Project Aristotle - ArisID Attribute Services

org.openliberty.arisid.policy
Interface IArisWSPolicy


public interface IArisWSPolicy


Field Summary
static java.lang.String AppAttrPolicy_NS
           
static java.lang.String AppAttrPolicy_PREFIX
           
static java.lang.String AppIdPolicy_NS
           
static java.lang.String AppIdPolicy_PREFIX
           
static short TYPE_ALL
           
static short TYPE_ASSERTION
           
static short TYPE_EXACTLYONE
           
static short TYPE_POLICY
           
static short TYPE_POLICY_REF
           
 
Method Summary
 boolean addConstraintOrAssertionToPolicy(IAssertion[] assertions, IPolicy targetPolicy, boolean isAll)
          Adds an array of assertions (aka Constraint) to a specified policy object.
 boolean addConstraintOrAssertionToPolicy(IAssertion assertion, IPolicy targetPolicy, boolean isAll)
          Adds an assertion (aka Constraint) to a specified policy object.
 void addLocalityConstraint(java.lang.String language, IAttributeValue value)
          When used as part of a value for a filter, a preferred locality can be set.
 java.util.Map<java.lang.String,IPolicy> addLocalityConstraint(java.lang.String language, java.lang.String name, java.util.Map<java.lang.String,IPolicy> constraintMap)
          When used as part read or search interaction, a preferred locality can be set.
 java.util.Map<java.lang.String,IPolicy> applyValueConstraints(IAttributeValue attrValue, java.lang.String language, java.util.Map<java.lang.String,IPolicy> constraintMap)
          When used as part of an interaction using an IAttributeValue (add, modify, compare), a preferred locality, or policies can be applied.
 IAddValuesConstraint createAddValuesConstraint()
           
 IContractOrLegalConstraint createContractOrLegalConstraint(java.net.URI contractUri, java.net.URI issuer)
           
 IDataDisplayMaskConstraint createDataDisplayMaskConstraint(java.lang.String maskPattern, java.net.URI issuer)
           
 IDataLossOrBreachConstraint createDataLossOrBreachConstraint(java.net.URI breachReportUri, java.net.URI issuer)
           
 IDeleteValuesConstraint createDeleteValuesConstraint()
           
 ILifetimeConstraint createLifetimeConstraint(java.util.Date startDate, java.util.Date endDate)
           
 ILifetimeConstraint createLifetimeConstraint(int hours, int minutes)
           
 ILocalizationConstraint createLocalizationConstraint(java.lang.String languageCode)
           
 IPolicy createNewPolicy()
          Generates a new Policy object to which constraints may be added.
 IPropagateConstraint createPropagateConstraint(java.net.URI propagateUri, java.net.URI issuer)
           
 IPurposeConstraint createPurposeConstraint(java.net.URI purposeUri, java.net.URI issuer)
           
 IRetentionConstraint createRetentionConstraint(java.net.URI retentionUri, java.net.URI issuer)
           
 IRetentionConstraint createRetentionConstraint(java.net.URI retentionUri, java.net.URI issuer, ILifetimeConstraint lifetime)
           
 IAssertion getConstraint(IPolicy policy, javax.xml.namespace.QName assertionName)
          Returns the first instance of a constraint located within a policy.
 IPolicy getInteractionPolicy(IInteraction ixn)
          Return any policy associated with an Interaction definition.
 java.util.List<java.lang.String> getLocalityConstraints(IAttributeValue value)
          Returns a list of localization languages for a particular IAttributeValue object.
 java.util.List<java.lang.String> getLocalityConstraints(IPolicy policy)
          Return any constraints related to locality in the specified policy
 IPolicy getSchemaRefPolicy(IInteraction ixn, schemaRef attrPredOrRoleRef)
          Returns the WS-Policy as referenced in any AttributeRef, PredicateRef, or RoleRef object.
 void initialize()
           
 boolean isAddValuesOnModify(IAttributeValue value, IModifyInteraction ixn)
          Used to check weather a set of values being used in a modify transaction are intended to add specific values rather than replace all values (the default).
 boolean isAssertionPresent(IPolicy policy, javax.xml.namespace.QName assertionName)
          A utility to test for the presence of a particular constraint or assertion class present in a Policy.
 boolean isDeleteValuesOnModify(IAttributeValue value, IModifyInteraction ixn)
          Used to check weather a set of values being used in a modify transaction are intended to delete specific values rather than replace all values (the default).
 IPolicy loadPolicyByReference(java.net.URI policyRef)
          Loads a Policy by URI reference.
 IPolicy parseDomPolicy(org.w3c.dom.Node policyNode)
          Takes a DOM parsed Node object and uses the WS-Policy implementation provider to generate an IPolicy object containing a native policy object.
 IPolicy parseStringPolicy(java.lang.String policyString)
          Invokes the selected DOM parser and WS-Policy implementation to parse an XML String into an IPolicy object.
 org.w3c.dom.Element parseStringToElement(java.lang.String pol)
          Converts a String representation of WS-Policy into a DOM Element
 org.w3c.dom.Element policyToElement(java.lang.Object policy)
          Converts a native policy object (from the policy provider) to a DOM Element
 java.lang.String policyToString(java.lang.Object policy)
          Converts a native policy object (from the policy provider) to a String representation
 void setAddValuesOnModifyConstraint(IAttributeValue value)
          Used to change the way a modify request works so that specific values listed can be added without having to replace all existing values.
 void setDeleteValuesOnModifyConstraint(IAttributeValue value)
          Used to change the way a modify request works so that specific values listed can be deleted.
 

