Search in sources :

Example 26 with ObjStoreAttrs

use of com.sun.messaging.jmq.admin.objstore.ObjStoreAttrs 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)

Example 27 with ObjStoreAttrs

use of com.sun.messaging.jmq.admin.objstore.ObjStoreAttrs in project openmq by eclipse-ee4j.

the class ObjStoreAddDialog method constructAttrs.

private ObjStoreAttrs constructAttrs(String osName) {
    // 
    if (osMgr != null && osMgr.getStore(osName) != null) {
        JOptionPane.showOptionDialog(this, acr.getString(acr.E_OBJSTORE_NAME_IN_USE, osName), acr.getString(acr.I_ADD_OBJSTORE) + ": " + acr.getString(acr.I_ERROR_CODE, AdminConsoleResources.E_OBJSTORE_NAME_IN_USE), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, close, close[0]);
        // if (osTextButton.isSelected()) {
        osText.requestFocus();
        osText.selectAll();
        // }
        return (null);
    }
    ObjStoreAttrs osa = new ObjStoreAttrs(osName, osName);
    if (jndiProps == null) {
        return (osa);
    }
    // Check for any properties that MUST be set.
    if (checkMandatoryProps() == 0) {
        return null;
    }
    for (Enumeration e = jndiProps.propertyNames(); e.hasMoreElements(); ) {
        String propName = (String) e.nextElement();
        osa.put(propName, jndiProps.getProperty(propName));
    }
    return (osa);
}
Also used : Enumeration(java.util.Enumeration) ObjStoreAttrs(com.sun.messaging.jmq.admin.objstore.ObjStoreAttrs)

Aggregations

ObjStoreAttrs (com.sun.messaging.jmq.admin.objstore.ObjStoreAttrs)27 ObjStore (com.sun.messaging.jmq.admin.objstore.ObjStore)13 InvalidPropertyException (com.sun.messaging.InvalidPropertyException)8 InvalidPropertyValueException (com.sun.messaging.InvalidPropertyValueException)8 ReadOnlyPropertyException (com.sun.messaging.ReadOnlyPropertyException)7 ObjStoreException (com.sun.messaging.jmq.admin.objstore.ObjStoreException)7 AuthenticationException (com.sun.messaging.jmq.admin.objstore.AuthenticationException)6 NameAlreadyExistsException (com.sun.messaging.jmq.admin.objstore.NameAlreadyExistsException)6 NameNotFoundException (com.sun.messaging.jmq.admin.objstore.NameNotFoundException)6 AdministeredObject (com.sun.messaging.AdministeredObject)5 AuthenticationNotSupportedException (com.sun.messaging.jmq.admin.objstore.AuthenticationNotSupportedException)5 CommunicationException (com.sun.messaging.jmq.admin.objstore.CommunicationException)5 GeneralNamingException (com.sun.messaging.jmq.admin.objstore.GeneralNamingException)5 InitializationException (com.sun.messaging.jmq.admin.objstore.InitializationException)5 NoPermissionException (com.sun.messaging.jmq.admin.objstore.NoPermissionException)5 SchemaViolationException (com.sun.messaging.jmq.admin.objstore.SchemaViolationException)5 MissingVersionNumberException (com.sun.messaging.naming.MissingVersionNumberException)5 UnsupportedVersionNumberException (com.sun.messaging.naming.UnsupportedVersionNumberException)5 Enumeration (java.util.Enumeration)4 Properties (java.util.Properties)4