Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.rds.model;
 

Contains the results of a successful invocation of the DescribeEventSubscriptions action.

 
 public class EventSubscription implements SerializableCloneable {

    
The AWS customer account associated with the RDS event notification subscription.
 
     private String customerAwsId;

    
The RDS event notification subscription Id.
 
     private String custSubscriptionId;

    
The topic ARN of the RDS event notification subscription.
 
     private String snsTopicArn;

    
The status of the RDS event notification subscription.

Constraints:

Can be one of the following: creating | modifying | deleting | active | no-permission | topic-not-exist

The status "no-permission" indicates that RDS no longer has permission to post to the SNS topic. The status "topic-not-exist" indicates that the topic was deleted after the subscription was created.

 
     private String status;

    
The time the RDS event notification subscription was created.
 
     private String subscriptionCreationTime;

    
The source type for the RDS event notification subscription.
 
     private String sourceType;

    
A list of source IDs for the RDS event notification subscription.
 
A list of event categories for the RDS event notification subscription.
 
A Boolean value indicating if the subscription is enabled. True indicates the subscription is enabled.
 
     private Boolean enabled;

    
The AWS customer account associated with the RDS event notification subscription.

Returns:
The AWS customer account associated with the RDS event notification subscription.
 
     public String getCustomerAwsId() {
         return ;
     }
    
    
The AWS customer account associated with the RDS event notification subscription.

Parameters:
customerAwsId The AWS customer account associated with the RDS event notification subscription.
 
     public void setCustomerAwsId(String customerAwsId) {
         this. = customerAwsId;
    }
    
    
The AWS customer account associated with the RDS event notification subscription.

Returns a reference to this object so that method calls can be chained together.

Parameters:
customerAwsId The AWS customer account associated with the RDS event notification subscription.
Returns:
A reference to this updated object so that method calls can be chained together.
    public EventSubscription withCustomerAwsId(String customerAwsId) {
        this. = customerAwsId;
        return this;
    }

    
The RDS event notification subscription Id.

Returns:
The RDS event notification subscription Id.
    public String getCustSubscriptionId() {
        return ;
    }
    
    
The RDS event notification subscription Id.

Parameters:
custSubscriptionId The RDS event notification subscription Id.
    public void setCustSubscriptionId(String custSubscriptionId) {
        this. = custSubscriptionId;
    }
    
    
The RDS event notification subscription Id.

Returns a reference to this object so that method calls can be chained together.

Parameters:
custSubscriptionId The RDS event notification subscription Id.
Returns:
A reference to this updated object so that method calls can be chained together.
    public EventSubscription withCustSubscriptionId(String custSubscriptionId) {
        this. = custSubscriptionId;
        return this;
    }

    
The topic ARN of the RDS event notification subscription.

Returns:
The topic ARN of the RDS event notification subscription.
    public String getSnsTopicArn() {
        return ;
    }
    
    
The topic ARN of the RDS event notification subscription.

Parameters:
snsTopicArn The topic ARN of the RDS event notification subscription.
    public void setSnsTopicArn(String snsTopicArn) {
        this. = snsTopicArn;
    }
    
    
The topic ARN of the RDS event notification subscription.

Returns a reference to this object so that method calls can be chained together.

Parameters:
snsTopicArn The topic ARN of the RDS event notification subscription.
Returns:
A reference to this updated object so that method calls can be chained together.
    public EventSubscription withSnsTopicArn(String snsTopicArn) {
        this. = snsTopicArn;
        return this;
    }

    
The status of the RDS event notification subscription.

Constraints:

Can be one of the following: creating | modifying | deleting | active | no-permission | topic-not-exist

The status "no-permission" indicates that RDS no longer has permission to post to the SNS topic. The status "topic-not-exist" indicates that the topic was deleted after the subscription was created.

Returns:
The status of the RDS event notification subscription.

Constraints:

Can be one of the following: creating | modifying | deleting | active | no-permission | topic-not-exist

The status "no-permission" indicates that RDS no longer has permission to post to the SNS topic. The status "topic-not-exist" indicates that the topic was deleted after the subscription was created.

    public String getStatus() {
        return ;
    }
    
    
The status of the RDS event notification subscription.

Constraints:

Can be one of the following: creating | modifying | deleting | active | no-permission | topic-not-exist

The status "no-permission" indicates that RDS no longer has permission to post to the SNS topic. The status "topic-not-exist" indicates that the topic was deleted after the subscription was created.

Parameters:
status The status of the RDS event notification subscription.

Constraints:

Can be one of the following: creating | modifying | deleting | active | no-permission | topic-not-exist

The status "no-permission" indicates that RDS no longer has permission to post to the SNS topic. The status "topic-not-exist" indicates that the topic was deleted after the subscription was created.

    public void setStatus(String status) {
        this. = status;
    }
    
    
The status of the RDS event notification subscription.

Constraints:

Can be one of the following: creating | modifying | deleting | active | no-permission | topic-not-exist

The status "no-permission" indicates that RDS no longer has permission to post to the SNS topic. The status "topic-not-exist" indicates that the topic was deleted after the subscription was created.

Returns a reference to this object so that method calls can be chained together.

Parameters:
status The status of the RDS event notification subscription.

Constraints:

Can be one of the following: creating | modifying | deleting | active | no-permission | topic-not-exist

The status "no-permission" indicates that RDS no longer has permission to post to the SNS topic. The status "topic-not-exist" indicates that the topic was deleted after the subscription was created.

Returns:
A reference to this updated object so that method calls can be chained together.
    public EventSubscription withStatus(String status) {
        this. = status;
        return this;
    }

    
The time the RDS event notification subscription was created.

Returns:
The time the RDS event notification subscription was created.
        return ;
    }
    
    
