org.eclipse.higgins.idas.cp.jena2.impl
Class Context

java.lang.Object
  extended byorg.eclipse.higgins.idas.cp.jena2.impl.Context
All Implemented Interfaces:
org.eclipse.higgins.idas.api.IContext, org.eclipse.higgins.idas.api.IHasAttributes, IJenaContext
Direct Known Subclasses:
FileContext, JDBCContext

public abstract class Context
extends Object
implements IJenaContext


Constructor Summary
Context()
           
 
Method Summary
 org.eclipse.higgins.idas.api.IAttribute addAttribute(org.eclipse.higgins.idas.api.IAttribute copyFrom)
           
 org.eclipse.higgins.idas.api.IAttribute addAttribute(URI attrID)
           
 org.eclipse.higgins.idas.api.IEntity addEntity(org.eclipse.higgins.idas.api.IEntity copyFrom)
           
 org.eclipse.higgins.idas.api.IEntity addEntity(URI type, String entityID)
           
 void applyUpdates()
           
 org.eclipse.higgins.idas.api.IAttribute buildAttribute(URI attrID)
           
 org.eclipse.higgins.idas.api.IFilterAttributeAssertion buildAttributeAssertion()
           
 org.eclipse.higgins.idas.api.IAuthNAttributesMaterials buildAuthNAttributesMaterials()
           
 org.eclipse.higgins.idas.api.IComplexAttrValue buildComplexAttrValue(URI type)
           
 org.eclipse.higgins.idas.api.IFilterEntityIDAssertion buildEntityIDAssertion()
           
 org.eclipse.higgins.idas.api.IFilterEntityTypeAssertion buildEntityTypeAssertion()
           
 org.eclipse.higgins.idas.api.IFilter buildFilter()
           
 org.eclipse.higgins.idas.api.ISimpleAttrValue buildSimpleAttrValue(URI type, Object value)
           
 void close()
           
 boolean equals(org.eclipse.higgins.idas.api.IHasAttributes attributes)
           
 String exportData(String filter, String representationFormat)
           
 org.eclipse.higgins.idas.api.IAttribute getAttribute(URI attrID)
           
 Iterator getAttributes()
           
 URI getContextID()
           
 org.eclipse.higgins.idas.api.model.IContextModel getContextModel()
           
 com.hp.hpl.jena.ontology.DatatypeProperty getDatatypeProperty(String uri)
           
 Iterator getEntities(org.eclipse.higgins.idas.api.IFilter filter)
           
 Iterator getEntities(org.eclipse.higgins.idas.api.IFilter filter, Iterator attrSelectionList)
           
 Iterator getEntities(org.eclipse.higgins.idas.api.IFilter filter, Iterator attrSelectionList, org.eclipse.higgins.idas.api.IExtension[] extensions)
           
 org.eclipse.higgins.idas.api.IEntity getEntity(String cuid)
           
 org.eclipse.higgins.idas.api.IEntity getEntity(String cuid, Iterator attrSelectionList)
           
 com.hp.hpl.jena.ontology.OntModel getModel()
          return jena ontology model of the context
 com.hp.hpl.jena.ontology.OntModel getModelNoException()
           
 ArrayList getNodeIndividuals(org.eclipse.higgins.idas.api.IFilter filter, boolean ignoreUserToken)
           
 String getNS()
          return namespace of context
 com.hp.hpl.jena.ontology.ObjectProperty getObjectProperty(String uri)
           
 com.hp.hpl.jena.ontology.OntClass getOntClass(String uri)
           
 com.hp.hpl.jena.ontology.OntProperty getOntProperty(String uri)
           
 String getSchema()
           
 String getSchemaURI()
           
 org.eclipse.higgins.idas.api.ISingleValuedAttribute getSingleValuedAttribute(URI attrID)
           
 IUserAccount getUserAccount()
           
 void importData(String filter, String representationFormat)
           
 void init(Properties props)
           
 boolean isOpen(Object identity)
           
 String open(Object authentication)
           
 String open(Object authentication, org.eclipse.higgins.idas.api.IExtension[] extensions)
           
 void registerChangedSubject(Entity subj)
          Register the subject which was changed and should be validated (optionally) before saving
 void removeAttribute(URI attrID)
           
 void removeAttributeValue(org.eclipse.higgins.idas.api.IAttribute attr)
           
 void removeAttributeValue(URI attrID, Object value)
           
 void removeSubject(String cuid)
           
 void reopen()
           
 void setComponentSetting(String key, Object value)
           
 void setComponentSetting(String key, Object value, boolean failUnsupported)
           
 void setContextModel(org.eclipse.higgins.idas.api.model.IContextModel model)
           
 void setSchema(String schema)
           
 void setValidationMode(boolean performValidation)
           
 void unregisterChangedSubject(Entity subj)
          When some Entity was removed it should be also removed from changed subjects list to prevent validation of non-existent subject
 boolean verifyEntityAttributes(String subjectID, Iterator attributes)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.higgins.idas.cp.jena2.IJenaContext
