Class BasexStore

java.lang.Object
org.javastro.ivoa.registry.internal.BasexStore
All Implemented Interfaces:
RegistryStoreInterface

@ApplicationScoped public class BasexStore extends Object implements RegistryStoreInterface
A registry store implemented with ... .
  • Field Details

    • REGDB_NAME

      public static final String REGDB_NAME
      See Also:
    • context

      protected static final org.basex.core.Context context
  • Constructor Details

    • BasexStore

      public BasexStore()
  • Method Details

    • open

      public void open()
      Description copied from interface: RegistryStoreInterface
      open the store.
      Specified by:
      open in interface RegistryStoreInterface
    • close

      public void close()
      Description copied from interface: RegistryStoreInterface
      close the store.
      Specified by:
      close in interface RegistryStoreInterface
    • create

      public void create(String content, String path)
      Description copied from interface: RegistryStoreInterface
      create a new entry in the store. The
      Specified by:
      create in interface RegistryStoreInterface
      Parameters:
      content - the content to be stored.
      path - the path within the store to store the content. The path should be a valid path within the store, and should include the filename (e.g. "managed/base.xml").
    • createFromFile

      public void createFromFile(Path file, String path)
      Description copied from interface: RegistryStoreInterface
      save the content of a file into the store (replacing any existing document at the path).
      Specified by:
      createFromFile in interface RegistryStoreInterface
      Parameters:
      file - the file to be stored.
      path - the path within the store, including the filename.
    • updateEntries

      public void updateEntries(String xml, String path)
      Description copied from interface: RegistryStoreInterface
      creates/updates the given registry entries in the registry store. The input is given as an XML string, which should be a valid registry entry (i.e. it should conform to the RegistryInterface schema). The path parameter is used to specify the location of the entry in the registry store. The location needs to have a VOResources root element already in place.
      Specified by:
      updateEntries in interface RegistryStoreInterface
      Parameters:
      xml - the registry entry to be stored.
      path - the path to store the entry in the registry store.
    • deleteEntry

      public void deleteEntry(org.javastro.ivoa.entities.Ivoid id)
      Description copied from interface: RegistryStoreInterface
      delete the given entry from the store. TODO - should this just be physical delete of that id - or the logical one?
      Specified by:
      deleteEntry in interface RegistryStoreInterface
    • deleteEntry

      public void deleteEntry(String identifier, String path)
      Description copied from interface: RegistryStoreInterface
      delete the resource with the given identifier from the document at the given path.
      Specified by:
      deleteEntry in interface RegistryStoreInterface
      Parameters:
      identifier - the IVOA identifier (ivo://...) of the resource.
      path - the path of the VOResources document within the store.
    • read

      public String read(String path) throws org.basex.core.BaseXException
      Description copied from interface: RegistryStoreInterface
      read the content of the given path from the store.
      Specified by:
      read in interface RegistryStoreInterface
      Parameters:
      path - the path to read from the store. The path should be a valid path within the store, and should include the filename (e.g. "managed/base.xml").
      Returns:
      the content of the given path.
      Throws:
      org.basex.core.BaseXException - if there is an error reading from the store.
    • exists

      public boolean exists(String path)
      Description copied from interface: RegistryStoreInterface
      checks if the given path exists in the store.
      Specified by:
      exists in interface RegistryStoreInterface
      Parameters:
      path - the path to chack for existence. The path should be a valid path within the store, and should include the filename (e.g. "managed/base.xml").
      Returns:
      true if the path already exists.
    • delete

      public void delete(String path)
      Description copied from interface: RegistryStoreInterface
      Delete a whole path from the database.
      Specified by:
      delete in interface RegistryStoreInterface
    • getContext

      public org.basex.core.Context getContext()
      Returns:
      The Store context