if (host.getLocalStorageMb() == null) { Long storage = DataAccessor.fromMap(data).withKey(HostConstants.FIELD_LOCAL_STORAGE_MB).as(Long.class); if (storage != null) {
@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"; }
setIsPublic(from.getIsPublic()); setAgentState(from.getAgentState()); setLocalStorageMb(from.getLocalStorageMb()); setMemory(from.getMemory()); setMilliCpu(from.getMilliCpu());