Field Detail

TYPE_POLICY

static final short TYPE_POLICY
See Also:
Constant Field Values

TYPE_EXACTLYONE

static final short TYPE_EXACTLYONE
See Also:
Constant Field Values

TYPE_ALL

static final short TYPE_ALL
See Also:
Constant Field Values

TYPE_POLICY_REF

static final short TYPE_POLICY_REF
See Also:
Constant Field Values

TYPE_ASSERTION

static final short TYPE_ASSERTION
See Also:
Constant Field Values

AppIdPolicy_NS

static final java.lang.String AppIdPolicy_NS
See Also:
Constant Field Values

AppAttrPolicy_NS

static final java.lang.String AppAttrPolicy_NS
See Also:
Constant Field Values

AppIdPolicy_PREFIX

static final java.lang.String AppIdPolicy_PREFIX
See Also:
Constant Field Values

AppAttrPolicy_PREFIX

static final java.lang.String AppAttrPolicy_PREFIX
See Also:
Constant Field Values
Method Detail

initialize

void initialize()

isDeleteValuesOnModify

boolean isDeleteValuesOnModify(IAttributeValue value,
                               IModifyInteraction ixn)
Used to check weather a set of values being used in a modify transaction are intended to delete specific values rather than replace all values (the default).

Parameters:
value - The IAttributeValue to be tested.
ixn - The modify interaction definition for the transaction.
Returns:
true if IDeleteValuesConstraint is present.

isAssertionPresent

boolean isAssertionPresent(IPolicy policy,
                           javax.xml.namespace.QName assertionName)
A utility to test for the presence of a particular constraint or assertion class present in a Policy. Note: this does not test whether the policy is required. Use the "intersect" method of your selected WS-Policy implementation for this purpose.

Parameters:
policy - The policy object to be tested for the presence of assertionName.
assertionName - The assertion name to look for within the policy.
Returns:
boolean value indicating whether the assertionName type is present in the specified policy.

isAddValuesOnModify

boolean isAddValuesOnModify(IAttributeValue value,
                            IModifyInteraction ixn)
Used to check weather a set of values being used in a modify transaction are intended to add specific values rather than replace all values (the default).

Parameters:
value - The IAttributeValue to be tested.
ixn - The modify interaction definition for the transaction.
Returns:
true if IAddValuesConstraint is present.

setAddValuesOnModifyConstraint

void setAddValuesOnModifyConstraint(IAttributeValue value)
                                    throws PolicyException
Used to change the way a modify request works so that specific values listed can be added without having to replace all existing values.

Parameters:
value - The IAttributeValue object that is to be used in a modify request.
Throws:
PolicyException

setDeleteValuesOnModifyConstraint

void setDeleteValuesOnModifyConstraint(IAttributeValue value)
                                       throws PolicyException
Used to change the way a modify request works so that specific values listed can be deleted.

Parameters:
value - The IAttributeValue object that is to be used in a modify request.
Throws:
PolicyException

getConstraint

IAssertion getConstraint(IPolicy policy,
                         javax.xml.namespace.QName assertionName)
Returns the first instance of a constraint located within a policy.

Parameters:
policy - The IPolicy object within which to search for the constraint or assertion.
assertionName - An String representing a IAssertion qname to search for.
Returns:
Returns the first IAssertion located or null

applyValueConstraints

