SiteMinder
Java SDK r12.51


com.netegrity.sdk.dmsapi
Class SmDmsObject

java.lang.Object
  extended by com.netegrity.sdk.dmsapi.SmDmsObject
Direct Known Subclasses:
SmDmsDirectory, SmDmsGroup, SmDmsOrganization, SmDmsRole, SmDmsUser

public class SmDmsObject
extends java.lang.Object

Class SmDmsObject is the root of the DMS API object hierarchy.

Since:
SDK 2.0

Field Summary
static int DMSOBJECT_CLASS_DIRECTORY
          The DMS object class identifier is a directory.
static int DMSOBJECT_CLASS_GROUP
          The DMS object class identifier is a group.
static int DMSOBJECT_CLASS_ORGANIZATION
          The DMS object class identifier is an organization.
static int DMSOBJECT_CLASS_ROLE
          The DMS object class identifier is a role.
static int DMSOBJECT_CLASS_UNKNOWN
          The DMS object class identifier is unknown.
static int DMSOBJECT_CLASS_USER
          The DMS object class identifier is a user.
 
Method Summary
 SmApiResult addObject()
          Adds the DMS object to the directory.
 SmApiResult addObjectNoAdminCheck()
           
 SmApiResult addToGroup(SmDmsGroup group)
          Adds the current object to a group.
 SmApiResult addToGroupNoAdminCheck(SmDmsGroup group)
           
 void clearAttributes()
          Clears the attributes of the current object.
 SmApiResult deleteObject()
          Deletes the DMS object from the directory.
 SmApiResult deleteObjectNoAdminCheck()
           
 SmApiSession getApiSession()
          Gets the API session associated with the current object.
 java.lang.Object getAttribute(java.lang.String attributeName)
          Gets the value of the specified attribute name.
 java.util.Hashtable getAttributes()
          Gets the attributes of the current object.
 int getClassId()
          Gets the object class identifier of the current object.
 SmDmsConfig getDmsConfig()
          Gets the DMS configuration object.
 java.lang.String getDn()
          Gets the distinguished name of the current object.
 SmApiResult getGroups(SmDmsCursor cursorObj, java.util.Vector attrNames, java.util.Vector groups, boolean recursive, int direction)
          Gets a list of groups that the object belongs to, and also gets information about the group attributes specified in attrNames.
 SmApiResult getGroups(java.util.Vector groups, boolean recursive)
          Gets a list of groups that this object belongs to--for example, all groups that a given user is a member of.
 SmApiResult getGroupsNoAdminCheck(SmDmsCursor cursorObj, java.util.Vector attrNames, java.util.Vector groups, boolean recursive, int direction)
           
 SmApiResult getGroupsNoAdminCheck(java.util.Vector groups, boolean recursive)
           
 SmApiResult getObject()
          Gets the current object's attributes from the directory.
 SmApiResult getObject(java.util.Vector attrNames)
          Gets a subset of the current object's attributes from the directory.
 SmApiResult getObjectNoAdminCheck()
           
 SmApiResult getObjectNoAdminCheck(java.util.Vector attrNames)
           
 java.lang.String getOrganizationDn()
          Gets the organization distinguished name of the current object.
 SmRealm getRealm()
          Gets the SiteMinder realm associated with the current object.
 SmUserDirectory getUserDirectory()
          Gets the SiteMinder user directory associated with the current object.
 int getVersion()
          Gets the DMS API version compliance level.
 boolean isActiveDir()
          Confirms the type of processing directory as Active directory.
 SmApiResult modifyObject()
          Modifies the current object's attributes in the directory.
 SmApiResult modifyObjectClass(java.util.Vector objectClass)
          Modifies the current object's object class.
 SmApiResult modifyObjectClassNoAdminCheck(java.util.Vector objectClass)
           
 SmApiResult modifyObjectNoAdminCheck()
           
 SmDmsObject newDmsObject(int nClassId, java.lang.String Dn)
          Creates a new DMS object for the specified object class identifier and DN.
 void readAttributes(java.util.Hashtable attributes)
          Copies the specified attributes to the current object.
 SmApiResult removeFromGroup(SmDmsGroup group)
          Removes the current object from a group.
 SmApiResult removeFromGroupNoAdminCheck(SmDmsGroup group)
           
 void setActiveDir()
          Sets the Directory type as Active directory.
 void setAttribute(java.lang.String attributeName, java.lang.Object attributeValue)
          Adds an attribute name-value pair.
 void setAttributes(java.util.Hashtable attributes)
          Sets the attributes for the current object.
 void setClassId(int classId)
          Sets the object class identifier.
 java.lang.String toString()
          Returns the distinguished name of the current object.
 void writeAttributes(java.util.Hashtable attributes)
          Copies the attribute of the current object to the specified attribute hashtable.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DMSOBJECT_CLASS_UNKNOWN

