Package net.officefloor.web.rest.build
Interface RestArchitect
- All Known Implementing Classes:
RestEmployer.RestArchitectImpl
public interface RestArchitect
Builds servicing of REST requests.
-
Method Summary
Modifier and TypeMethodDescription<M> MomentoKey<M>addRestMethodDecorator(RestMethodDecorator<M> decorator) Adds aRestMethodDecoratorfor theRestMethodinstances.addRestService(boolean isSecure, HttpMethod method, String restPath, String compositionLocation, PropertyList properties, RestConfiguration endpointConfiguration) Adds servicing of aRestMethod.addRestServices(boolean isSecure, String resourceDirectory, PropertyList properties) Adds all REST services.booleanisRestAvailable(String resourceDirectory) Determines if REST endpoints are configured.
-
Method Details
-
addRestMethodDecorator
Adds aRestMethodDecoratorfor theRestMethodinstances.- Type Parameters:
M- Momento type.- Parameters:
decorator-RestMethodDecorator.- Returns:
MomentoKeyto retrieve possibly set Momento on theRestMethod.
-
isRestAvailable
Determines if REST endpoints are configured.- Parameters:
resourceDirectory- Directory containing the REST configuration.- Returns:
trueif REST endpoint configuration available.- Throws:
Exception- If fails to check for REST configuration files.
-
addRestService
RestEndpoint addRestService(boolean isSecure, HttpMethod method, String restPath, String compositionLocation, PropertyList properties, RestConfiguration endpointConfiguration) throws Exception Adds servicing of aRestMethod.- Parameters:
isSecure- Indicates whether request must be over HTTPS.method-HttpMethod.restPath- REST path.compositionLocation- Location of composition to handle theRestMethod.properties-PropertyListto configure servicing.endpointConfiguration-RestConfigurationfor theRestEndpoint.- Returns:
RestEndpoint.- Throws:
Exception- If fails to loadRestEndpoint.
-
addRestServices
Map<String,RestEndpoint> addRestServices(boolean isSecure, String resourceDirectory, PropertyList properties) throws Exception Adds all REST services.- Parameters:
isSecure- Indicates if must be over HTTPS.resourceDirectory- Directory containing the REST configuration.properties-PropertyListto configure servicing.- Returns:
RestEndpointinstances by their path.- Throws:
Exception- If fails to loadRestEndpointinstances.
-