com.amazonaws.services.logs.model.ExportTask Maven / Gradle / Ivy
Show all versions of aws-java-sdk-osgi Show documentation
/*
 * Copyright 2010-2016 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.logs.model;
import java.io.Serializable;
/**
 * 
 * Represents an export task.
 * 
 */
public class ExportTask implements Serializable, Cloneable {
    /**
     * 
     * Id of the export task.
     * 
     */
    private String taskId;
    /**
     * 
     * The name of the export task.
     * 
     */
    private String taskName;
    /**
     * 
     * The name of the log group from which logs data was exported.
     * 
     */
    private String logGroupName;
    /**
     * 
     * A point in time expressed as the number of milliseconds since Jan 1, 1970
     * 00:00:00 UTC. Events with a timestamp prior to this time are not
     * exported.
     * 
     */
    private Long from;
    /**
     * 
     * A point in time expressed as the number of milliseconds since Jan 1, 1970
     * 00:00:00 UTC. Events with a timestamp later than this time are not
     * exported.
     * 
     */
    private Long to;
    /**
     * 
     * Name of Amazon S3 bucket to which the log data was exported.
     * 
     */
    private String destination;
    /**
     * 
     * Prefix that was used as the start of Amazon S3 key for every object
     * exported.
     * 
     */
    private String destinationPrefix;
    /**
     * 
     * Status of the export task.
     * 
     */
    private ExportTaskStatus status;
    /**
     * 
     * Execution info about the export task.
     * 
     */
    private ExportTaskExecutionInfo executionInfo;
    /**
     * 
     * Id of the export task.
     * 
     * 
     * @param taskId
     *        Id of the export task.
     */
    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }
    /**
     * 
     * Id of the export task.
     * 
     * 
     * @return Id of the export task.
     */
    public String getTaskId() {
        return this.taskId;
    }
    /**
     * 
     * Id of the export task.
     * 
     * 
     * @param taskId
     *        Id of the export task.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public ExportTask withTaskId(String taskId) {
        setTaskId(taskId);
        return this;
    }
    /**
     * 
     * The name of the export task.
     * 
     * 
     * @param taskName
     *        The name of the export task.
     */
    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }
    /**
     * 
     * The name of the export task.
     * 
     * 
     * @return The name of the export task.
     */
    public String getTaskName() {
        return this.taskName;
    }
    /**
     * 
     * The name of the export task.
     * 
     * 
     * @param taskName
     *        The name of the export task.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public ExportTask withTaskName(String taskName) {
        setTaskName(taskName);
        return this;
    }
    /**
     * 
     * The name of the log group from which logs data was exported.
     * 
     * 
     * @param logGroupName
     *        The name of the log group from which logs data was exported.
     */
    public void setLogGroupName(String logGroupName) {
        this.logGroupName = logGroupName;
    }
    /**
     * 
     * The name of the log group from which logs data was exported.
     * 
     * 
     * @return The name of the log group from which logs data was exported.
     */
    public String getLogGroupName() {
        return this.logGroupName;
    }
    /**
     * 
     * The name of the log group from which logs data was exported.
     * 
     * 
     * @param logGroupName
     *        The name of the log group from which logs data was exported.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public ExportTask withLogGroupName(String logGroupName) {
        setLogGroupName(logGroupName);
        return this;
    }
    /**
     * 
     * A point in time expressed as the number of milliseconds since Jan 1, 1970
     * 00:00:00 UTC. Events with a timestamp prior to this time are not
     * exported.
     * 
     * 
     * @param from
     *        A point in time expressed as the number of milliseconds since Jan
     *        1, 1970 00:00:00 UTC. Events with a timestamp prior to this time
     *        are not exported.
     */
    public void setFrom(Long from) {
        this.from = from;
    }
    /**
     * 
     * A point in time expressed as the number of milliseconds since Jan 1, 1970
     * 00:00:00 UTC. Events with a timestamp prior to this time are not
     * exported.
     * 
     * 
     * @return A point in time expressed as the number of milliseconds since Jan
     *         1, 1970 00:00:00 UTC. Events with a timestamp prior to this time
     *         are not exported.
     */
    public Long getFrom() {
        return this.from;
    }
    /**
     * 
     * A point in time expressed as the number of milliseconds since Jan 1, 1970
     * 00:00:00 UTC. Events with a timestamp prior to this time are not
     * exported.
     * 
     * 
     * @param from
     *        A point in time expressed as the number of milliseconds since Jan
     *        1, 1970 00:00:00 UTC. Events with a timestamp prior to this time
     *        are not exported.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public ExportTask withFrom(Long from) {
        setFrom(from);
        return this;
    }
    /**
     * 
     * A point in time expressed as the number of milliseconds since Jan 1, 1970
     * 00:00:00 UTC. Events with a timestamp later than this time are not
     * exported.
     * 
     * 
     * @param to
     *        A point in time expressed as the number of milliseconds since Jan
     *        1, 1970 00:00:00 UTC. Events with a timestamp later than this time
     *        are not exported.
     */
    public void setTo(Long to) {
        this.to = to;
    }
    /**
     * 
     * A point in time expressed as the number of milliseconds since Jan 1, 1970
     * 00:00:00 UTC. Events with a timestamp later than this time are not
     * exported.
     * 
     * 
     * @return A point in time expressed as the number of milliseconds since Jan
     *         1, 1970 00:00:00 UTC. Events with a timestamp later than this
     *         time are not exported.
     */
    public Long getTo() {
        return this.to;
    }
    /**
     * 
     * A point in time expressed as the number of milliseconds since Jan 1, 1970
     * 00:00:00 UTC. Events with a timestamp later than this time are not
     * exported.
     * 
     * 
     * @param to
     *        A point in time expressed as the number of milliseconds since Jan
     *        1, 1970 00:00:00 UTC. Events with a timestamp later than this time
     *        are not exported.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public ExportTask withTo(Long to) {
        setTo(to);
        return this;
    }
    /**
     * 
     * Name of Amazon S3 bucket to which the log data was exported.
     * 
     * 
     * @param destination
     *        Name of Amazon S3 bucket to which the log data was exported.
     */
    public void setDestination(String destination) {
        this.destination = destination;
    }
    /**
     * 
     * Name of Amazon S3 bucket to which the log data was exported.
     * 
     * 
     * @return Name of Amazon S3 bucket to which the log data was exported.
     */
    public String getDestination() {
        return this.destination;
    }
    /**
     * 
     * Name of Amazon S3 bucket to which the log data was exported.
     * 
     * 
     * @param destination
     *        Name of Amazon S3 bucket to which the log data was exported.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public ExportTask withDestination(String destination) {
        setDestination(destination);
        return this;
    }
    /**
     * 
     * Prefix that was used as the start of Amazon S3 key for every object
     * exported.
     * 
     * 
     * @param destinationPrefix
     *        Prefix that was used as the start of Amazon S3 key for every
     *        object exported.
     */
    public void setDestinationPrefix(String destinationPrefix) {
        this.destinationPrefix = destinationPrefix;
    }
    /**
     * 
     * Prefix that was used as the start of Amazon S3 key for every object
     * exported.
     * 
     * 
     * @return Prefix that was used as the start of Amazon S3 key for every
     *         object exported.
     */
    public String getDestinationPrefix() {
        return this.destinationPrefix;
    }
    /**
     * 
     * Prefix that was used as the start of Amazon S3 key for every object
     * exported.
     * 
     * 
     * @param destinationPrefix
     *        Prefix that was used as the start of Amazon S3 key for every
     *        object exported.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public ExportTask withDestinationPrefix(String destinationPrefix) {
        setDestinationPrefix(destinationPrefix);
        return this;
    }
    /**
     * 
     * Status of the export task.
     * 
     * 
     * @param status
     *        Status of the export task.
     */
    public void setStatus(ExportTaskStatus status) {
        this.status = status;
    }
    /**
     * 
     * Status of the export task.
     * 
     * 
     * @return Status of the export task.
     */
    public ExportTaskStatus getStatus() {
        return this.status;
    }
    /**
     * 
     * Status of the export task.
     * 
     * 
     * @param status
     *        Status of the export task.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public ExportTask withStatus(ExportTaskStatus status) {
        setStatus(status);
        return this;
    }
    /**
     * 
     * Execution info about the export task.
     * 
     * 
     * @param executionInfo
     *        Execution info about the export task.
     */
    public void setExecutionInfo(ExportTaskExecutionInfo executionInfo) {
        this.executionInfo = executionInfo;
    }
    /**
     * 
     * Execution info about the export task.
     * 
     * 
     * @return Execution info about the export task.
     */
    public ExportTaskExecutionInfo getExecutionInfo() {
        return this.executionInfo;
    }
    /**
     * 
     * Execution info about the export task.
     * 
     * 
     * @param executionInfo
     *        Execution info about the export task.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public ExportTask withExecutionInfo(ExportTaskExecutionInfo executionInfo) {
        setExecutionInfo(executionInfo);
        return this;
    }
    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getTaskId() != null)
            sb.append("TaskId: " + getTaskId() + ",");
        if (getTaskName() != null)
            sb.append("TaskName: " + getTaskName() + ",");
        if (getLogGroupName() != null)
            sb.append("LogGroupName: " + getLogGroupName() + ",");
        if (getFrom() != null)
            sb.append("From: " + getFrom() + ",");
        if (getTo() != null)
            sb.append("To: " + getTo() + ",");
        if (getDestination() != null)
            sb.append("Destination: " + getDestination() + ",");
        if (getDestinationPrefix() != null)
            sb.append("DestinationPrefix: " + getDestinationPrefix() + ",");
        if (getStatus() != null)
            sb.append("Status: " + getStatus() + ",");
        if (getExecutionInfo() != null)
            sb.append("ExecutionInfo: " + getExecutionInfo());
        sb.append("}");
        return sb.toString();
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (obj instanceof ExportTask == false)
            return false;
        ExportTask other = (ExportTask) obj;
        if (other.getTaskId() == null ^ this.getTaskId() == null)
            return false;
        if (other.getTaskId() != null
                && other.getTaskId().equals(this.getTaskId()) == false)
            return false;
        if (other.getTaskName() == null ^ this.getTaskName() == null)
            return false;
        if (other.getTaskName() != null
                && other.getTaskName().equals(this.getTaskName()) == false)
            return false;
        if (other.getLogGroupName() == null ^ this.getLogGroupName() == null)
            return false;
        if (other.getLogGroupName() != null
                && other.getLogGroupName().equals(this.getLogGroupName()) == false)
            return false;
        if (other.getFrom() == null ^ this.getFrom() == null)
            return false;
        if (other.getFrom() != null
                && other.getFrom().equals(this.getFrom()) == false)
            return false;
        if (other.getTo() == null ^ this.getTo() == null)
            return false;
        if (other.getTo() != null
                && other.getTo().equals(this.getTo()) == false)
            return false;
        if (other.getDestination() == null ^ this.getDestination() == null)
            return false;
        if (other.getDestination() != null
                && other.getDestination().equals(this.getDestination()) == false)
            return false;
        if (other.getDestinationPrefix() == null
                ^ this.getDestinationPrefix() == null)
            return false;
        if (other.getDestinationPrefix() != null
                && other.getDestinationPrefix().equals(
                        this.getDestinationPrefix()) == false)
            return false;
        if (other.getStatus() == null ^ this.getStatus() == null)
            return false;
        if (other.getStatus() != null
                && other.getStatus().equals(this.getStatus()) == false)
            return false;
        if (other.getExecutionInfo() == null ^ this.getExecutionInfo() == null)
            return false;
        if (other.getExecutionInfo() != null
                && other.getExecutionInfo().equals(this.getExecutionInfo()) == false)
            return false;
        return true;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        hashCode = prime * hashCode
                + ((getTaskId() == null) ? 0 : getTaskId().hashCode());
        hashCode = prime * hashCode
                + ((getTaskName() == null) ? 0 : getTaskName().hashCode());
        hashCode = prime
                * hashCode
                + ((getLogGroupName() == null) ? 0 : getLogGroupName()
                        .hashCode());
        hashCode = prime * hashCode
                + ((getFrom() == null) ? 0 : getFrom().hashCode());
        hashCode = prime * hashCode
                + ((getTo() == null) ? 0 : getTo().hashCode());
        hashCode = prime
                * hashCode
                + ((getDestination() == null) ? 0 : getDestination().hashCode());
        hashCode = prime
                * hashCode
                + ((getDestinationPrefix() == null) ? 0
                        : getDestinationPrefix().hashCode());
        hashCode = prime * hashCode
                + ((getStatus() == null) ? 0 : getStatus().hashCode());
        hashCode = prime
                * hashCode
                + ((getExecutionInfo() == null) ? 0 : getExecutionInfo()
                        .hashCode());
        return hashCode;
    }
    @Override
    public ExportTask clone() {
        try {
            return (ExportTask) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                            + "even though we're Cloneable!", e);
        }
    }
}