use of com.sun.messaging.jmq.admin.objstore.ObjStoreAttrs in project openmq by eclipse-ee4j.
the class ObjAdminHandler method doUpdateObjStore.
private void doUpdateObjStore(ObjAdminEvent oae, ConsoleObj selObj) {
ObjStoreAttrs osa = oae.getObjStoreAttrs();
ObjStoreManager osMgr = app.getObjStoreListCObj().getObjStoreManager();
boolean connect = oae.isConnectAttempt();
ObjStore prevOs = ((ObjStoreCObj) selObj).getObjStore();
String newName = oae.getObjStoreID();
/*
* Create/Update a new store and connect (if requested).
*/
ObjStore os = updateStore(prevOs, newName, osMgr, osa, connect);
/*
* If valid object store, then now try reading in any existing objects.
*/
if (os == null) {
// Don't do anything, just keep the old os.
return;
} else {
/*
* Read in the objects from the os.
*/
if (os.isOpen()) {
readObjStore(selObj, os);
}
}
/*
* If os is still valid, then update it cobj with the new obj store.
*/
((ObjStoreCObj) selObj).setObjStore(os);
/*
* We know that 0 is the dest list and 1 is the con factory list.
*/
ObjStoreDestListCObj destListCObj = (ObjStoreDestListCObj) selObj.getChildAt(0);
ObjStoreConFactoryListCObj cfListCObj = (ObjStoreConFactoryListCObj) selObj.getChildAt(1);
destListCObj.setObjStore(os);
cfListCObj.setObjStore(os);
app.getExplorer().nodeChanged(selObj);
app.getStatusArea().appendText(acr.getString(acr.S_OBJSTORE_UPDATE, selObj.toString()));
app.getInspector().selectedObjectUpdated();
// Update menu items, buttons.
controller.setActions(selObj);
/*
* If check box to connect is not checked, then remove all destination/connection factory objects from this object store
* node hierarchy
*/
if (!connect) {
clearStore(selObj);
}
/*
* Bring down the dialog if successful, otherwise keep it up.
*/
if (oae.isOKAction()) {
objStorePropsDialog.setVisible(false);
}
saveObjStoreList();
}
use of com.sun.messaging.jmq.admin.objstore.ObjStoreAttrs in project openmq by eclipse-ee4j.
the class ObjStorePropsDialog method show.
public void show(ObjStoreCObj osCObj) {
this.osCObj = osCObj;
ObjStore os = osCObj.getObjStore();
checkBox.setSelected(true);
ObjStoreAttrs attrs = os.getObjStoreAttrs();
jndiProps.clear();
if (attrs != null) {
for (java.util.Enumeration e = attrs.keys(); e.hasMoreElements(); ) {
String key = (String) e.nextElement();
jndiProps.setProperty(key, (String) attrs.get(key));
}
model.fireTableRowsInserted(0, attrs.size() - 1);
// Select the first one in the list.
if (attrs.size() >= 1) {
table.setRowSelectionInterval(0, 0);
}
} else {
comboBox.setSelectedIndex(0);
delButton.setEnabled(false);
chgButton.setEnabled(false);
model.fireTableDataChanged();
valueText.requestFocus();
}
// If Provider URL = object store name, then
// select provider url button.
// Otherwise, select use own name button and fill in.
//
/*
* String urlName = jndiProps.getProperty(Context.PROVIDER_URL); if (urlName != null && urlName.equals(os.getID())) {
* urlButton.setSelected(true); doUrlButton(); osText.setText(""); urlButton.requestFocus(); } else {
* osTextButton.setSelected(true); doOsTextButton(); osText.setText(os.getID()); osTextButton.requestFocus(); }
*/
osText.setText(os.getID());
if (os.isOpen()) {
setEditable(false);
} else {
setEditable(true);
}
setVisible(true);
}
use of com.sun.messaging.jmq.admin.objstore.ObjStoreAttrs in project openmq by eclipse-ee4j.
the class ObjStorePropsDialog method doOK.
@Override
public void doOK() {
String osName = null;
osName = osText.getText();
osName = osName.trim();
//
if (osName.equals("")) {
JOptionPane.showOptionDialog(this, acr.getString(acr.E_NO_OBJSTORE_NAME), acr.getString(acr.I_OBJSTORE_PROPS) + ": " + acr.getString(acr.I_ERROR_CODE, AdminConsoleResources.E_NO_OBJSTORE_NAME), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, close, close[0]);
osText.requestFocus();
return;
}
ObjAdminEvent oae;
ObjStoreAttrs osa = constructAttrs(osName);
if (osa == null) {
return;
}
oae = new ObjAdminEvent(this, ObjAdminEvent.UPDATE_OBJSTORE);
oae.setObjStoreID(osName);
oae.setObjStore((this.osCObj).getObjStore());
oae.setObjStoreAttrs(osa);
oae.setConnectAttempt(false);
oae.setOKAction(true);
fireAdminEventDispatched(oae);
}
use of com.sun.messaging.jmq.admin.objstore.ObjStoreAttrs in project openmq by eclipse-ee4j.
the class ObjStorePasswdDialog method show.
public void show(ObjStore os, Vector missingInfo) {
this.os = os;
this.missingInfo = missingInfo;
doClear();
ObjStoreAttrs osa = os.getObjStoreAttrs();
/*
* Fill in principal, credentials if we have it
*/
if (osa.containsKey(Context.SECURITY_CREDENTIALS)) {
credentialsText.setText((String) osa.get(Context.SECURITY_CREDENTIALS));
} else {
credentialsText.requestFocus();
}
/*
* Fill in this one second in case both are missing and we want to focus in the principal text field.
*/
if (osa.containsKey(Context.SECURITY_PRINCIPAL)) {
principalText.setText((String) osa.get(Context.SECURITY_PRINCIPAL));
} else {
principalText.requestFocus();
}
setDefaultButton(OK);
setVisible(true);
}
use of com.sun.messaging.jmq.admin.objstore.ObjStoreAttrs in project openmq by eclipse-ee4j.
the class ObjStorePasswdDialog method doOK.
@Override
public void doOK() {
String principalValue = principalText.getText().trim();
if (principalValue.equals("")) {
JOptionPane.showOptionDialog(this, acr.getString(acr.E_NO_PROP_VALUE, Context.SECURITY_PRINCIPAL), acr.getString(acr.I_CONNECT_OBJSTORE), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, close, close[0]);
principalText.requestFocus();
return;
}
String credentialsValue = credentialsText.getText().trim();
if (credentialsValue.equals("")) {
JOptionPane.showOptionDialog(this, acr.getString(acr.E_NO_PROP_VALUE, Context.SECURITY_CREDENTIALS), acr.getString(acr.I_CONNECT_OBJSTORE), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, close, close[0]);
credentialsText.requestFocus();
return;
}
/*
* Now add these to the object store.
*/
ObjStoreAttrs osa = os.getObjStoreAttrs();
if (!osa.containsKey(Context.SECURITY_PRINCIPAL)) {
this.os.addObjStoreAttr(Context.SECURITY_PRINCIPAL, principalValue);
}
if (!osa.containsKey(Context.SECURITY_CREDENTIALS)) {
this.os.addObjStoreAttr(Context.SECURITY_CREDENTIALS, credentialsValue);
}
ObjAdminEvent oae = new ObjAdminEvent(this, ObjAdminEvent.UPDATE_CREDENTIALS);
oae.setObjStore(os);
oae.setObjStoreAttrs(osa);
oae.setMissingAuthInfo(missingInfo);
oae.setOKAction(true);
fireAdminEventDispatched(oae);
}
Aggregations