public abstract class AS400Principal
extends java.lang.Object
implements java.security.Principal, java.io.Serializable
Typical IBM i system Principals include, but are not necessarily limited to, user profiles.
Constructor and Description |
---|
AS400Principal()
Constructs an AS400Principal object.
|
AS400Principal(AS400 system)
Constructs an AS400Principal object.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener.
|
void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds a VetoableChangeListener.
|
java.lang.String |
getName()
Returns the name commonly used to refer to the principal.
|
AS400 |
getSystem()
Returns the AS400 system object for the principal.
|
User |
getUser()
Returns an IBM i system User object based on the
user profile name and
system associated with
the principal.
|
java.lang.String |
getUserProfileName()
Returns the name of a user profile associated with
the thread when work is performed on
behalf of the principal.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the specified listener from the internal list.
|
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes the specified listener from the internal list.
|
void |
setSystem(AS400 system)
Sets the AS400 system object for the principal.
|
public AS400Principal()
public AS400Principal(AS400 system)
The system property is set to the specified value.
system
- The IBM i system associated with the principal.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
The specified listener's propertyChange method will be called each time the value of a bound property is changed.
listener
- The PropertyChangeListener.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
The specified listener's vetoableChange method will be called each time the value of a constrained property is changed.
listener
- The VetoableChangeListener.removeVetoableChangeListener(java.beans.VetoableChangeListener)
public java.lang.String getName()
Default behavior for the superclass is to return the user profile name
getName
in interface java.security.Principal
public AS400 getSystem()
public User getUser() throws AS400Exception, AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, ObjectDoesNotExistException, java.io.IOException, java.io.UnsupportedEncodingException
The system property must be set and a valid userProfileName must be identified by the principal prior to requesting the user.
ExtendedIllegalStateException
- If a required property is not set.AS400Exception
- If the IBM i system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the system object does not exist.java.io.UnsupportedEncodingException
- If the character encoding is not supported.public java.lang.String getUserProfileName()
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Does nothing if the listener is not in the list.
listener
- The PropertyChangeListener.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Does nothing if the listener is not in the list.
listener
- The VetoableChangeListener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void setSystem(AS400 system) throws java.beans.PropertyVetoException
system
- The AS400 system object.java.beans.PropertyVetoException
- If the change is vetoed.