it.eng.rdlab.soa3.pm.connector.impl
Class PolicyAdderImpl

java.lang.Object
  extended by it.eng.rdlab.soa3.pm.connector.impl.PolicyAdderImpl
All Implemented Interfaces:
PolicyAdder

public class PolicyAdderImpl
extends Object
implements PolicyAdder

Standard implementation of Policy Adder

Author:
Ciro Formisano (ENG)

Constructor Summary
PolicyAdderImpl()
           
PolicyAdderImpl(String url)
           
 
Method Summary
 Status addNewRule(String alias, Map<String,String> subjectAttributes, String action, String resource, boolean permitted, Obligation obligation, boolean moveAfter)
          Adds a new simple rule
 Status addXACMLPolicy(String alias, int index, String policySetId, String policyIdPrefix, Element xacmlPolicy)
          Adds a policy in Element format
 Status addXACMLPolicy(String alias, int index, String policySetId, String policyIdPrefix, org.opensaml.xacml.policy.PolicyType xacmlPolicy)
          Adds a policy in XACML format
 Status addXACMLPolicySet(String alias, int index, Element xacmlPolicySet)
          Adds a policy set in Element format
 Status addXACMLPolicySet(String alias, int index, org.opensaml.xacml.policy.PolicySetType xacmlPolicySet)
          Adds a policy set in XACML format
 void setUrl(String url)
           
 Status updateXACMLPolicy(String alias, int version, Element policy)
          Updates a Policy in Element format
 Status updateXACMLPolicy(String alias, int version, org.opensaml.xacml.policy.PolicyType xacmlPolicy)
          Updates a Policy in XACML format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolicyAdderImpl

public PolicyAdderImpl()

PolicyAdderImpl

public PolicyAdderImpl(String url)
Method Detail

setUrl

public void setUrl(String url)
Parameters:
url -

addNewRule

public Status addNewRule(String alias,
                         Map<String,String> subjectAttributes,
                         String action,
                         String resource,
                         boolean permitted,
                         Obligation obligation,
                         boolean moveAfter)
Adds a new simple rule

Specified by:
addNewRule in interface PolicyAdder
Parameters:
alias - the PAP alias (can be null)
subjectAttributes - a map (key - value) of the subject attributes
action - action id
resource - resource id
permitted - true if it is a permit rule, false otherwise
obligation - an obligation
moveAfter - boolean value indicating if the rule must be set as last rule of the policy
Returns:
the status object representing the result of the operation

addXACMLPolicy

public Status addXACMLPolicy(String alias,
                             int index,
                             String policySetId,
                             String policyIdPrefix,
                             org.opensaml.xacml.policy.PolicyType xacmlPolicy)
Adds a policy in XACML format

Specified by:
addXACMLPolicy in interface PolicyAdder
Parameters:
alias - the PAP alias (can be null)
index - the index of the policy in the policy set
policySetId - the policy set id
policyIdPrefix - the policy id prefix
xacmlPolicy - the policy in XACML format
Returns:
the status object representing the result of the operation

addXACMLPolicySet

public Status addXACMLPolicySet(String alias,
                                int index,
                                org.opensaml.xacml.policy.PolicySetType xacmlPolicySet)
Adds a policy set in XACML format

Specified by:
addXACMLPolicySet in interface PolicyAdder
Parameters:
alias - the PAP alias (can be null)
index - the index of the policy set
xacmlPolicySet - the policy set in XACML format
Returns:
the status object representing the result of the operation

updateXACMLPolicy

public Status updateXACMLPolicy(String alias,
                                int version,
                                org.opensaml.xacml.policy.PolicyType xacmlPolicy)
Updates a Policy in XACML format

Specified by:
updateXACMLPolicy in interface PolicyAdder
Parameters:
alias - the PAP alias (can be null)
version - the version of the old policy
xacmlPolicy - the policy in XACML format
Returns:
the status object representing the result of the operation

addXACMLPolicy

public Status addXACMLPolicy(String alias,
                             int index,
                             String policySetId,
                             String policyIdPrefix,
                             Element xacmlPolicy)
Adds a policy in Element format

Specified by:
addXACMLPolicy in interface PolicyAdder
Parameters:
alias - the PAP alias (can be null)
index - the index of the policy in the policy set
policySetId - the policy set id
policyIdPrefix - the policy id prefix
xacmlPolicy - the policy in XACML format as a DOM element
Returns:
the status object representing the result of the operation

addXACMLPolicySet

public Status addXACMLPolicySet(String alias,
                                int index,
                                Element xacmlPolicySet)
Adds a policy set in Element format

Specified by:
addXACMLPolicySet in interface PolicyAdder
Parameters:
alias - the PAP alias (can be null)
index - the index of the policy set
xacmlPolicySet - the policy set as a DOM element
Returns:
the status object representing the result of the operation

updateXACMLPolicy

public Status updateXACMLPolicy(String alias,
                                int version,
                                Element policy)
Updates a Policy in Element format

Specified by:
updateXACMLPolicy in interface PolicyAdder
Parameters:
alias - the PAP alias (can be null)
version - the version of the old policy
Returns:
the status object representing the result of the operation


Copyright © 2012. All Rights Reserved.