Example usage for com.amazonaws.services.lambda.model EventSourceMappingConfiguration getEventSourceArn

List of usage examples for com.amazonaws.services.lambda.model EventSourceMappingConfiguration getEventSourceArn

Introduction

In this page you can find the example usage for com.amazonaws.services.lambda.model EventSourceMappingConfiguration getEventSourceArn.

Prototype


public String getEventSourceArn() 

Source Link

Document

The Amazon Resource Name (ARN) of the event source.

Usage

From source file:com.netflix.spinnaker.clouddriver.lambda.deploy.ops.DeleteLambdaEventSourceAtomicOperation.java

License:Apache License

@Override
public Object operate(List priorOutputs) {
    LambdaFunction lambdaFunction = (LambdaFunction) lambdaFunctionProvider
            .getFunction(description.getAccount(), description.getRegion(), description.getFunctionName());

    List<EventSourceMappingConfiguration> eventSourceMappingConfigurations = lambdaFunction
            .getEventSourceMappings();//www  .j  a v a2s. c  om

    for (EventSourceMappingConfiguration eventSourceMappingConfiguration : eventSourceMappingConfigurations) {
        if (eventSourceMappingConfiguration.getEventSourceArn()
                .equalsIgnoreCase(description.getEventSourceArn())) {
            description.setUuid(eventSourceMappingConfiguration.getUUID());
            return deleteEventSourceMappingResult();
        }
    }

    return null;
}

From source file:com.netflix.spinnaker.clouddriver.lambda.deploy.ops.UpsertLambdaEventSourceAtomicOperation.java

License:Apache License

@Override
public Object operate(List priorOutputs) {
    String functionName = description.getFunctionName();
    String region = description.getRegion();
    String account = description.getAccount();

    LambdaFunction cache = (LambdaFunction) lambdaFunctionProvider.getFunction(account, region, functionName);

    List<EventSourceMappingConfiguration> eventSourceMappingConfigurations = cache.getEventSourceMappings();
    for (EventSourceMappingConfiguration eventSourceMappingConfiguration : eventSourceMappingConfigurations) {
        if (eventSourceMappingConfiguration.getEventSourceArn()
                .equalsIgnoreCase(description.getEventSourceArn())) {
            description.setProperty("uuid", eventSourceMappingConfiguration.getUUID());
            return updateEventSourceMappingResult(cache);
        }//w ww  . ja  va2  s  . c o m
    }

    return createEventSourceMapping(cache);
}