org.openpermis.xacml.io.v2
Class BasicXacmlWriter

java.lang.Object
  extended by org.openpermis.xacml.io.v2.BasicXacmlWriter
All Implemented Interfaces:
XacmlWriter

public class BasicXacmlWriter
extends Object
implements XacmlWriter

Basic implementation of a xacml writer.

Since:
0.4.0

Field Summary
static String XACML_CONTEXT_NAMESPACE
           
static String XACML_POLICY_NAMESPACE
           
 
Constructor Summary
BasicXacmlWriter()
          Creates a new basic response writer.
 
Method Summary
private  void addDecision(org.dom4j.Element parent, org.openpermis.policy.AccessDecision inputDecision)
          Adds the input decision to the parent.
private  void addObligations(org.dom4j.Element parent, org.openpermis.policy.AccessDecision inputDecision)
          Adds the obligations of the input decision to the parent.
private  void addStatus(org.dom4j.Element parent, XacmlStatus inputStatus)
          Adds the status to the parent.
private  String formatXml(org.dom4j.Document document)
          Formats the document.
 String writeResponse(org.openpermis.policy.AccessDecision inputDecision, XacmlStatus inputStatus)
          Writes a permis access decision to an xacml response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XACML_CONTEXT_NAMESPACE

public static final String XACML_CONTEXT_NAMESPACE
Constant Field Value:
"urn:oasis:names:tc:xacml:2.0:context:schema:os"
Since:
0.4.0

XACML_POLICY_NAMESPACE

public static final String XACML_POLICY_NAMESPACE
Constant Field Value:
"urn:oasis:names:tc:xacml:2.0:policy:schema:os"
Since:
0.4.0
Constructor Detail

BasicXacmlWriter

public BasicXacmlWriter()
Creates a new basic response writer.

Since:
0.4.0
Method Detail

formatXml

private String formatXml(org.dom4j.Document document)
                  throws IOException
Formats the document.

Parameters:
document - the document to format.
Returns:
a formatted String.
Throws:
IOException
Since:
0.4.0

addDecision

private void addDecision(org.dom4j.Element parent,
                         org.openpermis.policy.AccessDecision inputDecision)
Adds the input decision to the parent.

Parameters:
parent - the parent element.
inputDecision - an AccessDecision.
Since:
0.4.0

addObligations

private void addObligations(org.dom4j.Element parent,
                            org.openpermis.policy.AccessDecision inputDecision)
Adds the obligations of the input decision to the parent.

Notes:
All obligations have to be returned as one list, there is no way to group the obligations into sets in a xacml response (This is permis specific).
Parameters:
parent - the parent element.
inputDecision - an AccessDecision.
Since:
0.4.0

addStatus

private void addStatus(org.dom4j.Element parent,
                       XacmlStatus inputStatus)
Adds the status to the parent.

Parameters:
parent - the parent element.
inputStatus - a XacmlStatus.
Since:
0.4.0

writeResponse

public String writeResponse(org.openpermis.policy.AccessDecision inputDecision,
                            XacmlStatus inputStatus)
Description copied from interface: XacmlWriter
Writes a permis access decision to an xacml response. If the decision is null an appropriate response is generated (Used to signal an exception).

Specified by:
writeResponse in interface XacmlWriter
Parameters:
inputDecision - the access decision, may be null.
inputStatus - the status, may be null.
Returns:
the xacml response.
Since:
0.4.0


PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:15:45
Copyright (c) 2002-2007 Ergon Informatik AG