Project JXTA

net.jxta.impl.membership
Class NullMembership

java.lang.Object
  |
  +--net.jxta.membership.Membership
        |
        +--net.jxta.impl.membership.NullMembership

public class NullMembership
extends net.jxta.membership.Membership

The null membership service provides a Membership implementation which is is intended to be used with peer groups which require no real authentication. The null service allows you to claim any identity within the peergroup, but for peergroups which use this Membership method, it is likely that the identity is used only for informational purposes.

Since:
JXTA 1.0

Inner Class Summary
 class NullMembership.NullAuthenticator
           
 
Constructor Summary
NullMembership()
           
 
Method Summary
 net.jxta.membership.Authenticator apply(net.jxta.credential.AuthenticationCredential application)
          Request the necessary credentials to join the group with which this service is associated.
 net.jxta.document.Advertisement getAdvertisement()
          Returns the advertisement for that service.
 java.util.Enumeration getAuthCredentials()
          Returns the current credentials for this peer.
 java.util.Enumeration getCurrentCredentials()
          Returns the current credential for this peer.
 net.jxta.service.Service getInterface()
          Service objects are not manipulated directly to protect usage of the service.
 net.jxta.peergroup.PeerGroup getPeerGroup()
           
 void init(net.jxta.peergroup.PeerGroup group, net.jxta.document.Advertisement sadv)
          Initialize the application
 net.jxta.credential.Credential join(net.jxta.membership.Authenticator authenticated)
          Join the group by virtue of the completed authentication provided.
 net.jxta.credential.Credential makeCredential(net.jxta.document.Element element)
          Given a fragment of a StructuredDocument, reconstruct a Credential object from that fragment.
 void resign()
          Leave the group to which this service is attached.
 int startApp(java.lang.String[] arg)
          Supply arguments and starts this service if it hadn't started by itself.
 void stopApp()
          Ask this service to stop.
 
Methods inherited from class net.jxta.membership.Membership
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullMembership

public NullMembership()
Method Detail

init

public void init(net.jxta.peergroup.PeerGroup group,
                 net.jxta.document.Advertisement sadv)
          throws net.jxta.exception.PeerGroupException
Initialize the application
Overrides:
init in class net.jxta.membership.Membership
Parameters:
group - PeerGroup this application is started from
Since:
JXTA 1.0

getInterface

public net.jxta.service.Service getInterface()
Service objects are not manipulated directly to protect usage of the service. A Service interface is returned to access the service methods.
Overrides:
getInterface in class net.jxta.membership.Membership
Returns:
Service public interface of the service
Since:
JXTA 1.0

startApp

public int startApp(java.lang.String[] arg)
Supply arguments and starts this service if it hadn't started by itself. Currently this service starts by itself and does not expect arguments.
Overrides:
startApp in class net.jxta.membership.Membership
Parameters:
arg - A table of strings arguments.
Returns:
int status indication.

stopApp

public void stopApp()
Ask this service to stop. This request is currently ignored.
Overrides:
stopApp in class net.jxta.membership.Membership

getPeerGroup

public net.jxta.peergroup.PeerGroup getPeerGroup()

getAdvertisement

public net.jxta.document.Advertisement getAdvertisement()
Returns the advertisement for that service.
Overrides:
getAdvertisement in class net.jxta.membership.Membership
Returns:
Advertisement the advertisement.
Since:
JXTA 1.0

apply

public net.jxta.membership.Authenticator apply(net.jxta.credential.AuthenticationCredential application)
                                        throws net.jxta.exception.PeerGroupException,
                                               net.jxta.exception.ProtocolNotSupportedException
Request the necessary credentials to join the group with which this service is associated.
Overrides:
apply in class net.jxta.membership.Membership
Parameters:
credential - the original credential that justify the issuance of the the appropriate authenticator
Returns:
PeerGroupCredential the desired credential
Throws:
net.jxta.exception.ProtocolNotSupportedException - if the authentication method requested in the application is not supported by this service.

getCurrentCredentials

public java.util.Enumeration getCurrentCredentials()
                                            throws net.jxta.exception.PeerGroupException
Returns the current credential for this peer.
Overrides:
getCurrentCredentials in class net.jxta.membership.Membership

getAuthCredentials

public java.util.Enumeration getAuthCredentials()
                                         throws net.jxta.exception.PeerGroupException
Returns the current credentials for this peer. The elements of the enumeration are all of types derived from "AuthenticationCredential"
Overrides:
getAuthCredentials in class net.jxta.membership.Membership

join

public net.jxta.credential.Credential join(net.jxta.membership.Authenticator authenticated)
                                    throws net.jxta.exception.PeerGroupException
Join the group by virtue of the completed authentication provided.
Overrides:
join in class net.jxta.membership.Membership
Parameters:
authenticated - the completed authentication.

resign

public void resign()
            throws net.jxta.exception.PeerGroupException
Leave the group to which this service is attached.
Overrides:
resign in class net.jxta.membership.Membership

makeCredential

public net.jxta.credential.Credential makeCredential(net.jxta.document.Element element)
                                              throws net.jxta.exception.PeerGroupException,
                                                     java.lang.Exception
Given a fragment of a StructuredDocument, reconstruct a Credential object from that fragment.
Overrides:
makeCredential in class net.jxta.membership.Membership
Parameters:
element - The StructuredDocument fragment to use for building the credential.
Returns:
Credential The created credential

Project JXTA