com.apama.firewall
Event RiskFirewallFactory


The Risk Firewall Factory allows applications to create new instances of Risk Firewall.

The Risk Firewall is designed to allow applications to define a set of rules that any orders being sent to the Risk Firewall must be validated against. The Risk Firewall will then forward on all approved orders, or reject any orders that failed to meet the rules that have been added.

The factory also provides the ability to connect to existing Risk Firewalls that have previously been created in within the application. This allows applications to send/receive approved orders, and query the state of the Risk Firewall from either another context or a different monitor (IE out of scope) from the one that the Risk Firewall was originally created in. While still allowing a simple, and consistent, interface to it. Some functionality is purposefully removed from the interface that is returned when applications connect to existing Risk Firewalls. This is to prevent mis-use by other parts of the application, such as modifying the configuration of the Risk Firewall, and/or removing rules from it.
See Also:
com.apama.firewall.RiskFirewall - The Risk Firewall object that is constructed by the Risk Firewall Factory

Action summary
 integeraddErrorCallback(action<com.apama.firewall.RiskFirewallcom.apama.utils.Error> cbError)

This action allows applications to override the default error handling action used by the Risk Firewall Interface to report any errors that occur from actions called on the interface.
 voidclearErrorCallbacks()

This action allows the application to remove all error callbacks that were added by the addErrorCallback() action.
 com.apama.firewall.RiskFirewallconnect(context serviceManagerCtx, string rfwName)

This action allows applications to connect to an existing instance of a Risk Firewall from the current context.
 com.apama.firewall.RiskFirewallconnectCb(context serviceManagerCtx, string rfwName, action<com.apama.firewall.RiskFirewall> cbOnConnected)

This action allows applications to connect to an existing instance of a Risk Firewall from the current context.
 com.apama.firewall.RiskFirewallcreate(context serviceManagerCtx, string rfwName)

This action allows applications to create a new instance of a Risk Firewall in the current context.
 com.apama.firewall.RiskFirewallcreateCb(context serviceManagerCtx, string rfwName, action<com.apama.firewall.RiskFirewall> cbOnCreated)

This action allows applications to create a new instance of a Risk Firewall in the current context.
 com.apama.utils.ParamsgetParams()

This action allows applications to get the configuration for that has been set on the Risk Firewall Factory.
 voidremoveErrorCallback(integer refId)

This action allows the application to remove error callback that was added by the addErrorCallback() action using the reference Id provided.
 voidsetParams(com.apama.utils.Params config)

This action allows applications to modify any configuration for this instance of Risk Firewall Interface.
 
Action detail

addErrorCallback

integer addErrorCallback(action<com.apama.firewall.RiskFirewallcom.apama.utils.Error> cbError)
This action allows applications to override the default error handling action used by the Risk Firewall Interface to report any errors that occur from actions called on the interface.

For example, errors on creating the Risk Firewall, registering Rule Classes, adding Rule Class instances, etc.

This action will have no effect on the Risk Firewall once it has been created/connected. Instead the addErrorCallback() action on the RiskFirewall interface object should be called.
Parameters:
cbError - The Error callback.
Returns:
A reference Id that can be used to remove the callback at a later date
See Also:
com.apama.firewall.ErrorConstants - The set of constants that define the types of error that may be received.
com.apama.firewall.RiskFirewallFactory#clearErrorCallbacks() - This action clears all the error callbacks that were registered with the Risk Firewall

clearErrorCallbacks

void clearErrorCallbacks()
This action allows the application to remove all error callbacks that were added by the addErrorCallback() action.

Note that this action only affects those error callbacks that have been added on the Risk Firewall Factory. This action will have no effect on the Risk Firewall once it has been created/connected. Instead the clearErrorCallback() action on the RiskFirewall interface object should be called.
See Also:
com.apama.firewall.RiskFirewallFactory#addErrorCallback() - This action adds an error callback to the set of callbacks that will be called when an error occurs
com.apama.firewall.RiskFirewallFactory#removeErrorCallback() - This action removes an existing error callback using the reference identifier provided

