Project Aristotle - ArisID Attribute Services

org.openliberty.arisid.protocol.ldap
Class PrivacyControl

java.lang.Object
  extended by org.openliberty.arisid.protocol.ldap.PrivacyControl
All Implemented Interfaces:
java.io.Serializable, javax.naming.ldap.Control, IPrivacyControl

public class PrivacyControl
extends java.lang.Object
implements javax.naming.ldap.Control, IPrivacyControl

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface javax.naming.ldap.Control
CRITICAL, NONCRITICAL
 
Fields inherited from interface org.openliberty.arisid.protocol.ldap.IPrivacyControl
OID_IGF_CONTROL
 
Constructor Summary
PrivacyControl(byte[] encodedValue)
          Decodes and constructs a Java object representing the encodedValue
PrivacyControl(IInteraction ixn)
           
PrivacyControl(IInteraction ixn, boolean critical)
           
 
Method Summary
 java.lang.String getAppName()
           
 java.net.URI getAppURI()
          Deprecated. Use getCarmlURI() instead
 CarmlDoc getCarmlDoc()
          A convenience method to obtain the CarmlDoc object referenced by this control.
 java.net.URI getCarmlURI()
           
 java.util.Map<java.lang.String,IPolicy> getConstraintMap()
          Returns all dynamic WS-Policy constraints (interaction and attributes, predicates, roles) for the current transaction.
 IPolicy getDynamicConstraints(java.lang.String nameId)
          Returns dynamic WS-Policy for the specified Attribute, Predicate or Role name identifier or the interaction name if the constraint applies to the entire Interaction.
 byte[] getEncodedValue()
          Encode ASN.1 value.
 java.lang.String getID()
           
 java.lang.String getInteractionName()
           
 IPolicy getTransactionConstraints(java.lang.String nameId)
           
 boolean isCritical()
           
 void loadCarmlDoc(java.net.URI localUri)
          This is a convenience method intended for servers/proxies that need to instantiate a CarmlDoc object.
 void setDynamicConstraints(java.util.Map<java.lang.String,IPolicy> dynamicConstraints)
          Set dynamic transaction constraints.
 void setDynamicConstraints(java.lang.String nameId, IPolicy txnConstraints)
          Set dynamic transaction constraints.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrivacyControl

public PrivacyControl(IInteraction ixn)
               throws IGFException
Throws:
IGFException

PrivacyControl

public PrivacyControl(IInteraction ixn,
                      boolean critical)
               throws IGFException
Throws:
IGFException

PrivacyControl

public PrivacyControl(byte[] encodedValue)
               throws DecodeException
Decodes and constructs a Java object representing the encodedValue

Parameters:
encodedValue - ASN.1 encoded value as per Privacy Control Specifiction: http://www.openliberty.org/wiki/index.php/Profile_LDAP# Extended_PolicySequence_Variation
Throws:
DecodeException
Method Detail

getEncodedValue

public byte[] getEncodedValue()
Encode ASN.1 value. Encoding is as per spec: http://www.openliberty.org/wiki /index.php/Profile_LDAP#Extended_PolicySequence_Variation

Specified by:
getEncodedValue in interface javax.naming.ldap.Control
Specified by:
getEncodedValue in interface IPrivacyControl

getID

public java.lang.String getID()
Specified by:
getID in interface javax.naming.ldap.Control
Specified by:
getID in interface IPrivacyControl

isCritical

public boolean isCritical()
Specified by:
isCritical in interface javax.naming.ldap.Control
Specified by:
isCritical in interface IPrivacyControl

setDynamicConstraints

public void setDynamicConstraints(java.lang.String nameId,
                                  IPolicy txnConstraints)
Description copied from interface: IPrivacyControl
Set dynamic transaction constraints. If constraint is for entire transaction, nameID should be set to the interaction name, otherwise the nameId referenced should be the name of an Attribute, Predicate, or Role identifier. Note: Declared constraints should not be added here since the IInteraction reference already provides the information. Included constraints should only include dynamic constraints.

Specified by:
setDynamicConstraints in interface IPrivacyControl
Parameters:
nameId - The nameId of an Attribute Predicate or Role the policy is to be applied to.
txnConstraints - An IPolicy object containing the constraints for the specified object.

setDynamicConstraints

public void setDynamicConstraints(java.util.Map<java.lang.String,IPolicy> dynamicConstraints)
Description copied from interface: IPrivacyControl
Set dynamic transaction constraints. If constraint is for entire transaction, nameID should be set to the Interaction name, otherwise the nameId referenced should be the name of an Attribute, Predicate, or Role identifier. Note: Declared constraints should not be added here since the IInteraction reference already provides the information. Included constraints should only include dynamic constraints.

Specified by:
setDynamicConstraints in interface IPrivacyControl
Parameters:
dynamicConstraints - A Map containing a set of nameIds of Attributes, Predicates, or Roles and the Policy associated with each nameId.

getConstraintMap

public java.util.Map<java.lang.String,IPolicy> getConstraintMap()
Description copied from interface: IPrivacyControl
Returns all dynamic WS-Policy constraints (interaction and attributes, predicates, roles) for the current transaction.

Specified by:
getConstraintMap in interface IPrivacyControl
Returns:
A Map by NameId and IPolicy containing the WS-Policy for the specified objects.

getDynamicConstraints

public IPolicy getDynamicConstraints(java.lang.String nameId)
Description copied from interface: IPrivacyControl
Returns dynamic WS-Policy for the specified Attribute, Predicate or Role name identifier or the interaction name if the constraint applies to the entire Interaction.

Specified by:
getDynamicConstraints in interface IPrivacyControl
Parameters:
nameId - An nameIdentifier for an attribute, predicate, or role) or an Interaction name for which policy is to be returned.
Returns:
A WS-Policy object for the requested item.

getCarmlDoc

public CarmlDoc getCarmlDoc()
A convenience method to obtain the CarmlDoc object referenced by this control. For performance reasons, the CarmlDoc object is not instantiated unless loadCarmlDoc(URI) is called first.

Returns:
A CarmlDoc object containing the Controls referenced CarmlDoc or null if the document hasn't been loaded.

loadCarmlDoc

public void loadCarmlDoc(java.net.URI localUri)
                  throws java.net.URISyntaxException,
                         java.io.FileNotFoundException,
                         AttrSvcInitializedException,
                         java.lang.InstantiationException,
                         IGFException,
                         java.lang.IllegalAccessException
This is a convenience method intended for servers/proxies that need to instantiate a CarmlDoc object. The localUri is the URI of a local copy of the controls referenced Carml Document.

Parameters:
localUri - A URI to a copy of the CARML document matching the getAppName() of this control. If localUri is null, the method will use the stored URI to load the document.
Throws:
java.net.URISyntaxException
java.lang.IllegalAccessException
IGFException
java.lang.InstantiationException
AttrSvcInitializedException
java.io.FileNotFoundException

getTransactionConstraints

public IPolicy getTransactionConstraints(java.lang.String nameId)

getInteractionName

public java.lang.String getInteractionName()
Specified by:
getInteractionName in interface IPrivacyControl

getAppName

public java.lang.String getAppName()
Specified by:
getAppName in interface IPrivacyControl

getAppURI

public java.net.URI getAppURI()
Deprecated. Use getCarmlURI() instead

Specified by:
getAppURI in interface IPrivacyControl

getCarmlURI

public java.net.URI getCarmlURI()
Specified by:
getCarmlURI in interface IPrivacyControl
Returns:
The unique URI for the CARML declaration

OpenLiberty.org - Licensed under Apache APL 2.0