|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ail.core.Core
public class Core
This class is analogous to Java's java.lang.System class. It acts as a facade for the services offered by the core. Its purpose it to simplify access to the services, and so make using the services simpler.
| Field Summary | |
|---|---|
static java.lang.String |
CoreNamespace
|
| Constructor Summary | |
|---|---|
Core(CoreUser coreUser)
Clients are obliged to pass an instance of themselves in when they create an instance of Core. |
|
| Method Summary | ||
|---|---|---|
void |
closePersistenceSession()
Close the open session associated with the current thread and commit. |
|
|
create(T object)
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[]. |
|
GetClassListArg |
getClassList(GetClassListArg arg)
|
|
Configuration |
getConfiguration()
Load the configuration for the current namespace. |
|
java.lang.String |
getConfigurationNamespace()
This method is used internally by the configure sub-system when an instance of the core is being use by a non-ConfigurationOwner. |
|
java.util.Collection<java.lang.String> |
getConfigurationNamespaceParent()
|
|
java.util.Collection<java.lang.String> |
getConfigurationSource()
Return the source of the configuration being used by this instance of core. |
|
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 all the Parameters in a group and return them as a java.util.Properties. |
|
java.lang.String |
getParameterValue(java.lang.String name)
Fetch the value of the named parameter from current configuration. |
|
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()
Return the security principal associated with this core's core user. |
|
VersionEffectiveDate |
getVersionEffectiveDate()
Get the core's version effective date. |
|
CommandArg |
invokeService(java.lang.String commandName,
CommandArg arguments)
Create an instance of the specified command, and invoke it with the argument provided. |
|
java.util.Collection<ProductDetails> |
listProducts()
Fetch a collection of the products know to the system. |
|
|
load(java.lang.Class<T> type,
long systemId)
Load a specific instance of a type by ID. |
|
void |
logBootError(java.lang.String message)
Output a message to the Error boot logging channel. |
|
void |
logBootError(java.lang.String message,
java.lang.Throwable cause)
Output a message to the Error boot logging channel. |
|
void |
logBootFatal(java.lang.String message)
Output a message to the Fatal boot logging channel. |
|
void |
logBootFatal(java.lang.String message,
java.lang.Throwable cause)
Output a message to the Fatal boot logging channel. |
|
void |
logBootInfo(java.lang.String message)
Output a message to the Info boot logging channel. |
|
void |
logBootInfo(java.lang.String message,
java.lang.Throwable cause)
Output a message to the Info boot logging channel. |
|
void |
logBootWarning(java.lang.String message)
Output a message to the Warning Boot logging channel. |
|
void |
logBootWarning(java.lang.String message,
java.lang.Throwable cause)
Output a message to the Warning boot logging channel. |
|
void |
logDebug(java.lang.String message)
Output a message to the Debug logging channel. |
|
void |
logDebug(java.lang.String message,
java.lang.Throwable cause)
Output a message to the Debug logging channel. |
|
void |
logError(java.lang.String message)
Output a message to the Error logging channel. |
|
void |
logError(java.lang.String message,
java.lang.Throwable cause)
Output a message to the Error logging channel. |
|
void |
logFatal(java.lang.String message)
Output a message to the Fatal logging channel. |
|
void |
logFatal(java.lang.String message,
java.lang.Throwable cause)
Output a message to the Fatal logging channel. |
|
void |
logInfo(java.lang.String message)
Output a message to the Info logging channel. |
|
void |
logInfo(java.lang.String message,
java.lang.Throwable cause)
Output a message to the Info logging channel. |
|
void |
logWarning(java.lang.String message)
Output a message to the Warning logging channel. |
|
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 |
registerProduct(ProductDetails productDetails)
Register a new product with the catalog. |
|
void |
removeProduct(ProductDetails productDetails)
Remove a product from the registry. |
|
void |
resetAllProducts()
Reset all the products know to the product manager. |
|
void |
resetConfiguration()
Reset the core's configuration to its factory default. |
|
void |
resetProduct(java.lang.String productName)
Reset a specific product. |
|
void |
setConfiguration(Configuration config)
Save (create/update) the configuration for the current namespace. |
|
XMLString |
toXML(java.lang.Object obj)
Transform an object into its XML representation. |
|
|
update(T object)
Update the persistent copy of an object from its in memory copy. |
|
void |
updateProduct(java.lang.String productName,
ProductDetails productDetails)
Update the product registries details wrt the details passed in. |
|
ValidatorResult |
validate(java.lang.String key,
java.lang.Object value)
Validate a value |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String CoreNamespace
| Constructor Detail |
|---|
public Core(CoreUser coreUser)
coreUser - The client wanting to use the core.| Method Detail |
|---|
public VersionEffectiveDate getVersionEffectiveDate()
The core's version effective date is always based on the date/time that this instance of the core was instantiated.
getVersionEffectiveDate in interface CoreUserpublic void setConfiguration(Configuration config)
Note:Calling setConfiguration does not alter the configuration currently
being used. The configuration being used is determined by the callers
getVersionEffectiveDate(), this selects the version of configuration that
should be used by getParameter() for example.
setConfiguration in interface ConfigurationOwnerconfig - New configuration to be stored.ConfigurationOwner,
CoreUser.getVersionEffectiveDate(),
getParameter(java.lang.String)public Configuration getConfiguration()
getConfiguration in interface ConfigurationOwnerConfigurationOwner,
CoreUser.getVersionEffectiveDate()public java.lang.String getConfigurationNamespace()
getConfigurationNamespace in interface CoreUserpublic void resetConfiguration()
resetConfiguration in interface ConfigurationOwnerpublic Group getGroup(java.lang.String name)
The group's name may be dot seperated indicating that the group is nested within other groups.
getGroup in interface Configurename - The name of the group to be returned.
public java.util.Collection<java.lang.String> getConfigurationSource()
owner - The configuration's owneruser - The user asking for the sourcecore - The core being used - and who's source will be returned
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.
getParameter in interface Configurename - The name of the parameter to be returned.
public java.lang.String getParameterValue(java.lang.String name)
String value=null;
Parameter p=core.getParameter("paramName");
if (p!=null) {
value=p.getValue();
}String value=core.getParameterValue("paramName");
getParameterValue in interface Configurename - The name of the parameter to return a value for.
public java.lang.String getParameterValue(java.lang.String name,
java.lang.String defaultValue)
getParameterValue in interface Configurename - The name of the parameterdefaultValue - The default value
getParameterValue(java.lang.String)public java.util.Properties getParametersAsProperties(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.
getParametersAsProperties in interface Configurename - The name of the group whose parameters will be used.
public CommandArg invokeService(java.lang.String commandName,
CommandArg arguments)
throws BaseException
commandName - The name of the command to invoke.arguments - The arguments to pass to the service.
BaseException - Any exception thrown by the service.public AbstractCommand newCommand(java.lang.String commandName)
newCommand in interface FactorycommandName - The name of the command to create.
public Type newType(java.lang.String typeName)
newType in interface FactorytypeName - The name of the type to create.
public java.lang.Object newObject(java.lang.String objectName)
newObject in interface FactoryobjectName - The name of the object to create.
public void logDebug(java.lang.String message,
java.lang.Throwable cause)
logDebug in interface Loggingmessage - The text of the message to be output.cause - The cause of the debug message.public void logDebug(java.lang.String message)
logDebug in interface Loggingmessage - The text of the message to be output.
public void logInfo(java.lang.String message,
java.lang.Throwable cause)
logInfo in interface Loggingmessage - The text of the message to be output.cause - The cause of the info message.public void logInfo(java.lang.String message)
logInfo in interface Loggingmessage - The text of the message to be output.
public void logWarning(java.lang.String message,
java.lang.Throwable cause)
logWarning in interface Loggingmessage - The text of the message to be output.cause - The cause of the warning message.public void logWarning(java.lang.String message)
logWarning in interface Loggingmessage - The text of the message to be output.
public void logError(java.lang.String message,
java.lang.Throwable cause)
logError in interface Loggingmessage - The text of the message to be output.cause - The cause of the error.public void logError(java.lang.String message)
logError in interface Loggingmessage - The text of the message to be output.
public void logFatal(java.lang.String message,
java.lang.Throwable cause)
logFatal in interface Loggingmessage - The text of the message to be output.cause - The cause of the fatal error.public void logFatal(java.lang.String message)
logFatal in interface Loggingmessage - The text of the message to be output.public <T extends Type> T update(T object)
Persistence
update in interface Persistenceobject - The object to be written to persistent storage.
public java.util.List<?> query(java.lang.String queryName,
java.lang.Object... queryArgs)
Persistence
query in interface PersistencequeryName - The name of the query to be executed.queryArgs - Arguments to be used by the query.
public <T extends Type> T load(java.lang.Class<T> type,
long systemId)
Persistence
load in interface Persistencetype - The type to be loadedsystemId - the systemId of the instance to load.
public void delete(Type type)
Persistence
delete in interface Persistencetype - Object to be deleted
public Type queryUnique(java.lang.String queryName,
java.lang.Object... queryArgs)
Persistence
queryUnique in interface PersistencequeryName - The name of the query to be executed.queryArgs - Arguments to be used by the query.
public <T extends Type> T create(T object)
Persistence
create in interface Persistencepublic void openPersistenceSession()
PersistencePersistence.closePersistenceSession() are performed within
one transaction.
openPersistenceSession in interface Persistencepublic void closePersistenceSession()
Persistence
closePersistenceSession in interface PersistencePersistence.openPersistenceSession()
public <T> T fromXML(java.lang.Class<T> clazz,
XMLString xml)
throws XMLException
fromXML in interface XMLBindingclazz - The Class represented by xmlxml - The XML representing and instance of clazz
clazz built up from xml
XMLException - If there is a problem parsing the XMLpublic XMLString toXML(java.lang.Object obj)
toXML in interface XMLBindingobj - The object to be transformed.
obj
public ValidatorResult validate(java.lang.String key,
java.lang.Object value)
throws BaseException
validate in interface Validatorkey - Key to identify validation requiredvalue - Value to validate
BaseExceptionpublic GetClassListArg getClassList(GetClassListArg arg)
public java.security.Principal getSecurityPrincipal()
getSecurityPrincipal in interface CoreUserpublic java.util.Collection<ProductDetails> listProducts()
listProducts in interface Product
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 instantantiate 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 seperate 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.
newProductType in interface ProductproductName - The product "owning" the type.typeName - The name of type to be instantiated.
public Type newProductType(java.lang.String productName)
newProductType in interface ProductproductName - The name of the product to instantiate for.
public void resetAllProducts()
resetAllProducts in interface Productpublic void resetProduct(java.lang.String productName)
resetProduct in interface ProductproductName - The name of the product to reset
public void registerProduct(ProductDetails productDetails)
throws DuplicateProductException
registerProduct in interface Productdetails - Details of the product to register
DuplicateProduct - if a product by the name specified (details.name) is already defined.
DuplicateProductException
public void removeProduct(ProductDetails productDetails)
throws UnknownProductException
removeProduct in interface Productname - Name of the product to remove.
UnknownProduct - if the named product is not defined.
UnknownProductException
public void updateProduct(java.lang.String productName,
ProductDetails productDetails)
throws UnknownProductException
updateProduct in interface Productname - The name of the product to be updated.details - Details to store
UnknownProduct - if the product (name) isn't defined.
UnknownProductException
public byte[] generateDocument(java.lang.String productName,
java.lang.String documentDefinitionName,
Type model)
generateDocument in interface DocumentproductName - 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 void logBootError(java.lang.String message,
java.lang.Throwable cause)
logBootError in interface Loggingmessage - The text of the message to be output.cause - The exception that caused the error.public void logBootError(java.lang.String message)
logBootError in interface Loggingmessage - The text of the message to be output.
public void logBootFatal(java.lang.String message,
java.lang.Throwable cause)
logBootFatal in interface Loggingmessage - The text of the message to be output.cause - The exception that caused the fatal error.public void logBootFatal(java.lang.String message)
logBootFatal in interface Loggingmessage - The text of the message to be output.
public void logBootInfo(java.lang.String message,
java.lang.Throwable cause)
logBootInfo in interface Loggingmessage - The text of the message to be output.cause - Related cause.public void logBootInfo(java.lang.String message)
logBootInfo in interface Loggingmessage - The text of the message to be output.
public void logBootWarning(java.lang.String message,
java.lang.Throwable cause)
logBootWarning in interface Loggingmessage - The text of the message to be output.cause - The exception that caused the warning.public void logBootWarning(java.lang.String message)
logBootWarning in interface Loggingmessage - The text of the message to be output.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||