Package org.apache.solr.api
Class AnnotatedApi
- java.lang.Object
- 
- org.apache.solr.api.Api
- 
- org.apache.solr.api.AnnotatedApi
 
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- org.apache.solr.common.SpecProvider,- PermissionNameProvider
 
 public class AnnotatedApi extends Api implements PermissionNameProvider, Closeable This class implements an Api just from an annotated java class The class must have an annotationEndPointEach method must have an annotationCommandThe methods that implement a command should have the first 2 parametersSolrQueryRequestandSolrQueryResponseor it may optionally have a third parameter which could be a java class annotated with jackson annotations. The third parameter is only valid if it is using a json command payload
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.solr.security.PermissionNameProviderPermissionNameProvider.Name
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static StringERR- 
Fields inherited from class org.apache.solr.api.ApicommandSchema, spec
 - 
Fields inherited from interface org.apache.solr.security.PermissionNameProviderANY, NULL, values
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedAnnotatedApi(org.apache.solr.common.SpecProvider specProvider, EndPoint endPoint, Map<String,org.apache.solr.api.AnnotatedApi.Cmd> commands, Api fallback)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcall(SolrQueryRequest req, SolrQueryResponse rsp)The method that gets called for each requestvoidclose()static Map<String,Object>createSchema(Method m)static List<Api>getApis(Class<?> theClass, Object obj, boolean allowEmpty)Get a list of Api-s supported by this class.static List<Api>getApis(Object obj)Map<String,org.apache.solr.api.AnnotatedApi.Cmd>getCommands()EndPointgetEndPoint()PermissionNameProvider.NamegetPermissionName(AuthorizationContext request)- 
Methods inherited from class org.apache.solr.api.ApigetCommandSchema, getSpec
 
- 
 
- 
- 
- 
Field Detail- 
ERRpublic static final String ERR - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
closepublic void close() throws IOException- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
 - 
getEndPointpublic EndPoint getEndPoint() 
 - 
getApispublic static List<Api> getApis(Class<?> theClass, Object obj, boolean allowEmpty) Get a list of Api-s supported by this class.- Parameters:
- theClass- class
- obj- object of this class (may be null)
- allowEmpty- if false then an exception is thrown if no Api-s can be retrieved, if true then absence of Api-s is silently ignored.
- Returns:
- list of discovered Api-s
 
 - 
getPermissionNamepublic PermissionNameProvider.Name getPermissionName(AuthorizationContext request) - Specified by:
- getPermissionNamein interface- PermissionNameProvider
 
 - 
callpublic void call(SolrQueryRequest req, SolrQueryResponse rsp) Description copied from class:ApiThe method that gets called for each request
 
- 
 
-