Class FedoraId
java.lang.Object
org.fcrepo.kernel.api.identifiers.FedoraId
Class to store contextual information about a Fedora ID.
Differentiates between the original ID of the request and the actual resource we are operating on.
Resource Id : the shortened ID of the base resource, mostly needed to access the correct persistence object.
fullId : the full ID from the request, used in most cases.
So a fullId of info:fedora/object1/another/fcr:versions/20000101121212 has an id of info:fedora/object1/another
- Since:
- 6.0.0
- Author:
- whikloj
-
Method Summary
Modifier and TypeMethodDescriptionasAcl()Creates a new Fedora ID based on this ID that points to an ACL resource.asBaseId()Behaves the same asgetBaseId()except it returns a FedoraId rather than a String.Creates a new Fedora ID based on this ID that points to a binary description resource.Creates a new Fedora ID based on this ID that points to a memento resource.Creates a new Fedora ID based on this ID that points to a memento resource.Behaves the same asgetResourceId()except it returns a FedoraId rather than a String.Creates a new Fedora ID based on this ID that points to a timemap resource.Creates a new Fedora ID based on this ID that points to a tombstone resource.static FedoraIdStatic create methodbooleanReturns the ID string for the base ID the Fedora ID describes.Returns the FullId of the described resource.Return the original full ID.Return the original full ID without the info:fedora prefix.Get the hash uri.Return the Memento datetime as Instant.Return the Memento datetime string.static FedoraIdGet a FedoraId for repository root.Returns the ID string for the physical resource the Fedora ID describes.inthashCode()booleanisAcl()Is the identifier for an ACL?booleanIs the identifier for a nonRdfSourceDescription?booleanIs the identifier for a hash uri?booleanIs the identifier for a Memento?booleanIs the identifier for the repository root.booleanIs the identifier for a timemap?booleanIs the identifier for a tombstoneCreates a new Fedora ID by joining the base ID of this Fedora ID with the specified string part.toString()
-
Method Details
-
create
Static create method- Parameters:
additions- One or more strings to build an ID.- Returns:
- The FedoraId.
-
getRepositoryRootId
Get a FedoraId for repository root.- Returns:
- The FedoraId for repository root.
-
isRepositoryRoot
Is the identifier for the repository root.- Returns:
- true of id is equal to info:fedora/
-
isMemento
Is the identifier for a Memento?- Returns:
- true if the id is for the fcr:versions endpoint and has a memento datetime string after it.
-
isAcl
Is the identifier for an ACL?- Returns:
- true if the id is for the fcr:acl endpoint.
-
isTimemap
Is the identifier for a timemap?- Returns:
- true if id for the fcr:versions endpoint and NOT a memento.
-
isDescription
Is the identifier for a nonRdfSourceDescription?- Returns:
- true if id for the fcr:metadata endpoint
-
isTombstone
Is the identifier for a tombstone- Returns:
- true if id for the fcr:tombstone endpoint
-
isHashUri
Is the identifier for a hash uri?- Returns:
- true if full id referenced a hash uri.
-
getHashUri
Get the hash uri.- Returns:
- the hash uri from the id or null if none.
-
getResourceId
Returns the ID string for the physical resource the Fedora ID describes. In most cases, this ID is the same as the full resource ID. However, if the resource is a memento, timemap, or tombstone, then the ID returned here will be for the resource that contains it. Here are some examples:- "info:fedora/object1/another/fcr:versions/20000101121212" => "info:fedora/object1/another"
- "info:fedora/object1/another/fcr:metadata" => "info:fedora/object1/another/fcr:metadata"
- "info:fedora/object1/another" => "info:fedora/object1/another"
- Returns:
- the ID of the associated physical resource
-
asResourceId
Behaves the same asgetResourceId()except it returns a FedoraId rather than a String.- Returns:
- the ID of the associated physical resource
-
getBaseId
Returns the ID string for the base ID the Fedora ID describes. This value is the equivalent of the full ID with all extensions removed.- "info:fedora/object1/another/fcr:versions/20000101121212" => "info:fedora/object1/another"
- "info:fedora/object1/another/fcr:metadata" => "info:fedora/object1/another"
- "info:fedora/object1/another" => "info:fedora/object1/another"
- Returns:
- the ID of the associated base resource
-
asBaseId
Behaves the same asgetBaseId()except it returns a FedoraId rather than a String.- Returns:
- the ID of the associated base resource
-
getFullId
Return the original full ID.- Returns:
- the id.
-
getFullIdPath
Return the original full ID without the info:fedora prefix.- Returns:
- the full id path part
-
getEncodedFullId
- Returns:
- The encoded full ID.
-
getMementoInstant
Return the Memento datetime as Instant.- Returns:
- The datetime or null if not a memento.
-
getMementoString
Return the Memento datetime string.- Returns:
- The yyyymmddhhiiss memento datetime or null if not a Memento.
-
resolve
Creates a new Fedora ID by joining the base ID of this Fedora ID with the specified string part. Any extensions that this Fedora ID contains are discarded. For example:Resolving "child" against "info:fedora/object1/another/fcr:versions/20000101121212" yields "info:fedora/object1/another/child".
- Parameters:
child- the part to join- Returns:
- new Fedora ID in the form baseId/child
-
asAcl
Creates a new Fedora ID based on this ID that points to an ACL resource. The base ID, full ID without extensions, is always used to construct an ACL ID. If this ID is already an ACL, then it returns itself.- Returns:
- ACL resource ID
-
asDescription
Creates a new Fedora ID based on this ID that points to a binary description resource. There is no guarantee that the binary description resource exists. If this ID is already a description, then it returns itself. Otherwise, it uses the base ID, without extensions, to construct the new ID. If this Fedora ID is a timemap or memento or a hash uri, then these extensions are applied to new description ID as well.- Returns:
- description resource ID
-
getFullDescribedId
Returns the FullId of the described resource.- Returns:
- The ID.
-
asTombstone
Creates a new Fedora ID based on this ID that points to a tombstone resource. If this ID is already a tombstone, then it returns itself. Otherwise, it uses the base ID, without extensions, to construct the new ID.- Returns:
- tombstone resource ID
-
asTimemap
Creates a new Fedora ID based on this ID that points to a timemap resource. If this ID is already a timemap, then it returns itself. Otherwise, it uses the base ID, without extensions, to construct the new ID. Unless this ID is a binary description, in which case the new ID is constructed using the full ID.- Returns:
- timemap resource ID
-
asMemento
Creates a new Fedora ID based on this ID that points to a memento resource. If this ID is already a memento, then it returns itself. If this ID is an ACL, tombstone, or timemap, then the new ID is constructed using this ID's base ID. Otherwise, the full ID is used.- Parameters:
mementoInstant- memento representation- Returns:
- memento resource ID
-
asMemento
Creates a new Fedora ID based on this ID that points to a memento resource. If this ID is already a memento, then it returns itself. If this ID is an ACL, tombstone, or timemap, then the new ID is constructed using this ID's base ID. If this ID is a description, then the new ID is appended to the description ID.- Parameters:
mementoString- string memento representation- Returns:
- memento resource ID
-
equals
-
hashCode
-
toString
-