When using our skeleton project, Equinox OSGi framework starts its own web server on localhost:8080 and COPAL uses it to provide RESTful interface. You can find more information here on how to configure this web server.
| GET | return current context event types |
| PUT | register new context event type; e.g. <Event name="EHello" xmlns="http://www.sm4all-project.eu/COPAL" /> |
| GET | return context event type with specified name |
| DELETE | unregister context event type with specified name |
| GET | return namespace URI in context event type with specified name |
| PUT | set namespace URI in context event type with specified name; e.g. http://www.sm4all-project.eu/COPAL/EHello> |
| DELETE | remove namespace URI in context event type with specified name |
| GET | return schema in context event type with specified name |
| PUT | set schema in context event type with specified name; e.g. <Schema xmlns="http://www.sm4all-project.eu/COPAL"> <URL address="http://sm4all-project.eu/EHello.xsd/> u007C </Schema> |
| DELETE | remove schema in context event type with specified name |
| GET | return time-to-live in context event type with specified name |
| PUT | set time-to-live in context event type with specified name; e.g. 30000 |
| DELETE | set time-to-live in context event type with specified name to default value |
| GET | return priority in context event type with specified name |
| PUT | set priority in context event type with specified name; e.g. 10 |
| DELETE | set priority in context event type with specified name to default value |
| GET | return current attributes in context event type with specified name |
| PUT | remove old and set new attributes in context event type with specified name; e.g. <Attributes xmlns="http://www.sm4all-project.eu/COPAL"> <Attribute name="test1" value="abc123" /> <Attribute name="test2" value="def456" /> </Attributes> |
| POST | add additional attributes in context event type with specified name; e.g. <Attributes xmlns="http://www.sm4all-project.eu/COPAL"> <Attribute name="test1" value="123abc" /> <Attribute name="test3" value="789ghi" /> </Attributes> |
| DELETE | remove all attributes from context event type with specified name |
| GET | return attribute with specified name in context event type with specified event name |
| DELETE | remove attribute with specified name from context event type with specified event name |
| GET | return current authorizations in context event type with specified name |
| PUT | remove old and set new authorizations in context event type with specified name; e.g. <Authorizations xmlns="http://www.sm4all-project.eu/COPAL"> <Authorization method="hasToken"> <Attribute name="token" value="1" /> </Authorization> </Authorizations> |
| POST | add additional authorizations in context event type with specified name; e.g. <Authorizations xmlns="http://www.sm4all-project.eu/COPAL"> <Authorization method="hasToken"> <Attribute name="token" value="2" /> </Authorization> </Authorizations> |
| DELETE | remove all authorizations from context event type with specified name |
| GET | return authorization with specified name of its method in context event type with specified name |
| DELETE | remove authorization with specified name of its method from context event type with specified name |
| GET | return current actions in context event type with specified name |
| PUT | remove old and set new actions in context event type with specified name; e.g. <Actions xmlns="http://www.sm4all-project.eu/COPAL"> <Action name="audit" /> <Action name="translate" required="false" /> </Actions> |
| POST | add new actions in context event type with specified name; e.g. <Actions xmlns="http://www.sm4all-project.eu/COPAL"> <Action name="log" /> </Actions> |
| DELETE | remove all actions from context event type with specified name |
| GET | return action at specified index in context event type with specified name |
| PUT | remove old and set new action at specified index in context event type with specified name; e.g. <Action name="audit" /> |
| POST | add new action at specified index in context event type with specified name; e.g. <Action name="log" /> |
| DELETE | remove the action at specified index from context event type with specified name |
| GET | return current context publishers registered through REST API |
| PUT | register new context publisher; e.g. <Publisher sourceID="TestSource" xmlns="http://www.sm4all-project.eu/COPAL"> <Events> <Event name="EHello" /> </Events> </Publisher> Additionally the Publisher element can optionally have any of these elements: • ttl attribute - each published event will have its time-to-live set to this value • priority attribute - each published event will have its priority set to this value • Attributes element - each published event will have specified attributes • Authorizations element - each published event will have specified authorizations • Actions element - each published event will have specified actions appended |
| GET | return context publisher with specified source ID (works only for context publishers registered through REST API) |
| POST | publish specified event using context publisher with specified source ID (works only for context publishers registered through REST API); e.g. <EHello /> |
| DELETE | unregister context publisher with specified source ID (works only for context publishers registered through REST API) |
| GET | return all published types in context publisher with specified source ID (works only for context publishers registered through REST API) |
| PUT | remove old and set new published types in context publisher with specified source ID (works only for context publishers registered through REST API); e.g. <Events xmlns="http://www.sm4all-project.eu/COPAL"> <Event name="EHello" /> <Event name="ETemperature" /> </Events> |
| POST | add additional published types in context publisher with specified source ID (works only for context publishers registered through REST API); e.g. <Events xmlns="http://www.sm4all-project.eu/COPAL"> <Event name="ETemperature" /> <Event name="EMessage" /> </Events> |
| DELETE | remove all published types from context publisher with specified source ID (works only for context publishers registered through REST API) |
| DELETE | remove published type with specified name from context publisher with specified source ID (works only for context publisher registered through REST API) |
| GET | return time-to-live in context publisher with specified source ID (works only for context publishers registered through REST API) |
| PUT | set time-to-live in context publisher with specified source ID (works only for context publishers registered through REST API); e.g. 30000 |
| DELETE | unset time-to-live in context publisher with specified source ID (works only for context publishers registered through REST API) |
| GET | return priority in context publisher with specified source ID (works only for context publishers registered through REST API) |
| PUT | set priority in context publisher with specified source ID (works only for context publishers registered through REST API); e.g. 10 |
| DELETE | unset priority in context publisher with specified source ID (works only for context publishers registered through REST API) |
| GET | return current attributes in context publisher with specified source ID (works only for context publishers registered through REST API) |
| PUT | remove old and set new attributes in context publisher with specified source ID (works only for context publishers registered through REST API); e.g. <Attributes xmlns="http://www.sm4all-project.eu/COPAL"> <Attribute name="test1" value="abc123" /> <Attribute name="test2" value="def456" /> </Attributes> |
| POST | add additional attributes in context publisher with specified source ID (works only for context publishers registered through REST API); e.g. <Attributes xmlns="http://www.sm4all-project.eu/COPAL"> <Attribute name="test1" value="123abc" /> <Attribute name="test3" value="789ghi" /> </Attributes> |
| DELETE | remove all attributes from context publisher with specified source ID (works only for context publishers registered through REST API) |
| GET | return attribute with specified name in context publisher with specified source ID (works only for context publishers registered through REST API) |
| DELETE | remove attribute with specified name from context publisher with specified source ID (works only for context publishers registered through REST API) |
| GET | return current authorizations in context publisher with specified source ID (works only for context publishers registered through REST API) |
| PUT | remove old and set new authorizations in context publisher with specified source ID (works only for context publishers registered through REST API); e.g. <Authorizations xmlns="http://www.sm4all-project.eu/COPAL"> <Authorization method="hasToken"> <Attribute name="token" value="1" /> </Authorization> </Authorizations> |
| POST | add additional authorizations in context publisher with specified source ID (works only for context publishers registered through REST API); e.g. <Authorizations xmlns="http://www.sm4all-project.eu/COPAL"> <Authorization method="hasToken"> <Attribute name="token" value="2" /> </Authorization> </Authorizations> |
| DELETE | remove all authorizations from context publisher with specified source ID (works only for context publishers registered through REST API) |
| GET | return authorization with specified name of its method in context publisher with specified source ID (works only for context publishers registered through REST API) |
| DELETE | remove authorization with specified name of its method from context publisher with specified source ID (works only for context publishers registered through REST API) |
| GET | return current actions in context publisher with specified source ID (works only for context publishers registered through REST API) |
| PUT | remove old and set new actions in context publisher with specified source ID (works only for context publishers registered through REST API); e.g. <Actions xmlns="http://www.sm4all-project.eu/COPAL"> <Action name="audit" /> <Action name="translate" required="false" /> </Actions> |
| POST | add additional actions in context publisher with specified source ID (works only for context publishers registered through REST API); e.g. <Actions xmlns="http://www.sm4all-project.eu/COPAL"> <Action name="log" /> </Actions> |
| DELETE | remove all actions from context publisher with specified source ID (works only for context publishers registered through REST API) |
| GET | return current context processors registered through REST API |
| PUT | register new context processors that will POST all received events to specified URL and return POST result as value of processing; e.g. <Processor name="TestProcessor" url="http://www.example.org/Test" xmlns="http://www.sm4all-project.eu/COPAL"> <Actions <Action name="audit" input="EHello"> <Output> <Event name="EHello" /> </Output> </Action> </Actions> </Processor> |
| GET | return context processor with specified name (works only for context processors registered through REST API) |
| DELETE | unregister context processor with specified name (works only for context processors registered through REST API) |
| GET | return URL in context processor with specified name (works only for context processors registered through REST API) |
| PUT | set URL in context processor with specified name (works only for context processors registered through REST API); e.g. http://www.example.org/Test |
| GET | return current actions in context processor with specified name (works only for context processors registered through REST API) |
| PUT | remove old and set new actions in context processor with specified name (works only for context processors registered through REST API); e.g. <Actions <Action name="translate" input="EHello"> <Output> <Event name="EHello" /> </Output> </Action> </Actions> |
| POST | add additional actions in context processor with specified name (works only for context processors registered through REST API); e.g. <Actions <Action name="log" input="EHello"> <Output> <Event name="EHello" /> </Output> </Action> </Actions> |
| DELETE | remove all actions from context processor with specified name (works only for context processors registered through REST API) |
| GET | return current context queries |
| PUT | create new context query; e.g. <Query name="TestQuery" event="EHello" criteria="copal:SourceID = 'TestSource'" xmlns="http://www.sm4all-project.eu/COPAL" /> |
| GET | return context query with specified name |
| DELETE | destroy context query with specified name |
| GET | return name of listened events in context query with specified name |
| GET | return criteria in context query with specified name |
| GET | return current context listeners registered through REST API and that are registered to context query with specified name |
| PUT | register new context listener with specified context query that will POST all received events to specified URL; e.g. <Listener name="TestListener" url="http://www.example.org/Test" xmlns="http://www.sm4all-project.eu/COPAL" /> |
| GET | return context listener with specified name registered to context query with specified query name (works only for context listeners registered through REST API) |
| DELETE | unregister context listener with specified name from context query with specified query name (works only for context listeners registered through REST API) |
| GET | return URL in listener with specified name that is registered to context query with specified query name (works only for context listeners registered through REST API) |
| PUT | set URL in listener with specified name that is registered to context query with specified query name (works only for context listeners registered through REST API); e.g. http://www.example.org/Test |