public interface Database
Many methods take a parameter indicating whether security checks should be performed. If true, then the methods verify that the current operator (whose information is stored in the requestor context) can perform the operation, and throw an exception if the operator can not.
When this document talks about "deferring" a database operation,
it means that the database operation is performed when the
commit()
method is next called (or cancelled when
rollback()
is called).
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT |
static java.lang.String |
VERSION |
Modifier and Type | Method and Description |
---|---|
void |
addToUpdatesCache(java.lang.String aClearType,
ClipboardPage aInstancePage,
java.lang.String aParameters,
boolean aPerformOnThisNode,
boolean aPerformOnAllSystems)
Cause a rule instance to be updated on all nodes during their system pulse.
|
void |
addToUpdatesCache(java.lang.String aClearType,
java.lang.String aObjClass,
java.lang.String aInsKey,
java.lang.String aParameters,
boolean aPerformOnThisNode,
boolean aPerformOnAllSystems)
Cause a rule instance to be updated on all nodes during their system pulse.
|
boolean |
assertThreadLocalConnectionsClear()
Deprecated.
|
void |
cancelDeferredUpdate(ClipboardPage aInstancePage)
Cancels the deferred addition, deletion, or update of a page.
|
void |
clearCache()
Clears all entries from the database cache.
|
void |
commit()
Commits the current PegaRULES Transaction (applies all deferred
database changes).
|
void |
convertListCriteria(ClipboardPage aListPage)
Converts an old-style (version 2) list criteriapage to a current
list criteria page.
|
boolean |
delete(ClipboardPage aInstancePage,
boolean aCheckSecurity)
Immediately deletes a database instance from an object table.
|
void |
deleteDeferred(ClipboardPage aInstancePage,
boolean aCheckSecurity)
Defers deleting a database instance from an object table.
|
void |
deleteRDB(java.lang.String aObjectClass,
java.lang.String aRequestType,
java.lang.String aAccessMethod,
boolean aCheckSecurity)
Immediately deletes data from the database using an RDB rule.
|
boolean |
doClassesBelongToSingleDb(boolean aUseReportDb,
java.util.ArrayList aClasses)
Figures out if all classes in a SQL statement use the same dtabase instance.
|
boolean |
doesInstanceExist(java.lang.String aInstanceHandle)
Indicates whether a particular instance exists in the database.
|
void |
executeDBSchemaUpdates(java.util.List aSQL,
java.lang.String aDBName,
java.lang.String aUserName,
java.lang.String aPassword)
Executes SQL statements against a particular database, connecting with
a specified user name.
|
int |
executeRDB(com.pega.pegarules.priv.sqlgeneration.ISQLSelectQuery aSQLObject,
ClipboardPage aListPage)
Executes a SQL statement by using a Generated SQL Object.
|
int |
executeRDB(java.lang.String aSQL,
ClipboardPage aListPage)
Executes a SQL statement.
|
java.lang.String |
findHandle(StringMap aKeys)
Finds the handle of the instance that would be opened given a set of
keys.
|
void |
flushUpdatesCache(int aDeltaMinutes)
Flush out entries in pr_sys_updatescache older than given number of minutes
|
ClassDefinition |
getClassDef(java.lang.String aClassName)
Returns information about a class.
|
java.util.Collection |
getClassesInTable(java.lang.String aDBName,
java.lang.String aTableName)
Deprecated.
|
java.util.Collection |
getClassesInTable(java.lang.String aDBName,
java.lang.String aCatalog,
java.lang.String aSchema,
java.lang.String aTable)
Gets all the classes that live in a particular database table.
|
java.lang.String |
getColumnDataTypeForProperty(java.lang.String aClassName,
java.lang.String aPropertyName)
Returns the column data type for a property whether explicitly mapped or not.
|
java.lang.String |
getColumnForProperty(java.lang.String aClassName,
java.lang.String aPropertyName)
Returns the column name for a property whether explicitly mapped or not.
|
java.util.SortedSet |
getColumnsForTable(java.lang.String aDBName,
java.lang.String aTableName)
Deprecated.
this method does not allow you to specify the
catalog and schema of the table
|
java.lang.String[] |
getConcreteDescendantsInCurrentApplication(java.lang.String aAncestorName)
Returns the names of descendant classes of the given class that are concrete and
are in the current Application's rule sets, in distance order, nearest first.
|
java.lang.String |
getDataUniqueID(java.lang.String aOrganization,
java.lang.String aPrefix,
java.lang.String aSuffix)
Obtain a unique ID value for items
|
DatabaseInformation |
getDBInfo(java.lang.String aDBName)
Returns low-level information about a database.
|
java.util.List |
getDBSchemas(java.lang.String aDBName)
Returns a array of strings that are the schema's available from this db connection.
|
java.util.Collection |
getDBTables(java.lang.String aDBName,
java.lang.String aCatalogName,
java.lang.String aSchemaName,
java.lang.String[] aTableTypes)
Returns a Collection of com.pega.pegarules.pub.database.DatabaseTable objects
that contain information about a database's tables.
|
java.util.Collection |
getExposedList(ClassDefinition cdCurrentClass)
Deprecated.
use
PegaClassDefinition.getColumnsInTable()
instead |
ClassDefinition |
getFirstRealPatternAncestor(java.lang.String aClassName)
Goes through the pattern ancestors of this class, and returns
the first one that names a real class.
|
java.lang.String |
getHandle(StringMap aInstancePage)
Calculates the handle of an instance.
|
java.lang.String |
getInsIdFromInsName(java.lang.String aInstanceClass,
java.lang.String aInstanceName)
Gets the instance id using instance name
|
java.lang.String |
getInstanceName(StringMap aInstancePage,
ClassDefinition aClassDef)
Get the instance name for a page.
|
LockManager |
getLockManager()
Retrieves the lock manager.
|
java.util.Map |
getPropertyToColumnMap(java.lang.String aClassName)
Returns the explicit map of properties to columns.
|
RulesetContext |
getRulesetContext(ClipboardPage aRulePage)
Returns rule editing tools associated with a particular page.
|
RulesetContext |
getRulesetContext(ClipboardPage aRulePage,
java.lang.String aRuleSetNameProperty,
java.lang.String aRuleSetVersionProperty)
Returns rule editing tools associated with a particular page when
the page has non-standard RuleSet name and RuleSet version properties.
|
java.util.List<java.lang.String> |
getRulesetsFromApplication(java.util.List aApplicationList,
boolean aFollowDependencies,
boolean aFollowByParent)
Takes a list of Applications and returns the rulesets defined in those applications
|
int |
list(ClipboardPage aListPage,
boolean aCheckSecurity)
Lists instances from an object table.
|
int |
listRDB(ClipboardPage aListPage,
java.lang.String aRequestType,
java.lang.String aAccessMethod,
boolean aCheckSecurity)
Lists instances using an RDB rule.
|
void |
noteConfigChangesInClassMap(java.util.Collection configSaves,
java.util.Collection configDeletes)
Used by the system pulse (Code-.SystemPulse) to notify the classMap of config changes
|
ClipboardPage |
open(java.lang.String aInstanceHandle,
boolean aCheckSecurity)
Opens an instance from an object table by its handle.
|
ClipboardPage |
open(java.lang.String aInstanceHandle,
boolean aCheckSecurity,
boolean aLock,
boolean aUnlockOnCommit,
StringMap aLockInfo)
Opens an instance from an object table by its handle.
|
ClipboardPage |
open(StringMap aInstancePage,
boolean aCheckSecurity)
Opens the instance with the given keys.
|
ClipboardPage |
open(StringMap aInstancePage,
boolean aCheckSecurity,
boolean aLock,
boolean aUnlockOnCommit,
StringMap aLockInfo)
Opens the instance with the given keys.
|
ClipboardPage |
openDefault(StringMap aKeys,
boolean aCheckSecurity)
Opens the default version of the Rule with the given keys.
|
java.util.Map |
openForAllCircumstanceVals(StringMap aInstancePage,
RuleResolutionInformation aRuleInfo)
Deprecated.
|
ClipboardPage |
openIfStale(ClipboardPage aInstancePage,
boolean aCheckSecurity,
boolean aLock,
boolean aUnlockOnCommit,
StringMap aLockInfo)
Checks to see if an instance has been modfied; if it has, this function returns
a ClipboardPage with the new definition, if not return a handle to the input
page.
|
ClipboardPage |
openRDB(java.lang.String aObjectClass,
java.lang.String aRequestType,
java.lang.String aAccessMethod,
boolean aCheckSecurity)
Reads an instance using an RDB rule.
|
java.util.Map |
performSystemIndex()
Synchronizes the PegaRULES index with changes from all the nodes on this system.
|
java.util.Hashtable |
performSystemPulse()
Synchronize self with rest of nodes on this system
|
void |
recordAssembly(boolean aIsStart,
java.lang.String aAssemblyClass,
java.lang.String aForClass)
Records the fact that rule assembly was started or stopped as a Database
Trace event.
|
void |
removeFromNodeCache(ClipboardPage aInstancePage)
Remove a specific instance from the node's cache.
|
void |
removeFromNodeCache(java.lang.String aObjClass,
java.lang.String aInsKey)
Deprecated.
|
void |
resolveResultsOnListPage(ClipboardPage aListPage)
Filters a code-pega-list page so that it only contains the rule resolved classes.
|
void |
rollback()
Rolls back a PegaRULES Transaction (discards all deferred database changes).
|
void |
save(ClipboardPage aInstancePage,
boolean aOnlyIfNew,
boolean aCheckSecurity)
Immediately writes an instance to an object table.
|
void |
save(ClipboardPage aInstancePage,
boolean aOnlyIfNew,
boolean aCheckSecurity,
boolean aWithErrors)
Immediately writes an instance to the database.
|
void |
saveDeferred(ClipboardPage aInstancePage,
boolean aOnlyIfNew,
boolean aCheckSecurity)
Defers writing an instance to an object table.
|
void |
saveDeferred(ClipboardPage aInstancePage,
boolean aOnlyIfNew,
boolean aCheckSecurity,
boolean aWithErrors)
Defers writing an instance to an object table.
|
void |
saveRDB(java.lang.String aObjectClass,
java.lang.String aRequestType,
java.lang.String aAccessMethod,
boolean aCheckSecurity)
Immediately saves information to the database, using an RDB rule.
|
void |
testConnection(java.lang.String aConnectMethod,
java.lang.String aDBName,
java.lang.String aDBUrl,
java.lang.String aDBJndiName,
java.lang.String aDBUserName,
java.lang.String aDBPassword,
com.pega.pegarules.priv.PegaAPI aPega)
Tests to see if we can get a connection to a particular database.
|
void |
writeIndexesForPage(ClipboardPage aPage) |
static final java.lang.String VERSION
static final java.lang.String COPYRIGHT
void commit() throws DatabaseException
CacheException
- if the changes could not be committed due
to a problem with the cacheConfigurationException
- if there is a configuration problem
with classes and/or tablesBadInstanceDataException
- if an instance could not be saved
due to bad dataDatabaseException
- if there is something wrong with the databaseLockFailureException
- if we cannot obtain a
necessary lockvoid rollback() throws DatabaseException
DatabaseException
- if something goes wrong@Deprecated boolean assertThreadLocalConnectionsClear()
ClipboardPage open(StringMap aInstancePage, boolean aCheckSecurity) throws DatabaseException
aInstancePage
- a page containing the instance's key
partsaCheckSecurity
- should security checks be performed? E.g. are we authorized to view and/or lock the instance?null
if it
does not existBadClassDefinitionException
- if the instance keys specify an invalid instance class (pxObjClass
)
or if the instance keys specify an instance that belongs to
class that uses inheritance, and the keys specify a bad
object class (pyClassName
). The processing
status is set to error and the message is
Database-BadClassDef-BadObjectClass
.AuthorizationException
- if the Requestor performing the open is not authorized to open the
instance, and aCheckSecurity
is trueConfigurationException
- if the database table configuration is badMultipleCircumstancePropertiesException
- if, during Rule Resolution, Rules with conflicting Circumstance Properties or with
conflicting Circumstance Date Properties were encounteredMultipleRuleVersionException
- if the requested instance belongs to a class that uses Rule Resolution, and
there is more than one version of the rule that may be considered the best versionNoRuleVersionWithoutCircumstanceException
- if Rule Resolution was used to find the instance, and a default version of the
Rule was expected but not foundBadInputException
- if there is a problem with the key page.
The processing status is set to the error Database-BadInput-ClassCannotHaveInstances
.
Examples of problems are:
Code-
.BadInstanceDataException
- if the database instance is corruptDatabaseException
- if there is a problem with the
databaseClipboardPage open(StringMap aInstancePage, boolean aCheckSecurity, boolean aLock, boolean aUnlockOnCommit, StringMap aLockInfo) throws DatabaseException
aInstancePage
- a page containing the instance's key
partsaCheckSecurity
- should security checks be performed? E.g. are we authorized to view and/or lock the instance?aLock
- should the instance be locked?aUnlockOnCommit
- if aLock
is true and
aUnlockOnCommit
is true, then the instance will
be unlocked when the next Commit is performedaLockInfo
- if a lock is requested but the lock could not be
obtained, then this is filled in with information about the
attempt. The value of
ErrorMessage
is the name of a Rule-Message
that describes the problem. In addition, these other keys might be
set
pxOwnerId
- The ID of the Requestor that
currently owns the requested lock
pxExpireDateTime
- The date and time that the
requested lock expires
pxUpdateOperator
- The ID of the operator that
currently owns the requested lock
pxUpdateOpName
- The name of the operator that
currently owns the requested lock
pxLockHandle
- The lock key that was requested
null
if it
does not existBadClassDefinitionException
- if the instance keys specify an invalid instance class (pxObjClass
)
or if the instance keys specify an instance that belongs to
class that uses inheritance, and the keys specify a bad
object class (pyClassName
). The processing
status is set to error and the message is
Database-BadClassDef-BadObjectClass
.AuthorizationException
- if the Requestor performing the open is not authorized to open the
instance, and aCheckSecurity
is trueConfigurationException
- if the database table configuration is badMultipleCircumstancePropertiesException
- if, during Rule Resolution, Rules with conflicting Circumstance Properties or with
conflicting Circumstance Date Properties were encounteredMultipleRuleVersionException
- if the requested instance belongs to a class that uses Rule Resolution, and
there is more than one version of the rule that may be considered the best versionNoRuleVersionWithoutCircumstanceException
- if Rule Resolution was used to find the instance, and a default version of the
Rule was expected but not foundBadInputException
- if there is a problem with the key page.
The processing status is set to the error Database-BadInput-ClassCannotHaveInstances
.
Examples of problems are:
Code-
.BadInstanceDataException
- if the database instance is corruptDatabaseException
- if there is a problem with the
databaseClipboardPage openIfStale(ClipboardPage aInstancePage, boolean aCheckSecurity, boolean aLock, boolean aUnlockOnCommit, StringMap aLockInfo) throws DatabaseException
aInstancePage
- a clipboard page instanceaCheckSecurity
- should security checks be performed? E.g. are we authorized to view and/or lock the instance?aLock
- should the instance be locked?aUnlockOnCommit
- if aLock
is true and
aUnlockOnCommit
is true, then the instance will
be unlocked when the next Commit is performedaLockInfo
- if a lock is requested but the lock could not be
obtained, then this is filled in with information about the
attempt. The value of
ErrorMessage
is the name of a Rule-Message
that describes the problem. In addition, these other keys might be
set
pxOwnerId
- The ID of the Requestor that
currently owns the requested lock
pxExpireDateTime
- The date and time that the
requested lock expires
pxUpdateOperator
- The ID of the operator that
currently owns the requested lock
pxUpdateOpName
- The name of the operator that
currently owns the requested lock
pxLockHandle
- The lock key that was requested
openIfStale(aInstancePage) == aInstancePage
: The instance
has not been modified.
openIfStale(aInstancePage) != aInstancePage
: The instance
has been modified; the return falue is the new instance page
openIfStale(aInstancePage) == null
: The instance cannot
be found; it has been deleted.
BadClassDefinitionException
- if the instance keys specify an invalid instance class (pxObjClass
)
or if the instance keys specify an instance that belongs to
class that uses inheritance, and the keys specify a bad
object class (pyClassName
). The processing
status is set to error and the message is
Database-BadClassDef-BadObjectClass
.ConfigurationException
- if the database table configuration is badMultipleCircumstancePropertiesException
- if, during Rule Resolution, Rules with conflicting Circumstance Properties or with
conflicting Circumstance Date Properties were encounteredMultipleRuleVersionException
- if the requested instance belongs to a class that uses Rule Resolution, and
there is more than one version of the rule that may be considered the best versionNoRuleVersionWithoutCircumstanceException
- if Rule Resolution was used to find the instance, and a default version of the
Rule was expected but not foundAuthorizationException
- if the Requestor performing the open is not authorized to open the
instance, and aCheckSecurity
is trueBadInputException
- if there is a problem with the key page.
The processing status is set to the error Database-BadInput-ClassCannotHaveInstances
.
Examples of problems are:
Code-
.BadInstanceDataException
- if the database instance is corruptDatabaseException
- if there is a problem with the
databaseClipboardPage openDefault(StringMap aKeys, boolean aCheckSecurity) throws DatabaseException
aKeys
- the instance's key partsaCheckSecurity
- should security checks be performed? E.g. are we authorized to view the instance?null
if it
does not existBadClassDefinitionException
- if the instance keys specify an invalid instance class (pxObjClass
)
or if the instance keys specify an instance that belongs to
class that uses inheritance, and the keys specify a bad
object class (pyClassName
). The processing
status is set to error and the message is
Database-BadClassDef-BadObjectClass
.AuthorizationException
- if the Requestor performing the open is not authorized to open the
instance, and aCheckSecurity
is trueConfigurationException
- if the database table configuration is badMultipleCircumstancePropertiesException
- if, during Rule Resolution, Rules with conflicting Circumstance Properties or with
conflicting Circumstance Date Properties were encounteredMultipleRuleVersionException
- if the requested instance belongs to a class that uses Rule Resolution, and
there is more than one version of the rule that may be considered the best versionNoRuleVersionWithoutCircumstanceException
- if Rule Resolution was used to find the instance, and a default version of the
Rule was expected but not foundBadInputException
- if there is a problem with the key page.
The processing status is set to the error Database-BadInput-ClassCannotHaveInstances
.
Examples of problems are:
Code-
.BadInstanceDataException
- if the database instance is corruptDatabaseException
- if there is a problem with the
databasejava.util.Map openForAllCircumstanceVals(StringMap aInstancePage, RuleResolutionInformation aRuleInfo) throws DatabaseException
This is useful when you want to resolve a rule, but you want to resolve it for all possible circumstance values. This is usually desired in rules that produce generated Java. Instead of generating a seperate Java class for each circumstance-qualified version of a rule, it is usually better to generate a Java class that takes into account rule versions for all possible circumstances. In these cases, the logic that selects a particular circumstance-qualified version to use is built into the generated Java. No locking will be attempted
aInstancePage
- a page containing the instance's key
partsaRuleInfo
- filled in with information about the returned ruleCircumstanceResult
.
If there is a default result (that is, a version that is to be used if none
of the circumstance-qualified versions match), then it
is stored in the map with a null key. (This map should
not be updated--it might be read-only.)BadClassDefinitionException
- if the instance keys specify an invalid instance class (pxObjClass
)
or if the instance keys specify an instance that belongs to
class that uses inheritance, and the keys specify a bad
object class (pyClassName
). The processing
status is set to error and the message is
Database-BadClassDef-BadObjectClass
.ConfigurationException
- if the database table configuration is badMultipleCircumstancePropertiesException
- if more than one circumstance property is foundBadInputException
- if there is a problem with the key pageBadInstanceDataException
- if the database instance is corruptDatabaseException
- if there is a problem with the
databaseClipboardPage open(java.lang.String aInstanceHandle, boolean aCheckSecurity) throws DatabaseException
aInstanceHandle
- the handle of the instance to openaCheckSecurity
- should security checks be performed? E.g. are we authorized to view and/or lock the instance?null
if it
does not existBadClassDefinitionException
- if aInstanceHandle
has an invalid instance class, or if
aInstanceHandle
is the handle of a rule and the rule
has an invalid object class. The processing status is set to error,
message Database-BadClassDef-BadObjectClass
.AuthorizationException
- if the Requestor performing the open is not authorized to open the
instance, and aCheckSecurity
is trueConfigurationException
- if the database table configuration is badBadInstanceDataException
- if the database instance is corruptDatabaseException
- if something goes wrongClipboardPage open(java.lang.String aInstanceHandle, boolean aCheckSecurity, boolean aLock, boolean aUnlockOnCommit, StringMap aLockInfo) throws DatabaseException
aInstanceHandle
- the handle of the instance to openaCheckSecurity
- are we authorized to view and/or lock the instance?aLock
- Should the instance be locked as well? If a lock cannot be
obtained, the instance will be returned but the step status
will be set to SEVERITY_FAILaUnlockOnCommit
- if aLock
is true and
aUnlockOnCommit
is true, then the instance will
be unlocked when the next Commit is performedaLockInfo
- if a lock is requested but the lock could not be obtained,
then this is filled in with information about the attempt. The
value of ErrorMessage
is the name of a
Rule-Message
that describes the problem. In
addition, these other keys might be set
pxOwnerId
- The ID of the Requestor that
currently owns the requested lock
pxExpireDateTime
- The date and time that
the requested lock expires
pxUpdateOperator
- The ID of the operator
that currently owns the requested lock
pxUpdateOpName
- The name of the operator
that currently owns the requested lock
pxLockHandle
- The lock key that was
requested
null
if it does not
existBadClassDefinitionException
- if aInstanceHandle
has an invalid instance
class, or if aInstanceHandle
is the handle of
a rule and the rule has an invalid object class. The
processing status is set to error, message
Database-BadClassDef-BadObjectClass
.AuthorizationException
- if the Requestor performing the open is not authorized to
open the instance, and aCheckSecurity
is trueConfigurationException
- if the database table configuration is badBadInstanceDataException
- if the database instance is corruptDatabaseException
- if something goes wrongClipboardPage openRDB(java.lang.String aObjectClass, java.lang.String aRequestType, java.lang.String aAccessMethod, boolean aCheckSecurity) throws DatabaseException
aObjectClass
- the class of the RDB rule to useaRequestType
- the request type of the RDB rule to useaAccessMethod
- the access method of the RDB rule to useaCheckSecurity
- should security checks be performed?null
if it
does not existDatabaseException
- if something goes wrongvoid saveDeferred(ClipboardPage aInstancePage, boolean aOnlyIfNew, boolean aCheckSecurity) throws DatabaseException
aInstancePage
- the page containing the instance to
write. Its pzInsKey
property is set.aOnlyIfNew
- If true, then this instance is saved only if there is not
already an instance with the same handle in the database at
the time of the next commit;
if there is such an instance, then the commit()
method
fails, reports a processing status error, and throws a
DatabaseException
.
If false, any previous instance in the database with
the same handle is overwritten at commit time.aCheckSecurity
- should security checks be performed?DatabaseException
AuthorizationException
- if the Requestor performing the open is not authorized to save the
instance (including the case where the instance belongs to a locked RuleSet)
and aCheckSecurity
is trueBadInputException
- if the instance is not one
that may be saved for some reason. The processing status is set to error.
Such reasons may include the following:
Database-BadInput-ClassCannotHaveInstances
); or
BadClassDefinitionException
- if the page's class is undefinedvoid saveDeferred(ClipboardPage aInstancePage, boolean aOnlyIfNew, boolean aCheckSecurity, boolean aWithErrors) throws DatabaseException
aInstancePage
- the page containing the instance to
write. Its pzInsKey
property is set.aOnlyIfNew
- If true, then this instance is saved only if there is not
already an instance with the same handle in the database at
the time of the next commit;
if there is such an instance, then the commit()
method
fails, reports a processing status error, and throws a
DatabaseException
.
If false, any previous instance in the database with
the same handle is overwritten at commit time.aCheckSecurity
- should security checks be performed?aWithErrors
- should this instance be saved even if it has errors? If true
,
no validation is performed on the instance and it is saved regardless of any messages.DatabaseException
AuthorizationException
- if the Requestor performing the open is not authorized to save the
instance (including the case where the instance belongs to a locked RuleSet)
and aCheckSecurity
is trueBadInputException
- if the instance is not one
that may be saved for some reason. The processing status is set to error.
Such reasons may include the following:
Database-BadInput-ClassCannotHaveInstances
); or
BadClassDefinitionException
- if the page's class is undefinedvoid save(ClipboardPage aInstancePage, boolean aOnlyIfNew, boolean aCheckSecurity) throws DatabaseException
aInstancePage
- the page containing the instance to
write. Its pzInsKey
property (and other properties) are
potentially updated. This should not be a read-only page.aOnlyIfNew
- If true, then this instance is saved only if there is not
already an instance with the same handle in the database;
if there is such an instance, then the instance is not
saved, a processing status error is reported, and the method throws a
DatabaseException
.
If false, any previous instance in the database with
the same handle is overwritten.aCheckSecurity
- should security checks be performed? The security checks include tests
for ability to access and change the indicated class(es) and for rules includes the test for
a locked ruleset.AuthorizationException
- if the Requestor performing the open is not authorized to save the
instance (including the case where the instance belongs to a locked RuleSet)
and aCheckSecurity
is trueBadInputException
- if the instance is not one
that may be saved for some reason. The processing status is set to error.
Such reasons may include the following:
Database-BadInput-ClassCannotHaveInstances
); or
BadClassDefinitionException
- if the page's class is undefinedBadInstanceDataException
- if an instance could not be saved
due to bad dataBadTableMappingException
- if the instance can not be saved because it
is incompatible with the table it is being saved
toDatabaseException
- when something goes wrong with the database. This
exception is also thrown if saving an instance "only if
new" and there is already an instance there.void save(ClipboardPage aInstancePage, boolean aOnlyIfNew, boolean aCheckSecurity, boolean aWithErrors) throws DatabaseException
aInstancePage
- the page containing the instance to write. Its
pzInsKey
property (and other properties) are
potentially updated. This must not be a read-only page.aOnlyIfNew
- If true, then this instance is saved only if there is not
already an instance with the same handle in the database; if
there is such an instance, then the instance is not saved, a
processing status error is reported, and the method throws a
DatabaseException
. If
false, any previous instance in the database with the same
handle is overwritten.aCheckSecurity
- should security checks be performed? The security checks
include tests for ability to access and change the indicated
class(es) and for rules includes the test for a locked
ruleset.aWithErrors
- should this instance be saved even if it has errors? If
true
, no validation is performed on the instance
and it is saved regardless of any messages.AuthorizationException
- if the Requestor performing the open is not authorized to
save the instance (including the case where the instance
belongs to a locked RuleSet) and aCheckSecurity
is trueBadInputException
- if the instance is not one that may be saved for some reason.
The processing status is set to error. Such reasons may
include the following:
Database-BadInput-ClassCannotHaveInstances
); or
BadClassDefinitionException
- if the page's class is undefinedBadInstanceDataException
- if an instance could not be saved due to bad dataBadTableMappingException
- if the instance can not be saved because it is incompatible
with the table it is being saved toDatabaseException
- when something goes wrong with the database. This exception
is also thrown if saving an instance "only if new" and there
is already an instance there.void saveRDB(java.lang.String aObjectClass, java.lang.String aRequestType, java.lang.String aAccessMethod, boolean aCheckSecurity) throws DatabaseException
aObjectClass
- the object class of the RDB rule to useaRequestType
- the request type of the RDB rule to useaAccessMethod
- the access method of the RDB rule to useaCheckSecurity
- should security checks be performed?DatabaseException
- if something goes wrongvoid deleteDeferred(ClipboardPage aInstancePage, boolean aCheckSecurity) throws DatabaseException
aInstancePage
- the page containing the instance to
delete. Its pzInsKey
property is set. If it already has a
pzInsKey
property, then
it is ignored--so the instance must have
all the properties necessary to compute
its handleaCheckSecurity
- BadClassDefinitionException
- if the page's class is undefinedConfigurationException
- if a class or table is defined improperlyAuthorizationException
- if the Requestor performing the open is not authorized to delete the
instance (including the case where the instance belongs to a locked RuleSet)
and aCheckSecurity
is trueDatabaseException
- if something goes wrong with the databaseboolean delete(ClipboardPage aInstancePage, boolean aCheckSecurity) throws DatabaseException
aInstancePage
- the page containing the instance to
delete. Its pzInsKey
property is set. If it already has a
pzInsKey
property, then
it is ignored--so the instance must have
all the properties necessary to compute
its handleaCheckSecurity
- should security checks be performed? E.g. are we authorized to delete the instance?BadClassDefinitionException
- if the page to delete has a bad
classConfigurationException
- if there is a problem with table or class configurationAuthorizationException
- if the Requestor performing the open is not authorized to delete the
instance (including the case where the instance belongs to a locked RuleSet)
and aCheckSecurity
is trueDatabaseException
- if there is a problem with the databasevoid deleteRDB(java.lang.String aObjectClass, java.lang.String aRequestType, java.lang.String aAccessMethod, boolean aCheckSecurity) throws DatabaseException
aObjectClass
- the object class of the RDB rule to useaRequestType
- the request type of the RDB rule to useaAccessMethod
- the access method of the RDB rule to useaCheckSecurity
- should security checks be performed?DatabaseException
- if something goes wrongint list(ClipboardPage aListPage, boolean aCheckSecurity) throws DatabaseException
aListPage
- a Code-Pega-List
page containing
the list parameters. The list results are placed
in this page. See the package documentation
for details about this page.aCheckSecurity
- should security checks be performed?AuthorizationException
- if the Requestor performing the open is not authorized to list the
instances and aCheckSecurity
is trueBadInputException
- if there is a problem getting the list
definition page or if the list page is invalidBadClassDefinitionException
- if the requested list is on
a bad classConfigurationException
- if this class's storage
is not configured properlyDatabaseException
- if there is a problem
accessing the database to get storage informationint listRDB(ClipboardPage aListPage, java.lang.String aRequestType, java.lang.String aAccessMethod, boolean aCheckSecurity) throws DatabaseException
aListPage
- the page in which to place the results--the page
must have class Code-Pega-List
and
contain the list parameters. The results of the list
are placed on this pageaRequestType
- the request type of the RDB rule to useaAccessMethod
- the access method of the RDB rule to useaCheckSecurity
- should security checks be performed?DatabaseException
- if something goes wrongint executeRDB(java.lang.String aSQL, ClipboardPage aListPage) throws DatabaseException
aSQL
- the SQL statementaListPage
- the results are put on this pageBadInputException
- if the SQL is invalidConfigurationException
- if tables and/or classes are not configured correctlyBadInstanceDataException
- if there is a problem with the result dataBadClassDefinitionException
- if there is an undefined classDatabaseException
- if there is a database problemvoid cancelDeferredUpdate(ClipboardPage aInstancePage) throws DatabaseException
aInstancePage
- the page containing the instance whose
update should be cancelled; its handle
is calculated and setDatabaseException
BadClassDefinitionException
- if the class on the page
is invalidRulesetContext getRulesetContext(ClipboardPage aRulePage) throws DatabaseException
aRulePage
- the page containing the rule to be editedBadClassDefinitionException
- if the class of the rule is
undefinedBadInputException
- if the "rule" has a class that is not
a rule, or if the rule has a bad rulesetBadInstanceDataException
- if there is a problem with one of the
ruleset instance streamsDatabaseException
- if there is a database problemRulesetContext getRulesetContext(ClipboardPage aRulePage, java.lang.String aRuleSetNameProperty, java.lang.String aRuleSetVersionProperty) throws DatabaseException
This method is to be used with pages containing rules that have their
RuleSet names and versions on non-standard properties. The standard
properties are pyRuleSet
and pyRuleSetVersion
. But
certain classes, such as Rule-Obj-Class
, have their RuleSet name
or version on a different property..
aRulePage
- the page containing the rule to be editedaRuleSetNameProperty
- a reference to the property containing the
RuleSet name for aRulePage
aRuleSetVersionProperty
- a reference to the property containing the
RuleSet version for aRulePage
BadClassDefinitionException
- if the class of the rule is
undefinedBadInputException
- if the "rule" has a class that is not
a rule, or if the rule has a bad rulesetBadInstanceDataException
- if there is a problem with one of the
ruleset instance streamsDatabaseException
- if there is a database problemLockManager getLockManager()
java.lang.String getHandle(StringMap aInstancePage) throws DatabaseException
aInstancePage
- the page containing the instance whose handle
we wantDatabaseException
BadInputException
- if there is a problem with the page, or it is
of a class whose instances may not be writtenBadClassDefinitionException
- if there is a problem with
the page's class. If this happens, then a message with severity
"inform" is added to the processing status.ClassDefinition getClassDef(java.lang.String aClassName)
aClassName
- the name of the classnull
if the class does not exist. This method does
not change the processing status.ClassDefinition getFirstRealPatternAncestor(java.lang.String aClassName)
aClassName
- a class name--does not need to be a real defined
classvoid convertListCriteria(ClipboardPage aListPage) throws DatabaseException
aListPage
- the old-style list criteria page; it is changed to
a new-style pageBadClassDefinitionException
- if the list is for an undefined classBadInputException
- if there is something wrong with the list pageDatabaseException
- if there is a database problemjava.lang.String getInstanceName(StringMap aInstancePage, ClassDefinition aClassDef)
aInstancePage
- the instance pageaClassDef
- the definition of the class of the instance pagenull
if the class does not existjava.lang.String getInsIdFromInsName(java.lang.String aInstanceClass, java.lang.String aInstanceName) throws BadClassDefinitionException
aInstanceClass
- name of the class to which the instance belongsaInstanceName
- an instance namenull
if the class does not existBadClassDefinitionException
- if class
aClass
no longer existsjava.util.Collection getClassesInTable(java.lang.String aDBName, java.lang.String aTableName) throws DatabaseException
getClassesInTable(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
insteadaDBName
- the database nameaTableName
- the table nameClassDefinition
s. Abstract classes are not returned.
Concrete classes are returned, even if they are not writable (for
example, even if they have no keys defined).DatabaseException
java.util.Collection getClassesInTable(java.lang.String aDBName, java.lang.String aCatalog, java.lang.String aSchema, java.lang.String aTable) throws DatabaseException
aDBName
- the database nameaCatalog
- the table's catalog, or null if noneaSchema
- the table's schema, or null if noneaTable
- the name of the tableClassDefinition
s. Abstract classes are not returned.
Concrete classes are returned, even if they are not writable (for
example, even if they have no keys defined).DatabaseException
java.lang.String getDataUniqueID(java.lang.String aOrganization, java.lang.String aPrefix, java.lang.String aSuffix) throws DatabaseException
aOrganization
- The Organization NameaPrefix
- The prefix for the Unique IDaSuffix
- The suffix for the Unique IDDatabaseException
- if something goes wrongvoid flushUpdatesCache(int aDeltaMinutes) throws BadInputException, DatabaseException
aDeltaMinutes
- A positive integer indicating the number of minutes
that we should go back, and delete all entried previous toBadInputException
- if supplied delta is less than 0DatabaseException
- if error occurs while running stored procedurejava.lang.String findHandle(StringMap aKeys) throws DatabaseException
aKeys
- the keys of the instance in questionpzInsKey
of the instance that is named by
those keys, or null if such an instance does not existBadClassDefinitionException
- if the instance keys specify an invalid instance class (pxObjClass
)
or if the instance keys specify an instance that belongs to
class that uses inheritance, and the keys specify a bad
object class (pyClassName
). The processing
status is set to error and the message is
Database-BadClassDef-BadObjectClass
.MultipleCircumstancePropertiesException
- if, during Rule Resolution, Rules with conflicting
Circumstance Properties or with conflicting Circumstance Date
Properties were encounteredMultipleRuleVersionException
- if the requested instance belongs to a class that uses Rule
Resolution, and there is more than one version of the rule
that may be considered the best versionNoRuleVersionWithoutCircumstanceException
- if Rule Resolution was used to find the instance, and a
default version of the Rule was expected but not foundDatabaseException
- if there is a problem with the databasejava.util.Hashtable performSystemPulse() throws DatabaseException, NotSupportedException
DatabaseException
- if error occurs while gathering dataNotSupportedException
java.util.Map performSystemIndex() throws DatabaseException, NotSupportedException
DatabaseException
NotSupportedException
void addToUpdatesCache(java.lang.String aClearType, ClipboardPage aInstancePage, java.lang.String aParameters, boolean aPerformOnThisNode, boolean aPerformOnAllSystems) throws DatabaseException
aClearType
- A string of at most 5 characters describing the clear type.
If the length is greater than 5, only the first 5 are passed
alongaInstancePage
- Instance Page detailing a rule instanceaParameters
- reserved You must insert an empty string ("").aPerformOnThisNode
- Set to true if you want the given update to
apply to this node as well.aPerformOnAllSystems
- Set to true if you want the given update
to apply to all PegaRULES systems using this databaseDatabaseException
- if error occurs adding entryvoid addToUpdatesCache(java.lang.String aClearType, java.lang.String aObjClass, java.lang.String aInsKey, java.lang.String aParameters, boolean aPerformOnThisNode, boolean aPerformOnAllSystems) throws DatabaseException
aClearType
- A string of at most 5 characters describing the clear type.
If the length is greater than 5, only the first 5 are passed
alongaObjClass
- String containing the name of the instance's classaInsKey
- String containing the instance keyaParameters
- reserved You must insert an empty string ("").aPerformOnThisNode
- Set to true if you want the given update to
apply to this node as well.aPerformOnAllSystems
- Set to true if you want the given update
to apply to all PegaRULES systems using this databaseDatabaseException
- if error occurs adding entryvoid clearCache()
@Deprecated void removeFromNodeCache(java.lang.String aObjClass, java.lang.String aInsKey)
aObjClass
- a string containing the object class type to be removedaInsKey
- a string containing the key of the instance to be removed
from the local cachevoid removeFromNodeCache(ClipboardPage aInstancePage)
aInstancePage
- an Instance Page of the class to be removed from
the cachevoid noteConfigChangesInClassMap(java.util.Collection configSaves, java.util.Collection configDeletes) throws DatabaseException
configSaves
- - Collection of clipboard pages that were saved (inserted or updated)configDeletes
- - Collection of clipboard pages that were deletedDatabaseException
- - If class ancestor information cannot be writtenvoid executeDBSchemaUpdates(java.util.List aSQL, java.lang.String aDBName, java.lang.String aUserName, java.lang.String aPassword) throws DatabaseException
The SQL statements are executed in the order provided, within a single database transaction. This method should be used for schema updates. Schema upates performed with this method will be recognized by the Database Interface.
If an exception is thrown, then the transaction is rolled back.
aSQL
- the list of SQL statements, as String
saDBName
- the name of the Data-Admin-DB-Name
corresponding to the database to connect toaUserName
- the user name to use when connecting to the databaseaPassword
- the password to use when connecting to the databaseBadDatabaseDefinitionException
- if
the specified database is not configured properlyDatabaseException
- if there is any
other problem connecting to the database or executing the statementsDatabaseInformation getDBInfo(java.lang.String aDBName) throws DatabaseException
aDBName
- name of the database for which information is desiredBadDatabaseDefinitionException
- if the requested database is not defined correctlyDatabaseException
- if there is a database problemjava.util.List getDBSchemas(java.lang.String aDBName) throws DatabaseException
aDBName
- Name of the database for which information is desired.DatabaseException
- if there is a database problemjava.util.Collection getDBTables(java.lang.String aDBName, java.lang.String aCatalogName, java.lang.String aSchemaName, java.lang.String[] aTableTypes) throws DatabaseException
aDBName
- Name of the database for which information is desired.aTableTypes
- A string array containing the desired table types.aCatalogName
- The catalog name (or null).aSchemaName
- The schema name (or null).DatabaseException
- if there is a database problemjava.util.SortedSet getColumnsForTable(java.lang.String aDBName, java.lang.String aTableName) throws DatabaseException
aDBName
- the name of the database in which the table livesaTableName
- the name of the tableColumn
s, in the same order that the columns
are in the tableDatabaseException
- if there is a database problemvoid testConnection(java.lang.String aConnectMethod, java.lang.String aDBName, java.lang.String aDBUrl, java.lang.String aDBJndiName, java.lang.String aDBUserName, java.lang.String aDBPassword, com.pega.pegarules.priv.PegaAPI aPega) throws DatabaseException
aURL
) or a JNDI name (aJNDIName
)
or a database name (aDBName
) should be specified.aConnectMethod
- how the database configuration should
be obtained--this is supposed to be one
of the possible values of the
Data-Admin-DB-Name.pyConnectMethod
propertyaDBUrl
- the JDBC URL of the databaseaDBJndiName
- the JNDI name of the databaseaDBName
- the database nameaDBUserName
- user name for the databaseaDBPassword
- password for the databaseaPega
- the current Pega API objectConfigurationException
- if the appropriate parameters are not suppliedDatabaseException
- if a connection could not be made to the databaseboolean doesInstanceExist(java.lang.String aInstanceHandle) throws DatabaseException
This method does not perform any security checking.
aInstanceHandle
- the handle (pzInsKey
) of the instanceBadClassDefinitionException
- if the instance has an invalid pxObjClass
. The
processing status is set to error if this is the case.ConfigurationException
- if the database table configuration is badDatabaseException
- if something else goes wrongvoid writeIndexesForPage(ClipboardPage aPage) throws DatabaseException
DatabaseException
boolean doClassesBelongToSingleDb(boolean aUseReportDb, java.util.ArrayList aClasses) throws DatabaseException
aUseReportDb
- passed in flag to determine if we should check the reporting dBaClasses
- a list of class name stringsDatabaseException
- if something else goes wrongvoid resolveResultsOnListPage(ClipboardPage aListPage) throws DatabaseException
aListPage
- passed code pega list pageDatabaseException
- if something else goes wrongjava.lang.String getColumnForProperty(java.lang.String aClassName, java.lang.String aPropertyName) throws DatabaseException
aClassName
- the name of the classaPropertyName
- the name of the propertynull
if the property is not mapped or the class is not found.DatabaseException
- if lower level throwsjava.lang.String getColumnDataTypeForProperty(java.lang.String aClassName, java.lang.String aPropertyName) throws DatabaseException
aClassName
- the name of the classaPropertyName
- the name of the propertynull
if the property is not mapped or the class is not found.DatabaseException
- if lower level throwsjava.util.Map getPropertyToColumnMap(java.lang.String aClassName)
aClassName
- the name of the classjava.lang.String[] getConcreteDescendantsInCurrentApplication(java.lang.String aAncestorName) throws InvalidConfigurationException
aAncestorName
- a class nameInvalidConfigurationException,{@link
- InvalidLocaleException} if there is a locale mismatchInvalidConfigurationException
void recordAssembly(boolean aIsStart, java.lang.String aAssemblyClass, java.lang.String aForClass)
aIsStart
- true if this indicates the start of an assembly, false
if it is the endaAssemblyClass
- the instance class (pxObjClass
) of
the assemblyaForClass
- the class on which the rule is called(pyClassName
)java.util.List<java.lang.String> getRulesetsFromApplication(java.util.List aApplicationList, boolean aFollowDependencies, boolean aFollowByParent) throws DatabaseException
aApplicationList
- list of strings containing application names and versions
in the format aFollowDependencies
- boolean Flag when set to true returns rulesets from all
dependent applications for the ones defined in ApplicationList.aFollowByParent
- boolean Flag when set to true returns rulesets following
Dependent applications by parent for each application defined in ApplicationListDatabaseException
- if invalid entries are present in ApplicationListint executeRDB(com.pega.pegarules.priv.sqlgeneration.ISQLSelectQuery aSQLObject, ClipboardPage aListPage) throws DatabaseException
aSQLObject
- the SQL JAVA Object of type ISQLSelectQueryaListPage
- the results are put on this pageBadInputException
- if the SQL is invalidConfigurationException
- if tables and/or classes are not configured correctlyBadInstanceDataException
- if there is a problem with the result dataBadClassDefinitionException
- if there is an undefined classDatabaseException
- if there is a database problemjava.util.Collection getExposedList(ClassDefinition cdCurrentClass) throws DatabaseException
PegaClassDefinition.getColumnsInTable()
insteadcdCurrentClass
- the name of the classBadClassDefinitionException
- if there is an undefined classDatabaseException
- if there is a database problemCopyright © 2015 Pegasystems Inc. All Rights Reserved.