public static final int DMSOBJECT_CLASS_UNKNOWN
The DMS object class identifier is unknown. Use this constant if you are creating a base SmDmsObject object that is not associated with a subclass object type (directory, organization, group, role, or user).

See Also:
Constant Field Values

DMSOBJECT_CLASS_DIRECTORY

public static final int DMSOBJECT_CLASS_DIRECTORY
The DMS object class identifier is a directory.

See Also:
Constant Field Values

DMSOBJECT_CLASS_ORGANIZATION

public static final int DMSOBJECT_CLASS_ORGANIZATION
The DMS object class identifier is an organization.

See Also:
Constant Field Values

DMSOBJECT_CLASS_GROUP

public static final int DMSOBJECT_CLASS_GROUP
The DMS object class identifier is a group.

See Also:
Constant Field Values

DMSOBJECT_CLASS_USER

public static final int DMSOBJECT_CLASS_USER
The DMS object class identifier is a user.

See Also:
Constant Field Values

DMSOBJECT_CLASS_ROLE

public static final int DMSOBJECT_CLASS_ROLE
The DMS object class identifier is a role.

See Also:
Constant Field Values
Method Detail

newDmsObject

public SmDmsObject newDmsObject(int nClassId,
                                java.lang.String Dn)
Creates a new DMS object for the specified object class identifier and DN.

Parameters:
nClassId - Object Class identifier defined in the SmDmsObject class.
Dn - Distinguished name of the DMS object.

getApiSession

public SmApiSession getApiSession()
Gets the API session associated with the current object.

Returns:
The API session associated with the object.

getRealm

public SmRealm getRealm()

Gets the SiteMinder realm associated with the current object.

When this method is called for a directory context, the realm object will contain a null OID.

Returns:
The SiteMinder realm associated with the object.

getUserDirectory

public SmUserDirectory getUserDirectory()
Gets the SiteMinder user directory associated with the current object.

Returns:
The SiteMinder user directory associated with the object.

getDmsConfig

public SmDmsConfig getDmsConfig()
Gets the DMS configuration object.

Returns:
The SmDmsConfig object.

getClassId

public int getClassId()
Gets the object class identifier of the current object.

Returns:
The object class identifier of the object.

setClassId

public void setClassId(int classId)

Sets the object class identifier.

If you are creating a generic directory, organization, group, role, or user object with SmDmsObject, specify the type of object by calling setClassId() before you call addObject(). If you are creating a specific object using a subclass (such as SmDmsUser), setClassId() is set automatically.

If you are creating a base SmDmsObject object that is not associated with a subclass object type (directory, organization, group, role, or user), set classId to DMSOBJECT_CLASS_UNKNOWN.

Parameters:
classId - The new object class identifier. Class identifier constants appear in this class prefixed with DMSOBJECT_CLASS_.


getDn

public java.lang.String getDn()
Gets the distinguished name of the current object.

Returns:
The distinguished name of the object.

getOrganizationDn

public java.lang.String getOrganizationDn()
Gets the organization distinguished name of the current object.

Returns:
The organization distinguished name of the object.

getAttributes

public java.util.Hashtable getAttributes()
Gets the attributes of the current object.

Returns:
The attributes of the DMS object that is represented in a java.util.Hashtable

setAttributes

public void setAttributes(java.util.Hashtable attributes)

Sets the attributes for the current object.

The keys of the hashtable should be strings. The values associated with the keys can be any object. The SDK automatically puts the object into string format by calling toString() on the object. If the object is a Vector, the SDK calls toString() on each element of the object.

Parameters:
attributes - The new attributes for the current object.

clearAttributes

public void clearAttributes()
Clears the attributes of the current object. This method clears the hashtable so that it contains no keys.


setAttribute

public void setAttribute(java.lang.String attributeName,
                         java.lang.Object attributeValue)

Adds an attribute name-value pair.

This method maps the specified key to the specified value in this hashtable. attributeName should be a string. attributeValue can be any object. The SDK automatically puts the object into string format by calling toString() on the object. If the object is a Vector, the SDK calls toString() on each element of the object.

