com.ibm.as400.security.auth

Class AS400Principal

  • java.lang.Object
    • com.ibm.as400.security.auth.AS400Principal
  • All Implemented Interfaces:
    java.io.Serializable, java.security.Principal
    Direct Known Subclasses:
    UserProfilePrincipal


    public abstract class AS400Principal
    extends java.lang.Object
    implements java.security.Principal, java.io.Serializable
    The AS400Principal class provides an abstract superclass for representations of IBM i system security-related identities.

    Typical IBM i system Principals include, but are not necessarily limited to, user profiles.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      AS400Principal()
      Constructs an AS400Principal object.
      AS400Principal(AS400 system)
      Constructs an AS400Principal object.
    • Method Summary

      Methods 
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.security.Principal

        equals, hashCode, toString
    • Constructor Detail

      • AS400Principal

        public AS400Principal()
        Constructs an AS400Principal object.
      • AS400Principal

        public AS400Principal(AS400 system)
        Constructs an AS400Principal object.

        The system property is set to the specified value.

        Parameters:
        system - The IBM i system associated with the principal.
    • Method Detail

      • addPropertyChangeListener

        public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
        Adds a PropertyChangeListener.

        The specified listener's propertyChange method will be called each time the value of a bound property is changed.

        Parameters:
        listener - The PropertyChangeListener.
        See Also:
        removePropertyChangeListener(java.beans.PropertyChangeListener)
      • addVetoableChangeListener

        public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
        Adds a VetoableChangeListener.

        The specified listener's vetoableChange method will be called each time the value of a constrained property is changed.

        Parameters:
        listener - The VetoableChangeListener.
        See Also:
        removeVetoableChangeListener(java.beans.VetoableChangeListener)
      • getName

        public java.lang.String getName()
        Returns the name commonly used to refer to the principal.

        Default behavior for the superclass is to return the user profile name

        Specified by:
        getName in interface java.security.Principal
        Returns:
        The principal's name.
      • getSystem

        public AS400 getSystem()
        Returns the AS400 system object for the principal.
        Returns:
        The AS400 system for the principal; null if not assigned.
      • getUserProfileName

        public java.lang.String getUserProfileName()
        Returns the name of a user profile associated with the thread when work is performed on behalf of the principal.
        Returns:
        A String containing the name; empty if not applicable.
      • removePropertyChangeListener

        public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
        Removes the specified listener from the internal list.

        Does nothing if the listener is not in the list.

        Parameters:
        listener - The PropertyChangeListener.
        See Also:
        addPropertyChangeListener(java.beans.PropertyChangeListener)
      • removeVetoableChangeListener

        public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
        Removes the specified listener from the internal list.

        Does nothing if the listener is not in the list.

        Parameters:
        listener - The VetoableChangeListener.
        See Also:
        addVetoableChangeListener(java.beans.VetoableChangeListener)
      • setSystem

        public void setSystem(AS400 system)
                       throws java.beans.PropertyVetoException
        Sets the AS400 system object for the principal.
        Parameters:
        system - The AS400 system object.
        Throws:
        java.beans.PropertyVetoException - If the change is vetoed.