begin, commit, isTransactionSupported, rollback
 
Methods inherited from interface org.eclipse.higgins.idas.api.IContext
cancelUpdates
 

Constructor Detail

Context

public Context()
Method Detail

addEntity

public org.eclipse.higgins.idas.api.IEntity addEntity(URI type,
                                                      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
Specified by:
addEntity in interface org.eclipse.higgins.idas.api.IContext
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

addEntity

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
Specified by:
addEntity in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.EntityExistsException

buildAttribute

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

buildAttributeAssertion

public org.eclipse.higgins.idas.api.IFilterAttributeAssertion buildAttributeAssertion()
                                                                               throws org.eclipse.higgins.idas.api.IdASException
Specified by:
buildAttributeAssertion in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

buildAuthNAttributesMaterials

public org.eclipse.higgins.idas.api.IAuthNAttributesMaterials buildAuthNAttributesMaterials()
                                                                                     throws org.eclipse.higgins.idas.api.IdASException
Specified by:
buildAuthNAttributesMaterials in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

buildEntityIDAssertion

public org.eclipse.higgins.idas.api.IFilterEntityIDAssertion buildEntityIDAssertion()
                                                                             throws org.eclipse.higgins.idas.api.IdASException
Specified by:
buildEntityIDAssertion in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

buildComplexAttrValue

public org.eclipse.higgins.idas.api.IComplexAttrValue buildComplexAttrValue(URI type)
                                                                     throws org.eclipse.higgins.idas.api.IdASException,
                                                                            org.eclipse.higgins.idas.api.InvalidTypeException
Specified by:
buildComplexAttrValue in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException

buildFilter

public org.eclipse.higgins.idas.api.IFilter buildFilter()
                                                 throws org.eclipse.higgins.idas.api.IdASException
Specified by:
buildFilter in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

buildSimpleAttrValue

public org.eclipse.higgins.idas.api.ISimpleAttrValue buildSimpleAttrValue(URI type,
                                                                          Object value)
                                                                   throws org.eclipse.higgins.idas.api.IdASException,
                                                                          org.eclipse.higgins.idas.api.InvalidTypeException
Specified by:
buildSimpleAttrValue in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException

buildEntityTypeAssertion

public org.eclipse.higgins.idas.api.IFilterEntityTypeAssertion buildEntityTypeAssertion()
                                                                                 throws org.eclipse.higgins.idas.api.IdASException
Specified by:
buildEntityTypeAssertion in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

close

public void close()
           throws org.eclipse.higgins.idas.api.IdASException
Specified by:
close in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

exportData

public String exportData(String filter,
                         String representationFormat)
                  throws org.eclipse.higgins.idas.api.IdASException
Specified by:
exportData in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

getContextModel

public org.eclipse.higgins.idas.api.model.IContextModel getContextModel()
                                                                 throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getContextModel in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

setContextModel

public void setContextModel(org.eclipse.higgins.idas.api.model.IContextModel model)
                     throws org.eclipse.higgins.idas.api.IdASException
Throws:
org.eclipse.higgins.idas.api.IdASException

getContextID

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

getSchema

public String getSchema()
                 throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getSchema in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

getEntity

public org.eclipse.higgins.idas.api.IEntity getEntity(String cuid)
                                               throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getEntity in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

getEntity

public org.eclipse.higgins.idas.api.IEntity getEntity(String cuid,
                                                      Iterator attrSelectionList)
                                               throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getEntity in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

getEntities

public Iterator getEntities(org.eclipse.higgins.idas.api.IFilter filter)
                     throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getEntities in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

getNodeIndividuals

public ArrayList getNodeIndividuals(org.eclipse.higgins.idas.api.IFilter filter,
                                    boolean ignoreUserToken)
                             throws org.eclipse.higgins.idas.api.IdASException
Throws:
org.eclipse.higgins.idas.api.IdASException

getEntities

public Iterator getEntities(org.eclipse.higgins.idas.api.IFilter filter,
                            Iterator attrSelectionList)
                     throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getEntities in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

getEntities

public Iterator getEntities(org.eclipse.higgins.idas.api.IFilter filter,
                            Iterator attrSelectionList,
                            org.eclipse.higgins.idas.api.IExtension[] extensions)
                     throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getEntities in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

importData

public void importData(String filter,
                       String representationFormat)
                throws org.eclipse.higgins.idas.api.IdASException
Specified by:
importData in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

isOpen

public boolean isOpen(Object identity)
               throws org.eclipse.higgins.idas.api.IdASException
Specified by:
isOpen in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

open

public String open(Object authentication,
                   org.eclipse.higgins.idas.api.IExtension[] extensions)
            throws org.eclipse.higgins.idas.api.IdASException,
                   org.eclipse.higgins.idas.api.ContextOpenException
Specified by:
open in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.ContextOpenException

open

public String open(Object authentication)
            throws org.eclipse.higgins.idas.api.IdASException,
                   org.eclipse.higgins.idas.api.ContextOpenException
Specified by:
open in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.ContextOpenException

reopen

public void reopen()
            throws org.eclipse.higgins.idas.api.IdASException,
                   org.eclipse.higgins.idas.api.AuthenticationException
Specified by:
reopen in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.AuthenticationException

removeSubject

public void removeSubject(String cuid)
                   throws org.eclipse.higgins.idas.api.IdASException
Throws:
org.eclipse.higgins.idas.api.IdASException

setSchema

public void setSchema(String schema)
               throws org.eclipse.higgins.idas.api.IdASException
Specified by:
setSchema in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

verifyEntityAttributes

public boolean verifyEntityAttributes(String subjectID,
                                      Iterator attributes)
                               throws org.eclipse.higgins.idas.api.IdASException
Specified by:
verifyEntityAttributes in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

getModel

public com.hp.hpl.jena.ontology.OntModel getModel()
                                           throws org.eclipse.higgins.idas.api.IdASException
Description copied from interface: IJenaContext
return jena ontology model of the context

Specified by:
getModel in interface IJenaContext
Throws:
org.eclipse.higgins.idas.api.IdASException - If the context is not open or its ontology model is not initialized

getModelNoException

public com.hp.hpl.jena.ontology.OntModel getModelNoException()
Returns:

getNS

public String getNS()
Description copied from interface: IJenaContext
return namespace of context

Specified by:
getNS in interface IJenaContext

getUserAccount

public IUserAccount getUserAccount()
Returns:

getDatatypeProperty

public com.hp.hpl.jena.ontology.DatatypeProperty getDatatypeProperty(String uri)
                                                              throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getDatatypeProperty in interface IJenaContext
Parameters:
uri -
Returns:
Throws:
org.eclipse.higgins.idas.api.IdASException

getObjectProperty

public com.hp.hpl.jena.ontology.ObjectProperty getObjectProperty(String uri)
                                                          throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getObjectProperty in interface IJenaContext
Parameters:
uri -
Returns:
Throws:
org.eclipse.higgins.idas.api.IdASException

getOntProperty

public com.hp.hpl.jena.ontology.OntProperty getOntProperty(String uri)
                                                    throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getOntProperty in interface IJenaContext
Parameters:
uri -
Returns:
Throws:
org.eclipse.higgins.idas.api.IdASException

getOntClass

public com.hp.hpl.jena.ontology.OntClass getOntClass(String uri)
                                              throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getOntClass in interface IJenaContext
Parameters:
uri -
Returns:
Throws:
org.eclipse.higgins.idas.api.IdASException

getSchemaURI

public String getSchemaURI()
                    throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getSchemaURI in interface IJenaContext
Returns:
schema URI that will be used as imported ontology
Throws:
org.eclipse.higgins.idas.api.IdASException

init

public void init(Properties props)
          throws org.eclipse.higgins.idas.api.IdASException
Specified by:
init in interface IJenaContext
Parameters:
props -
Throws:
org.eclipse.higgins.idas.api.IdASException

applyUpdates

public void applyUpdates()
                  throws org.eclipse.higgins.idas.api.IdASException
Specified by:
applyUpdates in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

registerChangedSubject

public void registerChangedSubject(Entity subj)
Register the subject which was changed and should be validated (optionally) before saving

Specified by:
registerChangedSubject in interface IJenaContext
Parameters:
subj -
Throws:
org.eclipse.higgins.idas.api.IdASException

unregisterChangedSubject

public void unregisterChangedSubject(Entity subj)
Description copied from interface: IJenaContext
When some Entity was removed it should be also removed from changed subjects list to prevent validation of non-existent subject

Specified by:
unregisterChangedSubject in interface IJenaContext
Parameters:
subj -

setValidationMode

public void setValidationMode(boolean performValidation)
Specified by:
setValidationMode in interface IJenaContext
Parameters:
performValidation - if true then all changed subjects should be validated before saving of the context. Default value is true. In case of JDBC Context, if RDBMS does not support transactions, validation will not be performed

addAttribute

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

addAttribute

public org.eclipse.higgins.idas.api.IAttribute addAttribute(org.eclipse.higgins.idas.api.IAttribute copyFrom)
                                                     throws org.eclipse.higgins.idas.api.IdASException
Specified by:
addAttribute in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException

equals

public boolean equals(org.eclipse.higgins.idas.api.IHasAttributes attributes)
               throws org.eclipse.higgins.idas.api.IdASException
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

setComponentSetting

public void setComponentSetting(String key,
                                Object value,
                                boolean failUnsupported)
                         throws org.eclipse.higgins.idas.api.IdASException
Specified by:
setComponentSetting in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

setComponentSetting

public void setComponentSetting(String key,
                                Object value)
                         throws org.eclipse.higgins.idas.api.IdASException
Specified by:
setComponentSetting in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException