@@ -115,19 +115,22 @@ private void updateMetricsWithWildcards(PCFMessage[] pcfResponse) {
115
115
/**
116
116
* Retrieves info about all objects from input array via direct pcf commands.
117
117
*
118
- * @param objectNames - input array with objects.
118
+ * @param objectNames - input list with objects.
119
119
*/
120
- private void updateWithDirectPCFCommand (ArrayList <String > objectNames ) {
120
+ private void updateWithDirectPCFCommand (List <String > objectNames ) {
121
121
for (String objectName : objectNames ) {
122
122
MQObject directObject = new MQObject (objectName , object .getType ());
123
123
try {
124
124
PCFMessage [] directPCFResponse = agent .send (directObject .getPcfCmd ());
125
125
updateMetricWithoutWildcards (directPCFResponse [0 ], objectName );
126
126
} catch (PCFException e ) {
127
127
//This error means, that channel has status "inactive".
128
- if (e .reasonCode == MQConstants .MQRCCF_CHL_STATUS_NOT_FOUND ) {
128
+ if (object . getType () == MQObject . MQType . CHANNEL && e .reasonCode == MQConstants .MQRCCF_CHL_STATUS_NOT_FOUND ) {
129
129
logger .warn ("Channel {} is possibly inactive." , objectName );
130
130
MetricsManager .updateMetric (MetricsReference .getMetricName (object .getType ()), MetricsReference .getMetricValue (object .getType (), MQConstants .MQCHS_INACTIVE ), queueManagerName , objectName );
131
+ } else if (object .getType () == MQObject .MQType .LISTENER && e .reasonCode == MQConstants .MQRC_UNKNOWN_OBJECT_NAME ) {
132
+ MetricsManager .updateMetric (MetricsReference .getMetricName (object .getType ()), MetricsReference .getMetricValue (object .getType (), MQConstants .MQSVC_STATUS_STOPPED ), queueManagerName , objectName );
133
+ logger .warn ("Listener {} is possibly stopped." , objectName );
131
134
} else {
132
135
logger .error ("Error occurred during sending PCF command: " , e );
133
136
}
@@ -165,13 +168,14 @@ public void run() {
165
168
}
166
169
logger .debug ("PCF response for object type {} with name {} was processed successfully." , object .getType (), object .getName ());
167
170
} catch (PCFException e ) {
168
- if (e .reasonCode == MQConstants .MQRCCF_CHL_STATUS_NOT_FOUND ) {
171
+ if (object . getType () == MQObject . MQType . CHANNEL && e .reasonCode == MQConstants .MQRCCF_CHL_STATUS_NOT_FOUND ) {
169
172
logger .warn ("Channel {} is possibly inactive." , object .getName ());
170
173
MetricsManager .updateMetric (MetricsReference .getMetricName (object .getType ()), MetricsReference .getMetricValue (object .getType (), MQConstants .MQCHS_INACTIVE ), queueManagerName , object .getName ());
171
- }
172
- if (object .getType () == MQObject .MQType .LISTENER && e .reasonCode == MQConstants .MQRC_UNKNOWN_OBJECT_NAME ) {
174
+ } else if (object .getType () == MQObject .MQType .LISTENER && e .reasonCode == MQConstants .MQRC_UNKNOWN_OBJECT_NAME ) {
173
175
MetricsManager .updateMetric (MetricsReference .getMetricName (object .getType ()), MetricsReference .getMetricValue (object .getType (), MQConstants .MQSVC_STATUS_STOPPED ), queueManagerName , object .getName ());
174
176
logger .warn ("Listener {} is possibly stopped." , object .getName ());
177
+ } else {
178
+ logger .error ("Error occurred during sending PCF command: " , e );
175
179
}
176
180
} catch (MQException | IOException e ) {
177
181
logger .error ("Error occurred during sending PCF command: " , e );
0 commit comments