org.openadaptor.security.interfaces
Interface Policy

All Known Implementing Classes:
SimplePolicy

public interface Policy

This interface represents a Security Policy that is used by the adaptor to apply security operations on a DO (DO[]) with a specific DOType before publishing onto to messaging layer like ETX.

There can be more than only policy for a DOType, the distinguishing factor amongst them is based on actual data contents. For this purpose, policy contains a DOPredicate, which specifies the condition based on DOAttributes.

A policy contains the following details:

An example properties representation of a Policy -


        Policy.PolicyName                                               = allTrades

        Policy.allTrades.EncodingOrder                  = ENCRYPT-COMPRESS-SIGN
        Policy.allTrades.DecodingOrder                  = SIGN-COMPRESS-ENCRYPT
        Policy.allTrades.ENCRYPT.Algo                   = DES
        Policy.allTrades.ENCRYPT.ClassName              = com.cryptix.encryptor
        Policy.allTrades.SIGN.Algo                              = MD5
        Policy.allTrades.SIGN.ClassName                 = com.cryptix.sign
        Policy.allTrades.COMPRESS.Algo                  = ZIP
        Policy.allTrades.COMPRESS.ClassName             = com.cryptix.compressor
        Policy.allTrades.Timeout                                = 10000 (in ms)

        Policy.allTrades.DOType1                                = TRADE
        Policy.allTrades.DOType2                                = ORDER

        Policy.allTrades.Filter.TRADE.AttName1                  = Counterparty
        Policy.allTrades.Filter.TRADE.AttValue1                 =
        Policy.allTrades.Filter.TRADE.AttValueRegExp1   = London*[a-zA-Z]
        Policy.allTrades.Filter.TRADE.AttName2                  = Quantity
        Policy.allTrades.Filter.TRADE.AttValue2                 = 200
        Policy.allTrades.Filter.TRADE.AttValueRegExp2   =

        Policy.allTrades.TRADE.mCounterparty.PolicyName                 = allCPs
        Policy.allTrades.TRADE.mInstrument.Exchange.PolicyName  = allExs
  

See Also:
DOPredicate, SimpleDOPredicate

Method Summary
 DOPredicate getDOPredicate(java.lang.String doType)
          Returns the DOPredicate
 java.lang.String getName()
          Returns the name of the Policy
 java.util.Properties getPolicyForSubDOs(DOType doType)
          Searches the properties of this to find if any attribute of doType requires to be encoded in a separate way.
 java.util.Properties getPolicyForSubDOs(java.lang.String doType)
          Searches the properties of this to find if any attribute of doType Name requires to be encoded in a separate way.
 java.util.Properties getProperties()
          Returns all the properties in the policy
 java.lang.String getProperty(java.lang.String attr)
          Returns the requested property in the policy object
 java.lang.String getPropsPrefix()
          Policy property prefix
 void init(java.lang.String name, java.util.Properties props, java.lang.String propsPrefix)
          The Security Manager class creates the policy and calls the init function
 boolean isApplicableForDO(DataObject doObj)
          Checks whether this Policy is applicable for the DataObject Provided
 boolean isApplicableForType(DOType doType)
          Checks wether this policy is applicable to the DOType
 boolean isApplicableForType(java.lang.String doType)
          Checks wether this policy is applicable to the DOType Name
 

Method Detail

init

void init(java.lang.String name,
          java.util.Properties props,
          java.lang.String propsPrefix)
          throws java.lang.SecurityException
The Security Manager class creates the policy and calls the init function

Parameters:
name - The name of the Polciy created
properties - The properties object used the security agents
propsPrefix - The policy's property prefix
Throws:
java.lang.SecurityException - If anything fails during initialization

getDOPredicate

DOPredicate getDOPredicate(java.lang.String doType)
Returns the DOPredicate


getName

java.lang.String getName()
Returns the name of the Policy


getProperty

java.lang.String getProperty(java.lang.String attr)
Returns the requested property in the policy object


getProperties

java.util.Properties getProperties()
Returns all the properties in the policy


getPropsPrefix

java.lang.String getPropsPrefix()
Policy property prefix


getPolicyForSubDOs

java.util.Properties getPolicyForSubDOs(DOType doType)
Searches the properties of this to find if any attribute of doType requires to be encoded in a separate way.


getPolicyForSubDOs

java.util.Properties getPolicyForSubDOs(java.lang.String doType)
Searches the properties of this to find if any attribute of doType Name requires to be encoded in a separate way.


isApplicableForType

boolean isApplicableForType(DOType doType)
Checks wether this policy is applicable to the DOType


isApplicableForType

boolean isApplicableForType(java.lang.String doType)
Checks wether this policy is applicable to the DOType Name


isApplicableForDO

boolean isApplicableForDO(DataObject doObj)
Checks whether this Policy is applicable for the DataObject Provided