connect

com.apama.firewall.RiskFirewall connect(context serviceManagerCtx, string rfwName)
This action allows applications to connect to an existing instance of a Risk Firewall from the current context.

The application must provide the context that the Service Framework manager has been created on (currently this is always the main context) and the name of the Risk Firewall to connect to.

As the connection to an existing Risk Firewall is asynchronous, the Risk Firewall interface object that is returned may pend some operations made on it until such a time as it has been fully connected. If the application requires notification when the Risk Firewall has been fully connected, the alternate connection action 'connectCb()' should be called instead.

The Risk Firewall instance that is being connected to does not have to be registered at the time of calling this action. However, it must be created before the configurable timeout period has expired, otherwise an error will be returned.

Any error callbacks that were set prior to calling this action will be used in the connection of the Risk Firewall. However, any subsequent modifications to the set of error callbacks must be made through the Risk Firewall interface itself. Any further modifications of the error callbacks via the Risk Firewall Factory will only affect new instances of the Risk Firewall that are created/connected.

Connections to existing Risk Firewalls cannot modify the configuration of that Risk Firewall. So any configuration set in the Risk Firewall prior to the connection will be ignored. If the application needs to modify the configuration of the Risk Firewall, they must do so via the Risk Firewall interface that was originally created.
Parameters:
serviceManagerCtx - The context that the Service Framework manager has been created on (typically this is the main context)
rfwName - The name of the existing Risk Firewall to conect to.
Returns:
A new interface to communicate with an existing Risk Firewall instance
See Also:
com.apama.firewall.RiskFirewallFactory#connectCb() - This alternate action can be used to connect to an existing Risk Firewall, and also allows an application to specify an action callback to notify them when the connection to it has completed

connectCb

com.apama.firewall.RiskFirewall connectCb(context serviceManagerCtx, string rfwName, action<com.apama.firewall.RiskFirewall> cbOnConnected)
This action allows applications to connect to an existing instance of a Risk Firewall from the current context.

The application must provide the context that the Service Framework manager has been created on (currently this is always the main context) and the name of the Risk Firewall to connect to.

As the connection to an existing Risk Firewall is asynchronous, the Risk Firewall interface object that is returned may pend some operations made on it until such a time as it has been fully connected. The action callback that is passed in will we called to notify the application when the Risk Firewall has been fully connected.

The Risk Firewall instance that is being connected to does not have to be registered at the time of calling this action. However, it must be created before the configurable timeout period has expired, otherwise an error will be returned.

Any error callbacks that were set prior to calling this action will be used in the connection of the Risk Firewall. However, any subsequent modifications to the set of error callbacks must be made through the Risk Firewall interface itself. Any further modifications of the error callbacks via the Risk Firewall Factory will only affect new instances of the Risk Firewall that are created/connected.

Connections to existing Risk Firewalls cannot modify the configuration of that Risk Firewall. So any configuration set in the Risk Firewall prior to the connection will be ignored. If the application needs to modify the configuration of the Risk Firewall, they must do so via the Risk Firewall interface that was originally created.
Parameters:
serviceManagerCtx - The context that the Service Framework manager has been created on (typically this is the main context)
rfwName - The name of the existing Risk Firewall to conect to.
cbOnConnected
Returns:
A new interface to communicate with an existing Risk Firewall instance
See Also:
com.apama.firewall.RiskFirewallFactory#connect() - This alternate action can be used to connect to an existing instance of the Risk Firewall in cases where an application does not need to be notified when the Risk Firewall is fully connected.

create

com.apama.firewall.RiskFirewall create(context serviceManagerCtx, string rfwName)
This action allows applications to create a new instance of a Risk Firewall in the current context.

The application must provide the context that the Service Framework manager has been created on (currently this is always the main context) and the name of the Risk Firewall, which must be unique within the application.

