use of com.pspace.ifs.ksan.mq.MQResponse in project ksan by infinistor.
the class DiskMonitor method startStopDisk.
private MQResponse startStopDisk(DISKPOOL dskPool, JsonOutput jo) {
MQResponse res;
if (jo.status.equalsIgnoreCase("Good")) {
System.out.println("Start Disk>>" + jo);
dskPool.setDiskStatus(jo.serverid, jo.id, DiskStatus.GOOD);
} else if (jo.status.equalsIgnoreCase("Stop")) {
System.out.println("Stop Disk>>" + jo);
dskPool.setDiskStatus(jo.serverid, jo.id, DiskStatus.STOPPED);
}
res = new MQResponse(MQResponseType.SUCCESS, "", "", 0);
obmCache.displayDiskPoolList();
return res;
}
use of com.pspace.ifs.ksan.mq.MQResponse in project ksan by infinistor.
the class DiskMonitor method addRemoveDiskPool.
private MQResponse addRemoveDiskPool(String action, JsonOutput jo, String msg) {
MQResponse res;
// System.out.println("action >>" + action);
if (action.equalsIgnoreCase(KEYS.ADD.label)) {
DISKPOOL dskPool1 = new DISKPOOL(jo.id, jo.diskPoolName);
/*JSONObject jsonObject;
JSONObject jsonDskObject;
JSONArray jsonDisk;
try {
jsonObject = (JSONObject)parser.parse(msg);
jsonDisk = (JSONArray)jsonObject.get("Disks");
for(int idx=0; idx < jsonDisk.size(); idx++){
jsonDskObject = (JSONObject)jsonDisk.get(idx);
SERVER srv = new SERVER();
}
} catch (ParseException ex) {
Logger.getLogger(DiskMonitor.class.getName()).log(Level.SEVERE, null, ex);
}*/
this.obmCache.setDiskPoolInCache(dskPool1);
this.obmCache.displayDiskPoolList();
} else if (action.equalsIgnoreCase(KEYS.REMOVE.label)) {
if (!(jo.id.isEmpty() && jo.diskPoolName.isEmpty()))
this.obmCache.removeDiskPoolFromCache(jo.id);
this.obmCache.displayDiskPoolList();
}
res = new MQResponse(MQResponseType.SUCCESS, "", "", 0);
return res;
}
use of com.pspace.ifs.ksan.mq.MQResponse in project ksan by infinistor.
the class DiskMonitor method updateDiskPool.
private MQResponse updateDiskPool(DISKPOOL dskPool, JsonOutput jo, String msg) {
MQResponse res;
JSONObject dsk;
// DISKPOOL dskPool1 = obmCache.getDiskPoolFromCache(jo.id);
JSONArray dskArray = decodeJsonArray(msg, "Disks");
Iterator it = dskArray.iterator();
while (it.hasNext()) {
dsk = (JSONObject) it.next();
String diskId = (String) dsk.get("Id");
String serverId = (String) dsk.get("ServerId");
String dskPoolId = (String) dsk.get("DiskPoolId");
String mpath = (String) dsk.get("Path");
// dskPool1.
System.out.format("DISK to add: { diskid : %s serverId : %s dskPoolId : %s mpath : %s}", diskId, serverId, dskPoolId, mpath);
}
res = new MQResponse(MQResponseType.SUCCESS, "", "", 0);
return res;
}
use of com.pspace.ifs.ksan.mq.MQResponse in project ksan by infinistor.
the class DiskMonitor method addRemoveDisk.
private MQResponse addRemoveDisk(DISKPOOL dskPool, JsonOutput jo) {
MQResponse res;
try {
if (jo.action.equalsIgnoreCase(KEYS.ADD.label)) {
dskPool.getServerById(jo.serverid).addDisk(jo.mpath, jo.diskid, 0, DiskStatus.STOPPED);
} else if (jo.action.equalsIgnoreCase(KEYS.REMOVE.label)) {
dskPool.getServerById(jo.serverid).removeDisk(jo.mpath, jo.diskid);
}
} catch (ResourceNotFoundException ex) {
Logger.getLogger(DiskMonitor.class.getName()).log(Level.SEVERE, null, ex);
}
res = new MQResponse(MQResponseType.SUCCESS, "", "", 0);
obmCache.displayDiskPoolList();
return res;
}
use of com.pspace.ifs.ksan.mq.MQResponse in project ksan by infinistor.
the class DiskMonitor method volumeMGNT.
private MQResponse volumeMGNT(DISKPOOL dskPool, JsonOutput jo, String msg) {
MQResponse res;
System.out.println("[volumeMNT : 345] " + msg);
res = new MQResponse(MQResponseType.SUCCESS, "", "", 0);
return res;
}
Aggregations