Class LinkType
- All Implemented Interfaces:
IExtendedResource,IResource
Link types are grouped by AssociationType.
Here are some resources listing existing OSLC link types:
- Jazz wiki (association types): https://jazz.net/wiki/bin/view/Main/CALM2010LinkTypes
- Jazz wiki (CLM): https://jazz.net/wiki/bin/view/Deployment/IntegratingWithConfigurationManagementEnabledCLMApplications
- Jazz RM help page: https://jazz.net/help-dev/clm/index.jsp?re=1&topic=/com.ibm.rational.rrm.help.doc/topics/r_rm_link_domains.html
The set of supported link types can be restricted to a subset using a ProcessScope instance,
that all methods returning link types in this class will use.
- Since:
- 1.3.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<LinkType>forAssociationType(String associationTypeId) Returns the supported link types for the given association type.static Collection<LinkType>forPropertyDefinition(URI propertyDefinition) Returns the supported link types for the given property definition.static Collection<LinkType>forSourceRange(URI sourceRange) Returns the supported link types for the given source range.Gets the identifiers of the association types this link belongs to.Gets the link type's default deliverable type.static Optional<DeliverableType>getDeliverableType(URI propertyDefinition) Returns the link type default deliverable type for the given property definition.Gets the link type's default deliverable type name.Gets the link Direction as its enum value, if possible.static Optional<LinkType.Direction>getDirection(URI propertyDefinition) Returns the link type direction for the given property definition.static Collection<LinkType>Returns all supported link types.Get, if it exists in theLinkingTypesStore, theResourceTypefrom this link source range URI.Gets the target type domain.Get, if it exists in theLinkingTypesStore, theResourceTypefrom this link target range URI.getTitle()static booleanisNonStorableLink(URI linkType) Determines whether the link type is only present to be able to display a backlink title and should never be stored.booleanDetermines whether the end-user must be offered to create a link of such type.voidsetAssociationTypesIdentifiers(Collection<String> associationTypes) Sets the association types this link belongs to using their identifiers.voidsetBacklinkPropertyDefinition(URI backlinkPropertyDefinition) voidsetDeliverableType(DeliverableType deliverableType) Sets the link type's default deliverable type.voidsetDeliverableTypeName(String deliverableTypeName) Sets the link type's default deliverable type using the enumeration name property.voidsetLinkDirection(String linkDirection) voidsetPropertyDefinition(URI propertyDefinition) voidsetSourceRange(URI sourceRange) voidsetTargetDomain(Domain targetDomain) Sets the target type domain.voidsetTargetRange(URI targetRange) voidMethods inherited from class org.eclipse.lyo.oslc4j.core.model.AbstractResource
addType, getAbout, getExtendedProperties, getTypes, setAbout, setExtendedProperties, setTypes
-
Constructor Details
-
LinkType
public LinkType() -
LinkType
-
-
Method Details
-
getLinkTypes
Returns all supported link types.- Returns:
- all supported link types.
- Throws:
LinkingTypesStoreException- if an error prevents link types from being retrieved - added in 3.13.0.- Since:
- 3.13.0
-
forAssociationType
public static Collection<LinkType> forAssociationType(String associationTypeId) throws LinkingTypesStoreException Returns the supported link types for the given association type.- Parameters:
associationTypeId- the association type identifier- Returns:
- the corresponding link types
- Throws:
LinkingTypesStoreException- if an error prevents link types from being retrieved - added in 3.13.0.- Since:
- 3.13.0
-
forSourceRange
public static Collection<LinkType> forSourceRange(URI sourceRange) throws LinkingTypesStoreException Returns the supported link types for the given source range.- Parameters:
sourceRange- the source range (e.g:OslcCm.TYPE_CHANGE_REQUEST,OslcAm.TYPE_AMRESOURCE,OslcRm.TYPE_REQUIREMENT...)- Returns:
- the supported link types
- Throws:
LinkingTypesStoreException- if an error prevents link types from being retrieved - added in 3.13.0.- Since:
- 3.13.0
-
forPropertyDefinition
public static Collection<LinkType> forPropertyDefinition(URI propertyDefinition) throws LinkingTypesStoreException Returns the supported link types for the given property definition.- Parameters:
propertyDefinition- the link type property definition- Returns:
- the corresponding link types
- Throws:
LinkingTypesStoreException- if an error prevents link types from being retrieved - added in 3.13.0.- Since:
- 3.13.0
-
getDeliverableType
public static Optional<DeliverableType> getDeliverableType(URI propertyDefinition) throws LinkingTypesStoreException Returns the link type default deliverable type for the given property definition.Deliverable types only apply to link types between a CM resource and another configurable domain (AM, QM, RM...). Other link types will return an empty optional.
Note that while a property definition may have several corresponding link types, they will always be in the same direction.
- Parameters:
propertyDefinition- the link type property definition- Returns:
- the link type default deliverable type
- Throws:
LinkingTypesStoreException- if an error prevents link types from being retrieved.- Since:
- 3.13.0
-
getDirection
public static Optional<LinkType.Direction> getDirection(URI propertyDefinition) throws LinkingTypesStoreException Returns the link type direction for the given property definition.Note that while a property definition may have several corresponding link types, they will always be in the same direction.
- Parameters:
propertyDefinition- the link type property definition- Returns:
- the link type direction
- Throws:
LinkingTypesStoreException- if an error prevents link types from being retrieved.- Since:
- 3.13.0
-
getPropertyDefinition
@OslcPropertyDefinition("http://open-services.net/ns/core#propertyDefinition") public URI getPropertyDefinition() -
setPropertyDefinition
-
getTitle
@OslcPropertyDefinition("http://purl.org/dc/terms/title") @OslcValueType(XMLLiteral) public String getTitle() -
setTitle
-
getBacklinkPropertyDefinition
@OslcPropertyDefinition("http://www.sodius.com/ns/process#backlinkPropertyDefinition") public URI getBacklinkPropertyDefinition() -
setBacklinkPropertyDefinition
-
getSourceRange
-
getSourceType
Get, if it exists in theLinkingTypesStore, theResourceTypefrom this link source range URI.- Returns:
- An optional containing either the resource type of the link source range if it exists in the store, or
Optional.empty()otherwise. - Throws:
LinkingTypesStoreException- if an error prevents link types from being retrieved.- Since:
- 3.13.0
-
setSourceRange
-
getTargetRange
-
getTargetType
Get, if it exists in theLinkingTypesStore, theResourceTypefrom this link target range URI.- Returns:
- An optional containing either the resource type of the link target range if it exists in the store, or
Optional.empty()otherwise. - Throws:
LinkingTypesStoreException- if an error prevents link types from being retrieved.- Since:
- 3.13.0
-
setTargetRange
-
getLinkDirection
@OslcPropertyDefinition("http://www.sodius.com/ns/process#linkDirection") public String getLinkDirection() -
getDirection
Gets the link Direction as its enum value, if possible.- Returns:
- the link direction as a value of
LinkType.Directionif its exists,Optional.empty()otherwise. - Since:
- 3.13.0
-
setLinkDirection
-
getAssociationTypesIdentifiers
@OslcPropertyDefinition("http://www.sodius.com/ns/process#associationType") @OslcName("associationType") public Collection<String> getAssociationTypesIdentifiers()Gets the identifiers of the association types this link belongs to.- Returns:
- the identifiers of the association types this link belongs to.
- Since:
- 3.13.0
-
setAssociationTypesIdentifiers
Sets the association types this link belongs to using their identifiers.- Parameters:
associationTypes- the association type identifiers this link belongs to.- Since:
- 3.13.0
-
getDeliverableType
Gets the link type's default deliverable type.Deliverable types only apply to link types between a CM resource and another configurable domain (AM, QM, RM...). Other link types will return an empty optional.
- Returns:
- the link type's default deliverable type if present,
Optional.empt()otherwise. - Since:
- 3.13.0
-
setDeliverableType
Sets the link type's default deliverable type.- Parameters:
deliverableType- the deliverable type to set- Since:
- 3.13.0
-
getDeliverableTypeName
@OslcPropertyDefinition("http://www.sodius.com/ns/process#deliverableType") @OslcName("deliverableType") public String getDeliverableTypeName()Gets the link type's default deliverable type name.- Returns:
- the link type's default deliverable type name.
- Since:
- 3.13.0
-
setDeliverableTypeName
Sets the link type's default deliverable type using the enumeration name property.- Parameters:
deliverableTypeName- the link type's default deliverable type name.- Since:
- 3.13.0
-
getTargetDomain
@OslcPropertyDefinition("http://www.sodius.com/ns/process#targetDomain") @OslcRepresentation(Inline) @OslcValueType(LocalResource) public Domain getTargetDomain()Gets the target type domain.- Returns:
- the target type domain.
- Since:
- 3.13.0
-
setTargetDomain
Sets the target type domain.- Parameters:
targetDomain- the target type domain.- Since:
- 3.13.0
-
isUserSelectable
Determines whether the end-user must be offered to create a link of such type. Most of the link types can be initiated by the end-user on his local resource, but some can only be created from the opposite bound, typically thetracksChangeSetone.- Returns:
trueif the end-user can create such link on his local resource,falseotherwise.- Throws:
LinkingTypesStoreException- if an error prevents link types from being retrieved - added in 3.13.0.- Since:
- 3.13.0
-
isNonStorableLink
Determines whether the link type is only present to be able to display a backlink title and should never be stored.- Parameters:
linkType- Property definition of the LinkType.- Returns:
- true if the link type should never be stored, false otherwise.
- Throws:
LinkingTypesStoreException- if an error prevents link types from being retrieved.- Since:
- 3.13.0
-