com.iplanet.am.sdk
Interface AMTemplate

All Superinterfaces:
AMConstants, AMObject

public interface AMTemplate
extends AMObject

Represents a service template associated with a AMObject. Sun ONE Identity Server distinguishes between virtual and entry attibutes. Per iDS terminology, virtual attribute is an attribute that is not physically stored in an LDAP entry but still returned with the LDAP entry as a result of a LDAP search operation. Virtual attributes are analagous to the "inherited" attributes. Entry attributes are non-inherited attributes. For each AMObject, virtual attributes can be grouped in a Template on a per-service basis. Hence, there may be one service Template per service for any given AMObject. A given object may have more than one Template, in total, one each for each of the services for that object. Such templates determine the service attributes inherited by all the other objects within the scope of this object.

When any object inherits more than one template for the same service (by virtue of being in the scope of two or more objects with service templates), conflicts between such templates are resolved by the use of template priorities. In this priority scheme, zero is the highest possible priority with the lower priorities extending towards finity. Templates with higher priorities will be favored over and to the exclusion of templates with lower priorities. Templates which do not have an explicitly assigned priority are considered to have the lowest priority possible, or no priority. In the case where two or more templates are being considered for inheritance of an attribute value, and they have the same (or no) priority, the result is undefined, but does not exclude the possibility that a value will be returned, however arbitrarily chosen.

In this model, policy is treated as a service and hence policy templates at levels such as Organization or Role are possible.


Field Summary
static int ALL_TEMPLATES
          Represents both dynamic and policy template for a service
static int DYNAMIC_TEMPLATE
          Represents the Dynamic template type
static int ORGANIZATION_TEMPLATE
          Represents an Organization template type
static int POLICY_TEMPLATE
          Represents a Policy template type
static int UNDEFINED_PRIORITY
          Represents the priority of a template whose priority is not explicitly set.
 
Fields inherited from interface com.iplanet.am.sdk.AMObject
ASSIGNABLE_DYNAMIC_GROUP, DYNAMIC_GROUP, FILTERED_ROLE, GROUP, GROUP_CONTAINER, GROUP_PROFILE, MANAGED_ROLE, ORGANIZATION, ORGANIZATIONAL_UNIT, PEOPLE_CONTAINER, POLICY, ROLE, ROLE_PROFILE, SERVICE, STATIC_GROUP, TEMPLATE, UNKNOWN_OBJECT_TYPE, USER
 
Fields inherited from interface com.iplanet.am.sdk.AMConstants
SCOPE_BASE, SCOPE_ONE, SCOPE_SUB, SUBSCRIBABLE_ATTRIBUTE, UNIQUE_MEMBER_ATTRIBUTE
 
Method Summary
 java.util.Set getAttributeSchemas()
          Gets the Attribute Schemas that defines the schema (metadata) of this template.
 java.util.Set getPolicyNames()
          Get the policy name.
 int getPriority()
          Gets the priority of this template in the DIT.
 java.lang.String getServiceName()
          Gets the name of the service to which this template belongs.
 int getType()
          Gets the type of the template.
 void setPriority(int priority)
          Sets the priority of this template in the DIT
 
Methods inherited from interface com.iplanet.am.sdk.AMObject
addEventListener, assignPolicies, createPolicyTemplate, createPolicyTemplate, createTemplate, createTemplate, delete, delete, getAttribute, getAttributeByteArray, getAttributes, getAttributes, getAttributesByteArray, getAttributesByteArray, getDN, getOrganizationDN, getParentDN, getPolicy, getPolicyTemplate, getServiceAttributes, getStringAttribute, getTemplate, isExists, removeAttributes, removeEventListener, search, setAttributes, setStringAttribute, store, unassignPolicies
 

Field Detail

POLICY_TEMPLATE

public static final int POLICY_TEMPLATE
Represents a Policy template type

DYNAMIC_TEMPLATE

public static final int DYNAMIC_TEMPLATE
Represents the Dynamic template type

ORGANIZATION_TEMPLATE

public static final int ORGANIZATION_TEMPLATE
Represents an Organization template type

ALL_TEMPLATES

public static final int ALL_TEMPLATES
Represents both dynamic and policy template for a service

UNDEFINED_PRIORITY

public static final int UNDEFINED_PRIORITY
Represents the priority of a template whose priority is not explicitly set.
Method Detail

getServiceName

public java.lang.String getServiceName()
Gets the name of the service to which this template belongs. This method can be used in conjunction with SMS APIs to get the AttributeSchema/ServiceSchema for the service.

getAttributeSchemas

public java.util.Set getAttributeSchemas()
                                  throws AMException,
                                         SSOException
Gets the Attribute Schemas that defines the schema (metadata) of this template.
Returns:
Set Set of com.iplanet.dpro.sdk.AMAttributeSchema for this template
Throws:
AMException - if an error is encountered when trying to access/retrieve data from the data store
SSOException - if the sign on is no longer valid.

getPriority

public int getPriority()
                throws SSOException
Gets the priority of this template in the DIT.
Returns:
int priority

setPriority

public void setPriority(int priority)
                 throws AMException,
                        SSOException
Sets the priority of this template in the DIT
Parameters:
priority - priority
Throws:
AMException - if an error is encountered when trying to access/retrieve data from the data store
SSOException - if the sign on is no longer valid

getType

public int getType()
Gets the type of the template.
Returns:
Returns one of the following possible values:
  • POLICY_TEMPLATE
  • DYNAMIC_TEMPLATE
  • ORGANIZATION_TEMPLATE

getPolicyNames

public java.util.Set getPolicyNames()
                             throws AMException,
                                    SSOException
Get the policy name. Returns a policyDN if this AMTemplate is a named policy template, otherwise returns null
Returns:
Set DNs of the named policies