issrg.pba.management.agent.managed
Class ManagedSimplePERMISPolicyFinder

java.lang.Object
  extended by issrg.pba.rbac.PolicyFinder
      extended by issrg.simplePERMIS.SimplePERMISPolicyFinder
          extended by issrg.pba.management.agent.managed.ManagedSimplePERMISPolicyFinder
All Implemented Interfaces:
ManagedPolicyFinder

public class ManagedSimplePERMISPolicyFinder
extends SimplePERMISPolicyFinder
implements ManagedPolicyFinder

This class presents a managed version of SimplePERMISPolicyFinder. It is not very useful as it in fact doesn't permit dynamic updates of the policy. It is mainly there to allow a simpler implementation of the PolicyTester.

Author:
sfl

Field Summary
static java.lang.String XML_POLICY
          This is the attribute name that should be used in the repository passed to updatePolicy.
 
Fields inherited from class issrg.pba.rbac.PolicyFinder
accessPolicy, allocationPolicy, authzTokenRepository, filepath, msodPolicySet, parsedPolicy, policyOID, satLevel, sawsServer, soa, sv, tokenParser
 
Constructor Summary
ManagedSimplePERMISPolicyFinder(java.io.File file, java.security.Principal soa)
          Constructs a ManagedSimplePERMISPolicyFinder given a File and a Principal representing the policy writer.
ManagedSimplePERMISPolicyFinder(java.lang.String xmlPolicy, java.security.Principal soa)
          Constructs a ManagedSimplePERMISPolicyFinder given a String and a Principal representing the policy writer.
 
Method Summary
 java.security.Principal getPrincipalSOA()
          Returns the Source of Authority for this policy.
 java.lang.String updatePolicy(AttributeRepository attributeRepository, java.lang.String policyName)
          Updates the policy held by this PolicyFinder object.
 
Methods inherited from class issrg.simplePERMIS.SimplePERMISPolicyFinder
initFromString
 
Methods inherited from class issrg.pba.rbac.PolicyFinder
getAccessPolicy, getAllocationPolicy, getfilepath, getMSoDPolicy, getParsedPolicy, getPolicyOID, getRepository, getSATLevel, getSAWSServer, getSOA, getSV, removeSystemTag, SAWSCloseLog, setSV
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_POLICY

public static final java.lang.String XML_POLICY
This is the attribute name that should be used in the repository passed to updatePolicy.

See Also:
updatePolicy, Constant Field Values
Constructor Detail

ManagedSimplePERMISPolicyFinder

public ManagedSimplePERMISPolicyFinder(java.lang.String xmlPolicy,
                                       java.security.Principal soa)
                                throws PbaException
Constructs a ManagedSimplePERMISPolicyFinder given a String and a Principal representing the policy writer.

Parameters:
xmlPolicy - a String containing the new policy
soa - a Principal representing the policy writer (or the Source of Authority). Should not be null.
Throws:
PbaException - when the given policy could not be parsed

ManagedSimplePERMISPolicyFinder

public ManagedSimplePERMISPolicyFinder(java.io.File file,
                                       java.security.Principal soa)
                                throws java.io.IOException,
                                       PbaException
Constructs a ManagedSimplePERMISPolicyFinder given a File and a Principal representing the policy writer.

Parameters:
file - the File object that contains the policy
soa - a Principal representing the policy writer (or the Source of Authority). Should not be null.
Throws:
java.io.IOException - when the file could not be read
PbaException - when the given policy could not be parsed
Method Detail

getPrincipalSOA

public java.security.Principal getPrincipalSOA()
Returns the Source of Authority for this policy. Is in fact the same method as getSOA(), but is here because of the ManagedPolicyFinder interface. Should never return null.

Specified by:
getPrincipalSOA in interface ManagedPolicyFinder
Returns:
the principal object representing the SOA.

updatePolicy

public java.lang.String updatePolicy(AttributeRepository attributeRepository,
                                     java.lang.String policyName)
                              throws PbaException
Updates the policy held by this PolicyFinder object. Tries to replace the policy by one held in the given AttributeRepository. The new policy must be stored under the SOA's entry, and the attribute name should be XML_POLICY.

Specified by:
updatePolicy in interface ManagedPolicyFinder
Parameters:
attributeRepository - the AttributeRepository to use
policyName - the OID name of the new policy.
Returns:
a response code indicating the success of the update.
Throws:
PbaException - if the policy update failed.