com.sas.edir
Class NonExEntity

java.lang.Object
  |
  +--com.sas.edir.SasTrackedObject
        |
        +--com.sas.edir.NonExEntity
All Implemented Interfaces:
Caching, Entity, TrackedObject

public class NonExEntity
extends SasTrackedObject
implements Entity

This interface represents a non-existent entry in the Enterprise Directory. It may seem odd that we'd want to represent something that doesn't exist, but it's possible to have Map entries that point to DN's that have been deleted, so it's useful to have a placeholder for those things so the user can be alerted in a nice way that they have a problem, rather than either ignoring it so the broken link stays around forever, or throwing an exception.

Version:
1.0
Author:
SAS

Fields inherited from interface com.sas.edir.Entity
PROPERTY_CHANGED, SUBPROPERTY_CHANGED
 
Constructor Summary
NonExEntity(EnterpriseDirectory edir, java.lang.String context)
          Create a new non-existent entity object.
NonExEntity(EnterpriseDirectory edir, java.lang.String context, java.io.PrintStream debugStream)
          Create a new non-existent entity object.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a property change listener to the listener list.
 void edirUpdateStore()
          Dummy method to satisfy the Caching interface.
 java.lang.String getContext()
          Returns the context of this entity in the enterprise directory.
 java.lang.String getCreateTime()
          Get operational attribute with creation time stamp.
 java.lang.String getCreatorsName()
          Get operational attribute with Creator's DN
 java.lang.String getDescription()
          Returns this entities' description.
 EnterpriseDirectory getEnterpriseDirectory()
          Returns the enterprise directory service.
 java.lang.String getGuid()
          Returns null
 java.lang.String getModifiersName()
          Get operational attribute with Modifier's DN
 java.lang.String getModifyTime()
          Get operational attribute with last modified time stamp.
 java.lang.String getName()
          Returns this entities' name.
 java.lang.String getObjectclass()
          Returns the objectClass of this entity.
 long getTimeToLive()
          Dummy method to satisfy the Caching interface.
 boolean isExpired()
          Dummy method to satisfy the Caching interface.
 boolean refreshCache()
          Dummy method to satisfy the Caching interface.
 boolean refreshCachedObjects(EnterpriseDirectoryAttributes attributes)
          Dummy method to satisfy the Caching interface.
 void releaseCache()
          Dummy method to satisfy the Caching interface.
 void removeModificationItems()
          This method does nothing
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a property change listener from the listener list.
 void setDescription(java.lang.String description)
          Sets this entities' description.
 void setDirty()
          Dummy method to satisfy the Caching interface.
 void setGuid(java.lang.String guid)
          Sets this entities' guid.
 void setName(java.lang.String name)
          Sets this entities' name.
 void setObjectclass(java.lang.String objectClass)
          Sets the LDAP object class for this entity.
 void setTimeToLive(long seconds)
          Dummy method to satisfy the Caching interface.
 void setTimeToLive(java.lang.String seconds)
          Dummy method to satisfy the Caching interface.
 void updateStore()
          Dummy method to satisfy the Caching interface.
 
Methods inherited from class com.sas.edir.SasTrackedObject
getTrackingId, getUserData, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sas.edir.TrackedObject
getTrackingId, getUserData, setUserData
 

Constructor Detail

NonExEntity

public NonExEntity(EnterpriseDirectory edir,
                   java.lang.String context)
Create a new non-existent entity object.

Parameters:
edir - The enterprise directory service.
context - The DN where this object was expected to be, but wasn't.

NonExEntity

public NonExEntity(EnterpriseDirectory edir,
                   java.lang.String context,
                   java.io.PrintStream debugStream)
Create a new non-existent entity object.

Parameters:
edir - The enterprise directory service.
context - The DN where this object was expected to be, but wasn't.
debugStream - non-nil to turn on debugging.
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a property change listener to the listener list.

Specified by:
addPropertyChangeListener in interface Entity
Parameters:
listener - The property change listener.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a property change listener from the listener list.

Specified by:
removePropertyChangeListener in interface Entity
Parameters:
listener - The property change listener.

getContext

public java.lang.String getContext()
Returns the context of this entity in the enterprise directory.

Specified by:
getContext in interface Entity
Returns:
The context.

getDescription

public java.lang.String getDescription()
Returns this entities' description.

Specified by:
getDescription in interface Entity
Returns:
The description or null if one does not exist.

setDescription

public void setDescription(java.lang.String description)
Sets this entities' description.

This change is not persisted to the enterprise directory until updateStore is called.

