Package net.officefloor.web.rest.build
Class RestEmployer.RestArchitectImpl
java.lang.Object
net.officefloor.web.rest.build.RestEmployer.RestArchitectImpl
- All Implemented Interfaces:
RestArchitect
- Enclosing class:
- RestEmployer
RestArchitect implementation.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRestArchitectImpl(OfficeArchitect officeArchitect, WebArchitect webArchitect, ComposeArchitect composeArchitect, OfficeSourceContext officeSourceContext) -
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.
-
Constructor Details
-
RestArchitectImpl
protected RestArchitectImpl(OfficeArchitect officeArchitect, WebArchitect webArchitect, ComposeArchitect composeArchitect, OfficeSourceContext officeSourceContext) - Parameters:
officeArchitect-OfficeArchitect.webArchitect-WebArchitect.composeArchitect-ComposeArchitect.officeSourceContext-OfficeSourceContext.
-
-
Method Details
-
isRestAvailable
Description copied from interface:RestArchitectDetermines if REST endpoints are configured.- Specified by:
isRestAvailablein interfaceRestArchitect- Parameters:
resourceDirectory- Directory containing the REST configuration.- Returns:
trueif REST endpoint configuration available.- Throws:
Exception- If fails to check for REST configuration files.
-
addRestMethodDecorator
Description copied from interface:RestArchitectAdds aRestMethodDecoratorfor theRestMethodinstances.- Specified by:
addRestMethodDecoratorin interfaceRestArchitect- Type Parameters:
M- Momento type.- Parameters:
decorator-RestMethodDecorator.- Returns:
MomentoKeyto retrieve possibly set Momento on theRestMethod.
-
addRestService
public RestEndpoint addRestService(boolean isSecure, HttpMethod method, String restPath, String compositionLocation, PropertyList properties, RestConfiguration endpointConfiguration) throws Exception Description copied from interface:RestArchitectAdds servicing of aRestMethod.- Specified by:
addRestServicein interfaceRestArchitect- 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
public Map<String,RestEndpoint> addRestServices(boolean isSecure, String resourceDirectory, PropertyList properties) throws Exception Description copied from interface:RestArchitectAdds all REST services.- Specified by:
addRestServicesin interfaceRestArchitect- 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.
-