Package org.fcrepo.persistence.common
Class ResourceHeadersImpl
- java.lang.Object
-
- org.fcrepo.persistence.common.ResourceHeadersImpl
-
- All Implemented Interfaces:
ResourceHeaders
public class ResourceHeadersImpl extends Object implements ResourceHeaders
Common implementation of resource headers- Author:
- bbpennel
-
-
Field Summary
-
Fields inherited from interface org.fcrepo.kernel.api.models.ResourceHeaders
V1_0
-
-
Constructor Summary
Constructors Constructor Description ResourceHeadersImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FedoraId
getArchivalGroupId()
Get the identifier of the archival group resource that contains this resource, or null if the resource is not an archival part resourceString
getContentPath()
Returns the path to the content file the resource headers are associated withlong
getContentSize()
Get the size in bytes of the content of this resource.String
getCreatedBy()
Get the created by for the resourceInstant
getCreatedDate()
Get the date this resource was createdCollection<URI>
getDigests()
Get the list of all digest URIs recorded for this resourceString
getExternalHandling()
Get the handling type for external content associated with this resource.String
getExternalUrl()
Get the url of external content associated with this resource.String
getFilename()
Get the filename for the content of this resourceString
getHeadersVersion()
FedoraId
getId()
Get the identifier for the described resource.String
getInteractionModel()
Get the interaction model for the resourceString
getLastModifiedBy()
Get the last modified by value for the resourceInstant
getLastModifiedDate()
Get the date this resource was last modifiedInstant
getMementoCreatedDate()
Get the date a memento for this resource was created.String
getMimeType()
Get the mimetype describing the content contained by this resourceFedoraId
getParent()
Get the identifier of the parent of the resourceString
getStateToken()
Get the State Token value for the resource.boolean
isArchivalGroup()
Determine whether a resource is an Archival Groupboolean
isDeleted()
Determine if the resource is now a tombstone.boolean
isObjectRoot()
Determine whether a resource is the object rootvoid
setArchivalGroup(boolean flag)
void
setArchivalGroupId(FedoraId archivalGroupId)
void
setContentPath(String contentPath)
Sets the path to the content file associated with the header filevoid
setContentSize(long contentSize)
void
setCreatedBy(String createdBy)
void
setCreatedDate(Instant createdDate)
void
setDeleted(boolean deleted)
Set deleted status flag.void
setDigests(Collection<URI> digests)
void
setExternalHandling(String externalHandling)
void
setExternalUrl(String externalUrl)
void
setFilename(String filename)
void
setHeadersVersion(String headersVersion)
void
setId(FedoraId id)
void
setInteractionModel(String interactionModel)
void
setLastModifiedBy(String lastModifiedby)
void
setLastModifiedDate(Instant lastModifiedDate)
void
setMementoCreatedDate(Instant mementoCreatedDate)
void
setMimeType(String mimeType)
void
setObjectRoot(boolean flag)
void
setParent(FedoraId parent)
void
setStateToken(String stateToken)
String
toString()
-
-
-
Constructor Detail
-
ResourceHeadersImpl
public ResourceHeadersImpl()
-
-
Method Detail
-
getId
public FedoraId getId()
Description copied from interface:ResourceHeaders
Get the identifier for the described resource.- Specified by:
getId
in interfaceResourceHeaders
- Returns:
- identifier for the resource.
-
getParent
public FedoraId getParent()
Description copied from interface:ResourceHeaders
Get the identifier of the parent of the resource- Specified by:
getParent
in interfaceResourceHeaders
- Returns:
- identifier of the parent
-
getArchivalGroupId
public FedoraId getArchivalGroupId()
Description copied from interface:ResourceHeaders
Get the identifier of the archival group resource that contains this resource, or null if the resource is not an archival part resource- Specified by:
getArchivalGroupId
in interfaceResourceHeaders
- Returns:
- identifier of the containing archival group resource or null
-
setArchivalGroupId
public void setArchivalGroupId(FedoraId archivalGroupId)
- Parameters:
archivalGroupId
- the archivalGroupId to set
-
getStateToken
public String getStateToken()
Description copied from interface:ResourceHeaders
Get the State Token value for the resource.- Specified by:
getStateToken
in interfaceResourceHeaders
- Returns:
- state-token value
-
setStateToken
public void setStateToken(String stateToken)
- Parameters:
stateToken
- the stateToken to set
-
getInteractionModel
public String getInteractionModel()
Description copied from interface:ResourceHeaders
Get the interaction model for the resource- Specified by:
getInteractionModel
in interfaceResourceHeaders
- Returns:
- interaction model URI
-
setInteractionModel
public void setInteractionModel(String interactionModel)
- Parameters:
interactionModel
- the interactionModel to set
-
getMimeType
public String getMimeType()
Description copied from interface:ResourceHeaders
Get the mimetype describing the content contained by this resource- Specified by:
getMimeType
in interfaceResourceHeaders
- Returns:
- mimetype
-
setMimeType
public void setMimeType(String mimeType)
- Parameters:
mimeType
- the mimeType to set
-
getFilename
public String getFilename()
Description copied from interface:ResourceHeaders
Get the filename for the content of this resource- Specified by:
getFilename
in interfaceResourceHeaders
- Returns:
- filename
-
setFilename
public void setFilename(String filename)
- Parameters:
filename
- the filename to set
-
getContentSize
public long getContentSize()
Description copied from interface:ResourceHeaders
Get the size in bytes of the content of this resource. May be -1 if the size is unknown or there is no content.- Specified by:
getContentSize
in interfaceResourceHeaders
- Returns:
- size
-
setContentSize
public void setContentSize(long contentSize)
- Parameters:
contentSize
- the contentSize to set
-
getDigests
public Collection<URI> getDigests()
Description copied from interface:ResourceHeaders
Get the list of all digest URIs recorded for this resource- Specified by:
getDigests
in interfaceResourceHeaders
- Returns:
- digest URIs
-
setDigests
public void setDigests(Collection<URI> digests)
- Parameters:
digests
- the digests to set
-
getExternalHandling
public String getExternalHandling()
Description copied from interface:ResourceHeaders
Get the handling type for external content associated with this resource.- Specified by:
getExternalHandling
in interfaceResourceHeaders
- Returns:
- external handling value
-
setExternalHandling
public void setExternalHandling(String externalHandling)
- Parameters:
externalHandling
- the externalHandling to set
-
getCreatedDate
public Instant getCreatedDate()
Description copied from interface:ResourceHeaders
Get the date this resource was created- Specified by:
getCreatedDate
in interfaceResourceHeaders
- Returns:
- created date
-
setCreatedDate
public void setCreatedDate(Instant createdDate)
- Parameters:
createdDate
- the createdDate to set
-
getCreatedBy
public String getCreatedBy()
Description copied from interface:ResourceHeaders
Get the created by for the resource- Specified by:
getCreatedBy
in interfaceResourceHeaders
- Returns:
- created by
-
setCreatedBy
public void setCreatedBy(String createdBy)
- Parameters:
createdBy
- the createdBy to set
-
getLastModifiedDate
public Instant getLastModifiedDate()
Description copied from interface:ResourceHeaders
Get the date this resource was last modified- Specified by:
getLastModifiedDate
in interfaceResourceHeaders
- Returns:
- last modified date
-
setLastModifiedDate
public void setLastModifiedDate(Instant lastModifiedDate)
- Parameters:
lastModifiedDate
- the lastModifiedDate to set
-
getLastModifiedBy
public String getLastModifiedBy()
Description copied from interface:ResourceHeaders
Get the last modified by value for the resource- Specified by:
getLastModifiedBy
in interfaceResourceHeaders
- Returns:
- last modified by
-
setLastModifiedBy
public void setLastModifiedBy(String lastModifiedby)
- Parameters:
lastModifiedby
- the lastModifiedby to set
-
getMementoCreatedDate
public Instant getMementoCreatedDate()
Description copied from interface:ResourceHeaders
Get the date a memento for this resource was created. This field should generally be kept in sync with the last modified date, but they may not be the same, in the case that a memento was created as a result of an update to a different resource. Additionally, this date is NOT the same as the actual memento timestamp, which is determined by the timestamp on the OCFL version.- Specified by:
getMementoCreatedDate
in interfaceResourceHeaders
- Returns:
- memento created date
-
setMementoCreatedDate
public void setMementoCreatedDate(Instant mementoCreatedDate)
- Parameters:
mementoCreatedDate
- the mementoCreateDate to set
-
setExternalUrl
public void setExternalUrl(String externalUrl)
- Parameters:
externalUrl
- the externalUrl to set
-
getExternalUrl
public String getExternalUrl()
Description copied from interface:ResourceHeaders
Get the url of external content associated with this resource.- Specified by:
getExternalUrl
in interfaceResourceHeaders
- Returns:
- external url
-
setArchivalGroup
public void setArchivalGroup(boolean flag)
- Parameters:
flag
- boolean flag
-
isArchivalGroup
public boolean isArchivalGroup()
Description copied from interface:ResourceHeaders
Determine whether a resource is an Archival Group- Specified by:
isArchivalGroup
in interfaceResourceHeaders
- Returns:
- Archival Group status
-
setObjectRoot
public void setObjectRoot(boolean flag)
- Parameters:
flag
- boolean flag
-
isObjectRoot
public boolean isObjectRoot()
Description copied from interface:ResourceHeaders
Determine whether a resource is the object root- Specified by:
isObjectRoot
in interfaceResourceHeaders
- Returns:
- true if the resource is at the root of a persistence object
-
setDeleted
public void setDeleted(boolean deleted)
Set deleted status flag.- Parameters:
deleted
- true if deleted (a tombstone).
-
isDeleted
public boolean isDeleted()
Determine if the resource is now a tombstone.- Specified by:
isDeleted
in interfaceResourceHeaders
- Returns:
- Deleted status.
-
getContentPath
public String getContentPath()
Returns the path to the content file the resource headers are associated with- Specified by:
getContentPath
in interfaceResourceHeaders
- Returns:
- path the content file
-
setContentPath
public void setContentPath(String contentPath)
Sets the path to the content file associated with the header file- Parameters:
contentPath
- path to content file
-
getHeadersVersion
public String getHeadersVersion()
- Specified by:
getHeadersVersion
in interfaceResourceHeaders
- Returns:
- the header version
-
setHeadersVersion
public void setHeadersVersion(String headersVersion)
- Parameters:
headersVersion
- the headers version
-
-