As the creation of the Risk Firewall is asynchronous, the Risk Firewall interface object that is returned may pend some operations made on it until such a time as it has been fully constructed. If the application requires notification when the Risk Firewall has been fully constructed, the alternate creation action 'createCb()' should be called instead.

Any configuration and/or error callbacks that were set prior to calling this action will be used in the construction of the Risk Firewall. However, any subsequent additions/modifications to the configuration or error callbacks must be made through the Risk Firewall interface itself. Any further modifications via the Risk Firewall Factory will only affect new instances of the Risk Firewall that are created/connected.
Parameters:
serviceManagerCtx - The context that the Service Framework manager has been created on (typically this is the main context)
rfwName - The name of the Risk Firewall to create. This must be unique within the application.
Returns:
A new instance of the Risk Firewall
See Also:
com.apama.firewall.RiskFirewallFactory#createCb() - This alternate action can be used to create a new instance of the Risk Firewall, also allows an application to specify an action callback to notify them when the Risk Firewall is fully constructed.

createCb

com.apama.firewall.RiskFirewall createCb(context serviceManagerCtx, string rfwName, action<com.apama.firewall.RiskFirewall> cbOnCreated)
This action allows applications to create a new instance of a Risk Firewall in the current context.

The application must provide the context that the Service Framework manager has been created on (currently this is always the main context) and the name of the Risk Firewall, which must be unique within the application.

As the creation of the Risk Firewall is asynchronous, the Risk Firewall interface object that is returned immediately from the call may pend some operations made on it until such a time as it has been fully constructed. The action callback that is passed in will we called to notify the application when the Risk Firewall has been fully constructed.

Any configuration and/or error callbacks that were set prior to calling this action will be used in the construction of the Risk Firewall. However, any subsequent additions/modifications to the configuration or error callbacks must be made through the Risk Firewall interface itself. Any further modifications via the Risk Firewall Factory will only affect new instances of the Risk Firewall that are created/connected.
Parameters:
serviceManagerCtx - The context that the Service Framework manager has been created on (typically this is the main context)
rfwName - The name of the Risk Firewall to create. This must be unique within the application.
cbOnCreated - The user defined action callback that will be called once the Risk Firewall has been fully constructed
Returns:
A new instance of the Risk Firewall
See Also:
com.apama.firewall.RiskFirewallFactory#create() - This alternate action can be used to create a new instance of the Risk Firewall in cases where an application does not need to be notified when the Risk Firewall is fully constructed.

getParams

com.apama.utils.Params getParams()
This action allows applications to get the configuration for that has been set on the Risk Firewall Factory.

Once the Risk Firewall instance has been created the configuration for that instance must be queried by the 'getParams()' action on the RiskFirewall interface that is returned. The configuration of the Risk Firewall is only modifiable by the created instance of the Risk Firewall, and is ignored from a remotely connected interface.
Returns:
The configuration that this Risk Firewall should be created with

removeErrorCallback

void removeErrorCallback(integer refId)
This action allows the application to remove error callback that was added by the addErrorCallback() action using the reference Id provided.

Note that this action only affects those error callbacks that have been added on the Risk Firewall Factory. This action will have no effect on the Risk Firewall once it has been created/connected. Instead the removeErrorCallback() action on the RiskFirewall interface object should be called.
Parameters:
refId - The reference ID as returned from the call to the addErrorCallback() action
See Also:
com.apama.firewall.RiskFirewallFactory#addErrorCallback() - This action adds an error callback to the set of callbacks that will be called when an error occurs
com.apama.firewall.RiskFirewallFactory#clearErrorCallbacks() - This action clears all the error callbacks that were registered with the Risk Firewall

setParams

void setParams(com.apama.utils.Params config)
This action allows applications to modify any configuration for this instance of Risk Firewall Interface.

Once the Risk Firewall instance has been created, the configuration for that instance can only be modified by the 'setParams()' action on the RiskFirewall interface that is returned. The configuration of the Risk Firewall is only modifiable by the created instance of the Risk Firewall, and is ignored from a remotely connected interface.
Parameters:
config - The configuration that this Risk Firewall should be created with