java.lang.Object
com.mjh.switchrmi.protocol.xmlrpc.XmlRpcProtocol
- All Implemented Interfaces:
- com.mjh.switchrmi.RmiProtocol
- public class XmlRpcProtocol
- extends java.lang.Object
- implements com.mjh.switchrmi.RmiProtocol
|
Method Summary |
private java.util.List |
convertArrayToObject(org.w3c.dom.Node node)
|
private byte[] |
convertBase64ToObject(org.w3c.dom.Node node)
|
private java.util.Date |
convertDateTimeToObject(org.w3c.dom.Node node)
|
private org.w3c.dom.Node |
convertObjectToArray(java.util.List list,
org.w3c.dom.Document doc)
|
private org.w3c.dom.Node |
convertObjectToBase64Value(byte[] bytes,
org.w3c.dom.Document doc)
|
private org.w3c.dom.Node |
convertObjectToDateTimeValue(java.util.Date date,
org.w3c.dom.Document doc)
|
private org.w3c.dom.Node |
convertObjectToStruct(java.util.Map map,
org.w3c.dom.Document doc)
|
private org.w3c.dom.Node |
convertObjectToXmlRpcValue(java.lang.Object object,
java.lang.String type,
org.w3c.dom.Document doc)
|
private java.lang.String |
convertObjectTypeToXmlRpcType(java.lang.String javaType)
|
private java.lang.Object |
convertSimpleToObject(org.w3c.dom.Element element)
|
private java.util.Map |
convertStructToObject(org.w3c.dom.Node node)
|
private java.lang.Object |
convertXmlRpcValueToObject(org.w3c.dom.Node node)
|
com.mjh.switchrmi.RmiRequest |
createRequest(java.lang.reflect.Method method,
java.lang.Object[] args,
com.mjh.switchrmi.RmiContext context)
|
com.mjh.switchrmi.RmiResponse |
createResponse(com.mjh.switchrmi.RmiRequest request,
java.lang.Object result,
com.mjh.switchrmi.RmiContext context)
|
private java.lang.String[] |
extractArgumentTypesFromParams(java.util.List values)
|
private java.lang.Object[] |
extractArgumentValuesFromParams(java.util.List values)
|
private java.util.List |
extractValueNodesFromParams(org.w3c.dom.NodeList nodes)
|
java.lang.String |
getMimeType()
|
java.lang.String |
getName()
|
private static org.w3c.dom.Document |
parse(java.lang.String resourceName,
javax.xml.parsers.DocumentBuilder builder)
|
private java.lang.Object |
readFault(org.w3c.dom.Document doc)
|
com.mjh.switchrmi.RmiRequest |
readRequest(com.mjh.switchrmi.RmiContext context)
|
com.mjh.switchrmi.RmiResponse |
readResponse(com.mjh.switchrmi.RmiContext context)
|
com.mjh.switchrmi.RmiResponse |
readSynchronousResponse(com.mjh.switchrmi.RmiContext context)
|
private org.w3c.dom.Document |
writeFaultResponse(java.lang.Exception exception)
|
void |
writeRequest(com.mjh.switchrmi.RmiRequest req,
com.mjh.switchrmi.RmiContext context)
|
void |
writeResponse(com.mjh.switchrmi.RmiResponse response,
com.mjh.switchrmi.RmiContext context)
|
private org.w3c.dom.Document |
writeResultResponse(java.lang.Object object)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static final org.apache.log4j.Logger log
XMLRPC_REQUEST_TEMPLATE_FILE
private static final java.lang.String XMLRPC_REQUEST_TEMPLATE_FILE
- See Also:
- Constant Field Values
XMLRPC_RESPONSE_TEMPLATE_FILE
private static final java.lang.String XMLRPC_RESPONSE_TEMPLATE_FILE
- See Also:
- Constant Field Values
XMLRPC_FAULTRESPONSE_TEMPLATE_FILE
private static final java.lang.String XMLRPC_FAULTRESPONSE_TEMPLATE_FILE
- See Also:
- Constant Field Values
requestTemplate
private static org.w3c.dom.Document requestTemplate
responseTemplate
private static org.w3c.dom.Document responseTemplate
faultResponseTemplate
private static org.w3c.dom.Document faultResponseTemplate
request
private com.mjh.switchrmi.RmiRequest request
transport
private com.mjh.switchrmi.RmiTransport transport
dateFormatter
private java.text.SimpleDateFormat dateFormatter
XmlRpcProtocol
public XmlRpcProtocol()
parse
private static org.w3c.dom.Document parse(java.lang.String resourceName,
javax.xml.parsers.DocumentBuilder builder)
throws java.lang.Exception
getName
public java.lang.String getName()
- Specified by:
getName in interface com.mjh.switchrmi.RmiProtocol
getMimeType
public java.lang.String getMimeType()
- Specified by:
getMimeType in interface com.mjh.switchrmi.RmiProtocol
createRequest
public com.mjh.switchrmi.RmiRequest createRequest(java.lang.reflect.Method method,
java.lang.Object[] args,
com.mjh.switchrmi.RmiContext context)
- Specified by:
createRequest in interface com.mjh.switchrmi.RmiProtocol
createResponse
public com.mjh.switchrmi.RmiResponse createResponse(com.mjh.switchrmi.RmiRequest request,
java.lang.Object result,
com.mjh.switchrmi.RmiContext context)
- Specified by:
createResponse in interface com.mjh.switchrmi.RmiProtocol
writeRequest
public void writeRequest(com.mjh.switchrmi.RmiRequest req,
com.mjh.switchrmi.RmiContext context)
throws java.lang.Exception
- Specified by:
writeRequest in interface com.mjh.switchrmi.RmiProtocol
readRequest
public com.mjh.switchrmi.RmiRequest readRequest(com.mjh.switchrmi.RmiContext context)
throws java.lang.Exception
- Specified by:
readRequest in interface com.mjh.switchrmi.RmiProtocol
writeResponse
public void writeResponse(com.mjh.switchrmi.RmiResponse response,
com.mjh.switchrmi.RmiContext context)
throws java.lang.Exception
- Specified by:
writeResponse in interface com.mjh.switchrmi.RmiProtocol
writeResultResponse
private org.w3c.dom.Document writeResultResponse(java.lang.Object object)
throws java.lang.Exception
writeFaultResponse
private org.w3c.dom.Document writeFaultResponse(java.lang.Exception exception)
throws java.lang.Exception
readResponse
public com.mjh.switchrmi.RmiResponse readResponse(com.mjh.switchrmi.RmiContext context)
throws java.lang.Exception
- Specified by:
readResponse in interface com.mjh.switchrmi.RmiProtocol
readSynchronousResponse
public com.mjh.switchrmi.RmiResponse readSynchronousResponse(com.mjh.switchrmi.RmiContext context)
throws java.lang.Exception
readFault
private java.lang.Object readFault(org.w3c.dom.Document doc)
throws java.lang.Exception
convertObjectTypeToXmlRpcType
private java.lang.String convertObjectTypeToXmlRpcType(java.lang.String javaType)
throws XmlRpcUnsupportedTypeException
convertObjectToXmlRpcValue
private org.w3c.dom.Node convertObjectToXmlRpcValue(java.lang.Object object,
java.lang.String type,
org.w3c.dom.Document doc)
throws XmlRpcUnsupportedTypeException
convertXmlRpcValueToObject
private java.lang.Object convertXmlRpcValueToObject(org.w3c.dom.Node node)
throws XmlRpcException
convertSimpleToObject
private java.lang.Object convertSimpleToObject(org.w3c.dom.Element element)
throws XmlRpcException
convertObjectToArray
private org.w3c.dom.Node convertObjectToArray(java.util.List list,
org.w3c.dom.Document doc)
throws XmlRpcUnsupportedTypeException
convertArrayToObject
private java.util.List convertArrayToObject(org.w3c.dom.Node node)
throws XmlRpcException
convertObjectToStruct
private org.w3c.dom.Node convertObjectToStruct(java.util.Map map,
org.w3c.dom.Document doc)
throws XmlRpcUnsupportedTypeException
convertStructToObject
private java.util.Map convertStructToObject(org.w3c.dom.Node node)
throws XmlRpcException
convertObjectToDateTimeValue
private org.w3c.dom.Node convertObjectToDateTimeValue(java.util.Date date,
org.w3c.dom.Document doc)
convertDateTimeToObject
private java.util.Date convertDateTimeToObject(org.w3c.dom.Node node)
throws XmlRpcException
convertObjectToBase64Value
private org.w3c.dom.Node convertObjectToBase64Value(byte[] bytes,
org.w3c.dom.Document doc)
convertBase64ToObject
private byte[] convertBase64ToObject(org.w3c.dom.Node node)
throws XmlRpcException
extractValueNodesFromParams
private java.util.List extractValueNodesFromParams(org.w3c.dom.NodeList nodes)
extractArgumentTypesFromParams
private java.lang.String[] extractArgumentTypesFromParams(java.util.List values)
extractArgumentValuesFromParams
private java.lang.Object[] extractArgumentValuesFromParams(java.util.List values)
throws XmlRpcException