Example usage for com.amazonaws.services.simpleworkflow AmazonSimpleWorkflow setEndpoint

List of usage examples for com.amazonaws.services.simpleworkflow AmazonSimpleWorkflow setEndpoint

Introduction

In this page you can find the example usage for com.amazonaws.services.simpleworkflow AmazonSimpleWorkflow setEndpoint.

Prototype

@Deprecated
void setEndpoint(String endpoint);

Source Link

Document

Overrides the default endpoint for this client ("swf.us-east-1.amazonaws.com").

Usage

From source file:clojusc.aws.examples.swf.javaapp.GreeterMain.java

License:Open Source License

public static void main() throws Exception {
    ClientConfiguration config = new ClientConfiguration().withSocketTimeout(GreeterConstants.clientTimeout);

    AWSCredentials creds = new BasicAWSCredentials(System.getenv(GreeterConstants.accessKey),
            System.getenv(GreeterConstants.secretKey));

    AmazonSimpleWorkflow service = new AmazonSimpleWorkflowClient(creds, config);
    service.setEndpoint(GreeterConstants.endpoint);

    GreeterWorkflowClientExternalFactory factory = new GreeterWorkflowClientExternalFactoryImpl(service,
            GreeterConstants.domain);//from  ww w . j av  a2 s .c  om
    GreeterWorkflowClientExternal greeter = factory.getClient(GreeterConstants.clientId);
    greeter.greet();
}

From source file:clojusc.aws.examples.swf.javaapp.GreeterWorker.java

License:Open Source License

public static void main() throws Exception {
    ClientConfiguration config = new ClientConfiguration().withSocketTimeout(GreeterConstants.clientTimeout);

    AWSCredentials creds = new BasicAWSCredentials(System.getenv(GreeterConstants.accessKey),
            System.getenv(GreeterConstants.secretKey));

    AmazonSimpleWorkflow service = new AmazonSimpleWorkflowClient(creds, config);
    service.setEndpoint(GreeterConstants.endpoint);

    ActivityWorker aw = new ActivityWorker(service, GreeterConstants.domain, GreeterConstants.taskListToPoll);
    aw.addActivitiesImplementation(new GreeterActivitiesImpl());
    aw.start();/*from ww  w  .  j  ava2  s  .c  om*/

    WorkflowWorker wfw = new WorkflowWorker(service, GreeterConstants.domain, GreeterConstants.taskListToPoll);
    wfw.addWorkflowImplementationType(GreeterWorkflowImpl.class);
    wfw.start();
}

From source file:com.eucalyptus.simpleworkflow.common.client.WorkflowClientStandalone.java

License:Open Source License

private AmazonSimpleWorkflow getAWSClient() {
    final AWSCredentialsProvider provider = this.getCredentialsProvider();
    final ClientConfiguration configuration = this.buildClientConfig();
    final AmazonSimpleWorkflow client = new AmazonSimpleWorkflowClient(provider, configuration);
    client.setEndpoint(this.swfEndpoint);
    return client;
}

From source file:com.MobMonkey.Helpers.SimpleWorkFlow.ConfigHelper.java

License:Open Source License

public AmazonSimpleWorkflow createSWFClient() {
    AWSCredentials awsCredentials = new BasicAWSCredentials(this.swfAccessId, this.swfSecretKey);
    AmazonSimpleWorkflow client = new AmazonSimpleWorkflowClient(awsCredentials);
    client.setEndpoint(this.swfServiceUrl);
    return client;
}

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

License:Apache License

public static SchedulerWorkflowClientExternal getScheduler(String clientId, SchedulerConfig schedulerConfig) {
    AWSCredentials awsCredentials = DyDBUtils.getAwsCredentials();

    ClientConfiguration config = new ClientConfiguration()
            .withSocketTimeout(Integer.parseInt(schedulerConfig.getSocketTimeout()));
    AmazonSimpleWorkflow service = new AmazonSimpleWorkflowClient(awsCredentials, config);

    service.setEndpoint(schedulerConfig.getEndPoint());
    String domain = schedulerConfig.getDomain();

    SchedulerWorkflowClientExternalFactory factory = new SchedulerWorkflowClientExternalFactoryImpl(service,
            domain);/*from  w  ww  .  j  a v a  2  s  .  co  m*/

    SchedulerWorkflowClientExternal scheduler = factory.getClient(clientId);

    return scheduler;
}

From source file:org.diksha.engine.SchedulerWorker.java

License:Apache License

public static void main(String[] args) throws Exception {

    ClientConfiguration config = new ClientConfiguration().withSocketTimeout(70 * 1000);

    String swfAccessId = System.getenv("AWS_ACCESS_KEY_ID");
    String swfSecretKey = System.getenv("AWS_SECRET_ACCESS_KEY");
    AWSCredentials awsCredentials = new BasicAWSCredentials(swfAccessId, swfSecretKey);

    AmazonSimpleWorkflow service = new AmazonSimpleWorkflowClient(awsCredentials, config);

    String configParam;/*w w w  .j  a v a 2 s .c  o  m*/

    if (args.length == 0) {
        configParam = "cf1";
    } else {
        configParam = args[0];
    }

    SchedulerConfig schedulerConfig = DyDBUtils.getSchedulerConfig(configParam);

    service.setEndpoint(schedulerConfig.getEndPoint());

    String domain = schedulerConfig.getDomain();
    String taskListToPoll = schedulerConfig.getTaskList();

    try {
        ActivityWorker aw = new ActivityWorker(service, domain, taskListToPoll);
        aw.addActivitiesImplementation(new SchedulerActivitiesImpl());
        aw.start();

        WorkflowWorker wfw = new WorkflowWorker(service, domain, taskListToPoll);
        wfw.addWorkflowImplementationType(SchedulerWorkflowImpl.class);
        wfw.start();

    } catch (Exception e) {
        System.out.println("should have caught it");
    }

}

From source file:org.systemsbiology.common.ConfigHelper.java

License:Open Source License

public AmazonSimpleWorkflow createSWFClient() {
    ClientConfiguration config = new ClientConfiguration().withSocketTimeout(70 * 1000);
    AWSCredentials awsCredentials = new BasicAWSCredentials(this.swfAccessId, this.swfSecretKey);
    AmazonSimpleWorkflow client = new AmazonSimpleWorkflowClient(awsCredentials, config);
    client.setEndpoint(this.swfServiceUrl);
    return client;
}