public class DispatchGenerator extends ServiceableGenerator
Modifier and Type | Class and Description |
---|---|
static class |
DispatchGenerator.ResponseHandler
Wrap the handler ignore start and end document, but adding a response tag.
|
Modifier and Type | Field and Description |
---|---|
private DispatchProcessExtensionPoint |
_dispatchProcessExtensionPoint |
private JSONUtils |
_jsonUtils |
private SourceResolver |
_resolver |
private SAXParser |
_saxParser |
manager
objectModel, parameters, resolver, source
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
Constructor and Description |
---|
DispatchGenerator() |
Modifier and Type | Method and Description |
---|---|
private StringBuilder |
_buildQueryParameter(String key,
Object value) |
protected String |
_createUrl(String pluginOrWorkspace,
String relativeUrl,
Map<String,Object> requestParameters)
Create url to call
|
private void |
_dispatching(Map<String,Object> parametersAsMap,
Map<String,Object> contextAsMap) |
private String |
_escape(String value) |
private String |
_getRelativePath(String url) |
private String |
_getRequestBody() |
private String |
_getRequestContext() |
protected String |
_getUrlPrefix(String pluginOrWorkspace)
Get the url prefix
|
private void |
_removeRequestAttributes() |
private void |
_restoreRequestAttributes(Map<String,Object> attributes)
Clean the requests attributes and add those in the map
|
private Map<String,Object> |
_saveRequestAttributes()
Transforms the request attributes into a map and clean the attributes
|
protected void |
_setContextInRequestAttributes(Map<String,Object> contextAsMap)
Set the request attributes from the contextual parameters
|
private Throwable |
_unroll(Throwable initial) |
void |
generate() |
void |
service(ServiceManager smanager) |
protected Map<String,Object> |
transmitAttributes(Map<String,Object> attributes)
Filters attributes that should be transmitted to the dispatched request
|
dispose
recycle, setup
setConsumer, setContentHandler, setLexicalHandler
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setConsumer
private SourceResolver _resolver
private SAXParser _saxParser
private DispatchProcessExtensionPoint _dispatchProcessExtensionPoint
private JSONUtils _jsonUtils
public DispatchGenerator()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
service
in class ServiceableGenerator
ServiceException
public void generate() throws IOException, SAXException, ProcessingException
private String _getRequestBody()
private String _getRequestContext()
private void _dispatching(Map<String,Object> parametersAsMap, Map<String,Object> contextAsMap) throws SAXException
SAXException
protected Map<String,Object> transmitAttributes(Map<String,Object> attributes)
attributes
- The full list of attributesprivate void _restoreRequestAttributes(Map<String,Object> attributes)
attributes
- The attributes to restoreprivate void _removeRequestAttributes()
protected void _setContextInRequestAttributes(Map<String,Object> contextAsMap)
contextAsMap
- The contextual parametersprivate Map<String,Object> _saveRequestAttributes()
protected String _createUrl(String pluginOrWorkspace, String relativeUrl, Map<String,Object> requestParameters)
pluginOrWorkspace
- the plugin or workspace namerelativeUrl
- the relative urlrequestParameters
- the request parameters. Can not be null.private String _getRelativePath(String url)
private StringBuilder _buildQueryParameter(String key, Object value)
protected String _getUrlPrefix(String pluginOrWorkspace)
pluginOrWorkspace
- the plugin or workspace name