|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.membership.none.NoneMembershipService
public class NoneMembershipService
A Membership Service implementation which is intended to be used with peer groups which require no real authentication.
The none service allows you to claim any identity within the peergroup, but for peergroups which use this Membership Service method, it is likely that the identity is used only for informational purposes. A default credential with the name "nobody" is automatically available without requiring authentication by this service.
Nested Class Summary | |
---|---|
static class |
NoneMembershipService.NoneAuthenticator
Authenticator Class for the None Membership Service. |
Field Summary |
---|
Fields inherited from interface net.jxta.membership.MembershipService |
---|
ADD_CREDENTIAL_PROPERTY, DEFAULT_CREDENTIAL_PROPERTY |
Fields inherited from interface net.jxta.platform.Module |
---|
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_DISABLED, START_OK |
Constructor Summary | |
---|---|
NoneMembershipService()
default constructor. |
Method Summary | |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a listener |
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Add a listener |
Authenticator |
apply(AuthenticationCredential application)
Request the necessary credentials to join the group with which this service is associated. |
Enumeration<AuthenticationCredential> |
getAuthCredentials()
Returns the authentication credentials which were used to establish the current identities. |
Enumeration<Credential> |
getCurrentCredentials()
Returns the current credentials for this peer. |
Credential |
getDefaultCredential()
Returns the default credential for this peer. |
Advertisement |
getImplAdvertisement()
Returns the advertisement for this service. |
Service |
getInterface()
Service objects are not manipulated directly to protect usage of the service. |
void |
init(PeerGroup group,
ID assignedID,
Advertisement impl)
Initialize the module, passing it its peer group and advertisement. |
Credential |
join(Authenticator authenticated)
Join the group by virtue of the completed authentication provided. |
Credential |
makeCredential(Element element)
Given a fragment of a StructuredDocument, reconstruct a Credential object from that fragment. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Remove a listener |
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Remove a listener |
void |
resign()
Resign all credentials which were previously gained through prior join() operations. |
int |
startApp(String[] arg)
Complete any remaining initialization of the module. |
void |
stopApp()
Stop a module. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NoneMembershipService() throws PeerGroupException
PeerGroupException
Method Detail |
---|
public void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
in interface MembershipService
listener
- the listenerpublic void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
addPropertyChangeListener
in interface MembershipService
propertyName
- the property to watchlistener
- the listenerpublic void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener
in interface MembershipService
listener
- the listenerpublic void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
removePropertyChangeListener
in interface MembershipService
propertyName
- the property which was watchedlistener
- the listenerpublic void init(PeerGroup group, ID assignedID, Advertisement impl) throws PeerGroupException
init
in interface Module
group
- The PeerGroup from which this Module can obtain services.
If this module is a Service, this is also the PeerGroup of which this
module is a service.assignedID
- Identity of Module within group.
modules can use it as a the root of their namespace to create
names that are unique within the group but predictable by the
same module on another peer. This is normally the ModuleClassID
which is also the name under which the module is known by other
modules. For a group it is the PeerGroupID itself.
The parameters of a service, in the Peer configuration, are indexed
by the assignedID of that service, and a Service must publish its
run-time parameters in the Peer Advertisement under its assigned ID.impl
- The implementation advertisement for this
Module. It is permissible to pass null if no implementation
advertisement is available. This may happen if the
implementation was selected by explicit class name rather than
by following an implementation advertisement. Modules are not
required to support that style of loading, but if they do, then
their documentation should mention it.
PeerGroupException
- This module failed to initialize.public Service getInterface()
getInterface
in interface Service
public int startApp(String[] arg)
startApp()
is completed. That is
also the opportunity to supply arbitrary arguments (mostly to
applications).
If this module is a PeerGroup
service, it may be invoked
several times depending on its return value.
startApp
in interface Module
arg
- An array of Strings forming the parameters for this
Module.
Module.START_OK
, Module.START_AGAIN_PROGRESS
,
Module.START_AGAIN_STALLED
, which indicates partial or complete
success, or any other value (negative values are
recommended for future compatibility), which indicates failure.public void stopApp()
init()
completes and should not assume that startApp()
has been
called or completed.
The Module cannot be forced to comply, but in the future
we might be able to deny it access to anything after some timeout.
stopApp
in interface Module
public Advertisement getImplAdvertisement()
getImplAdvertisement
in interface Service
ModuleImplAdvertisement
.public Authenticator apply(AuthenticationCredential application) throws PeerGroupException, ProtocolNotSupportedException
apply
in interface MembershipService
application
- The authentication Credential associated with this
membership application. See
AuthenticationCredential
for more information.
PeerGroupException
- Thrown in the event of errors.
ProtocolNotSupportedException
- if the authentication method requested
in the application is not supported by this service.public Credential getDefaultCredential()
getDefaultCredential
in interface MembershipService
null
if there is no
current default.public Enumeration<Credential> getCurrentCredentials()
getCurrentCredentials
in interface MembershipService
public Enumeration<AuthenticationCredential> getAuthCredentials()
getAuthCredentials
in interface MembershipService
public Credential join(Authenticator authenticated) throws PeerGroupException
join
in interface MembershipService
authenticated
- the completed authentication.
PeerGroupException
- Thrown in the event of errors.public void resign()
join()
operations.
resign
in interface MembershipService
public Credential makeCredential(Element element) throws PeerGroupException, Exception
makeCredential
in interface MembershipService
element
- The StructuredDocument fragment to use for building the
credential.
PeerGroupException
- Thrown in the event of errors.
Exception
- Thrown in the event of errors.
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |