[ 
https://issues.apache.org/jira/browse/SOLR-13787?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Noble Paul updated SOLR-13787:
------------------------------
    Description: 
example v2 API may look as follows
{code:java}
@EndPoint(
 spec = "cluster.package",
 method = POST,
 permission = PKG_EDIT
)
static class PkgEdit {
 @Command(command = "add")
 public void add(CallInfo callInfo) throws Exception {


 }

 @Command(command = "update")
 public void update(CallInfo callInfo) throws Exception {
}

 @Command(command = "delete")
 boolean deletePackage(CallInfo params) throws Exception {

}

{code}
This expects you to already have the API spec json 

 

The annotations are:

 
{code:java}
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
public @interface EndPoint {
  /**name of the API spec file without the '.json' suffix
   */
  String spec();

  /**Http method
   */
  SolrRequest.METHOD method();

  /**The well known persmission name if any
   */
  PermissionNameProvider.Name permission();
}
{code}
{code:java}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Command {
  String command() default "";
}
{code}

  was:
example v2 API may look as follows

{code:java}

@EndPoint(
 spec = "cluster.package",
 method = POST,
 permission = PKG_EDIT
)
static class PkgEdit {
 @Command(command = "add")
 public void add(CallInfo callInfo) throws Exception {


 }

 @Command(command = "update")
 public void update(CallInfo callInfo) throws Exception {
}

 @Command(command = "delete")
 boolean deletePackage(CallInfo params) throws Exception {

}

{code}

This expects you to already have the API spec json 


> An annotation based system to write v2 only APIs
> ------------------------------------------------
>
>                 Key: SOLR-13787
>                 URL: https://issues.apache.org/jira/browse/SOLR-13787
>             Project: Solr
>          Issue Type: Task
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Noble Paul
>            Priority: Major
>
> example v2 API may look as follows
> {code:java}
> @EndPoint(
>  spec = "cluster.package",
>  method = POST,
>  permission = PKG_EDIT
> )
> static class PkgEdit {
>  @Command(command = "add")
>  public void add(CallInfo callInfo) throws Exception {
>  }
>  @Command(command = "update")
>  public void update(CallInfo callInfo) throws Exception {
> }
>  @Command(command = "delete")
>  boolean deletePackage(CallInfo params) throws Exception {
> }
> {code}
> This expects you to already have the API spec json 
>  
> The annotations are:
>  
> {code:java}
> @Retention(RetentionPolicy.RUNTIME)
> @Target({ElementType.TYPE})
> public @interface EndPoint {
>   /**name of the API spec file without the '.json' suffix
>    */
>   String spec();
>   /**Http method
>    */
>   SolrRequest.METHOD method();
>   /**The well known persmission name if any
>    */
>   PermissionNameProvider.Name permission();
> }
> {code}
> {code:java}
> @Retention(RetentionPolicy.RUNTIME)
> @Target(ElementType.METHOD)
> public @interface Command {
>   String command() default "";
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to