Table of Contents

Search

  1. Preface
  2. RulePoint Interfaces
  3. RulePoint Services
  4. Custom Service API
  5. Java Adapter for REST API
  6. RulePoint REST API
  7. Sample XML and JSON Requests and Responses
  8. RulePoint Pluggable Authentication Module
  9. HTTP Request and Response Attributes

Developer Guide

Developer Guide

Create a Marshaller

Create a Marshaller

Use the POST method to create a marshaller for a source.

POST Request in JSON Format

Generate a POST request. For example, the following POST request creates a marshaller in a RulePoint application:
POST http://localhost:8080/rulepoint/api/projects/1/sources Accept: application/json Content-Type: application/json Cookie: JSESSIONID=<VALID SESSION ID>

POST Body in JSON Format

{ "name": "MyFileInputSource", "description": "", "valid": true, "sourceType": "FileSource", "connection": null, "topics": [ { "rel": "self", "href": "api/projects/1/topics/45a09189-2edd-475a-8106-502f7da3115d", "title": "filetopic", "id": "45a09189-2edd-475a-8106-502f7da3115d" } ], "config": { "file": "c:\\temp\\myfile.txt", "mode": "new", "markerId": null, "propertyMetadataMap": null }, "marshaller": { "marshallerClassname": "com.mycompany.MyMarshaller", "marshallerProperties": {} } }

POST Response in JSON Format

Returns the marshaller object and response code 201 created. Returns the error object if an error occurs.
{ "id": "f420484c-3cb9-4e51-9d18-a5db2eba6599", "name": "MyFileInputSource", "self": { "rel": "self", "href": "api/projects/1/sources/f420484c-3cb9-4e51-9d18-a5db2eba6599", "title": "MyFileInputSource", "id": "f420484c-3cb9-4e51-9d18-a5db2eba6599" }, "actions": [ { "rel": "update", "href": "api/projects/1/sources/f420484c-3cb9-4e51-9d18-a5db2eba6599", "type": "PUT", "title": "Edit" }, { "rel": "delete", "href": "api/projects/1/sources/f420484c-3cb9-4e51-9d18-a5db2eba6599", "type": "DELETE", "title": "Delete" }, { "rel": "createSchedule", "href": "api/projects/1/sources/f420484c-3cb9-4e51-9d18-a5db2eba6599/schedules", "type": "POST", "title": "Create Schedule" } ], "acl": { "rel": "acl", "href": "api/projects/1/sources/f420484c-3cb9-4e51-9d18-a5db2eba6599/acl", "title": "acl" }, "owningProject": { "rel": "owningProject", "href": "api/projects/1", "title": "Default Project", "id": "1" }, "type": "sources", "valid": false, "lastModifiedDate": "2013-09-26T16:39:49+05:30", "createDate": "2013-09-26T16:39:49+05:30", "createdBy": "Administrator", "predefined": false, "deployable": true, "deployState": "DRAFT", "force": false, "dtError": "There are no schedules attached to this Source", "sourceType": "FileSource", "sourceTypeDisplayName": "File Source", "schedulable": true, "config": { "file": "c:\\temp\\myfile.txt", "markerId": "", "propertyMetadataMap": null, "mode": "new" }, "topics": [ { "href": "api/projects/1/topics/45a09189-2edd-475a-8106-502f7da3115d", "title": "filetopic", "objectType": "topics", "id": "45a09189-2edd-475a-8106-502f7da3115d" } ], "marshaller": { "marshallerClassname": "com.mycompany.MyMarshaller", "marshallerProperties": {}, "marshallerThreadsafe": false } }
Response Code: 201 Created

POST Request in XML Format

Generate a POST request. For example, the following POST request creates a marshaller in a RulePoint application:
POST http://localhost:8080/rulepoint/api/projects/1/sources Accept: application/xml Content-Type: application/xml Cookie: JSESSIONID=<VALID SESSION ID>

