use of com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin in project openmq by eclipse-ee4j.
the class BrokerAdminHandler method doPurgeDurable.
private void doPurgeDurable(BrokerAdminEvent bae, ConsoleObj selObj) {
BrokerDestCObj bDestCObj;
BrokerAdmin ba;
String durableName = null;
String clientID = null;
if (!(selObj instanceof BrokerDestCObj)) {
/*
* REMINDER: Need to flag this error ?
*/
return;
}
bDestCObj = (BrokerDestCObj) selObj;
ba = bDestCObj.getBrokerAdmin();
/*
* Broker may take more time to complete the task than the specified timeout value. This value is used when refreshing
* the console in such cases.
*/
if (!ba.isBusy()) {
ba.setAssociatedObj(bDestCObj);
}
durableName = bae.getDurableName();
clientID = bae.getClientID();
int result = JOptionPane.showConfirmDialog(app.getFrame(), acr.getString(acr.Q_BROKER_PURGE_DUR, durableName, "" + clientID), acr.getString(acr.I_PURGE_DURABLE), JOptionPane.YES_NO_OPTION);
if (result == JOptionPane.NO_OPTION) {
return;
}
try {
ba.sendPurgeDurableMessage(durableName, clientID);
ba.receivePurgeDurableReplyMessage();
app.getStatusArea().appendText(acr.getString(acr.S_BROKER_PURGE_DUR, BrokerAdminUtil.getDSubLogString(clientID, durableName)));
} catch (BrokerAdminException baex) {
JOptionPane.showOptionDialog(app.getFrame(), acr.getString(acr.E_BROKER_PURGE_DUR, BrokerAdminUtil.getDSubLogString(clientID, durableName)) + printBrokerAdminExceptionDetails(baex), acr.getString(acr.I_DELETE_DURABLE) + ": " + acr.getString(acr.I_ERROR_CODE, AdminConsoleResources.E_BROKER_PURGE_DUR), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, close, close[0]);
return;
}
/*
* Refresh the durable subscription table.
*/
refreshBrokerDestCObj(bDestCObj, bae.getType());
Vector durables = bDestCObj.getDurables();
if (durables != null) {
brokerDestPropsDialog.refresh(durables);
}
}
use of com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin in project openmq by eclipse-ee4j.
the class BrokerAdminHandler method doResumeBroker.
private void doResumeBroker(BrokerCObj bCObj) {
BrokerAdmin ba = bCObj.getBrokerAdmin();
int result = JOptionPane.showConfirmDialog(app.getFrame(), acr.getString(acr.Q_BROKER_RESUME, ba.getKey()), acr.getString(acr.I_RESUME_BROKER), JOptionPane.YES_NO_OPTION);
if (result == JOptionPane.NO_OPTION) {
return;
}
/*
* Broker may take more time to complete the task than the specified timeout value. This value is used when refreshing
* the console in such cases.
*/
if (!ba.isBusy()) {
ba.setAssociatedObj(bCObj);
}
if (resumeBroker(ba)) {
Enumeration e = bCObj.children();
BrokerServiceListCObj bSvclCObj = null;
while (e.hasMoreElements()) {
ConsoleObj cObj = (ConsoleObj) e.nextElement();
if (cObj instanceof BrokerServiceListCObj) {
bSvclCObj = (BrokerServiceListCObj) cObj;
}
}
Vector svcs = queryAllServiceInfo(ba);
if (svcs != null) {
updateAllServiceInfo(bSvclCObj, svcs);
// Update menu items, buttons.
controller.setActions(bCObj);
app.getInspector().refresh();
}
}
}
use of com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin in project openmq by eclipse-ee4j.
the class BrokerAdminHandler method loadBrokerList.
/*
* Load broker list from property file. See ConsoleBrokerAdminManager and BrokerListProperties for details on the actual
* file loading.
*/
private void loadBrokerList() {
ConsoleBrokerAdminManager baMgr = app.getBrokerListCObj().getBrokerAdminManager();
try {
baMgr.setFileName(BROKERLIST_FILENAME);
baMgr.readBrokerAdminsFromFile();
} catch (Exception ex) {
String errStr = acr.getString(acr.E_LOAD_BKR_LIST) + ex.getMessage();
/*
* Show popup to indicate that the loading failed.
*/
JOptionPane.showOptionDialog(app.getFrame(), errStr, acr.getString(acr.I_LOAD_BKR_LIST) + ": " + acr.getString(acr.I_ERROR_CODE, AdminConsoleResources.E_LOAD_BKR_LIST), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, close, close[0]);
/*
* At this point, should we make sure the ConsoleBrokerAdminManager contains no obj stores ?
*/
}
Vector v = baMgr.getBrokerAdmins();
for (int i = 0; i < v.size(); i++) {
BrokerAdmin ba = (BrokerAdmin) v.get(i);
ConsoleObj brokerCObj = new BrokerCObj(ba);
/*
* Add code to populate broker node here if connected
*/
app.getExplorer().addBroker(brokerCObj);
}
app.getInspector().refresh();
}
use of com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin in project openmq by eclipse-ee4j.
the class BrokerAdminHandler method doPurgeDestination.
private void doPurgeDestination(BrokerDestCObj bDestCObj) {
BrokerAdmin ba = bDestCObj.getBrokerAdmin();
DestinationInfo destInfo = bDestCObj.getDestinationInfo();
int result = JOptionPane.showConfirmDialog(app.getFrame(), acr.getString(acr.Q_BROKER_PURGE_DEST, destInfo.name, ba.getKey()), acr.getString(acr.I_PURGE_MESSAGES), JOptionPane.YES_NO_OPTION);
if (result == JOptionPane.NO_OPTION) {
return;
}
if (!purgeDestination(ba, destInfo.name, destInfo.type)) {
return;
}
destInfo = queryDestinationInfo(ba, destInfo.name, destInfo.type);
if (destInfo != null) {
bDestCObj.setDestinationInfo(destInfo);
app.getInspector().selectedObjectUpdated();
}
}
use of com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin in project openmq by eclipse-ee4j.
the class BrokerAdminHandler method doPauseBroker.
private void doPauseBroker(BrokerCObj bCObj) {
BrokerAdmin ba = bCObj.getBrokerAdmin();
int result = JOptionPane.showConfirmDialog(app.getFrame(), acr.getString(acr.Q_BROKER_PAUSE, ba.getKey()), acr.getString(acr.I_PAUSE_BROKER), JOptionPane.YES_NO_OPTION);
if (result == JOptionPane.NO_OPTION) {
return;
}
/*
* Broker may take more time to complete the task than the specified timeout value. This value is used when refreshing
* the console in such cases.
*/
if (!ba.isBusy()) {
ba.setAssociatedObj(bCObj);
}
if (pauseBroker(ba)) {
Enumeration e = bCObj.children();
BrokerServiceListCObj bSvclCObj = null;
while (e.hasMoreElements()) {
ConsoleObj cObj = (ConsoleObj) e.nextElement();
if (cObj instanceof BrokerServiceListCObj) {
bSvclCObj = (BrokerServiceListCObj) cObj;
}
}
Vector svcs = queryAllServiceInfo(ba);
if (svcs != null) {
updateAllServiceInfo(bSvclCObj, svcs);
// Update menu items, buttons.
controller.setActions(bCObj);
app.getInspector().refresh();
}
}
}
Aggregations