Class ProcessSchemeStore
java.lang.Object
com.sodius.oslc.server.process.scheme.ProcessSchemeStore
Manages access to process schemes.
Subclasses need to ensure that the first time the store is accessed, a default scheme is automatically created if none yet exists.
- Since:
- 3.5.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddScheme(ProcessScheme scheme) Adds a new scheme.static ProcessSchemeStoreReturns the current store instance.abstract StringgetProjectAreaScheme(String projectAreaIdentifier) Resolves the scheme identifier to which the given project area is associated.abstract Optional<ProcessScheme> Resolves a scheme by identifier.abstract Collection<String> getSchemeProjectAreas(String schemeIdentifier) Resolves the identifiers of the project areas associated to the given scheme.abstract Collection<ProcessScheme> Resolves the registered schemes.abstract voidremoveScheme(String identifier) Removes the scheme of given identifier.static voidsetInstance(ProcessSchemeStore store) Replaces the current store instance with the given one.abstract voidsetProjectAreaScheme(String projectAreaIdentifier, String schemeIdentifier) Replaces the scheme associated with the given project area.abstract voidupdateScheme(ProcessScheme scheme) Updates a scheme.
-
Constructor Details
-
ProcessSchemeStore
public ProcessSchemeStore()
-
-
Method Details
-
getInstance
Returns the current store instance.- Returns:
- the current instance.
- See Also:
-
setInstance
Replaces the current store instance with the given one.- Parameters:
store- the new store.
-
getSchemes
Resolves the registered schemes. Implementation needs to ensure a default scheme is created if none yet exists.- Returns:
- the registered schemes.
- Throws:
ProcessSchemeStoreException- if an error prevents schemes from being retrieved.
-
getScheme
public abstract Optional<ProcessScheme> getScheme(String identifier) throws ProcessSchemeStoreException Resolves a scheme by identifier.- Parameters:
identifier- the given identifier.- Returns:
- the scheme for the given identifier, an empty
Optionalif none - Throws:
ProcessSchemeStoreException- if an error prevents the scheme from being retrieved.
-
addScheme
Adds a new scheme.- Parameters:
scheme- the scheme to add- Throws:
ProcessSchemeStoreException- if an error prevents the scheme from being added.
-
removeScheme
Removes the scheme of given identifier.- Parameters:
identifier- the given identifier.- Throws:
ProcessSchemeStoreException- if an error prevents the scheme from being removed.
-
updateScheme
Updates a scheme.- Parameters:
scheme- the scheme to update- Throws:
ProcessSchemeStoreException- if an error prevents the scheme from being updated.
-
getSchemeProjectAreas
public abstract Collection<String> getSchemeProjectAreas(String schemeIdentifier) throws ProcessSchemeStoreException Resolves the identifiers of the project areas associated to the given scheme.- Parameters:
schemeIdentifier- the identifier of a scheme- Returns:
- the list of project areas identifiers which are bound to the given scheme
- Throws:
ProcessSchemeStoreException- if an error prevents the associations from being read.
-
getProjectAreaScheme
public abstract String getProjectAreaScheme(String projectAreaIdentifier) throws ProcessSchemeStoreException Resolves the scheme identifier to which the given project area is associated. Subclasses needs to ensure the project is always associated to a given scheme, which can be the default scheme.- Parameters:
projectAreaIdentifier- the identifier of a project area- Returns:
- the identifier of the scheme to which the given project area is associated.
- Throws:
ProcessSchemeStoreException- if an error prevents the association from being read.
-
setProjectAreaScheme
public abstract void setProjectAreaScheme(String projectAreaIdentifier, String schemeIdentifier) throws ProcessSchemeStoreException Replaces the scheme associated with the given project area.- Parameters:
projectAreaIdentifier- the identifier of the project areaschemeIdentifier- the identifier of the new scheme to assign- Throws:
ProcessSchemeStoreException- if an error prevents the association from being created.
-