Package com.cosmicpush.pub.internal

Examples of com.cosmicpush.pub.internal.RequestErrors


    this.clientPassword = ExceptionUtils.assertNotNull(clientPassword, "clientPassword");
    this.cosmicPushUrl = ExceptionUtils.assertNotNull(cosmicPushUrl, "cosmicPushUrl");
  }

  public PushResponse push(Push push) {
    push.validate(new RequestErrors()).assertNoErrors();
    String json = translate(push);
    return processRequest(push.getEndPoint(), json);
  }
View Full Code Here


  public String getTestAddress() {
    return testAddress;
  }

  public GoogleTalkConfig create(CreateGoogleTalkConfigAction action) {
    action.validate(new RequestErrors()).assertNoErrors();

    this.userName = action.getUserName();
    this.password = action.getPassword();
    this.recipientOverride = action.getRecipientOverride();
    this.testAddress = action.getTestAddress();
View Full Code Here

  public List<ApiClient> getApiClients() {
    return apiClients;
  }
  public ApiClient add(CreateClientAction action) {
    action.validate(new RequestErrors()).assertNoErrors();
    ApiClient apiClient = new ApiClient().create(action);
    apiClients.add(apiClient);
    return apiClient;
  }
View Full Code Here

  public AccountStore(CpCouchServer couchServer) {
    super(couchServer, couchServer.getDatabaseName(), Account.class);
  }

  public Account get(AccountQuery accountQuery) {
    RequestErrors errors = new RequestErrors();
    accountQuery.validate(errors);
    if (errors.isNotEmpty()) {
      throw errors.toBadRequestException();
    }

    if (accountQuery instanceof AccountIdQuery) {
      AccountIdQuery query = (AccountIdQuery)accountQuery;
      return getByAccountId(query.getAccountId());
View Full Code Here

  @Override
  public Account execute(AccountRequest purchaseRequest) {
    ExceptionUtils.assertNotNull(purchaseRequest, "request");
    AccountAction accountOperation = purchaseRequest.getOperation();

    RequestErrors errors = new RequestErrors();
    accountOperation.validate(errors);
    if (errors.isEmpty() == false) {
      String msg = StringUtils.concat("\n", errors);
      throw ApiException.badRequest(msg);
    }

    Account account = accountStore.get(purchaseRequest.getQuery());
View Full Code Here

  public ApiClient() {
  }

  public ApiClient create(CreateClientAction action) {
    action.validate(new RequestErrors()).assertNoErrors();

    this.apiClientId = CpIdGenerator.newId();
    this.clientName = action.getClientName();
    this.clientPassword = action.getClientPassword();
View Full Code Here

  public void setLastMessage(String lastMessage) {
    this.lastMessage = lastMessage;
  }

  public void apply(UpdateClientAction action) {
    action.validate(new RequestErrors()).assertNoErrors();

    this.clientName = action.getClientName();
    this.clientPassword = action.getClientPassword();

    this.lastMessage = "API Client configuration changed.";
View Full Code Here

  public AwsEmailConfig() {
  }

  public AwsEmailConfig create(CreateAwsEmailConfigAction action) {
    action.validate(new RequestErrors()).assertNoErrors();

    this.accessKeyId = action.getAccessKeyId();
    this.secretKey = action.getSecretKey();
    this.testAddress = action.getTestAddress();
    this.recipientOverride = action.getRecipientOverride();
View Full Code Here

  public SmtpEmailConfig() {
  }

  public SmtpEmailConfig create(CreateSmtpEmailConfigAction action) {
    action.validate(new RequestErrors()).assertNoErrors();

    this.userName = action.getUserName();
    this.password = action.getPassword();

    this.authType = action.getAuthType();
View Full Code Here

    return client;
  }

  @Override
  public PushResponse push(Push push) {
    push.validate(new RequestErrors()).assertNoErrors();
    return getClient().post(PushResponse.class, push.getEndPoint(), push);
  }
View Full Code Here

TOP

Related Classes of com.cosmicpush.pub.internal.RequestErrors

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.