This appendix provides a detailed reference of the REST configuration deployment descriptor and includes a brief overview of the descriptor.
The following sections are included in this appendix:
The REST configuration deployment descriptor specifies the configuration for the REST implementation. The default name of the descriptor is coherence-rest-config.xml and must be found on the classpath. The name can be overridden using the tangosol.coherence.rest.config system property. For example:
-Dtangosol.coherence.rest.config=MyConfig.xml
The REST configuration deployment descriptor schema is defined in the coherence-rest-config.xsd file. The XSD file is located in the root of the coherence.jar library and at the following Web URL:
http://xmlns.oracle.com/coherence/coherence-rest-config/1.0/coherence-rest-config.xsd
The <rest> element is the root element of the configuration file and typically includes an XSD and Coherence namespace reference and the location of the coherence-rest-config.xsd file. For example:
<?xml version='1.0'?> <cache-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/coherence/coherence-rest-config" xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-rest-config coherence-rest-config.xsd">
|
Notes:
|
Table A-1 lists all non-terminal REST configuration elements.
Used in: aggregators
The aggregator element is used to define custom aggregators that are used to aggregate data in a cache. Each aggregator element must contain a single binding between a name and an aggregator class or aggregator factory class.
Table A-2 describes the subelements of the aggregator element.
Table A-2 aggregator Subelements
| Element | Required/ Optional |
Description |
|---|---|---|
|
< |
Required |
Specifies a name to be used in a RESTful URL that is bound to an aggregator class or aggregator factory class. |
|
< |
Required |
Specifies the fully qualified name of a custom aggregator class or custom aggregator factory class that is bound to a name. The class must implement the |
Used in: rest
The aggregators element contains any number of custom aggregator definitions.
Table A-3 describes the subelements of the aggregators element.
Table A-3 aggregators Subelements
| Element | Required/ Optional |
Description |
|---|---|---|
|
Required |
Specifies a single binding between a name and an aggregator class or aggregator factory class. |
Used in: resource
The marshaller element contains bindings between cache entry key/value classes and a marshaller class that is used to marshall and unmarshall instances of those classes.
Table A-4 describes the subelements of the marshaller element.
Table A-4 marshaller Subelements
| Element | Required/ Optional |
Description |
|---|---|---|
|
|
Required |
Specifies the name of the medium that is used to for marshalling. Coherence provides default implementations for XML and JSON data output. |
|
|
Required |
Specifies the fully qualified name of a custom class that implements the |
Used in: processors
The processor element is used to define custom entry processors that are used to process data in a cache. Each processor element must contain a single binding between a name and the processor factory class.
Table A-5 describes the subelements of the processor element.
Table A-5 processor Subelements
| Element | Required/ Optional |
Description |
|---|---|---|
|
|
Required |
Specifies a name to be used in a RESTful URL that is bound to a processor factory class. |
|
|
Required |
Specifies the fully qualified name of a custom processor factory class that is bound to a name. The class must implement the |
Used in: rest
The processors element contains any number of custom processor definitions.
Table A-6 describes the subelements of the processors element.
Table A-6 processors Subelements
| Element | Required/ Optional |
Description |
|---|---|---|
|
Required |
Specifies a single binding between a name and a processor factory class. |
Used in: resources
The resource element provides the metadata that is used to marshall and unmarshall cache entries. The metadata includes a single binding between a cache name and cache entry key and value classes.
Table A-7 describes the subelements of the resource element.
Table A-7 resource Subelements
| Element | Required/ Optional |
Description |
|---|---|---|
|
|
Required |
Specifies the name of the cache exposed by this resource. The cache must be defined in the cache configuration file. |
|
|
Optional |
Specifies an alias for the |
|
|
Required |
Specifies the type of the entry keys stored in this cache. |
|
|
Required |
Specifies the type of the entry values stored in this cache. |
|
|
Optional |
Specifies the fully qualified name of a class that implements the |
|
Optional |
Specifies the fully qualified name of a class that implements the |
Used in: rest
The resources element contains any number of resource definitions. A resource definition provides the metadata that is used to marshall and unmarshall cache entries.
Table A-8 describes the subelements of the resources element.
Table A-8 resources Subelements
| Element | Required/ Optional |
Description |
|---|---|---|
|
|
Required |
Specifies a single binding between a cache name and cache entry key and value classes. |
root element
The rest element is the root element of the coherence-rest-config.xml file which is used to configure the Coherence REST implementation. The implementation uses RESTful Web services to allow remote clients to access data in the cluster over HTTP and does not require the use of POF serialization.
Table A-9 describes the subelements of each rest element.
| Element | Required/ Optional |
Description |
|---|---|---|
|
Optional |
Specifies any number of resource definitions that provide the metadata that is used to marshall and unmarshall cache entries. |
|
|
Optional |
Specifies any number of custom processor definitions that are used to process data in a cache. |
|
|
Optional |
Specifies any number of custom aggregator definitions that are used to aggregate data in a cache. |