|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ail.core.CoreProxy
public class CoreProxy
This class acts as a proxy for those who need to access some of the Core's services, but for whatever reason cannot (or do not want to) implement CoreUser themselves.
The versionEffectiveDate of the proxy is taken to be the date at which it was instantiated.
| Field Summary | |
|---|---|
static java.lang.String |
DefaultNamespace
|
| Constructor Summary | |
|---|---|
CoreProxy()
Default constructor. |
|
CoreProxy(java.lang.String namespace)
Construct a proxy to work against a specific configuration namespace. |
|
CoreProxy(java.lang.String namespace,
CoreUser coreuser)
Construct a proxy for a specific namespace, and inherit all other settings (version effective date, security principal etc) from an instance of CoreUser. |
|
CoreProxy(java.lang.String namespace,
VersionEffectiveDate ved,
java.security.Principal securityPrincipal)
Create a core proxy with a specific configuration namespace and version effective date. |
|
| Method Summary | ||
|---|---|---|
void |
closePersistenceSession()
Close the open session associated with the current thread and commit. |
|
|
create(T type)
Create a persistent copy of an object. |
|
void |
delete(Type type)
Delete one or more objects from persistent storage. |
|
|
fromXML(java.lang.Class<T> clazz,
XMLString xml)
Transform XML into an object. |
|
byte[] |
generateDocument(java.lang.String productName,
java.lang.String documentDefinitionName,
Type model)
Generate a document and return it as a byte[]. |
|
Configuration |
getConfiguration()
Get a copy of the CoreProxy's current configuration. |
|
java.lang.String |
getConfigurationNamespace()
Get the CoreProxy's namespace. |
|
java.util.Collection<java.lang.String> |
getConfigurationNamespaceParent()
Return a list of the namespace(s) of the parent(s) of this configuration. |
|
java.util.Collection<java.lang.String> |
getConfigurationSource()
Return the source of the configuration being used by this instance of core. |
|
Core |
getCore()
Get the instance of Core being used by this proxy. |
|
Group |
getGroup(java.lang.String name)
Fetch the named group the from current configuration. |
|
Parameter |
getParameter(java.lang.String name)
Fetch the named parameter from current configuration. |
|
java.util.Properties |
getParametersAsProperties(java.lang.String name)
Fetch the value of the named parameter from current configuration. |
|
java.lang.String |
getParameterValue(java.lang.String name)
Fetch all the Parameters in a group and return them as a java.util.Properties. |
|
java.lang.String |
getParameterValue(java.lang.String name,
java.lang.String defaultValue)
Return the value of a parameter or a default if it is null. |
|
java.security.Principal |
getSecurityPrincipal()
Get the security principal associated with this instance. |
|
VersionEffectiveDate |
getVersionEffectiveDate()
Return the version effective date associated with this proxy. |
|
|
load(java.lang.Class<T> type,
long systemId)
Load a specific instance of a type by ID. |
|
void |
logDebug(java.lang.String message)
|
|
void |
logDebug(java.lang.String message,
java.lang.Throwable cause)
Output a message to the Debug logging channel. |
|
void |
logError(java.lang.String message)
|
|
void |
logError(java.lang.String message,
java.lang.Throwable cause)
Output a message to the Error logging channel. |
|
void |
logFatal(java.lang.String message)
|
|
void |
logFatal(java.lang.String message,
java.lang.Throwable cause)
Output a message to the Fatal logging channel. |
|
void |
logInfo(java.lang.String message)
|
|
void |
logInfo(java.lang.String message,
java.lang.Throwable cause)
Output a message to the Info logging channel. |
|
void |
logWarning(java.lang.String message)
|
|
void |
logWarning(java.lang.String message,
java.lang.Throwable cause)
Output a message to the Warning logging channel. |
|
AbstractCommand |
newCommand(java.lang.String commandName)
Create a instance of the named command object. |
|
java.lang.Object |
newObject(java.lang.String objectName)
Create a instance of the named object. |
|
Type |
newProductType(java.lang.String productName)
Instantiate the default type associated with a product. |
|
Type |
newProductType(java.lang.String productName,
java.lang.String typeName)
Instantiate a type associated with a product. |
|
Type |
newType(java.lang.String typeName)
Create a instance of the named type object. |
|
void |
openPersistenceSession()
Initiate a persistence session. |
|
java.util.List<?> |
query(java.lang.String queryName,
java.lang.Object... queryArgs)
Query persistent storage for the collection of objects returned by a query. |
|
Type |
queryUnique(java.lang.String queryName,
java.lang.Object... queryArgs)
Query persistent storage for the single object returned by a query. |
|
void |
resetConfiguration()
Reset the CoreProxy's configuration to its factory default settings. |
|
boolean |
resetConfiguration(java.lang.String configOwnerClassName)
Reset the configuration for a named class. |
|
void |
resetCoreConfiguration()
Reset the core's configuration to its factory default settings. |
|
void |
setConfiguration(Configuration config)
Update the persisted copy of the CoreProxy's configuration. |
|
void |
setSecurityPrincipal(java.security.Principal securityPrincipal)
Set the security principal using the proxy |
|
void |
setVersionEffectiveDate(VersionEffectiveDate ved)
Set the version effective date for the proxy to a specific date. |
|
void |
setVersionEffectiveDateToNow()
Set the version effective date to the date now. |
|
XMLString |
toXML(java.lang.Object obj)
Transform an object into its XML representation. |
|
|
update(T type)
Update the persistent copy of an object from its in memory copy. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DefaultNamespace
| Constructor Detail |
|---|
public CoreProxy()
public CoreProxy(java.lang.String namespace)
namespace - Configuration namespace.
public CoreProxy(java.lang.String namespace,
CoreUser coreuser)
namespace - Configuration namespace to be used.coreuser - Provides other settings.
public CoreProxy(java.lang.String namespace,
VersionEffectiveDate ved,
java.security.Principal securityPrincipal)
namespace - configuration namespace to be used.ved - version effective date.securityPrincipal - Security principal to apply.| Method Detail |
|---|
public VersionEffectiveDate getVersionEffectiveDate()
getVersionEffectiveDate in interface CoreUserpublic void setVersionEffectiveDate(VersionEffectiveDate ved)
ved - New date to run as.public void setVersionEffectiveDateToNow()
public java.security.Principal getSecurityPrincipal()
getSecurityPrincipal in interface CoreUserpublic void setSecurityPrincipal(java.security.Principal securityPrincipal)
securityPrincipal - public AbstractCommand newCommand(java.lang.String commandName)
commandName - The name of the command to create.
public Type newType(java.lang.String typeName)
typeName - The name of the type to create.
public java.lang.Object newObject(java.lang.String objectName)
objectName - The name of the object to create.
public void logDebug(java.lang.String message,
java.lang.Throwable cause)
message - The text of the message to be output.public void logDebug(java.lang.String message)
public void logInfo(java.lang.String message,
java.lang.Throwable cause)
message - The text of the message to be output.public void logInfo(java.lang.String message)
public void logWarning(java.lang.String message,
java.lang.Throwable cause)
message - The text of the message to be output.public void logWarning(java.lang.String message)
public void logError(java.lang.String message,
java.lang.Throwable cause)
message - The text of the message to be output.public void logError(java.lang.String message)
public void logFatal(java.lang.String message,
java.lang.Throwable cause)
message - The text of the message to be output.public void logFatal(java.lang.String message)
public <T> T fromXML(java.lang.Class<T> clazz,
XMLString xml)
throws XMLException
clazz - The Class represented by xmlxml - The XML representing and instance of clazz
clazz built up from xml
XMLExceptionpublic XMLString toXML(java.lang.Object obj)
obj - The object to be transformed.
objpublic boolean resetConfiguration(java.lang.String configOwnerClassName)
configOwnerClassName - The fully qualified name of the class to reset the config for.public void setConfiguration(Configuration config)
setConfiguration in interface ConfigurationOwnerconfig - New configuration.public Configuration getConfiguration()
getConfiguration in interface ConfigurationOwnerpublic java.lang.String getConfigurationNamespace()
getConfigurationNamespace in interface CoreUserpublic void resetCoreConfiguration()
public void resetConfiguration()
resetConfiguration in interface ConfigurationOwnerpublic Type newProductType(java.lang.String productName)
productName - The name of the product to instantiate for.
public Type newProductType(java.lang.String productName,
java.lang.String typeName)
newProductType(String)), but may define any number of additional types for
use during its lifecycle; this method is used to instantiate specific types by name.For example, a complex insurance product may define several different types to describe the assets the product covers. A commercial combined product might define a stock asset, a vehicle asset, a safe asset, etc. Each of these is described within the product as a separate named type. A client would use this method to instantiate these different types as and when they needed to be added to an instance of a commercial combined policy.
productName - The product "owning" the type.typeName - The name of type to be instantiated.
public <T extends Type> T create(T type)
The - object to be persisted.
public <T extends Type> T update(T type)
object - The object to be written to persistent storage.
public void delete(Type type)
object - Object to be deleted
VersionException - If the version object is badly defined, or relates to a version that does not exist.
public <T extends Type> T load(java.lang.Class<T> type,
long systemId)
type - The type to be loadedsystemId - the systemId of the instance to load.
public java.util.List<?> query(java.lang.String queryName,
java.lang.Object... queryArgs)
queryName - The name of the query to be executed.queryArgs - Arguments to be used by the query.
VersionException - The version argument is either badly defined, or relates to a version that does not exist.
public Type queryUnique(java.lang.String queryName,
java.lang.Object... queryArgs)
queryName - The name of the query to be executed.queryArgs - Arguments to be used by the query.
VersionException - The version argument is either badly defined, or relates to a version that does not exist.public void openPersistenceSession()
closePersistenceSession() are performed within
one transaction.
public void closePersistenceSession()
openPersistenceSession()public Group getGroup(java.lang.String name)
The group's name may be dot separated indicating that the group is nested within other groups.
name - The name of the group to be returned.name -
public java.util.Collection<java.lang.String> getConfigurationSource()
public java.util.Collection<java.lang.String> getConfigurationNamespaceParent()
public Parameter getParameter(java.lang.String name)
The parameter's name may be dot seperated indicating that the parameter is nested within one of more groups.
name - The name of the parameter to be returned.
public java.util.Properties getParametersAsProperties(java.lang.String name)
String value=null;
Parameter p=core.getParameter("paramName");
if (p!=null) {
value=p.getValue();
}String value=core.getParameterValue("paramName");
name - The name of the parameter to return a value for.
public java.lang.String getParameterValue(java.lang.String name)
If the group specified does not exist, null is returned. If the group does exist but contains no Parameters, an empty Properties object is returned.
name - The name of the group whose parameters will be used.
public java.lang.String getParameterValue(java.lang.String name,
java.lang.String defaultValue)
name - The name of the parameterdefaultValue - The default value
getParameterValue(java.lang.String)
public byte[] generateDocument(java.lang.String productName,
java.lang.String documentDefinitionName,
Type model)
productName - The name of product which 'owns' the document definition.documentDefinitionName - the name of the definition to use.model - The dynamic data satisfying references in the document definition.
public Core getCore()
Core being used by this proxy.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||