@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getActivityId() == null) ? 0 : getActivityId().hashCode()); hashCode = prime * hashCode + ((getAutoScalingGroupName() == null) ? 0 : getAutoScalingGroupName().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getCause() == null) ? 0 : getCause().hashCode()); hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); hashCode = prime * hashCode + ((getStatusCode() == null) ? 0 : getStatusCode().hashCode()); hashCode = prime * hashCode + ((getStatusMessage() == null) ? 0 : getStatusMessage().hashCode()); hashCode = prime * hashCode + ((getProgress() == null) ? 0 : getProgress().hashCode()); hashCode = prime * hashCode + ((getDetails() == null) ? 0 : getDetails().hashCode()); return hashCode; }
public Activity unmarshall(StaxUnmarshallerContext context) throws Exception { Activity activity = new Activity(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; activity.setActivityId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; activity.setAutoScalingGroupName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; activity.setDescription(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; activity.setCause(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; activity.setStartTime(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context)); continue; activity.setEndTime(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context)); continue; activity.setStatusCode(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; activity.setStatusMessage(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; activity.setProgress(IntegerStaxUnmarshaller.getInstance().unmarshall(context));
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TerminateInstanceInAutoScalingGroupResult == false) return false; TerminateInstanceInAutoScalingGroupResult other = (TerminateInstanceInAutoScalingGroupResult) obj; if (other.getActivity() == null ^ this.getActivity() == null) return false; if (other.getActivity() != null && other.getActivity().equals(this.getActivity()) == false) return false; return true; }
/** * Fetch scaling activities and determine if the most recent activity was successful. * * A successful scaling activity is sufficient to indicate that a server group is no longer having launch failures. */ protected boolean hasLaunchFailures(AmazonAutoScaling amazonAutoScaling, EntityTags entityTags) { EntityTags.EntityRef entityRef = entityTags.getEntityRef(); try { DescribeScalingActivitiesResult describeScalingActivitiesResult = amazonAutoScaling.describeScalingActivities( new DescribeScalingActivitiesRequest().withAutoScalingGroupName(entityRef.getEntityId()) ); List<Activity> activities = describeScalingActivitiesResult.getActivities(); return !activities.isEmpty() && !activities.get(0).getStatusCode().equals(ScalingActivityStatusCode.Successful.toString()); } catch (Exception e) { AmazonServiceException amazonServiceException = amazonServiceException(e); if (amazonServiceException != null) { if (amazonServiceException.getErrorMessage().toLowerCase().contains("name not found")) { return false; } } throw e; } }
public Activity unmarshall(StaxUnmarshallerContext context) throws Exception { Activity activity = new Activity(); activity.setActivityId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; activity.setAutoScalingGroupName(StringStaxUnmarshaller.getInstance() .unmarshall(context)); continue; activity.setDescription(StringStaxUnmarshaller.getInstance() .unmarshall(context)); continue; activity.setCause(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; activity.setStartTime(DateStaxUnmarshaller.getInstance().unmarshall(context)); continue; activity.setEndTime(DateStaxUnmarshaller.getInstance().unmarshall(context)); continue; activity.setStatusCode(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; activity.setStatusMessage(StringStaxUnmarshaller.getInstance().unmarshall( context)); continue;
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TerminateInstanceInAutoScalingGroupResult == false) return false; TerminateInstanceInAutoScalingGroupResult other = (TerminateInstanceInAutoScalingGroupResult) obj; if (other.getActivity() == null ^ this.getActivity() == null) return false; if (other.getActivity() != null && other.getActivity().equals(this.getActivity()) == false) return false; return true; } }
return false; Activity other = (Activity) obj; if (other.getActivityId() == null ^ this.getActivityId() == null) return false; if (other.getActivityId() != null && other.getActivityId().equals(this.getActivityId()) == false) return false; if (other.getAutoScalingGroupName() == null ^ this.getAutoScalingGroupName() == null) return false; if (other.getAutoScalingGroupName() != null && other.getAutoScalingGroupName().equals(this.getAutoScalingGroupName()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getCause() == null ^ this.getCause() == null) return false; if (other.getCause() != null && other.getCause().equals(this.getCause()) == false) return false; if (other.getStartTime() == null ^ this.getStartTime() == null) return false; if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == false) return false; if (other.getEndTime() == null ^ this.getEndTime() == null) return false; if (other.getEndTime() != null && other.getEndTime().equals(this.getEndTime()) == false) return false; if (other.getStatusCode() == null ^ this.getStatusCode() == null) return false; if (other.getStatusCode() != null && other.getStatusCode().equals(this.getStatusCode()) == false)
public class MyBaseActivity extends Activity { protected MyApp mMyApp; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mMyApp = (MyApp)this.getApplicationContext(); } protected void onResume() { super.onResume(); mMyApp.setCurrentActivity(this); } protected void onPause() { clearReferences(); super.onPause(); } protected void onDestroy() { clearReferences(); super.onDestroy(); } private void clearReferences(){ Activity currActivity = mMyApp.getCurrentActivity(); if (currActivity != null && currActivity.equals(this)) mMyApp.setCurrentActivity(null); } }
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getActivityId() != null) sb.append("ActivityId: ").append(getActivityId()).append(","); if (getAutoScalingGroupName() != null) sb.append("AutoScalingGroupName: ").append(getAutoScalingGroupName()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getCause() != null) sb.append("Cause: ").append(getCause()).append(","); if (getStartTime() != null) sb.append("StartTime: ").append(getStartTime()).append(","); if (getEndTime() != null) sb.append("EndTime: ").append(getEndTime()).append(","); if (getStatusCode() != null) sb.append("StatusCode: ").append(getStatusCode()).append(","); if (getStatusMessage() != null) sb.append("StatusMessage: ").append(getStatusMessage()).append(","); if (getProgress() != null) sb.append("Progress: ").append(getProgress()).append(","); if (getDetails() != null) sb.append("Details: ").append(getDetails()); sb.append("}"); return sb.toString();
public class MyBaseActivity extends Activity { protected MyApp mMyApp; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mMyApp = (MyApp)this.getApplicationContext(); } protected void onResume() { super.onResume(); mMyApp.setCurrentActivity(this); } protected void onPause() { clearReferences(); super.onPause(); } protected void onDestroy() { clearReferences(); super.onDestroy(); } private void clearReferences(){ Activity currActivity = mMyApp.getCurrentActivity(); if (currActivity != null && currActivity.equals(this)) mMyApp.setCurrentActivity(null); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getActivityId() == null) ? 0 : getActivityId().hashCode()); hashCode = prime * hashCode + ((getAutoScalingGroupName() == null) ? 0 : getAutoScalingGroupName().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getCause() == null) ? 0 : getCause().hashCode()); hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); hashCode = prime * hashCode + ((getStatusCode() == null) ? 0 : getStatusCode().hashCode()); hashCode = prime * hashCode + ((getStatusMessage() == null) ? 0 : getStatusMessage().hashCode()); hashCode = prime * hashCode + ((getProgress() == null) ? 0 : getProgress().hashCode()); hashCode = prime * hashCode + ((getDetails() == null) ? 0 : getDetails().hashCode()); return hashCode; }
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getActivityId() != null) sb.append("ActivityId: " + getActivityId() + ","); if (getAutoScalingGroupName() != null) sb.append("AutoScalingGroupName: " + getAutoScalingGroupName() + ","); if (getDescription() != null) sb.append("Description: " + getDescription() + ","); if (getCause() != null) sb.append("Cause: " + getCause() + ","); if (getStartTime() != null) sb.append("StartTime: " + getStartTime() + ","); if (getEndTime() != null) sb.append("EndTime: " + getEndTime() + ","); if (getStatusCode() != null) sb.append("StatusCode: " + getStatusCode() + ","); if (getStatusMessage() != null) sb.append("StatusMessage: " + getStatusMessage() + ","); if (getProgress() != null) sb.append("Progress: " + getProgress() + ","); if (getDetails() != null) sb.append("Details: " + getDetails()); sb.append("}"); return sb.toString();
if (other.getActivityId() == null ^ this.getActivityId() == null) return false; if (other.getActivityId() != null && other.getActivityId().equals(this.getActivityId()) == false) return false; if (other.getAutoScalingGroupName() == null ^ this.getAutoScalingGroupName() == null) return false; if (other.getAutoScalingGroupName() != null && other.getAutoScalingGroupName().equals(this.getAutoScalingGroupName()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getCause() == null ^ this.getCause() == null) return false; if (other.getCause() != null && other.getCause().equals(this.getCause()) == false) return false; if (other.getStartTime() == null ^ this.getStartTime() == null) return false; if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == false) return false; if (other.getEndTime() == null ^ this.getEndTime() == null) return false; if (other.getEndTime() != null && other.getEndTime().equals(this.getEndTime()) == false) return false; if (other.getStatusCode() == null ^ this.getStatusCode() == null)
public void marshall(Activity _activity, Request<?> request, String _prefix) { String prefix; if (_activity.getActivityId() != null) { prefix = _prefix + "ActivityId"; String activityId = _activity.getActivityId(); request.addParameter(prefix, StringUtils.fromString(activityId)); if (_activity.getAutoScalingGroupName() != null) { prefix = _prefix + "AutoScalingGroupName"; String autoScalingGroupName = _activity.getAutoScalingGroupName(); request.addParameter(prefix, StringUtils.fromString(autoScalingGroupName)); if (_activity.getDescription() != null) { prefix = _prefix + "Description"; String description = _activity.getDescription(); request.addParameter(prefix, StringUtils.fromString(description)); if (_activity.getCause() != null) { prefix = _prefix + "Cause"; String cause = _activity.getCause(); request.addParameter(prefix, StringUtils.fromString(cause)); if (_activity.getStartTime() != null) { prefix = _prefix + "StartTime"; java.util.Date startTime = _activity.getStartTime(); request.addParameter(prefix, StringUtils.fromDate(startTime)); if (_activity.getEndTime() != null) { prefix = _prefix + "EndTime"; java.util.Date endTime = _activity.getEndTime();