Package org.fcrepo.kernel.api.models
Interface FedoraResource
public interface FedoraResource
A resource in a Fedora repository.
- Since:
- Jan 10, 2014
- Author:
- ajs6f
-
Method Summary
Modifier and TypeMethodDescriptionfindMementoByDatetime(Instant mementoDatetime) Retrieve the Memento with the closest datetime to the request.getAcl()Get the ACL of this resourceGet the FedoraId for the Archival Group of this resource, if it existsdefault Stream<FedoraResource> Get the children of this resourcegetChildren(Boolean recursive) Get the children of this resource, possibly recursivelyGet the container of this resourceGet the created by valueGet the date this resource was createdGet the resource described by this resourceGet the description for this resourceConstruct an ETag value for the resource.Get the FedoraId for this resource.getId()Get the fedora identifier for this resourceGet the resource's interaction model.Get the last modified by valueGet the date this resource was last modifiedRetrieve the mementoDatetime property and return it as an InstantGet the Original Resource for which this resource is a memento or timemap for.Get the resource which contains this resource.Get the FedoraId of this resource's parentConstruct a State Token value for the resource.Get the resource's path in storage.getSystemTypes(boolean forRdf) Get only the system defined types from their RDF.Get the TimeMap/LDPCv of this resourceReturn the RDF properties for this resource.getTypes()Get the RDF:type values for this resource, this is usually the combination of getUserTypes and getSystemTypes(false) to get ALL the types.Get only the user provided types from their RDF.booleanhasProperty(String relPath) Does this resource have a propertybooleanCheck if this object uses a given RDF typebooleanisAcl()Returns true if this resource is an ACL.booleanReturns true if this resource is a Memento.booleanCheck if a resource is an original resource (ie versionable, as opposed to non-versionable resources like mementos, timemaps, and acls).
-
Method Details
-
getId
Get the fedora identifier for this resource- Returns:
- the fedora identifier
-
getFedoraId
Get the FedoraId for this resource.- Returns:
- the FedoraId identifier.
-
getArchivalGroupId
Get the FedoraId for the Archival Group of this resource, if it exists- Returns:
- an Optional containing the FedoraId
-
getParent
Get the resource which contains this resource.- Returns:
- the parent resource
- Throws:
PathNotFoundException- thrown if the parent cannot be found
-
getParentId
Get the FedoraId of this resource's parent- Returns:
- the parent resource's id
-
getChildren
Get the children of this resource- Returns:
- a stream of Fedora resources
-
getChildren
Get the children of this resource, possibly recursively- Parameters:
recursive- whether to recursively fetch child resources- Returns:
- a stream of Fedora resources
-
getContainer
Get the container of this resource- Returns:
- the container of this resource
-
getOriginalResource
Get the Original Resource for which this resource is a memento or timemap for. If this resource is not a memento or timemap, then it is the original.- Returns:
- the original resource for this
-
getTimeMap
Get the TimeMap/LDPCv of this resource- Returns:
- the container for TimeMap/LDPCv of this resource
-
getMementoDatetime
Retrieve the mementoDatetime property and return it as an Instant- Returns:
- the Instant for this resource
-
isMemento
boolean isMemento()Returns true if this resource is a Memento.- Returns:
- true if the resource is a Memento.
-
isAcl
boolean isAcl()Returns true if this resource is an ACL.- Returns:
- true if the resource is an ACL.
-
findMementoByDatetime
Retrieve the Memento with the closest datetime to the request.- Parameters:
mementoDatetime- The requested date time.- Returns:
- The closest Memento or null.
-
getAcl
Get the ACL of this resource- Returns:
- the container for ACL of this resource
-
hasProperty
Does this resource have a property- Parameters:
relPath- the given path- Returns:
- the boolean value whether the resource has a property
-
getCreatedDate
Get the date this resource was created- Returns:
- created date
-
getCreatedBy
Get the created by value- Returns:
- created by
-
getLastModifiedDate
Get the date this resource was last modified- Returns:
- last modified date
-
getLastModifiedBy
Get the last modified by value- Returns:
- last modified by
-
hasType
Check if this object uses a given RDF type- Parameters:
type- the given type- Returns:
- whether the object has the given type
-
getUserTypes
List<URI> getUserTypes()Get only the user provided types from their RDF.- Returns:
- a list of types from the user provided RDF.
-
getSystemTypes
Get only the system defined types from their RDF.- Parameters:
forRdf- whether we only want types for displaying in a RDF body.- Returns:
- a list of types from the user provided RDF.
-
getTypes
Get the RDF:type values for this resource, this is usually the combination of getUserTypes and getSystemTypes(false) to get ALL the types.- Returns:
- a list of types for this resource
-
getTriples
Return the RDF properties for this resource.- Returns:
- the RDF properties of this object.
-
getEtagValue
Construct an ETag value for the resource.- Returns:
- constructed etag value
-
getStateToken
Construct a State Token value for the resource.- Returns:
- constructed state-token value
-
isOriginalResource
boolean isOriginalResource()Check if a resource is an original resource (ie versionable, as opposed to non-versionable resources like mementos, timemaps, and acls).- Returns:
- whether the resource is an original resource.
-
getDescription
Get the description for this resource- Returns:
- the description for this resource
-
getDescribedResource
Get the resource described by this resource- Returns:
- the resource being described
-
getInteractionModel
Get the resource's interaction model.- Returns:
- the interaction model.
-
getStorageRelativePath
Get the resource's path in storage.- Returns:
- the path in storage.
-