wt.org
Class WTPrincipalReference

java.lang.Object
  extended bywt.fc.ObjectReference
      extended bywt.org.WTPrincipalReference
All Implemented Interfaces:
Evolvable, Externalizable, NetFactor, ObjectMappable, Serializable, WTReference

public class WTPrincipalReference
extends ObjectReference
implements Externalizable

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:
Serialized Form

Field Summary
private static String ACCESS_RESOURCE
           
private  boolean accessible
           
private  boolean accessVerified
           
static WTPrincipalReference ALL
          Constant reference that designates all existing users.
static int ALL_ID
           
private static ObjectIdentifier allObjectId
           
private static String CLASSNAME
           
private  boolean disabled
           
static String DISABLED
          Label for the attribute.
private  String dn
           
static String DN
          Label for the attribute.
private  String EMail
           
static String EMAIL
          Label for the attribute; Non-persistent attribute that is filled in by the inflate in the query results thru the cached object.
static long EXTERNALIZATION_VERSION_UID
           
static String FULL_NAME
          Label for the attribute; Non-persistent attribute that is filled in by the inflate in the query results thru the cached object.
private  String fullName
           
private  boolean inflated
           
private  String name
           
static String NAME
          Label for the attribute; Non-persistent attribute that is filled in by the inflate in the query results thru the cached object.
static String OBJECT
          Label for the attribute.
protected static long OLD_FORMAT_VERSION_UID
           
static WTPrincipalReference OWNER
          Constant reference that designates the object's owner.
static int OWNER_ID
           
private static ObjectIdentifier ownerObjectId
           
private static String PROXY_GROUP
           
private static String PROXY_USER
           
private  String repository
           
static String REPOSITORY
          Label for the attribute.
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private static boolean VERBOSE
           
private static boolean VERBOSE_INFLATION
           
 
Fields inherited from class wt.fc.ObjectReference
KEY, object, OBJECT_ID
 
Constructor Summary
WTPrincipalReference()
           
 
Method Summary
 boolean equals(Object obj)
          Overrides the equals method of the superclass.
 String getConceptualClassname()
          Deprecated.  
 String getDisplayName()
          

Supported API: true
 String getDn()
          Gets the value of the attribute: DN.
 String getEMail()
          Gets the value of the attribute: EMAIL.
 String getFullName()
          Gets the value of the attribute: FULL_NAME.
 String getIdentity()
          Return the nice string of the referenced object's identity.
 QueryKey getKey()
          Overrides the getKey method of the superclass.
 String getName()
          Gets the value of the attribute: NAME.
 Persistable getObject()
          Overrides getObject method of superclass and returns a copy to guard against concurrent updates against cached instances.
 WTPrincipal getPrincipal()
          Returns principal referenced by object.
 Persistable getReadOnlyObject()
          Returns a read-only instance of the principal.
 String getRepository()
          Gets the value of the attribute: REPOSITORY.
 int hashCode()
          Overrides the hashCode method of the superclass to ensure that an ObjectIdentifier is available against which to compute the hash code.
 void inflate()
           
protected  void initialize(ObjectIdentifier id)
          Supports initialization, following construction of an instance.
protected  void initialize(String dn, String repository)
          Supports initialization, following construction of an instance.
protected  void initialize(WTPrincipal principal)
          Supports initialization, following construction of an instance.
protected  void initialize(WTPrincipalReference principalReference)
          Supports initialization, following construction of an instance.
 boolean isAccessible()
          Determines whether the caller has the right to access the referenced principal.
 boolean isDisabled()
          Gets the value of the attribute: DISABLED.
 boolean isInflated()
           
static WTPrincipalReference newWTPrincipalReference()
          

Supported API: true
static WTPrincipalReference newWTPrincipalReference(ObjectIdentifier id)
          Constructs a principal out of its database identifier.
static WTPrincipalReference newWTPrincipalReference(String dn, String repository)
          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.
static WTPrincipalReference newWTPrincipalReference(WTPrincipal principal)
          Creates reference given a principal.
