/**
 * Copyright 2010-2012 Ralph Schaer <ralphschaer@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ch.ralscha.extdirectspring.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotation for methods whose implement a call
 * 
 * @author Ralph Schaer
 */
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface ExtDirectMethod {

	/**
	 * Specifies the type of the remote method. Defaults to simple method call.
	 */
	ExtDirectMethodType value() default ExtDirectMethodType.SIMPLE;

	/**
	 * The name of an api group this method is part of.
	 */
	String group() default "";

	/**
	 * Optional parameter if the method is a POLL method. The name of the event
	 * this method is sending messages to If parameter is empty the name of the
	 * method will be used as event name
	 */
	String event() default "";

	/**
	 * Optional parameter. If true execution of the method is synchronized on
	 * the session, to serialize parallel invocations from the same client. Not
	 * feasible for FORM_POST methods
	 */
	boolean synchronizeOnSession() default false;

	/**
	 * Optional parameter. If true json response will be streamed into the
	 * response, without setting the Content-Length HTTP header. Default
	 * behaviour (false) is writing the response into a buffer, setting the
	 * Content-Length header and writing the buffer into the response. Not
	 * feasible for FORM_POST methods
	 */
	boolean streamResponse() default false;

	/**
	 * Optional parameter. Specifies the type of an object in a collection. If
	 * the generic type of a collection is an interface the library cannot
	 * figure out the type of the implementation class. For this scenario
	 * specify the class with this parameter.
	 * 
	 * STORE_MODIFY methods
	 */
	Class<?> entryClass() default Object.class;

}

@@ -1441,27 +1441,27 @@
 eter
- if the method is a
+. Only feasible for
  POL
@@ -1468,16 +1468,17 @@
 L method
+s
 . The na
@@ -1532,20 +1532,26 @@
 sages to
+.
  If 
+this 
 paramete
@@ -1573,20 +1573,20 @@
 name
+%0D%0A%09 *
  of the
-%0D%0A%09 *
  met
@@ -1611,24 +1611,25 @@
 s event name
+.
 %0D%0A%09 */%0D%0A%09Str
@@ -1676,32 +1676,68 @@
 ional parameter.
+ Not feasible for FORM_POST methods.
  If true executi
@@ -1738,16 +1738,21 @@
 xecution
+%0D%0A%09 *
  of the 
@@ -1776,21 +1776,16 @@
 nized on
-%0D%0A%09 *
  the ses
@@ -1792,11 +1792,11 @@
 sion
-, t
+. T
 o se
@@ -1811,16 +1811,21 @@
 parallel
+%0D%0A%09 *
  invocat
@@ -1854,48 +1854,8 @@
 ent.
- Not%0D%0A%09 * feasible for FORM_POST methods
 %0D%0A%09 
@@ -1937,16 +1937,52 @@
 rameter.
+ Not feasible for FORM_POST methods.
  If true
@@ -1986,16 +1986,21 @@
 rue json
+%0D%0A%09 *
  respons
@@ -2026,21 +2026,16 @@
 into the
-%0D%0A%09 *
  respons
@@ -2056,16 +2056,21 @@
 ting the
+%0D%0A%09 *
  Content
@@ -2097,21 +2097,16 @@
  Default
-%0D%0A%09 *
  behavio
@@ -2126,24 +2126,29 @@
  writing the
+%0D%0A%09 *
  response in
@@ -2163,37 +2163,32 @@
 fer, setting the
-%0D%0A%09 *
  Content-Length 
@@ -2209,16 +2209,21 @@
 ting the
+%0D%0A%09 *
  buffer 
@@ -2244,48 +2244,8 @@
 nse.
- Not%0D%0A%09 * feasible for FORM_POST methods
 %0D%0A%09 
@@ -2321,16 +2321,56 @@
 rameter.
+ Only feasible for STORE_MODIFY methods.
  Specifi
@@ -2367,32 +2367,37 @@
 s. Specifies the
+%0D%0A%09 *
  type of an obje
@@ -2418,21 +2418,16 @@
 tion. If
-%0D%0A%09 *
  the gen
@@ -2454,16 +2454,21 @@
 ction is
+%0D%0A%09 *
  an inte
@@ -2491,21 +2491,16 @@
 y cannot
-%0D%0A%09 *
  figure 
@@ -2533,16 +2533,21 @@
 entation
+%0D%0A%09 *
  class. 
@@ -2563,21 +2563,16 @@
 scenario
-%0D%0A%09 *
  specify
@@ -2608,40 +2608,8 @@
 r.%0D%0A
-%09 * %0D%0A%09 * STORE_MODIFY methods%0D%0A
 %09 */

update javadoc