/* * Copyright 2018-2023 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; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Represents a log stream, which is a sequence of log events from a single emitter of logs. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class LogStream implements Serializable, Cloneable, StructuredPojo { /** *

* The name of the log stream. *

*/ private String logStreamName; /** *

* The creation time of the stream, expressed as the number of milliseconds after * Jan 1, 1970 00:00:00 UTC. *

*/ private Long creationTime; /** *

* The time of the first event, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. *

*/ private Long firstEventTimestamp; /** *

* The time of the most recent log event in the log stream in CloudWatch Logs. This number is expressed as the * number of milliseconds after Jan 1, 1970 00:00:00 UTC. The lastEventTime value updates * on an eventual consistency basis. It typically updates in less than an hour from ingestion, but in rare * situations might take longer. *

*/ private Long lastEventTimestamp; /** *

* The ingestion time, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC The * lastIngestionTime value updates on an eventual consistency basis. It typically updates in less than * an hour after ingestion, but in rare situations might take longer. *

*/ private Long lastIngestionTime; /** *

* The sequence token. *

* *

* The sequence token is now ignored in PutLogEvents actions. PutLogEvents actions are * always accepted regardless of receiving an invalid sequence token. You don't need to obtain * uploadSequenceToken to use a PutLogEvents action. *

*
*/ private String uploadSequenceToken; /** *

* The Amazon Resource Name (ARN) of the log stream. *

*/ private String arn; /** *

* The number of bytes stored. *

*

* Important: As of June 17, 2019, this parameter is no longer supported for log streams, and is always * reported as zero. This change applies only to log streams. The storedBytes parameter for log groups * is not affected. *

*/ @Deprecated private Long storedBytes; /** *

* The name of the log stream. *

* * @param logStreamName * The name of the log stream. */ public void setLogStreamName(String logStreamName) { this.logStreamName = logStreamName; } /** *

* The name of the log stream. *

* * @return The name of the log stream. */ public String getLogStreamName() { return this.logStreamName; } /** *

* The name of the log stream. *

* * @param logStreamName * The name of the log stream. * @return Returns a reference to this object so that method calls can be chained together. */ public LogStream withLogStreamName(String logStreamName) { setLogStreamName(logStreamName); return this; } /** *

* The creation time of the stream, expressed as the number of milliseconds after * Jan 1, 1970 00:00:00 UTC. *

* * @param creationTime * The creation time of the stream, expressed as the number of milliseconds after * Jan 1, 1970 00:00:00 UTC. */ public void setCreationTime(Long creationTime) { this.creationTime = creationTime; } /** *

* The creation time of the stream, expressed as the number of milliseconds after * Jan 1, 1970 00:00:00 UTC. *

* * @return The creation time of the stream, expressed as the number of milliseconds after * Jan 1, 1970 00:00:00 UTC. */ public Long getCreationTime() { return this.creationTime; } /** *

* The creation time of the stream, expressed as the number of milliseconds after * Jan 1, 1970 00:00:00 UTC. *

* * @param creationTime * The creation time of the stream, expressed as the number of milliseconds after * Jan 1, 1970 00:00:00 UTC. * @return Returns a reference to this object so that method calls can be chained together. */ public LogStream withCreationTime(Long creationTime) { setCreationTime(creationTime); return this; } /** *

* The time of the first event, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. *

* * @param firstEventTimestamp * The time of the first event, expressed as the number of milliseconds after * Jan 1, 1970 00:00:00 UTC. */ public void setFirstEventTimestamp(Long firstEventTimestamp) { this.firstEventTimestamp = firstEventTimestamp; } /** *

* The time of the first event, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. *

* * @return The time of the first event, expressed as the number of milliseconds after * Jan 1, 1970 00:00:00 UTC. */ public Long getFirstEventTimestamp() { return this.firstEventTimestamp; } /** *

* The time of the first event, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. *

* * @param firstEventTimestamp * The time of the first event, expressed as the number of milliseconds after * Jan 1, 1970 00:00:00 UTC. * @return Returns a reference to this object so that method calls can be chained together. */ public LogStream withFirstEventTimestamp(Long firstEventTimestamp) { setFirstEventTimestamp(firstEventTimestamp); return this; } /** *

* The time of the most recent log event in the log stream in CloudWatch Logs. This number is expressed as the * number of milliseconds after Jan 1, 1970 00:00:00 UTC. The lastEventTime value updates * on an eventual consistency basis. It typically updates in less than an hour from ingestion, but in rare * situations might take longer. *

* * @param lastEventTimestamp * The time of the most recent log event in the log stream in CloudWatch Logs. This number is expressed as * the number of milliseconds after Jan 1, 1970 00:00:00 UTC. The lastEventTime * value updates on an eventual consistency basis. It typically updates in less than an hour from ingestion, * but in rare situations might take longer. */ public void setLastEventTimestamp(Long lastEventTimestamp) { this.lastEventTimestamp = lastEventTimestamp; } /** *

* The time of the most recent log event in the log stream in CloudWatch Logs. This number is expressed as the * number of milliseconds after Jan 1, 1970 00:00:00 UTC. The lastEventTime value updates * on an eventual consistency basis. It typically updates in less than an hour from ingestion, but in rare * situations might take longer. *

* * @return The time of the most recent log event in the log stream in CloudWatch Logs. This number is expressed as * the number of milliseconds after Jan 1, 1970 00:00:00 UTC. The lastEventTime * value updates on an eventual consistency basis. It typically updates in less than an hour from ingestion, * but in rare situations might take longer. */ public Long getLastEventTimestamp() { return this.lastEventTimestamp; } /** *

* The time of the most recent log event in the log stream in CloudWatch Logs. This number is expressed as the * number of milliseconds after Jan 1, 1970 00:00:00 UTC. The lastEventTime value updates * on an eventual consistency basis. It typically updates in less than an hour from ingestion, but in rare * situations might take longer. *

* * @param lastEventTimestamp * The time of the most recent log event in the log stream in CloudWatch Logs. This number is expressed as * the number of milliseconds after Jan 1, 1970 00:00:00 UTC. The lastEventTime * value updates on an eventual consistency basis. It typically updates in less than an hour from ingestion, * but in rare situations might take longer. * @return Returns a reference to this object so that method calls can be chained together. */ public LogStream withLastEventTimestamp(Long lastEventTimestamp) { setLastEventTimestamp(lastEventTimestamp); return this; } /** *

* The ingestion time, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC The * lastIngestionTime value updates on an eventual consistency basis. It typically updates in less than * an hour after ingestion, but in rare situations might take longer. *

* * @param lastIngestionTime * The ingestion time, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC * The lastIngestionTime value updates on an eventual consistency basis. It typically updates in * less than an hour after ingestion, but in rare situations might take longer. */ public void setLastIngestionTime(Long lastIngestionTime) { this.lastIngestionTime = lastIngestionTime; } /** *

* The ingestion time, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC The * lastIngestionTime value updates on an eventual consistency basis. It typically updates in less than * an hour after ingestion, but in rare situations might take longer. *

* * @return The ingestion time, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC * The lastIngestionTime value updates on an eventual consistency basis. It typically updates * in less than an hour after ingestion, but in rare situations might take longer. */ public Long getLastIngestionTime() { return this.lastIngestionTime; } /** *

* The ingestion time, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC The * lastIngestionTime value updates on an eventual consistency basis. It typically updates in less than * an hour after ingestion, but in rare situations might take longer. *

* * @param lastIngestionTime * The ingestion time, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC * The lastIngestionTime value updates on an eventual consistency basis. It typically updates in * less than an hour after ingestion, but in rare situations might take longer. * @return Returns a reference to this object so that method calls can be chained together. */ public LogStream withLastIngestionTime(Long lastIngestionTime) { setLastIngestionTime(lastIngestionTime); return this; } /** *

* The sequence token. *

* *

* The sequence token is now ignored in PutLogEvents actions. PutLogEvents actions are * always accepted regardless of receiving an invalid sequence token. You don't need to obtain * uploadSequenceToken to use a PutLogEvents action. *

*
* * @param uploadSequenceToken * The sequence token.

*

* The sequence token is now ignored in PutLogEvents actions. PutLogEvents actions * are always accepted regardless of receiving an invalid sequence token. You don't need to obtain * uploadSequenceToken to use a PutLogEvents action. *

*/ public void setUploadSequenceToken(String uploadSequenceToken) { this.uploadSequenceToken = uploadSequenceToken; } /** *

* The sequence token. *

* *

* The sequence token is now ignored in PutLogEvents actions. PutLogEvents actions are * always accepted regardless of receiving an invalid sequence token. You don't need to obtain * uploadSequenceToken to use a PutLogEvents action. *

*
* * @return The sequence token.

*

* The sequence token is now ignored in PutLogEvents actions. PutLogEvents actions * are always accepted regardless of receiving an invalid sequence token. You don't need to obtain * uploadSequenceToken to use a PutLogEvents action. *

*/ public String getUploadSequenceToken() { return this.uploadSequenceToken; } /** *

* The sequence token. *

* *

* The sequence token is now ignored in PutLogEvents actions. PutLogEvents actions are * always accepted regardless of receiving an invalid sequence token. You don't need to obtain * uploadSequenceToken to use a PutLogEvents action. *

*
* * @param uploadSequenceToken * The sequence token.

*

* The sequence token is now ignored in PutLogEvents actions. PutLogEvents actions * are always accepted regardless of receiving an invalid sequence token. You don't need to obtain * uploadSequenceToken to use a PutLogEvents action. *

* @return Returns a reference to this object so that method calls can be chained together. */ public LogStream withUploadSequenceToken(String uploadSequenceToken) { setUploadSequenceToken(uploadSequenceToken); return this; } /** *

* The Amazon Resource Name (ARN) of the log stream. *

* * @param arn * The Amazon Resource Name (ARN) of the log stream. */ public void setArn(String arn) { this.arn = arn; } /** *

* The Amazon Resource Name (ARN) of the log stream. *

* * @return The Amazon Resource Name (ARN) of the log stream. */ public String getArn() { return this.arn; } /** *

* The Amazon Resource Name (ARN) of the log stream. *

* * @param arn * The Amazon Resource Name (ARN) of the log stream. * @return Returns a reference to this object so that method calls can be chained together. */ public LogStream withArn(String arn) { setArn(arn); return this; } /** *

* The number of bytes stored. *

*

* Important: As of June 17, 2019, this parameter is no longer supported for log streams, and is always * reported as zero. This change applies only to log streams. The storedBytes parameter for log groups * is not affected. *

* * @param storedBytes * The number of bytes stored.

*

* Important: As of June 17, 2019, this parameter is no longer supported for log streams, and is * always reported as zero. This change applies only to log streams. The storedBytes parameter * for log groups is not affected. */ @Deprecated public void setStoredBytes(Long storedBytes) { this.storedBytes = storedBytes; } /** *

* The number of bytes stored. *

*

* Important: As of June 17, 2019, this parameter is no longer supported for log streams, and is always * reported as zero. This change applies only to log streams. The storedBytes parameter for log groups * is not affected. *

* * @return The number of bytes stored.

*

* Important: As of June 17, 2019, this parameter is no longer supported for log streams, and is * always reported as zero. This change applies only to log streams. The storedBytes parameter * for log groups is not affected. */ @Deprecated public Long getStoredBytes() { return this.storedBytes; } /** *

* The number of bytes stored. *

*

* Important: As of June 17, 2019, this parameter is no longer supported for log streams, and is always * reported as zero. This change applies only to log streams. The storedBytes parameter for log groups * is not affected. *

* * @param storedBytes * The number of bytes stored.

*

* Important: As of June 17, 2019, this parameter is no longer supported for log streams, and is * always reported as zero. This change applies only to log streams. The storedBytes parameter * for log groups is not affected. * @return Returns a reference to this object so that method calls can be chained together. */ @Deprecated public LogStream withStoredBytes(Long storedBytes) { setStoredBytes(storedBytes); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getLogStreamName() != null) sb.append("LogStreamName: ").append(getLogStreamName()).append(","); if (getCreationTime() != null) sb.append("CreationTime: ").append(getCreationTime()).append(","); if (getFirstEventTimestamp() != null) sb.append("FirstEventTimestamp: ").append(getFirstEventTimestamp()).append(","); if (getLastEventTimestamp() != null) sb.append("LastEventTimestamp: ").append(getLastEventTimestamp()).append(","); if (getLastIngestionTime() != null) sb.append("LastIngestionTime: ").append(getLastIngestionTime()).append(","); if (getUploadSequenceToken() != null) sb.append("UploadSequenceToken: ").append(getUploadSequenceToken()).append(","); if (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getStoredBytes() != null) sb.append("StoredBytes: ").append(getStoredBytes()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof LogStream == false) return false; LogStream other = (LogStream) obj; if (other.getLogStreamName() == null ^ this.getLogStreamName() == null) return false; if (other.getLogStreamName() != null && other.getLogStreamName().equals(this.getLogStreamName()) == false) return false; if (other.getCreationTime() == null ^ this.getCreationTime() == null) return false; if (other.getCreationTime() != null && other.getCreationTime().equals(this.getCreationTime()) == false) return false; if (other.getFirstEventTimestamp() == null ^ this.getFirstEventTimestamp() == null) return false; if (other.getFirstEventTimestamp() != null && other.getFirstEventTimestamp().equals(this.getFirstEventTimestamp()) == false) return false; if (other.getLastEventTimestamp() == null ^ this.getLastEventTimestamp() == null) return false; if (other.getLastEventTimestamp() != null && other.getLastEventTimestamp().equals(this.getLastEventTimestamp()) == false) return false; if (other.getLastIngestionTime() == null ^ this.getLastIngestionTime() == null) return false; if (other.getLastIngestionTime() != null && other.getLastIngestionTime().equals(this.getLastIngestionTime()) == false) return false; if (other.getUploadSequenceToken() == null ^ this.getUploadSequenceToken() == null) return false; if (other.getUploadSequenceToken() != null && other.getUploadSequenceToken().equals(this.getUploadSequenceToken()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getStoredBytes() == null ^ this.getStoredBytes() == null) return false; if (other.getStoredBytes() != null && other.getStoredBytes().equals(this.getStoredBytes()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLogStreamName() == null) ? 0 : getLogStreamName().hashCode()); hashCode = prime * hashCode + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode()); hashCode = prime * hashCode + ((getFirstEventTimestamp() == null) ? 0 : getFirstEventTimestamp().hashCode()); hashCode = prime * hashCode + ((getLastEventTimestamp() == null) ? 0 : getLastEventTimestamp().hashCode()); hashCode = prime * hashCode + ((getLastIngestionTime() == null) ? 0 : getLastIngestionTime().hashCode()); hashCode = prime * hashCode + ((getUploadSequenceToken() == null) ? 0 : getUploadSequenceToken().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getStoredBytes() == null) ? 0 : getStoredBytes().hashCode()); return hashCode; } @Override public LogStream clone() { try { return (LogStream) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.logs.model.transform.LogStreamMarshaller.getInstance().marshall(this, protocolMarshaller); } }