Class LinkType

java.lang.Object
org.eclipse.lyo.oslc4j.core.model.AbstractResource
com.sodius.oslc.server.process.model.LinkType
All Implemented Interfaces:
IExtendedResource, IResource

@OslcNamespace("http://www.sodius.com/ns/process#") @OslcResourceShape(title="Link Type Resource Shape", describes="http://www.sodius.com/ns/process#LinkType") public class LinkType extends AbstractResource
Describes a type of link between 2 OSLC resources.

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 Details

    • LinkType

      public LinkType()
    • LinkType

      public LinkType(LinkType linkType)
  • Method Details

    • getLinkTypes

      public static Collection<LinkType> getLinkTypes() throws LinkingTypesStoreException
      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

      public void setPropertyDefinition(URI propertyDefinition)
    • getTitle

      @OslcPropertyDefinition("http://purl.org/dc/terms/title") @OslcValueType(XMLLiteral) public String getTitle()
    • setTitle

      public void setTitle(String title)
    • getBacklinkPropertyDefinition

      @OslcPropertyDefinition("http://www.sodius.com/ns/process#backlinkPropertyDefinition") public URI getBacklinkPropertyDefinition()
    • setBacklinkPropertyDefinition

      public void setBacklinkPropertyDefinition(URI backlinkPropertyDefinition)
    • getSourceRange

      @OslcPropertyDefinition("http://www.sodius.com/ns/process#sourceRange") public URI getSourceRange()
    • getSourceType

      public Optional<ResourceType> getSourceType() throws LinkingTypesStoreException
      Get, if it exists in the LinkingTypesStore, the ResourceType from 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

      public void setSourceRange(URI sourceRange)
    • getTargetRange

      @OslcPropertyDefinition("http://www.sodius.com/ns/process#targetRange") public URI getTargetRange()
    • getTargetType

      public Optional<ResourceType> getTargetType() throws LinkingTypesStoreException
      Get, if it exists in the LinkingTypesStore, the ResourceType from 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

      public void setTargetRange(URI targetRange)
    • getLinkDirection

      @OslcPropertyDefinition("http://www.sodius.com/ns/process#linkDirection") public String getLinkDirection()
    • getDirection

      public Optional<LinkType.Direction> getDirection()
      Gets the link Direction as its enum value, if possible.
      Returns:
      the link direction as a value of LinkType.Direction if its exists, Optional.empty() otherwise.
      Since:
      3.13.0
    • setLinkDirection

      public void setLinkDirection(String linkDirection)
    • 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

      public void setAssociationTypesIdentifiers(Collection<String> associationTypes)
      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

      public Optional<DeliverableType> 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

      public void setDeliverableType(DeliverableType deliverableType)
      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

      public void setDeliverableTypeName(String deliverableTypeName)
      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

      public void setTargetDomain(Domain targetDomain)
      Sets the target type domain.
      Parameters:
      targetDomain - the target type domain.
      Since:
      3.13.0
    • isUserSelectable

      public boolean isUserSelectable() throws LinkingTypesStoreException
      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 the tracksChangeSet one.
      Returns:
      true if the end-user can create such link on his local resource, false otherwise.
      Throws:
      LinkingTypesStoreException - if an error prevents link types from being retrieved - added in 3.13.0.
      Since:
      3.13.0
    • isNonStorableLink

      public static boolean isNonStorableLink(URI linkType) throws LinkingTypesStoreException
      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