Search in sources :

Example 6 with ObjAdminEvent

use of com.sun.messaging.jmq.admin.apps.console.event.ObjAdminEvent 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);
}
Also used : ObjAdminEvent(com.sun.messaging.jmq.admin.apps.console.event.ObjAdminEvent) ObjStoreAttrs(com.sun.messaging.jmq.admin.objstore.ObjStoreAttrs)

Example 7 with ObjAdminEvent

use of com.sun.messaging.jmq.admin.apps.console.event.ObjAdminEvent in project openmq by eclipse-ee4j.

the class ObjStoreAddDialog method doOK.

@Override
public void doOK() {
    String osName = null;
    // if (osTextButton.isSelected()) {
    osName = osText.getText();
    osName = osName.trim();
    // 
    if (osName.equals("")) {
        JOptionPane.showOptionDialog(this, acr.getString(acr.E_NO_OBJSTORE_NAME), acr.getString(acr.I_ADD_OBJSTORE) + ": " + 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;
    }
    /*
         * } else if (urlButton.isSelected()) { // Make sure a provider.url property was set. osName =
         * jndiProps.getProperty(Context.PROVIDER_URL); if (osName == null || osName.equals("")) {
         * JOptionPane.showOptionDialog(this, acr.getString(acr.E_NO_PROVIDER_URL, Context.PROVIDER_URL),
         * acr.getString(acr.I_ADD_OBJSTORE) + ": " + acr.getString(acr.I_ERROR_CODE, AdminConsoleResources.E_NO_PROVIDER_URL),
         * JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, close, close[0]);
         * comboBox.setSelectedItem(Context.PROVIDER_URL); valueText.requestFocus(); return; } }
         */
    ObjAdminEvent oae;
    ObjStoreAttrs osa = constructAttrs(osName);
    if (osa == null) {
        return;
    }
    oae = new ObjAdminEvent(this, ObjAdminEvent.ADD_OBJSTORE);
    oae.setObjStoreAttrs(osa);
    // oae.setConnectAttempt(checkBox.isSelected());
    oae.setConnectAttempt(false);
    oae.setOKAction(true);
    fireAdminEventDispatched(oae);
}
Also used : ObjAdminEvent(com.sun.messaging.jmq.admin.apps.console.event.ObjAdminEvent) ObjStoreAttrs(com.sun.messaging.jmq.admin.objstore.ObjStoreAttrs)

Aggregations

ObjAdminEvent (com.sun.messaging.jmq.admin.apps.console.event.ObjAdminEvent)7 AdministeredObject (com.sun.messaging.AdministeredObject)4 ObjStore (com.sun.messaging.jmq.admin.objstore.ObjStore)4 Properties (java.util.Properties)4 ObjStoreAttrs (com.sun.messaging.jmq.admin.objstore.ObjStoreAttrs)3 LabelledComponent (com.sun.messaging.jmq.admin.apps.console.util.LabelledComponent)2 Enumeration (java.util.Enumeration)2