有沒有辦法編寫PCF程序來獲取處於「正在運行」狀態的羣集發送者/接收者通道的通道狀態?
我有這樣的東西,只給我一個頻道的頻道狀態!如何編寫PCF命令以獲取條件的通道狀態?
// send the request and collect the responses
String checkStatus="";
String channelName ="";
// build a request
request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS);
// add a parameter designating the name of the channel for which status is requested
request.addParameter(CMQCFC.MQCACH_CHANNEL_NAME, "TO.*");
// add a parameter designating the instance type (current) desired
request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_TYPE, CMQC.MQOT_CURRENT_CHANNEL);
responses = agent.send(request);
for (int j = 0; j < responses.length; j++) {
// get the channel name and trim the spaces
String temp ="";
temp = responses[j].getStringParameterValue(CMQCFC.MQCACH_CHANNEL_NAME);
channelName = temp.trim();
int chlStatus = responses[j].getIntParameterValue(CMQCFC.MQIACH_CHANNEL_STATUS);
//System.out.println("channel status: " + chlStatus);
String[] chStatusText = {
"", "MQCHS_BINDING", "MQCHS_STARTING", "MQCHS_RUNNING",
"MQCHS_STOPPING", "MQCHS_RETRYING", "MQCHS_STOPPED",
"MQCHS_REQUESTING", "MQCHS_PAUSED",
"", "", "", "", "MQCHS_INITIALIZING"
};
checkStatus = chStatusText[chlStatus];
//System.out.println("channel status: " + checkStatus);
}
System.out.println("chl: " + channelName + " STATUS: " + checkStatus + ")");
上面的代碼給出了只有一個通道而不是所有通道的通道狀態。這裏有什麼問題?
您是否在問如何將您返回的整數轉換爲運行(或其他狀態),或者您在問如何從通道狀態記錄中獲取其他信息以及運行狀態? –
基本上我想寫一個對應於下面的runmqsc dis chs(TO。*)的PCF命令,其中(STATUS eq RUNNING) – sijo0703