@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStreamName() == null) ? 0 : getStreamName().hashCode()); hashCode = prime * hashCode + ((getStreamARN() == null) ? 0 : getStreamARN().hashCode()); hashCode = prime * hashCode + ((getStreamStatus() == null) ? 0 : getStreamStatus().hashCode()); hashCode = prime * hashCode + ((getRetentionPeriodHours() == null) ? 0 : getRetentionPeriodHours().hashCode()); hashCode = prime * hashCode + ((getStreamCreationTimestamp() == null) ? 0 : getStreamCreationTimestamp().hashCode()); hashCode = prime * hashCode + ((getEnhancedMonitoring() == null) ? 0 : getEnhancedMonitoring().hashCode()); hashCode = prime * hashCode + ((getEncryptionType() == null) ? 0 : getEncryptionType().hashCode()); hashCode = prime * hashCode + ((getKeyId() == null) ? 0 : getKeyId().hashCode()); hashCode = prime * hashCode + ((getOpenShardCount() == null) ? 0 : getOpenShardCount().hashCode()); hashCode = prime * hashCode + ((getConsumerCount() == null) ? 0 : getConsumerCount().hashCode()); return hashCode; }
public StreamDescriptionSummary unmarshall(JsonUnmarshallerContext context) throws Exception { StreamDescriptionSummary streamDescriptionSummary = new StreamDescriptionSummary(); if (context.testExpression("StreamName", targetDepth)) { context.nextToken(); streamDescriptionSummary.setStreamName(context.getUnmarshaller(String.class).unmarshall(context)); streamDescriptionSummary.setStreamARN(context.getUnmarshaller(String.class).unmarshall(context)); streamDescriptionSummary.setStreamStatus(context.getUnmarshaller(String.class).unmarshall(context)); streamDescriptionSummary.setRetentionPeriodHours(context.getUnmarshaller(Integer.class).unmarshall(context)); streamDescriptionSummary.setStreamCreationTimestamp(context.getUnmarshaller(java.util.Date.class).unmarshall(context)); streamDescriptionSummary.setEnhancedMonitoring(new ListUnmarshaller<EnhancedMetrics>(EnhancedMetricsJsonUnmarshaller.getInstance()) .unmarshall(context)); streamDescriptionSummary.setEncryptionType(context.getUnmarshaller(String.class).unmarshall(context)); streamDescriptionSummary.setKeyId(context.getUnmarshaller(String.class).unmarshall(context)); streamDescriptionSummary.setOpenShardCount(context.getUnmarshaller(Integer.class).unmarshall(context)); streamDescriptionSummary.setConsumerCount(context.getUnmarshaller(Integer.class).unmarshall(context));
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeStreamSummaryResult == false) return false; DescribeStreamSummaryResult other = (DescribeStreamSummaryResult) obj; if (other.getStreamDescriptionSummary() == null ^ this.getStreamDescriptionSummary() == null) return false; if (other.getStreamDescriptionSummary() != null && other.getStreamDescriptionSummary().equals(this.getStreamDescriptionSummary()) == false) return false; return true; }
/** * Get the status of a Stream * * @param streamName * @return */ protected static String getStreamStatus(AmazonKinesis kinesisClient, String streamName) throws Exception { return describeStream(kinesisClient, streamName).getStreamStatus(); }
public static int getOpenShardCount(AmazonKinesisClient kinesisClient, String streamName) throws Exception { return StreamScalingUtils.describeStream(kinesisClient, streamName).getOpenShardCount(); }
/** * <p> * Represents the current enhanced monitoring settings of the stream. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param enhancedMonitoring <p> * Represents the current enhanced monitoring settings of the * stream. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public StreamDescriptionSummary withEnhancedMonitoring(EnhancedMetrics... enhancedMonitoring) { if (getEnhancedMonitoring() == null) { this.enhancedMonitoring = new java.util.ArrayList<EnhancedMetrics>( enhancedMonitoring.length); } for (EnhancedMetrics value : enhancedMonitoring) { this.enhancedMonitoring.add(value); } return this; }
return false; StreamDescriptionSummary other = (StreamDescriptionSummary) obj; if (other.getStreamName() == null ^ this.getStreamName() == null) return false; if (other.getStreamName() != null && other.getStreamName().equals(this.getStreamName()) == false) return false; if (other.getStreamARN() == null ^ this.getStreamARN() == null) return false; if (other.getStreamARN() != null && other.getStreamARN().equals(this.getStreamARN()) == false) return false; if (other.getStreamStatus() == null ^ this.getStreamStatus() == null) return false; if (other.getStreamStatus() != null && other.getStreamStatus().equals(this.getStreamStatus()) == false) return false; if (other.getRetentionPeriodHours() == null ^ this.getRetentionPeriodHours() == null) return false; if (other.getRetentionPeriodHours() != null && other.getRetentionPeriodHours().equals(this.getRetentionPeriodHours()) == false) return false; if (other.getStreamCreationTimestamp() == null ^ this.getStreamCreationTimestamp() == null) return false; if (other.getStreamCreationTimestamp() != null && other.getStreamCreationTimestamp().equals(this.getStreamCreationTimestamp()) == false) return false; if (other.getEnhancedMonitoring() == null ^ this.getEnhancedMonitoring() == null) return false; if (other.getEnhancedMonitoring() != null && other.getEnhancedMonitoring().equals(this.getEnhancedMonitoring()) == false) return false; if (other.getEncryptionType() == null ^ this.getEncryptionType() == null) return false; if (other.getEncryptionType() != null && other.getEncryptionType().equals(this.getEncryptionType()) == false)
StreamDescriptionSummary streamDescriptionSummary = new StreamDescriptionSummary(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("StreamName")) { streamDescriptionSummary.setStreamName(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("StreamARN")) { streamDescriptionSummary.setStreamARN(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("StreamStatus")) { streamDescriptionSummary.setStreamStatus(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("RetentionPeriodHours")) { streamDescriptionSummary.setRetentionPeriodHours(IntegerJsonUnmarshaller .getInstance() .unmarshall(context)); } else if (name.equals("StreamCreationTimestamp")) { streamDescriptionSummary.setStreamCreationTimestamp(DateJsonUnmarshaller .getInstance() .unmarshall(context)); } else if (name.equals("EnhancedMonitoring")) { streamDescriptionSummary .setEnhancedMonitoring(new ListUnmarshaller<EnhancedMetrics>( EnhancedMetricsJsonUnmarshaller.getInstance() streamDescriptionSummary.setEncryptionType(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("KeyId")) {
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeStreamSummaryResult == false) return false; DescribeStreamSummaryResult other = (DescribeStreamSummaryResult) obj; if (other.getStreamDescriptionSummary() == null ^ this.getStreamDescriptionSummary() == null) return false; if (other.getStreamDescriptionSummary() != null && other.getStreamDescriptionSummary().equals(this.getStreamDescriptionSummary()) == false) return false; return true; } }
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getStreamName() != null) sb.append("StreamName: ").append(getStreamName()).append(","); if (getStreamARN() != null) sb.append("StreamARN: ").append(getStreamARN()).append(","); if (getStreamStatus() != null) sb.append("StreamStatus: ").append(getStreamStatus()).append(","); if (getRetentionPeriodHours() != null) sb.append("RetentionPeriodHours: ").append(getRetentionPeriodHours()).append(","); if (getStreamCreationTimestamp() != null) sb.append("StreamCreationTimestamp: ").append(getStreamCreationTimestamp()).append(","); if (getEnhancedMonitoring() != null) sb.append("EnhancedMonitoring: ").append(getEnhancedMonitoring()).append(","); if (getEncryptionType() != null) sb.append("EncryptionType: ").append(getEncryptionType()).append(","); if (getKeyId() != null) sb.append("KeyId: ").append(getKeyId()).append(","); if (getOpenShardCount() != null) sb.append("OpenShardCount: ").append(getOpenShardCount()).append(","); if (getConsumerCount() != null) sb.append("ConsumerCount: ").append(getConsumerCount()); sb.append("}"); return sb.toString();
public StreamDescriptionSummary unmarshall(JsonUnmarshallerContext context) throws Exception { StreamDescriptionSummary streamDescriptionSummary = new StreamDescriptionSummary(); if (context.testExpression("StreamName", targetDepth)) { context.nextToken(); streamDescriptionSummary.setStreamName(context.getUnmarshaller(String.class).unmarshall(context)); streamDescriptionSummary.setStreamARN(context.getUnmarshaller(String.class).unmarshall(context)); streamDescriptionSummary.setStreamStatus(context.getUnmarshaller(String.class).unmarshall(context)); streamDescriptionSummary.setRetentionPeriodHours(context.getUnmarshaller(Integer.class).unmarshall(context)); streamDescriptionSummary.setStreamCreationTimestamp(context.getUnmarshaller(java.util.Date.class).unmarshall(context)); streamDescriptionSummary.setEnhancedMonitoring(new ListUnmarshaller<EnhancedMetrics>(EnhancedMetricsJsonUnmarshaller.getInstance()) .unmarshall(context)); streamDescriptionSummary.setEncryptionType(context.getUnmarshaller(String.class).unmarshall(context)); streamDescriptionSummary.setKeyId(context.getUnmarshaller(String.class).unmarshall(context)); streamDescriptionSummary.setOpenShardCount(context.getUnmarshaller(Integer.class).unmarshall(context)); streamDescriptionSummary.setConsumerCount(context.getUnmarshaller(Integer.class).unmarshall(context));
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeStreamSummaryResult == false) return false; DescribeStreamSummaryResult other = (DescribeStreamSummaryResult) obj; if (other.getStreamDescriptionSummary() == null ^ this.getStreamDescriptionSummary() == null) return false; if (other.getStreamDescriptionSummary() != null && other.getStreamDescriptionSummary().equals(this.getStreamDescriptionSummary()) == false) return false; return true; }
/** * Marshall the given parameter object. */ public void marshall(StreamDescriptionSummary streamDescriptionSummary, ProtocolMarshaller protocolMarshaller) { if (streamDescriptionSummary == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(streamDescriptionSummary.getStreamName(), STREAMNAME_BINDING); protocolMarshaller.marshall(streamDescriptionSummary.getStreamARN(), STREAMARN_BINDING); protocolMarshaller.marshall(streamDescriptionSummary.getStreamStatus(), STREAMSTATUS_BINDING); protocolMarshaller.marshall(streamDescriptionSummary.getRetentionPeriodHours(), RETENTIONPERIODHOURS_BINDING); protocolMarshaller.marshall(streamDescriptionSummary.getStreamCreationTimestamp(), STREAMCREATIONTIMESTAMP_BINDING); protocolMarshaller.marshall(streamDescriptionSummary.getEnhancedMonitoring(), ENHANCEDMONITORING_BINDING); protocolMarshaller.marshall(streamDescriptionSummary.getEncryptionType(), ENCRYPTIONTYPE_BINDING); protocolMarshaller.marshall(streamDescriptionSummary.getKeyId(), KEYID_BINDING); protocolMarshaller.marshall(streamDescriptionSummary.getOpenShardCount(), OPENSHARDCOUNT_BINDING); protocolMarshaller.marshall(streamDescriptionSummary.getConsumerCount(), CONSUMERCOUNT_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStreamName() == null) ? 0 : getStreamName().hashCode()); hashCode = prime * hashCode + ((getStreamARN() == null) ? 0 : getStreamARN().hashCode()); hashCode = prime * hashCode + ((getStreamStatus() == null) ? 0 : getStreamStatus().hashCode()); hashCode = prime * hashCode + ((getRetentionPeriodHours() == null) ? 0 : getRetentionPeriodHours().hashCode()); hashCode = prime * hashCode + ((getStreamCreationTimestamp() == null) ? 0 : getStreamCreationTimestamp() .hashCode()); hashCode = prime * hashCode + ((getEnhancedMonitoring() == null) ? 0 : getEnhancedMonitoring().hashCode()); hashCode = prime * hashCode + ((getEncryptionType() == null) ? 0 : getEncryptionType().hashCode()); hashCode = prime * hashCode + ((getKeyId() == null) ? 0 : getKeyId().hashCode()); hashCode = prime * hashCode + ((getOpenShardCount() == null) ? 0 : getOpenShardCount().hashCode()); return hashCode; }
if (other.getStreamName() == null ^ this.getStreamName() == null) return false; if (other.getStreamName() != null && other.getStreamName().equals(this.getStreamName()) == false) return false; if (other.getStreamARN() == null ^ this.getStreamARN() == null) return false; if (other.getStreamARN() != null && other.getStreamARN().equals(this.getStreamARN()) == false) return false; if (other.getStreamStatus() == null ^ this.getStreamStatus() == null) return false; if (other.getStreamStatus() != null && other.getStreamStatus().equals(this.getStreamStatus()) == false) return false; if (other.getRetentionPeriodHours() == null ^ this.getRetentionPeriodHours() == null) return false; if (other.getRetentionPeriodHours() != null && other.getRetentionPeriodHours().equals(this.getRetentionPeriodHours()) == false) return false; if (other.getStreamCreationTimestamp() == null ^ this.getStreamCreationTimestamp() == null) return false; if (other.getStreamCreationTimestamp() != null && other.getStreamCreationTimestamp().equals(this.getStreamCreationTimestamp()) == false) return false; if (other.getEnhancedMonitoring() == null ^ this.getEnhancedMonitoring() == null) return false; if (other.getEnhancedMonitoring() != null && other.getEnhancedMonitoring().equals(this.getEnhancedMonitoring()) == false)
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getStreamName() != null) sb.append("StreamName: " + getStreamName() + ","); if (getStreamARN() != null) sb.append("StreamARN: " + getStreamARN() + ","); if (getStreamStatus() != null) sb.append("StreamStatus: " + getStreamStatus() + ","); if (getRetentionPeriodHours() != null) sb.append("RetentionPeriodHours: " + getRetentionPeriodHours() + ","); if (getStreamCreationTimestamp() != null) sb.append("StreamCreationTimestamp: " + getStreamCreationTimestamp() + ","); if (getEnhancedMonitoring() != null) sb.append("EnhancedMonitoring: " + getEnhancedMonitoring() + ","); if (getEncryptionType() != null) sb.append("EncryptionType: " + getEncryptionType() + ","); if (getKeyId() != null) sb.append("KeyId: " + getKeyId() + ","); if (getOpenShardCount() != null) sb.append("OpenShardCount: " + getOpenShardCount()); sb.append("}"); return sb.toString();
public void marshall(StreamDescriptionSummary streamDescriptionSummary, AwsJsonWriter jsonWriter) throws Exception { jsonWriter.beginObject(); if (streamDescriptionSummary.getStreamName() != null) { String streamName = streamDescriptionSummary.getStreamName(); jsonWriter.name("StreamName"); jsonWriter.value(streamName); if (streamDescriptionSummary.getStreamARN() != null) { String streamARN = streamDescriptionSummary.getStreamARN(); jsonWriter.name("StreamARN"); jsonWriter.value(streamARN); if (streamDescriptionSummary.getStreamStatus() != null) { String streamStatus = streamDescriptionSummary.getStreamStatus(); jsonWriter.name("StreamStatus"); jsonWriter.value(streamStatus); if (streamDescriptionSummary.getRetentionPeriodHours() != null) { Integer retentionPeriodHours = streamDescriptionSummary.getRetentionPeriodHours(); jsonWriter.name("RetentionPeriodHours"); jsonWriter.value(retentionPeriodHours); if (streamDescriptionSummary.getStreamCreationTimestamp() != null) { java.util.Date streamCreationTimestamp = streamDescriptionSummary .getStreamCreationTimestamp(); jsonWriter.name("StreamCreationTimestamp"); jsonWriter.value(streamCreationTimestamp); if (streamDescriptionSummary.getEnhancedMonitoring() != null) {
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStreamName() == null) ? 0 : getStreamName().hashCode()); hashCode = prime * hashCode + ((getStreamARN() == null) ? 0 : getStreamARN().hashCode()); hashCode = prime * hashCode + ((getStreamStatus() == null) ? 0 : getStreamStatus().hashCode()); hashCode = prime * hashCode + ((getRetentionPeriodHours() == null) ? 0 : getRetentionPeriodHours().hashCode()); hashCode = prime * hashCode + ((getStreamCreationTimestamp() == null) ? 0 : getStreamCreationTimestamp().hashCode()); hashCode = prime * hashCode + ((getEnhancedMonitoring() == null) ? 0 : getEnhancedMonitoring().hashCode()); hashCode = prime * hashCode + ((getEncryptionType() == null) ? 0 : getEncryptionType().hashCode()); hashCode = prime * hashCode + ((getKeyId() == null) ? 0 : getKeyId().hashCode()); hashCode = prime * hashCode + ((getOpenShardCount() == null) ? 0 : getOpenShardCount().hashCode()); hashCode = prime * hashCode + ((getConsumerCount() == null) ? 0 : getConsumerCount().hashCode()); return hashCode; }
return false; StreamDescriptionSummary other = (StreamDescriptionSummary) obj; if (other.getStreamName() == null ^ this.getStreamName() == null) return false; if (other.getStreamName() != null && other.getStreamName().equals(this.getStreamName()) == false) return false; if (other.getStreamARN() == null ^ this.getStreamARN() == null) return false; if (other.getStreamARN() != null && other.getStreamARN().equals(this.getStreamARN()) == false) return false; if (other.getStreamStatus() == null ^ this.getStreamStatus() == null) return false; if (other.getStreamStatus() != null && other.getStreamStatus().equals(this.getStreamStatus()) == false) return false; if (other.getRetentionPeriodHours() == null ^ this.getRetentionPeriodHours() == null) return false; if (other.getRetentionPeriodHours() != null && other.getRetentionPeriodHours().equals(this.getRetentionPeriodHours()) == false) return false; if (other.getStreamCreationTimestamp() == null ^ this.getStreamCreationTimestamp() == null) return false; if (other.getStreamCreationTimestamp() != null && other.getStreamCreationTimestamp().equals(this.getStreamCreationTimestamp()) == false) return false; if (other.getEnhancedMonitoring() == null ^ this.getEnhancedMonitoring() == null) return false; if (other.getEnhancedMonitoring() != null && other.getEnhancedMonitoring().equals(this.getEnhancedMonitoring()) == false) return false; if (other.getEncryptionType() == null ^ this.getEncryptionType() == null) return false; if (other.getEncryptionType() != null && other.getEncryptionType().equals(this.getEncryptionType()) == false)
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getStreamName() != null) sb.append("StreamName: ").append(getStreamName()).append(","); if (getStreamARN() != null) sb.append("StreamARN: ").append(getStreamARN()).append(","); if (getStreamStatus() != null) sb.append("StreamStatus: ").append(getStreamStatus()).append(","); if (getRetentionPeriodHours() != null) sb.append("RetentionPeriodHours: ").append(getRetentionPeriodHours()).append(","); if (getStreamCreationTimestamp() != null) sb.append("StreamCreationTimestamp: ").append(getStreamCreationTimestamp()).append(","); if (getEnhancedMonitoring() != null) sb.append("EnhancedMonitoring: ").append(getEnhancedMonitoring()).append(","); if (getEncryptionType() != null) sb.append("EncryptionType: ").append(getEncryptionType()).append(","); if (getKeyId() != null) sb.append("KeyId: ").append(getKeyId()).append(","); if (getOpenShardCount() != null) sb.append("OpenShardCount: ").append(getOpenShardCount()).append(","); if (getConsumerCount() != null) sb.append("ConsumerCount: ").append(getConsumerCount()); sb.append("}"); return sb.toString();