All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.jsoagger.core.business.cloud.operations.rule.GetRuleOperation Maven / Gradle / Ivy

The newest version!
/**
 *
 */
package io.github.jsoagger.core.business.cloud.operations.rule;

import java.util.function.Consumer;

import com.google.gson.JsonObject;
import io.github.jsoagger.core.business.cloud.services.utils.CloudServicesLocator;
import io.github.jsoagger.core.bridge.operation.IOperation;
import io.github.jsoagger.core.bridge.operation.IOperationResult;

/**
 * @author vonji
 *
 */
public class GetRuleOperation implements IOperation {

  /**
   * {@inheritDoc}
   */
  @Override
  public void doOperation(JsonObject query, Consumer resultHandler,
      Consumer exHandler) {
    try {
      if(query == null) throw new NullPointerException("Query can not be null");
      IOperationResult result = CloudServicesLocator.businessRuleApi.getRule(query);
      resultHandler.accept(result);
    }
    catch (Exception e) {
      if(exHandler != null) exHandler.accept(e);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy