Class ProjectAreaStore
Subclasses usually only need to override getAccessibleProjectAreas().
In addition, they may override getRestrictedProjectAreas() if they have a mean to provide this information.
- Since:
- 3.3.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the OSLC enabled project areas accessible by thecurrent user.abstract Collection<ProjectArea> Gets project areas accessible by thecurrent user.static ProjectAreaStoreReturns the current store instance.Gets all the OSLC enabled project areas.Gets all the project areas, which is the union of projects accessible by thecurrent userand the ones that are not.Gets the OSLC enabled project areas not accessible by thecurrent user.Gets project areas not accessible by acurrent 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.
-
Constructor Details
-
ProjectAreaStore
public ProjectAreaStore()
-
-
Method Details
-
onProjectConfigurationEnabled
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
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
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.
-
getProjectAreas
Gets all the project areas, which is the union of projects accessible by thecurrent userand the ones that are not.Implementation must set the title and
project identifier. It must not set the service providers.Default implementation combines
getAccessibleProjectAreas()andgetRestrictedProjectAreas()- Returns:
- the collection of all project areas.
- Throws:
ProjectAreaStoreException- if an error prevents project areas from being retrieved.- Since:
- 4.0.0
-
getAccessibleProjectAreas
public abstract Collection<ProjectArea> getAccessibleProjectAreas() throws ProjectAreaStoreExceptionGets project areas accessible by thecurrent user.Implementation must set the title and
project identifier. It must not 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.
- Returns:
- a collection of accessible project areas.
- Throws:
ProjectAreaStoreException- if an error prevents project areas from being retrieved.- Since:
- 4.0.0
-
getRestrictedProjectAreas
Gets project areas not accessible by acurrent user.Implementation must set the title and
project identifier. It must not 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.
Default implementation returns an empty collection, as providing restricted project areas is rarely achievable. Subclasses may override if they have a mean to provide this information.
- Returns:
- a collection of restricted project areas.
- Throws:
ProjectAreaStoreException- if an error prevents project areas from being retrieved.- Since:
- 4.0.0
-
getOslcProjectAreas
Gets all the OSLC enabled project areas.Implementation retains OSLC-enabled projects from
getProjectAreas().- Returns:
- the collection of OSLC-enabled project areas.
- Throws:
ProjectAreaStoreException- if an error prevents project areas from being retrieved.- Since:
- 4.0.0
-
getAccessibleOslcProjectAreas
Gets the OSLC enabled project areas accessible by thecurrent user.Implementation retains OSLC-enabled projects from
getAccessibleProjectAreas().- Returns:
- a collection of OSLC accessible project areas.
- Throws:
ProjectAreaStoreException- if an error prevents project areas from being retrieved.- Since:
- 4.0.0
-
getRestrictedOslcProjectAreas
Gets the OSLC enabled project areas not accessible by thecurrent user.Implementation retains OSLC-enabled projects from
getRestrictedProjectAreas().- Returns:
- a collection of OSLC restricted project areas.
- Throws:
ProjectAreaStoreException- if an error prevents project areas from being retrieved.- Since:
- 4.0.0
-
isConfigurationManagementEnabled
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
-