Class Entry

java.lang.Object
net.quasardb.qdb.kv.Entry
Direct Known Subclasses:
BlobEntry, DoubleEntry, IntegerEntry, StringEntry, TimestampEntry

public class Entry extends Object
A blob in the database. Blob stands for "Binary Large Object", it's an entry which store binary data.
  • Field Details

    • session

      protected Session session
    • alias

      protected String alias
  • Constructor Details

    • Entry

      protected Entry(Session session, String alias)
      Constructor.
      Parameters:
      session - Active connection to the QuasarDB cluster.
      alias - Alias / key of the entry
  • Method Details

    • alias

      public String alias()
      Gets the alias (i.e. its "key") of the entry in the database.
      Returns:
      The alias.
    • attachTag

      public boolean attachTag(String tag)
      Attaches a tag to the entry. The tag is created if it does not exist.
      Parameters:
      tag - The alias of the tag to attach.
      Returns:
      true if the tag has been attached, false if it was already attached
      Throws:
      AliasNotFoundException - If an entry matching the provided alias cannot be found.
      ClusterClosedException - If QdbCluster.close() has been called.
      ReservedAliasException - If the alias name or prefix is reserved for quasardb internal use.
    • hasTag

      public boolean hasTag(String tag)
      Checks if a tag is attached to the entry.
      Parameters:
      tag - The alias to the tag to check.
      Returns:
      true if the entry has the provided tag, false otherwise
      Throws:
      AliasNotFoundException - If an entry matching the provided alias cannot be found.
      ClusterClosedException - If QdbCluster.close() has been called.
      ReservedAliasException - If the alias name or prefix is reserved for quasardb internal use.
    • remove

      public void remove()
      Removes the entry from the database.
      Throws:
      AliasNotFoundException - If an entry matching the provided alias cannot be found.
      ClusterClosedException - If QdbCluster.close() has been called.
      ReservedAliasException - If the alias name or prefix is reserved for quasardb internal use.
    • detachTag

      public boolean detachTag(String tag)
      Detaches a tag from the entry.
      Parameters:
      tag - The alias of the tag to detach.
      Returns:
      true if the tag has been detached, false if the tag was not attached
      Throws:
      AliasNotFoundException - If an entry matching the provided alias cannot be found.
      ClusterClosedException - If QdbCluster.close() has been called.
      ReservedAliasException - If the alias name or prefix is reserved for quasardb internal use.
    • exists

      public boolean exists()
      Check if the entry exists.
      Returns:
      Returns true if the entry exists, false otherwise.
      Throws:
      ClusterClosedException - If QdbCluster.close() has been called.
      ReservedAliasException - If the alias is reserved for quasardb internal use.