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:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bedework.carddav.server.dirHandlers.db.DumpEntity
DumpEntity.DumpType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDeletedEntity(DbEntity<?> val) Add a deleted entity - these may appear as a result of updates.voidCalled after delete from the dbvoidCalled when we are about to delete from the dbvoidCalled when we are about to save the object.voidCalled when we are about to update the object.intCollection<DbEntity<?>>getSeq()Get the entity seqintlength()Size to use for quotas.voidvoidsetByteSize(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) voidSet the seq for this entityvoidtoStringSegment(org.bedework.base.ToString ts) Add our stuff to the ToString builderMethods inherited from class org.bedework.carddav.server.dirHandlers.db.UnversionedDbentity
clone, compareTo, equals, getId, hashCode, setId, unsavedMethods inherited from class org.bedework.carddav.server.dirHandlers.db.DumpEntity
dump, dump, getLogger, hasDumpValueMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bedework.util.logging.Logged
audit, debug, debug, debug, enableAuditLogger, enableErrorLogger, enableMetricsLogger, error, error, error, getLogLevel, info, isAuditLoggerEnabled, isErrorLoggerEnabled, isMetricsDebugEnabled, isMetricsLoggerEnabled, metrics, setLoggerClass, setLoggerClass, trace, trace, trace, warnMethods inherited from interface org.bedework.webdav.servlet.access.SharedEntity
getAccessState, getPath, isCollection, setAccessState
-
Constructor Details
-
DbEntity
public DbEntity()No-arg constructor
-
-
Method Details
-
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- byte size
-
getByteSize
public int getByteSize()- Returns:
- int last byte size
-
setSeq
Set the seq for this entity- Parameters:
val- int seq
-
getSeq
Get the entity seq- Returns:
- int the entity seq
-
setOwnerHref
- Specified by:
setOwnerHrefin interfaceorg.bedework.webdav.servlet.access.SharedEntity- Parameters:
val- owner href
-
getOwnerHref
- Specified by:
getOwnerHrefin interfaceorg.bedework.webdav.servlet.access.SharedEntity- Returns:
- String
-
setCreatorHref
- Parameters:
val- creatorHref
-
getCreatorHref
- Returns:
- String
-
setAccess
- Specified by:
setAccessin interfaceorg.bedework.webdav.servlet.access.SharedEntity- Parameters:
val- access
-
getAccess
- Specified by:
getAccessin interfaceorg.bedework.webdav.servlet.access.SharedEntity- Returns:
- String
-
setParentPath
- Specified by:
setParentPathin interfaceorg.bedework.webdav.servlet.access.SharedEntity- Parameters:
val- parent path
-
getParentPath
- Specified by:
getParentPathin interfaceorg.bedework.webdav.servlet.access.SharedEntity- Returns:
- parentPath.
-
setCreated
- Parameters:
val- create date/time
-
getCreated
- Returns:
- String created
-
addDeletedEntity
Add a deleted entity - these may appear as a result of updates. A null parameter is a noop.- Parameters:
val- a deleted entity
-
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(org.bedework.base.ToString ts) Description copied from class:UnversionedDbentityAdd our stuff to the ToString builder- Overrides:
toStringSegmentin classUnversionedDbentity<T>- Parameters:
ts- ToString builder for result
-