POST Body in XML Format

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <source> <name>jmssource</name> <type>sources</type> <config> <entry> <key>clientAcknowledgeMode</key> <value>AUTO_ACKNOWLEDGE</value> </entry> <entry> <key>clientId</key> <value/> </entry> <entry> <key>destination</key> <value>jmsQueue</value> </entry> <entry> <key>messageSelector</key> <value/> </entry> <entry> <key>subscriptionName</key> <value/> </entry> </config> <connection> <href>api/projects/1/connections/894b2948-ce82-4e0a-9302-267d3482ae25</href> <id>894b2948-ce82-4e0a-9302-267d3482ae25</id> <rel>connection</rel> <title>jmsconnection</title> </connection> <marshaller> <marshallerProperties/> <marshallerThreadsafe>false</marshallerThreadsafe> </marshaller> <schedulable>false</schedulable> <sourceType>JMSSource</sourceType> <sourceTypeDisplayName>JMS Source</sourceTypeDisplayName> <topics> <topic> <href>api/projects/1/topics/6e9c0ae9-fce0-4219-9e58-639af4e79daa</href> <id>6e9c0ae9-fce0-4219-9e58-639af4e79daa</id> <objectType>topics</objectType> <title>jmstopic</title> </topic> </topics> </source>

POST Response in XML Format

Returns the marshaller object and response code. Returns the error object if an error occurs.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <source> <acl> <href>api/projects/1/sources/f420484c-3cb9-4e51-9d18-a5db2eba6599/acl</href> <rel>acl</rel> <title>acl</title> </acl> <actions> <action> <href>api/projects/1/sources/f420484c-3cb9-4e51-9d18-a5db2eba6599</href> <rel>update</rel> <title>Edit</title> <type>PUT</type> </action> <action> <href>api/projects/1/sources/f420484c-3cb9-4e51-9d18-a5db2eba6599</href> <rel>delete</rel> <title>Delete</title> <type>DELETE</type> </action> <action> <href>api/projects/1/sources/f420484c-3cb9-4e51-9d18-a5db2eba6599/schedules</href> <rel>createSchedule</rel> <title>Create Schedule</title> <type>POST</type> </action> </actions> <id>f420484c-3cb9-4e51-9d18-a5db2eba6599</id> <name>MyFileInputSource</name> <owningProject> <href>api/projects/1</href> <id>1</id> <rel>owningProject</rel> <title>Default Project</title> </owningProject> <self> <href>api/projects/1/sources/f420484c-3cb9-4e51-9d18-a5db2eba6599</href> <id>f420484c-3cb9-4e51-9d18-a5db2eba6599</id> <rel>self</rel> <title>MyFileInputSource</title> </self> <createDate/> <createdBy>Administrator</createdBy> <deployState>DRAFT</deployState> <deployable>true</deployable> <description/> <dtError>There are no schedules attached to this Source</dtError> <force>false</force> <lastModifiedDate/> <predefined>false</predefined> <type>sources</type> <valid>false</valid> <config> <entry> <key>file</key> <value>c:\temp\myfile.txt</value> </entry> <entry> <key>markerId</key> <value/> </entry> <entry> <key>propertyMetadataMap</key> </entry> <entry> <key>mode</key> <value>new</value> </entry> </config> <marshaller> <marshallerClassname>com.mycompany.MyMarshaller</marshallerClassname> <marshallerProperties/> <marshallerThreadsafe>false</marshallerThreadsafe> </marshaller> <schedulable>true</schedulable> <sourceType>FileSource</sourceType> <sourceTypeDisplayName>File Source</sourceTypeDisplayName> <topics> <topic> <href>api/projects/1/topics/45a09189-2edd-475a-8106-502f7da3115d</href> <id>45a09189-2edd-475a-8106-502f7da3115d</id> <objectType>topics</objectType> <title>filetopic</title> </topic> </topics> </source>
Response Code: 201 Created
When you create a marshaller for a responder, add the following code in the request body if you use the JSON format:
"marshaller": { "marshallerClassname": "com.mycompany.MyMarshaller", "marshallerProperties":{}}
Add the following code in the request body if you use the XML format:
<marshaller> <marshallerClassname>com.mycompany.MyMarshaller</marshallerClassname> <marshallerProperties/> <marshallerThreadsafe>false</marshallerThreadsafe> </marshaller>

0 COMMENTS

We’d like to hear from you!