Package org.bedework.calfacade
Class BwResource
- All Implemented Interfaces:
Serializable,Comparable<BwResource>,OwnedEntity,ShareableEntity,org.bedework.util.logging.Logged
Represent a resource stored within the system, e.g an attachment or an
image. The actual content is stored in a BwResourceContent object to allow us
to put off retrieval of content - or maybe even store outside of the db.
- Author:
- Mike Douglass douglm - bedework.edu
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bedework.calfacade.base.DumpEntity
DumpEntity.DumpType -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Make visibleintcompareTo(BwResource that) voidcopyTo(BwResource val) Copy this objects values into the parameterGet the contentlongGet the lengthGet the contentTypeGet the extra stuff appended to the content typeGet the contentType strippedGet the encodinggetEtag()getHref()getName()Get the nameGet the resource's previous lastmod - used to allow if none matchintGet the event's previous seq - used to allow if none matchintGet the sequencebooleanIs this resource tombstoned?inthashCode()voidSet the contentvoidsetContentLength(long val) Set the lengthvoidsetContentType(String val) Set the contentType - may be null for unknown.voidsetCreated(String val) voidsetEncoding(String val) Set the encodingvoidSet the href - ignoredvoidsetLastmod(String val) voidSet the namevoidsetPrevLastmod(String val) Set the resource's previous lastmod - used to allow if none matchvoidsetPrevSeq(int val) Set the event's previous seq - used to allow if none matchvoidsetSequence(int val) Set the sequencevoidMake this thing a tombstoned resource.toString()voidupdateLastmod(Timestamp val) Update last mod fieldsMethods inherited from class org.bedework.calfacade.base.BwShareableContainedDbentity
copyTo, getColPath, setColPath, setColPath, shallowCopyTo, toStringSegmentMethods inherited from class org.bedework.calfacade.base.BwShareableDbentity
copyTo, getAccess, getCreatorEnt, getCreatorHref, setAccess, setCreatorEnt, setCreatorHref, shallowCopyToMethods inherited from class org.bedework.calfacade.base.BwOwnedDbentity
copyTo, getOwnerHref, getPublick, setOwnerHref, setPublick, shallowCopyToMethods inherited from class org.bedework.calfacade.base.BwDbentity
addDeletedEntity, afterDeletion, beforeDeletion, beforeSave, beforeUpdate, getByteSize, getDeletedEntities, getSeq, length, setByteSize, setSeqMethods inherited from class org.bedework.calfacade.base.BwUnversionedDbentity
equals, getId, markUnsaved, setId, unsavedMethods inherited from class org.bedework.calfacade.base.DumpEntity
dump, dump, getLogger, hasDumpValueMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, 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.calfacade.base.OwnedEntity
getOwnerHref, getPublick, setOwnerHref, setPublick
-
Field Details
-
tombstoned
Value of encoding for a tombstoned resource- See Also:
-
tombstonedSuffix
Value of suffix on path for a tombstoned resource- See Also:
-
-
Constructor Details
-
BwResource
public BwResource()Constructor
-
-
Method Details
-
setHref
Set the href - ignored- Overrides:
setHrefin classBwUnversionedDbentity<BwResource>- Parameters:
val- String href
-
getHref
- Overrides:
getHrefin classBwUnversionedDbentity<BwResource>- Returns:
- non null unique href for the entity
-
setName
Set the name- Parameters:
val- String name
-
getName
Get the name- Returns:
- String name
-
setCreated
- Parameters:
val- created date
-
getCreated
- Returns:
- String created
-
setLastmod
- Parameters:
val- lastmod date
-
getLastmod
- 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
-
setContentType
Set the contentType - may be null for unknown. For internal use extra information can be appended by adding a TAB character then the extra. On delivery the TAB and anything after stripped- Parameters:
val- String contentType
-
getContentType
Get the contentType- Returns:
- String contentType
-
setEncoding
Set the encoding- Parameters:
val- String encoding
-
getEncoding
Get the encoding- Returns:
- String encoding
-
setContentLength
public void setContentLength(long val) Set the length- Parameters:
val- int
-
getContentLength
public long getContentLength()Get the length- Returns:
- long length
-
getContentTypeStripped
Get the contentType stripped- Returns:
- String contentType
-
getContentTypeExtra
Get the extra stuff appended to the content type- Returns:
- String extra data
-
copyTo
Copy this objects values into the parameter- Parameters:
val- target resource
-
updateLastmod
Update last mod fields- Parameters:
val- timestamp
-
setPrevLastmod
Set the resource's previous lastmod - used to allow if none match- Parameters:
val- lastmod
-
getPrevLastmod
Get the resource's previous lastmod - used to allow if none match- Returns:
- the event's lastmod
-
setPrevSeq
public void setPrevSeq(int val) Set the event's previous seq - used to allow if none match- Parameters:
val- sequence number
-
getPrevSeq
public int getPrevSeq()Get the event's previous seq - used to allow if none match- Returns:
- the event's seq
-
setContent
Set the content- Parameters:
val- BwResourceContent
-
getContent
Get the content- Returns:
- BwResourceContent content
-
getEtag
- Returns:
- etag for this resource.
-
getEtagValue
- Returns:
- unquoted etag for this resource.
-
getPreviousEtag
- Returns:
- prev tag or null for no values set.
-
tombstone
public void tombstone()Make this thing a tombstoned resource. Non-reversible -
getTombstoned
public boolean getTombstoned()Is this resource tombstoned?- Returns:
- true/false
-
hashCode
public int hashCode()- Overrides:
hashCodein classBwUnversionedDbentity<BwResource>
-
compareTo
- Specified by:
compareToin interfaceComparable<BwResource>- Overrides:
compareToin classBwUnversionedDbentity<BwResource>
-
toString
-
clone
Description copied from class:BwUnversionedDbentityMake visible- Overrides:
clonein classBwUnversionedDbentity<BwResource>- Returns:
- Object of class T
-