Package com.cosmicpush.app.domain.requests

Examples of com.cosmicpush.app.domain.requests.ApiRequest


  @POST
  @Path("/{apiRequestId}/resend")
  public Response resendEmailMessage(@Context ServletContext context, @PathParam("apiRequestId") String apiRequestId) throws Exception {

    ApiRequest apiRequest = config.getApiRequestStore().getByApiRequestId(apiRequestId);
    EmailPush push = (EmailPush)apiRequest.getPush();

    if (useAwsEmail()) {
      new AwsEmailDelegate(config.getObjectMapper(), config.getApiRequestStore(), account, apiClient, apiRequest, push).resend();

    } else {
      new SmtpEmailDelegate(config.getObjectMapper(), config.getApiRequestStore(), account, apiClient, apiRequest, push).resend();
    }

    // Do not use the old References - they need to be reloaded.
    apiRequest = config.getApiRequestStore().getByApiRequestId(apiRequestId);
    push = (EmailPush)apiRequest.getPush();

    EmailModel model = new EmailModel(account, apiClient, apiRequest, push);

    String path = String.format("%s/manage/api-client/%s/emails/%s", context.getContextPath(), apiClient.getClientName(), apiRequest.getApiRequestId());
    return Response.seeOther(new URI(path)).build();
  }
View Full Code Here

TOP

Related Classes of com.cosmicpush.app.domain.requests.ApiRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.