The time the RDS event notification subscription was created.

Parameters:
subscriptionCreationTime The time the RDS event notification subscription was created.
    public void setSubscriptionCreationTime(String subscriptionCreationTime) {
        this. = subscriptionCreationTime;
    }
    
    
The time the RDS event notification subscription was created.

Returns a reference to this object so that method calls can be chained together.

Parameters:
subscriptionCreationTime The time the RDS event notification subscription was created.
Returns:
A reference to this updated object so that method calls can be chained together.
    public EventSubscription withSubscriptionCreationTime(String subscriptionCreationTime) {
        this. = subscriptionCreationTime;
        return this;
    }

    
The source type for the RDS event notification subscription.

Returns:
The source type for the RDS event notification subscription.
    public String getSourceType() {
        return ;
    }
    
    
The source type for the RDS event notification subscription.

Parameters:
sourceType The source type for the RDS event notification subscription.
    public void setSourceType(String sourceType) {
        this. = sourceType;
    }
    
    
The source type for the RDS event notification subscription.

Returns a reference to this object so that method calls can be chained together.

Parameters:
sourceType The source type for the RDS event notification subscription.
Returns:
A reference to this updated object so that method calls can be chained together.
    public EventSubscription withSourceType(String sourceType) {
        this. = sourceType;
        return this;
    }

    
A list of source IDs for the RDS event notification subscription.

Returns:
A list of source IDs for the RDS event notification subscription.
    public java.util.List<StringgetSourceIdsList() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of source IDs for the RDS event notification subscription.

