Package com.sodius.oslc.server.process
Class LinkingType
java.lang.Object
com.sodius.oslc.server.process.LinkingType
Either an OSLC domain or
LinkType for linking two application's artifacts.- Since:
- 3.1.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleancorresponds(ProjectAreaAssociation association) Determines whether this linking type corresponds to a givenProjectAreaAssociation.voidfilter(OslcCore.Finder<Dialog> filter) Appends the target range of this instance to an OSLC dialog filter.static LinkingTypeforLinkCompact(URI uri, ApplicationArtifact artifact) Unlikeof(URI, ApplicationArtifact), this method does not raise an exception if theartifacttype mismatches the source range of the linking type, if any.Gets the linking group identifier to which this linking type belongs.Gets the underlying link type, if any.Gets the target domain of this instance.Gets the target types of this instance.getTitle()Gets the linking type title.getUri()Gets the URI of the linking type.booleanDetermines whether this linking type matches aLinkType.static LinkingTypeof(URI uri, ApplicationArtifact artifact) Builds an instance given the linking URI and HTTP request.
-
Method Details
-
of
public static LinkingType of(URI uri, ApplicationArtifact artifact) throws LinkingTypesStoreException Builds an instance given the linking URI and HTTP request.- Parameters:
uri- the linking URI.artifact- the linking artifact.- Returns:
- the corresponding instance.
- Throws:
LinkingTypesStoreException- if an error prevents link types from being retrieved - added in 3.13.0.NullPointerException- if eitheruriorrequestisnull.OslcWebApplicationException- ifuriis an unknown OSLC domain or an unknown/invalidLinkType.- Since:
- 3.13.0
-
forLinkCompact
public static LinkingType forLinkCompact(URI uri, ApplicationArtifact artifact) throws LinkingTypesStoreException Unlikeof(URI, ApplicationArtifact), this method does not raise an exception if theartifacttype mismatches the source range of the linking type, if any. This is convenient for resolvingCompactresources 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 asofin such case- Parameters:
uri- the linking URI.artifact- the linking artifact.- Returns:
- the corresponding instance.
- Throws:
LinkingTypesStoreException- if an error prevents link types from being retrieved - added in 3.13.0.NullPointerException- if eitheruriorrequestisnull.OslcWebApplicationException- ifuriis an unknown OSLC domain or an unknownLinkType.- Since:
- 3.13.0
-
getUri
Gets the URI of the linking type.- Returns:
- the linking type URI.
-
getTitle
Gets the linking type title.- Returns:
- the linking type title.
- Since:
- 3.5.0
-
getLinkType
Gets the underlying link type, if any.- Returns:
- the underlying link type.
- Since:
- 3.13.0
-
getTargetDomain
Gets the target domain of this instance.- Returns:
- the target domain URI.
-
filter
Appends the target range of this instance to an OSLC dialog filter.- Parameters:
filter- the OSLC dialog filter.- Throws:
LinkingTypesStoreException- if an error prevents link types from being retrieved - added in 3.13.0.- Since:
- 3.13.0
-
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.13.0
-
matches
Determines whether this linking type matches aLinkType.- Parameters:
linkType- the given link type.- Returns:
trueif thelinkTypematches this linking type;falseotherwise.
-
corresponds
Determines whether this linking type corresponds to a givenProjectAreaAssociation.- Parameters:
association- the given association.- Returns:
trueif this linking type corresponds to theassociation;falseotherwise.- Throws:
LinkingTypesStoreException- if an error prevents link types from being retrieved - added in 3.13.0.- Since:
- 3.3.0
-
getLinkingGroup
Gets the linking group identifier to which this linking type belongs.- Returns:
- the
AssociationType.getIdentifier()of the correspondinglink typeif present;domain URIotherwise. - Throws:
LinkingTypesStoreException- if an error prevents association types from being retrieved - added in 3.13.0.- Since:
- 3.13.0
-