View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.module.ibeans.annotations;
8   
9   import org.mule.api.MuleMessage;
10  
11  import org.ibeans.annotation.State;
12  import org.ibeans.annotation.Template;
13  import org.ibeans.annotation.param.HeaderParam;
14  import org.ibeans.annotation.param.Order;
15  import org.ibeans.annotation.param.PropertyParam;
16  import org.ibeans.annotation.param.UriParam;
17  import org.ibeans.api.CallException;
18  import org.ibeans.api.ExceptionListenerAware;
19  import org.ibeans.api.ParamFactory;
20  import org.ibeans.api.Response;
21  
22  public interface TestParamsFactoryIBean extends ExceptionListenerAware
23  {
24      @UriParam("param1")
25      @Order(1)
26      public static final FirstParamFactory FIRST_URI_FACTORY = new FirstParamFactory();
27  
28      @UriParam("param2")
29      @Order(2)
30      public static final SecondParamFactory SECOND_URI_FACTORY = new SecondParamFactory();
31  
32      @HeaderParam("header1")
33      @Order(3)
34      public static final FirstParamFactory FIRST_HEADER_FACTORY = new FirstParamFactory();
35  
36      @HeaderParam("header2")
37      @Order(4)
38      public static final SecondParamFactory SECOND_HEADER_FACTORY = new SecondParamFactory();
39  
40      @State
41      void init(@PropertyParam("key") byte[] key);
42  
43      @Template("The key is {param1} for {foo}. Param2 is: '{param2}'")
44      public String doUriParams(@UriParam("foo") String foo) throws CallException;
45  
46      @Template("The key is {paramX} for {foo}. Param2 is: '{param2}'")
47      public String doMethodUriParam(@UriParam("foo") String foo, @UriParam("paramX") ParamFactory factory) throws CallException;
48  
49      @Template("Value is: {foo}")
50      public MuleMessage doHeaderParam(@UriParam("foo") String foo) throws CallException;
51  
52      @Template("Value is: {foo}")
53      public MuleMessage doMethodHeaderParam(@UriParam("foo") String foo, @HeaderParam("echoHeader") EchoParamFactory factory) throws CallException;
54  
55      @Template("Value is: {foo}")
56      public MuleMessage doMethodPropertyParam(@UriParam("foo") String foo, @PropertyParam("customProperty") String prop, @HeaderParam("propHeader") ReversePropertyParamFactory factory) throws CallException;
57  
58      @Template("Foo")
59      public MuleMessage doTestHeadersWithNoParams() throws CallException;
60  
61      @Template("Foo")
62      public Response doTestHeadersWithNoParamsAndResponse() throws CallException;
63  
64      @Template("Value is: {foo}")
65      public Response doHeaderParamAndResponse(@UriParam("foo") String foo) throws CallException;
66  
67      @Template("Value is: {foo}")
68      public Response doMethodHeaderParamAndResponse(@UriParam("foo") String foo, @HeaderParam("echoHeader") EchoParamFactory factory) throws CallException;
69  
70      @Template("Value is: {foo}")
71      public Response doMethodPropertyParamAndResponse(@UriParam("foo") String foo, @PropertyParam("customProperty") String prop, @HeaderParam("propHeader") ReversePropertyParamFactory factory) throws CallException;
72  }