Package com.sun.identity.sm
Class ServiceInstance
java.lang.Object
com.sun.identity.sm.ServiceInstance
The class
ServiceInstance
provides methods to manage service's
instance variables.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute
(String attrName, Set<String> values) Adds the given attribute name and values to the attribute set.Returns the attributes that are associated with the service's instances.getGroup()
Returns the group name from which the configuration parameters for the instance must be obtained.getName()
Returns the instance name.Returns the service name.getURI()
Returns the URL of the service.Returns the service version.void
removeAttribute
(String attrName) Removes the specified attribute name and its values from the attribute set.void
removeAttributeValues
(String attrName, Set<String> values) Removes the specified attribute's values.void
replaceAttributeValue
(String attrName, String oldValue, String newValue) Replaces the attribute's old value with the new value.void
Replaces the attribute's old values with the new valuesvoid
setAttributes
(org.forgerock.openam.sm.ConfigurationAttributes attrs) Sets the attributes that are specific to the service instance.void
Sets the group name for this instance.void
Sets the URI for the service instance.toString()
Returns the String representation of theServiceInstance
object.toXML()
protected void
validate()
protected void
-
Method Details
-
getName
Returns the instance name.- Returns:
- the instance name.
-
getServiceName
Returns the service name.- Returns:
- the service name.
-
getVersion
Returns the service version.- Returns:
- the service version.
-
getGroup
Returns the group name from which the configuration parameters for the instance must be obtained.- Returns:
- the group name from which the configuration parameters for the instance must be obtained.
-
setGroup
Sets the group name for this instance.- Parameters:
groupName
- name of group.- Throws:
SSOException
- if the user's single sign on token is invalid or expiredSMSException
- if an error occurred while performing the operation
-
getURI
Returns the URL of the service. Will benull
if the service does not have an URI.- Returns:
- the URL of the service. Will be
null
if the service does not have an URI.
-
setURI
Sets the URI for the service instance.- Parameters:
uri
- URI of the service instance.- Throws:
SSOException
- if the user's single sign on token is invalid or expiredSMSException
- if an error occurred while performing the operation
-
toString
Returns the String representation of theServiceInstance
object. -
getAttributes
Returns the attributes that are associated with the service's instances.- Returns:
- the attributes that are associated with the service's instances.
-
setAttributes
public void setAttributes(org.forgerock.openam.sm.ConfigurationAttributes attrs) throws SSOException, SMSException Sets the attributes that are specific to the service instance. It is up to the service developer to define the set of attributes and values- Parameters:
attrs
- map of attribute name to values.- Throws:
SSOException
- if the user's single sign on token is invalid or expiredSMSException
- if an error occurred while performing the operation
-
addAttribute
Adds the given attribute name and values to the attribute set.- Parameters:
attrName
- name of attribute.values
- values to be added.- Throws:
SSOException
- if the user's single sign on token is invalid or expiredSMSException
- if an error occurred while performing the operation
-
removeAttribute
Removes the specified attribute name and its values from the attribute set.- Parameters:
attrName
- name of attribute.- Throws:
SSOException
- if the user's single sign on token is invalid or expiredSMSException
- if an error occurred while performing the operation
-
removeAttributeValues
public void removeAttributeValues(String attrName, Set<String> values) throws SSOException, SMSException Removes the specified attribute's values.- Parameters:
attrName
- name of attribute.values
- values to be removed.- Throws:
SSOException
- if the user's single sign on token is invalid or expiredSMSException
- if an error occurred while performing the operation
-
replaceAttributeValue
public void replaceAttributeValue(String attrName, String oldValue, String newValue) throws SSOException, SMSException Replaces the attribute's old value with the new value.- Parameters:
attrName
- name of attribute.oldValue
- old value.newValue
- new value.- Throws:
SSOException
- if the user's single sign on token is invalid or expiredSMSException
- if an error occurred while performing the operation
-
replaceAttributeValues
public void replaceAttributeValues(String attrName, Set<String> oldValues, Set<String> newValues) throws SSOException, SMSException Replaces the attribute's old values with the new values- Parameters:
attrName
- name of attribute.oldValues
- old values.newValues
- new values.- Throws:
SSOException
- if the user's single sign on token is invalid or expiredSMSException
- if an error occurred while performing the operation
-
toXML
-
validate
protected void validate() -
validateServiceInstance
- Throws:
SMSException
-