Package com.sodius.oslc.server.process
Class ArtifactTypeStore
- java.lang.Object
-
- com.sodius.oslc.server.process.ArtifactTypeStore
-
public abstract class ArtifactTypeStore extends Object
Manages persistence of Artifact Type Usage Mappings and deliverance of Artifact Types.- Since:
- 3.1.0
- See Also:
ArtifactType
,ArtifactTypeUsageMapping
-
-
Constructor Summary
Constructors Constructor Description ArtifactTypeStore()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Collection<ArtifactType>
getArtifactTypes(String containerId)
Returns the Artifact Types available for a containerId.abstract Collection<ArtifactTypeUsageMapping>
getArtifactTypeUsageMappings(String containerId)
Returns the list of Artifact Type Usage Mapping for a given containerId.abstract Collection<ArtifactTypeUsageMapping>
getArtifactTypeUsageMappings(String containerId, String templateId)
Returns the list of artifact type usage mappings for the requested template.abstract Collection<ArtifactTypeUsageMapping>
getDefaultArtifactTypeUsageMappings(String containerId)
Returns the list of default artifact type usage mappings.static ArtifactTypeStore
getInstance()
Returns the current store instance.abstract void
setArtifactTypeUsageMappings(String containerId, Collection<ArtifactTypeUsageMapping> artifactTypeUsageMappings)
Saves a list of Artifact Type Usage Mapping for a given containerId.static void
setInstance(ArtifactTypeStore store)
Replaces the current store instance with the given one.
-
-
-
Method Detail
-
getInstance
public static ArtifactTypeStore getInstance()
Returns the current store instance.- Returns:
- the current instance.
- See Also:
setInstance(ArtifactTypeStore)
-
setInstance
public static void setInstance(ArtifactTypeStore store)
Replaces the current store instance with the given one.- Parameters:
store
- the new store.
-
getArtifactTypeUsageMappings
public abstract Collection<ArtifactTypeUsageMapping> getArtifactTypeUsageMappings(String containerId) throws ArtifactTypeStoreException
Returns the list of Artifact Type Usage Mapping for a given containerId.- Parameters:
containerId
- The container ID of the Artifact Type Usage Mapping- Returns:
- The list of the ArtifactTypeUsageMapping associated with the containerId
- Throws:
ArtifactTypeStoreException
- if an error occurs while querying the store.
-
setArtifactTypeUsageMappings
public abstract void setArtifactTypeUsageMappings(String containerId, Collection<ArtifactTypeUsageMapping> artifactTypeUsageMappings) throws ArtifactTypeStoreException
Saves a list of Artifact Type Usage Mapping for a given containerId.- Parameters:
containerId
- the container IDartifactTypeUsageMappings
- the list of Artifact Type Usage Mapping- Throws:
ArtifactTypeStoreException
- if an error occurs while updating the store.
-
getDefaultArtifactTypeUsageMappings
public abstract Collection<ArtifactTypeUsageMapping> getDefaultArtifactTypeUsageMappings(String containerId) throws ArtifactTypeStoreException
Returns the list of default artifact type usage mappings. These are the mappings to use when no customization has been done by the administrator for the given container.- Parameters:
containerId
- the container ID.- Returns:
- A list of ArtifactTypeUsageMapping containing the requested artifacts
- Throws:
ArtifactTypeStoreException
- if an error occurs while querying the store.
-
getArtifactTypeUsageMappings
public abstract Collection<ArtifactTypeUsageMapping> getArtifactTypeUsageMappings(String containerId, String templateId) throws ArtifactTypeStoreException
Returns the list of artifact type usage mappings for the requested template. Applications are free to define as many templates as they want.- Parameters:
containerId
- the container ID.templateId
- the template ID.- Returns:
- A list of ArtifactTypeUsageMapping containing the requested artifacts
- Throws:
ArtifactTypeStoreException
- if an error occurs while querying the store.
-
getArtifactTypes
public abstract Collection<ArtifactType> getArtifactTypes(String containerId) throws ArtifactTypeStoreException
Returns the Artifact Types available for a containerId.- Parameters:
containerId
- the container ID.- Returns:
- A list of ArtifactType containing the identifier and label of the artifacts, the Resource Type and the available usages.
- Throws:
ArtifactTypeStoreException
- if an error occurs while querying the artifact types.
-
-