Package com.sodius.oslc.server.process
Class ProjectAreaAssociationStore
- java.lang.Object
-
- com.sodius.oslc.server.process.ProjectAreaAssociationStore
-
public abstract class ProjectAreaAssociationStore extends Object
Manages persistence of ProjectArea associations.- Since:
- 2.0.0
- See Also:
ProjectAreaAssociation
-
-
Constructor Summary
Constructors Constructor Description ProjectAreaAssociationStore()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract 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.abstract Collection<ProjectAreaAssociation>
getAssociations(String projectAreaId)
Returns existing associations for the given project area.static ProjectAreaAssociationStore
getInstance()
Returns the current store instance.boolean
isProjectAreaAssociated(String projectAreaId)
Determines whether a project area is associated or not.static void
setInstance(ProjectAreaAssociationStore store)
Replaces the current store instance with the given one.
-
-
-
Method Detail
-
getInstance
public static ProjectAreaAssociationStore getInstance()
Returns the current store instance.- Returns:
- the current instance.
- See Also:
setInstance(ProjectAreaAssociationStore)
-
setInstance
public static void setInstance(ProjectAreaAssociationStore store)
Replaces the current store instance with the given one.- Parameters:
store
- the new store.
-
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 exists, 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:
true
if the given project has at least one association;false
otherwise.- Throws:
ProjectAreaAssociationStoreException
- if an error occurs while querying the store- Since:
- 3.3.0
-
-