Enum Class LinkType

java.lang.Object
java.lang.Enum<LinkType>
com.sodius.oslc.core.process.model.LinkType
All Implemented Interfaces:
Serializable, Comparable<LinkType>, java.lang.constant.Constable

public enum LinkType extends Enum<LinkType>
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.7.0
  • Enum Constant Details

    • TESTED_BY_TEST_CASE

      public static final LinkType TESTED_BY_TEST_CASE
    • TESTS_CHANGE_REQUEST

      public static final LinkType TESTS_CHANGE_REQUEST
    • BLOCKS_TEST_EXECUTION_RECORD

      public static final LinkType BLOCKS_TEST_EXECUTION_RECORD
    • BLOCKED_BY_CHANGE_REQUEST

      public static final LinkType BLOCKED_BY_CHANGE_REQUEST
    • AFFECTS_TEST_RESULT

      public static final LinkType AFFECTS_TEST_RESULT
    • AFFECTED_BY_CHANGE_REQUEST

      public static final LinkType AFFECTED_BY_CHANGE_REQUEST
    • VALIDATES_REQUIREMENT_TEST_CASE

      public static final LinkType VALIDATES_REQUIREMENT_TEST_CASE
    • VALIDATED_BY_TEST_CASE

      public static final LinkType VALIDATED_BY_TEST_CASE
    • VALIDATES_REQUIREMENT_COLLECTION

      public static final LinkType VALIDATES_REQUIREMENT_COLLECTION
    • VALIDATED_BY_TEST_PLAN

      public static final LinkType VALIDATED_BY_TEST_PLAN
    • VALIDATES_ARCHITECTURE_ELEMENT

      public static final LinkType VALIDATES_ARCHITECTURE_ELEMENT
    • VALIDATED_BY

      public static final LinkType VALIDATED_BY
    • IMPLEMENTS_REQUIREMENT

      public static final LinkType IMPLEMENTS_REQUIREMENT
    • IMPLEMENTED_BY

      public static final LinkType IMPLEMENTED_BY
    • AFFECTS_REQUIREMENT

      public static final LinkType AFFECTS_REQUIREMENT
    • AFFECTED_BY

      public static final LinkType AFFECTED_BY
    • TRACKS_REQUIREMENT

      public static final LinkType TRACKS_REQUIREMENT
    • TRACKED_BY

      public static final LinkType TRACKED_BY
    • TRACKS_CHANGE_SET

      public static final LinkType TRACKS_CHANGE_SET
      Links a change request to a requirement or source change set, to control the authorization of the changes delivery. This link type has no opposite link type, the remote server is discovering its incoming links using an OSLC query.
      Since:
      3.3.1
    • AFFECTS_PLAN_ITEM

      public static final LinkType AFFECTS_PLAN_ITEM
    • AFFECTED_BY_DEFECT

      public static final LinkType AFFECTED_BY_DEFECT
    • TRACKED_WORK_ITEM

      public static final LinkType TRACKED_WORK_ITEM
      Since:
      1.9.0
    • TRACKS_WORK_ITEM

      public static final LinkType TRACKS_WORK_ITEM
      Since:
      1.9.0
    • ELABORATED_BY_ARCHITECTURE_ELEMENT

      public static final LinkType ELABORATED_BY_ARCHITECTURE_ELEMENT
    • ELABORATES

      public static final LinkType ELABORATES
    • DERIVES

      public static final LinkType DERIVES
    • REFINE

      public static final LinkType REFINE
    • SATISFY

      public static final LinkType SATISFY
    • TRACE

      public static final LinkType TRACE
    • DERIVES_FROM_ARCHITECTURE_ELEMENT

      public static final LinkType DERIVES_FROM_ARCHITECTURE_ELEMENT
      Backlink of DERIVES, used to display incoming links but should never be stored.
      Since:
      3.13.0
      See Also:
    • REFINED_BY_ARCHITECTURE_ELEMENT

      public static final LinkType REFINED_BY_ARCHITECTURE_ELEMENT
      Backlink of REFINE, used to display incoming links but should never be stored.
      Since:
      3.13.0
      See Also:
    • SATISFIED_BY_ARCHITECTURE_ELEMENT

      public static final LinkType SATISFIED_BY_ARCHITECTURE_ELEMENT
      Backlink of SATISFY, used to display incoming links but should never be stored.
      Since:
      3.13.0
      See Also:
    • TRACED_BY_ARCHITECTURE_ELEMENT

      public static final LinkType TRACED_BY_ARCHITECTURE_ELEMENT
      Backlink of TRACE, used to display incoming links but should never be stored.
      Since:
      3.13.0
      See Also:
    • TRACKS_AM

      public static final LinkType TRACKS_AM
      Since:
      3.15.0
    • ALLOCATES

      public static final LinkType ALLOCATES
    • REALIZES

      public static final LinkType REALIZES
    • TRACKED_BY_AM

      public static final LinkType TRACKED_BY_AM
      Backlink of TRACKS_AM, used to display incoming links but should never be stored.
      Since:
      3.15.0
      See Also:
    • ALLOCATED_BY

      public static final LinkType ALLOCATED_BY
      Backlink of ALLOCATES, used to display incoming links but should never be stored.
      Since:
      3.15.0
      See Also:
    • REALIZED_BY

      public static final LinkType REALIZED_BY
      Backlink of REALIZES, used to display incoming links but should never be stored.
      Since:
      3.15.0
      See Also:
    • CONSTRAINS

      public static final LinkType CONSTRAINS
    • CONSTRAINED_BY

      public static final LinkType CONSTRAINED_BY
    • DECOMPOSES

      public static final LinkType DECOMPOSES
    • DECOMPOSED_BY

      public static final LinkType DECOMPOSED_BY
    • SPECIFIES

      public static final LinkType SPECIFIES
    • SPECIFIED_BY

      public static final LinkType SPECIFIED_BY
    • SATISFIES_RM

      public static final LinkType SATISFIES_RM
    • SATISFIED_BY

      public static final LinkType SATISFIED_BY
    • ELABORATES_RM

      public static final LinkType ELABORATES_RM
    • ELABORATED_BY

      public static final LinkType ELABORATED_BY
    • REFERENCES

      public static final LinkType REFERENCES
      Links a requirement to a related resource, which is supposed to be another requirement. This link type has no opposite link type, an application is discovering its incoming links using an OSLC query.
      Since:
      3.7.0
  • Method Details

    • values

      public static LinkType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static LinkType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • supportedValues

      public static Collection<LinkType> supportedValues()
      Returns the link types that are supported, as determined by ProcessScope.
      Returns:
      the supported link types.
      Since:
      1.9.0
      See Also:
    • forAssociationType

      public static Collection<LinkType> forAssociationType(AssociationType associationType)
      Returns the supported link types for the given association type.
      Parameters:
      associationType - the association type
      Returns:
      the supported link types
    • forSourceType

      public static Collection<LinkType> forSourceType(ResourceType sourceType)
      Returns the supported link types for the given source type.
      Parameters:
      sourceType - the source type (e.g: ResourceType.CHANGE_REQUEST or ResourceType.REQUIREMENT)
      Returns:
      the supported link types
      Since:
      3.5.0
    • forSourceRange

      public static Collection<LinkType> forSourceRange(URI sourceRange)
      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
    • forPropertyDefinition

      public static Collection<LinkType> forPropertyDefinition(URI propertyDefinition)
      Returns the supported link types for the given property definition.
      Parameters:
      propertyDefinition - the link type property definition
      Returns:
      the corresponding link types
    • forDeliverableType

      public static Collection<LinkType> forDeliverableType(DeliverableType deliverableType)
      Returns the supported link types matching the given deliverable type.
      Parameters:
      deliverableType - the deliverable type to match
      Returns:
      the supported link types
      Since:
      1.8.0
    • getDirection

      public static LinkType.Direction getDirection(URI propertyDefinition)
      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
    • getDeliverableType

      public static Optional<DeliverableType> getDeliverableType(URI propertyDefinition)
      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.

      Parameters:
      propertyDefinition - the link type property definition
      Returns:
      the link type default deliverable type
      Since:
      1.8.0
    • getTitle

      public static String getTitle(URI propertyDefinition, List<Locale> locales)
      Returns the link type title for the given property definition.

      Note that while a property definition may have several corresponding link types, they will always have the same title.

      Parameters:
      propertyDefinition - the link type property definition
      locales - the locales preferences to translate the title
      Returns:
      the link type title
    • getUsagePropertyDefinition

      @Deprecated(since="4.2.0", forRemoval=true) public static URI getUsagePropertyDefinition(String usages)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the property definition (URI) of an usages value. A usage is commonly sent by ELM applications when opening a selection/creation dialog, to inform the remote application of the link type the dialog was opened for. It consists of a prefixed link type property, such as oslc_cm:relatedChangeRequest.
      Parameters:
      usages - the usages value.
      Returns:
      the corresponding URI.
      Throws:
      IllegalArgumentException - if usages cannot be resolved to a valid instance of this class.
    • getLinkTypesFromUsage

      public static List<LinkType> getLinkTypesFromUsage(String usage, OslcNamespaces namespaces)
      Parses a linking oslc:usage into a collection of supported LinkType constants.

      Remote applications may send an oslc:usage query parameter when opening a linking dialog (selection or creation). This parameter is a semicolon-separated list of namespace-prefixed link types, e.g., oslc:usage=oslc_qm:testsChangeRequest;oslc_rm:implementedBy, that specifies the intended link type(s) to create when the dialog selection/creation completes. Typically, a single link type is specified, but ETM has been observed to send all the link types that it will create, in cascade, in the different involved applications for a test case (as showed in the example above).

      Knowing the link type that will be created after the selection/creation is useful, for a Change Management application for example, to determine the Deliverable field that must be used to match a Global Configuration, if any.

      This method parses the LinkType constants in the order they are specified in the query parameter, and uses a scoping OslcNamespaces instance to resolve the prefixed namespaces.

      Parameters:
      usage - the oslc:usage parameter value.
      namespaces - the scoping OslcNamespaces instance.
      Returns:
      an empty list if usage is null or empty; the matching supporting LinkType instances otherwise.
      Throws:
      NullPointerException - if namespaces is null.
      Since:
      4.2.0
    • getAssociationType

      @Deprecated(since="3.7.0", forRemoval=false) public AssociationType getAssociationType()
      Deprecated.
      use getAssociationTypes() instead, as link types can belong to multiple association types.
      Gets the association type this link belongs to.
      Returns:
      the association type this link type belongs to.
    • getAssociationTypes

      public Collection<AssociationType> getAssociationTypes()
      Gets the association types this link belongs to.
      Returns:
      the association types this link type belongs to.
      Since:
      3.7.0
    • getPropertyDefinition

      public URI getPropertyDefinition()
    • getTitle

      public String getTitle(List<Locale> locales)
    • getSourceType

      public ResourceType getSourceType()
      Returns the source type of the link type
      Returns:
      the source type
      Since:
      3.5.0
    • getSourceRange

      public URI getSourceRange()
    • getTargetType

      public ResourceType getTargetType()
      Returns the target type of the link type
      Returns:
      the target type
      Since:
      3.5.0
    • getTargetRange

      public URI getTargetRange()
    • getDirection

      public LinkType.Direction getDirection()
    • getBacklink

      public Optional<LinkType> getBacklink()
    • getDeliverableType

      public Optional<DeliverableType> getDeliverableType()
      Returns 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
      Since:
      1.8.0
    • isUserSelectable

      public boolean 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 the tracksChangeSet one.
      Returns:
      true if the end-user can create such link on his local resource, false otherwise.
      Since:
      3.3.1
    • isNonStorableLink

      public static boolean isNonStorableLink(URI linkType)
      Determines whether the link type is only present to be able to display a link 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.
      Since:
      3.13.0