Class RestCallbackBuilder

java.lang.Object
de.knightsoftnet.gwtp.spring.client.rest.helper.RestCallbackBuilder

public class RestCallbackBuilder extends Object
Async callback implementation with error handling.
Author:
Manfred Tremmel
  • Constructor Details

    • RestCallbackBuilder

      public RestCallbackBuilder()
  • Method Details

    • build

      public static <R> com.google.gwt.user.client.rpc.AsyncCallback<R> build(AsyncCallbackOnSuccess<R> pcallbackOnSuccess, AsyncCallbackOnFailure pcallbackOnFailure)
      create rest callback implementation.
      Type Parameters:
      R - rest result type
      Parameters:
      pcallbackOnSuccess - on success callback
      pcallbackOnFailure - on failure callback
      Returns:
      RestCallbackImpl
    • build

      public static <V extends HasShowMessage, R, H extends HttpMessages> RestCallbackSimpleImpl<V,R,H> build(V pview, Session psession, AsyncCallbackOnSuccess<R> pcallbackOnSuccess)
      create rest callback implementation.
      Type Parameters:
      V - view or widget which implements EditorWithErrorHandling interface
      R - rest result type
      H - http messages
      Parameters:
      pview - view of the
      psession - session
      pcallbackOnSuccess - on success callback
      Returns:
      RestCallbackImpl
    • build

      public static <V extends HasShowMessage, R, H extends HttpMessages> RestCallbackSimpleImpl<V,R,H> build(V pview, Session psession, AsyncCallbackOnSuccess<R> pcallbackOnSuccess, H phttpMessage)
      create rest callback implementation.
      Type Parameters:
      V - view or widget which implements EditorWithErrorHandling interface
      R - rest result type
      H - http messages
      Parameters:
      pview - view of the
      psession - session
      pcallbackOnSuccess - on success callback
      phttpMessage - http code messages to show
      Returns:
      RestCallbackImpl
    • build

      public static <P, D, V extends EditorWithErrorHandling<P, D>, R, H extends HttpMessages> RestCallbackImpl<P,D,V,R,H> build(V pview, D pdata, Session psession, AsyncCallbackOnSuccess<R> pcallbackOnSuccess)
      create rest callback implementation.
      Type Parameters:
      P - presenter type
      D - data type given to the server
      V - view or widget which implements EditorWithErrorHandling interface
      R - rest result type
      H - http messages
      Parameters:
      pview - view of the
      pdata - data given from server
      psession - session
      pcallbackOnSuccess - on success callback
      Returns:
      RestCallbackImpl
    • build

      public static <P, D, V extends EditorWithErrorHandling<P, D>, R, H extends HttpMessages> RestCallbackImpl<P,D,V,R,H> build(V pview, D pdata, Session psession, H phttpMessage, AsyncCallbackOnSuccess<R> pcallbackOnSuccess)
      create rest callback implementation.
      Type Parameters:
      P - presenter type
      D - data type given to the server
      V - view or widget which implements EditorWithErrorHandling interface
      R - rest result type
      H - http messages
      Parameters:
      pview - view of the
      pdata - data given from server
      psession - session
      phttpMessage - http code messages to show
      pcallbackOnSuccess - on success callback
      Returns:
      RestCallbackImpl
    • buildLoginCallback

      public static <T extends User, V extends EditorWithErrorHandling<?, ?>, M extends LoginMessages, H extends HttpMessages> LoginCallback<T,V,M,H> buildLoginCallback(V pview, Session psession)
      create login callback implementation.
      Type Parameters:
      T - user data
      V - view or widget which implements EditorWithErrorHandling interface
      M - login messages
      H - http messages
      Parameters:
      pview - view of the
      psession - session
      Returns:
      LoginCallback
    • buildLoginCallback

      public static <T extends User, V extends EditorWithErrorHandling<?, ?>, M extends LoginMessages, H extends HttpMessages> LoginCallback<T,V,M,H> buildLoginCallback(V pview, Session psession, M ploginErrorMessage)
      create login callback implementation.
      Type Parameters:
      T - user data
      V - view or widget which implements EditorWithErrorHandling interface
      M - login messages
      H - http messages
      Parameters:
      pview - view of the
      psession - session
      ploginErrorMessage - error message to show
      Returns:
      LoginCallback
    • buildLoginCallback

      public static <T extends User, V extends EditorWithErrorHandling<?, ?>, M extends LoginMessages, H extends HttpMessages> LoginCallback<T,V,M,H> buildLoginCallback(V pview, Session psession, M ploginErrorMessage, H phttpMessage)
      create login callback implementation.
      Type Parameters:
      T - user data
      V - view or widget which implements EditorWithErrorHandling interface
      M - login messages
      H - http messages
      Parameters:
      pview - view of the
      psession - session
      ploginErrorMessage - error message to show
      phttpMessage - http code messages to show
      Returns:
      LoginCallback