Examples of ObjStore


Examples of com.sun.messaging.jmq.admin.objstore.ObjStore

    
    }

    private void doDeleteDestination(ConsoleObj selObj) {

  ObjStore os = ((ObjStoreDestCObj)selObj).getObjStore();
      int result = JOptionPane.showConfirmDialog(app.getFrame(),
      acr.getString(acr.Q_DEST_OBJ_DELETE,
              selObj.toString(), os.getID()),
      acr.getString(acr.I_DELETE_OBJSTORE_DEST),
      JOptionPane.YES_NO_OPTION);

  if (result == JOptionPane.NO_OPTION)
      return;

  /*
   * Disconnect and delete the object store.
   */
  String lookupName = selObj.toString();
  try {
      os.delete(lookupName);
  } catch (Exception e) {
      JOptionPane.showOptionDialog(app.getFrame(),
      acr.getString(acr.E_DELETE_DEST_OBJ, selObj.toString(),
              e.toString()),
      acr.getString(acr.I_DELETE_OBJSTORE_DEST) + ": " +
                                acr.getString(acr.I_ERROR_CODE,
                                AdminConsoleResources.E_DELETE_DEST_OBJ),
                        JOptionPane.YES_NO_OPTION,
                        JOptionPane.ERROR_MESSAGE, null, close, close[0]);
      return;
        }

  app.getStatusArea().appendText(acr.getString(acr.S_OBJSTORE_DELETE_DEST,
                 selObj.toString(), os.getID()));
  ObjStoreDestListCObj destList = (ObjStoreDestListCObj)selObj.getParent();
  app.getExplorer().removeFromParent(selObj);
  // Force selection of ObjStoreDestListCObj
  app.getExplorer().select(((ConsoleObj)destList));
  app.getInspector().refresh();
View Full Code Here

Examples of com.sun.messaging.jmq.admin.objstore.ObjStore

    }

    private void doDeleteConnFactory(ConsoleObj selObj) {

  ObjStore os = ((ObjStoreConFactoryCObj)selObj).getObjStore();
      int result = JOptionPane.showConfirmDialog(app.getFrame(),
      acr.getString(acr.Q_CF_OBJ_DELETE,
              selObj.toString(), os.getID()),
      acr.getString(acr.I_DELETE_OBJSTORE_CF),
      JOptionPane.YES_NO_OPTION);

  if (result == JOptionPane.NO_OPTION)
      return;

  /*
   * Disconnect and delete the object store.
   */
  String lookupName = selObj.toString();
  try {
      os.delete(lookupName);
  } catch (Exception e) {
      JOptionPane.showOptionDialog(app.getFrame(),
    acr.getString(acr.E_DELETE_CF_OBJ, selObj.toString(),
            e.toString()),
    acr.getString(acr.I_DELETE_OBJSTORE_CF) + ": " +
                              acr.getString(acr.I_ERROR_CODE,
                              AdminConsoleResources.E_DELETE_CF_OBJ),
                JOptionPane.YES_NO_OPTION,
                JOptionPane.ERROR_MESSAGE, null, close, close[0]);
      return;
        }

  app.getStatusArea().appendText(acr.getString(acr.S_OBJSTORE_DELETE_CF,
                 selObj.toString(), os.getID()));
  ObjStoreConFactoryListCObj cfList = (ObjStoreConFactoryListCObj)selObj.getParent();
  app.getExplorer().removeFromParent(selObj);
  // Force selection of ObjStoreDestListCObj
  app.getExplorer().select(((ConsoleObj)cfList));
  app.getInspector().refresh();
View Full Code Here

Examples of com.sun.messaging.jmq.admin.objstore.ObjStore

    }

    private void doUpdateDestination(ObjAdminEvent oae, ConsoleObj selObj) {

  ObjStore os = oae.getObjStore();
  String lookupName = oae.getLookupName();
  boolean readOnly = oae.isReadOnly();

  Object currentObj = ((ObjStoreDestCObj)selObj).getObject();
  Object updatedObject = updateObject(currentObj, oae.getDestinationType(),
        oae.getObjProperties(), readOnly);
  if (updatedObject == null)
      return;

  try {
      os.add(lookupName, updatedObject, true);
        } catch (NameAlreadyExistsException naee) {
            // Should never happen, since we pass true to add

        } catch (Exception e)  {
      JOptionPane.showOptionDialog(app.getFrame(),
    e.toString(),
    acr.getString(acr.I_OBJSTORE_DEST_PROPS),
                JOptionPane.YES_NO_OPTION,
                JOptionPane.ERROR_MESSAGE, null, close, close[0]);
      return;
        }

  /*
   * Now replace this updated object in the tree.
   */
  ((ObjStoreDestCObj)selObj).setObject(updatedObject);

  //ConsoleObj parent = (ConsoleObj)selObj.getParent();
  //app.getExplorer().removeFromParent(selObj);

   //ObjStoreDestCObj destCObj = new ObjStoreDestCObj(os, lookupName, updatedObject);
  //app.getExplorer().addToParent(parent, destCObj);

  app.getStatusArea().appendText(acr.getString(acr.S_OBJSTORE_UPDATE_DEST,
                      selObj.toString(), os.getID()));
  app.getInspector().selectedObjectUpdated();

  if (oae.isOKAction())  {
      objStoreDestPropsDialog.hide();
        }
View Full Code Here

Examples of com.sun.messaging.jmq.admin.objstore.ObjStore

        return updatedObject;

    }

    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,
