Class Rest
java.lang.Object
de.iip_ecosphere.platform.support.rest.Rest
Generic access to Rest (server). Requires an implementing plugin of type
Rest or an active
RestProviderDescriptor. Simplified interface akin to Spark.- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceRepresents an exception handler, can be used to uniformly handle exceptions.static interfaceRepresents a route filter.static interfaceRequest interface.static interfaceResponse interface.static interfaceRepresents a rest server.static interfaceRepresents a route (function). -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Rest.RestServercreateServer(int port) Creates a server instance.createServer(de.iip_ecosphere.platform.support.ServerAddress addr) Creates a server instance.abstract RestTargetcreateTarget(String uri) Creates a web/REST target to call operations on, a kind of REST client.static RestReturns the Rest instance.static voidsetInstance(Rest rest) Manually sets the instance.
-
Field Details
-
instance
-
-
Constructor Details
-
Rest
public Rest()
-
-
Method Details
-
getInstance
Returns the Rest instance.- Returns:
- the instance
-
setInstance
Manually sets the instance. Shall not be needed, but may be required in some tests.- Parameters:
rest- the Rest instance
-
createServer
Creates a server instance.- Parameters:
port- the port to use- Returns:
- the server instance
-
createServer
Creates a server instance.- Parameters:
addr- the server address (port taken)- Returns:
- the server instance
-
createTarget
Creates a web/REST target to call operations on, a kind of REST client.- Parameters:
uri- web resource URI. May contain template parameters. Must not be null.- Returns:
- the rest target instance
- Throws:
IllegalArgumentException- in case the supplied string is not a valid URI templateNullPointerException- in case the supplied argument is null.
-