Examples of ObjStore


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

    public void doClose() { hide(); }
    public void doClear() { }

    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);
  }
 
View Full Code Here

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

  super.show();
    }

    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 (!prevOsName.equals(osName) &&  // they changed it
      osMgr != null &&
      osMgr.getStore(osName) != null)  {
View Full Code Here

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

                    objStoreDestAddDialog.addAdminEventListener(this);
                    objStoreDestAddDialog.setLocationRelativeTo(app.getFrame());
          }

          // This should't happen - menu item should be disabled.
    ObjStore os = ((ObjStoreDestListCObj)selObj).getObjStore();
    if (!os.isOpen()) {
            JOptionPane.showOptionDialog(app.getFrame(),
      acr.getString(acr.E_OBJSTORE_NOT_CONNECTED, os.getID()),
      acr.getString(acr.I_ADD_OBJSTORE_DEST) + ": " +
          acr.getString(acr.I_ERROR_CODE,
            AdminConsoleResources.E_OBJSTORE_NOT_CONNECTED),
      JOptionPane.YES_NO_OPTION,
      JOptionPane.ERROR_MESSAGE, null, close, close[0]);
    }
                objStoreDestAddDialog.show((ObjStoreDestListCObj)selObj);

      } else if (selObj instanceof ObjStoreConFactoryListCObj) {
    if (objStoreConFactoryAddDialog == null) {
                    objStoreConFactoryAddDialog = new ObjStoreConFactoryAddDialog(app.getFrame());
                    objStoreConFactoryAddDialog.addAdminEventListener(this);
                    objStoreConFactoryAddDialog.setLocationRelativeTo(app.getFrame());
          }
          // This should't happen - menu item should be disabled.
    ObjStore os = ((ObjStoreConFactoryListCObj)selObj).getObjStore();
    if (!os.isOpen()) {
            JOptionPane.showOptionDialog(app.getFrame(),
      acr.getString(acr.E_OBJSTORE_NOT_CONNECTED, os.getID()),
      acr.getString(acr.I_ADD_OBJSTORE_CF) + ": " +
          acr.getString(acr.I_ERROR_CODE,
            AdminConsoleResources.E_OBJSTORE_NOT_CONNECTED),
      JOptionPane.YES_NO_OPTION,
      JOptionPane.ERROR_MESSAGE, null, close, close[0]);
        return;
    }
                objStoreConFactoryAddDialog.show((ObjStoreConFactoryListCObj)selObj);

            }
  break;

        case DialogEvent.DELETE_DIALOG:
      if (selObj instanceof ObjStoreCObj) {
    doDeleteObjStore(selObj);
      } else if (selObj instanceof ObjStoreDestCObj) {
    doDeleteDestination(selObj);
      } else if (selObj instanceof ObjStoreConFactoryCObj) {
    doDeleteConnFactory(selObj);
            }
        break;

  case DialogEvent.PROPS_DIALOG:
      if (selObj instanceof ObjStoreCObj) {
    if (objStorePropsDialog == null) {
        ObjStoreCObj osCObj = (ObjStoreCObj)selObj;
        ObjStoreListCObj oslCObj = (ObjStoreListCObj)osCObj.getParent();
                    objStorePropsDialog = new ObjStorePropsDialog(app.getFrame(),
            oslCObj);
                    objStorePropsDialog.addAdminEventListener(this);
                    objStorePropsDialog.setLocationRelativeTo(app.getFrame());
          }
                objStorePropsDialog.show((ObjStoreCObj)selObj);
      } else if (selObj instanceof ObjStoreDestCObj) {
    if (objStoreDestPropsDialog == null) {
                    objStoreDestPropsDialog = new ObjStoreDestPropsDialog
            (app.getFrame());
                    objStoreDestPropsDialog.addAdminEventListener(this);
                    objStoreDestPropsDialog.setLocationRelativeTo(app.getFrame());
          }
          // This should't happen - menu item should be disabled.
    ObjStore os = ((ObjStoreDestCObj)selObj).getObjStore();
    if (!os.isOpen()) {
            JOptionPane.showOptionDialog(app.getFrame(),
      acr.getString(acr.E_OBJSTORE_NOT_CONNECTED, os.getID()),
      acr.getString(acr.I_OBJSTORE_DEST_PROPS) + ": " +
          acr.getString(acr.I_ERROR_CODE,
                              AdminConsoleResources.E_OBJSTORE_NOT_CONNECTED),
      JOptionPane.YES_NO_OPTION,
      JOptionPane.ERROR_MESSAGE, null, close, close[0]);
        return;
    }
                objStoreDestPropsDialog.show((ObjStoreDestCObj)selObj);
      } else if (selObj instanceof ObjStoreConFactoryCObj) {
    if (objStoreConFactoryPropsDialog == null) {
                    objStoreConFactoryPropsDialog =
      new ObjStoreConFactoryPropsDialog(app.getFrame());
                    objStoreConFactoryPropsDialog.addAdminEventListener(this);
                    objStoreConFactoryPropsDialog.setLocationRelativeTo
              (app.getFrame());
          }
          // This should't happen - menu item should be disabled.
    ObjStore os = ((ObjStoreConFactoryCObj)selObj).getObjStore();
    if (!os.isOpen()) {
            JOptionPane.showOptionDialog(app.getFrame(),
      acr.getString(acr.E_OBJSTORE_NOT_CONNECTED, os.getID()),
      acr.getString(acr.I_OBJSTORE_CF_PROPS) + ": " +
                            acr.getString(acr.I_ERROR_CODE,
                              AdminConsoleResources.E_OBJSTORE_NOT_CONNECTED),
                        JOptionPane.YES_NO_OPTION,
                        JOptionPane.ERROR_MESSAGE, null, close, close[0]);
View Full Code Here

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

  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, osMgr, os);
      }
  }   
  /*
   * If os is still valid, then add it to the tree list.
View Full Code Here

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

    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, osMgr, os);
      }
  } 

  /*
 
View Full Code Here

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

    }

    private ObjStore createStore(ObjStoreManager osMgr, ObjStoreAttrs osa,
         boolean attemptToConnect) {
  ObjStore os = null;

  if (osMgr == null || osa == null)  {
      JOptionPane.showOptionDialog(app.getFrame(),
      acr.getString(acr.E_OS_PROCESS),
      acr.getString(acr.I_OBJSTORE) + ": " +
                                acr.getString(acr.I_ERROR_CODE,
                                  AdminConsoleResources.E_OS_PROCESS),
                        JOptionPane.YES_NO_OPTION,
                        JOptionPane.ERROR_MESSAGE, null, close, close[0]);
      return (null);
  }

  /*
   * Create ObjStore
   */
  try  {
      os = osMgr.createStore(osa);
        } catch (Exception ex) {
      JOptionPane.showOptionDialog(app.getFrame(),
      ex.toString(),
      acr.getString(acr.I_OBJSTORE),
                        JOptionPane.YES_NO_OPTION,
                        JOptionPane.ERROR_MESSAGE, null, close, close[0]);
      return null;
  }

  /*
   * Now try connecting to it (if they want to try).
   * Then read in the objects from the store.
   */
  if (attemptToConnect) {

      try {
          if (os != null)
              os.open();
      } catch (Exception e) {
          JOptionPane.showOptionDialog(app.getFrame(),
        acr.getString(acr.E_INSUFFICIENT_INFO, e.toString()),
        acr.getString(acr.I_OBJSTORE) + ": " +
                        acr.getString(acr.I_ERROR_CODE,
View Full Code Here

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

    }

    private ObjStore updateStore(ObjStore prevOs, String newName,
         ObjStoreManager osMgr,
         ObjStoreAttrs osa, boolean attemptToConnect) {
  ObjStore os = null;
  boolean created = false;

  if (osMgr == null || osa == null)  {
      JOptionPane.showOptionDialog(app.getFrame(),
      acr.getString(acr.E_OS_PROCESS),
      acr.getString(acr.I_OBJSTORE) + ": " +
                                acr.getString(acr.I_ERROR_CODE,
                                  AdminConsoleResources.E_OS_PROCESS),
                        JOptionPane.YES_NO_OPTION,
                        JOptionPane.ERROR_MESSAGE, null, close, close[0]);
      return (null);
  }

  /*
   * Update ObjStore
   */
  ObjStoreAttrs prevAttrs = prevOs.getObjStoreAttrs();
  os = osMgr.getStore(prevOs.getID());

  if (os == null) {
      JOptionPane.showOptionDialog(app.getFrame(),
      acr.getString(acr.E_OS_PROCESS),
      acr.getString(acr.I_OBJSTORE) + ": " +
                                acr.getString(acr.I_ERROR_CODE,
                                  AdminConsoleResources.E_OS_PROCESS),
                        JOptionPane.YES_NO_OPTION,
                        JOptionPane.ERROR_MESSAGE, null, close, close[0]);
  }

  //
  // If we're changing the OS name, then we need to
  // delete old os and create new one.
  // Otherwise, just set new attrs on the os.
  //
  try  {
      if (newName != null && os != null && !newName.equals(os.getID())) {
          os = osMgr.createStore(osa);
    created = true;
      } else if (os != null)  {
          os.setObjStoreAttrs(osa);
      }
        } catch (Exception ex) {
      JOptionPane.showOptionDialog(app.getFrame(),
    ex.toString(),
    acr.getString(acr.I_OBJSTORE_PROPS),
                JOptionPane.YES_NO_OPTION,
                JOptionPane.ERROR_MESSAGE, null, close, close[0]);
      return null;
  }

  /*
   * Now try connecting to it (if they want to try).
   * Then read in the objects from the store.
   */
  if (attemptToConnect) {
      try {
          if (os != null) {
              os.open();
          }
      } catch (Exception e) {
          JOptionPane.showOptionDialog(app.getFrame(),
      acr.getString(acr.E_INSUFFICIENT_INFO, e.toString()),
      acr.getString(acr.I_OBJSTORE_PROPS) + ": " +
                                acr.getString(acr.I_ERROR_CODE,
                                  AdminConsoleResources.E_INSUFFICIENT_INFO),
                        JOptionPane.YES_NO_OPTION,
                        JOptionPane.ERROR_MESSAGE, null, close, close[0]);
    // Don't update it, undo everything
    try {
        if (created) {
          osMgr.destroyStore(osa.getID());
        } else {
      // Reset old attrs back
      os.setObjStoreAttrs(prevAttrs);
        }
     } catch (Exception ex) { }
        return null;
      }
  }

  //
  // If successful in updating, now we can delete the old one.
  //
  if (os != null && created) {
      try {
    if (prevOs.isOpen())
        prevOs.close();
        osMgr.destroyStore(prevOs.getID());

           if (!attemptToConnect && os.isOpen())
        os.close();

      } catch (Exception ex) { }
  }

  //
  // If the os is open and unchecked connect box, then close it.
  //
   if (os != null && !attemptToConnect && os.isOpen()) {
      try {
    os.close();
      } catch (Exception ex) { }
  }
  return (os);
    }
View Full Code Here

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

  return (os);
    }

    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();

        boolean carriageReturnNeeded = false;
        if (missingAuthInfo != null && missingAuthInfoSize > 0) {
      if (objStorePasswdDialog == null && missingAuthInfoSize > 0) {
View Full Code Here

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

    }


    private void doDisconnectObjStore(ConsoleObj selObj) {

  ObjStore os =((ObjStoreCObj)selObj).getObjStore();

  if (!os.isOpen()) {
      JOptionPane.showOptionDialog(app.getFrame(),
    acr.getString(acr.E_OS_ALREADY_DISCONNECTED,
            selObj.toString()),
    acr.getString(acr.I_DISCONNECT_OBJSTORE) + ": " +
                    acr.getString(acr.I_ERROR_CODE,
                      AdminConsoleResources.E_OS_ALREADY_DISCONNECTED),
                JOptionPane.YES_NO_OPTION,
                JOptionPane.ERROR_MESSAGE, null, close, close[0]);
      return;
  }

  try {
      if (os != null)
          os.close();
  } catch (Exception e) {
      JOptionPane.showOptionDialog(app.getFrame(),
      acr.getString(acr.E_OS_UNABLE_DISCONNECT,
              selObj.toString()),
      acr.getString(acr.I_DISCONNECT_OBJSTORE) + ": " +
View Full Code Here

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

      return;

  /*
   * Disconnect and delete the object store.
   */
  ObjStore os = ((ObjStoreCObj)selObj).getObjStore();
  try {
      os.close();
  } catch (Exception e) { }

  ObjStoreManager osMgr = app.getObjStoreListCObj().getObjStoreManager();
  try {
      osMgr.destroyStore(os.getID());
  } catch (Exception e) { }

  /*
   * Remove the node from the tree.
   */
  app.getExplorer().removeFromParent(selObj);
  app.getStatusArea().appendText(acr.getString(acr.S_OBJSTORE_DELETE,
               os.getID()));

  /*
   * Clear selection if the selection is from the explorer.
   * Otherwise, refresh the inspector.
   */
 
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.