Class ProcessScope
An OSLC application may not necessarily support all available resource types, associations and links.
For example LinkType.TRACKS_WORK_ITEM relates to planning
and may not make sense for all Change Management applications.
The application is also likely to support locally only a subset of available OSLC resource types.
An application can restrict the supported associations and links to a subset of available ones
by changing the ProcessScope at initialization time, using following code:
ProcessScope.setInstance(ProcessScope.builder() //
.resourceType(ResourceType.CHANGE_REQUEST) //
.association(AssociationType.RELATED_TO) //
.link(LinkType.RELATED_CHANGE_REQUEST) //
.build());
This class implements Predicate so that a domain, resource type, association or link types Stream
can easily be filtered with a ProcessScope instance.
- Since:
- 1.9.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classEnables configuring and creating aProcessScopeinstance. -
Method Summary
Modifier and TypeMethodDescriptionstatic ProcessScope.Builderbuilder()Creates a builder to configure and build a newProcessScopeinstance.booleancontains(AssociationType type) Determines if the given association type is supported by this scope instance.booleanDetermines if the given domain is supported by this scope instance, meaning one that defines a type of artifact that the local application enables managing.booleanDetermines if the given link type is supported by this scope instance.booleancontains(ResourceType type) Determines if the given resource type is supported by this scope instance, meaning one whose artifacts can be managed by that the local application.static ProcessScopeReturns the current scope instance.static voidsetInstance(ProcessScope scope) Replaces the current scope with the given one.booleanDetermines if the given domain, resource type, association type or link type is supported by this scope instance.
-
Method Details
-
getInstance
Returns the current scope instance. Default instance supports all available resource types, associations and links.- Returns:
- the current instance.
- See Also:
-
setInstance
Replaces the current scope with the given one.- Parameters:
scope- the new scope.
-
builder
Creates a builder to configure and build a newProcessScopeinstance.- Returns:
- a scope builder.
-
contains
Determines if the given domain is supported by this scope instance, meaning one that defines a type of artifact that the local application enables managing.As
SCMis not associated to any resource type, implementation considers this domain is supported ifDeliverabletype also is.- Parameters:
domain- the domain- Returns:
trueif the domain is part of the scope,falseotherwise.- Since:
- 3.5.0
-
contains
Determines if the given resource type is supported by this scope instance, meaning one whose artifacts can be managed by that the local application.- Parameters:
type- the resource type- Returns:
trueif the resource type is part of the scope,falseotherwise.- Since:
- 3.5.0
-
contains
Determines if the given association type is supported by this scope instance.- Parameters:
type- an association type to test.- Returns:
trueif the link type is part of the scope,falseotherwise.
-
contains
Determines if the given link type is supported by this scope instance.- Parameters:
type- a link type to test.- Returns:
trueif the link type is part of the scope,falseotherwise.
-
test
Determines if the given domain, resource type, association type or link type is supported by this scope instance.
-