public class LockUtils extends Object
Modifier and Type | Field and Description |
---|---|
static AccessLevel |
CHECKOUT_LOCK_RESTRICTION
AccessLevel specifying the restrictions for an ECM "checkout" lock.
|
static AccessLevel |
DAV_LOCK_RESTRICTION
AccessLevel specifying the restrictions for a DAV lock.
|
static AccessLevel |
FINALIZED_LOCK_RESTRICTION
AccessLevel specifying the restrictions for an ECM "finalized" lock
(version immutability lock).
|
static AccessLevel |
FREEZE_LOCK_RESTRICTION
AccessLevel specifying the restrictions for an ECM "freeze" lock
(used for documents that are put under a legal or audit hold).
|
static AccessLevel |
HAS_RECORD_LOCK_RESTRICTION
AccessLevel specifying the restrictions for an ECM "HasRecord" lock
This lock is used to prevent deletion and move of Family and Folder
instances that contain records.
|
static AccessLevel |
LIFECYCLE_LOCK_RESTRICTION
AccessLevel specifying the restrictions for an ECM "lifecycle" lock
(used for documents that are classified with a LifecyclePolicy that
is configured to imply that the document should also be locked).
|
static AccessLevel |
MANUAL_LOCK_RESTRICTION
AccessLevel specifying the restrictions for an ECM "manual" lock.
|
static AccessLevel |
RECORD_LOCK_RESTRICTION
AccessLevel specifying the restrictions for an ECM "record" lock
(record immutability lock).
|
static AccessLevel |
RETENTION_LOCK_RESTRICTION
AccessLevel specifying the restrictions for an ECM "retention" lock
(used for documents that are classified with a RetentionPolicy that
is configured to imply that the document should also be locked).
|
static AccessLevel |
WORKFLOW_LOCK_RESTRICTION
AccessLevel specifying the restrictions for an ECM "workflow" lock.
|
Constructor and Description |
---|
LockUtils() |
Modifier and Type | Method and Description |
---|---|
static LockEntry |
acquireManualLock(PublicObject object)
Acquire a manual lock for the given object.
|
static void |
addLockType(LibrarySession session,
boolean custom,
String lockTypeKey,
boolean singleton,
LockEntryDefinition lockDef)
Adds a new lock type entry to a lock type lookup table.
|
static LockEntryDefinition |
createCheckoutLockEntryDefinition(LibrarySession session)
Creates a LockEntryDefinition that specifies an ECM "checkout" lock.
|
static LockEntryDefinition |
createDavLockEntryDefinition(LibrarySession session,
Date timeout,
Integer depth,
String token,
String davOwner)
Creates a LockEntryDefinition that specifies a DAV lock.
|
static void |
createLockTypeLookupTables(LibrarySession session)
Creates the lock type lookup tables in the instance-wide
Domain PropertyBundle.
|
static LockEntryDefinition |
createManualLockEntryDefinition(LibrarySession session)
Creates a LockEntryDefinition that specifies an ECM "manual" lock.
|
static SystemLockEntry |
createNamedFreezeLock(LibrarySession session,
Folder domain,
String freezeName)
Find a Named freeze SystemLockEntry by name.
|
static Long |
deleteNamedFreezeLock(LibrarySession session,
Folder domain,
String freezeName)
Delete a Named freeze SystemLockEntry.
|
static LockEntry |
findLockEntry(PublicObject[] objects,
int lockEntryType)
Returns the first LockEntry, of the given lockEntryType, found on the
given array of PublicObjects.
|
static LockEntry |
findLockEntry(PublicObject object,
int lockType)
Returns the first LockEntry on the given PublicObject with its TYPE
attribute equal to the given lockEntryType, or null if no
LockEntry of the specified TYPE exists on the object.
|
static LockEntry |
findLockEntry(PublicObject object,
int[] lockTypes)
Returns the first LockEntry on the given PublicObject with its TYPE
attribute equal to one of the given lockTypes, or null if no
LockEntry of the specified TYPEs exists on the object.
|
static SystemLockEntry |
findNamedFreezeLock(LibrarySession session,
Folder domain,
String freezeName)
Find a Named freeze SystemLockEntry by name.
|
static SystemLockEntry |
getFinalizedLockEntry(LibrarySession session)
Returns the singleton Oracle "finalized" SystemLockEntry.
|
static SystemLockEntry |
getFreezeLockEntry(LibrarySession session)
Returns the singleton Oracle "freeze" SystemLockEntry.
|
static SystemLockEntry |
getHasRecordLockEntry(LibrarySession session)
Returns the singleton Oracle "hasRecord" SystemLockEntry.
|
static SystemLockEntry |
getLifecycleLockEntry(LibrarySession session)
Returns the singleton Oracle "lifecycle" SystemLockEntry.
|
static String[] |
getLockTypeKeys(LibrarySession session,
boolean custom)
Returns a registered lock type that is a global shared singleton as a
SystemLockEntry.
|
static PropertyBundle |
getLockTypeLookupTable(LibrarySession session,
boolean custom)
Returns either the standard Oracle lock type lookup table
or the custom lock type lookup table.
|
static SystemLockEntry |
getRecordLockEntry(LibrarySession session)
Returns the singleton Oracle "record" SystemLockEntry.
|
static LockEntryDefinition |
getRegisteredLockTypeDefinition(LibrarySession session,
boolean custom,
String lockTypeKey,
LockEntryDefinition overrideDef)
Returns a registered lock type as a LockEntryDefinition.
|
static SystemLockEntry |
getRegisteredSingletonLockType(LibrarySession session,
boolean custom,
String lockTypeKey)
Returns a registered lock type that is a global shared singleton as a
SystemLockEntry.
|
static SystemLockEntry |
getRetentionLockEntry(LibrarySession session)
Returns the singleton Oracle "retention" SystemLockEntry.
|
static LockEntry |
refreshDavLock(PublicObject object,
Date timeout,
String davOwner)
Refreshes a DAV lock for the given object.
|
static void |
releaseDavLock(PublicObject object)
Releases a DAV lock from the given object, if a DAV lock exists for
that object.
|
static void |
releaseManualLock(PublicObject object)
Release the manual lock for the given object if it exists.
|
static void |
removeLockType(LibrarySession session,
boolean custom,
String lockTypeKey)
Removes a registered lock type.
|
static void |
unlockIfExists(PublicObject object,
int lockEntryType)
Unlocks the LockEntry of the specifed lockEntryType if it exists on the
given PublicObject.
|
static void |
verifyLockEntry(LibrarySession session,
PublicObject object,
LockEntryDefinition def)
Verify that the lockentry definition can be applied to the
specifed object.
|
public static AccessLevel CHECKOUT_LOCK_RESTRICTION
public static AccessLevel MANUAL_LOCK_RESTRICTION
public static AccessLevel DAV_LOCK_RESTRICTION
public static AccessLevel FINALIZED_LOCK_RESTRICTION
public static AccessLevel WORKFLOW_LOCK_RESTRICTION
public static AccessLevel RECORD_LOCK_RESTRICTION
public static AccessLevel HAS_RECORD_LOCK_RESTRICTION
public static AccessLevel FREEZE_LOCK_RESTRICTION
public static AccessLevel LIFECYCLE_LOCK_RESTRICTION
public static AccessLevel RETENTION_LOCK_RESTRICTION
public static LockEntryDefinition createCheckoutLockEntryDefinition(LibrarySession session) throws IfsException
session
- the current sessionIfsException
- if the operation failspublic static LockEntryDefinition createManualLockEntryDefinition(LibrarySession session) throws IfsException
session
- the current sessionIfsException
- if the operation failspublic static LockEntryDefinition createDavLockEntryDefinition(LibrarySession session, Date timeout, Integer depth, String token, String davOwner) throws IfsException
session
- the current sessiontimeout
- the timeout valuedepth
- the depth valuetoken
- the DAV token valuedavOwner
- the DavOwner valueIfsException
- if the operation failspublic static void releaseDavLock(PublicObject object) throws IfsException
object
- the object from which to release the DAV lock.IfsException
- if the operation fails.public static LockEntry refreshDavLock(PublicObject object, Date timeout, String davOwner) throws IfsException
object
- the object on which to refresh the DAV locktimeout
- the new timeout valuedavOwner
- the new DavOwner valueIfsException
- if the operation failspublic static SystemLockEntry getFinalizedLockEntry(LibrarySession session) throws IfsException
session
- the current sessionIfsException
- if the operation failspublic static SystemLockEntry getRecordLockEntry(LibrarySession session) throws IfsException
session
- the current sessionIfsException
- if the operation failspublic static SystemLockEntry getHasRecordLockEntry(LibrarySession session) throws IfsException
session
- the current sessionIfsException
- if the operation failspublic static SystemLockEntry getFreezeLockEntry(LibrarySession session) throws IfsException
session
- the current sessionIfsException
- if the operation failspublic static SystemLockEntry getLifecycleLockEntry(LibrarySession session) throws IfsException
session
- the current sessionIfsException
- if the operation failspublic static SystemLockEntry getRetentionLockEntry(LibrarySession session) throws IfsException
session
- the current sessionIfsException
- if the operation failspublic static LockEntry acquireManualLock(PublicObject object) throws IfsException
object
- the object to lockIfsException
- if the operation failspublic static void releaseManualLock(PublicObject object) throws IfsException
object
- the object to lockIfsException
- if the operation failspublic static void verifyLockEntry(LibrarySession session, PublicObject object, LockEntryDefinition def) throws IfsException
session
- the session contextobject
- the object to inspectdef
- the LockEntry definitionIfsException
- 90704: if a lock exist of the same type specified
public static LockEntry findLockEntry(PublicObject object, int lockType) throws IfsException
object
- the PublicObject on which to find the LockEntry of
the specified TYPElockType
- the TYPE of LockEntry to findIfsException
- if the operation failspublic static LockEntry findLockEntry(PublicObject object, int[] lockTypes) throws IfsException
object
- the PublicObject on which to find the LockEntry of
the specified TYPElockTypes
- set of LockEntry TYPEs to findIfsException
- if the operation failspublic static LockEntry findLockEntry(PublicObject[] objects, int lockEntryType) throws IfsException
objects
- the array of PublicObjects on which to find the
LockEntry of the specified TYPElockEntryType
- the TYPE of LockEntryIfsException
- if the operation failspublic static void unlockIfExists(PublicObject object, int lockEntryType) throws IfsException
Does nothing if the LockEntry of the specified lockEntryType does not exist on the specified PublicObject.
object
- the PublicObject for which to unlock the LockEntrylockEntryType
- the TYPE of LockEntry to unlockIfsException
- if the operation failspublic static SystemLockEntry findNamedFreezeLock(LibrarySession session, Folder domain, String freezeName) throws IfsException
The name specified is the "common name" for the freeze. The actual unique name is derived from the combination of the domain and the common name.
session
- the session contextdomain
- the Domain contextfreezeName
- the name of the Named freeze lockIfsException
- if the operation failspublic static SystemLockEntry createNamedFreezeLock(LibrarySession session, Folder domain, String freezeName) throws IfsException
The name specified is the "common name" for the freeze. The actual unique name is derived from the combination of the domain and the common name.
session
- the session contextdomain
- the Domain contextfreezeName
- the name of the Named freeze lockIfsException
- if the operation failspublic static Long deleteNamedFreezeLock(LibrarySession session, Folder domain, String freezeName) throws IfsException
The name specified is the "common name" for the freeze. The actual unique name is derived from the combination of the domain and the common name.
By deleting the SystemLockEntry, all objects that reference this will have that lock implicitly released. This is done lazily - the referencing PublicObjects will still have that LockEntry in its LockEntry array, but it will be treated as though it is removed in determining lock status.
session
- the session contextdomain
- the Domain contextfreezeName
- the name of the Named freeze lockIfsException
- if the operation failspublic static void createLockTypeLookupTables(LibrarySession session) throws IfsException
Note: this method should only be called at schema initialization time
session
- the session contextIfsException
- if the operation failspublic static void addLockType(LibrarySession session, boolean custom, String lockTypeKey, boolean singleton, LockEntryDefinition lockDef) throws IfsException
session
- the current sessioncustom
- true if this is a custom lock; false if it is a
standard Oracle lock typelockTypeKey
- the key for the new lock typesingleton
- true if this lock type should be a global shared
singleton SystemLockEntry; false if it should be
a LockEntry definitionlockDef
- the definition for the custom lock typeIfsException
- if the operation failspublic static PropertyBundle getLockTypeLookupTable(LibrarySession session, boolean custom) throws IfsException
session
- the current sessioncustom
- true if the custom lock type lookup table should be
returned; false if the standard Oracle lock type
lookup table should be returnedIfsException
- if the operation failspublic static LockEntryDefinition getRegisteredLockTypeDefinition(LibrarySession session, boolean custom, String lockTypeKey, LockEntryDefinition overrideDef) throws IfsException
session
- the current sessioncustom
- true if this is a custom lock type; false if it is a
standard Oracle lock typelockTypeKey
- the key for the registered lock typeoverrideDef
- an optional LockEntryDefinition with overridesIfsException
- if the operation failspublic static SystemLockEntry getRegisteredSingletonLockType(LibrarySession session, boolean custom, String lockTypeKey) throws IfsException
session
- the current sessioncustom
- true if this is a custom lock type; false if it is a
standard Oracle lock typelockTypeKey
- the key for the registered singleton lock typeIfsException
- 90780: if lockTypeKey does not refer to a singleton lock type
public static String[] getLockTypeKeys(LibrarySession session, boolean custom) throws IfsException
session
- the current sessioncustom
- true if this is a custom lock type; false if it is a
standard Oracle lock typeIfsException
- if the operation failspublic static void removeLockType(LibrarySession session, boolean custom, String lockTypeKey) throws IfsException
session
- the current sessioncustom
- true if this is a custom lock type; false if it is a
standard Oracle lock typelockTypeKey
- the key for the registered singleton lock typeIfsException
- if the operation failsCopyright © 2023. All rights reserved.