Package com.sun.identity.sm
Class ServiceInstance
- java.lang.Object
-
- com.sun.identity.sm.ServiceInstance
-
public class ServiceInstance extends Object
The classServiceInstanceprovides methods to manage service's instance variables.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(String attrName, Set values)Adds the given attribute name and values to the attribute set.MapgetAttributes()Returns the attributes that are associated with the service's instances.StringgetGroup()Returns the group name from which the configuration parameters for the instance must be obtained.StringgetName()Returns the instance name.StringgetServiceName()Returns the service name.StringgetURI()Returns the URL of the service.StringgetVersion()Returns the service version.voidremoveAttribute(String attrName)Removes the specified attribute name and its values from the attribute set.voidremoveAttributeValues(String attrName, Set values)Removes the specified attribute's values.voidreplaceAttributeValue(String attrName, String oldValue, String newValue)Replaces the attribute's old value with the new value.voidreplaceAttributeValues(String attrName, Set oldValues, Set newValues)Replaces the attribute's old values with the new valuesvoidsetAttributes(Map attrs)Sets the attributes that are specific to the service instance.voidsetGroup(String groupName)Sets the group name for this instance.voidsetURI(String uri)Sets the URI for the service instance.StringtoString()Returns the String representation of theServiceInstanceobject.StringtoXML()protected voidvalidate()protected voidvalidateServiceInstance()
-
-
-
Method Detail
-
getName
public String getName()
Returns the instance name.- Returns:
- the instance name.
-
getServiceName
public String getServiceName()
Returns the service name.- Returns:
- the service name.
-
getVersion
public String getVersion()
Returns the service version.- Returns:
- the service version.
-
getGroup
public String 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
public void setGroup(String groupName) throws SSOException, SMSException
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
public String getURI()
Returns the URL of the service. Will benullif the service does not have an URI.- Returns:
- the URL of the service. Will be
nullif the service does not have an URI.
-
setURI
public void setURI(String uri) throws SSOException, SMSException
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
public String toString()
Returns the String representation of theServiceInstanceobject.
-
getAttributes
public Map 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(Map 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
public void addAttribute(String attrName, Set values) throws SSOException, SMSException
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
public void removeAttribute(String attrName) throws SSOException, SMSException
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 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 oldValues, Set 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
public String toXML()
-
validate
protected void validate()
-
validateServiceInstance
protected void validateServiceInstance() throws SMSException- Throws:
SMSException
-
-