java.util.Map<java.lang.String,IPolicy> applyValueConstraints(IAttributeValue attrValue,
                                                              java.lang.String language,
                                                              java.util.Map<java.lang.String,IPolicy> constraintMap)
                                                              throws PolicyException
When used as part of an interaction using an IAttributeValue (add, modify, compare), a preferred locality, or policies can be applied.

Note: If a language parameter is specified, it will be added to existing policy specified in constraintMap (which may also have locality constraints). If a policy for the attribute is defined in constraintMap, it will override any existing policy in the passed attributeValue - otherwise, existing policy in attributeValue is used if none if found in constraintMap for the attribute.

Note: At least one of language or constraintMap must be specified.

Parameters:
attrValue - An IAttributeValue for which the locality constraint is to be set. An IAttributeValue object for whom the localization request constraint is to be added. To set the constraint for all data in the interaction, specify the interaction name instead of the data element name.
language - Language token as defined by RFC3066 http://www.w3.org/TR/xmlschema-2/#RFC3066 (may be null)
constraintMap - A Map containing existing existing constraints for which the language constraint is to be added. To create a new map, pass a null. Existing values will overwrite policy already set in attrValue.
Returns:
Map The modified map containing the requested constraint.
Throws:
PolicyException - If attrValue is null, or if both language and constraintMap is null.

getLocalityConstraints

java.util.List<java.lang.String> getLocalityConstraints(IPolicy policy)
Return any constraints related to locality in the specified policy

Parameters:
policy - A WS-Policy object that may contain a locality constraint
Returns:
A list containing locality constraints if present, or NULL.

addLocalityConstraint

void addLocalityConstraint(java.lang.String language,
                           IAttributeValue value)
                           throws PolicyException
When used as part of a value for a filter, a preferred locality can be set.

Parameters:
language - Language token as defined by RFC3066 http://www.w3.org/TR/xmlschema-2/#RFC3066
value - An IAttributeValue object for whom the localization request constraint is to be added.
Throws:
PolicyException

addLocalityConstraint

java.util.Map<java.lang.String,IPolicy> addLocalityConstraint(java.lang.String language,
                                                              java.lang.String name,
                                                              java.util.Map<java.lang.String,IPolicy> constraintMap)
                                                              throws PolicyException
When used as part read or search interaction, a preferred locality can be set.

Parameters:
language - Language token as defined by RFC3066 http://www.w3.org/TR/xmlschema-2/#RFC3066
name - NameId of the attribute, predicate, or role for which the locality constraint is to be set. An IAttributeValue object for whom the localization request constraint is to be added. To set the constraint for all data in the interaction, specify the interaction name instead of the data element name.
constraintMap - A Map containing existing existing constraints for which the language constraint is to be added. To create a new map, pass a null.
Returns:
Map The modified map containing the requested constraint.
Throws:
PolicyException

getLocalityConstraints

java.util.List<java.lang.String> getLocalityConstraints(IAttributeValue value)
Returns a list of localization languages for a particular IAttributeValue object.

For a returned valued, the order should reflect the languages of the returned values.

Parameters:
value - The value object that may contain localized values.
Returns:
An List of String language values contained or null if no localization present.

getInteractionPolicy

IPolicy getInteractionPolicy(IInteraction ixn)
Return any policy associated with an Interaction definition.

Parameters:
ixn - A handle to a IInteraction object for which associated policy is to be returned.
Returns:
The policy associated or null if none defined

getSchemaRefPolicy

IPolicy getSchemaRefPolicy(IInteraction ixn,
                           schemaRef attrPredOrRoleRef)
Returns the WS-Policy as referenced in any AttributeRef, PredicateRef, or RoleRef object.

Parameters:
ixn - The interaction that contains the schemaRef object.
attrPredOrRoleRef - The particular AttributeRef, PredicateRef, or RoleRef whose policy needs to be returned.
Returns:
The Policy declared for this particular use of schema for this Interaction.

policyToElement

org.w3c.dom.Element policyToElement(java.lang.Object policy)
Converts a native policy object (from the policy provider) to a DOM Element

Parameters:
policy - A Java object representing the WS-Provider native implementation of a WS Policy object
Returns:
A DOM Element representation of the WS-Policy

policyToString

java.lang.String policyToString(java.lang.Object policy)
Converts a native policy object (from the policy provider) to a String representation

Parameters:
policy - The native ws-policy object to be converted. Typically obtained from IPolicy.getPolicy().
Returns:
A String representation of the ws-policy object