Neither a key nor its value can be null.

You can set multiple values for an attribute in the following circumstances:

You can set multile values for an attribute in either of these ways:

Parameters:
attributeName - The name of the attribute.
attributeValue - The attribute value.

getAttribute

public java.lang.Object getAttribute(java.lang.String attributeName)
Gets the value of the specified attribute name. If the attribute name is not found, the method returns an empty string. This will pass the attributes name in lower case if dmsobject belongs to non Active Directory. For Active Directory to work properly dmsobject should call setActivedir before calling this method.

Parameters:
attributeName - The name of the attribute.
Returns:
The attribute value.

readAttributes

public void readAttributes(java.util.Hashtable attributes)
Copies the specified attributes to the current object.

Parameters:
attributes - The new attributes.

writeAttributes

public void writeAttributes(java.util.Hashtable attributes)
Copies the attribute of the current object to the specified attribute hashtable.

Parameters:
attributes - The destination attribute hashtable.

toString

public java.lang.String toString()
Returns the distinguished name of the current object.

Overrides:
toString in class java.lang.Object
Returns:
The distinguished name of the object.

getObject

public SmApiResult getObject()
                      throws SmApiException

Gets the current object's attributes from the directory.

To retrieve a subset of the object's attributes, call getObject(Vector).

This method requires an end user session or higher.

For an example of this method, see modifyObject().

Returns:
SmApiResult The result of the request.
Throws:
SmApiException

getObjectNoAdminCheck

public SmApiResult getObjectNoAdminCheck()
                                  throws SmApiException
Throws:
SmApiException

getObject

public SmApiResult getObject(java.util.Vector attrNames)
                      throws SmApiException

Gets a subset of the current object's attributes from the directory.

To retrieve all of the object's attributes, call getObject().

This method requires an end user session or higher.

Parameters:
attrNames - The attributes to retrieve.
Returns:
SmApiResult The result of the request.
Throws:
SmApiException
Since:
SDK 2.2

getObjectNoAdminCheck

public SmApiResult getObjectNoAdminCheck(java.util.Vector attrNames)
                                  throws SmApiException
Throws:
SmApiException

addObject

public SmApiResult addObject()
                      throws SmApiException
Adds the DMS object to the directory. This method creates a new entry in the directory.

When you add an object to the directory and you are setting a value for the object's objectclass attribute, you can assign multiple values to the attribute. For information, see setAttribute().

If you are creating a generic directory, organization, group, role, or user object with SmDmsObject, specify the type of object by calling setClassId() before you call addObject(). If you are creating a specific object using a subclass (such as SmDmsUser), setClassId() is set automatically.

This method requires an organization administrator session or higher.

Returns:
SmApiResult The result of the request.
Throws:
SmApiException

addObjectNoAdminCheck

public SmApiResult addObjectNoAdminCheck()
                                  throws SmApiException
Throws:
SmApiException

deleteObject

public SmApiResult deleteObject()
                         throws SmApiException

Deletes the DMS object from the directory. This method deletes the entry from the directory.

This method requires an organization administrator session or higher.

Returns:
SmApiResult The result of the request.
Throws:
SmApiException

deleteObjectNoAdminCheck

public SmApiResult deleteObjectNoAdminCheck()
                                     throws SmApiException
Throws:
SmApiException

modifyObject

public SmApiResult modifyObject()
                         throws SmApiException

Modifies the current object's attributes in the directory.

When you modify an object, you can assign multiple values to any of the object's attributes. For information, see setAttribute().

Before you modify an object's attributes, you must retrieve its current attributes with getObject() -- for example:
 SmDmsUser user = org.newUser(USER_DN1);
 result = user.getObject();
 user.setAttribute("l", "Boston");
 result = user.modifyObject();
This method requires an end user session or higher.

Returns:
SmApiResult The result of the request.
Throws:
SmApiException

modifyObjectNoAdminCheck

public SmApiResult modifyObjectNoAdminCheck()
                                     throws SmApiException
Throws:
SmApiException

modifyObjectClass

public SmApiResult modifyObjectClass(java.util.Vector objectClass)
                              throws SmApiException

Modifies the current object's object class.

You can assign multiple values to the object class in a single call to modifyObjectClass(). To do so, you can either pass in a string, with each value within the string delimited by a carat (^) character, or you can pass in a vector of values. For more information, see setAttribute().

This method requires an organization administrator session or higher.

