Package com.sodius.oslc.server.process
Class ProjectAreaAssociationStore
java.lang.Object
com.sodius.oslc.server.process.ProjectAreaAssociationStore
Manages persistence of ProjectArea associations.
- Since:
- 2.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Collection<ProjectAreaAssociation> addAssociations(String projectAreaId, Collection<ProjectAreaAssociation> associations) Adds project area associations.abstract Collection<ProjectAreaAssociation> deleteAssociations(String projectAreaId, Collection<String> associationIds) Deletes project area associations.Gets the set of associated project ids.abstract Collection<ProjectAreaAssociation> getAssociations(String projectAreaId) Returns existing associations for the given project area.static ProjectAreaAssociationStoreReturns the current store instance.booleanisProjectAreaAssociated(String projectAreaId) Determines whether a project area is associated or not.static voidReplaces the current store instance with the given one.
-
Constructor Details
-
ProjectAreaAssociationStore
public ProjectAreaAssociationStore()
-
-
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.
-
getAssociatedProjects
Gets the set of associated project ids.- Returns:
- the set of associated project ids.
- Throws:
ProjectAreaAssociationStoreException- if an error occurs while querying the store.- Since:
- 3.9.0
-
getAssociations
public abstract Collection<ProjectAreaAssociation> getAssociations(String projectAreaId) throws ProjectAreaAssociationStoreException Returns existing associations for the given project area.- Parameters:
projectAreaId- the project area identifier- Returns:
- the project area's associations
- Throws:
ProjectAreaAssociationStoreException- if an error occurs while querying the store
-
addAssociations
public abstract Collection<ProjectAreaAssociation> addAssociations(String projectAreaId, Collection<ProjectAreaAssociation> associations) throws ProjectAreaAssociationStoreException Adds project area associations. If the association already exists, nothing is done and no error is thrown.- Parameters:
projectAreaId- the project area identifierassociations- the association(s) to add- Returns:
- the stored association(s)
- Throws:
ProjectAreaAssociationStoreException- if an error occurs while updating the store- Since:
- 3.5.0
-
deleteAssociations
public abstract Collection<ProjectAreaAssociation> deleteAssociations(String projectAreaId, Collection<String> associationIds) throws ProjectAreaAssociationStoreException Deletes project area associations. If the association does not exist, nothing is done and no error is thrown.- Parameters:
projectAreaId- the project area identifierassociationIds- the project area association identifier(s)- Returns:
- the removed project associations
- Throws:
ProjectAreaAssociationStoreException- if an error occurs while updating the store- Since:
- 3.5.0
-
isProjectAreaAssociated
public boolean isProjectAreaAssociated(String projectAreaId) throws ProjectAreaAssociationStoreException Determines whether a project area is associated or not. Implementations should override this method to provide a better-performance implementation that avoids loading all associations.- Parameters:
projectAreaId- the project area identifier.- Returns:
trueif the given project has at least one association;falseotherwise.- Throws:
ProjectAreaAssociationStoreException- if an error occurs while querying the store- Since:
- 3.3.0
-