summaryrefslogtreecommitdiffstats
path: root/src/com/ibm/ServerWizard2/SystemModel.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/ibm/ServerWizard2/SystemModel.java')
-rw-r--r--src/com/ibm/ServerWizard2/SystemModel.java104
1 files changed, 0 insertions, 104 deletions
diff --git a/src/com/ibm/ServerWizard2/SystemModel.java b/src/com/ibm/ServerWizard2/SystemModel.java
index f6bf50a..4e801cc 100644
--- a/src/com/ibm/ServerWizard2/SystemModel.java
+++ b/src/com/ibm/ServerWizard2/SystemModel.java
@@ -75,110 +75,6 @@ public class SystemModel {
public Collection<Target> getTargetInstances() {
return targetInstances.values();
}
- public void updateIpmiTarget(Target target,int l_entityInst,HashMap<Integer, HashMap<Integer, Vector<SdrRecord>>> sdrLookup,
- String path) throws Exception {
- for (String child : target.getAllChildren()) {
- int entityInst=l_entityInst;
- Target childTarget = this.getTarget(child);
- if (childTarget.getAttribute("MRW_TYPE").equals("IPMI_SENSOR") ||
- childTarget.getAttribute("MRW_TYPE").equals("APSS_SENSOR")) {
- if (!childTarget.getAttribute("IPMI_INSTANCE").isEmpty()) {
- entityInst=Integer.decode(childTarget.getAttribute("IPMI_INSTANCE"));
- }
- if (childTarget.getAttribute("MRW_TYPE").equals("APSS_SENSOR")) {
- String id=childTarget.getAttribute("ADC_CHANNEL_ASSIGNMENT");
- if (!id.isEmpty()) {
- entityInst=Integer.decode(id)+1;
- }
- }
- String instPath=path+"/"+childTarget.getName();
- String entityIdStr = childTarget.getAttribute("IPMI_ENTITY_ID");
- String sensorTypeStr = childTarget.getAttribute("IPMI_SENSOR_TYPE");
- int entityId = Integer.decode(entityIdStr);
- int sensorType = Integer.decode(sensorTypeStr);
- HashMap<Integer,Vector<SdrRecord>> sdrMap= sdrLookup.get(entityId);
- if (sdrMap!=null) {
- Vector<SdrRecord> sdrs = sdrMap.get(entityInst);
- if (sdrs!=null) {
- for (SdrRecord sdr:sdrs ) {
- if (sdr.getSensorType()==sensorType) {
- String msg = "MATCH: "+childTarget.getName()+"; "+sdr.toString();
- this.logData=this.logData+msg+"\n";
- this.setGlobalSetting(instPath, "IPMI_SENSOR_ID", String.format("0x%02X", sdr.getSensorId()));
- }
- }
- } else {
- if (entityInst!=-1) {
- String msg = ">> WARNING: "+childTarget.getName()+"; Entity ID: "+entityId+"; Entity Inst: "+entityInst+" not found in SDR";
- this.logData=this.logData+msg+"\n";
- this.setGlobalSetting(instPath, "IPMI_SENSOR_ID", "");
- }
- }
- }
- }
- }
- }
- public void importSdr2(Target target, HashMap<Integer, HashMap<Integer, Vector<SdrRecord>>> sdrLookup,HashMap<String,Integer>instCheck,String path) throws Exception {
- if (target==null) {
- for (Target t : this.rootTargets) {
- this.importSdr2(t,sdrLookup,instCheck,"/");
- }
- } else {
- String instPath = path+target.getName();
- String type = target.getAttribute("TYPE");
- if (type.equals("APSS")) {
- String msg="\n========================================================\n";
- msg=msg+"IPMI TARGET: "+instPath+" (APSS)";
- this.logData=this.logData+msg+"\n";
- this.updateIpmiTarget(target,-1,sdrLookup,instPath);
- } else {
- if (target.isAttribute("FRU_NAME")) {
- Integer entityInst = instCheck.get(type);
- if (entityInst == null) {
- entityInst=-1;
- }
- entityInst++;
- instCheck.put(type,entityInst);
- this.setGlobalSetting(instPath, "IPMI_INSTANCE", entityInst.toString());
- if (this.getGlobalSetting(instPath, "FRU_NAME").value.isEmpty()) {
- this.setGlobalSetting(instPath,"FRU_NAME", type+entityInst);
- }
- String msg="\n========================================================\n";
- msg=msg+"IPMI TARGET: "+instPath+"; IPMI_INSTANCE="+entityInst+"; FRU_NAME="+this.getGlobalSetting(instPath, "FRU_NAME").value;
- this.logData=this.logData+msg+"\n";
- this.updateIpmiTarget(target,entityInst,sdrLookup,instPath);
- }
- }
- /*
- HashMap<String,Field> inst = this.globalSettings.get(instPath);
- int entityInst=0;
- if (inst!=null) {
- Field instStr=inst.get("IPMI_INSTANCE");
- if (instStr!=null && instStr.value!=null) {
- if (!instStr.value.isEmpty()) {
- entityInst = Integer.parseInt(instStr.value);
- //String key = target.getName()+":"+entityInst;
- Boolean = instCheck.get(target.getAttribute("TYPE"));
- if (instFound!=null) {
- throw new Exception("Duplicate instance id for instance type: \n"+instPath+
- "\n. Make sure each instance has a unique IPMI_INSTANCE attribute.");
- } else {
- instCheck.put(key,true);
- }
- this.updateIpmiTarget(target,entityInst,sdrLookup,instPath);
- }
- }
- } else if(target.getAttribute("TYPE").equals("APSS")) {
- this.updateIpmiTarget(target,-1,sdrLookup,instPath);
- }*/
-
- path=path+target.getName()+"/";
- for (String child : target.getChildren()) {
- Target childTarget = this.getTarget(child);
- this.importSdr2(childTarget, sdrLookup,instCheck,path);
- }
- }
- }
public Vector<Target> getConnectionCapableTargets() {
Vector<Target> cards = new Vector<Target>();
OpenPOWER on IntegriCloud