org.filteredpush.rdf.handler.ws
Class RdfBeanHandlerWS

java.lang.Object
  extended by org.filteredpush.rdf.handler.ws.RdfBeanHandlerWS

public class RdfBeanHandlerWS
extends java.lang.Object

The webservice that exposes the RDFHandler classes for use by clients written in languages other than Java. The handlers can be configured via the generator properties config file.

Author:
lowery

Constructor Summary
RdfBeanHandlerWS()
          The constructor preconfigures handlers for different model descriptor xml files from the generator properties file.
 
Method Summary
 java.lang.String createAnnotationJSON(java.lang.String handlerName, java.lang.String jsonStr)
          This web method will take model objects serialized as json and hands them off to the handler (given by path param handlerName) defined in the generator.properties file.
 java.lang.String createAnnotationXML(java.lang.String handlerName, java.lang.String xml)
          When invoked with a handlerName that corresponds to one definied in the configuration, RdfBeanHandler is invoked with the appropriate descriptor xml to generate an rdf/xml serialization of the incoming xml (unmarshaled using JaxB).
 java.lang.String generateSchema(java.lang.String handlerName)
          Will return the xml schema associated with the model objects processed by the handler.
 java.lang.String listHandlers()
           
 java.lang.String testHandler(java.lang.String handlerName)
          This web method responds to a get request and uses ExampleAnnotationRDF to test the webservice and output insert determination rdf/xml.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RdfBeanHandlerWS

public RdfBeanHandlerWS()
                 throws java.lang.Exception
The constructor preconfigures handlers for different model descriptor xml files from the generator properties file.

Throws:
java.lang.Exception
Method Detail

listHandlers

public java.lang.String listHandlers()

createAnnotationXML

public java.lang.String createAnnotationXML(java.lang.String handlerName,
                                            java.lang.String xml)
                                     throws java.lang.Exception
When invoked with a handlerName that corresponds to one definied in the configuration, RdfBeanHandler is invoked with the appropriate descriptor xml to generate an rdf/xml serialization of the incoming xml (unmarshaled using JaxB).

Parameters:
handlerName -
xml -
Returns:
xml
Throws:
java.lang.Exception

createAnnotationJSON

public java.lang.String createAnnotationJSON(java.lang.String handlerName,
                                             java.lang.String jsonStr)
                                      throws java.lang.Exception
This web method will take model objects serialized as json and hands them off to the handler (given by path param handlerName) defined in the generator.properties file.

Parameters:
handlerName -
jsonStr -
Returns:
Throws:
java.lang.Exception

testHandler

public java.lang.String testHandler(java.lang.String handlerName)
                             throws java.lang.IllegalArgumentException,
                                    java.lang.IllegalAccessException,
                                    java.lang.reflect.InvocationTargetException,
                                    java.lang.Exception
This web method responds to a get request and uses ExampleAnnotationRDF to test the webservice and output insert determination rdf/xml. Can be invoked via HTTP get. Will return a test rdf/xml serialization to indicate that the webservice is functioning properly.

Parameters:
handlerName -
Returns:
example rdf/xml as a String
Throws:
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.Exception

generateSchema

public java.lang.String generateSchema(java.lang.String handlerName)
                                throws java.lang.IllegalArgumentException,
                                       java.lang.IllegalAccessException,
                                       java.lang.reflect.InvocationTargetException,
                                       java.lang.Exception
Will return the xml schema associated with the model objects processed by the handler. A handler is given by name (defined in the xml model descriptor) and the appropriate model is used with jaxb to generate a schema.

Parameters:
handlerName -
Returns:
xml schema
Throws:
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.Exception