EASP API 7.15.0

net.juniper.smgt.ent.im
Interface Persistent

All Known Subinterfaces:
Access, Enterprise, Folder, Manager, Retailer, Service, Site, Subscriber, Subscription, VPN

public interface Persistent

This interface is for interacting with objects that are persistent (i.e. that are stored in SSC's LDAP directory). These objects have identity, names, descriptions, and attributes. The identity is system generated. The name is the value of the LDAP RDN of the object, and is fixed for the lifetime of the object. The name is always unique amongst the object's siblings (i.e. those within the same container; for example, all the subscriptions for a single subscriber will have different names). All Persistent objects have a display name which is initially the same as the name of the object, but which can be changed.

The enterprise server caches persistent objects on a per-manager-session basis. A manager's session lasts for the period between a call to ServiceProvider.bind and a subsequent call to ServiceProvider.unbind or ServiceProvider.bind (see ServiceProvider for details on binding). If the directory is modified during a Manager's session, ServiceProvider.clearCache or ServiceProvider.bind must be called again to see the new versions of the objects.

Persistent objects implement a change notification system. Interested objects can register as listeners to listen for changes to Persistent objects. Since persistent objects are cached on a per-manager-session basis, if the same persistent object is accessed more than once within a manager session, multiple references to the same object will be handed out by this API, and not references to multiple cached copies of the persistent data. Thus, if a listener is added to a persistent object, it will recieve change notifications for any update to the object provided that the update originates in the same manager session. Updates notifications will not be sent if the persisent object is changed by another manager session, or if it is changed in the directory by any other external systems.


Method Summary
 void addListener(PersistentChangeListener l)
          Adds a listener to this object.
 void delListener(PersistentChangeListener l)
          Removes a listener from this object.
 java.lang.Object[] getAttribute(java.lang.String name)
          Returns the named attribute from this object's LDAP entry.
 java.lang.String getDisplayName()
          This method returns a cached copy of the value of getAttribute("displayname")[0], or, if no such attribute exists, the value of the LDAP RDN for this Persistent object's LDAP entry.
 java.lang.String getId()
          Returns the unique system-generated identifier of this object.
 java.lang.String getName()
          Returns the value of the LDAP RDN for this object, which is unique amongst its sibling objects.
 void setAttribute(java.lang.String name, java.lang.Object[] values)
          Overwrites the values of the named attribute in this object's LDAP entry.
 void setAttribute(java.lang.String name, java.lang.String[] values)
          Deprecated. use setAttribute(String name, Object values[]) instead
 void setDisplayName(java.lang.String name)
          Sets the display name of this object.
 

Method Detail

getId

java.lang.String getId()
Returns the unique system-generated identifier of this object.


getName

java.lang.String getName()
Returns the value of the LDAP RDN for this object, which is unique amongst its sibling objects. For example, an object with the LDAP DN "uniqueID=xxx,ou=local,retailerName=default,o=Users,o=UMC", this method would return "xxx".


getDisplayName

java.lang.String getDisplayName()
This method returns a cached copy of the value of getAttribute("displayname")[0], or, if no such attribute exists, the value of the LDAP RDN for this Persistent object's LDAP entry.

Returns:
The display name of this object.

setDisplayName

void setDisplayName(java.lang.String name)
                    throws CommunicationException,
                           AccessControlException
Sets the display name of this object. This is a convenience effect is the same as calling the setAttribute method for the "displayname" attribute of this object.

Throws:
AccessControlException - Thrown if the current manager doesn't have the privilige of setting the display name.
CommunicationException - Thrown if there is a problem communicating with the directory.

getAttribute

java.lang.Object[] getAttribute(java.lang.String name)
                                throws CommunicationException,
                                       AccessControlException
Returns the named attribute from this object's LDAP entry.

Parameters:
name - The name of the attribute in the LDAP schema for this object.
Returns:
The values of the attribute, or null if this object doesn't have the named attribute.
Throws:
CommunicationException - Thrown if there is a problem communicating with the directory.
AccessControlException - Thrown if the current manager does not have permission to access the named attribute.

setAttribute

void setAttribute(java.lang.String name,
                  java.lang.Object[] values)
                  throws CommunicationException,
                         AccessControlException,
                         ViolateSchemaException
Overwrites the values of the named attribute in this object's LDAP entry.

Parameters:
name - The name of the attribute in the LDAP schema for this object.
values - The new values for the attribute.
Throws:
CommunicationException - Thrown if there is a problem communicating with the directory.
AccessControlException - Thrown if the current manager does not have write access for the named attribute.
ViolateSchemaException - Thrown if this object's LDAP schema does not allow the given attribute or if multiple values are given for a single-valued attribute.

setAttribute

void setAttribute(java.lang.String name,
                  java.lang.String[] values)
                  throws CommunicationException,
                         AccessControlException,
                         ViolateSchemaException
Deprecated. use setAttribute(String name, Object values[]) instead

Overwrites the values of the named attribute in this object's LDAP entry.

Parameters:
name - The name of the attribute in the LDAP schema for this object.
values - The new values for the attribute.
Throws:
CommunicationException - Thrown if there is a problem communicating with the directory.
AccessControlException - Thrown if the current manager does not have write access for the named attribute.
ViolateSchemaException - Thrown if this object's LDAP schema does not allow the given attribute or if multiple values are given for a single-valued attribute.

addListener

void addListener(PersistentChangeListener l)
Adds a listener to this object. Does nothing if the listener has already been added to this object.

Parameters:
listener - The listener that is interested in changes to this object.

delListener

void delListener(PersistentChangeListener l)
Removes a listener from this object. Does nothing if the given listener has not been added to this object.

Parameters:
listener - The listener that is no longer interested in changes to this object.

EASP API 7.15.0