/** * Simplified method form for invoking the DescribeAlarms operation with an AsyncHandler. * * @see #describeAlarmsAsync(DescribeAlarmsRequest, com.amazonaws.handlers.AsyncHandler) */ @Override public java.util.concurrent.Future<DescribeAlarmsResult> describeAlarmsAsync( com.amazonaws.handlers.AsyncHandler<DescribeAlarmsRequest, DescribeAlarmsResult> asyncHandler) { return describeAlarmsAsync(new DescribeAlarmsRequest(), asyncHandler); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAlarmNames() == null) ? 0 : getAlarmNames().hashCode()); hashCode = prime * hashCode + ((getAlarmNamePrefix() == null) ? 0 : getAlarmNamePrefix().hashCode()); hashCode = prime * hashCode + ((getStateValue() == null) ? 0 : getStateValue().hashCode()); hashCode = prime * hashCode + ((getActionPrefix() == null) ? 0 : getActionPrefix().hashCode()); hashCode = prime * hashCode + ((getMaxRecords() == null) ? 0 : getMaxRecords().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); return hashCode; }
/** * <p> * The names of the alarms. * </p> * * @param alarmNames * The names of the alarms. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeAlarmsRequest withAlarmNames(java.util.Collection<String> alarmNames) { setAlarmNames(alarmNames); return this; }
public static void main(String[] args) { final AmazonCloudWatch cw = AmazonCloudWatchClientBuilder.defaultClient(); boolean done = false; DescribeAlarmsRequest request = new DescribeAlarmsRequest(); while(!done) { DescribeAlarmsResult response = cw.describeAlarms(request); for(MetricAlarm alarm : response.getMetricAlarms()) { System.out.printf("Retrieved alarm %s", alarm.getAlarmName()); } request.setNextToken(response.getNextToken()); if(response.getNextToken() == null) { done = true; } } } }
/** * <p> * The token returned by a previous call to indicate that there is more data available. * </p> * * @param nextToken * The token returned by a previous call to indicate that there is more data available. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeAlarmsRequest withNextToken(String nextToken) { setNextToken(nextToken); return this; }
/** * <p> * A list of alarm names to retrieve information for. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param alarmNames <p> * A list of alarm names to retrieve information for. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public DescribeAlarmsRequest withAlarmNames(String... alarmNames) { if (getAlarmNames() == null) { this.alarmNames = new java.util.ArrayList<String>(alarmNames.length); } for (String value : alarmNames) { this.alarmNames.add(value); } return this; }
return false; DescribeAlarmsRequest other = (DescribeAlarmsRequest) obj; if (other.getAlarmNames() == null ^ this.getAlarmNames() == null) return false; if (other.getAlarmNames() != null && other.getAlarmNames().equals(this.getAlarmNames()) == false) return false; if (other.getAlarmNamePrefix() == null ^ this.getAlarmNamePrefix() == null) return false; if (other.getAlarmNamePrefix() != null && other.getAlarmNamePrefix().equals(this.getAlarmNamePrefix()) == false) return false; if (other.getStateValue() == null ^ this.getStateValue() == null) return false; if (other.getStateValue() != null && other.getStateValue().equals(this.getStateValue()) == false) return false; if (other.getActionPrefix() == null ^ this.getActionPrefix() == null) return false; if (other.getActionPrefix() != null && other.getActionPrefix().equals(this.getActionPrefix()) == false) return false; if (other.getMaxRecords() == null ^ this.getMaxRecords() == null) return false; if (other.getMaxRecords() != null && other.getMaxRecords().equals(this.getMaxRecords()) == false) return false; if (other.getNextToken() == null ^ this.getNextToken() == null) return false; if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false) return false; return true;
/** * Simplified method form for invoking the DescribeAlarms operation. * * @see #describeAlarmsAsync(DescribeAlarmsRequest) */ @Override public java.util.concurrent.Future<DescribeAlarmsResult> describeAlarmsAsync() { return describeAlarmsAsync(new DescribeAlarmsRequest()); }
/** * <p> * The names of the alarms. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setAlarmNames(java.util.Collection)} or {@link #withAlarmNames(java.util.Collection)} if you want to * override the existing values. * </p> * * @param alarmNames * The names of the alarms. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeAlarmsRequest withAlarmNames(String... alarmNames) { if (this.alarmNames == null) { setAlarmNames(new com.amazonaws.internal.SdkInternalList<String>(alarmNames.length)); } for (String ele : alarmNames) { this.alarmNames.add(ele); } 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 (getAlarmNames() != null) sb.append("AlarmNames: ").append(getAlarmNames()).append(","); if (getAlarmNamePrefix() != null) sb.append("AlarmNamePrefix: ").append(getAlarmNamePrefix()).append(","); if (getStateValue() != null) sb.append("StateValue: ").append(getStateValue()).append(","); if (getActionPrefix() != null) sb.append("ActionPrefix: ").append(getActionPrefix()).append(","); if (getMaxRecords() != null) sb.append("MaxRecords: ").append(getMaxRecords()).append(","); if (getNextToken() != null) sb.append("NextToken: ").append(getNextToken()); sb.append("}"); return sb.toString(); }
/** * Simplified method form for invoking the DescribeAlarms operation with an AsyncHandler. * * @see #describeAlarmsAsync(DescribeAlarmsRequest, com.amazonaws.handlers.AsyncHandler) */ @Override public java.util.concurrent.Future<DescribeAlarmsResult> describeAlarmsAsync( com.amazonaws.handlers.AsyncHandler<DescribeAlarmsRequest, DescribeAlarmsResult> asyncHandler) { return describeAlarmsAsync(new DescribeAlarmsRequest(), asyncHandler); }
/** * <p> * A list of alarm names to retrieve information for. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param alarmNames <p> * A list of alarm names to retrieve information for. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public DescribeAlarmsRequest withAlarmNames(java.util.Collection<String> alarmNames) { setAlarmNames(alarmNames); return this; }
request.setHttpMethod(HttpMethodName.POST); if (!describeAlarmsRequest.getAlarmNames().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) describeAlarmsRequest.getAlarmNames()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<String> alarmNamesList = (com.amazonaws.internal.SdkInternalList<String>) describeAlarmsRequest .getAlarmNames(); int alarmNamesListIndex = 1; if (describeAlarmsRequest.getAlarmNamePrefix() != null) { request.addParameter("AlarmNamePrefix", StringUtils.fromString(describeAlarmsRequest.getAlarmNamePrefix())); if (describeAlarmsRequest.getStateValue() != null) { request.addParameter("StateValue", StringUtils.fromString(describeAlarmsRequest.getStateValue())); if (describeAlarmsRequest.getActionPrefix() != null) { request.addParameter("ActionPrefix", StringUtils.fromString(describeAlarmsRequest.getActionPrefix())); if (describeAlarmsRequest.getMaxRecords() != null) { request.addParameter("MaxRecords", StringUtils.fromInteger(describeAlarmsRequest.getMaxRecords())); if (describeAlarmsRequest.getNextToken() != null) { request.addParameter("NextToken", StringUtils.fromString(describeAlarmsRequest.getNextToken()));
/** * Simplified method form for invoking the DescribeAlarms operation. * * @see #describeAlarmsAsync(DescribeAlarmsRequest) */ @Override public java.util.concurrent.Future<DescribeAlarmsResult> describeAlarmsAsync() { return describeAlarmsAsync(new DescribeAlarmsRequest()); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAlarmNames() == null) ? 0 : getAlarmNames().hashCode()); hashCode = prime * hashCode + ((getAlarmNamePrefix() == null) ? 0 : getAlarmNamePrefix().hashCode()); hashCode = prime * hashCode + ((getStateValue() == null) ? 0 : getStateValue().hashCode()); hashCode = prime * hashCode + ((getActionPrefix() == null) ? 0 : getActionPrefix().hashCode()); hashCode = prime * hashCode + ((getMaxRecords() == null) ? 0 : getMaxRecords().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); return hashCode; }
@Override public DescribeAlarmsResult describeAlarms() { return describeAlarms(new DescribeAlarmsRequest()); }
if (other.getAlarmNames() == null ^ this.getAlarmNames() == null) return false; if (other.getAlarmNames() != null && other.getAlarmNames().equals(this.getAlarmNames()) == false) return false; if (other.getAlarmNamePrefix() == null ^ this.getAlarmNamePrefix() == null) return false; if (other.getAlarmNamePrefix() != null && other.getAlarmNamePrefix().equals(this.getAlarmNamePrefix()) == false) return false; if (other.getStateValue() == null ^ this.getStateValue() == null) return false; if (other.getStateValue() != null && other.getStateValue().equals(this.getStateValue()) == false) return false; if (other.getActionPrefix() == null ^ this.getActionPrefix() == null) return false; if (other.getActionPrefix() != null && other.getActionPrefix().equals(this.getActionPrefix()) == false) return false; if (other.getMaxRecords() == null ^ this.getMaxRecords() == null) return false; if (other.getMaxRecords() != null && other.getMaxRecords().equals(this.getMaxRecords()) == false) return false; if (other.getNextToken() == null ^ this.getNextToken() == null) return false; if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
@Override public DescribeAlarmsResult describeAlarms() { return describeAlarms(new DescribeAlarmsRequest()); }
/** * 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 (getAlarmNames() != null) sb.append("AlarmNames: " + getAlarmNames() + ","); if (getAlarmNamePrefix() != null) sb.append("AlarmNamePrefix: " + getAlarmNamePrefix() + ","); if (getStateValue() != null) sb.append("StateValue: " + getStateValue() + ","); if (getActionPrefix() != null) sb.append("ActionPrefix: " + getActionPrefix() + ","); if (getMaxRecords() != null) sb.append("MaxRecords: " + getMaxRecords() + ","); if (getNextToken() != null) sb.append("NextToken: " + getNextToken()); sb.append("}"); return sb.toString(); }
/** * <p> * Retrieves alarms with the specified names. If no name is specified, all * alarms for the user are returned. Alarms can be retrieved by using only a * prefix for the alarm name, the alarm state, or a prefix for any action. * </p> * * @return describeAlarmsResult The response from the DescribeAlarms service * method, as returned by Amazon CloudWatch. * @throws InvalidNextTokenException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * CloudWatch indicating either a problem with the data in the * request, or a server side issue. */ public DescribeAlarmsResult describeAlarms() throws AmazonServiceException, AmazonClientException { DescribeAlarmsRequest describeAlarmsRequest = new DescribeAlarmsRequest(); return describeAlarms(describeAlarmsRequest); }