Project Aristotle - ArisID Attribute Services

org.openliberty.arisid
Interface IAttributeValue

All Known Subinterfaces:
IFilterValue
All Known Implementing Classes:
AttributeFilterValue, AttributeValue

public interface IAttributeValue

An Interface representing common access features for values represented in the AttributeServices API.


Field Summary
static int VALUE_TYPE_EMPTY
           
static int VALUE_TYPE_MULTI
           
static int VALUE_TYPE_SINGLE
           
static int VALUE_TYPE_UNDEFINED
           
 
Method Summary
 boolean add(java.lang.String value)
          Add a String value to the list of values.
 boolean addBinary(byte[] value)
          Adds a binary value to the list of Attribute Values.
 boolean compare(java.lang.String value)
           
 boolean compareValueExact(IAttributeValue value)
           
 boolean compareValueIgnoreCaseExact(IAttributeValue value)
           
 boolean contains(java.lang.String value)
          Tests whether the specified value is contained.
 boolean containsBinary(byte[] value)
          Tests whether the specified binary value is contained.
 boolean equals(java.lang.Object value)
           
 java.lang.String get(int i)
          Returns a String representation of the value at index i where 0 is the first element in the array.
 byte[] getBinary(int i)
          Returns a value in binary form.
 java.lang.Exception getError()
          Returns the error associated with the value if present
 java.lang.String getNameIdRef()
          Returns the Attribute associated with the value as declared in CARML
 IPolicy getPolicy()
          Returns dynamic WS-Policy constraints that are to be applied to the value.
 int getValueType()
          Returns whether the value is either undefined, empty, contains single or multiple values.
 boolean isError()
          Returns whether the current entity has an error condition.
 boolean isUndefined()
          Returns whether the current value is undefined.
 java.util.Iterator<java.lang.String> iterator()
           
 java.lang.String remove(int i)
          Returns the i-th element in the array where 0 is the first element.
 byte[] removeBinary(int i)
          Removes the i th element and returns the binary value removed.
 void setPolicy(IPolicy transactionConstraints)
          Allows dynamic privacy policy constraints to be applied in the form of a WS-Policy.
 int size()
          Returns the number of elements currently available.
 

Field Detail

VALUE_TYPE_UNDEFINED

static final int VALUE_TYPE_UNDEFINED
See Also:
Constant Field Values

VALUE_TYPE_EMPTY

static final int VALUE_TYPE_EMPTY
See Also:
Constant Field Values

VALUE_TYPE_SINGLE

static final int VALUE_TYPE_SINGLE
See Also:
Constant Field Values

VALUE_TYPE_MULTI

static final int VALUE_TYPE_MULTI
See Also:
Constant Field Values
Method Detail

equals

boolean equals(java.lang.Object value)
Overrides:
equals in class java.lang.Object

getError

java.lang.Exception getError()
Returns the error associated with the value if present

Returns:
the exception or null if no error present.

getNameIdRef

java.lang.String getNameIdRef()
Returns the Attribute associated with the value as declared in CARML

Returns:
A String containing the Attribute name identifier.

isError

boolean isError()
Returns whether the current entity has an error condition. Note: the presence of an error does not mean there are not values present.

Returns:
The error condition that occured during construction of the value.

isUndefined

boolean isUndefined()
Returns whether the current value is undefined. For example, see constructors for AttributeValue.

Returns:
true if no value has been defined (as opposed to just an empty set).

getValueType

int getValueType()
Returns whether the value is either undefined, empty, contains single or multiple values.

Returns:
an integer as defined by the constants VALUE_TYPE_UNDEFINED, VALUE_TYPE_EMPTY, VALUE_TYPE_SINGLE, or VALUE_TYPE_MULTI.

size

int size()
Returns the number of elements currently available. Note that 0 can mean either no elements or undefined.

Returns:
The number of elements available. Returns 0 whether the value is undefined or empty.

iterator

java.util.Iterator<java.lang.String> iterator()
Returns:
An Iterator of values in String form.

compareValueIgnoreCaseExact

boolean compareValueIgnoreCaseExact(IAttributeValue value)

compareValueExact

boolean compareValueExact(IAttributeValue value)

compare

boolean compare(java.lang.String value)
Parameters:
value - to be compared
Returns:
true if the String representation of the values are a match. This is the String version of compareValueExact(IAttributeValue).

get

java.lang.String get(int i)
Returns a String representation of the value at index i where 0 is the first element in the array.

Parameters:
i - the index of the String value to be returned where 0 is the first element to be returned.
Returns:
a String representation of the value at index i.

add

boolean add(java.lang.String value)
Add a String value to the list of values.

Parameters:
value -
Returns:
true if added successfully.

remove

java.lang.String remove(int i)
Returns the i-th element in the array where 0 is the first element.

Parameters:
i - - the index of the element (starting from 0) to be returned.
Returns:
The element requested or null

contains

boolean contains(java.lang.String value)
Tests whether the specified value is contained.

Parameters:
value -
Returns:
true if a match is located based on the String value.

addBinary

boolean addBinary(byte[] value)
Adds a binary value to the list of Attribute Values. The byte[] array will be stored as a base64 encoded string.

Parameters:
value -
Returns:
true if the value was Added.

containsBinary

boolean containsBinary(byte[] value)
Tests whether the specified binary value is contained.

Parameters:
value -
Returns:
true if a match is located based on a base64 encoding of the byte[] value.

getBinary

byte[] getBinary(int i)
Returns a value in binary form. The method does a base64 deocde of the stored string value.

Parameters:
i - The element to return (where 0 is the first element)
Returns:
A byte[] array containing the original binary value.

removeBinary

byte[] removeBinary(int i)
Removes the i th element and returns the binary value removed.

Parameters:
i - The element to remove (where 0 is the first)
Returns:
The binary value of the element removed

getPolicy

IPolicy getPolicy()
Returns dynamic WS-Policy constraints that are to be applied to the value. On an outbound request it applies to constraints being sent to an attribute authority. In a response, such a from DigitalSubject.getAttributeValue(String), it contains transactional constraints specified by the attribute authority.

Returns:
Privacy constraints in a WS-Policy (IPolicy) container. To parse/set transactional constraints, use the PolicyHandler class.

setPolicy

void setPolicy(IPolicy transactionConstraints)
Allows dynamic privacy policy constraints to be applied in the form of a WS-Policy.

Parameters:
transactionConstraints - Privacy constraints in a WS-Policy (IPolicy) container. To parse/set dynamic constraints, use the PolicyHandler class.

OpenLiberty.org - Licensed under Apache APL 2.0