Class AbstractAmqCommand

java.lang.Object
org.apache.activemq.console.command.AbstractCommand
org.apache.activemq.console.command.AbstractAmqCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
AmqBrowseCommand

public abstract class AbstractAmqCommand extends AbstractCommand
  • Constructor Details

    • AbstractAmqCommand

      public AbstractAmqCommand()
  • Method Details

    • createConnection

      protected jakarta.jms.Connection createConnection() throws jakarta.jms.JMSException
      Establishes a connection to the remote broker specified by the broker url.
      Returns:
      - connection to the broker
      Throws:
      jakarta.jms.JMSException
    • createConnection

      protected jakarta.jms.Connection createConnection(String username, String password) throws jakarta.jms.JMSException
      Establishes a connection to the remote broker specified by the broker url.
      Parameters:
      username - - username for the connection
      password - - password for the connection
      Returns:
      - connection to the broker
      Throws:
      jakarta.jms.JMSException
    • closeAllConnections

      protected void closeAllConnections()
      Close all created connections.
    • handleOption

      protected void handleOption(String token, List tokens) throws Exception
      Handle the --amqurl option.
      Overrides:
      handleOption in class AbstractCommand
      Parameters:
      token - - current option
      tokens - - succeeding list of arguments
      Throws:
      Exception
    • setBrokerUrl

      protected void setBrokerUrl(URI brokerUrl)
      Set the broker url.
      Parameters:
      brokerUrl - - new broker url
    • setBrokerUrl

      protected void setBrokerUrl(String address) throws URISyntaxException
      Set the broker url.
      Parameters:
      address - - address of the new broker url
      Throws:
      URISyntaxException
    • getBrokerUrl

      protected URI getBrokerUrl()
      Get the current broker url.
      Returns:
      current broker url
    • getConnectionFactory

      public jakarta.jms.ConnectionFactory getConnectionFactory()
      Returns:
      the factory
    • getUsername

      public String getUsername()
      Returns:
      the username
    • setFactory

      public void setFactory(jakarta.jms.ConnectionFactory factory)
      Parameters:
      factory - the factory to set
    • setUsername

      public void setUsername(String username)
      Parameters:
      username - the username to set
    • getPassword

      public String getPassword()
      Returns:
      the password
    • setPassword

      public void setPassword(String password)
      Parameters:
      password - the password to set
    • getPasswordFactory

      public PasswordFactory getPasswordFactory()
      Returns:
      the passwordFactory
    • setPasswordFactory

      public void setPasswordFactory(PasswordFactory passwordFactory)
      Parameters:
      passwordFactory - the passwordFactory to set