org.wso2.balana.ctx
Class Attribute

java.lang.Object
  extended by org.wso2.balana.ctx.Attribute

public class Attribute
extends Object

Represents the AttributeType XML type found in the context schema.

Since:
1.0
Author:
Seth Proctor

Constructor Summary
Attribute(URI id, String issuer, DateTimeAttribute issueInstant, AttributeValue value, boolean includeInResult, int version)
          Creates a new Attribute of the type specified in the given AttributeValue.for XACML 3 with one AttributeValue
Attribute(URI id, String issuer, DateTimeAttribute issueInstant, AttributeValue value, int version)
          Creates a new Attribute for XACML 2 and XACML 1.X with one AttributeValue
Attribute(URI id, URI type, String issuer, DateTimeAttribute issueInstant, List<AttributeValue> attributeValues, boolean includeInResult, int xacmlVersion)
          Creates a new Attribute
 
Method Summary
 String encode()
          Encodes this Attribute into its XML form
 void encode(StringBuilder builder)
          Encodes this Attribute into its XML form and writes this out to the provided StringBuilder
 URI getId()
          Returns the id of this attribute
static Attribute getInstance(Node root, int version)
          Creates an instance of an Attribute based on the root DOM node of the XML data.
 DateTimeAttribute getIssueInstant()
          Returns the moment at which the attribute was issued, or null if no issue time was provided
 String getIssuer()
          Returns the issuer of this attribute, or null if no issuer was named
 URI getType()
          Returns the data type of this attribute
 AttributeValue getValue()
          a AttributeValue of this attribute, or null if no value was included
 List<AttributeValue> getValues()
          List of AttributeValue of this attribute, or null if no value was included
 boolean isIncludeInResult()
          Returns whether attribute must be present in response or not
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attribute

public Attribute(URI id,
                 String issuer,
                 DateTimeAttribute issueInstant,
                 AttributeValue value,
                 boolean includeInResult,
                 int version)
Creates a new Attribute of the type specified in the given AttributeValue.for XACML 3 with one AttributeValue

Parameters:
id - the id of the attribute
issuer - the attribute's issuer or null if there is none
issueInstant - the moment when the attribute was issued, or null if it's unspecified
value - the actual value associated with the attribute meta-data
includeInResult - whether to include this attribute in the result.
version - XACML version

Attribute

public Attribute(URI id,
                 String issuer,
                 DateTimeAttribute issueInstant,
                 AttributeValue value,
                 int version)
Creates a new Attribute for XACML 2 and XACML 1.X with one AttributeValue

Parameters:
id - the id of the attribute
issuer - the attribute's issuer or null if there is none
issueInstant - the moment when the attribute was issued, or null if it's unspecified
value - actual List of AttributeValue associated with
version - XACML version

Attribute

public Attribute(URI id,
                 URI type,
                 String issuer,
                 DateTimeAttribute issueInstant,
                 List<AttributeValue> attributeValues,
                 boolean includeInResult,
                 int xacmlVersion)
Creates a new Attribute

Parameters:
id - the id of the attribute
type - the type of the attribute
issuer - the attribute's issuer or null if there is none
issueInstant - the moment when the attribute was issued, or null if it's unspecified
attributeValues - actual List of AttributeValue associated with
includeInResult - whether to include this attribute in the result.
xacmlVersion - xacml version
Method Detail

getInstance

public static Attribute getInstance(Node root,
                                    int version)
                             throws ParsingException
Creates an instance of an Attribute based on the root DOM node of the XML data.

Parameters:
root - the DOM root of the AttributeType XML type
version - XACML version
Returns:
the attribute
Throws:
ParsingException - throws ParsingException if the data is invalid

getId

public URI getId()
Returns the id of this attribute

Returns:
the attribute id

getType

public URI getType()
Returns the data type of this attribute

Returns:
the attribute's data type

getIssuer

public String getIssuer()
Returns the issuer of this attribute, or null if no issuer was named

Returns:
the issuer or null

getIssueInstant

public DateTimeAttribute getIssueInstant()
Returns the moment at which the attribute was issued, or null if no issue time was provided

Returns:
the time of issuance or null

isIncludeInResult

public boolean isIncludeInResult()
Returns whether attribute must be present in response or not

Returns:
true/false

getValues

public List<AttributeValue> getValues()
List of AttributeValue of this attribute, or null if no value was included

Returns:
the attribute' s value or null

getValue

public AttributeValue getValue()
a AttributeValue of this attribute, or null if no value was included

Returns:
the attribute' s value or null

encode

public String encode()
Encodes this Attribute into its XML form

Returns:
String

encode

public void encode(StringBuilder builder)
Encodes this Attribute into its XML form and writes this out to the provided StringBuilder

Parameters:
builder - string stream into which the XML-encoded data is written


Copyright © 2015 WSO2. All rights reserved.