Class STSInstanceConfigStoreBase<T extends STSInstanceConfig>
- java.lang.Object
-
- org.forgerock.openam.sts.publish.common.STSInstanceConfigStoreBase<T>
-
- All Implemented Interfaces:
STSInstanceConfigStore<T>
- Direct Known Subclasses:
RestSTSInstanceConfigStore,SoapSTSInstanceConfigStore
public abstract class STSInstanceConfigStoreBase<T extends STSInstanceConfig> extends Object implements STSInstanceConfigStore<T>
-
-
Constructor Summary
Constructors Constructor Description STSInstanceConfigStoreBase(InstanceConfigMarshaller<T> instanceConfigMarshaller, String serviceName, org.slf4j.Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<T>getAllPublishedInstances()This method will be called by some startup context in the {locally|remotely} deployed {REST|SOAP} STS context to obtain all of the previously-published STS instances.List<T>getPublishedInstances(String realm)This method will be called by some startup context in the remotely deployed SOAP STS context to obtain all of the previously-published soap STS instances for a given realm, as a soap-sts deployment is specific to a given realm.TgetSTSInstanceConfig(String stsInstanceId, String realm)Returns the STSInstanceConfig subclass corresponding to the stsInstanceId parameter.booleanisInstancePresent(String stsId, String realm)This method returns whether STS instance config referenced by the realm and id is present in the SMS.voidpersistSTSInstance(String stsInstanceId, String realm, T instance)Persists the STS instance into the SMS.voidremoveSTSInstance(String stsInstanceId, String realm)Removes the sts instance corresponding to the id from the SMS.voidupdateSTSInstance(String stsInstanceId, String realm, T instance)Updates attributes corresponding to the existing STS instance.
-
-
-
Constructor Detail
-
STSInstanceConfigStoreBase
public STSInstanceConfigStoreBase(InstanceConfigMarshaller<T> instanceConfigMarshaller, String serviceName, org.slf4j.Logger logger)
-
-
Method Detail
-
persistSTSInstance
public void persistSTSInstance(String stsInstanceId, String realm, T instance) throws STSPublishException
Persists the STS instance into the SMS.- Specified by:
persistSTSInstancein interfaceSTSInstanceConfigStore<T extends STSInstanceConfig>- Parameters:
stsInstanceId- the identifier for the to-be-published sts instancerealm- The realm in which the sts instance should be deployedinstance- The to-be-persisted state.- Throws:
STSPublishException- if the SMS encounters a problem during persistence.
-
removeSTSInstance
public void removeSTSInstance(String stsInstanceId, String realm) throws STSPublishException
Removes the sts instance corresponding to the id from the SMS.- Specified by:
removeSTSInstancein interfaceSTSInstanceConfigStore<T extends STSInstanceConfig>- Parameters:
stsInstanceId- The id of the to-be-removed sts instance.realm- the realm in which the sts instance was deployed. Necessary for SMS lookup.- Throws:
STSPublishException- if the SMS encounters an error during the removal.
-
updateSTSInstance
public void updateSTSInstance(String stsInstanceId, String realm, T instance) throws STSPublishException
Updates attributes corresponding to the existing STS instance.- Specified by:
updateSTSInstancein interfaceSTSInstanceConfigStore<T extends STSInstanceConfig>- Parameters:
stsInstanceId- the identifier for the to-be-updated sts instancerealm- The realm in which the sts instance should be deployedinstance- The updated STSInstanceConfig subclass- Throws:
STSPublishException- if the SMS encounters a problem during persistence.
-
getSTSInstanceConfig
public T getSTSInstanceConfig(String stsInstanceId, String realm) throws STSPublishException
Returns the STSInstanceConfig subclass corresponding to the stsInstanceId parameter.- Specified by:
getSTSInstanceConfigin interfaceSTSInstanceConfigStore<T extends STSInstanceConfig>- Parameters:
stsInstanceId- the identifier of the stsrealm- the realm in which the sts instance was deployed. Necessary for SMS lookup.- Returns:
- the SoapSTSInstanceConfig or RestSTSInstanceConfig instance corresponding to this published instance.
- Throws:
STSPublishException- if no instance could be found, or if the SMS encountered an error during the lookup.
-
getAllPublishedInstances
public List<T> getAllPublishedInstances() throws STSPublishException
Description copied from interface:STSInstanceConfigStoreThis method will be called by some startup context in the {locally|remotely} deployed {REST|SOAP} STS context to obtain all of the previously-published STS instances. The publish service will be called with all obtained instances. This will the set of published STS instances to be reconstituted following a server restart.- Specified by:
getAllPublishedInstancesin interfaceSTSInstanceConfigStore<T extends STSInstanceConfig>- Returns:
- A non-null, but possibly empty list containing all of the STSInstanceConfig subclasses corresponding to published rest or soap sts instances.
- Throws:
STSPublishException- if the realm names, necessary to obtain the sts instances published in each, could not be obtained.
-
getPublishedInstances
public List<T> getPublishedInstances(String realm) throws STSPublishException
Description copied from interface:STSInstanceConfigStoreThis method will be called by some startup context in the remotely deployed SOAP STS context to obtain all of the previously-published soap STS instances for a given realm, as a soap-sts deployment is specific to a given realm.- Specified by:
getPublishedInstancesin interfaceSTSInstanceConfigStore<T extends STSInstanceConfig>- Returns:
- The List of STSInstanceConfig instances (possibly empty) corresponding to the set of previously-published instances in the specified realm.
- Throws:
STSPublishException
-
isInstancePresent
public boolean isInstancePresent(String stsId, String realm) throws STSPublishException
Description copied from interface:STSInstanceConfigStoreThis method returns whether STS instance config referenced by the realm and id is present in the SMS. It is called by RestSTSPublishServiceRequestHandler#handleUpdate to determine whether the referenced sts id actually corresponds to a previously-published instance- Specified by:
isInstancePresentin interfaceSTSInstanceConfigStore<T extends STSInstanceConfig>- Parameters:
stsId- The unique identifier for a particular STSInstanceConfig. Currently obtained by calling RestSTSInstanceConfig#getDeploymentSubPath.realm- the realm in which the sts instance was deployed. Necessary for SMS lookup.- Returns:
- true if the instance is present
- Throws:
STSPublishException- If an exception is encountered consulting the SMS.
-
-