com.ibm.as400.security.auth
Class UserProfilePrincipal

java.lang.Object
  extended by com.ibm.as400.security.auth.AS400Principal
      extended by com.ibm.as400.security.auth.UserProfilePrincipal
All Implemented Interfaces:
AS400BasicAuthenticationPrincipal, Serializable, Principal

public class UserProfilePrincipal
extends AS400Principal
implements AS400BasicAuthenticationPrincipal

The UserProfilePrincipal class represents an IBM i system user profile.

See Also:
AS400Principal, Serialized Form

Constructor Summary
Constructor and Description
UserProfilePrincipal()
          Constructs a UserProfilePrincipal object.
UserProfilePrincipal(AS400 system, String name)
          Constructs a UserProfilePrincipal object.
UserProfilePrincipal(String name)
          Constructs a UserProfilePrincipal object with the principal name set to the supplied argument.
 
Method Summary
Modifier and Type Method and Description
 boolean equals(Object o)
          Compares the specified Object with the credential for equality.
 String getUserProfileName()
          Returns the user profile name.
 int hashCode()
          Returns a hash code for this principal.
 void initialize(String name)
          Initializes a principal for the local IBM i system based on the given user profile name.
 void setUserProfileName(String name)
          Sets the user profile name.
 String toString()
          Returns a string representation of the object
 
Methods inherited from class com.ibm.as400.security.auth.AS400Principal
addPropertyChangeListener, addVetoableChangeListener, getName, getSystem, getUser, removePropertyChangeListener, removeVetoableChangeListener, setSystem
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Principal
getName
 

Constructor Detail

UserProfilePrincipal

public UserProfilePrincipal()
Constructs a UserProfilePrincipal object.


UserProfilePrincipal

public UserProfilePrincipal(String name)
Constructs a UserProfilePrincipal object with the principal name set to the supplied argument.

Parameters:
name - The user profile name.

UserProfilePrincipal

public UserProfilePrincipal(AS400 system,
                            String name)
Constructs a UserProfilePrincipal object.

The system and name properties are set to the specified values.

Parameters:
system - The system associated with the principal.
name - The user profile name.
Method Detail

equals

public boolean equals(Object o)
Compares the specified Object with the credential for equality.

Specified by:
equals in interface Principal
Overrides:
equals in class Object
Parameters:
o - Object to be compared for equality.
Returns:
true if equal; otherwise false.

getUserProfileName

public String getUserProfileName()
Returns the user profile name.

Specified by:
getUserProfileName in interface AS400BasicAuthenticationPrincipal
Overrides:
getUserProfileName in class AS400Principal
Returns:
A String containing the name; empty if not assigned.

hashCode

public int hashCode()
Returns a hash code for this principal.

Specified by:
hashCode in interface Principal
Overrides:
hashCode in class Object
Returns:
a hash code for this principal.

initialize

public void initialize(String name)
                throws Exception
Initializes a principal for the local IBM i system based on the given user profile name.

Specified by:
initialize in interface AS400BasicAuthenticationPrincipal
Parameters:
name - The profile name.
Throws:
Exception - If an exception occurs.

setUserProfileName

public void setUserProfileName(String name)
                        throws PropertyVetoException
Sets the user profile name.

Parameters:
name - The profile name.
Throws:
PropertyVetoException - If the change is vetoed.
ExtendedIllegalArgumentException - If the provided value exceeds the maximum allowed length or contains non-valid characters.

toString

public String toString()
Returns a string representation of the object

Specified by:
toString in interface Principal
Overrides:
toString in class Object
Returns:
a string representation of the object.