View Full Code Here

Examples of com.sun.messaging.jmq.admin.objstore.ObjStore

  }
    }

    private void doUpdateConnFactory(ObjAdminEvent oae, ConsoleObj selObj) {

  ObjStore os = oae.getObjStore();
  String lookupName = oae.getLookupName();
  boolean readOnly = oae.isReadOnly();

  Object currentObj = ((ObjStoreConFactoryCObj)selObj).getObject();
  Object updatedObject = updateObject(currentObj, oae.getFactoryType(),
              oae.getObjProperties(), readOnly);
  if (updatedObject == null)
      return;

  try {
      os.add(lookupName, updatedObject, true);
        } catch (NameAlreadyExistsException naee) {
            // Should never happen, since we pass true to add

        } catch (Exception e)  {
      JOptionPane.showOptionDialog(app.getFrame(),
    e.toString(),
    acr.getString(acr.I_OBJSTORE_CF_PROPS),
                JOptionPane.YES_NO_OPTION,
                JOptionPane.ERROR_MESSAGE, null, close, close[0]);
      return;
        }

  /*
   * Now replace this updated object in the tree.
   */
  ((ObjStoreConFactoryCObj)selObj).setObject(updatedObject);

  //ConsoleObj parent = (ConsoleObj)selObj.getParent();
  //app.getExplorer().removeFromParent(selObj);

   //ObjStoreConFactoryCObj conFactoryCObj = new ObjStoreConFactoryCObj (os, lookupName, updatedObject);
  //app.getExplorer().addToParent(parent, conFactoryCObj);

  app.getStatusArea().appendText(acr.getString(acr.S_OBJSTORE_UPDATE_CF,
                      selObj.toString(), os.getID()));
  app.getInspector().selectedObjectUpdated();

  if (oae.isOKAction())  {
      objStoreConFactoryPropsDialog.hide();
        }
View Full Code Here

Examples of com.sun.messaging.jmq.admin.objstore.ObjStore

    }

    private void doAddDestination(ObjAdminEvent oae, ConsoleObj selObj) {

  Object object = null;
  ObjStore os = oae.getObjStore();
  int destType = oae.getDestinationType();
  String lookupName = oae.getLookupName();
  Properties objProps = oae.getObjProperties();
  boolean readOnly = oae.isReadOnly();
  boolean overwrite = false;

  if (os.isOpen()) {
      Object newObj = null;
      try {

          if (destType == ObjAdminEvent.TOPIC) {
              newObj = JMSObjFactory.createTopic(objProps);
          } else if (destType == ObjAdminEvent.QUEUE) {
              newObj = JMSObjFactory.createQueue(objProps);
          }

      } catch (Exception e) {
          handleExceptions(e, acr.I_ADD_OBJSTORE_DEST);
    return;
      }

            /*
             * Set this newly created obj to read-only if specified.
             */
      if (readOnly)
                JMSObjFactory.doReadOnlyForAdd(newObj, "true");
      else
                JMSObjFactory.doReadOnlyForAdd(newObj, "false");

      //
      // Check if it already exists so we can confirm with user to
      // overwrite.
      //
      try {
    object = os.retrieve(lookupName);
            } catch (NameNotFoundException nnfe) {
    // Make sure that this exception is NOT treated as an error for add
    ;
      } catch (Exception ex) {
        JOptionPane.showOptionDialog(app.getFrame(),
      ex.toString(),
      acr.getString(acr.I_ADD_OBJSTORE_DEST),
                        JOptionPane.YES_NO_OPTION,
                        JOptionPane.ERROR_MESSAGE, null, close, close[0]);
    return;
      }

      // Object already exists so confirm with user.
      if (object != null) {
          int result = JOptionPane.showConfirmDialog(app.getFrame(),
       acr.getString(acr.Q_LOOKUP_NAME_EXISTS, lookupName),
        acr.getString(acr.I_ADD_OBJSTORE_DEST),
       JOptionPane.YES_NO_OPTION);
    if (result == JOptionPane.NO_OPTION)
        return;
    else
        overwrite = true;
      }

      try {
    os.add(lookupName, newObj, true);
      } catch (Exception ex) {
        JOptionPane.showOptionDialog(app.getFrame(),
      ex.toString(),
      acr.getString(acr.I_ADD_OBJSTORE_DEST),
                        JOptionPane.YES_NO_OPTION,
                        JOptionPane.ERROR_MESSAGE, null, close, close[0]);
    return;
      }

      if (os != null)  {
     /*
      * If already exists, the delete old tree node before adding.
      */
     if (overwrite) {
           removeChild(selObj, lookupName)
           removeChild((ConsoleObj)selObj.getParent().getChildAt(1), lookupName)
     }
     ObjStoreDestCObj destCObj =
      new ObjStoreDestCObj((ObjStoreCObj)selObj.getParent(), lookupName, newObj);
           app.getExplorer().addToParent(selObj, destCObj);
           app.getInspector().refresh();
           app.getStatusArea().appendText(acr.getString(acr.S_OBJSTORE_ADD_DEST,
                     lookupName, os.getID()));
     if (oae.isOKAction())  {
               objStoreDestAddDialog.hide();
     }
      }
  }
View Full Code Here

Examples of com.sun.messaging.jmq.admin.objstore.ObjStore

    }

    private void doAddConnFactory(ObjAdminEvent oae, ConsoleObj selObj) {

  Object object = null;
  ObjStore os = oae.getObjStore();
  int factoryType = oae.getFactoryType();
  String lookupName = oae.getLookupName();
  Properties objProps = oae.getObjProperties();
        boolean readOnly = oae.isReadOnly();
  boolean overwrite = false;

  if (os.isOpen()) {
      Object newObj = null;
      try {

          if (factoryType == ObjAdminEvent.QCF) {
              newObj = JMSObjFactory.createQueueConnectionFactory(objProps);
          } else if (factoryType == ObjAdminEvent.TCF) {
              newObj = JMSObjFactory.createTopicConnectionFactory(objProps);
          } else if (factoryType == ObjAdminEvent.CF) {
              newObj = JMSObjFactory.createConnectionFactory(objProps);
          } else if (factoryType == ObjAdminEvent.XAQCF) {
              newObj = JMSObjFactory.createXAQueueConnectionFactory(objProps);
          } else if (factoryType == ObjAdminEvent.XATCF) {
              newObj = JMSObjFactory.createXATopicConnectionFactory(objProps);
          } else if (factoryType == ObjAdminEvent.XACF) {
              newObj = JMSObjFactory.createXAConnectionFactory(objProps);
          }

      } catch (Exception e) {
    handleExceptions(e, acr.I_ADD_OBJSTORE_CF);
    return;
      }

            /*
             * Set this newly created obj to read-only if specified.
             */
            if (readOnly)
                JMSObjFactory.doReadOnlyForAdd(newObj, "true");
            else
                JMSObjFactory.doReadOnlyForAdd(newObj, "false");

      //
      // Check if it already exists so we can confirm with user to
      // overwrite.
      //
      try {
    object = os.retrieve(lookupName);
            } catch (NameNotFoundException nnfe) {
    // Make sure that this exception is NOT treated as an error for add
    ;
      } catch (Exception ex) {
        JOptionPane.showOptionDialog(app.getFrame(),
      ex.toString(),
      acr.getString(acr.I_ADD_OBJSTORE_CF),
      JOptionPane.YES_NO_OPTION,
                        JOptionPane.ERROR_MESSAGE, null, close, close[0]);
    return;
      }

      // Object already exists so confirm with user.
      if (object != null) {
                int result = JOptionPane.showConfirmDialog(app.getFrame(),
                         acr.getString(acr.Q_LOOKUP_NAME_EXISTS, lookupName),
                         acr.getString(acr.I_ADD_OBJSTORE_CF),
                         JOptionPane.YES_NO_OPTION);
                if (result == JOptionPane.NO_OPTION)
                    return;
                else
                    overwrite = true;
      }

      try {
    os.add(lookupName, newObj, true);
      } catch (Exception ex) {
        JOptionPane.showOptionDialog(app.getFrame(),
      ex.toString(),
      acr.getString(acr.I_ADD_OBJSTORE_CF),
                        JOptionPane.YES_NO_OPTION,
                        JOptionPane.ERROR_MESSAGE, null, close, close[0]);
    return;
      }

      if (os != null)  {
     /*
      * If already exists, the delete old tree node before adding.
      */
     if (overwrite) {
           removeChild(selObj, lookupName)
           removeChild((ConsoleObj)selObj.getParent().getChildAt(0), lookupName)
     }
     ObjStoreConFactoryCObj conFacCObj =
      new ObjStoreConFactoryCObj((ObjStoreCObj)selObj.getParent(), lookupName, newObj);
           app.getExplorer().addToParent(selObj, conFacCObj);
           app.getInspector().refresh();
           app.getStatusArea().appendText(acr.getString(acr.S_OBJSTORE_ADD_CF,
                     lookupName, os.getID()));
     if (oae.isOKAction())  {
               objStoreConFactoryAddDialog.hide();
     }
      }
  }
View Full Code Here

Examples of com.sun.messaging.jmq.admin.objstore.ObjStore

  }

  Vector v = osMgr.getAllStores();

  for (int i = 0; i < v.size(); i++) {
      ObjStore os = (ObjStore)v.get(i);
      ConsoleObj osCObj= new ObjStoreCObj(os);

      if (os.isOpen()) {
          readObjStore(osCObj, osMgr, os);
      }
      app.getExplorer().addObjStore(osCObj);
  }