parseStringPolicy

IPolicy parseStringPolicy(java.lang.String policyString)
                          throws java.lang.Exception
Invokes the selected DOM parser and WS-Policy implementation to parse an XML String into an IPolicy object.

Parameters:
policyString - An XML String representing a WS-Policy or WS-PolicyReference object
Returns:
An IPolicy containing the parsed policy. Use IPolicy.getPolicy() to obtain the actual native policy built by the selected WS-Policy implementation.
Throws:
java.lang.Exception

parseStringToElement

org.w3c.dom.Element parseStringToElement(java.lang.String pol)
Converts a String representation of WS-Policy into a DOM Element

Parameters:
pol - An XML String representation of WS-Policy
Returns:
A DOM Element containing the WS-Policy

parseDomPolicy

IPolicy parseDomPolicy(org.w3c.dom.Node policyNode)
Takes a DOM parsed Node object and uses the WS-Policy implementation provider to generate an IPolicy object containing a native policy object.

Parameters:
policyNode - A DOM Node containing a Policy or PolicyReference node.
Returns:
An IPolicy object holding the WS-Policy object.

loadPolicyByReference

IPolicy loadPolicyByReference(java.net.URI policyRef)
Loads a Policy by URI reference. The reference may be within the CARML Doc or may be an external reference.

Parameters:
policyRef - A URI referencing a WS-Policy document.
Returns:
An IPolicy object containing the obtained and parsed policy.

createAddValuesConstraint

IAddValuesConstraint createAddValuesConstraint()

createContractOrLegalConstraint

IContractOrLegalConstraint createContractOrLegalConstraint(java.net.URI contractUri,
                                                           java.net.URI issuer)

createDataDisplayMaskConstraint

IDataDisplayMaskConstraint createDataDisplayMaskConstraint(java.lang.String maskPattern,
                                                           java.net.URI issuer)

createDataLossOrBreachConstraint

IDataLossOrBreachConstraint createDataLossOrBreachConstraint(java.net.URI breachReportUri,
                                                             java.net.URI issuer)

createDeleteValuesConstraint

IDeleteValuesConstraint createDeleteValuesConstraint()

createLifetimeConstraint

ILifetimeConstraint createLifetimeConstraint(int hours,
                                             int minutes)

createLifetimeConstraint

ILifetimeConstraint createLifetimeConstraint(java.util.Date startDate,
                                             java.util.Date endDate)

createLocalizationConstraint

ILocalizationConstraint createLocalizationConstraint(java.lang.String languageCode)
                                                     throws PolicyException
Throws:
PolicyException

createPropagateConstraint

IPropagateConstraint createPropagateConstraint(java.net.URI propagateUri,
                                               java.net.URI issuer)

createPurposeConstraint

IPurposeConstraint createPurposeConstraint(java.net.URI purposeUri,
                                           java.net.URI issuer)

createRetentionConstraint

IRetentionConstraint createRetentionConstraint(java.net.URI retentionUri,
                                               java.net.URI issuer)

createRetentionConstraint

IRetentionConstraint createRetentionConstraint(java.net.URI retentionUri,
                                               java.net.URI issuer,
                                               ILifetimeConstraint lifetime)

createNewPolicy

IPolicy createNewPolicy()
Generates a new Policy object to which constraints may be added.

Returns:
An IPolicy object to which constraints may be added.

addConstraintOrAssertionToPolicy

boolean addConstraintOrAssertionToPolicy(IAssertion assertion,
                                         IPolicy targetPolicy,
                                         boolean isAll)
Adds an assertion (aka Constraint) to a specified policy object.

Parameters:
assertion - IAssertion to be added
targetPolicy - Target IPolicy object to receive the constraint
isAll - If true, assertion will be added to existing policy assuming that the new constraint is required in addition to any existing constraints (part of an All assertion).
Returns:
True if successfully added

addConstraintOrAssertionToPolicy

boolean addConstraintOrAssertionToPolicy(IAssertion[] assertions,
                                         IPolicy targetPolicy,
                                         boolean isAll)
Adds an array of assertions (aka Constraint) to a specified policy object.

Parameters:
assertions - An array of IAssertion to be added. All assertions added will be placed together within an All policy object.
targetPolicy - Target IPolicy object to receive the constraint
isAll - If true, assertions will be added to existing policy assuming that the new constraints are required in addition to any existing constraints (part of an All assertion).
Returns:
True if successfully added

OpenLiberty.org - Licensed under Apache APL 2.0