|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.higgins.idas.spi.BasicAttributeSet
org.eclipse.higgins.idas.spi.BasicContext
org.eclipse.higgins.idas.cp.jspolicy.JSPolicyContext
A Higgins Context Provider implementation allowing for javascript policy at critical points. Utilizing Mozilla's Rhino project, this code currently supports JavaScript PDPs at the following points:
getEntity(String entityID), and
getEntity(java.lang.String, java.util.Iterator) calls allow entity IDs
to be mapped from stored (provider) values to what is presented by consumers of
this Context Provider.JSPolicyContext,
JSPolicyEntity, and
| Field Summary | |
|---|---|
static String |
attrMetadataPDPCache
Generic parameter name used by selected PDPs. |
static String |
attrPDPCache
Generic parameter name used by selected PDPs. |
static String |
connectionType
|
static String |
consumerAIDToProvider
Identifier used in the id attribute of a
JSPolicyAction element to specify the mapping performed on
Attribute ID passed to this context provider before being passed to the
real context provider. |
static String |
consumerATypeToProvider
Identifier used in the id attribute of a
JSPolicyAction element to specify the mapping performed on
Attribute Types passed to this context provider before being passed to the
real context provider. |
static String |
consumerAValueToProvider
Identifier used in the id attribute of a
JSPolicyAction element to specify the mapping performed on
Attribute Values passed to this context provider before being passed to
the real context provider. |
static String |
consumerContext
Generic parameter name used by selected PDPs. |
static String |
consumerEntityIDToProvider
Identifier used in the id attribute of a
JSPolicyAction element to specify the mapping performed on
Entity IDs passed to this context provider before being passed to the real
context provider. |
static String |
consumerEntityTypeToProvider
Identifier used in the id attribute of a
JSPolicyAction element to specify the mapping performed on
Entity Types passed to this context provider before being passed
to the real context provider. |
static String |
consumerIDParamName
Generic parameter name used by selected PDPs. |
static String |
consumerMIDToProvider
Identifier used in the id attribute of a
JSPolicyAction element to specify the mapping performed on
Metadata ID passed to this context provider before being passed to the
real context provider. |
static String |
consumerMTypeToProvider
Identifier used in the id attribute of a
JSPolicyAction element to specify the mapping performed on
Metadata Types passed to this context provider before being passed to the
real context provider. |
static String |
consumerMValueToProvider
|
static String |
consumerOpenAIDToProvider
Identifier used in the id attribute of a
JSPolicyAction element to specify the mapping performed on
Attribute Types passed to this context provider before being passed to the
real context provider in the course of a context open call. |
static String |
consumerOpenContextRefToProvider
Identifier used in the id attribute of a
JSPolicyAction element to specify the mapping performed on
Context URI during the context open call. |
static String |
consumerOpenValueToProvider
Identifier used in the id attribute of a
JSPolicyAction element to specify the mapping performed on
Attribute Values passed to this context provider before being passed to
the real context provider during a context open call. |
static String |
consumerTypeParamName
Generic parameter name used by selected PDPs. |
static String |
exportData
|
static String |
genericParamName
Generic name which is used on many of the PDPs to pass a single parameter from java to the script. |
static String |
genericParamName2
Generic name which is used on many of the PDPs to pass a single parameter from java to the script. |
static String |
genericResultName
Generic name which is used on many of the PDPs to pass the result from JavaScript back to JAVA PDP code. |
static String |
getSchema
|
static String |
providerAIDToConsumer
Identifier used in the id attribute of a
JSPolicyAction element to specify the mapping performed on
Attribute ID as they are returned from the real context provider to
this context provider. |
static String |
providerATypeToConsumer
Identifier used in the id attribute of a
JSPolicyAction element to specify the mapping performed on
Attribute Types as they are returned from the real context provider to
this context provider. |
static String |
providerAValueToConsumer
Identifier used in the id attribute of a
JSPolicyAction element to specify the mapping performed on
Attribute values passed to this context provider before being passed to
the real context provider. |
static String |
providerContext
Generic parameter name used by selected PDPs. |
static String |
providerEntityIDToConsumer
Identifier used in the id attribute of a
JSPolicyAction element to specify the mapping performed on
Entity IDs as they are returned from the real context provider to this context
provider. |
static String |
providerEntityTypeToConsumer
Identifier used in the id attribute of a
JSPolicyAction element to specify the mapping performed on
Entity Types as they are returned from the real context provider
to this context provider. |
static String |
providerIDParamName
Generic parameter name for for selected PDPs. |
static String |
providerMIDToConsumer
Identifier used in the id attribute of a
JSPolicyAction element to specify the mapping performed on
Attribute ID as they are returned from the real context provider to
this context provider. |
static String |
providerMTypeToConsumer
Identifier used in the id attribute of a
JSPolicyAction element to specify the mapping performed on
Metadata Types as they are returned from the real context provider to
this context provider. |
static String |
providerMValueToConsumer
|
static String |
providerTypeParamName
Generic parameter name for for selected PDPs. |
static String |
setSchema
|
| Method Summary | |
|---|---|
org.eclipse.higgins.idas.api.IEntity |
addEntity(org.eclipse.higgins.idas.api.IEntity copyFrom)
TODO implement this function This Context Provider allows Entity Types, Entity ID, metadata, and attribute values to be mapped from values passed by consumers of this Context Provider to types and values for storage. |
org.eclipse.higgins.idas.api.IEntity |
addEntity(URI entityType,
String entityID)
This Context Provider allows Entity Types, Entity ID and Attribute values to be mapped from values passed by consumers of this Context Provider to types and values for storage. |
void |
close()
|
String |
exportData(String filter,
String representationFormat)
|
org.eclipse.higgins.idas.api.model.IContextModel |
getContextModel()
TODO implement this function |
Iterator |
getEntities(org.eclipse.higgins.idas.api.IFilter filter)
TODO implement this function |
Iterator |
getEntities(org.eclipse.higgins.idas.api.IFilter filter,
Iterator consumerSelectionList)
TODO implement this function |
org.eclipse.higgins.idas.api.IEntity |
getEntity(String entityID)
|
org.eclipse.higgins.idas.api.IEntity |
getEntity(String entityID,
Iterator consumerSelectionList)
This Context Provider allows 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. |
String |
getSchema()
|
void |
importData(String filter,
String representationFormat)
TODO Implement this function? |
boolean |
isOpen(Object identity)
|
String |
open(Object identity)
|
void |
setSchema(String schema)
|
boolean |
verifyEntityAttributes(String entityID,
Iterator attributes)
|
| Methods inherited from class org.eclipse.higgins.idas.spi.BasicContext |
|---|
applyUpdates, buildAttribute, buildAttributeAssertion, buildAuthNAttributesMaterials, buildComplexAttrValue, buildEntityIDAssertion, buildEntityTypeAssertion, buildFilter, buildSimpleAttrValue, cancelUpdates, createSimpleValue, getContextID, updateNotification |
| Methods inherited from class org.eclipse.higgins.idas.spi.BasicAttributeSet |
|---|
addAttribute, addAttribute, addUnnotifiedAttribute, addUnnotifiedAttribute, equals, getAttribute, getAttributes, getSingleValuedAttribute, removeAttribute, removeAttributeValue, removeAttributeValue, updateNotification |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.higgins.idas.api.IHasAttributes |
|---|
addAttribute, addAttribute, equals, getAttribute, getAttributes, getSingleValuedAttribute, removeAttribute, removeAttributeValue, removeAttributeValue |
| Methods inherited from interface org.eclipse.higgins.idas.spi.IAttributeContainer |
|---|
updateNotification |
| Field Detail |
public static final String connectionType
public static final String consumerEntityIDToProvider
id attribute of a
JSPolicyAction element to specify the mapping performed on
Entity IDs passed to this context provider before being passed to the real
context provider.
When this PDP is invoked the Entity ID is converted to a string, stored in an
evaluation specific JavaScript scope using the name
consumerIDParamName. It is presented that either the result of the
script or a JavaScript variable with the name
genericResultName is the new Entity ID.
To avoid problems it is recomended that the reverse mapping also be
defined using the id providerEntityIDToConsumer
A simple nonsensical sample where the provider Entity IDs all start with the letters 'vc' and those are replaced by the letters 'js':
<JSPolicyAction id="consumerEntityIDToProvider" evalType="javascript">
var re = new RegExp("ˆjs", "g");
RESULT = consumerID.replace(re, "vc");
</JSPolicyAction>
<JSPolicyAction id="providerEntityIDToConsumer" evalType="javascript">
var re = new RegExp("ˆvc", "g");
RESULT = consumerID.replace(re, "js");
</JSPolicyAction>
public static final String providerEntityIDToConsumer
id attribute of a
JSPolicyAction element to specify the mapping performed on
Entity IDs as they are returned from the real context provider to this context
provider. The inverse of this mapping is consumerEntityIDToProvider
public static final String consumerMIDToProvider
id attribute of a
JSPolicyAction element to specify the mapping performed on
Metadata ID passed to this context provider before being passed to the
real context provider. Applies to metadata on Entities, Attributes, and
Attribute Values.
JScriptCPMetadataPDPs.consumerIDToProvider(java.net.URI),
Constant Field Valuespublic static final String providerMIDToConsumer
id attribute of a
JSPolicyAction element to specify the mapping performed on
Attribute ID as they are returned from the real context provider to
this context provider. The inverse of this mapping is
consumerMIDToProvider
public static final String consumerAIDToProvider
id attribute of a
JSPolicyAction element to specify the mapping performed on
Attribute ID passed to this context provider before being passed to the
real context provider.
JScriptCPAttributePDPs.consumerIDToProvider(java.net.URI),
Constant Field Valuespublic static final String providerAIDToConsumer
id attribute of a
JSPolicyAction element to specify the mapping performed on
Attribute ID as they are returned from the real context provider to
this context provider. The inverse of this mapping is
consumerAIDToProvider
public static final String consumerMTypeToProvider
id attribute of a
JSPolicyAction element to specify the mapping performed on
Metadata Types passed to this context provider before being passed to the
real context provider.
JScriptCPMetadataPDPs.consumerTypeToProvider(java.net.URI, java.net.URI),
Constant Field Valuespublic static final String providerMTypeToConsumer
id attribute of a
JSPolicyAction element to specify the mapping performed on
Metadata Types as they are returned from the real context provider to
this context provider. The inverse of this mapping is
consumerMTypeToProvider
public static final String consumerATypeToProvider
id attribute of a
JSPolicyAction element to specify the mapping performed on
Attribute Types passed to this context provider before being passed to the
real context provider.
JScriptCPAttributePDPs.consumerTypeToProvider(java.net.URI, java.net.URI),
Constant Field Valuespublic static final String providerATypeToConsumer
id attribute of a
JSPolicyAction element to specify the mapping performed on
Attribute Types as they are returned from the real context provider to
this context provider. The inverse of this mapping is
consumerATypeToProvider
public static final String consumerEntityTypeToProvider
id attribute of a
JSPolicyAction element to specify the mapping performed on
Entity Types passed to this context provider before being passed
to the real context provider.
When this PDP is invoked the Entity Type is stored in an
evaluation specific JavaScript scope using the name
consumerTypeParamName. It is presented that either the result of the
script or a JavaScript variable with the name
genericResultName is the new Entity Type.
To avoid problems it is recomended that the reverse mapping also be
defined using the id providerEntityTypeToConsumer
A simple nonsensical sample where the provider Entity Type mappings are stored in a globally scoped attribute multimap, and are referenced using JavaScript Associative Arrays.
<JSPolicyAction id="consumerEntityTypeToProvider" evalType="javascript"> RESULT = multimap.consumer[String(PARAM.toString())]; </JSPolicyAction> <JSPolicyAction id="providerEntityTypeToConsumer" evalType="javascript"> RESULT = multimap.provider[String(PARAM.toString())]; </JSPolicyAction>
TODO: currently this is for Attribute types, Entity MetaData Types, and Attribute MetaData Types, should we have seperate PDPs for those? The internal code is already fully instrumented for the addtional PDPs.
public static final String providerEntityTypeToConsumer
id attribute of a
JSPolicyAction element to specify the mapping performed on
Entity Types as they are returned from the real context provider
to this context provider. The inverse of this mapping is
consumerEntityTypeToProvider
public static final String consumerAValueToProvider
id attribute of a
JSPolicyAction element to specify the mapping performed on
Attribute Values passed to this context provider before being passed to
the real context provider.
When this PDP is invoked the consumer type, the provider type and the
Attribute Value are all stored in an evaluation specific JavaScript scope
using the names consumerTypeParamName,
providerTypeParamName, genericParamName respectivly. It is
presented that either the result of the script or a JavaScript
variable with the name genericResultName is the new value
To avoid problems it is recomended that the reverse mapping also be
defined using the id providerAValueToConsumer
A simple nonsensical sample where the for anything which is Entity ID the same
mappings is preformed as noted in the sample for
consumerEntityTypeToProvider
<JSPolicyAction id="consumerEntityTypeToProvider" evalType="javascript">
importPackage(Packages.org.eclipse.higgins.idas);
importPackage(Packages.org.eclipse.higgins.idas.impl);
var re = new RegExp("ˆvc", "g");
if (consumerType == "EntityIDSyntax") {
RESULT = new Packages.org.eclipse.higgins.idas.impl.BasicValueString(
String(PARAM.getData()).replace(re, "js"));
}
</JSPolicyAction>
public static final String consumerMValueToProvider
public static final String providerAValueToConsumer
id attribute of a
JSPolicyAction element to specify the mapping performed on
Attribute values passed to this context provider before being passed to
the real context provider. The inverse of this mapping is
consumerMValueToProvider
public static final String providerMValueToConsumer
public static final String consumerOpenValueToProvider
id attribute of a
JSPolicyAction element to specify the mapping performed on
Attribute Values passed to this context provider before being passed to
the real context provider during a context open call.
When this PDP is invoked the consumer type, the provider type and the
Attribute Value are all stored in an evaluation specific JavaScript scope
using the names consumerTypeParamName,
providerTypeParamName, genericParamName respectivly. It is
presented that either the result of the script or a JavaScript
variable with the name genericResultName is the new value
Please note this is a unidirctional mapping, there is no inverse.
A simple nonsensical sample where the for anything which is Entity ID the same
mappings is preformed as noted in the sample for
consumerEntityTypeToProvider
<JSPolicyAction id="consumerOpenValueToProvider" evalType="javascript">
importPackage(Packages.org.eclipse.higgins.idas);
importPackage(Packages.org.eclipse.higgins.idas.impl);
var re = new RegExp("ˆvc", "g");
if (consumerType == "EntityIDSyntax") {
RESULT = new Packages.org.eclipse.higgins.idas.impl.BasicValueString(
String(PARAM.getData()).replace(re, "js"));
}
</JSPolicyAction>
public static final String consumerOpenAIDToProvider
id attribute of a
JSPolicyAction element to specify the mapping performed on
Attribute Types passed to this context provider before being passed to the
real context provider in the course of a context open call.
When this PDP is invoked the Attribute Type is stored in an evaluation
specific JavaScript scope using the name genericParamName. It is
presented that either the result of the script or a JavaScript
variable with the name genericResultName is the new Attribute
Type.
This is a one way map, no values are returned. A simple nonsensical sample where the provider Entity Type mappings are stored in a globally scoped attribute multimap, and are referenced using JavaScript Associative Arrays.
<JSPolicyAction id="consumerOpenAIDToProvider" evalType="javascript"> RESULT = multimap.consumer[PARAM]; </JSPolicyAction>
public static final String consumerOpenContextRefToProvider
id attribute of a
JSPolicyAction element to specify the mapping performed on
Context URI during the context open call. When this PDP is invoked the
consumer type, the mapping context provider's Context Ref is stored in an
evaluation specific JavaScript scope using the name
genericParamName. It is presented that either the result of the
script or a JavaScript variable with the name
genericResultName is the new value
Please note this is a unidirctional mapping, there is no inverse. A simple sample which ignores the passed in PARAM and just returns a new value
<JSPolicyAction id="consumerOpenContextRefToProvider" evalType="javascript">
new java.lang.URI("http://bogus.data.frogspawn:port");
</JSPolicyAction>
public static final String genericParamName
public static final String genericParamName2
public static final String genericResultName
public static final String consumerIDParamName
public static final String providerIDParamName
public static final String consumerTypeParamName
public static final String providerTypeParamName
public static final String consumerContext
public static final String providerContext
public static final String attrPDPCache
public static final String attrMetadataPDPCache
public static final String getSchema
public static final String setSchema
public static final String exportData
| Method Detail |
public String open(Object identity)
throws org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.IdASExceptionIContext.open(java.lang.Object)
public void close()
throws org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.IdASExceptionIContext.close()
public boolean isOpen(Object identity)
throws org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.IdASExceptionIContext.isOpen(java.lang.Object)
public org.eclipse.higgins.idas.api.IEntity getEntity(String entityID,
Iterator consumerSelectionList)
throws org.eclipse.higgins.idas.api.IdASException
consumerEntityTypeToProvider
contains the type mappings performed on the Entity ID, the PDP described by
consumerMTypeToProvider
describes the mappings performed on the attribute types. TODO: Attrs are assumed to always map consistiently, but with generated attrs it's possible that both the generated and the real attribute should be returned if passed in a selection list.
org.eclipse.higgins.idas.api.IdASExceptionIContext.getEntity(java.lang.String,
java.util.Iterator)
public org.eclipse.higgins.idas.api.IEntity getEntity(String entityID)
throws org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.IdASExceptionIContext.getEntity(java.lang.String)
public org.eclipse.higgins.idas.api.IEntity addEntity(URI entityType,
String entityID)
throws org.eclipse.higgins.idas.api.IdASException,
org.eclipse.higgins.idas.api.InvalidTypeException,
org.eclipse.higgins.idas.api.InvalidEntityIDException,
org.eclipse.higgins.idas.api.EntityExistsException
consumerEntityTypeToProvider
contains the type mappings performed on the Subjec type, the PDP described by
consumerEntityIDToProvider
describes the mappings performed on the Entity ID.
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException
org.eclipse.higgins.idas.api.InvalidEntityIDException
org.eclipse.higgins.idas.api.EntityExistsException
public org.eclipse.higgins.idas.api.IEntity addEntity(org.eclipse.higgins.idas.api.IEntity copyFrom)
throws org.eclipse.higgins.idas.api.IdASException,
org.eclipse.higgins.idas.api.EntityExistsException
consumerEntityTypeToProvider
contains the type mappings performed on the Entity type, the PDP described by
consumerEntityIDToProvider
describes the mappings performed on the Entity ID. the PDP described by
consumerATypeToProvider
describes the mappings performed on the attribute types. The PDP described
by
consumerAValueToProvider
describes the value mappings which will occur.
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.EntityExistsException
public String exportData(String filter,
String representationFormat)
throws org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.IdASExceptionIContext.exportData(java.lang.String,
java.lang.String)
public void importData(String filter,
String representationFormat)
throws org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.IdASExceptionIContext.importData(java.lang.String,
java.lang.String)
public String getSchema()
throws org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.IdASExceptionIContext.getSchema()
public void setSchema(String schema)
throws org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.IdASExceptionIContext.setSchema(java.lang.String)
public Iterator getEntities(org.eclipse.higgins.idas.api.IFilter filter)
throws org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.IdASExceptionIContext.getEntities(org.eclipse.higgins.idas.api.IFilter)
public Iterator getEntities(org.eclipse.higgins.idas.api.IFilter filter,
Iterator consumerSelectionList)
throws org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.IdASExceptionIContext.getEntities(org.eclipse.higgins.idas.api.IFilter,
java.util.Iterator)
public boolean verifyEntityAttributes(String entityID,
Iterator attributes)
throws org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.IdASExceptionIContext.verifyEntityAttributes(java.lang.String,
java.util.Iterator)
public org.eclipse.higgins.idas.api.model.IContextModel getContextModel()
throws org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.IdASExceptionIContext.getContextModel()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||