static WTPrincipalReference newWTPrincipalReference(WTPrincipalReference principalReference)
          Creates reference given a principal reference.
 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(WTPrincipalReference thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 boolean references(Persistable obj)
          Overrides references method of the superclass.
 void refresh()
          Refresh the WTPrincipalReference using the OrganizationService's principal cache.
private  ObjectIdentifier replaceProxy(ObjectIdentifier oid)
           
 String toString()
          Returns string representation of the reference.
 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.ObjectReference
deflate, getClassInfo, getObjectId, getReferencedClass, getReferencedClass, hasPersistence, initialize, initialize, initialize, isObjectInflated, newObjectReference, newObjectReference, newObjectReference, newObjectReference, readVersion, setKey, setObject, setObjectId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

OWNER

public static final WTPrincipalReference OWNER
Constant reference that designates the object's owner. To be used internally in ACLs. Warning: this reference doesn NOT point to an actual user. Methods in the WTPrincipal should take this into account.

Supported API: false


ALL

public static final WTPrincipalReference ALL
Constant reference that designates all existing users. To be used internally in ACLs. Warning: this reference does not refer to an actual group. Methods in the WTPrincipal should take this into account.

Supported API: false


EMAIL

public static final String EMAIL
Label for the attribute; Non-persistent attribute that is filled in by the inflate in the query results thru the cached object.

Supported API: false

See Also:
Constant Field Values

EMail

private String EMail

NAME

public static final String NAME
Label for the attribute; Non-persistent attribute that is filled in by the inflate in the query results thru the cached object.

Supported API: false

See Also:
Constant Field Values

name

private String name

FULL_NAME

public static final String FULL_NAME
Label for the attribute; Non-persistent attribute that is filled in by the inflate in the query results thru the cached object.

Supported API: false

See Also:
Constant Field Values

fullName

private String fullName

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

OBJECT

public static final String OBJECT
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

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

accessible

private boolean accessible

accessVerified

private boolean accessVerified

inflated

private boolean inflated

ACCESS_RESOURCE

private static final String ACCESS_RESOURCE
See Also:
Constant Field Values

VERBOSE

private static boolean VERBOSE

VERBOSE_INFLATION

private static boolean VERBOSE_INFLATION

PROXY_USER

private static final String PROXY_USER

PROXY_GROUP

private static final String PROXY_GROUP

OWNER_ID

public static final int OWNER_ID
See Also:
Constant Field Values

ALL_ID

public static final int ALL_ID
See Also:
Constant Field Values

allObjectId

private static ObjectIdentifier allObjectId

ownerObjectId

private static ObjectIdentifier ownerObjectId
Constructor Detail

WTPrincipalReference

public WTPrincipalReference()
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 ObjectReference
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 ObjectReference
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(WTPrincipalReference 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 ObjectReference
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 ObjectReference
Parameters:
input -
Throws:
SQLException
DatastoreException

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class ObjectReference
Returns:
String

getEMail

public String getEMail()
Gets the value of the attribute: EMAIL. Non-persistent attribute that is filled in by the inflate in the query results thru the cached object.

Supported API: false

Returns:
String

getName

public String getName()
Gets the value of the attribute: NAME. Non-persistent attribute that is filled in by the inflate in the query results thru the cached object.

Supported API: false

Returns:
String

getFullName

public String getFullName()
Gets the value of the attribute: FULL_NAME. Non-persistent attribute that is filled in by the inflate in the query results thru the cached object.

Supported API: false

Returns:
String

isDisabled

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

Supported API: false

Returns:
boolean

getDn

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

Supported API: false

Returns:
String

getRepository

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

Supported API: false

Returns:
String

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


Supported API: true

Returns:
String
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 nice string of the referenced object's 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

isAccessible

public boolean isAccessible()
                     throws WTException
Determines whether the caller has the right to access the referenced principal.

Returns:
true if the caller may access the principal.
Throws:
WTException

getObject

public Persistable getObject()
                      throws WTRuntimeException
Overrides getObject method of superclass and returns a copy to guard against concurrent updates against cached instances.

Specified by:
getObject in interface WTReference
Overrides:
getObject in class ObjectReference
Returns:
The principal.
Throws:
WTRuntimeException

getReadOnlyObject

public Persistable getReadOnlyObject()
                              throws WTRuntimeException
Returns a read-only instance of the principal. This might be a direct reference to an entry in the principal cache, so none of its setters should be called.

Returns:
The principal.
Throws:
WTRuntimeException

getKey

public QueryKey getKey()
Overrides the getKey method of the superclass.

Specified by:
getKey in interface WTReference
Overrides:
getKey in class ObjectReference
Returns:
The query key (ObjectIdentifier) associated with this instance

hashCode

public int hashCode()
Overrides the hashCode method of the superclass to ensure that an ObjectIdentifier is available against which to compute the hash code.

Specified by:
hashCode in interface WTReference
Overrides:
hashCode in class ObjectReference
Returns:
The hash code.

equals

public boolean equals(Object obj)
Overrides the equals method of the superclass.

Specified by:
equals in interface WTReference
Overrides:
equals in class ObjectReference
Parameters:
obj - The object against which to compare this object.
Returns:
true if this object is the same as the one specified.

inflate

public void inflate()
             throws WTException
Throws:
WTException

isInflated

public boolean isInflated()

references

public boolean references(Persistable obj)
Overrides references method of the superclass.

Specified by:
references in interface WTReference
Overrides:
references in class ObjectReference
Parameters:
obj - The object to compare against.
Returns:
true if this instance references the specified object.

replaceProxy

private ObjectIdentifier replaceProxy(ObjectIdentifier oid)
                               throws WTException
Throws:
WTException