Interface Rest.RestServer
- All Superinterfaces:
de.iip_ecosphere.platform.support.Server
- Enclosing class:
Rest
public static interface Rest.RestServer
extends de.iip_ecosphere.platform.support.Server
Represents a rest server.
- Author:
- Holger Eichelberger, SSE
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddExceptionHandler(Class<Exception> cls, Rest.ExceptionHandler handler) Adds an exception handler for a specified type.voiddefineBefore(Rest.Filter filter) Defines a filter on all paths.voiddefineBefore(String path, Rest.Filter filter) Defines a filter on a given path.voiddefineDelete(String path, Rest.Route route) Defines a delete route.voiddefineGet(String path, Rest.Route route) Defines a get route.voiddefinePost(String path, Rest.Route route) Defines a post route.voiddefinePut(String path, Rest.Route route) Defines a put route.voidHalts processing a request.voidSet the connection to be secure, using the specified keystore and truststore.booleanReturns whether path variables are supported.toPathVariable(String name) Turns a name to a path variable.Methods inherited from interface de.iip_ecosphere.platform.support.Server
start, stop
-
Method Details
-
definePost
Defines a post route.- Parameters:
path- the pathroute- the route
-
defineGet
Defines a get route.- Parameters:
path- the pathroute- the route
-
definePut
Defines a put route.- Parameters:
path- the pathroute- the route
-
defineDelete
Defines a delete route.- Parameters:
path- the pathroute- the route
-
defineBefore
Defines a filter on all paths.- Parameters:
filter- the filter
-
defineBefore
Defines a filter on a given path.- Parameters:
path- the pathfilter- the filter
-
halt
Halts processing a request.- Parameters:
status- the statusbody- the body
-
supportsPathVariables
boolean supportsPathVariables()Returns whether path variables are supported.- Returns:
truefor path variables,falseelse
-
toPathVariable
Turns a name to a path variable.- Parameters:
name- the name- Returns:
- the path variable for
name, may benameif no path variables are supported - See Also:
-
secure
Set the connection to be secure, using the specified keystore and truststore. This has to be called before any route mapping is done.- Parameters:
keystoreFile- The keystore file location as stringkeystorePassword- the password for the keystorecertAlias- the default certificate Alias
-
addExceptionHandler
Adds an exception handler for a specified type.- Parameters:
cls- the exception typehandler- the handler
-