Package hermes.config

Examples of hermes.config.ConnectionConfig


   public FactoryConfig getFactoryConfig(HermesConfig config, String hermesId) throws HermesException
   {
      for (Iterator<FactoryConfig> factoryIter = config.getFactory().iterator(); factoryIter.hasNext();)
      {
         FactoryConfig factoryConfig = factoryIter.next();
         ConnectionConfig connectionConfig = (ConnectionConfig) factoryConfig.getConnection().get(0);

         if (connectionConfig.getSession().size() > 0)
         {
            SessionConfig sessionConfig = (SessionConfig) connectionConfig.getSession().get(0);

            if (sessionConfig.getId().equals(hermesId))
            {
               return factoryConfig;
            }
View Full Code Here


    * @see hermes.impl.ConfigDAO#duplicate(hermes.config.ConnectionConfig,
    *      java.lang.String)
    */
   public ConnectionConfig duplicate(ConnectionConfig sourceConnection, String newSessionId) throws JAXBException
   {
      ConnectionConfig rval = factory.createConnectionConfig();
      SessionConfig sessionConfig = (SessionConfig) sourceConnection.getSession().get(0);

      rval.setPassword(sourceConnection.getPassword());
      rval.setUsername(sourceConnection.getUsername());

      rval.getSession().add(duplicate(sessionConfig, newSessionId));

      return rval;
   }
View Full Code Here

    *      java.lang.String)
    */
   public FactoryConfig duplicate(FactoryConfig sourceFactory, String newSessionId) throws JAXBException
   {
      FactoryConfig rval = factory.createFactoryConfig();
      ConnectionConfig connectionConfig = (ConnectionConfig) sourceFactory.getConnection().get(0);

      rval.setClasspathId(sourceFactory.getClasspathId());
      rval.setExtension(sourceFactory.getExtension());
      rval.setProvider(sourceFactory.getProvider());

View Full Code Here

      {
         public void actionPerformed(ActionEvent arg0)
         {
            try
            {
               ConnectionConfig cConfig = (ConnectionConfig) factoryConfig.getConnection().get(0);
               SessionConfig sConfig = (SessionConfig) cConfig.getSession().get(0);
               DestinationConfig dConfig = new DestinationConfig() ;
               dConfig.setDomain(Domain.QUEUE.getId()) ;
               dConfig.setName("NEW") ;

               destinationTableModel.addItem(dConfig) ;
               doEdit(sConfig.getId(), dConfig);
               dialog.setDirty();
            }
            catch (Exception ex)
            {
               cat.error(ex.getMessage(), ex);
            }
         }
      });

      removeItem.addActionListener(new ActionListener()
      {
         public void actionPerformed(ActionEvent arg0)
         {
            for (int row : destinationTable.getSelectedRows())
            {
               if (row >= 0)
               {
                  int realRow = destinationTable.getActualRowAt(row);
                  destinationTableModel.removeRow(realRow);
                  dialog.setDirty();
               }
            }
         }
      });

      mouseAdapter = new MouseAdapter()
      {
         public void mousePressed(MouseEvent e)
         {
            if (SwingUtilities.isRightMouseButton(e))
            {
               if (e.getComponent() == destinationTableSP)
               {
                  removeItem.setEnabled(false);
               }
               else
               {
                  removeItem.setEnabled(true);
               }

               popupMenu.show(e.getComponent(), e.getX(), e.getY());
            }
            else if (e.getClickCount() == 2)
            {
               int row = destinationTable.getActualRowAt(destinationTable.getSelectedRow());

               if (row >= 0)
               {
                  ConnectionConfig cConfig = (ConnectionConfig) factoryConfig.getConnection().get(0);
                  SessionConfig sConfig = (SessionConfig) cConfig.getSession().get(0);
                  doEdit(sConfig.getId(), destinationTableModel.getRowConfig(row));
               }
            }
         }
      };
View Full Code Here

         {
            FactoryConfig factoryConfig = (FactoryConfig) iter.next();

            if (factoryConfig.getConnection().size() == 0)
            {
               factoryConfig.getConnection().add(new ConnectionConfig());
            }

            if (factoryConfig.getProvider().getProperties() == null)
            {
               factoryConfig.getProvider().setProperties(new PropertySetConfig());
            }

            connectionFactoryConfigPanel.setFactoryConfig(model, factoryConfig);
            destinationConfigPanel.setFactoryConfig(factoryConfig);

            for (Iterator iter3 = factoryConfig.getConnection().iterator(); iter3.hasNext();)
            {
               ConnectionConfig connectionConfig = (ConnectionConfig) iter3.next();

               connectionConfigPanel.setConnectionConfig(connectionConfig);

               for (Iterator iter4 = connectionConfig.getSession().iterator(); iter4.hasNext();)
               {
                  SessionConfig sessionConfig = (SessionConfig) iter4.next();

                  if (firstSessionId == null)
                  {
View Full Code Here

            for (Iterator iter = HermesBrowser.getBrowser().getConfig().getFactory().iterator(); iter.hasNext();)
            {
               FactoryConfig fConfig = (FactoryConfig) iter.next();

               ConnectionConfig cConfig = (ConnectionConfig) fConfig.getConnection().get(0);

               for (Iterator iter2 = cConfig.getSession().iterator(); iter2.hasNext();)
               {
                  SessionConfig sConfig = (SessionConfig) iter2.next();

                  if (sConfig.getId() == null || sConfig.getId().equals(""))
                  {
View Full Code Here

  private JComboBox comboBox;
  private JTextField sessionName;

  public BasicConnectionPanel(String serverUrlProperty, FactoryConfig factoryConfig, HermesConfig config) {
    this.factoryConfig = factoryConfig;
    ConnectionConfig connectionConfig = factoryConfig.getConnection().get(0) ;
    SessionConfig sessionConfig = connectionConfig.getSession().get(0) ;
    setLayout(new FormLayout(new ColumnSpec[] {
        FormFactory.RELATED_GAP_COLSPEC,
        ColumnSpec.decode("max(41dlu;default)"),
        FormFactory.RELATED_GAP_COLSPEC,
        ColumnSpec.decode("118dlu:grow"),
        ColumnSpec.decode("22dlu"),},
      new RowSpec[] {
        FormFactory.RELATED_GAP_ROWSPEC,
        FormFactory.DEFAULT_ROWSPEC,
        FormFactory.RELATED_GAP_ROWSPEC,
        FormFactory.DEFAULT_ROWSPEC,
        FormFactory.RELATED_GAP_ROWSPEC,
        FormFactory.DEFAULT_ROWSPEC,
        FormFactory.RELATED_GAP_ROWSPEC,
        FormFactory.DEFAULT_ROWSPEC,
        FormFactory.RELATED_GAP_ROWSPEC,
        FormFactory.DEFAULT_ROWSPEC,
        FormFactory.RELATED_GAP_ROWSPEC,
        FormFactory.DEFAULT_ROWSPEC,
        FormFactory.RELATED_GAP_ROWSPEC,
        FormFactory.DEFAULT_ROWSPEC,}));
   
    JLabel lblName = new JLabel("Name:");
    lblName.setHorizontalAlignment(SwingConstants.RIGHT);
    add(lblName, "2, 2, right, default");
   
    sessionName = new JTextField();
    add(sessionName, "4, 2, fill, default");
    sessionName.setColumns(10);

    JLabel lblServerurl = new JLabel(getServerUrlLabel());
    lblServerurl.setHorizontalAlignment(SwingConstants.RIGHT);
    add(lblServerurl, "2, 4, right, default");

    serverURL = new JTextField();
    serverURL.setText(getValueOf(serverUrlProperty));
    add(serverURL, "4, 4, fill, default");
    serverURL.setColumns(10);

    JLabel lblUsername = new JLabel("Username:");
    lblUsername.setHorizontalAlignment(SwingConstants.RIGHT);
    add(lblUsername, "2, 6, right, default");

    username = new JTextField(connectionConfig.getUsername());
    add(username, "4, 6, fill, default");
    username.setColumns(10);

    JLabel lblPassword = new JLabel("Password:");
    lblPassword.setHorizontalAlignment(SwingConstants.RIGHT);
    add(lblPassword, "2, 8, right, default");

    password = new JPasswordField(connectionConfig.getPassword()) ;
    add(password, "4, 8, fill, default");
    password.setColumns(10);

    JLabel lblClientid = new JLabel("ClientID:");
    lblClientid.setHorizontalAlignment(SwingConstants.RIGHT);
    add(lblClientid, "2, 10, right, default");

    clientID = new JTextField(connectionConfig.getClientID());
    add(clientID, "4, 10, fill, default");
    clientID.setColumns(10);

    JLabel lblClassloader = new JLabel("ClassLoader:");
    lblClassloader.setHorizontalAlignment(SwingConstants.RIGHT);
View Full Code Here

  public boolean isValid() {
    return !TextUtils.isEmpty(sessionName.getText()) ;
  }
 
  public void setValues(FactoryConfig config) {
    ConnectionConfig connectionConfig = HermesBrowser.getConfigDAO().getFactory().createConnectionConfig() ;
    SessionConfig sessionConfig = HermesBrowser.getConfigDAO().getFactory().createSessionConfig() ;
   
    connectionConfig.setUsername(getUsername()) ;
    connectionConfig.setPassword(getPassword()) ;
    connectionConfig.setClientID(getClientID()) ;
   
    sessionConfig.setId(sessionName.getText()) ;
   
    connectionConfig.getSession().add(sessionConfig) ;
    config.getConnection().add(connectionConfig) ;
  }
View Full Code Here

TOP

Related Classes of hermes.config.ConnectionConfig

Copyright © 2018 www.massapicom. 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.