@@ -75,110 +75,6 @@ public Vector<Target> getTargetList() {
75
75
public Collection <Target > getTargetInstances () {
76
76
return targetInstances .values ();
77
77
}
78
- public void updateIpmiTarget (Target target ,int l_entityInst ,HashMap <Integer , HashMap <Integer , Vector <SdrRecord >>> sdrLookup ,
79
- String path ) throws Exception {
80
- for (String child : target .getAllChildren ()) {
81
- int entityInst =l_entityInst ;
82
- Target childTarget = this .getTarget (child );
83
- if (childTarget .getAttribute ("MRW_TYPE" ).equals ("IPMI_SENSOR" ) ||
84
- childTarget .getAttribute ("MRW_TYPE" ).equals ("APSS_SENSOR" )) {
85
- if (!childTarget .getAttribute ("IPMI_INSTANCE" ).isEmpty ()) {
86
- entityInst =Integer .decode (childTarget .getAttribute ("IPMI_INSTANCE" ));
87
- }
88
- if (childTarget .getAttribute ("MRW_TYPE" ).equals ("APSS_SENSOR" )) {
89
- String id =childTarget .getAttribute ("ADC_CHANNEL_ASSIGNMENT" );
90
- if (!id .isEmpty ()) {
91
- entityInst =Integer .decode (id )+1 ;
92
- }
93
- }
94
- String instPath =path +"/" +childTarget .getName ();
95
- String entityIdStr = childTarget .getAttribute ("IPMI_ENTITY_ID" );
96
- String sensorTypeStr = childTarget .getAttribute ("IPMI_SENSOR_TYPE" );
97
- int entityId = Integer .decode (entityIdStr );
98
- int sensorType = Integer .decode (sensorTypeStr );
99
- HashMap <Integer ,Vector <SdrRecord >> sdrMap = sdrLookup .get (entityId );
100
- if (sdrMap !=null ) {
101
- Vector <SdrRecord > sdrs = sdrMap .get (entityInst );
102
- if (sdrs !=null ) {
103
- for (SdrRecord sdr :sdrs ) {
104
- if (sdr .getSensorType ()==sensorType ) {
105
- String msg = "MATCH: " +childTarget .getName ()+"; " +sdr .toString ();
106
- this .logData =this .logData +msg +"\n " ;
107
- this .setGlobalSetting (instPath , "IPMI_SENSOR_ID" , String .format ("0x%02X" , sdr .getSensorId ()));
108
- }
109
- }
110
- } else {
111
- if (entityInst !=-1 ) {
112
- String msg = ">> WARNING: " +childTarget .getName ()+"; Entity ID: " +entityId +"; Entity Inst: " +entityInst +" not found in SDR" ;
113
- this .logData =this .logData +msg +"\n " ;
114
- this .setGlobalSetting (instPath , "IPMI_SENSOR_ID" , "" );
115
- }
116
- }
117
- }
118
- }
119
- }
120
- }
121
- public void importSdr2 (Target target , HashMap <Integer , HashMap <Integer , Vector <SdrRecord >>> sdrLookup ,HashMap <String ,Integer >instCheck ,String path ) throws Exception {
122
- if (target ==null ) {
123
- for (Target t : this .rootTargets ) {
124
- this .importSdr2 (t ,sdrLookup ,instCheck ,"/" );
125
- }
126
- } else {
127
- String instPath = path +target .getName ();
128
- String type = target .getAttribute ("TYPE" );
129
- if (type .equals ("APSS" )) {
130
- String msg ="\n ========================================================\n " ;
131
- msg =msg +"IPMI TARGET: " +instPath +" (APSS)" ;
132
- this .logData =this .logData +msg +"\n " ;
133
- this .updateIpmiTarget (target ,-1 ,sdrLookup ,instPath );
134
- } else {
135
- if (target .isAttribute ("FRU_NAME" )) {
136
- Integer entityInst = instCheck .get (type );
137
- if (entityInst == null ) {
138
- entityInst =-1 ;
139
- }
140
- entityInst ++;
141
- instCheck .put (type ,entityInst );
142
- this .setGlobalSetting (instPath , "IPMI_INSTANCE" , entityInst .toString ());
143
- if (this .getGlobalSetting (instPath , "FRU_NAME" ).value .isEmpty ()) {
144
- this .setGlobalSetting (instPath ,"FRU_NAME" , type +entityInst );
145
- }
146
- String msg ="\n ========================================================\n " ;
147
- msg =msg +"IPMI TARGET: " +instPath +"; IPMI_INSTANCE=" +entityInst +"; FRU_NAME=" +this .getGlobalSetting (instPath , "FRU_NAME" ).value ;
148
- this .logData =this .logData +msg +"\n " ;
149
- this .updateIpmiTarget (target ,entityInst ,sdrLookup ,instPath );
150
- }
151
- }
152
- /*
153
- HashMap<String,Field> inst = this.globalSettings.get(instPath);
154
- int entityInst=0;
155
- if (inst!=null) {
156
- Field instStr=inst.get("IPMI_INSTANCE");
157
- if (instStr!=null && instStr.value!=null) {
158
- if (!instStr.value.isEmpty()) {
159
- entityInst = Integer.parseInt(instStr.value);
160
- //String key = target.getName()+":"+entityInst;
161
- Boolean = instCheck.get(target.getAttribute("TYPE"));
162
- if (instFound!=null) {
163
- throw new Exception("Duplicate instance id for instance type: \n"+instPath+
164
- "\n. Make sure each instance has a unique IPMI_INSTANCE attribute.");
165
- } else {
166
- instCheck.put(key,true);
167
- }
168
- this.updateIpmiTarget(target,entityInst,sdrLookup,instPath);
169
- }
170
- }
171
- } else if(target.getAttribute("TYPE").equals("APSS")) {
172
- this.updateIpmiTarget(target,-1,sdrLookup,instPath);
173
- }*/
174
-
175
- path =path +target .getName ()+"/" ;
176
- for (String child : target .getChildren ()) {
177
- Target childTarget = this .getTarget (child );
178
- this .importSdr2 (childTarget , sdrLookup ,instCheck ,path );
179
- }
180
- }
181
- }
182
78
183
79
public Vector <Target > getConnectionCapableTargets () {
184
80
Vector <Target > cards = new Vector <Target >();
0 commit comments