Package com.sun.identity.sm
Class SMSEntry
- java.lang.Object
-
- com.sun.identity.sm.SMSEntry
-
-
Field Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttribute(String attrName, String value)
Adds the attribute value to the given attribute name.static boolean
checkIfEntryExists(String dn, SSOToken token)
Checks if the provided DN exists.Object
clone()
boolean
containsAttrValue(String attrName, String attrValue)
Checks if the attribute value exists in the attributevoid
delete()
Delete the entry in the datastore.void
forceDelete(SSOToken adminToken)
Delete the entry in the datastore.static String
getAMSdkBaseDN()
Map
getAttributes()
Returns the read attributesString[]
getAttributeValues(String attrName)
Returns the attribute values for the given attribute name.String[]
getAttributeValues(String attrName, boolean ignoreCache)
static String
getDataStore(SSOToken token)
static String
getFilterPatternService()
static String
getRootSuffix()
static void
initializeClass()
protected static void
initializeProperties()
static boolean
isAttributeCaseSensitive(String attrName)
boolean
isNewEntry()
Returnstrue
if the entry does not exist in the data storevoid
modifyAttributes(ModificationItem[] modItems)
Modify the attribute values.protected static Set
parseResult(Set resultSet, String dn)
protected static Set
parseResult(Set resultSet, String dn, boolean includeThisDN)
void
removeAttribute(String attrName)
Remove the attribute from the entry.void
removeAttribute(String attrName, String value)
Removes the attribute value from the attribute.void
save()
Save the modification(s) to the object.static Set<String>
search(SSOToken token, String dn, String filter, int numOfEntries, int timeLimit, boolean sortResults, boolean ascendingOrder)
Returns the DNs that match the filter.static Iterator
search(SSOToken token, String dn, String filter, int numOfEntries, int timeLimit, boolean sortResults, boolean ascendingOrder, Set exclude)
Returns the DNs and its attribute values that match the filter.void
setAttribute(String attrName, String[] attrValues)
Set the attribute values.void
setAttributes(Map attributes)
Set the attributes.String
toString()
static void
validateToken(SSOToken token)
-
-
-
Field Detail
-
ORGANIZATION_RDN
public static final String ORGANIZATION_RDN
- See Also:
- Constant Field Values
-
EQUALS
public static final String EQUALS
- See Also:
- Constant Field Values
-
SERVICES_NODE
public static final String SERVICES_NODE
- See Also:
- Constant Field Values
-
PLACEHOLDER_RDN
public static final String PLACEHOLDER_RDN
- See Also:
- Constant Field Values
-
SERVICES_RDN
public static final String SERVICES_RDN
- See Also:
- Constant Field Values
-
COMMA
public static final String COMMA
- See Also:
- Constant Field Values
-
debug
public static Debug debug
-
eventDebug
public static Debug eventDebug
-
tm
public static SSOTokenManager tm
-
DATASTORE_FLAT_FILE
public static String DATASTORE_FLAT_FILE
Flat File Configuration Data Store
-
DATASTORE_SUN_DIR
public static String DATASTORE_SUN_DIR
Sun Directory Server Configuration Data Store
-
DATASTORE_ACTIVE_DIR
public static String DATASTORE_ACTIVE_DIR
Active Directory Configuration Data Store
-
bundle
public static ResourceBundle bundle
-
DB_PROXY_ENABLE
public static final String DB_PROXY_ENABLE
- See Also:
- Constant Field Values
-
EXPORTEDARGS
public static final String EXPORTEDARGS
- See Also:
- Constant Field Values
-
IMPORTEDARGS
public static final String IMPORTEDARGS
- See Also:
- Constant Field Values
-
dn
protected String dn
-
normalizedDN
protected String normalizedDN
-
DC_RDN
public static final String DC_RDN
- See Also:
- Constant Field Values
-
DEFAULT_RDN
public static final String DEFAULT_RDN
- See Also:
- Constant Field Values
-
ATTR_SCHEMA
public static final String ATTR_SCHEMA
- See Also:
- Constant Field Values
-
ATTR_PLUGIN_SCHEMA
public static final String ATTR_PLUGIN_SCHEMA
- See Also:
- Constant Field Values
-
ATTR_KEYVAL
public static final String ATTR_KEYVAL
- See Also:
- Constant Field Values
-
ATTR_XML_KEYVAL
public static final String ATTR_XML_KEYVAL
- See Also:
- Constant Field Values
-
ATTR_OBJECTCLASS
public static final String ATTR_OBJECTCLASS
- See Also:
- Constant Field Values
-
ATTR_PRIORITY
public static final String ATTR_PRIORITY
- See Also:
- Constant Field Values
-
ATTR_SERVICE_ID
public static final String ATTR_SERVICE_ID
- See Also:
- Constant Field Values
-
ATTR_LABELED_URI
public static final String ATTR_LABELED_URI
- See Also:
- Constant Field Values
-
ATTR_MODIFY_TIMESTAMP
public static final String ATTR_MODIFY_TIMESTAMP
- See Also:
- Constant Field Values
-
SMS_ATTRIBUTES
public static final String[] SMS_ATTRIBUTES
-
OC_TOP
public static final String OC_TOP
- See Also:
- Constant Field Values
-
OC_ORG_UNIT
public static final String OC_ORG_UNIT
- See Also:
- Constant Field Values
-
OC_SERVICE
public static final String OC_SERVICE
- See Also:
- Constant Field Values
-
OC_REALM_SERVICE
public static final String OC_REALM_SERVICE
- See Also:
- Constant Field Values
-
OC_SERVICE_COMP
public static final String OC_SERVICE_COMP
- See Also:
- Constant Field Values
-
SMS_SERVER_GROUP
public static final String SMS_SERVER_GROUP
- See Also:
- Constant Field Values
-
SUN_INTERNAL_REALM_NAME
public static final String SUN_INTERNAL_REALM_NAME
- See Also:
- Constant Field Values
-
SUN_INTERNAL_REALM_PREFIX
public static final String SUN_INTERNAL_REALM_PREFIX
- See Also:
- Constant Field Values
-
SUN_INTERNAL_REALM_PREFIX2
public static final String SUN_INTERNAL_REALM_PREFIX2
- See Also:
- Constant Field Values
-
REALM_SERVICE
public static final String REALM_SERVICE
- See Also:
- Constant Field Values
-
FILTER_PATTERN_ALL
protected static final String FILTER_PATTERN_ALL
- See Also:
- Constant Field Values
-
FILTER_PATTERN
protected static final String FILTER_PATTERN
- See Also:
- Constant Field Values
-
FILTER_PATTERN_SERVICE
protected static final String FILTER_PATTERN_SERVICE
- See Also:
- Constant Field Values
-
FILTER_SERVICE_COMPONENTS
public static final String FILTER_SERVICE_COMPONENTS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SMSEntry
public SMSEntry(SSOToken token, String dn) throws SSOException, SMSException
Constructor for a persistent SMS object given an authenticated SSOToken and DN. The entry is read from the directory.- Throws:
SSOException
SMSException
-
-
Method Detail
-
initializeClass
public static void initializeClass()
-
initializeProperties
protected static void initializeProperties()
-
getAttributes
public Map getAttributes()
Returns the read attributes
-
getAttributeValues
public String[] getAttributeValues(String attrName)
Returns the attribute values for the given attribute name. The values are returned from the cached attribute set. It is not read from the directory.
-
addAttribute
public void addAttribute(String attrName, String value) throws SMSException
Adds the attribute value to the given attribute name. It is stored locally and is not written to the directory.- Throws:
SMSException
-
setAttribute
public void setAttribute(String attrName, String[] attrValues)
Set the attribute values.save()
must be called to make the changes persistant
-
modifyAttributes
public void modifyAttributes(ModificationItem[] modItems)
Modify the attribute values.save()
must be called to make the changes persistant. This does not affect the existing attributes already read.
-
setAttributes
public void setAttributes(Map attributes)
Set the attributes.save()
must be called to make the changes persistant
-
removeAttribute
public void removeAttribute(String attrName, String value) throws SMSException
Removes the attribute value from the attribute.- Parameters:
attrName
- Name of attribute.value
- Value to be removed.- Throws:
SMSException
- if value cannot be removed.
-
removeAttribute
public void removeAttribute(String attrName) throws SMSException
Remove the attribute from the entry.- Throws:
SMSException
-
containsAttrValue
public boolean containsAttrValue(String attrName, String attrValue)
Checks if the attribute value exists in the attribute
-
save
public void save() throws SSOException, SMSException
Save the modification(s) to the object. Save the changes made so far to the datastore.- Throws:
SSOException
SMSException
-
delete
public void delete() throws SMSException, SSOException
Delete the entry in the datastore. This will delete sub-entries also!- Throws:
SMSException
SSOException
-
forceDelete
public void forceDelete(SSOToken adminToken) throws SMSException, SSOException
Delete the entry in the datastore. This will delete sub-entries also! TODO: There is no way to set read-only to false, we should see what we can about this.- Throws:
SMSException
SSOException
-
search
public static Set<String> search(SSOToken token, String dn, String filter, int numOfEntries, int timeLimit, boolean sortResults, boolean ascendingOrder) throws SMSException
Returns the DNs that match the filter. The search is performed from the root suffix ie., DN. It searchs for SMS objects only.- Parameters:
token
- Single-Sign On token.dn
- Base DNfilter
- Search Filter.numOfEntries
- number of max entries, 0 means unlimitedtimeLimit
- maximum number of seconds for the search to spend, 0 means unlimitedsortResults
-true
to have result sorted.ascendingOrder
-true
to have result sorted in ascending order.- Throws:
SMSException
-
search
public static Iterator search(SSOToken token, String dn, String filter, int numOfEntries, int timeLimit, boolean sortResults, boolean ascendingOrder, Set exclude) throws SMSException
Returns the DNs and its attribute values that match the filter. The search is performed from the root suffix ie., DN. It searchs for SMS objects only.- Parameters:
token
- Single-Sign On token.dn
- Base DNfilter
- Search Filter.numOfEntries
- number of max entries, 0 means unlimitedtimeLimit
- maximum number of seconds for the search to spend, 0 means unlimitedsortResults
-true
to have result sorted.ascendingOrder
-true
to have result sorted in ascending order.exclude
- List of DN to exclude.- Throws:
SMSException
-
checkIfEntryExists
public static boolean checkIfEntryExists(String dn, SSOToken token)
Checks if the provided DN exists. Used by PolicyManager.
-
isNewEntry
public boolean isNewEntry()
Returnstrue
if the entry does not exist in the data store
-
validateToken
public static void validateToken(SSOToken token) throws SMSException
- Throws:
SMSException
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
getRootSuffix
public static String getRootSuffix()
-
getAMSdkBaseDN
public static String getAMSdkBaseDN()
-
isAttributeCaseSensitive
public static boolean isAttributeCaseSensitive(String attrName)
- Returns:
- true if the given attribute's value is case sensitive.
-
getFilterPatternService
public static String getFilterPatternService()
- Returns:
- the service filter pattern string
-
-