Skip Headers
Oracle® Coherence Client Guide
Release 3.7.1

Part Number E22839-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

A REST Configuration Elements

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:

A.1 REST Configuration File

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:

  • The schema located in the coherence.jar library is always used at run time even if the xsi:schemaLocation attribute references the Web URL.

  • The xsi:schemaLocation attribute can be omitted to disable schema validation.

  • When deploying Coherence into environments where the default character set is EBCDIC rather than ASCII, ensure that the deployment descriptor file is in ASCII format and is deployed into its run-time environment in the binary format.


Element Index

Table A-1 lists all non-terminal REST configuration elements.

Table A-1 REST Configuration Elements

Element Used In

aggregator

aggregators

aggregators

rest

marshaller

resource

processor

processors

processors

rest

resource

resources

resources

rest

rest

root element



aggregator

Used in: aggregators

Description

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.

Elements

Table A-2 describes the subelements of the aggregator element.

Table A-2 aggregator Subelements

Element Required/
Optional
Description

<name>

Required

Specifies a name to be used in a RESTful URL that is bound to an aggregator class or aggregator factory class.

<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 com.tangosol.util.EntryAggregator or com.tangosol.coherence.rest.util.aggregator.AggregatorFactory interfaces, respectively.



aggregators

Used in: rest

Description

The aggregators element contains any number of custom aggregator definitions.

Elements

Table A-3 describes the subelements of the aggregators element.

Table A-3 aggregators Subelements

Element Required/
Optional
Description

<aggregator>

Required

Specifies a single binding between a name and an aggregator class or aggregator factory class.



marshaller

Used in: resource

Description

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.

Elements

Table A-4 describes the subelements of the marshaller element.

Table A-4 marshaller Subelements

Element Required/
Optional
Description

<media-type>

Required

Specifies the name of the medium that is used to for marshalling. Coherence provides default implementations for XML and JSON data output.

<class-name>

Required

Specifies the fully qualified name of a custom class that implements the com.tangosol.coherence.rest.io.Marshaller interface. The implementation is used to marshall/unmarshall cache entry values that are stored in the cache. Marshallers are configured for each object type and media type.



processor

Used in: processors

Description

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.

Elements

Table A-5 describes the subelements of the processor element.

Table A-5 processor Subelements

Element Required/
Optional
Description

<name>

Required

Specifies a name to be used in a RESTful URL that is bound to a processor factory class.

<class-name>

Required

Specifies the fully qualified name of a custom processor factory class that is bound to a name. The class must implement the com.tangosol.coherence.rest.util.processor.ProcessorFactory interface.



processors

Used in: rest

Description

The processors element contains any number of custom processor definitions.

Elements

Table A-6 describes the subelements of the processors element.

Table A-6 processors Subelements

Element Required/
Optional
Description

<processor>

Required

Specifies a single binding between a name and a processor factory class.



resource

Used in: resources

Description

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.

Elements

Table A-7 describes the subelements of the resource element.

Table A-7 resource Subelements

Element Required/
Optional
Description

<cache-name>

Required

Specifies the name of the cache exposed by this resource. The cache must be defined in the cache configuration file.

<alias>

Optional

Specifies an alias for the <cache-name> element when the name is not ideal for the RESTful URL path segment. The value defaults to the value of the <cache-name> element if a value is not specified.

<key-class>

Required

Specifies the type of the entry keys stored in this cache.

<value-class>

Required

Specifies the type of the entry values stored in this cache.

<key-converter>

Optional

Specifies the fully qualified name of a class that implements the com.tangosol.coherence.rest.KeyConverter interface. The class is used to convert cache entry keys to string and string representations of the keys that are used in the RESTful URL into an appropriate object instance that can be used to access cache entries. The com.tangosol.coherence.rest.DefaultKeyConverter class is used by default if no value is provided. The default class offers reasonable to string and from string conversions for Java primitives, dates, and UUIDs. See Oracle Coherence Java API Reference for details.

<marshaller>

Optional

Specifies the fully qualified name of a class that implements the com.tangosol.coherence.rest.io.Marshaller interface. The class is used to marshall/unmarshall cache entry values that are stored in a cache. Coherence provides default implementations for XML and JSON data output.



resources

Used in: rest

Description

The resources element contains any number of resource definitions. A resource definition provides the metadata that is used to marshall and unmarshall cache entries.

Elements

Table A-8 describes the subelements of the resources element.

Table A-8 resources Subelements

Element Required/
Optional
Description

<resource>

Required

Specifies a single binding between a cache name and cache entry key and value classes.



rest

root element

Description

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.

Elements

Table A-9 describes the subelements of each rest element.

Table A-9 rest Subelements

Element Required/
Optional
Description

<resources>

Optional

Specifies any number of resource definitions that provide the metadata that is used to marshall and unmarshall cache entries.

<processors>

Optional

Specifies any number of custom processor definitions that are used to process data in a cache.

<aggregators>

Optional

Specifies any number of custom aggregator definitions that are used to aggregate data in a cache.