public class BdbjeDataElement extends AbstractFileDataElement implements FileDataElement
| Constructor and Description |
|---|
BdbjeDataElement(BdbjeDigitalObject dobj,
com.sleepycat.je.Environment dbEnvironment,
com.sleepycat.je.Database db,
java.lang.String elName,
byte[] elementKeyBytes) |
| Modifier and Type | Method and Description |
|---|---|
void |
delete()
Deletes the data element from its digital object.
|
void |
deleteAttribute(java.lang.String name)
Deletes a particular attribute.
|
void |
deleteAttributes(java.util.List<java.lang.String> names)
Deletes multiple attributes.
|
java.lang.String |
getAttribute(java.lang.String name)
Returns the value for a particular attribute
|
DigitalObject |
getDigitalObject()
Returns the digital object of this data element.
|
java.io.File |
getFile()
Returns a file for the data of the data element.
|
java.lang.String |
getName()
Returns the name of this data element.
|
java.lang.String |
getType()
Returns the MIME type of the given data.
|
boolean |
isKeyAttributeOfThisElement(byte[] keyBytes)
Is the given key an attribute on this element.
|
CloseableIterator<java.util.Map.Entry<java.lang.String,java.lang.String>> |
listAttributes()
Returns a CloseableIterator view of the attributes of the data element.
|
void |
setAttribute(java.lang.String name,
java.lang.String value)
Sets a particular attribute.
|
void |
setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
Sets the value of multiple attributes.
|
getSize, read, writegetAttributes, read, setType, writeequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAttributes, getSize, read, read, setType, write, writepublic BdbjeDataElement(BdbjeDigitalObject dobj, com.sleepycat.je.Environment dbEnvironment, com.sleepycat.je.Database db, java.lang.String elName, byte[] elementKeyBytes) throws CreationException, InternalException
CreationExceptionInternalExceptionpublic DigitalObject getDigitalObject()
DataElementgetDigitalObject in interface DataElementpublic java.lang.String getName()
DataElementgetName in interface DataElementpublic void delete()
throws RepositoryException
DataElementdelete in interface DataElementdelete in class AbstractDataElementRepositoryExceptionpublic boolean isKeyAttributeOfThisElement(byte[] keyBytes)
public CloseableIterator<java.util.Map.Entry<java.lang.String,java.lang.String>> listAttributes() throws RepositoryException
DataElementlistAttributes in interface DataElementlistAttributes in class AbstractDataElementRepositoryExceptionpublic java.lang.String getAttribute(java.lang.String name)
throws RepositoryException
DataElementgetAttribute in interface DataElementgetAttribute in class AbstractDataElementname - the attribute nameRepositoryExceptionpublic void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
throws RepositoryException
DataElementsetAttributes in interface DataElementsetAttributes in class AbstractDataElementattributes - the attributes to set, mapped to their new valuesRepositoryExceptionpublic void setAttribute(java.lang.String name,
java.lang.String value)
throws RepositoryException
DataElementsetAttribute in interface DataElementname - the attribute namevalue - the attribute value; if null, the attribute will be deleted.RepositoryExceptionpublic void deleteAttributes(java.util.List<java.lang.String> names)
throws RepositoryException
DataElementdeleteAttributes in interface DataElementdeleteAttributes in class AbstractDataElementnames - the names of the attributes to deleteRepositoryExceptionpublic void deleteAttribute(java.lang.String name)
throws RepositoryException
DataElementdeleteAttribute in interface DataElementname - the name of the attribute to deleteRepositoryExceptionpublic java.lang.String getType()
throws RepositoryException
DataElementgetType in interface DataElementgetType in class AbstractDataElementRepositoryExceptionpublic java.io.File getFile()
throws RepositoryException
FileDataElementgetFile in interface FileDataElementRepositoryException