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 ProjectAreaStoregetInstance()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.booleanisConfigurationManagementEnabled(String projectAreaId)Determines whether Configuration Management is enabled on a given project area.static voidoffProjectConfigurationEnabled(Consumer<String> action)Removes an action from being notified when a project area is Configuration Management enabled.static voidonProjectConfigurationEnabled(Consumer<String> action)Registers an action to get executed when a project area is Configuration Management enabled.voidsetConfigurationManagementEnabled(String projectAreaId, boolean enabled)Updates the Configuration Management status on a given project area.static voidsetInstance(ProjectAreaStore store)Replaces the current store instance with the given one.
-
-
-
Method Detail
-
onProjectConfigurationEnabled
public static void onProjectConfigurationEnabled(Consumer<String> action)
Registers an action to get executed when a project area is Configuration Management enabled.Changes that occurred before the registration are not notified, registrations should be done at application startup. All actions will be executed on a dedicated thread and no exceptions must be thrown but handled internally.
Actions are all automatically unregistered when the application is
disposed.- Parameters:
action- the action to execute.- Since:
- 3.9.0
-
offProjectConfigurationEnabled
public static void offProjectConfigurationEnabled(Consumer<String> action)
Removes an action from being notified when a project area is Configuration Management enabled.Actions are all automatically unregistered when the application is
disposed.- Parameters:
action- the action to execute.- Since:
- 3.9.0
-
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:identifierextended 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:identifierextended 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.
-
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:
trueif Configuration Management is enabled;falseotherwise.- 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
-
-