com.ail.insurance.quotation.addpolicynumber
Class AddPolicyNumberService

java.lang.Object
  extended by com.ail.core.Type
      extended by com.ail.core.Service
          extended by com.ail.insurance.quotation.addpolicynumber.AddPolicyNumberService
All Implemented Interfaces:
ConfigurationOwner, CoreUser, java.io.Serializable, java.lang.Cloneable

public class AddPolicyNumberService
extends Service

Version:
$Revision: 1.7 $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ail.core.Type
jXPathContext, NOT_PERSISTED
 
Constructor Summary
AddPolicyNumberService()
          Default constructor
 
Method Summary
 CommandArg getArgs()
          Getter returning the arguments used by this entry point.
 java.lang.String getConfigurationNamespace()
          Return the product type id of the policy we're assessing the risk for as the configuration namespace.
 Core getCore()
          Getter to fetch the entry point's code.
 Version getVersion()
          Fetch the version of this entry point.
 void invoke()
          This service adds a policy number to a policy.
 void setArgs(CommandArg args)
          Setter used to the set the entry points arguments.
 
Methods inherited from class com.ail.core.Service
getConfiguration, getSecurityPrincipal, getVersionEffectiveDate, resetConfiguration, setConfiguration
 
Methods inherited from class com.ail.core.Type
addAttribute, clone, deleteLock, deleteSerialVersion, fetchJXPathContext, getAttribute, getAttribute, getAttributeCount, getForeignSystemId, getLock, getSerialVersion, getSystemId, hasLock, hasSerialVersion, hasSystemId, isPersisted, markAsNotPersisted, mergeWithDataFrom, removeAttribute, removeAttribute, setAttribute, setForeignSystemId, setLock, setSerialVersion, setSystemId, xpathGet, xpathGet, xpathIterate, xpathSet
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddPolicyNumberService

public AddPolicyNumberService()
Default constructor

Method Detail

getCore

public Core getCore()
Getter to fetch the entry point's code. This method is demanded by the EntryPoint class.

Specified by:
getCore in class Service
Returns:
This entry point's instance of Core.

getVersion

public Version getVersion()
Fetch the version of this entry point.

Specified by:
getVersion in class Service
Returns:
A version object describing the version of this entry point.

setArgs

public void setArgs(CommandArg args)
Setter used to the set the entry points arguments.

Specified by:
setArgs in class Service
Parameters:
args - for invoke

getArgs

public CommandArg getArgs()
Getter returning the arguments used by this entry point.

Specified by:
getArgs in class Service
Returns:
An instance of AddPolicyNumberArgs.

getConfigurationNamespace

public java.lang.String getConfigurationNamespace()
Return the product type id of the policy we're assessing the risk for as the configuration namespace. The has the effect of selecting the product's configuration.

Specified by:
getConfigurationNamespace in interface CoreUser
Overrides:
getConfigurationNamespace in class Service
Returns:
product type id

invoke

public void invoke()
            throws PreconditionException,
                   PostconditionException,
                   BaseException
This service adds a policy number to a policy. The specific format and content of the policy number depends on business rules, and may vary depending the policy's product. The service checks the preconditions, and then generates a unique number before passing control into the product specific 'GeneratePolicyNumberRule'. The policy and unique number are passed into this rule. The rule isn't obliged to use the unique number, and may generate other numbers of it's own, but it is expected to set the policy's policy number to something other than null or '' (see the postconditions). The unique number generated by this service is unique in a system wide sence. The numbers it generates aren't necessarily contiguous and (as mentioned above) they may never be used. Numbers are allocated to instances of this service in a block by block basis. The service's configuration defines the last number allocated, and the size of the allocation blocks. The last number allocated is updated every time a new block is issued.

Specified by:
invoke in class Service
Throws:
PreconditionException
PostconditionException
BaseException