wt.org
Class WTPrincipal

java.lang.Object
  extended bywt.fc.WTObject
      extended bywt.fc.Item
          extended bywt.org.WTPrincipal
All Implemented Interfaces:
AccessControlled, BusinessInformation, DisplayIdentification, DomainAdministered, Externalizable, Federatable, NetFactor, ObjectMappable, Persistable, Principal, RecentlyVisited, RemotelyLinkable, Serializable
Direct Known Subclasses:
WTGroup, WTUser

public abstract class WTPrincipal
extends Item
implements BusinessInformation, Federatable, Principal, RecentlyVisited, Externalizable

Abstract class that represents a user or a group of users.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
static String ALL
          String by which the pseudo group"ALL" may be referred to.
private static String CLASSNAME
           
private  boolean disabled
           
static String DISABLED
          Label for the attribute.
private  String dn
           
static String DN
          Label for the attribute.
static long EXTERNALIZATION_VERSION_UID
           
private  FederatableInfo federatableInfo
           
private  int hash
           
private  boolean inflated
           
protected static String INFLATED
          Label for the attribute.
private  String name
           
static String NAME
          Label for the attribute; Name of the principal (user, group, or organization).
private static int NAME_UPPER_LIMIT
           
protected static long OLD_FORMAT_VERSION_UID
           
static String OWNER
          String by which the OWNER may be referred to.
static String REPAIR_NEEDED
          Label for the attribute.
private  boolean repairNeeded
           
private  String repository
           
static String REPOSITORY
          Label for the attribute.
private static String RESOURCE
           
(package private) static long serialVersionUID
           
 
Fields inherited from class wt.fc.Item
VERSION_40_UID, VERSION_51_UID
 
Fields inherited from class wt.fc.WTObject
CREATE_TIMESTAMP, MODIFY_TIMESTAMP
 
Fields inherited from interface wt.fc.BusinessInformation
BUSINESS_TYPE, IDENTITY
 
Fields inherited from interface wt.ufid.Federatable
FEDERATABLE_INFO
 
Fields inherited from interface wt.fc.Persistable
IDENTITY, PERSIST_INFO, TYPE
 
Fields inherited from interface wt.admin.DomainAdministered
DOMAIN_REF, INHERITED_DOMAIN
 
Fields inherited from interface wt.identity.DisplayIdentification
DISPLAY_IDENTIFIER, DISPLAY_IDENTITY, DISPLAY_TYPE
 
Constructor Summary
WTPrincipal()
           
 
Method Summary
protected  String _mangleName()
           
protected  void _setDisabled(boolean disabled)
           
protected  String _unmangleName()
           
protected abstract  void copyAttributes(WTPrincipal target)
          

Supported API: false
 boolean equals(Object obj)
          Determines if the current principal is equal to the one passed as argument.
private  void federatableInfoValidate(FederatableInfo a_FederatableInfo)
           
abstract  HashMap getAttributeMap(String service)
          

Supported API: false
 String getBusinessType()
          Deprecated. Replaced by IdentityFactory.getDispayType(object) to return a localizable equivalent of getBusinessType(). Another alternative is ((WTObject)obj).getDisplayType().
 String getDn()
          Gets the value of the attribute: DN.
protected  String getDn(boolean inflate)
          

Supported API: false
 FederatableInfo getFederatableInfo()
          Gets the object for the association that plays role: FEDERATABLE_INFO.
abstract  HashMap getFieldValueMap()
          

Supported API: false
 IdentificationObject getIdentificationObject()
          Deprecated.  
 String getIdentity()
          Deprecated.  
 String getName()
          Gets the value of the attribute: NAME.
 WTOrganization getOrganization()
          

Supported API: false
 String getRepository()
          Gets the value of the attribute: REPOSITORY.
protected  String getRepository(boolean inflate)
          

Supported API: false
 int hashCode()
          returns the hash code for users and groups.
protected  WTPrincipal inflate()
           
protected  void initialize()
          

Supported API: false
protected  void initialize(String service)
           
 boolean isDefaultDomain()
          Indicates whether or not the domain currently assigned to the instance is the default domain for principals of the instance's class.
 boolean isDisabled()
          Gets the value of the attribute: DISABLED.
protected  boolean isInflated()
          Gets the value of the attribute: INFLATED.
 boolean isRepairNeeded()
          Gets the value of the attribute: REPAIR_NEEDED.
abstract  void mapAttributes(HashMap attributes)
          

