Search in sources :

Example 1 with RequestFunction

use of com.liferay.apio.architect.alias.RequestFunction in project com-liferay-apio-architect by liferay.

the class RootEndpointImpl method activate.

@Activate
public void activate() {
    RequestFunction<Optional<APITitle>> apiTitleRequestFunction = httpServletRequest -> _providerManager.provideOptional(httpServletRequest, APITitle.class);
    RequestFunction<Optional<APIDescription>> apiDescriptionRequestFunction = httpServletRequest -> _providerManager.provideOptional(httpServletRequest, APIDescription.class);
    _documentation = new Documentation(apiTitleRequestFunction, apiDescriptionRequestFunction);
}
Also used : JsonObject(com.google.gson.JsonObject) CollectionRouterManager(com.liferay.apio.architect.wiring.osgi.manager.router.CollectionRouterManager) ItemRoutes(com.liferay.apio.architect.routes.ItemRoutes) ExceptionSupplierUtil.notFound(com.liferay.apio.architect.endpoint.ExceptionSupplierUtil.notFound) NestedCollectionRoutes(com.liferay.apio.architect.routes.NestedCollectionRoutes) RequestFunction(com.liferay.apio.architect.alias.RequestFunction) BinaryEndpoint(com.liferay.apio.architect.endpoint.BinaryEndpoint) HttpServletRequest(javax.servlet.http.HttpServletRequest) MediaType(javax.ws.rs.core.MediaType) Component(org.osgi.service.component.annotations.Component) NestedCollectionRouterManager(com.liferay.apio.architect.wiring.osgi.manager.router.NestedCollectionRouterManager) Documentation(com.liferay.apio.architect.documentation.Documentation) Activate(org.osgi.service.component.annotations.Activate) ProviderManager(com.liferay.apio.architect.wiring.osgi.manager.ProviderManager) SingleModel(com.liferay.apio.architect.single.model.SingleModel) ReusableNestedCollectionRouterManager(com.liferay.apio.architect.wiring.osgi.manager.router.ReusableNestedCollectionRouterManager) RootEndpoint(com.liferay.apio.architect.endpoint.RootEndpoint) Try(com.liferay.apio.architect.functional.Try) PathIdentifierMapperManager(com.liferay.apio.architect.wiring.osgi.manager.PathIdentifierMapperManager) Context(javax.ws.rs.core.Context) APIDescription(com.liferay.apio.architect.documentation.APIDescription) RepresentableManager(com.liferay.apio.architect.wiring.osgi.manager.representable.RepresentableManager) ServerURL(com.liferay.apio.architect.url.ServerURL) Path(com.liferay.apio.architect.uri.Path) APITitle(com.liferay.apio.architect.documentation.APITitle) IdentifierClassManager(com.liferay.apio.architect.wiring.osgi.manager.representable.IdentifierClassManager) List(java.util.List) Response(javax.ws.rs.core.Response) FormEndpoint(com.liferay.apio.architect.endpoint.FormEndpoint) Optional(java.util.Optional) Reference(org.osgi.service.component.annotations.Reference) ItemRouterManager(com.liferay.apio.architect.wiring.osgi.manager.router.ItemRouterManager) Optional(java.util.Optional) Documentation(com.liferay.apio.architect.documentation.Documentation) Activate(org.osgi.service.component.annotations.Activate)

Aggregations

JsonObject (com.google.gson.JsonObject)1 RequestFunction (com.liferay.apio.architect.alias.RequestFunction)1 APIDescription (com.liferay.apio.architect.documentation.APIDescription)1 APITitle (com.liferay.apio.architect.documentation.APITitle)1 Documentation (com.liferay.apio.architect.documentation.Documentation)1 BinaryEndpoint (com.liferay.apio.architect.endpoint.BinaryEndpoint)1 ExceptionSupplierUtil.notFound (com.liferay.apio.architect.endpoint.ExceptionSupplierUtil.notFound)1 FormEndpoint (com.liferay.apio.architect.endpoint.FormEndpoint)1 RootEndpoint (com.liferay.apio.architect.endpoint.RootEndpoint)1 Try (com.liferay.apio.architect.functional.Try)1 ItemRoutes (com.liferay.apio.architect.routes.ItemRoutes)1 NestedCollectionRoutes (com.liferay.apio.architect.routes.NestedCollectionRoutes)1 SingleModel (com.liferay.apio.architect.single.model.SingleModel)1 Path (com.liferay.apio.architect.uri.Path)1 ServerURL (com.liferay.apio.architect.url.ServerURL)1 PathIdentifierMapperManager (com.liferay.apio.architect.wiring.osgi.manager.PathIdentifierMapperManager)1 ProviderManager (com.liferay.apio.architect.wiring.osgi.manager.ProviderManager)1 IdentifierClassManager (com.liferay.apio.architect.wiring.osgi.manager.representable.IdentifierClassManager)1 RepresentableManager (com.liferay.apio.architect.wiring.osgi.manager.representable.RepresentableManager)1 CollectionRouterManager (com.liferay.apio.architect.wiring.osgi.manager.router.CollectionRouterManager)1