Package adams.flow.rest
Class RESTUtils
- java.lang.Object
-
- adams.flow.rest.RESTUtils
-
public class RESTUtils extends Object
Utility class around REST webservices.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Constructor Summary
Constructors Constructor Description RESTUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
configureClient(adams.flow.core.Actor owner, Object servicePort, int connection, int receive, String url)
Sets the timeouts for connection and receiving.static void
configureFactoryInterceptors(adams.flow.core.Actor owner, org.apache.cxf.jaxrs.JAXRSServerFactoryBean factory, AbstractInInterceptorGenerator inInterceptor, AbstractOutInterceptorGenerator outInterceptor)
Configures the interceptors/logging for the service endpoint (incoming and outgoing).static String
getAdditionalInformation(RESTPlugin plugin)
Generates information about the plugin, to be used for the information return byAdditionalInformationHandler
.protected static String
getAdditionalInformation(Class cls)
Returns the additional for the class, if any.protected static String
getAdditionalInformation(Method method)
Returns the additional for the method, if any.static String
loadWsdl(URL location)
Loads the WSDL from the given location.
-
-
-
Method Detail
-
configureClient
public static void configureClient(adams.flow.core.Actor owner, Object servicePort, int connection, int receive, String url)
Sets the timeouts for connection and receiving. Also configures the proxy settings in case there is a system-wide proxy configured.- Parameters:
owner
- the owning actorservicePort
- the service port to set the timeouts forconnection
- the timeout for the connection in msec, 0 is infinitereceive
- the timeout for receiving in msec, 0 is infiniteurl
- the URL of the webservice, null to use default- See Also:
ProxyHelper
-
configureFactoryInterceptors
public static void configureFactoryInterceptors(adams.flow.core.Actor owner, org.apache.cxf.jaxrs.JAXRSServerFactoryBean factory, AbstractInInterceptorGenerator inInterceptor, AbstractOutInterceptorGenerator outInterceptor)
Configures the interceptors/logging for the service endpoint (incoming and outgoing).- Parameters:
owner
- the owning actorfactory
- the server factory to updateinInterceptor
- the interceptor for incoming messagesoutInterceptor
- the interceptor for outcoing messages
-
loadWsdl
public static String loadWsdl(URL location)
Loads the WSDL from the given location.- Parameters:
location
- the location of the WSDL- Returns:
- the content of the WSDL, null if failed to load
-
getAdditionalInformation
protected static String getAdditionalInformation(Class cls)
Returns the additional for the class, if any.- Parameters:
cls
- the class to inspect- Returns:
- the generated information, null if none available
-
getAdditionalInformation
protected static String getAdditionalInformation(Method method)
Returns the additional for the method, if any.- Parameters:
method
- the method to inspect- Returns:
- the generated information, null if none available
-
getAdditionalInformation
public static String getAdditionalInformation(RESTPlugin plugin)
Generates information about the plugin, to be used for the information return byAdditionalInformationHandler
.- Parameters:
plugin
- the plugin to generate the information for- Returns:
- the information, null if none available
-
-