org.eclipse.higgins.util.idas.cp
Class BasicAttributePDP

java.lang.Object
  extended byorg.eclipse.higgins.util.idas.cp.BasicAttributePDP
All Implemented Interfaces:
org.eclipse.higgins.idas.api.IAttribute, org.eclipse.higgins.idas.api.IHasAttributes

public class BasicAttributePDP
extends Object
implements org.eclipse.higgins.idas.api.IAttribute

Helper routines for Higgins Context providers that implement some type of PDP. This implementation allows for PDPs at critical points for converting types and values, both for the core properties and for the metadata associated with the attribute.

Author:
dbuss@novell.com

Constructor Summary
BasicAttributePDP(IAttributePDPs attributePDP, IAttributePDPs attributeMetaAttrPDP, IAttributePDPs attributeValueMetaAttrPDP, org.eclipse.higgins.idas.api.IAttribute attribute, boolean isProviderAttr)
          Create a new PDP based attribute which calls out to do conversions.
 
Method Summary
 org.eclipse.higgins.idas.api.IAttribute addAttribute(org.eclipse.higgins.idas.api.IAttribute copyFrom)
          Creates an meta-attribute for this object.
 org.eclipse.higgins.idas.api.IAttribute addAttribute(URI attrID)
          Creates a meta-attribute for this object.
 org.eclipse.higgins.idas.api.IComplexAttrValue addComplexValue(URI arg0)
           
 org.eclipse.higgins.idas.api.ISimpleAttrValue addSimpleValue(URI dataType, Object copyFrom)
           
 org.eclipse.higgins.idas.api.IAttributeValue addValue(org.eclipse.higgins.idas.api.IAttributeValue copyFrom)
          TODO: this doesn't yet perform any policy callouts
 org.eclipse.higgins.idas.api.IAttributeValue addValue(URI attrID)
           
 boolean equals(org.eclipse.higgins.idas.api.IAttribute attr)
          Quick to implement and possibly low performance impl
 boolean equals(org.eclipse.higgins.idas.api.IHasAttributes attributes)
          Quick to implement and possibly low performance impl
 org.eclipse.higgins.idas.api.IAttribute getAttribute(URI attrID)
           
 Iterator getAttributes()
           
 URI getAttrID()
           
 org.eclipse.higgins.idas.api.model.IAttributeModel getModel()
          TODO: currently returns the unmapped model TODO actually implement this function as more than a pass through function
 org.eclipse.higgins.idas.api.ISingleValuedAttribute getSingleValuedAttribute(URI attrID)
           
 Iterator getValues()
           
 Iterator getValues(org.eclipse.higgins.idas.api.IExtension[] extensions)
           
 boolean isSingleValued()
          TODO actually implement this function as more than a pass through function
 void remove()
          TODO actually implement this function as more than a pass through function
 void removeAttribute(URI attrID)
           
 void removeAttributeValue(org.eclipse.higgins.idas.api.IAttribute attr)
           
 void removeAttributeValue(URI attrID, Object value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicAttributePDP

public BasicAttributePDP(IAttributePDPs attributePDP,
                         IAttributePDPs attributeMetaAttrPDP,
                         IAttributePDPs attributeValueMetaAttrPDP,
                         org.eclipse.higgins.idas.api.IAttribute attribute,
                         boolean isProviderAttr)
                  throws org.eclipse.higgins.idas.api.IdASException
Create a new PDP based attribute which calls out to do conversions.

Parameters:
attributePDP - The PDP for the attribute conversions.
attributeMetaAttrPDP - The PDP for Attribute meta-attribute conversions.
attributeValueMetaAttrPDP - The PDP for Attribute Value meta-attribute conversions.
attribute - The object we will wrap, it is the unmapped value, this could be provider or consumer value
isProviderAttr - indicates if the value passed is provider or consumer. Pass true if the value is provider based.
Throws:
org.eclipse.higgins.idas.api.IdASException
Method Detail

getModel

public org.eclipse.higgins.idas.api.model.IAttributeModel getModel()
                                                            throws org.eclipse.higgins.idas.api.IdASException
TODO: currently returns the unmapped model TODO actually implement this function as more than a pass through function

Specified by:
getModel in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException
See Also:
IAttribute.getModel()

addValue

public org.eclipse.higgins.idas.api.IAttributeValue addValue(URI attrID)
                                                      throws org.eclipse.higgins.idas.api.IdASException,
                                                             org.eclipse.higgins.idas.api.InvalidTypeException
Specified by:
addValue in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException

addValue

public org.eclipse.higgins.idas.api.IAttributeValue addValue(org.eclipse.higgins.idas.api.IAttributeValue copyFrom)
                                                      throws org.eclipse.higgins.idas.api.IdASException
TODO: this doesn't yet perform any policy callouts

Specified by:
addValue in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException

getAttrID

public URI getAttrID()
              throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getAttrID in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException

isSingleValued

public boolean isSingleValued()
                       throws org.eclipse.higgins.idas.api.IdASException
TODO actually implement this function as more than a pass through function

Specified by:
isSingleValued in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException
See Also:
IAttribute.isSingleValued()

addComplexValue

public org.eclipse.higgins.idas.api.IComplexAttrValue addComplexValue(URI arg0)
                                                               throws org.eclipse.higgins.idas.api.IdASException,
                                                                      org.eclipse.higgins.idas.api.InvalidTypeException
Specified by:
addComplexValue in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException

addSimpleValue

public org.eclipse.higgins.idas.api.ISimpleAttrValue addSimpleValue(URI dataType,
                                                                    Object copyFrom)
                                                             throws org.eclipse.higgins.idas.api.IdASException,
                                                                    org.eclipse.higgins.idas.api.InvalidTypeException
Specified by:
addSimpleValue in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException

getValues

public Iterator getValues()
                   throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getValues in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException

getValues

public Iterator getValues(org.eclipse.higgins.idas.api.IExtension[] extensions)
                   throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getValues in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException

remove

public void remove()
            throws org.eclipse.higgins.idas.api.IdASException
TODO actually implement this function as more than a pass through function

Specified by:
remove in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException
See Also:
IAttribute.remove()

equals

public boolean equals(org.eclipse.higgins.idas.api.IAttribute attr)
               throws org.eclipse.higgins.idas.api.IdASException
Quick to implement and possibly low performance impl

Specified by:
equals in interface org.eclipse.higgins.idas.api.IAttribute
Throws:
org.eclipse.higgins.idas.api.IdASException

addAttribute

public org.eclipse.higgins.idas.api.IAttribute addAttribute(URI attrID)
                                                     throws org.eclipse.higgins.idas.api.IdASException,
                                                            org.eclipse.higgins.idas.api.InvalidTypeException
Creates a meta-attribute for this object. This Context Provider allows meta-attribute types and values to be mapped from stored (provider) values to what is presented by consumers of this Context Provider by inserting JavaScript into the configuration file. The PDP naming is controlled by the Context Provider.

Specified by:
addAttribute in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException
See Also:
org.eclipse.higgins.idas.api.IHasAttrbutes#addAttribute(java.net.URI)

addAttribute

public org.eclipse.higgins.idas.api.IAttribute addAttribute(org.eclipse.higgins.idas.api.IAttribute copyFrom)
                                                     throws org.eclipse.higgins.idas.api.IdASException
Creates an meta-attribute for this object. This Context Provider allows meta-attribute types and values to be mapped from stored (provider) values to what is presented by consumers of this Context Provider by inserting JavaScript into the configuration file. The PDP naming is controlled by the Context Provider.

TODO this function needs to check the incoming copyFrom and see if it is from this cp or not, then check the mapping, then copy it while mapping

Specified by:
addAttribute in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException
See Also:
IHasAttributes.addAttribute(org.eclipse.higgins.idas.api.IAttribute)

equals

public boolean equals(org.eclipse.higgins.idas.api.IHasAttributes attributes)
               throws org.eclipse.higgins.idas.api.IdASException
Quick to implement and possibly low performance impl

Specified by:
equals in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException

getAttribute

public org.eclipse.higgins.idas.api.IAttribute getAttribute(URI attrID)
                                                     throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getAttribute in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException

getAttributes

public Iterator getAttributes()
                       throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getAttributes in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException

getSingleValuedAttribute

public org.eclipse.higgins.idas.api.ISingleValuedAttribute getSingleValuedAttribute(URI attrID)
                                                                             throws org.eclipse.higgins.idas.api.IdASException,
                                                                                    org.eclipse.higgins.idas.api.NotSingleValuedAttributeException
Specified by:
getSingleValuedAttribute in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.NotSingleValuedAttributeException

removeAttribute

public void removeAttribute(URI attrID)
                     throws org.eclipse.higgins.idas.api.IdASException
Specified by:
removeAttribute in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException

removeAttributeValue

public void removeAttributeValue(URI attrID,
                                 Object value)
                          throws org.eclipse.higgins.idas.api.IdASException
Specified by:
removeAttributeValue in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException

removeAttributeValue

public void removeAttributeValue(org.eclipse.higgins.idas.api.IAttribute attr)
                          throws org.eclipse.higgins.idas.api.IdASException
Specified by:
removeAttributeValue in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException