Package wt.org

Class WTPrincipalReference

java.lang.Object
wt.fc._ObjectReference
wt.fc.ObjectReference
wt.org._WTPrincipalReference
wt.org.WTPrincipalReference
All Implemented Interfaces:
Externalizable, Serializable, wt.fc._NetFactor, wt.fc._ObjectMappable, _WTReference, NetFactor, ObjectMappable, WTReference, Evolvable

@GenAsObjectMappable(superClass=ObjectReference.class,versions=6273535935738757412L,properties={@GeneratedProperty(name="EMail",type=java.lang.String.class,javaDoc="Non-persistent attribute that is filled in by the inflate in the query results thru the cached object.",accessors=@PropertyAccessors(setAccess=PRIVATE),columnProperties=@ColumnProperties(persistent=false)),@GeneratedProperty(name="name",type=java.lang.String.class,javaDoc="Non-persistent attribute that is filled in by the inflate in the query results thru the cached object.",accessors=@PropertyAccessors(setAccess=PRIVATE),columnProperties=@ColumnProperties(persistent=false)),@GeneratedProperty(name="fullName",type=java.lang.String.class,javaDoc="Non-persistent attribute that is filled in by the inflate in the query results thru the cached object.",accessors=@PropertyAccessors(setAccess=PRIVATE),columnProperties=@ColumnProperties(persistent=false)),@GeneratedProperty(name="disabled",type=boolean.class,initialValue="false",accessors=@PropertyAccessors(setAccess=PRIVATE),columnProperties=@ColumnProperties(persistent=false)),@GeneratedProperty(name="dn",type=java.lang.String.class,accessors=@PropertyAccessors(setAccess=PRIVATE),columnProperties=@ColumnProperties(persistent=false)),@GeneratedProperty(name="repository",type=java.lang.String.class,accessors=@PropertyAccessors(setAccess=PRIVATE),columnProperties=@ColumnProperties(persistent=false)),@GeneratedProperty(name="object",type=WTPrincipal.class,concrete=false,accessors=@PropertyAccessors(getAccess=PRIVATE,setExceptions={}),constraints=@PropertyConstraints(required=false),columnProperties=@ColumnProperties(persistent=false))}) public class WTPrincipalReference extends wt.org._WTPrincipalReference
Reference to a principal object.

Use the newWTPrincipalReference static factory method(s), not the WTPrincipalReference constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: false

See Also:
  • Method Details

    • newWTPrincipalReference

      public static WTPrincipalReference newWTPrincipalReference() throws WTException


      Supported API: true
      Returns:
      WTPrincipalReference
      Throws:
      WTException
    • newWTPrincipalReference

      public static WTPrincipalReference newWTPrincipalReference(WTPrincipal principal) throws WTException
      Creates reference given a principal.

      Supported API: true
      Parameters:
      principal -
      Returns:
      WTPrincipalReference
      Throws:
      WTException
    • initialize

      protected void initialize(WTPrincipal principal) throws WTException
      Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

      Supported API: true
      Parameters:
      principal -
      Throws:
      WTException
    • newWTPrincipalReference

      public static WTPrincipalReference newWTPrincipalReference(WTPrincipalReference principalReference) throws WTException
      Creates reference given a principal reference.

      Supported API: true
      Parameters:
      principalReference -
      Returns:
      WTPrincipalReference
      Throws:
      WTException
    • initialize

      protected void initialize(WTPrincipalReference principalReference) throws WTException
      Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

      Supported API: true
      Parameters:
      principalReference -
      Throws:
      WTException
    • newWTPrincipalReference

      public static WTPrincipalReference newWTPrincipalReference(ObjectIdentifier id) throws WTException
      Constructs a principal out of its database identifier. Used by externalizable classes to store the reference persistently in the most compact way possible.

      Supported API: true
      Parameters:
      id -
      Returns:
      WTPrincipalReference
      Throws:
      WTException
    • initialize

      protected void initialize(ObjectIdentifier id) throws WTException
      Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

      Supported API: true
      Overrides:
      initialize in class ObjectReference
      Parameters:
      id -
      Throws:
      WTException
    • newWTPrincipalReference

      public static WTPrincipalReference newWTPrincipalReference(String dn, String repository) throws WTException
      Constructs a principal reference from a directory distinguished name and the name of the directory repository that holds the entry specified by the distinguished name.

      Supported API: true
      Parameters:
      dn -
      repository -
      Returns:
      WTPrincipalReference
      Throws:
      WTException
    • initialize

      protected void initialize(String dn, String repository) throws WTException
      Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

      Supported API: true
      Parameters:
      dn -
      repository -
      Throws:
      WTException
    • getDisplayName

      public String getDisplayName() throws WTException
      Returns a name for the principal. Certain usage-specific behavioral nuances apply when it comes to individual principal types (see details below). Therefore, this API may not be best-suited if the name is intended for display in UI. For such cases, see getUniqueDisplayIdentifier().

      While there are many attributes needed to make a principal uniquely identifiable, all those attributes are not included in the name returned by this API. If indeed a unique display identity is what is required, use getUniqueDisplayIdentifier()

      The name returned is determined by the type of principal the reference is for:
      • Pseudo-roles ALL or OWNER: Returns the value in Session locale corresponding to these names (for example: "All" or "Owner")
      • User: Returns the user's full name
      • External/user-defined group: Returns the group's name
      • Internal/system group such as role group or internal organization group: Returns the name of the group as-is with no localization is applied (for example: "teamMembers", "GUEST", etc.)
      • Role Principal: Returns the localized name of the role in Session locale. For example: "Team Members", "Guest", etc.
      • Organization: Returns the organization's name
      • All other cases, including internal/system group: Returns the principal's name as-is
      If the session user does not have access to the principal, the wt.access.accessResource.SECURED_INFORMATION message is returned instead. The same message may be displayed in the place of organization name, within the returned identifier, if the session user does not have access to the organization.

      Supported API: true
      Returns:
      String - Display name based on the above specifications
      Throws:
      WTException
    • getPrincipal

      public WTPrincipal getPrincipal() throws WTException
      Returns principal referenced by object.

      Supported API: true
      Returns:
      WTPrincipal
      Throws:
      WTException
    • getIdentity

      public String getIdentity()
      Return the principal's name as its identity.

      Supported API: true
      Returns:
      String
    • refresh

      public void refresh() throws WTException
      Refresh the WTPrincipalReference using the OrganizationService's principal cache.

      Supported API: true
      Specified by:
      refresh in interface WTReference
      Overrides:
      refresh in class ObjectReference
      Throws:
      WTException
    • toString

      public String toString()
      Returns string representation of the reference.

      Supported API: true
      Overrides:
      toString in class ObjectReference
      Returns:
      String
    • getUniqueDisplayIdentifier

      public String getUniqueDisplayIdentifier() throws WTException
      Returns a unique, display-friendly identifier for the principal reference. Labels and internal representations are localized using session locale.
      The value returned is determined by the type of principal the reference is for:

      If the session user does not have access to the principal, the wt.access.accessResource.SECURED_INFORMATION message is returned instead. The same message may be displayed in the place of organization name, within the returned identifier, if the session user does not have access to the organization.

      Supported API: true
      Returns:
      String - Unique display identifier generated based on the above specifications
      Throws:
      WTException