Package com.polarion.platform.context
Interface IContextNatureProvider
public interface IContextNatureProvider
Interface for contribution of Project nature recognition logic.
- Author:
- POLARION SOFTWARE
-
Method Summary
Modifier and TypeMethodDescriptionDetermines the nature for given context.getHistoricalLocations
(String projectId) This method is used during decision, how theIContextId
for given location will look like - whether it's a project one or group one.void
locationsMoved
(List locationPairs) Notification, that location, which maps-to (and possibly contains) some contexts was moved.void
setContextService
(IContextService contextService) Used to init with context service, which might be needed to implementation ofIContextObjectMapper
.
-
Method Details
-
getProjectIdForLocation
This method is used during decision, how theIContextId
for given location will look like - whether it's a project one or group one.Call to
locationsMoved(List)
will update this information.- Parameters:
loc
-- Returns:
- The project Id for locations, which are roots of projects,
null
otherwise.
-
determineContextNature
Determines the nature for given context. The nature logic/consistency is maintained by the ContextService, which is able to recognizeContextNature.ROOT_NATURE
ContextNature.REPOSITORY_NATURE
. Contexts below these are travesrsed and passed to this function. Ifnull
is returned, than child contexts are examined. If there is any child (even deep one) withContextNature.PROJECT_NATURE
then the context receivesContextNature.PROJECT_GROUP_NATURE
, otherwise it's not considered context any more. IfContextNature.IGNORE_NATURE
is returned, than the context and it's children are ignored (are not considered being contexts any more).- Parameters:
ctx
-- Returns:
- Either
null
,ContextNature.PROJECT_NATURE
orContextNature.IGNORE_NATURE
.
-
setContextService
Used to init with context service, which might be needed to implementation ofIContextObjectMapper
. This method should be called by the ContextService itself- Parameters:
contextService
-
-
locationsMoved
Notification, that location, which maps-to (and possibly contains) some contexts was moved.Called by the service, so that the provider can update it's internal state, before the procession of the new locations will start.
- Parameters:
locationPairs
- List of ILocation[] { oldLoc, newLoc } of all locations, which map to a context and were moved
-
getHistoricalLocations
- Since:
- 3.5.3
-