Parameters:
sourceIdsList A list of source IDs for the RDS event notification subscription.
    public void setSourceIdsList(java.util.Collection<StringsourceIdsList) {
        if (sourceIdsList == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringsourceIdsListCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(sourceIdsList.size());
        sourceIdsListCopy.addAll(sourceIdsList);
        this. = sourceIdsListCopy;
    }
    
    
A list of source IDs for the RDS event notification subscription.

NOTE: This method appends the values to the existing list (if any). Use setSourceIdsList(java.util.Collection) or withSourceIdsList(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
sourceIdsList A list of source IDs for the RDS event notification subscription.
Returns:
A reference to this updated object so that method calls can be chained together.
    public EventSubscription withSourceIdsList(String... sourceIdsList) {
        if (getSourceIdsList() == nullsetSourceIdsList(new java.util.ArrayList<String>(sourceIdsList.length));
        for (String value : sourceIdsList) {
            getSourceIdsList().add(value);
        }
        return this;
    }
    
    
A list of source IDs for the RDS event notification subscription.

Returns a reference to this object so that method calls can be chained together.

Parameters:
sourceIdsList A list of source IDs for the RDS event notification subscription.
Returns:
A reference to this updated object so that method calls can be chained together.
    public EventSubscription withSourceIdsList(java.util.Collection<StringsourceIdsList) {
        if (sourceIdsList == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringsourceIdsListCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(sourceIdsList.size());
            sourceIdsListCopy.addAll(sourceIdsList);
            this. = sourceIdsListCopy;
        }
        return this;
    }

    
A list of event categories for the RDS event notification subscription.

Returns:
A list of event categories for the RDS event notification subscription.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of event categories for the RDS event notification subscription.

Parameters:
eventCategoriesList A list of event categories for the RDS event notification subscription.
    public void setEventCategoriesList(java.util.Collection<StringeventCategoriesList) {
        if (eventCategoriesList == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringeventCategoriesListCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(eventCategoriesList.size());
        eventCategoriesListCopy.addAll(eventCategoriesList);
        this. = eventCategoriesListCopy;
    }
    
    
A list of event categories for the RDS event notification subscription.

NOTE: This method appends the values to the existing list (if any). Use setEventCategoriesList(java.util.Collection) or withEventCategoriesList(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
eventCategoriesList A list of event categories for the RDS event notification subscription.
Returns:
A reference to this updated object so that method calls can be chained together.
    public EventSubscription withEventCategoriesList(String... eventCategoriesList) {
        if (getEventCategoriesList() == nullsetEventCategoriesList(new java.util.ArrayList<String>(eventCategoriesList.length));
        for (String value : eventCategoriesList) {
            getEventCategoriesList().add(value);
        }
        return this;
    }
    
    
A list of event categories for the RDS event notification subscription.

Returns a reference to this object so that method calls can be chained together.

Parameters:
eventCategoriesList A list of event categories for the RDS event notification subscription.
Returns:
A reference to this updated object so that method calls can be chained together.
    public EventSubscription withEventCategoriesList(java.util.Collection<StringeventCategoriesList) {
        if (eventCategoriesList == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringeventCategoriesListCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(eventCategoriesList.size());
            eventCategoriesListCopy.addAll(eventCategoriesList);
            this. = eventCategoriesListCopy;
        }
        return this;
    }

    
A Boolean value indicating if the subscription is enabled. True indicates the subscription is enabled.

Returns:
A Boolean value indicating if the subscription is enabled. True indicates the subscription is enabled.
    public Boolean isEnabled() {
        return ;
    }
    
    
A Boolean value indicating if the subscription is enabled. True indicates the subscription is enabled.

Parameters:
enabled A Boolean value indicating if the subscription is enabled. True indicates the subscription is enabled.
    public void setEnabled(Boolean enabled) {
        this. = enabled;
    }
    
    
A Boolean value indicating if the subscription is enabled. True indicates the subscription is enabled.

Returns a reference to this object so that method calls can be chained together.

Parameters:
enabled A Boolean value indicating if the subscription is enabled. True indicates the subscription is enabled.
Returns:
A reference to this updated object so that method calls can be chained together.
    public EventSubscription withEnabled(Boolean enabled) {
        this. = enabled;
        return this;
    }

    
A Boolean value indicating if the subscription is enabled. True indicates the subscription is enabled.

Returns:
A Boolean value indicating if the subscription is enabled. True indicates the subscription is enabled.
    public Boolean getEnabled() {
        return ;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getCustomerAwsId() != nullsb.append("CustomerAwsId: " + getCustomerAwsId() + ",");
        if (getCustSubscriptionId() != nullsb.append("CustSubscriptionId: " + getCustSubscriptionId() + ",");
        if (getSnsTopicArn() != nullsb.append("SnsTopicArn: " + getSnsTopicArn() + ",");
        if (getStatus() != nullsb.append("Status: " + getStatus() + ",");
        if (getSubscriptionCreationTime() != nullsb.append("SubscriptionCreationTime: " + getSubscriptionCreationTime() + ",");
        if (getSourceType() != nullsb.append("SourceType: " + getSourceType() + ",");
        if (getSourceIdsList() != nullsb.append("SourceIdsList: " + getSourceIdsList() + ",");
        if (getEventCategoriesList() != nullsb.append("EventCategoriesList: " + getEventCategoriesList() + ",");
        if (isEnabled() != nullsb.append("Enabled: " + isEnabled() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getCustomerAwsId() == null) ? 0 : getCustomerAwsId().hashCode()); 
        hashCode = prime * hashCode + ((getCustSubscriptionId() == null) ? 0 : getCustSubscriptionId().hashCode()); 
        hashCode = prime * hashCode + ((getSnsTopicArn() == null) ? 0 : getSnsTopicArn().hashCode()); 
        hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); 
        hashCode = prime * hashCode + ((getSubscriptionCreationTime() == null) ? 0 : getSubscriptionCreationTime().hashCode()); 
        hashCode = prime * hashCode + ((getSourceType() == null) ? 0 : getSourceType().hashCode()); 
        hashCode = prime * hashCode + ((getSourceIdsList() == null) ? 0 : getSourceIdsList().hashCode()); 
        hashCode = prime * hashCode + ((getEventCategoriesList() == null) ? 0 : getEventCategoriesList().hashCode()); 
        hashCode = prime * hashCode + ((isEnabled() == null) ? 0 : isEnabled().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof EventSubscription == falsereturn false;
        EventSubscription other = (EventSubscription)obj;
        
        if (other.getCustomerAwsId() == null ^ this.getCustomerAwsId() == nullreturn false;
        if (other.getCustomerAwsId() != null && other.getCustomerAwsId().equals(this.getCustomerAwsId()) == falsereturn false
        if (other.getCustSubscriptionId() == null ^ this.getCustSubscriptionId() == nullreturn false;
        if (other.getCustSubscriptionId() != null && other.getCustSubscriptionId().equals(this.getCustSubscriptionId()) == falsereturn false
        if (other.getSnsTopicArn() == null ^ this.getSnsTopicArn() == nullreturn false;
        if (other.getSnsTopicArn() != null && other.getSnsTopicArn().equals(this.getSnsTopicArn()) == falsereturn false
        if (other.getStatus() == null ^ this.getStatus() == nullreturn false;
        if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == falsereturn false
        if (other.getSubscriptionCreationTime() == null ^ this.getSubscriptionCreationTime() == nullreturn false;
        if (other.getSubscriptionCreationTime() != null && other.getSubscriptionCreationTime().equals(this.getSubscriptionCreationTime()) == falsereturn false
        if (other.getSourceType() == null ^ this.getSourceType() == nullreturn false;
        if (other.getSourceType() != null && other.getSourceType().equals(this.getSourceType()) == falsereturn false
        if (other.getSourceIdsList() == null ^ this.getSourceIdsList() == nullreturn false;
        if (other.getSourceIdsList() != null && other.getSourceIdsList().equals(this.getSourceIdsList()) == falsereturn false
        if (other.getEventCategoriesList() == null ^ this.getEventCategoriesList() == nullreturn false;
        if (other.getEventCategoriesList() != null && other.getEventCategoriesList().equals(this.getEventCategoriesList()) == falsereturn false
        if (other.isEnabled() == null ^ this.isEnabled() == nullreturn false;
        if (other.isEnabled() != null && other.isEnabled().equals(this.isEnabled()) == falsereturn false
        return true;
    }
    
    @Override
    public EventSubscription clone() {
        try {
            return (EventSubscriptionsuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X