Supported API: false
private  void nameValidate(String a_Name)
           
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
 void readExternal(PersistentRetrieveIfc input)
          Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(WTPrincipal thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void setDisabled(boolean a_Disabled)
          Sets the value of the attribute: DISABLED.
 void setDn(String a_Dn)
          Sets the value of the attribute: DN.
 void setDn(String dn, boolean inflate)
           
 void setFederatableInfo(FederatableInfo a_FederatableInfo)
          Sets the object for the association that plays role: FEDERATABLE_INFO.
protected  void setInflated(boolean a_Inflated)
          Sets the value of the attribute: INFLATED.
 void setName(String a_Name)
          Sets the value of the attribute: NAME.
 void setRepairNeeded(boolean a_RepairNeeded)
          Sets the value of the attribute: REPAIR_NEEDED.
 void setRepository(String a_Repository)
          Sets the value of the attribute: REPOSITORY.
 void setRepository(String repository, boolean inflate)
           
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 void writeExternal(PersistentStoreIfc output)
          Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.
 
Methods inherited from class wt.fc.Item
getDomainRef, isInheritedDomain, readVersion, setDomainRef, setInheritedDomain
 
Methods inherited from class wt.fc.WTObject
checkAttributes, duplicate, finalize, getClassInfo, getCreateTimestamp, getDisplayIdentifier, getDisplayIdentity, getDisplayType, getModifyTimestamp, getPersistInfo, getType, readVersion, setPersistInfo, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wt.fc.Persistable
checkAttributes, getPersistInfo, getType, setPersistInfo
 
Methods inherited from interface wt.fc.NetFactor
getClassInfo, getConceptualClassname
 
Methods inherited from interface java.security.Principal
toString
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

NAME

public static final String NAME
Label for the attribute; Name of the principal (user, group, or organization). This is a required attribute.

Supported API: false

See Also:
Constant Field Values

NAME_UPPER_LIMIT

private static int NAME_UPPER_LIMIT

name

private String name

OWNER

public static final String OWNER
String by which the OWNER may be referred to.

Supported API: false

See Also:
Constant Field Values

ALL

public static final String ALL
String by which the pseudo group"ALL" may be referred to.

Supported API: false

See Also:
Constant Field Values

DISABLED

public static final String DISABLED
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

disabled

private boolean disabled

DN

public static final String DN
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

dn

private String dn

REPOSITORY

public static final String REPOSITORY
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

repository

private String repository

REPAIR_NEEDED

public static final String REPAIR_NEEDED
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

repairNeeded

private boolean repairNeeded

INFLATED

protected static final String INFLATED
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

inflated

private boolean inflated

federatableInfo

private FederatableInfo federatableInfo

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

hash

private int hash
Constructor Detail

WTPrincipal

public WTPrincipal()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class Item
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class Item
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(WTPrincipal thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(PersistentStoreIfc output)
                   throws SQLException,
                          DatastoreException
Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
writeExternal in interface ObjectMappable
Overrides:
writeExternal in class Item
Parameters:
output -
Throws:
SQLException
DatastoreException

readExternal

public void readExternal(PersistentRetrieveIfc input)
                  throws SQLException,
                         DatastoreException
Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
readExternal in interface ObjectMappable
Overrides:
readExternal in class Item
Parameters:
input -
Throws:
SQLException
DatastoreException

getName

public String getName()
Gets the value of the attribute: NAME. Name of the principal (user, group, or organization). This is a required attribute.

Supported API: false

Specified by:
getName in interface Principal
Returns:
String

setName

public void setName(String a_Name)
             throws UserNotFoundException,
                    WTPropertyVetoException
Sets the value of the attribute: NAME. Name of the principal (user, group, or organization). This is a required attribute.

Supported API: false

Parameters:
a_Name -
Throws:
UserNotFoundException
WTPropertyVetoException

nameValidate

private void nameValidate(String a_Name)
                   throws WTPropertyVetoException
Parameters:
a_Name -
Throws:
WTPropertyVetoException

isDisabled

public boolean isDisabled()
Gets the value of the attribute: DISABLED.

Supported API: false

Returns:
boolean

setDisabled

public void setDisabled(boolean a_Disabled)
                 throws WTException,
                        WTPropertyVetoException
Sets the value of the attribute: DISABLED.

Supported API: false

Parameters:
a_Disabled -
Throws:
WTException
WTPropertyVetoException

getDn

public String getDn()
Gets the value of the attribute: DN.

Supported API: false

Returns:
String

setDn

public void setDn(String a_Dn)
Sets the value of the attribute: DN.

Supported API: false

Parameters:
a_Dn -

getRepository

public String getRepository()
Gets the value of the attribute: REPOSITORY.

Supported API: false

Returns:
String

setRepository

public void setRepository(String a_Repository)
Sets the value of the attribute: REPOSITORY.

Supported API: false

Parameters:
a_Repository -

isRepairNeeded

public boolean isRepairNeeded()
Gets the value of the attribute: REPAIR_NEEDED.

Supported API: false

Returns:
boolean

setRepairNeeded

public void setRepairNeeded(boolean a_RepairNeeded)
Sets the value of the attribute: REPAIR_NEEDED.

Supported API: false

Parameters:
a_RepairNeeded -

isInflated

protected boolean isInflated()
Gets the value of the attribute: INFLATED.

Supported API: false

Returns:
boolean

setInflated

protected void setInflated(boolean a_Inflated)
Sets the value of the attribute: INFLATED.

Supported API: false

Parameters:
a_Inflated -

hashCode

public int hashCode()
returns the hash code for users and groups. The hash code is based on the principal's name.

Supported API: false

Specified by:
hashCode in interface Principal
Overrides:
hashCode in class Item
Returns:
int

equals

public boolean equals(Object obj)
Determines if the current principal is equal to the one passed as argument. Two principals are considered equal if they have the same name.

Supported API: true

Specified by:
equals in interface Principal
Overrides:
equals in class Item
Parameters:
obj -
Returns:
boolean

getIdentity

public String getIdentity()
Deprecated.  

Returns the principal's name as its identity. This identity must be unique across all principals and administrative domains. Implements Identified.getIdentity.

Supported API: false

Specified by:
getIdentity in interface BusinessInformation
Overrides:
getIdentity in class WTObject
Returns:
String

getIdentificationObject

public IdentificationObject getIdentificationObject()
                                             throws WTException
Deprecated.  

Constructs and returns a PrincipalDomainIdentification for the purpose of identity checking. Imnplements Identified.getIdentificationObject.

Supported API: false

Returns:
IdentificationObject
Throws:
WTException

getOrganization

public WTOrganization getOrganization()
                               throws WTException


Supported API: false

Returns:
WTOrganization
Throws:
WTException

getAttributeMap

public abstract HashMap getAttributeMap(String service)
                                 throws WTException


Supported API: false

Parameters:
service -
Returns:
HashMap
Throws:
WTException

getFieldValueMap

public abstract HashMap getFieldValueMap()
                                  throws WTException


Supported API: false

Returns:
HashMap
Throws:
WTException

isDefaultDomain

public boolean isDefaultDomain()
                        throws WTException
Indicates whether or not the domain currently assigned to the instance is the default domain for principals of the instance's class.

Supported API: false

Returns:
boolean
Throws:
WTException

mapAttributes

public abstract void mapAttributes(HashMap attributes)
                            throws WTException,
                                   WTPropertyVetoException


Supported API: false

Parameters:
attributes -
Throws:
WTException
WTPropertyVetoException

copyAttributes

protected abstract void copyAttributes(WTPrincipal target)
                                throws WTException,
                                       WTPropertyVetoException


Supported API: false

Parameters:
target -
Throws:
WTException
WTPropertyVetoException

getDn

protected String getDn(boolean inflate)


Supported API: false

Parameters:
inflate -
Returns:
String

getRepository

protected String getRepository(boolean inflate)


Supported API: false

Parameters:
inflate -
Returns:
String

getBusinessType

public String getBusinessType()
Deprecated. Replaced by IdentityFactory.getDispayType(object) to return a localizable equivalent of getBusinessType(). Another alternative is ((WTObject)obj).getDisplayType().

Gets the value of the attribute: BUSINESS_TYPE. Identifies the type of the object for business purposes. This is typically the class name of the object but may be derived from some other attribute of the object.

Supported API: false

Specified by:
getBusinessType in interface BusinessInformation
Returns:
String

getFederatableInfo

public FederatableInfo getFederatableInfo()
Gets the object for the association that plays role: FEDERATABLE_INFO.

Supported API: false

Specified by:
getFederatableInfo in interface Federatable
Returns:
FederatableInfo

setFederatableInfo

public void setFederatableInfo(FederatableInfo a_FederatableInfo)
                        throws WTPropertyVetoException
Sets the object for the association that plays role: FEDERATABLE_INFO.

Supported API: false

Specified by:
setFederatableInfo in interface Federatable
Parameters:
a_FederatableInfo -
Throws:
WTPropertyVetoException

federatableInfoValidate

private void federatableInfoValidate(FederatableInfo a_FederatableInfo)
                              throws WTPropertyVetoException
Parameters:
a_FederatableInfo -
Throws:
WTPropertyVetoException

initialize

protected void initialize()
                   throws WTException
Description copied from class: Item


Supported API: false

Overrides:
initialize in class Item
Throws:
WTException

initialize

protected void initialize(String service)
                   throws WTException
Throws:
WTException

_setDisabled

protected void _setDisabled(boolean disabled)

_mangleName

protected String _mangleName()
                      throws WTException,
                             WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

_unmangleName

protected String _unmangleName()

inflate

protected WTPrincipal inflate()

setDn

public void setDn(String dn,
                  boolean inflate)

setRepository

public void setRepository(String repository,
                          boolean inflate)