net.jxta.membership
Class Membership
java.lang.Object
|
+--net.jxta.membership.Membership
- All Implemented Interfaces:
- Application, Service
- public abstract class Membership
- extends java.lang.Object
- implements Service
The membership policy allows a peer to establish an identity within a peer
group. Once an identity has been a established a credential is available
which allows the peer to prove that it rightfully has that identity.
Identities are used to services to determine the capabilities which should
be offered to peers.
When a peer group is instantiated on a peer the membership policy for that
peer group establishes a default temporary identity for the peer within the
peergroup. This identity, by convention, only allows the peer to establish
their true identity.
The sequence for establishing an indentity for a peer within a peer group
is as follows:
Apply : The peer provides the membership policy an initial credential which
may be used by the policy to determine which method of authentication
is to be used to establish the identity of this peer. If the policy
allows authentication using the requested mechanism then an
appropriate authenticator object is returned.
The peer group instance is assumsed to know how to interact with the
authentication object (remember that it requested the authentication
method earlier in the apply process).
Join : The completed authenticator is returned to the Membership policy and
the identity of this peer is adjusted based on the new credential
available from the authenticator. Until the "Join" is completed the
indentity of the peer remains as it was.
Resign : Whatever existing identity that is established for this peer is
discarded and the current identity reverts to the "nobody" identity.
There is also the question of the duration of validity of the Credential
objects returned.
- Since:
- JXTA 1.0
Method Summary |
abstract Authenticator |
apply(AuthenticationCredential application)
Request the necessary credentials to join the group with which this
policy is associated. |
abstract java.util.Enumeration |
getAuthCredentials()
Returns the current credentials for this peer. |
abstract java.util.Enumeration |
getCurrentCredentials()
Returns the current credentials for this peer. |
Service |
getInterface()
Policy objects are not manipulated directly to protect usage
of the policy. |
java.lang.String |
getName()
Returns the name of the associated policy. |
abstract Credential |
join(Authenticator authenticated)
Join the group by virtue of the completed authentication provided. |
abstract Credential |
makeCredential(Element element)
Given a fragment of a StructuredDocument, reconstruct a Credential object
from that fragment. |
abstract void |
resign()
Leave the group to which this policy is attached. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Membership
public Membership()
getName
public final java.lang.String getName()
- Returns the name of the associated policy. Each policy has a unique
name.
- Returns:
- String the name of this policy.
getInterface
public Service getInterface()
- Policy objects are not manipulated directly to protect usage
of the policy. A Policy interface is returned to access the policy
methods.
- Specified by:
getInterface
in interface Service
- Returns:
- Policy public interface of the policy
apply
public abstract Authenticator apply(AuthenticationCredential application)
throws PeerGroupException,
ProtocolNotSupportedException
- Request the necessary credentials to join the group with which this
policy is associated.
- Parameters:
application
- The authenticationCredential associated with this
membership application. See
AuthenticationCredential
for more information.- Returns:
- PeerGroupCredential the desired credential
- Throws:
PeerGroupException
- Thrown in the event of errors. This exception spec is currently a placeholder
and needs to be narrowed.ProtocolNotSupportedException
- if the authentication method requested
in the application is not supported by this policy.
join
public abstract Credential join(Authenticator authenticated)
throws PeerGroupException
- Join the group by virtue of the completed authentication provided.
- Parameters:
authenticated
- the completed authentication.- Returns:
- Credential the credential for this completed authentication.
- Throws:
PeerGroupException
- Thrown in the event of errors. This exception spec is currently a placeholder
and needs to be narrowed.
resign
public abstract void resign()
throws PeerGroupException
- Leave the group to which this policy is attached.
- Throws:
PeerGroupException
- Thrown in the event of errors. This exception spec is currently a placeholder
and needs to be narrowed.
getCurrentCredentials
public abstract java.util.Enumeration getCurrentCredentials()
throws PeerGroupException
- Returns the current credentials for this peer. The elements of the
enumeration are all of types derived from "Credential"
- Returns:
- Enumeration of the Credentials currently associated with this peer for this peergroup
- Throws:
PeerGroupException
- Thrown in the event of errors. This exception spec is currently a placeholder
and needs to be narrowed.
getAuthCredentials
public abstract java.util.Enumeration getAuthCredentials()
throws PeerGroupException
- Returns the current credentials for this peer. The elements of the
enumeration are all of types derived from "AuthenticationCredential"
- Returns:
- Enumeration of the AuthenticatioCredentials which were used to establish the current
identities.
- Throws:
PeerGroupException
- Thrown in the event of errors. This exception spec is currently a placeholder
and needs to be narrowed.
makeCredential
public abstract Credential makeCredential(Element element)
throws PeerGroupException,
java.lang.Exception
- Given a fragment of a StructuredDocument, reconstruct a Credential object
from that fragment.
- Parameters:
element
- The StructuredDocument fragment to use for building the
credential.- Returns:
- Credential The created credential
- Throws:
PeerGroupException
- Thrown in the event of errors. This exception spec is currently a placeholder
and needs to be narrowed.java.lang.Exception
- Thrown in the event of errors. This exception spec is currently a placeholder
and needs to be narrowed.