Specified by:
setDescription in interface Entity
Parameters:
description - The description.

getEnterpriseDirectory

public EnterpriseDirectory getEnterpriseDirectory()
Returns the enterprise directory service.

Specified by:
getEnterpriseDirectory in interface Entity
Returns:
The enterprise directory service.

getGuid

public java.lang.String getGuid()
Returns null

Specified by:
getGuid in interface Entity
Returns:
null.

getName

public java.lang.String getName()
Returns this entities' name.

Specified by:
getName in interface Entity
Returns:
The name or null if one does not exist.

setName

public void setName(java.lang.String name)
Sets this entities' name.

This change is not persisted to the enterprise directory until updateStore is called.

Specified by:
setName in interface Entity
Parameters:
name - The name.

getObjectclass

public java.lang.String getObjectclass()
Returns the objectClass of this entity. Each Subclass should set this value in the new method.

Specified by:
getObjectclass in interface Entity
Returns:
The entity's LDAP object class

setObjectclass

public void setObjectclass(java.lang.String objectClass)
Sets the LDAP object class for this entity.

Specified by:
setObjectclass in interface Entity
Parameters:
objectClass - the object Class for this entity

refreshCache

public boolean refreshCache()
Dummy method to satisfy the Caching interface.
Specified by:
refreshCache in interface Caching
Following copied from interface: com.sas.edir.Caching
Returns:
true if the cache changed, false otherwise.

refreshCachedObjects

public boolean refreshCachedObjects(EnterpriseDirectoryAttributes attributes)
Dummy method to satisfy the Caching interface.
Specified by:
refreshCachedObjects in interface Caching
Following copied from interface: com.sas.edir.Caching
Parameters:
attributes - The attributes for the entity.
Returns:
true if the entity changed, false otherwise.

updateStore

public void updateStore()
Dummy method to satisfy the Caching interface.
Specified by:
updateStore in interface Caching
Following copied from interface: com.sas.edir.Caching
Throws:
NamingException - Thrown for enterprise directory failure.

edirUpdateStore

public void edirUpdateStore()
Dummy method to satisfy the Caching interface.
Specified by:
edirUpdateStore in interface Caching
Following copied from interface: com.sas.edir.Caching
Throws:
EnterpriseDirectoryException - Thrown for enterprise directory failure.

releaseCache

public void releaseCache()
Dummy method to satisfy the Caching interface.
Specified by:
releaseCache in interface Caching

setDirty

public void setDirty()
Dummy method to satisfy the Caching interface.
Specified by:
setDirty in interface Caching

isExpired

public boolean isExpired()
Dummy method to satisfy the Caching interface.
Specified by:
isExpired in interface Caching

getTimeToLive

public long getTimeToLive()
Dummy method to satisfy the Caching interface.
Specified by:
getTimeToLive in interface Caching
Following copied from interface: com.sas.edir.Caching
Returns:
The number of seconds this object's data should be considered valid.

setTimeToLive

public void setTimeToLive(long seconds)
Dummy method to satisfy the Caching interface.
Specified by:
setTimeToLive in interface Caching
Following copied from interface: com.sas.edir.Caching
Parameters:
seconds - The number of seconds this object's data should be considered valid.

setTimeToLive

public void setTimeToLive(java.lang.String seconds)
Dummy method to satisfy the Caching interface.
Specified by:
setTimeToLive in interface Caching
Following copied from interface: com.sas.edir.Caching
Parameters:
seconds - The number of seconds this object's data should be considered valid.

getCreatorsName

public java.lang.String getCreatorsName()
Get operational attribute with Creator's DN

Specified by:
getCreatorsName in interface Entity
Returns:
String with the creating user's DN

getModifiersName

public java.lang.String getModifiersName()
Get operational attribute with Modifier's DN

Specified by:
getModifiersName in interface Entity
Returns:
String with last modifying user's DN

getCreateTime

public java.lang.String getCreateTime()
Get operational attribute with creation time stamp.

Specified by:
getCreateTime in interface Entity
Returns:
String with creation time stamp.

getModifyTime

public java.lang.String getModifyTime()
Get operational attribute with last modified time stamp.

Specified by:
getModifyTime in interface Entity
Returns:
String with last modification time stamp.

removeModificationItems

public void removeModificationItems()
This method does nothing

Specified by:
removeModificationItems in interface Entity

setGuid

public void setGuid(java.lang.String guid)
Sets this entities' guid.

This change is not persisted to the enterprise directory until updateStore is called.

Specified by:
setGuid in interface Entity
Parameters:
guid - The guid.