public Map<String, Object> update() { Map<String, Object> result = new HashMap<String, Object>(); this.initArgs(this.getMessage().getParams()); cimClient(ipAddress, username, password, namespace, port, protocol, "v7000"); HashMap<String, String> cmap = new HashMap<String, String>(); cmap.put("status", status); if (errorq.equals("")) { try { double TotalManagedSpace = 0; double RemainingManagedSpace = 0; double assignedrate = 0.00; if ((mapV != null) && mapV.v7000StoragePools != null) { for (CIM_StoragePool pool : mapV.v7000StoragePools) { TotalManagedSpace = TotalManagedSpace + pool.getTotalManagedSpace(); RemainingManagedSpace = RemainingManagedSpace + pool.getRemainingManagedSpace(); } TotalManagedSpace = TotalManagedSpace / 1024 / 1024 / 1024; BigDecimal bd = new BigDecimal(TotalManagedSpace); bd = bd.setScale(1, BigDecimal.ROUND_HALF_UP); TotalManagedSpace = bd.doubleValue(); RemainingManagedSpace = RemainingManagedSpace / 1024 / 1024 / 1024; bd = new BigDecimal(RemainingManagedSpace); bd = bd.setScale(1, BigDecimal.ROUND_HALF_UP); RemainingManagedSpace = bd.doubleValue(); if (TotalManagedSpace > 0) assignedrate = (TotalManagedSpace - RemainingManagedSpace) / TotalManagedSpace; bd = new BigDecimal(assignedrate); bd = bd.setScale(2, BigDecimal.ROUND_HALF_UP); assignedrate = bd.doubleValue(); // inf.getUpdate(); cmap.put("totalManagedSpace", TotalManagedSpace + ""); cmap.put("remainingManagedSpace", RemainingManagedSpace + ""); cmap.put("AllocatedCapacityRate", assignedrate + ""); } if ((mapFCP != null) && (mapFCP.FCPortlist != null)) for (CIM_FCPort fcport : mapFCP.FCPortlist) { cmap.put(fcport.getDeviceId() + "OperationalStatus", fcport.getOperationalStatus()); } if ((mapV != null) && (mapV.v7000StorageVolumes != null)) { for (CIM_StorageVolume StorageVolume : mapV.v7000StorageVolumes) { cmap.put( StorageVolume.getDeviceId() + "OperationalStatus", StorageVolume.getOperationalStatus()); double lunsize = StorageVolume.getBlockSize() * StorageVolume.getNumberOfBlocks() / 1024 / 1024 / 1024; BigDecimal bd = new BigDecimal(lunsize); bd = bd.setScale(1, BigDecimal.ROUND_HALF_UP); lunsize = bd.doubleValue(); cmap.put(StorageVolume.getDeviceId() + "LunSize", lunsize + ""); } } } catch (Exception e) { } } else { cmap.put("error", errorq); } int len = this.Counters.size(); if (cmap.containsKey("error")) { this.lastError = cmap.get("error"); result.put("stateString", "update fail"); result.put("countersInError", len); } else { int errorCount = 0; StringBuffer statestring = new StringBuffer(); int j = 0; for (String s : this.Counters.keySet()) { String s1 = this.Counters.get(s).toString(); // .replace("-", // "/"); String value = ""; if (cmap.containsKey(s)) { String v = cmap.get(s); value = v; try { int V1 = Integer.parseInt(v); result.put(s1, V1); result.put(s, V1); } catch (Exception ex) { try { Float Vf = Float.parseFloat(v); result.put(s1, Vf); result.put(s, Vf); } catch (Exception ex1) { if (v instanceof String) { if (v.equals("false")) { result.put(s1, false); result.put(s, false); } else if (v.equals("true")) { result.put(s1, true); result.put(s, true); } else { result.put(s1, v); result.put(s, v); } } else { result.put(s1, v); result.put(s, v); } } } } else { ++errorCount; value = "n/a"; result.put(s1, "n/a"); } if (value.equals("")) statestring.append(s1).append(" = \"\""); else { statestring.append(s1).append(" = ").append(value); } if (j != len - 1) statestring.append(", "); ++j; } result.put("stateString", statestring.toString()); result.put("countersInError", errorCount); } return result; }