Package cz.vutbr.fit.layout.api
Interface ArtifactRepository
-
- All Known Implementing Classes:
DefaultArtifactRepository
public interface ArtifactRepositoryA repository of available artifacts we are working with.- Author:
- burgetr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddArtifact(Artifact artifact)Adds an artifact to the repository.voidclear()Removes all artifacts from the repository.org.eclipse.rdf4j.model.IRIcreateArtifactIri(Artifact artifact)Generates a unique IRI for a new artifact based on the strategy of the given repository.voiddisconnect()Disconnects the repository.ArtifactgetArtifact(org.eclipse.rdf4j.model.IRI artifactIri)Obtains an artifact from the repository.Collection<Artifact>getArtifactInfo()Obtains the basic information about the artifacts.Collection<org.eclipse.rdf4j.model.IRI>getArtifactIRIs()Obtains a list of all artifact IRIs in the repository.IRIDecodergetIriDecoder()Gets an IRI encoder / decoder usable with this repository.booleanisReadOnly()Checks if the repository should be treated as read-only.voidremoveArtifact(org.eclipse.rdf4j.model.IRI artifactIri)Removes an artifact and all its derived artifacts from the repository.voidreplaceArtifact(org.eclipse.rdf4j.model.IRI artifactIri, Artifact artifact)Sets an IRI to a artifact and stores it into the repository while replacing the eventual existing artifact with that IRI.
-
-
-
Method Detail
-
isReadOnly
boolean isReadOnly()
Checks if the repository should be treated as read-only. If true is returned, all modification operations such as adding or removing artifacts should fail with a StorageException.- Returns:
truewhen the repository is read-only,falseotherwise.
-
getArtifactIRIs
Collection<org.eclipse.rdf4j.model.IRI> getArtifactIRIs()
Obtains a list of all artifact IRIs in the repository.- Returns:
- The list of all artifacts.
-
getArtifactInfo
Collection<Artifact> getArtifactInfo()
Obtains the basic information about the artifacts. Note that the resulting objects are not necessarily the complete artifacts. UsegetArtifact(IRI)to load the complete artifacts of the appropriate types.- Returns:
- A collection of objects that represent the available artifacts.
-
getArtifact
Artifact getArtifact(org.eclipse.rdf4j.model.IRI artifactIri)
Obtains an artifact from the repository.- Parameters:
artifactIri- the artifact IRI- Returns:
- the artifact or
nullwhen there is no such artifact available
-
addArtifact
void addArtifact(Artifact artifact)
Adds an artifact to the repository. If the artifact IRI isnulla new IRI is generated usingcreateArtifactIri(Artifact).- Parameters:
artifact- the artifact to add
-
createArtifactIri
org.eclipse.rdf4j.model.IRI createArtifactIri(Artifact artifact)
Generates a unique IRI for a new artifact based on the strategy of the given repository.- Parameters:
artifact- the artifact to generate to IRI for- Returns:
- The generated IRI
-
replaceArtifact
void replaceArtifact(org.eclipse.rdf4j.model.IRI artifactIri, Artifact artifact)Sets an IRI to a artifact and stores it into the repository while replacing the eventual existing artifact with that IRI.- Parameters:
artifactIri- the target IRIartifact- the artifact to store
-
removeArtifact
void removeArtifact(org.eclipse.rdf4j.model.IRI artifactIri)
Removes an artifact and all its derived artifacts from the repository.- Parameters:
artifactIri- the artifact IRI
-
clear
void clear()
Removes all artifacts from the repository.
-
getIriDecoder
IRIDecoder getIriDecoder()
Gets an IRI encoder / decoder usable with this repository.- Returns:
-
disconnect
void disconnect()
Disconnects the repository.
-
-