public interface PersistenceManager extends Resolver
| Modifier and Type | Interface and Description |
|---|---|
static class |
PersistenceManager.LockParameters
Encapsulation of lock parameters.
|
static class |
PersistenceManager.LockPhase |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
LOCK_NAME
Option for lockObject that specifies the name of the user
that will hold the lock.
|
static java.lang.String |
LOCK_TYPE
Option for lockObject that specifies the type of lock to
be acquired.
|
static java.lang.String |
LOCK_TYPE_PERSISTENT
A value for the LOCK_TYPE option that selects a persistent lock.
|
static java.lang.String |
LOCK_TYPE_TRANSACTION
A value for the LOCK_TYPE option that selects a transaction lock.
|
| Modifier and Type | Method and Description |
|---|---|
void |
attach(SailPointObject object)
Attach the given SailPointObject possibly loaded by a different
SailPointContext to this SailPointContext.
|
void |
clearHighLevelCache()
Clears a "high level" cache.
|
java.lang.Object |
clone()
Optional clone method.
|
void |
close()
Close this PersistenceManager and release any resources in use.
|
void |
commitTransaction()
Commit the current transaction that was started with
startTransaction(). |
void |
commitTransaction(boolean startNewTransaction)
Commit the current transaction that was started with
startTransaction(). |
int |
countObjects(java.lang.Class cls,
QueryOptions options)
Counts the number of objects that match a criteria.
|
void |
decache()
Remove all objects the cache.
|
void |
decache(SailPointObject obj)
Remove the object from the cache.
|
void |
enableStatistics(boolean b)
Enable or disable collection of statistics.
|
<T extends SailPointObject> |
getObjectById(java.lang.Class<T> cls,
java.lang.String id)
Retrieve an object by id.
|
<T extends SailPointObject> |
getObjectByName(java.lang.Class<T> cls,
java.lang.String name)
Retrieve an object by name.
|
<T extends SailPointObject> |
getObjects(java.lang.Class<T> cls)
Return all objects of a given class.
|
<T extends SailPointObject> |
getObjects(java.lang.Class<T> cls,
QueryOptions ops)
Return all objects of a given class, constrained by Filters
in the QueryOptions.
|
PersistenceOptions |
getPersistenceOptions()
Get current options that control how objects are managed in the Hibernate session.
|
default <T> java.util.Iterator<T> |
getPropertyIterator(java.lang.Class<? extends SailPointObject> cls,
QueryOptions options,
java.lang.String property)
Perform a projection search for a single object property and return an iterator.
|
default <T> java.util.List<T> |
getPropertyList(java.lang.Class<? extends SailPointObject> cls,
QueryOptions options,
java.lang.String property)
Perform a projection search for a single object property and return a list.
|
<T extends SailPointObject> |
getUniqueObject(java.lang.Class<T> cls,
Filter f)
Retrieve an object matching a Filter.
|
<T extends SailPointObject> |
getUniqueObject(T example)
Retrieve an object whose properties match those specified in
an example object.
|
void |
importObject(SailPointObject obj)
Import an object into the persistent store.
|
<T extends SailPointObject> |
lockObject(java.lang.Class<T> clazz,
PersistenceManager.LockParameters params)
This method should be the entry point for all public locking calls.
|
<T extends SailPointObject> |
lockObjectById(java.lang.Class<T> cls,
java.lang.String id,
java.util.Map<java.lang.String,java.lang.Object> options)
Retrieve an object with a long-duration lock.
|
<T extends SailPointObject> |
lockObjectByName(java.lang.Class<T> cls,
java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> options)
Retrieve an object with a long-duration lock.
|
void |
printStatistics()
Print the collected statistics.
|
void |
reconnect()
Reconnect the PersistenceManager to the persistent store (for example, by
reconnecting to the database).
|
void |
releasePersistentLocks()
Ensure any persistent locks acquired are released before releasing this context.
|
void |
removeObject(SailPointObject obj)
Remove an object from the persistent store.
|
<T extends SailPointObject> |
removeObjects(java.lang.Class<T> cls,
QueryOptions ops)
Bulk remove object based on the Filter defined in the
QueryOptions.
|
boolean |
requiresJoin(java.lang.Class<? extends SailPointObject> cls,
QueryOptions options,
java.util.List<java.lang.String> properties)
Returns whether the resulting query for the specified QueryOptions and properties
requires sql joins, making duplicate results possible.
|
void |
rollbackTransaction()
Rollback the current transaction that was started with
startTransaction(). |
void |
saveObject(SailPointObject obj)
Save an object in the persistent store.
|
<T extends SailPointObject> |
search(java.lang.Class<T> cls,
QueryOptions options)
Return a set of objects matching the query options.
|
<T extends SailPointObject> |
search(java.lang.Class<T> cls,
QueryOptions options,
java.util.List<java.lang.String> properties)
Perform a projection search for selected object properties and return
an iterator.
|
<T extends SailPointObject> |
search(java.lang.Class<T> cls,
QueryOptions options,
java.lang.String properties)
Perform a projection search for selected object properties and return
an iterator.
|
java.util.Iterator |
search(java.lang.String query,
java.util.Map<java.lang.String,java.lang.Object> args,
QueryOptions ops)
Perform a search specified in an HQL or SQL string.
|
void |
setPersistenceOptions(PersistenceOptions ops)
Set options to control how objects are managed in the Hibernate session.
|
void |
startTransaction()
Begin a transaction.
|
<T extends SailPointObject> |
unlockObject(T object)
Save and unlock an object.
|
int |
update(java.lang.String query,
java.util.Map<java.lang.String,java.lang.Object> args) |
static final java.lang.String LOCK_NAME
static final java.lang.String LOCK_TYPE
static final java.lang.String LOCK_TYPE_TRANSACTION
static final java.lang.String LOCK_TYPE_PERSISTENT
java.lang.Object clone()
throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedExceptionvoid startTransaction()
throws GeneralException
GeneralExceptionvoid commitTransaction()
throws GeneralException
startTransaction().GeneralExceptionvoid commitTransaction(boolean startNewTransaction)
throws GeneralException
startTransaction().GeneralExceptionvoid rollbackTransaction()
throws GeneralException
startTransaction().GeneralExceptionvoid releasePersistentLocks()
throws GeneralException
GeneralExceptionvoid close()
throws GeneralException
SailPointFactory.releaseContext().GeneralException<T extends SailPointObject> T getObjectById(java.lang.Class<T> cls, java.lang.String id) throws GeneralException
getObjectById in interface ResolverGeneralException<T extends SailPointObject> T getObjectByName(java.lang.Class<T> cls, java.lang.String name) throws GeneralException
getObjectByName in interface ResolverGeneralException<T extends SailPointObject> T lockObjectById(java.lang.Class<T> cls, java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> options) throws GeneralException
GeneralException<T extends SailPointObject> T lockObjectByName(java.lang.Class<T> cls, java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> options) throws GeneralException
GeneralException<T extends SailPointObject> void unlockObject(T object) throws GeneralException
GeneralException<T extends SailPointObject> T getUniqueObject(T example) throws GeneralException
GeneralException<T extends SailPointObject> T getUniqueObject(java.lang.Class<T> cls, Filter f) throws GeneralException
GeneralExceptionvoid saveObject(SailPointObject obj) throws GeneralException
GeneralExceptionvoid importObject(SailPointObject obj) throws GeneralException
GeneralExceptionvoid removeObject(SailPointObject obj) throws GeneralException
GeneralException<T extends SailPointObject> void removeObjects(java.lang.Class<T> cls, QueryOptions ops) throws GeneralException
GeneralException<T extends SailPointObject> java.util.List<T> getObjects(java.lang.Class<T> cls) throws GeneralException
GeneralException<T extends SailPointObject> java.util.List<T> getObjects(java.lang.Class<T> cls, QueryOptions ops) throws GeneralException
getObjects in interface ResolverGeneralExceptionint countObjects(java.lang.Class cls,
QueryOptions options)
throws GeneralException
GeneralException<T extends SailPointObject> java.util.Iterator<T> search(java.lang.Class<T> cls, QueryOptions options) throws GeneralException
GeneralExceptiongetObjects(Class, QueryOptions)<T extends SailPointObject> java.util.Iterator<java.lang.Object[]> search(java.lang.Class<T> cls, QueryOptions options, java.lang.String properties) throws GeneralException
search(Class, QueryOptions, List) but accepts the properties as
a comma-separated string rather than a list.cls - The Class to search over.options - The QueryOptions to use.properties - A comma-separated list of properties to return.GeneralException<T extends SailPointObject> java.util.Iterator<java.lang.Object[]> search(java.lang.Class<T> cls, QueryOptions options, java.util.List<java.lang.String> properties) throws GeneralException
GeneralExceptionboolean requiresJoin(java.lang.Class<? extends SailPointObject> cls, QueryOptions options, java.util.List<java.lang.String> properties)
cls - The class that we're searching on.options - The QueryOptions with filters and ordering.properties - The List of properties to return.default <T> java.util.Iterator<T> getPropertyIterator(java.lang.Class<? extends SailPointObject> cls, QueryOptions options, java.lang.String property) throws GeneralException
getPropertyList(java.lang.Class<? extends sailpoint.object.SailPointObject>, sailpoint.object.QueryOptions, java.lang.String) for large results to avoid pulling too much data into memory,
but should not be used if the results need to be iterable across transaction boundaries, as the iterator session
may be closed on commits.GeneralExceptiondefault <T> java.util.List<T> getPropertyList(java.lang.Class<? extends SailPointObject> cls, QueryOptions options, java.lang.String property) throws GeneralException
getPropertyIterator(java.lang.Class<? extends sailpoint.object.SailPointObject>, sailpoint.object.QueryOptions, java.lang.String) should be used.GeneralExceptionjava.util.Iterator search(java.lang.String query,
java.util.Map<java.lang.String,java.lang.Object> args,
QueryOptions ops)
throws GeneralException
GeneralExceptionint update(java.lang.String query,
java.util.Map<java.lang.String,java.lang.Object> args)
throws GeneralException
query - It can be either hql or sql. If it is sql it should be prepended with "sql:"args - Parameters for the queryGeneralExceptionvoid attach(SailPointObject object) throws GeneralException
GeneralExceptionvoid decache(SailPointObject obj) throws GeneralException
GeneralExceptionvoid decache()
throws GeneralException
GeneralExceptionvoid setPersistenceOptions(PersistenceOptions ops)
PersistenceOptions getPersistenceOptions()
void enableStatistics(boolean b)
void printStatistics()
void reconnect()
decache() instead.void clearHighLevelCache()
throws GeneralException
GeneralException<T extends SailPointObject> T lockObject(java.lang.Class<T> clazz, PersistenceManager.LockParameters params) throws GeneralException
clazz - The sailpoint class type of the objectparams - contains all the information pertinent to locking.GeneralException