com.novell.service.security
Class NdsIdentity

java.lang.Object
  |
  +--com.novell.java.security.Identity
        |
        +--com.novell.service.security.XplatIdentity
              |
              +--com.novell.service.security.NdsIdentity

public class NdsIdentity
extends XplatIdentity
implements PasswordIdentityFactory

Represents an authenticatable entity in NDS, such as a user, an administrator, and so forth. Every NdsIdentity is associated with an identity scope that is typically an NDS context. The NDS context is in turn, associated with an NDS tree, which, is then associated with the NDS administrative domain scope. The tree domain scope is a child of the administrative domain scope. The context domain scope is a child of the tree domain scope. There may be many context domain scopes. A user identity is a child of the context domain scope.

For example, to construct a user named Karah in a subcontext called Java in a context called Engineering in an NDS tree called KARAH_CORP you can do the following:

 IdentityScope administrativeDomain  = new NdsIdentityScope();
 IdentityScope tree                  = new NdsIdentityScope("KARAH_CORP",administrativeDomain);
 IdentityScope context               = new NdsIdentityScope("Engineering",tree);
 IdentityScope subcontext            = new NdsIdentityScope("Java",context);
 Identity      user                  = new NdsIdentity("Karah",subcontext);
 

See Also:
NdsIdentityScope, BinderyIdentity

Constructor Summary
NdsIdentity(Identity identity)
          Constructs an identity from another specified identity.
NdsIdentity(java.lang.String name)
          Construct an identity with the specified user name and no scope.
NdsIdentity(java.lang.String name, IdentityScope scope)
          Construct an identity with the specified user name as a String and scope as an IdentityScope.
NdsIdentity(java.lang.String name, java.lang.String scope)
          Construct an identity with the specified user name and scope as Strings.
 
Method Summary
 java.lang.String getAdministrativeDomain()
          Get the administrative domain string.
 PasswordIdentity getPasswordIdentityInstance()
          Instantiate a password identity class.
 java.lang.String getUserDomain()
          Returns the user domain as a String.
 java.lang.String getUsername()
          Return the user name.
 
Methods inherited from class com.novell.service.security.XplatIdentity
getSession, getSessionManager, setSession, setSessionManager
 
Methods inherited from class com.novell.java.security.Identity
addCertificate, equals, getCertificates, getInfo, getName, getPublicKey, getScope, hashCode, removeCertificate, setInfo, setPublicKey, toString, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NdsIdentity

public NdsIdentity(java.lang.String name)
Construct an identity with the specified user name and no scope.
Parameters:
name - The user name of the identity.

NdsIdentity

public NdsIdentity(java.lang.String name,
                   java.lang.String scope)
            throws KeyManagementException
Construct an identity with the specified user name and scope as Strings.
Parameters:
name - The user name of the identity.
scope - The scope of the identity (the domain).
Throws:
KeyManagementException - When an error occurs.

NdsIdentity

public NdsIdentity(java.lang.String name,
                   IdentityScope scope)
            throws KeyManagementException
Construct an identity with the specified user name as a String and scope as an IdentityScope.
Parameters:
name - The user name of the identity.
scope - The scope of the identity (the domain).
Throws:
KeyManagementException - When an error occurs.

NdsIdentity

public NdsIdentity(Identity identity)
            throws KeyManagementException
Constructs an identity from another specified identity.

The name and parent scope are copied from the existing identity. If the identity is an XplatIdentity, the session and session manager are also copied. If the identity is an NDS identity, its context handle is also copied.

Parameters:
identity - The identity to copy.
Throws:
KeyManagementException - When an error occurs.
Method Detail

getAdministrativeDomain

public java.lang.String getAdministrativeDomain()
Get the administrative domain string.
Returns:
The administrative domain identifier, "[NDS]".
Overrides:
getAdministrativeDomain in class XplatIdentity

getUsername

public java.lang.String getUsername()
Return the user name.
Returns:
The String name of the user domain.
Overrides:
getUsername in class XplatIdentity

getUserDomain

public java.lang.String getUserDomain()
Returns the user domain as a String.
Returns:
The String containing the user domain.
Overrides:
getUserDomain in class XplatIdentity

getPasswordIdentityInstance

public PasswordIdentity getPasswordIdentityInstance()
Instantiate a password identity class.
Specified by:
getPasswordIdentityInstance in interface PasswordIdentityFactory
Returns:
The appropriate PasswordIdentity.