Package com.sodius.oslc.server.process
Class LinkingTypesStore
java.lang.Object
com.sodius.oslc.server.process.LinkingTypesStore
Manages available
ResourceType, LinkType, and AssociationType using enumerations for standard types. Additional custom
types are left to be handled by subclasses.- Since:
- 3.13.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the association types available.static LinkingTypesStoreReturns the current store instance.Gets the link types available.getResourceType(URI resourceTypeURI) Gets a resource type from its URI, if available.Gets the resource types available.Gets the supported association types.Gets the link types that are supported.Gets the supported resource types.booleanisNonStorableLink(URI linkType) Determines whether the link type is only present to be able to display a backlink title and should never be stored.booleanisUserSelectable(LinkType linkType) Determines whether the end-user must be offered to create a link of such type.static voidsetInstance(LinkingTypesStore store) Replaces the current store instance with the given one.
-
Constructor Details
-
LinkingTypesStore
public LinkingTypesStore()
-
-
Method Details
-
getInstance
Returns the current store instance. If no instance was set, returns a default store containing only the standard types.- Returns:
- the current instance.
- See Also:
-
setInstance
Replaces the current store instance with the given one.- Parameters:
store- the new store.
-
getResourceTypes
Gets the resource types available.- Returns:
- all available resource types.
- Throws:
LinkingTypesStoreException- if an error occurs while querying the store.
-
getSupportedResourceTypes
Gets the supported resource types.- Returns:
- the supported resource types.
- Throws:
LinkingTypesStoreException- if an error occurs while querying the store.- See Also:
-
getResourceType
public Optional<ResourceType> getResourceType(URI resourceTypeURI) throws LinkingTypesStoreException Gets a resource type from its URI, if available.- Parameters:
resourceTypeURI- the URI- Returns:
- the resource type,
Optional.empty()otherwise. - Throws:
LinkingTypesStoreException- if an error occurs while querying the store.
-
getLinkTypes
Gets the link types available.- Returns:
- all available link types.
- Throws:
LinkingTypesStoreException- if an error occurs while querying the store.
-
getSupportedLinkTypes
Gets the link types that are supported.- Returns:
- the supported link types.
- Throws:
LinkingTypesStoreException- if an error occurs while querying the store.- See Also:
-
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.- Parameters:
linkType- the link type to check- Returns:
trueif the end-user can create such link on his local resource,falseotherwise.- Throws:
LinkingTypesStoreException- if an error occurs while querying the store.
-
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
-
getAssociationTypes
Gets the association types available.- Returns:
- all available association types.
- Throws:
LinkingTypesStoreException- if an error occurs while querying the store.
-
getSupportedAssociationTypes
Gets the supported association types.- Returns:
- the supported association types.
- Throws:
LinkingTypesStoreException- if an error occurs while querying the store.- See Also:
-