public class RestFactory
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
RestMessage |
createRestGET(org.licas_xml.abs.Element serviceUri,
java.lang.String serverPassword,
java.lang.String servicePassword)
Create a string-based RESTful description to invoke the default GET method on a licas service.
|
RestMessage |
createRestMessage(WsMethodInfo methodInfo)
Create a string-based RESTful description of the contents of the method info.
|
Rest_MethodHandler |
createRestMethodHandler()
Create the client rest method handler.
|
static java.lang.String |
decode(java.lang.String queryUri)
Decode the encoded RestFactory-style query URI, from the application/x-www-form-urlencoded MIME format.
|
static java.lang.String |
encode(java.lang.String queryUri)
Encode the RestFactory-style query URI, to the application/x-www-form-urlencoded MIME format.
|
static RestFactory |
getInstance()
Get the rest factory instance.
|
boolean |
notQueryMessage(java.lang.String message)
Return true if the message string cannot be a REST-style query, namely,
there are no query key-value pairs.
|
static void |
setInstance(RestFactory thisInstance)
Set the rest factory instance if null.
|
WsMethodInfo |
toMethodInfo(RestMessage restMessage)
Convert the REST-style message back into a method info object.
|
public static void setInstance(RestFactory thisInstance)
thisInstance
- the factory instance.public static RestFactory getInstance()
public RestMessage createRestGET(org.licas_xml.abs.Element serviceUri, java.lang.String serverPassword, java.lang.String servicePassword)
serviceUri
- the Handle
-based description of the service uri.serverPassword
- the server password. If null, it defaults to Const
.ANON
.servicePassword
- the service password. If null, it defaults to Const
.ANON
.public RestMessage createRestMessage(WsMethodInfo methodInfo) throws java.io.UnsupportedEncodingException
methodInfo
- the method info. Null fields are not included.java.io.UnsupportedEncodingException
- encoding format not supported. UTF-8.public Rest_MethodHandler createRestMethodHandler()
public WsMethodInfo toMethodInfo(RestMessage restMessage) throws java.lang.Exception
restMessage
- the rest query.java.lang.Exception
- any error.public boolean notQueryMessage(java.lang.String message)
message
- the full rest message.=
symbols.public static java.lang.String encode(java.lang.String queryUri) throws java.io.UnsupportedEncodingException
queryUri
- the rest-style query to encode.java.io.UnsupportedEncodingException
- if the encoding is not supported.public static java.lang.String decode(java.lang.String queryUri) throws java.io.UnsupportedEncodingException
queryUri
- the rest-style query to decode.java.io.UnsupportedEncodingException
- if the encoding is not supported.