Package net.quasardb.qdb.kv
Class Entry
java.lang.Object
net.quasardb.qdb.kv.Entry
- Direct Known Subclasses:
BlobEntry
,DoubleEntry
,IntegerEntry
,StringEntry
,TimestampEntry
A blob in the database.
Blob stands for "Binary Large Object", it's an entry which store binary data.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
session
-
alias
-
-
Constructor Details
-
Entry
Constructor.- Parameters:
session
- Active connection to the QuasarDB cluster.alias
- Alias / key of the entry
-
-
Method Details
-
alias
Gets the alias (i.e. its "key") of the entry in the database.- Returns:
- The alias.
-
attachTag
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
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
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.
-