Class DefaultArtifactRepository

  • All Implemented Interfaces:
    ArtifactRepository

    public class DefaultArtifactRepository
    extends Object
    implements ArtifactRepository
    Default simple in-memory implementation of an ArtifactRepository.
    Author:
    burgetr
    • Constructor Detail

      • DefaultArtifactRepository

        public DefaultArtifactRepository()
    • Method Detail

      • isReadOnly

        public boolean isReadOnly()
        Description copied from interface: ArtifactRepository
        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.
        Specified by:
        isReadOnly in interface ArtifactRepository
        Returns:
        true when the repository is read-only, false otherwise.
      • getArtifact

        public Artifact getArtifact​(org.eclipse.rdf4j.model.IRI artifactIri)
        Description copied from interface: ArtifactRepository
        Obtains an artifact from the repository.
        Specified by:
        getArtifact in interface ArtifactRepository
        Parameters:
        artifactIri - the artifact IRI
        Returns:
        the artifact or null when there is no such artifact available
      • createArtifactIri

        public org.eclipse.rdf4j.model.IRI createArtifactIri​(Artifact artifact)
        Description copied from interface: ArtifactRepository
        Generates a unique IRI for a new artifact based on the strategy of the given repository.
        Specified by:
        createArtifactIri in interface ArtifactRepository
        Parameters:
        artifact - the artifact to generate to IRI for
        Returns:
        The generated IRI
      • replaceArtifact

        public void replaceArtifact​(org.eclipse.rdf4j.model.IRI artifactIri,
                                    Artifact artifact)
        Description copied from interface: ArtifactRepository
        Sets an IRI to a artifact and stores it into the repository while replacing the eventual existing artifact with that IRI.
        Specified by:
        replaceArtifact in interface ArtifactRepository
        Parameters:
        artifactIri - the target IRI
        artifact - the artifact to store
      • removeArtifact

        public void removeArtifact​(org.eclipse.rdf4j.model.IRI artifactIri)
        Description copied from interface: ArtifactRepository
        Removes an artifact and all its derived artifacts from the repository.
        Specified by:
        removeArtifact in interface ArtifactRepository
        Parameters:
        artifactIri - the artifact IRI