Package com.sodius.oslc.server.process
Class LinkingType
- java.lang.Object
-
- com.sodius.oslc.server.process.LinkingType
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
corresponds(ProjectAreaAssociation association)
Determines whether this linking type corresponds to a givenProjectAreaAssociation
.void
filter(OslcCore.Finder<Dialog> filter)
Appends the target range of this instance to an OSLC dialog filter.static LinkingType
forLinkCompact(URI uri, ApplicationArtifact artifact, HttpServletRequest request)
Unlikeof(URI, ApplicationArtifact, HttpServletRequest)
, this method does not raise an exception if theartifact
type mismatches the source range of the linking type, if any.String
getLinkingGroup()
Gets the linking group identifier to which this linking type belongs.Optional<LinkType>
getLinkType()
Gets the underlying link type, if any.URI
getTargetDomain()
Gets the target domain of this instance.Collection<ResourceType>
getTargetTypes()
Gets the target types of this instance.String
getTitle()
Gets the linking type title.URI
getUri()
Gets the URI of the linking type.boolean
matches(LinkType linkType)
Determines whether this linking type matches aLinkType
.boolean
matches(LinkType linkType)
Determines whether this linking type matches aLinkType
.static LinkingType
of(URI uri, ApplicationArtifact artifact, HttpServletRequest request)
Builds an instance given the linking URI and HTTP request.
-
-
-
Method Detail
-
of
public static LinkingType of(URI uri, ApplicationArtifact artifact, HttpServletRequest request)
Builds an instance given the linking URI and HTTP request.- Parameters:
uri
- the linking URI.artifact
- the linking artifact.request
- the current HTTP request.- Returns:
- the corresponding instance.
- Throws:
NullPointerException
- if eitheruri
orrequest
isnull
.OslcWebApplicationException
- ifuri
is an unknown OSLC domain or an unknown/invalidLinkType
.- Since:
- 3.7.0
-
forLinkCompact
public static LinkingType forLinkCompact(URI uri, ApplicationArtifact artifact, HttpServletRequest request)
Unlikeof(URI, ApplicationArtifact, HttpServletRequest)
, this method does not raise an exception if theartifact
type mismatches the source range of the linking type, if any. This is convenient for resolvingCompact
resources of existing links which may have mutated into a different resource type after the link creation.Note: the exception will still be thrown if
the artifact type mapping store is NOT implemented
, meaning this method behaves exactly the same asof
in such case- Parameters:
uri
- the linking URI.artifact
- the linking artifact.request
- the current HTTP request.- Returns:
- the corresponding instance.
- Throws:
NullPointerException
- if eitheruri
orrequest
isnull
.OslcWebApplicationException
- ifuri
is an unknown OSLC domain or an unknownLinkType
.- Since:
- 3.9.0
-
getUri
public URI getUri()
Gets the URI of the linking type.- Returns:
- the linking type URI.
-
getTitle
public String getTitle()
Gets the linking type title.- Returns:
- the linking type title.
- Since:
- 3.5.0
-
getLinkType
public Optional<LinkType> getLinkType()
Gets the underlying link type, if any.- Returns:
- the underlying link type.
-
getTargetDomain
public URI getTargetDomain()
Gets the target domain of this instance.- Returns:
- the target domain URI.
-
filter
public void filter(OslcCore.Finder<Dialog> filter)
Appends the target range of this instance to an OSLC dialog filter.- Parameters:
filter
- the OSLC dialog filter.
-
getTargetTypes
public Collection<ResourceType> getTargetTypes()
Gets the target types of this instance.- Returns:
- an empty collection if this instance represents an OSLC domain; the target resource types of the link type otherwise.
- Since:
- 3.7.0
-
matches
public boolean matches(LinkType linkType)
Determines whether this linking type matches aLinkType
.- Parameters:
linkType
- the given link type.- Returns:
true
if thelinkType
matches this linking type;false
otherwise.
-
matches
public boolean matches(LinkType linkType)
Determines whether this linking type matches aLinkType
.- Parameters:
linkType
- the given link type.- Returns:
true
if thelinkType
matches this linking type;false
otherwise.
-
corresponds
public boolean corresponds(ProjectAreaAssociation association)
Determines whether this linking type corresponds to a givenProjectAreaAssociation
.- Parameters:
association
- the given association.- Returns:
true
if this linking type corresponds to theassociation
;false
otherwise.- Since:
- 3.3.0
-
getLinkingGroup
public String getLinkingGroup()
Gets the linking group identifier to which this linking type belongs.- Returns:
- the
AssociationType.getIdentifier()
of the correspondinglink type
if present;domain URI
otherwise. - Since:
- 3.3.0
-
-