Search in sources :

Example 1 with ObjStoreAttrs

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

the class ConsoleObjStoreManager method readObjStoresFromFile.

/**
 * Reads the files and populates objStores.
 */
public void readObjStoresFromFile() throws UserPropertiesException, ObjStoreException {
    ObjStoreListProperties oslProps = readFromFile();
    int count = oslProps.getObjStoreCount();
    for (int i = 0; i < count; ++i) {
        ObjStoreAttrs osa = oslProps.getObjStoreAttrs(i);
        createStore(osa);
    }
}
Also used : ObjStoreAttrs(com.sun.messaging.jmq.admin.objstore.ObjStoreAttrs)

Example 2 with ObjStoreAttrs

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

the class ObjAdminHandler method doConnectObjStore.

private void doConnectObjStore(ConsoleObj selObj) {
    ObjStore os = ((ObjStoreCObj) selObj).getObjStore();
    if (os.isOpen()) {
        JOptionPane.showOptionDialog(app.getFrame(), acr.getString(acr.E_OS_ALREADY_CONNECTED, selObj.toString()), acr.getString(acr.I_CONNECT_OBJSTORE) + ": " + acr.getString(acr.I_ERROR_CODE, AdminConsoleResources.E_OS_ALREADY_CONNECTED), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, close, close[0]);
        return;
    }
    /*
         * Retrieve the original ObjStoreAttrs that the user input. This DOES NOT read any jndi property files processed by jndi
         * since this is done PRIOR to creating the initialContext.
         */
    ObjStoreAttrs osa = os.getObjStoreAttrs();
    Vector missingAuthInfo = os.checkAuthentication(osa);
    int missingAuthInfoSize = missingAuthInfo.size();
    if (missingAuthInfoSize > 0) {
        if (objStorePasswdDialog == null && missingAuthInfoSize > 0) {
            objStorePasswdDialog = new ObjStorePasswdDialog(app.getFrame());
            objStorePasswdDialog.addAdminEventListener(this);
            objStorePasswdDialog.setLocationRelativeTo(app.getFrame());
        }
        if (missingAuthInfoSize > 0) {
            objStorePasswdDialog.show(os, missingAuthInfo);
        }
    } else {
        boolean success = finishDoConnectObjStore(selObj, os);
        if (success) {
            app.getStatusArea().appendText(acr.getString(acr.S_OBJSTORE_CONNECT, selObj.toString()));
        }
    }
}
Also used : ObjStore(com.sun.messaging.jmq.admin.objstore.ObjStore) ObjStoreAttrs(com.sun.messaging.jmq.admin.objstore.ObjStoreAttrs) Vector(java.util.Vector)

Example 3 with ObjStoreAttrs

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

the class ObjAdminHandler method doUpdateCredentials.

private void doUpdateCredentials(ObjAdminEvent oae, ConsoleObj selObj) {
    ObjStore os = oae.getObjStore();
    boolean success = finishDoConnectObjStore(selObj, os);
    if (success) {
        app.getStatusArea().appendText(acr.getString(acr.S_OBJSTORE_CONNECT, selObj.toString()));
    }
    // Remove missing info that we just added.
    ObjStoreAttrs osa = oae.getObjStoreAttrs();
    Vector missingInfo = oae.getMissingAuthInfo();
    for (int i = 0; i < missingInfo.size(); i++) {
        String key = (String) missingInfo.elementAt(i);
        osa.remove(key);
    }
    try {
        os.setObjStoreAttrs(osa);
    } catch (ObjStoreException ose) {
        JOptionPane.showOptionDialog(app.getFrame(), ose.toString(), acr.getString(acr.I_OBJSTORE), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, close, close[0]);
    }
    if (success && oae.isOKAction()) {
        objStorePasswdDialog.setVisible(false);
    }
}
Also used : ObjStore(com.sun.messaging.jmq.admin.objstore.ObjStore) ObjStoreException(com.sun.messaging.jmq.admin.objstore.ObjStoreException) ObjStoreAttrs(com.sun.messaging.jmq.admin.objstore.ObjStoreAttrs) Vector(java.util.Vector)

Example 4 with ObjStoreAttrs

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

the class ObjAdminHandler method doAddObjStore.

private void doAddObjStore(ObjAdminEvent oae) {
    ObjStoreAttrs osa = oae.getObjStoreAttrs();
    ObjStoreManager osMgr = app.getObjStoreListCObj().getObjStoreManager();
    boolean connect = oae.isConnectAttempt();
    ConsoleObj osCObj = null;
    /*
         * Create store and connect (if requested).
         */
    ObjStore os = createStore(osMgr, osa, connect);
    /*
         * If valid object store, then now try reading in any existing objects.
         */
    if (os != null) {
        osCObj = new ObjStoreCObj(os);
        if (os.isOpen()) {
            readObjStore(osCObj, os);
        }
    }
    /*
         * If os is still valid, then add it to the tree list.
         */
    if (osCObj != null) {
        app.getExplorer().addObjStore(osCObj);
        app.getInspector().refresh();
        app.getStatusArea().appendText(acr.getString(acr.S_OBJSTORE_ADD, osCObj.toString()));
    }
    /*
         * Bring down the dialog if successful, otherwise keep it up.
         */
    if (oae.isOKAction() && os != null) {
        objStoreAddDialog.setVisible(false);
    }
    saveObjStoreList();
}
Also used : ObjStoreManager(com.sun.messaging.jmq.admin.objstore.ObjStoreManager) ObjStore(com.sun.messaging.jmq.admin.objstore.ObjStore) ObjStoreAttrs(com.sun.messaging.jmq.admin.objstore.ObjStoreAttrs)

Example 5 with ObjStoreAttrs

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

the class ObjStorePropsDialog method constructAttrs.

private ObjStoreAttrs constructAttrs(String osName) {
    ObjStore os = osCObj.getObjStore();
    // 
    // If they changed the os name to something else,
    // make sure it doesn't already exist.
    // 
    String prevOsName = os.getID();
    if (// they changed it
    !prevOsName.equals(osName) && osMgr != null && osMgr.getStore(osName) != null) {
        JOptionPane.showOptionDialog(this, acr.getString(acr.E_OBJSTORE_NAME_IN_USE, osName), acr.getString(acr.I_OBJSTORE_PROPS) + ": " + acr.getString(acr.I_ERROR_CODE, AdminConsoleResources.E_OBJSTORE_NAME_IN_USE), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, close, close[0]);
        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 (java.util.Enumeration e = jndiProps.propertyNames(); e.hasMoreElements(); ) {
        String propName = (String) e.nextElement();
        osa.put(propName, jndiProps.getProperty(propName));
    }
    return (osa);
}
Also used : ObjStore(com.sun.messaging.jmq.admin.objstore.ObjStore) 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