Package com.sodius.oslc.server.process
Class ProjectAreaStore
- java.lang.Object
-
- com.sodius.oslc.server.process.ProjectAreaStore
-
public abstract class ProjectAreaStore extends Object
Manages access to OSLC project areas.- Since:
- 3.3.0
-
-
Constructor Summary
Constructors Constructor Description ProjectAreaStore()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Collection<ProjectArea>
getAccessibleOslcProjectAreas(String userIdentifier)
Gets the OSLC enabled project areas accessible by a user.abstract Collection<ProjectArea>
getAccessibleProjectAreas(String userIdentifier)
Gets project areas accessible by a user.static ProjectAreaStore
getInstance()
Returns the current store instance.Collection<ProjectArea>
getRestrictedOslcProjectAreas(String userIdentifier)
Gets the OSLC enabled project areas not accessible by a user.abstract Collection<ProjectArea>
getRestrictedProjectAreas(String userIdentifier)
Gets project areas not accessible by a user.boolean
isConfigurationManagementEnabled(String projectAreaId)
Determines whether Configuration Management is enabled on a given project area.protected boolean
isOslcProject(ProjectArea projectArea)
Determines whether a project area is OSLC enabled or not.void
setConfigurationManagementEnabled(String projectAreaId, boolean enabled)
Updates the Configuration Management status on a given project area.static void
setInstance(ProjectAreaStore store)
Replaces the current store instance with the given one.
-
-
-
Method Detail
-
getInstance
public static ProjectAreaStore getInstance()
Returns the current store instance.- Returns:
- the current instance.
- See Also:
setInstance(ProjectAreaStore)
-
setInstance
public static void setInstance(ProjectAreaStore store)
Replaces the current store instance with the given one.- Parameters:
store
- the new store.
-
getAccessibleProjectAreas
public abstract Collection<ProjectArea> getAccessibleProjectAreas(String userIdentifier) throws ProjectAreaStoreException
Gets project areas accessible by a user. Implementations MUST set the project identifier into thedcterms:identifier
extended property but are not required to set the service providers. If the application APIs do not allow access to the project area title for users without a READ permission, then this method should return an empty collection.- Parameters:
userIdentifier
- the user identifier.- Returns:
- a collection of accessible project areas.
- Throws:
ProjectAreaStoreException
- if an error prevents project areas from being retrieved.
-
getRestrictedProjectAreas
public abstract Collection<ProjectArea> getRestrictedProjectAreas(String userIdentifier) throws ProjectAreaStoreException
Gets project areas not accessible by a user. Implementations MUST set the project identifier into thedcterms:identifier
extended property but are not required to set the service providers. If the application APIs do not allow access to the project area title for users without a READ permission, then this method should return an empty collection.- Parameters:
userIdentifier
- the user identifier.- Returns:
- a collection of restricted project areas.
- Throws:
ProjectAreaStoreException
- if an error prevents project areas from being retrieved.
-
isOslcProject
protected boolean isOslcProject(ProjectArea projectArea) throws ProjectAreaStoreException
Determines whether a project area is OSLC enabled or not. By default, a project area is OSLC enabled when there is at least one remote associated project area.- Parameters:
projectArea
- the testing project area.- Returns:
true
if the given project is OSLC enabled;false
otherwise.- Throws:
ProjectAreaStoreException
- if an error prevents the OSLC-enabled resolution.
-
getAccessibleOslcProjectAreas
public Collection<ProjectArea> getAccessibleOslcProjectAreas(String userIdentifier) throws ProjectAreaStoreException
Gets the OSLC enabled project areas accessible by a user.- Parameters:
userIdentifier
- the user identifier.- Returns:
- a collection of OSLC accessible project areas.
- Throws:
ProjectAreaStoreException
- if an error prevents project areas from being retrieved.
-
getRestrictedOslcProjectAreas
public Collection<ProjectArea> getRestrictedOslcProjectAreas(String userIdentifier) throws ProjectAreaStoreException
Gets the OSLC enabled project areas not accessible by a user.- Parameters:
userIdentifier
- the user identifier.- Returns:
- a collection of OSLC restricted project areas.
- Throws:
ProjectAreaStoreException
- if an error prevents project areas from being retrieved.
-
isConfigurationManagementEnabled
public boolean isConfigurationManagementEnabled(String projectAreaId) throws SettingStoreException
Determines whether Configuration Management is enabled on a given project area.- Parameters:
projectAreaId
- the given project area id.- Returns:
true
if Configuration Management is enabled;false
otherwise.- Throws:
SettingStoreException
- if a storage exception occurs.- Since:
- 3.7.0
-
setConfigurationManagementEnabled
public void setConfigurationManagementEnabled(String projectAreaId, boolean enabled) throws SettingStoreException
Updates the Configuration Management status on a given project area.- Parameters:
projectAreaId
- the given project area id.enabled
- the next Configuration Management status.- Throws:
SettingStoreException
- if a storage exception occurs.- Since:
- 3.7.0
-
-