Project JXTA

net.jxta.credential
Class AuthenticationCredential

java.lang.Object
  |
  +--net.jxta.credential.AuthenticationCredential
All Implemented Interfaces:
Credential

public final class AuthenticationCredential
extends java.lang.Object
implements Credential

Authenication credentials are used by the JXTA Membership services as the basis for applications for peergroup membership. The AuthenticationCredential provides two important pieces of inforamtion, the authetication method being requested and the identity information which will be provided to that authentation method. Not all authentication methods use the identity information.

Since:
JXTA 1.0

Constructor Summary
AuthenticationCredential(PeerGroup peergroup, java.lang.String method, Element indentityInfo)
          Creates new AuthenticationCredential
 
Method Summary
 StructuredDocument getDocument(MimeMediaType as)
          Write credential into a document.
 Element getIdentityInfo()
          Returns the StructuredDocument Element containing the identity information which was originally provided when this AuthenticationCredential was created.
 java.lang.String getMethod()
          Returns the AuthenticationMethod which this AuthenticationCredential will be requesting when it is provided to a Membership service during the Apply operation.
 PeerGroupID getPeerGroupID()
          Returns the PeerGroupID associated with this AuthenticationCredential.
 PeerID getPeerID()
          Returns the PeerID associated with this AuthenticationCredential.
 Membership getSourceService()
          Always reutrns null since this type of credential is not associated with a particular membership service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticationCredential

public AuthenticationCredential(PeerGroup peergroup,
                                java.lang.String method,
                                Element indentityInfo)
Creates new AuthenticationCredential
Parameters:
peergroup - The peergroup context in which this AuthenticationCredential is created.
method - The authentication method which will be requested when the AuthentiationCredential is provided to the peergroup Membership Service.
indentityInfo - Optional additional information about the identity being requested which is used by the authentication method. This information is passed to the authentication method during the apply operation of the Membership Service.
Method Detail

getSourceService

public Membership getSourceService()
Always reutrns null since this type of credential is not associated with a particular membership service.
Specified by:
getSourceService in interface Credential
Returns:
null because this type of credential is not associated with any membership service.

getPeerGroupID

public PeerGroupID getPeerGroupID()
Returns the PeerGroupID associated with this AuthenticationCredential. AuthenticationCredentials are created in the context of a PeerGroup though they are generally independant of peergroups. The intent is that the AuthenticationCredential will be passed to the Membership service of the same peergroup as the AuthenticationCredenitals.
Specified by:
getPeerGroupID in interface Credential
Returns:
PeerGroupID associated with this AuthenticationCredential.

getPeerID

public PeerID getPeerID()
Returns the PeerID associated with this AuthenticationCredential.
Specified by:
getPeerID in interface Credential
Returns:
PeerID associated with this AuthenticationCredential.

getMethod

public java.lang.String getMethod()
Returns the AuthenticationMethod which this AuthenticationCredential will be requesting when it is provided to a Membership service during the Apply operation.
Returns:
String containing the authentication methdod being requested.

getIdentityInfo

public Element getIdentityInfo()
Returns the StructuredDocument Element containing the identity information which was originally provided when this AuthenticationCredential was created.
Returns:
StructuredDocument Element containing the identity information which was originally provided when this AuthenticationCredential was created.

getDocument

public StructuredDocument getDocument(MimeMediaType as)
                               throws java.lang.Exception
Write credential into a document. as is a mime media-type specification and provides the form of the document which is being requested. Two standard document forms are defined. "text/text" encodes the document in a form nice for printing out and "text/xml" which provides an XML format.
Specified by:
getDocument in interface Credential
Parameters:
as - The mime media type of the encoding format being requested.
Returns:
the StructuredDocument which represents this credential.
Throws:
java.lang.Exception - When errors occur.

Project JXTA