Class DbEntity<T>
- java.lang.Object
-
- org.bedework.carddav.server.dirHandlers.db.DumpEntity<T>
-
- org.bedework.carddav.server.dirHandlers.db.UnversionedDbentity<T>
-
- org.bedework.carddav.server.dirHandlers.db.DbEntity<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
Serializable,Comparable<T>,org.bedework.util.logging.Logged,org.bedework.webdav.servlet.access.SharedEntity
- Direct Known Subclasses:
DbNamedEntity
public abstract class DbEntity<T> extends UnversionedDbentity<T> implements org.bedework.webdav.servlet.access.SharedEntity
Base type for a database entity. We require an id and the subclasses must implement hashcode and compareTo.- Version:
- 1.0
- Author:
- Mike Douglass
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.bedework.carddav.server.dirHandlers.db.DumpEntity
DumpEntity.DumpType
-
-
Constructor Summary
Constructors Constructor Description DbEntity()No-arg constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDeletedEntity(DbEntity<?> val)Add a deleted entity - these may appear as a result of updates.voidafterDeletion()Called after delete from the dbvoidbeforeDeletion()Called when we are about to delete from the dbvoidbeforeSave()Called when we are about to save the object.voidbeforeUpdate()Called when we are about to update the object.StringgetAccess()intgetByteSize()StringgetCreated()StringgetCreatorHref()Collection<DbEntity<?>>getDeletedEntities()StringgetOwnerHref()StringgetParentPath()IntegergetSeq()Get the entity seqintlength()Size to use for quotas.voidsetAccess(String val)voidsetByteSize(int val)The last calculated byte size should be stored with the entity.voidsetCreated(String val)voidsetCreatorHref(String val)voidsetOwnerHref(String val)voidsetParentPath(String val)voidsetSeq(Integer val)Set the seq for this entityvoidtoStringSegment(StringBuilder sb)Add our stuff to the StringBuilder-
Methods inherited from class org.bedework.carddav.server.dirHandlers.db.UnversionedDbentity
clone, compareTo, equals, getId, hashCode, setId, unsaved
-
Methods inherited from class org.bedework.carddav.server.dirHandlers.db.DumpEntity
dump, dump, getLogger, hasDumpValue
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bedework.util.logging.Logged
audit, debug, debug, enableAuditLogger, enableErrorLogger, enableMetricsLogger, error, error, error, getLogLevel, info, isAuditLoggerEnabled, isErrorLoggerEnabled, isMetricsDebugEnabled, isMetricsLoggerEnabled, metrics, setLoggerClass, setLoggerClass, setLogLevel, trace, trace, warn
-
-
-
-
Method Detail
-
setByteSize
public void setByteSize(int val)
The last calculated byte size should be stored with the entity. On update call calculateByteSize to get a new value and use the difference to adjust the quota.- Parameters:
val-
-
getByteSize
public int getByteSize()
- Returns:
- int last byte size
-
setSeq
public void setSeq(Integer val)
Set the seq for this entity- Parameters:
val- int seq
-
getSeq
public Integer getSeq()
Get the entity seq- Returns:
- int the entity seq
-
setOwnerHref
public void setOwnerHref(String val)
- Specified by:
setOwnerHrefin interfaceorg.bedework.webdav.servlet.access.SharedEntity- Parameters:
val-
-
getOwnerHref
public String getOwnerHref()
- Specified by:
getOwnerHrefin interfaceorg.bedework.webdav.servlet.access.SharedEntity- Returns:
- String
-
setCreatorHref
public void setCreatorHref(String val)
- Parameters:
val-
-
getCreatorHref
public String getCreatorHref()
- Returns:
- String
-
setAccess
public void setAccess(String val)
- Specified by:
setAccessin interfaceorg.bedework.webdav.servlet.access.SharedEntity- Parameters:
val-
-
getAccess
public String getAccess()
- Specified by:
getAccessin interfaceorg.bedework.webdav.servlet.access.SharedEntity- Returns:
- String
-
setParentPath
public void setParentPath(String val)
- Specified by:
setParentPathin interfaceorg.bedework.webdav.servlet.access.SharedEntity- Parameters:
val-
-
getParentPath
public String getParentPath()
- Specified by:
getParentPathin interfaceorg.bedework.webdav.servlet.access.SharedEntity- Returns:
- parentPath.
-
setCreated
public void setCreated(String val)
- Parameters:
val-
-
getCreated
public String getCreated()
- Returns:
- String created
-
addDeletedEntity
public void addDeletedEntity(DbEntity<?> val)
Add a deleted entity - these may appear as a result of updates. A null parameter is a noop.- Parameters:
val-
-
getDeletedEntities
public Collection<DbEntity<?>> getDeletedEntities()
- Returns:
- deleted entities or null
-
beforeDeletion
public void beforeDeletion()
Called when we are about to delete from the db
-
afterDeletion
public void afterDeletion()
Called after delete from the db
-
beforeUpdate
public void beforeUpdate()
Called when we are about to update the object.
-
beforeSave
public void beforeSave()
Called when we are about to save the object. Default to calling before update
-
length
public int length()
Size to use for quotas.- Returns:
- int
-
toStringSegment
public void toStringSegment(StringBuilder sb)
Description copied from class:UnversionedDbentityAdd our stuff to the StringBuilder- Overrides:
toStringSegmentin classUnversionedDbentity<T>- Parameters:
sb-
-
-