Package org.bedework.calfacade.base
Class BwLastMod<T extends BwDbentity,T1>
java.lang.Object
org.bedework.calfacade.base.DumpEntity<T>
org.bedework.calfacade.base.BwUnversionedDbentity<T1>
org.bedework.calfacade.base.BwLastMod<T,T1>
- Type Parameters:
T- type we are a lastmod forT1- the actual class.
- All Implemented Interfaces:
Serializable,Comparable<T1>,org.bedework.util.logging.Logged
- Direct Known Subclasses:
BwCollectionLastmod
This is used to store the last modification times for some entities. We do
this to avoid the overhead and errors caused by versioning when not needed.
For example, we frequently update a calendar collections last mod when events are changed. We need this lastmod to flag collection that have changed, on the other hand we don't need the possibility of StaleStateExceptions.
The touch method will update this object only and save it avoiding most of tha overhead.
- Version:
- 1.0
- Author:
- Mike Douglass
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bedework.calfacade.base.DumpEntity
DumpEntity.DumpType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetHref()intgetId()intGet the sequenceReturn a value that can be used for etag and ctag supportstatic StringgetTagValue(String timestamp, int sequence) Return a value that can be used for etag and ctag supportinthashCode()voidsetDbEntity(T val) voidSet the href - ignoredvoidsetId(int val) voidsetSequence(int val) Set the sequencevoidsetTimestamp(String val) protected voidtoStringSegment(org.bedework.util.misc.ToString ts) Add our stuff to the StringBuilderbooleanunsaved()voidupdateLastmod(Timestamp val) Update last mod fieldsMethods inherited from class org.bedework.calfacade.base.BwUnversionedDbentity
clone, compareTo, equals, markUnsavedMethods inherited from class org.bedework.calfacade.base.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, warn
-
Constructor Details
-
BwLastMod
No date constructor- Parameters:
dbEntity- related db entity
-
BwLastMod
Constructor to set last mod- Parameters:
dbEntity- related db entitydt- datetime
-
-
Method Details
-
setId
public void setId(int val) - Overrides:
setIdin classBwUnversionedDbentity<T1>- Parameters:
val- the id
-
getId
public int getId()- Overrides:
getIdin classBwUnversionedDbentity<T1>- Returns:
- int id
-
setDbEntity
- Parameters:
val- related db entity
-
getDbEntity
- Returns:
- T
-
setTimestamp
- Parameters:
val- timestamp of change
-
getTimestamp
- Returns:
- String lastmod
-
setSequence
public void setSequence(int val) Set the sequence- Parameters:
val- sequence number
-
getSequence
public int getSequence()Get the sequence- Returns:
- int the sequence
-
unsaved
public boolean unsaved()- Overrides:
unsavedin classBwUnversionedDbentity<T1>- Returns:
- true if this entity is not saved.
-
setHref
Set the href - ignored- Overrides:
setHrefin classBwUnversionedDbentity<T1>- Parameters:
val- String href
-
getHref
- Overrides:
getHrefin classBwUnversionedDbentity<T1>- Returns:
- non null unique href for the entity
-
updateLastmod
Update last mod fields- Parameters:
val- timestamp of change
-
getTagValue
Return a value that can be used for etag and ctag support- Returns:
- String tag value
-
getTagValue
Return a value that can be used for etag and ctag support- Parameters:
timestamp- of changesequence- to allow sub microsec precision- Returns:
- String tag value
-
toStringSegment
protected void toStringSegment(org.bedework.util.misc.ToString ts) Add our stuff to the StringBuilder- Overrides:
toStringSegmentin classBwUnversionedDbentity<T1>- Parameters:
ts- for result
-
hashCode
public int hashCode()- Overrides:
hashCodein classBwUnversionedDbentity<T1>
-