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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description FedoraResourcefindMementoByDatetime(Instant mementoDatetime)Retrieve the Memento with the closest datetime to the request.FedoraResourcegetAcl()Get the ACL of this resourceOptional<FedoraId>getArchivalGroupId()Get the FedoraId for the Archival Group of this resource, if it existsdefault Stream<FedoraResource>getChildren()Get the children of this resourceStream<FedoraResource>getChildren(Boolean recursive)Get the children of this resource, possibly recursivelyFedoraResourcegetContainer()Get the container of this resourceStringgetCreatedBy()Get the created by valueInstantgetCreatedDate()Get the date this resource was createdFedoraResourcegetDescribedResource()Get the resource described by this resourceFedoraResourcegetDescription()Get the description for this resourceStringgetEtagValue()Construct an ETag value for the resource.FedoraIdgetFedoraId()Get the FedoraId for this resource.StringgetId()Get the fedora identifier for this resourceStringgetInteractionModel()Get the resource's interaction model.StringgetLastModifiedBy()Get the last modified by valueInstantgetLastModifiedDate()Get the date this resource was last modifiedInstantgetMementoDatetime()Retrieve the mementoDatetime property and return it as an InstantFedoraResourcegetOriginalResource()Get the Original Resource for which this resource is a memento or timemap for.FedoraResourcegetParent()Get the resource which contains this resource.FedoraIdgetParentId()Get the FedoraId of this resource's parentStringgetStateToken()Construct a State Token value for the resource.List<URI>getSystemTypes(boolean forRdf)Get only the system defined types from their RDF.TimeMapgetTimeMap()Get the TimeMap/LDPCv of this resourceRdfStreamgetTriples()Return the RDF properties for this resource.List<URI>getTypes()Get the RDF:type values for this resource, this is usually the combination of getUserTypes and getSystemTypes(false) to get ALL the types.List<URI>getUserTypes()Get only the user provided types from their RDF.booleanhasProperty(String relPath)Does this resource have a propertybooleanhasType(String type)Check if this object uses a given RDF typebooleanisAcl()Returns true if this resource is an ACL.booleanisMemento()Returns true if this resource is a Memento.booleanisOriginalResource()Check if a resource is an original resource (ie versionable, as opposed to non-versionable resources like mementos, timemaps, and acls).
-
-
-
Method Detail
-
getFedoraId
FedoraId getFedoraId()
Get the FedoraId for this resource.- Returns:
- the FedoraId identifier.
-
getArchivalGroupId
Optional<FedoraId> getArchivalGroupId()
Get the FedoraId for the Archival Group of this resource, if it exists- Returns:
- an Optional containing the FedoraId
-
getParent
FedoraResource getParent() throws PathNotFoundException
Get the resource which contains this resource.- Returns:
- the parent resource
- Throws:
PathNotFoundException- thrown if the parent cannot be found
-
getParentId
FedoraId getParentId()
Get the FedoraId of this resource's parent- Returns:
- the parent resource's id
-
getChildren
default Stream<FedoraResource> getChildren()
Get the children of this resource- Returns:
- a stream of Fedora resources
-
getChildren
Stream<FedoraResource> getChildren(Boolean recursive)
Get the children of this resource, possibly recursively- Parameters:
recursive- whether to recursively fetch child resources- Returns:
- a stream of Fedora resources
-
getContainer
FedoraResource getContainer()
Get the container of this resource- Returns:
- the container of this resource
-
getOriginalResource
FedoraResource 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
TimeMap getTimeMap()
Get the TimeMap/LDPCv of this resource- Returns:
- the container for TimeMap/LDPCv of this resource
-
getMementoDatetime
Instant 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
FedoraResource findMementoByDatetime(Instant mementoDatetime)
Retrieve the Memento with the closest datetime to the request.- Parameters:
mementoDatetime- The requested date time.- Returns:
- The closest Memento or null.
-
getAcl
FedoraResource getAcl()
Get the ACL of this resource- Returns:
- the container for ACL of this resource
-
hasProperty
boolean hasProperty(String relPath)
Does this resource have a property- Parameters:
relPath- the given path- Returns:
- the boolean value whether the resource has a property
-
getCreatedDate
Instant getCreatedDate()
Get the date this resource was created- Returns:
- created date
-
getCreatedBy
String getCreatedBy()
Get the created by value- Returns:
- created by
-
getLastModifiedDate
Instant getLastModifiedDate()
Get the date this resource was last modified- Returns:
- last modified date
-
getLastModifiedBy
String getLastModifiedBy()
Get the last modified by value- Returns:
- last modified by
-
hasType
boolean hasType(String type)
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
List<URI> getSystemTypes(boolean forRdf)
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
List<URI> 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
RdfStream getTriples()
Return the RDF properties for this resource.- Returns:
- the RDF properties of this object.
-
getEtagValue
String getEtagValue()
Construct an ETag value for the resource.- Returns:
- constructed etag value
-
getStateToken
String 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
FedoraResource getDescription()
Get the description for this resource- Returns:
- the description for this resource
-
getDescribedResource
FedoraResource getDescribedResource()
Get the resource described by this resource- Returns:
- the resource being described
-
getInteractionModel
String getInteractionModel()
Get the resource's interaction model.- Returns:
- the interaction model.
-
-