/* * 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.applicationdiscovery.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Information about agents associated with the user’s Amazon Web Services account. Information includes agent IDs, IP * addresses, media access control (MAC) addresses, agent or collector status, hostname where the agent resides, and * agent version for each agent. *
*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AgentInfo implements Serializable, Cloneable, StructuredPojo { /** ** The agent or collector ID. *
*/ private String agentId; /** ** The name of the host where the agent or collector resides. The host can be a server or virtual machine. *
*/ private String hostName; /** ** Network details about the host where the agent or collector resides. *
*/ private java.util.List* The ID of the connector. *
*/ private String connectorId; /** ** The agent or collector version. *
*/ private String version; /** ** The health of the agent. *
*/ private String health; /** ** Time since agent health was reported. *
*/ private String lastHealthPingTime; /** ** Status of the collection process for an agent. *
*/ private String collectionStatus; /** ** Type of agent. *
*/ private String agentType; /** ** Agent's first registration timestamp in UTC. *
*/ private String registeredTime; /** ** The agent or collector ID. *
* * @param agentId * The agent or collector ID. */ public void setAgentId(String agentId) { this.agentId = agentId; } /** ** The agent or collector ID. *
* * @return The agent or collector ID. */ public String getAgentId() { return this.agentId; } /** ** The agent or collector ID. *
* * @param agentId * The agent or collector ID. * @return Returns a reference to this object so that method calls can be chained together. */ public AgentInfo withAgentId(String agentId) { setAgentId(agentId); return this; } /** ** The name of the host where the agent or collector resides. The host can be a server or virtual machine. *
* * @param hostName * The name of the host where the agent or collector resides. The host can be a server or virtual machine. */ public void setHostName(String hostName) { this.hostName = hostName; } /** ** The name of the host where the agent or collector resides. The host can be a server or virtual machine. *
* * @return The name of the host where the agent or collector resides. The host can be a server or virtual machine. */ public String getHostName() { return this.hostName; } /** ** The name of the host where the agent or collector resides. The host can be a server or virtual machine. *
* * @param hostName * The name of the host where the agent or collector resides. The host can be a server or virtual machine. * @return Returns a reference to this object so that method calls can be chained together. */ public AgentInfo withHostName(String hostName) { setHostName(hostName); return this; } /** ** Network details about the host where the agent or collector resides. *
* * @return Network details about the host where the agent or collector resides. */ public java.util.List* Network details about the host where the agent or collector resides. *
* * @param agentNetworkInfoList * Network details about the host where the agent or collector resides. */ public void setAgentNetworkInfoList(java.util.Collection* Network details about the host where the agent or collector resides. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setAgentNetworkInfoList(java.util.Collection)} or {@link #withAgentNetworkInfoList(java.util.Collection)} * if you want to override the existing values. *
* * @param agentNetworkInfoList * Network details about the host where the agent or collector resides. * @return Returns a reference to this object so that method calls can be chained together. */ public AgentInfo withAgentNetworkInfoList(AgentNetworkInfo... agentNetworkInfoList) { if (this.agentNetworkInfoList == null) { setAgentNetworkInfoList(new java.util.ArrayList* Network details about the host where the agent or collector resides. *
* * @param agentNetworkInfoList * Network details about the host where the agent or collector resides. * @return Returns a reference to this object so that method calls can be chained together. */ public AgentInfo withAgentNetworkInfoList(java.util.Collection* The ID of the connector. *
* * @param connectorId * The ID of the connector. */ public void setConnectorId(String connectorId) { this.connectorId = connectorId; } /** ** The ID of the connector. *
* * @return The ID of the connector. */ public String getConnectorId() { return this.connectorId; } /** ** The ID of the connector. *
* * @param connectorId * The ID of the connector. * @return Returns a reference to this object so that method calls can be chained together. */ public AgentInfo withConnectorId(String connectorId) { setConnectorId(connectorId); return this; } /** ** The agent or collector version. *
* * @param version * The agent or collector version. */ public void setVersion(String version) { this.version = version; } /** ** The agent or collector version. *
* * @return The agent or collector version. */ public String getVersion() { return this.version; } /** ** The agent or collector version. *
* * @param version * The agent or collector version. * @return Returns a reference to this object so that method calls can be chained together. */ public AgentInfo withVersion(String version) { setVersion(version); return this; } /** ** The health of the agent. *
* * @param health * The health of the agent. * @see AgentStatus */ public void setHealth(String health) { this.health = health; } /** ** The health of the agent. *
* * @return The health of the agent. * @see AgentStatus */ public String getHealth() { return this.health; } /** ** The health of the agent. *
* * @param health * The health of the agent. * @return Returns a reference to this object so that method calls can be chained together. * @see AgentStatus */ public AgentInfo withHealth(String health) { setHealth(health); return this; } /** ** The health of the agent. *
* * @param health * The health of the agent. * @see AgentStatus */ public void setHealth(AgentStatus health) { withHealth(health); } /** ** The health of the agent. *
* * @param health * The health of the agent. * @return Returns a reference to this object so that method calls can be chained together. * @see AgentStatus */ public AgentInfo withHealth(AgentStatus health) { this.health = health.toString(); return this; } /** ** Time since agent health was reported. *
* * @param lastHealthPingTime * Time since agent health was reported. */ public void setLastHealthPingTime(String lastHealthPingTime) { this.lastHealthPingTime = lastHealthPingTime; } /** ** Time since agent health was reported. *
* * @return Time since agent health was reported. */ public String getLastHealthPingTime() { return this.lastHealthPingTime; } /** ** Time since agent health was reported. *
* * @param lastHealthPingTime * Time since agent health was reported. * @return Returns a reference to this object so that method calls can be chained together. */ public AgentInfo withLastHealthPingTime(String lastHealthPingTime) { setLastHealthPingTime(lastHealthPingTime); return this; } /** ** Status of the collection process for an agent. *
* * @param collectionStatus * Status of the collection process for an agent. */ public void setCollectionStatus(String collectionStatus) { this.collectionStatus = collectionStatus; } /** ** Status of the collection process for an agent. *
* * @return Status of the collection process for an agent. */ public String getCollectionStatus() { return this.collectionStatus; } /** ** Status of the collection process for an agent. *
* * @param collectionStatus * Status of the collection process for an agent. * @return Returns a reference to this object so that method calls can be chained together. */ public AgentInfo withCollectionStatus(String collectionStatus) { setCollectionStatus(collectionStatus); return this; } /** ** Type of agent. *
* * @param agentType * Type of agent. */ public void setAgentType(String agentType) { this.agentType = agentType; } /** ** Type of agent. *
* * @return Type of agent. */ public String getAgentType() { return this.agentType; } /** ** Type of agent. *
* * @param agentType * Type of agent. * @return Returns a reference to this object so that method calls can be chained together. */ public AgentInfo withAgentType(String agentType) { setAgentType(agentType); return this; } /** ** Agent's first registration timestamp in UTC. *
* * @param registeredTime * Agent's first registration timestamp in UTC. */ public void setRegisteredTime(String registeredTime) { this.registeredTime = registeredTime; } /** ** Agent's first registration timestamp in UTC. *
* * @return Agent's first registration timestamp in UTC. */ public String getRegisteredTime() { return this.registeredTime; } /** ** Agent's first registration timestamp in UTC. *
* * @param registeredTime * Agent's first registration timestamp in UTC. * @return Returns a reference to this object so that method calls can be chained together. */ public AgentInfo withRegisteredTime(String registeredTime) { setRegisteredTime(registeredTime); 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 (getAgentId() != null) sb.append("AgentId: ").append(getAgentId()).append(","); if (getHostName() != null) sb.append("HostName: ").append(getHostName()).append(","); if (getAgentNetworkInfoList() != null) sb.append("AgentNetworkInfoList: ").append(getAgentNetworkInfoList()).append(","); if (getConnectorId() != null) sb.append("ConnectorId: ").append(getConnectorId()).append(","); if (getVersion() != null) sb.append("Version: ").append(getVersion()).append(","); if (getHealth() != null) sb.append("Health: ").append(getHealth()).append(","); if (getLastHealthPingTime() != null) sb.append("LastHealthPingTime: ").append(getLastHealthPingTime()).append(","); if (getCollectionStatus() != null) sb.append("CollectionStatus: ").append(getCollectionStatus()).append(","); if (getAgentType() != null) sb.append("AgentType: ").append(getAgentType()).append(","); if (getRegisteredTime() != null) sb.append("RegisteredTime: ").append(getRegisteredTime()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AgentInfo == false) return false; AgentInfo other = (AgentInfo) obj; if (other.getAgentId() == null ^ this.getAgentId() == null) return false; if (other.getAgentId() != null && other.getAgentId().equals(this.getAgentId()) == false) return false; if (other.getHostName() == null ^ this.getHostName() == null) return false; if (other.getHostName() != null && other.getHostName().equals(this.getHostName()) == false) return false; if (other.getAgentNetworkInfoList() == null ^ this.getAgentNetworkInfoList() == null) return false; if (other.getAgentNetworkInfoList() != null && other.getAgentNetworkInfoList().equals(this.getAgentNetworkInfoList()) == false) return false; if (other.getConnectorId() == null ^ this.getConnectorId() == null) return false; if (other.getConnectorId() != null && other.getConnectorId().equals(this.getConnectorId()) == false) return false; if (other.getVersion() == null ^ this.getVersion() == null) return false; if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false) return false; if (other.getHealth() == null ^ this.getHealth() == null) return false; if (other.getHealth() != null && other.getHealth().equals(this.getHealth()) == false) return false; if (other.getLastHealthPingTime() == null ^ this.getLastHealthPingTime() == null) return false; if (other.getLastHealthPingTime() != null && other.getLastHealthPingTime().equals(this.getLastHealthPingTime()) == false) return false; if (other.getCollectionStatus() == null ^ this.getCollectionStatus() == null) return false; if (other.getCollectionStatus() != null && other.getCollectionStatus().equals(this.getCollectionStatus()) == false) return false; if (other.getAgentType() == null ^ this.getAgentType() == null) return false; if (other.getAgentType() != null && other.getAgentType().equals(this.getAgentType()) == false) return false; if (other.getRegisteredTime() == null ^ this.getRegisteredTime() == null) return false; if (other.getRegisteredTime() != null && other.getRegisteredTime().equals(this.getRegisteredTime()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAgentId() == null) ? 0 : getAgentId().hashCode()); hashCode = prime * hashCode + ((getHostName() == null) ? 0 : getHostName().hashCode()); hashCode = prime * hashCode + ((getAgentNetworkInfoList() == null) ? 0 : getAgentNetworkInfoList().hashCode()); hashCode = prime * hashCode + ((getConnectorId() == null) ? 0 : getConnectorId().hashCode()); hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode()); hashCode = prime * hashCode + ((getHealth() == null) ? 0 : getHealth().hashCode()); hashCode = prime * hashCode + ((getLastHealthPingTime() == null) ? 0 : getLastHealthPingTime().hashCode()); hashCode = prime * hashCode + ((getCollectionStatus() == null) ? 0 : getCollectionStatus().hashCode()); hashCode = prime * hashCode + ((getAgentType() == null) ? 0 : getAgentType().hashCode()); hashCode = prime * hashCode + ((getRegisteredTime() == null) ? 0 : getRegisteredTime().hashCode()); return hashCode; } @Override public AgentInfo clone() { try { return (AgentInfo) 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.applicationdiscovery.model.transform.AgentInfoMarshaller.getInstance().marshall(this, protocolMarshaller); } }