View Full Code Here

Examples of com.sun.messaging.jmq.admin.objstore.ObjStore

  }
    }

    private void doRefreshConnFactory(ConsoleObj selObj) {

  ObjStore os = ((ObjStoreConFactoryCObj)selObj).getObjStore();
  String lookupName = ((ObjStoreConFactoryCObj)selObj).getLookupName();
  Object object = null;

  try {
      object = os.retrieve(lookupName);
        } catch (Exception e)  {
      JOptionPane.showOptionDialog(app.getFrame(),
    e.toString(),
    acr.getString(acr.I_OBJSTORE_REFRESH_CF),
                JOptionPane.YES_NO_OPTION,
                JOptionPane.ERROR_MESSAGE, null, close, close[0]);
      return;
        }

  /*
   * Now replace this updated object in the tree.
   */
  ((ObjStoreConFactoryCObj)selObj).setObject(object);

  app.getStatusArea().appendText(acr.getString(acr.S_OS_CF_REFRESH,
                      selObj.toString(), os.getID()));
  app.getInspector().selectedObjectUpdated();

    }
View Full Code Here

Examples of com.sun.messaging.jmq.admin.objstore.ObjStore

    }

    private void doRefreshDestination(ConsoleObj selObj) {

  ObjStore os = ((ObjStoreDestCObj)selObj).getObjStore();
  String lookupName = ((ObjStoreDestCObj)selObj).getLookupName();
  Object object = null;

  try {
      object = os.retrieve(lookupName);
        } catch (Exception e)  {
      JOptionPane.showOptionDialog(app.getFrame(),
    e.toString(),
    acr.getString(acr.I_OBJSTORE_REFRESH_DEST),
                JOptionPane.YES_NO_OPTION,
                JOptionPane.ERROR_MESSAGE, null, close, close[0]);
      return;
        }

  /*
   * Now replace this updated object in the tree.
   */
  ((ObjStoreDestCObj)selObj).setObject(object);

  app.getStatusArea().appendText(acr.getString(acr.S_OS_DEST_REFRESH,
                      selObj.toString(), os.getID()));
  app.getInspector().selectedObjectUpdated();

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.