Example usage for com.amazonaws.services.simpleworkflow.model CountOpenWorkflowExecutionsRequest CountOpenWorkflowExecutionsRequest

List of usage examples for com.amazonaws.services.simpleworkflow.model CountOpenWorkflowExecutionsRequest CountOpenWorkflowExecutionsRequest

Introduction

In this page you can find the example usage for com.amazonaws.services.simpleworkflow.model CountOpenWorkflowExecutionsRequest CountOpenWorkflowExecutionsRequest.

Prototype

CountOpenWorkflowExecutionsRequest

Source Link

Usage

From source file:org.diksha.common.dyutils.SchedulerUDE.java

License:Apache License

public static int countOpenExecutionsFromSWF(String config) {

    SchedulerConfig schedulerConfig = DyDBUtils.getSchedulerConfig(config);

    AmazonSimpleWorkflowClient amazonSimpleWorkflowClient = new AmazonSimpleWorkflowClient(
            DyDBUtils.getAwsCredentials());
    amazonSimpleWorkflowClient.setEndpoint(schedulerConfig.getEndPoint());

    CountOpenWorkflowExecutionsRequest countOpenWorkflowExecutionsRequest = new CountOpenWorkflowExecutionsRequest()
            .withDomain(schedulerConfig.getDomain());
    countOpenWorkflowExecutionsRequest/*from  w  w w  .  ja  v  a2s.  c  o  m*/
            .setStartTimeFilter(new ExecutionTimeFilter().withOldestDate(new Date(0L)));
    WorkflowExecutionCount workflowExecutionCount = amazonSimpleWorkflowClient
            .countOpenWorkflowExecutions(countOpenWorkflowExecutionsRequest);

    return workflowExecutionCount.getCount();
}