String agentState = host.getAgentState(); if (CommonStatesConstants.ACTIVE.equals(host.getState()) && StringUtils.isNotBlank(agentState)) { fields.put(ObjectMetaDataManager.STATE_FIELD, agentState);
@SuppressWarnings("unchecked") public HostMetaData(String agent_ip, Host host, Account account) { super(); this.agent_ip = agent_ip; String hostname = DataAccessor.fieldString(host, "hostname"); this.name = StringUtils.isEmpty(host.getName()) ? hostname: host.getName(); this.hostname = hostname; this.state = host.getState(); this.agent_state = host.getAgentState(); this.labels = (Map<String, String>) DataAccessor.fields(host) .withKey(InstanceConstants.FIELD_LABELS) .withDefault(Collections.EMPTY_MAP).as(Map.class); this.uuid = host.getUuid(); this.hostId = host.getId(); this.local_storage_mb = host.getLocalStorageMb(); this.memory = host.getMemory(); this.milli_cpu = host.getMilliCpu(); this.environment_uuid = account.getUuid(); this.metadata_kind = "host"; }
setPhysicalHostId(from.getPhysicalHostId()); setIsPublic(from.getIsPublic()); setAgentState(from.getAgentState()); setLocalStorageMb(from.getLocalStorageMb()); setMemory(from.getMemory());