Interface Describable<D,R>
- 
- Type Parameters:
- D- The type of API Descriptor object that will be the result of the description. For example, for CREST this would be the- ApiDescriptionclass from the api-descriptor module.
- R- The type of request that will be presented to get API descriptions.
 - All Known Subinterfaces:
- DescribableHandler
 - All Known Implementing Classes:
- AbstractConnectionWrapper,- AbstractRouter,- DescribedSyncRequestHandlerAdapter,- FilterChain,- Router,- Router
 
 public interface Describable<D,R>A routing component (a CHFHandleror CRESTRequestHandler) can describe its API by implementing this interface.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static interfaceDescribable.ListenerInterface for listener instances.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidaddDescriptorListener(Describable.Listener listener)Add a listener for API Descriptor changes.Dapi(ApiProducer<D> producer)Provide the API description for the component.DhandleApiRequest(Context context, R request)Handle a request for the API Descriptor.default voidremoveDescriptorListener(Describable.Listener listener)Remove a listener from API Descriptor changes.
 
- 
- 
- 
Method Detail- 
apiD api(ApiProducer<D> producer) Provide the API description for the component. This method should perform the heavy-lifting of computing the API descriptor, and should be expected to be called rarely. Upstream handlers should call this method in order to compose all of their downstream API Descriptors into a single descriptor.- Parameters:
- producer- The API producer that provides general information to be built into the descriptor.
- Returns:
- The description object.
 
 - 
handleApiRequestD handleApiRequest(Context context, R request) Handle a request for the API Descriptor. This method should not do any computation, but should return the already computed descriptor.- Parameters:
- context- The request context.
- request- The request.
- Returns:
- The descriptor.
- Throws:
- IllegalStateException- When the request cannot be routed to an acceptable handler.
- UnsupportedOperationException- When there is no API Descriptor available for the request.
 
 - 
addDescriptorListenerdefault void addDescriptorListener(Describable.Listener listener) Add a listener for API Descriptor changes. The described object should call all the listeners.- Parameters:
- listener- The listener.
 
 - 
removeDescriptorListenerdefault void removeDescriptorListener(Describable.Listener listener) Remove a listener from API Descriptor changes.- Parameters:
- listener- The listener.
 
 
- 
 
-