Parameters:
objectClass - Vector containing new object classes (String).
Returns:
SmApiResult The result of the request.
Throws:
SmApiException

modifyObjectClassNoAdminCheck

public SmApiResult modifyObjectClassNoAdminCheck(java.util.Vector objectClass)
                                          throws SmApiException
Throws:
SmApiException

addToGroup

public SmApiResult addToGroup(SmDmsGroup group)
                       throws SmApiException

Adds the current object to a group.

This method requires an organization administrator session or higher.

Parameters:
group - Group under which the object is to be added.
Returns:
SmApiResult The result of the request.
Throws:
SmApiException

addToGroupNoAdminCheck

public SmApiResult addToGroupNoAdminCheck(SmDmsGroup group)
                                   throws SmApiException
Throws:
SmApiException

removeFromGroup

public SmApiResult removeFromGroup(SmDmsGroup group)
                            throws SmApiException

Removes the current object from a group.

This method requires an organization administrator session or higher.

Parameters:
group - Group under which the object is to be removed.
Returns:
SmApiResult The result of the request.
Throws:
SmApiException

removeFromGroupNoAdminCheck

public SmApiResult removeFromGroupNoAdminCheck(SmDmsGroup group)
                                        throws SmApiException
Throws:
SmApiException

getGroups

public SmApiResult getGroups(java.util.Vector groups,
                             boolean recursive)
                      throws SmApiException
Gets a list of groups that this object belongs to--for example, all groups that a given user is a member of.

To retrieve group names and selected attribute information, call getGroups(SmDmsCursor, Vector, Vector, int).

This method requires an end user session or higher.

Parameters:
groups - When this method returns successfully, this output parameter is filled with a Vector of strings containing the distinguished names of groups.
recursive - If true, the search is recursive. If false, the search occurs on just one level.
Returns:
SmApiResult Result of the request.
Throws:
SmApiException

getGroupsNoAdminCheck

public SmApiResult getGroupsNoAdminCheck(java.util.Vector groups,
                                         boolean recursive)
                                  throws SmApiException
Throws:
SmApiException

getGroups

public SmApiResult getGroups(SmDmsCursor cursorObj,
                             java.util.Vector attrNames,
                             java.util.Vector groups,
                             boolean recursive,
                             int direction)
                      throws SmApiException
Gets a list of groups that the object belongs to, and also gets information about the group attributes specified in attrNames. For example, the method might return all the groups that a given user is a member of, along with the values of selected attributes.

The search result is sorted and paginated according to the information in SmDmsCursor.

Call this method each time you want to retrieve a new page from the result set.

With LDAP directories, do not retrieve the attribute that lists all the static members for the group. Including this attribute degrades performance and could overwhelm the buffer.

To retrieve group names only, call getGroups(Vector, boolean).

This method requires an end user session or higher.

Note: This version of getGroups() is not supported with ODBC databases. Use an SmDmsOrganization.search... method instead, or use the getGroups(Vector, boolean) version that retrieves group names but not attribute information.

Parameters:
cursorObj - The object containing sorting and paging information.
attrNames - A Vector of strings containing the names of the attributes to retrieve.
groups - When this method returns successfully, this output parameter is filled with a Vector of SmDmsObject objects containing the distinguished names of the retrieved groups and the specified attribute information.
recursive - If true, the search is recursive. If false, the search occurs on just one level.
direction - The search direction. One of the following:
Returns:
SmApiResult Result of the request.
Throws:
SmApiException
Since:
SDK 2.2

getGroupsNoAdminCheck

public SmApiResult getGroupsNoAdminCheck(SmDmsCursor cursorObj,
                                         java.util.Vector attrNames,
                                         java.util.Vector groups,
                                         boolean recursive,
                                         int direction)
                                  throws SmApiException
Throws:
SmApiException

getVersion

public int getVersion()

Gets the DMS API version compliance level.

Returns:
The DMS API version compliance level.

isActiveDir

public boolean isActiveDir()

Confirms the type of processing directory as Active directory.

Returns:
The flag value m_bActiveDir as true, if processing directory is Active directory;.

setActiveDir

public void setActiveDir()

Sets the Directory type as Active directory.

For Active Directory to work properly dmsobject should call setActivedir before calling getAttribute , ReadAtributes, writeAttributes & copyAttributes methods.


SiteMinder
Java SDK r12.51

Mon 04/08/2013

http://ca.com
Copyright (c) 2013 CA.