Public Member Functions | |
UIDLibrary (Logger logger) | |
synchronized void | assignUniqueEntityId (EntityT entity, IdentifierJ identifier) throws AcsJUidAlreadyExistsEx, AcsJIdentifierUnavailableEx, AcsJRangeUnavailableEx, AcsJIdentifierUnexpectedEx |
synchronized void | replaceUniqueEntityId (EntityT entity, IdentifierJ identifier) throws AcsJRangeUnavailableEx, AcsJIdentifierUnavailableEx, AcsJIdentifierUnexpectedEx |
URI | getNewRestrictedRange (int size, String user, IdentifierJ identifier, boolean printLogs) throws AcsJRangeUnavailableEx, AcsJIdentifierUnexpectedEx |
URI | getNewRestrictedRange (int size, String user, IdentifierJ identifier) throws AcsJRangeUnavailableEx, AcsJIdentifierUnexpectedEx |
void | assignUniqueEntityId (EntityT entity, URI uri, boolean printLogs) throws AcsJRangeUnavailableEx, AcsJUidAlreadyExistsEx, AcsJRangeLockedEx, AcsJRangeExhaustedEx |
void | assignUniqueEntityId (EntityT entity, URI uri) throws AcsJRangeUnavailableEx, AcsJUidAlreadyExistsEx, AcsJRangeLockedEx, AcsJRangeExhaustedEx |
void | fetchRange (URI uri, String user, IdentifierJ identifier) throws AcsJRangeUnavailableEx |
void | assignUniqueEntityRef (EntityRefT ref, URI uri) throws AcsJRangeUnavailableEx, AcsJRangeExhaustedEx, AcsJRangeUnlockedEx |
Protected Member Functions | |
synchronized void | checkDefaultRange (IdentifierJ identifier) throws AcsJRangeUnavailableEx, AcsJIdentifierUnavailableEx |
Private Attributes | |
final Logger | logger |
final HashMap< URI, Range > | idRanges |
final HashMap< URI, Range > | refRanges |
Static Private Attributes | |
volatile Range | defaultRange |
Range
objects by only referring to them through their UIDs in methods assignUniqueEntityId(EntityT, URI), assignUniqueEntityRef(EntityRefT, URI) etc., but it is not clear how useful this is.
|
Creates the UIDLibrary without making any calls.
|
|
convenience method for the above, printLogs is set to true |
|
Assigns a uid to the EntityT from the specified range. This is not permitted with a locked Range object. This method should only be used in very special cases, see Archive/UidLibrary wiki page! TODO: figure out if this is meant to work only if the Range referenced by uri has been loaded previously by this instance. If so, put a comment that fetchRange must be called first. Otherwise the fetch method could be called automatically.
|
|
Assigns a UID from the default range to the
Implementation note: the default range of UIDs is retrieved from the archive at the first call and is then shared among instances in order to be frugal on UIDs and to minimize archive access. This means that often the passed in
|
|
Assigns a UID to an entity reference. This method should only be used in very special cases, see Archive/UidLibrary wiki page! Note that this operation is only permitted with a locked range.
|
|
Creates a default range on demand, or sets a new default range if the old range has no more UID (which happens after pulling Long.MAX UIDs, or sooner if a limit was set).
|
|
Fetch an existing range from the archive and deserialise, only certain operations will be permitted. This method should only be used in very special cases, see Archive/UidLibrary wiki page!
|
|
convenience method for the above, printLogs is set to true |
|
Fetches a new restricted range. This will return a URI allowing access to the new Range. The range is automatically stored in the archive. This method should only be used in very special cases, see Archive/UidLibrary wiki page!
|
|
Similar to assignUniqueEntityId(EntityT, IdentifierJ), but allows replacing an existing ID. Only in very special cases such as ObsPrep replacing locally-generated IDs with archive-generated UIDs should this method be used. Replacing UIDs can easily corrupt the archive because existing links would no longer hold!
|
|
|
|
|
|
|
|
|