Package org.fcrepo.kernel.api.models
Interface FedoraResource
-
- All Known Implementing Classes:
BinaryImpl
,ContainerImpl
,FedoraResourceImpl
,NonRdfSourceDescriptionImpl
,TimeMapImpl
,TombstoneImpl
,WebacAclImpl
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 FedoraResource
findMementoByDatetime(Instant mementoDatetime)
Retrieve the Memento with the closest datetime to the request.FedoraResource
getAcl()
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 recursivelyFedoraResource
getContainer()
Get the container of this resourceString
getCreatedBy()
Get the created by valueInstant
getCreatedDate()
Get the date this resource was createdFedoraResource
getDescribedResource()
Get the resource described by this resourceFedoraResource
getDescription()
Get the description for this resourceString
getEtagValue()
Construct an ETag value for the resource.FedoraId
getFedoraId()
Get the FedoraId for this resource.String
getId()
Get the fedora identifier for this resourceString
getInteractionModel()
Get the resource's interaction model.String
getLastModifiedBy()
Get the last modified by valueInstant
getLastModifiedDate()
Get the date this resource was last modifiedInstant
getMementoDatetime()
Retrieve the mementoDatetime property and return it as an InstantFedoraResource
getOriginalResource()
Get the Original Resource for which this resource is a memento or timemap for.FedoraResource
getParent()
Get the resource which contains this resource.FedoraId
getParentId()
Get the FedoraId of this resource's parentString
getStateToken()
Construct a State Token value for the resource.List<URI>
getSystemTypes(boolean forRdf)
Get only the system defined types from their RDF.TimeMap
getTimeMap()
Get the TimeMap/LDPCv of this resourceRdfStream
getTriples()
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.boolean
hasProperty(String relPath)
Does this resource have a propertyboolean
hasType(String type)
Check if this object uses a given RDF typeboolean
isAcl()
Returns true if this resource is an ACL.boolean
isMemento()
Returns true if this resource is a Memento.boolean
isOriginalResource()
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.
-
-