Package javax.jms

Examples of javax.jms.InvalidClientIDException


      }
      catch (HornetQException e)
      {
         if (e.getType() == HornetQExceptionType.DUPLICATE_METADATA)
         {
            throw new InvalidClientIDException("clientID=" + clientID + " was already set into another connection");
         }
      }

      this.clientID = clientID;
      try
View Full Code Here


         String clientID = spec.getClientID();

         // Durable sub
         if (clientID == null)
         {
            throw new InvalidClientIDException("Cannot create durable subscription for " + subscriptionName +
                                               " - client ID has not been set");
         }

         SimpleString queueName = new SimpleString(HornetQDestination.createQueueNameForDurableSubscription(clientID,
                                                                                                            subscriptionName));
View Full Code Here

    }

    public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception {
        String clientId = info.getClientId();
        if (clientId == null) {
            throw new InvalidClientIDException("No clientID specified for connection request");
        }
        synchronized (clientIdSet ) {
            if (clientIdSet.containsKey(clientId)) {
                throw new InvalidClientIDException("Broker: " + getBrokerName() + " - Client: " + clientId + " already connected");
            }
            else {
                clientIdSet.put(clientId, info);
            }
        }
View Full Code Here

    }

    public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
        String clientId = info.getClientId();
        if (clientId == null) {
            throw new InvalidClientIDException("No clientID specified for connection disconnect request");
        }
        synchronized (clientIdSet) {
            ConnectionInfo oldValue = (ConnectionInfo) clientIdSet.get(clientId);
            // we may be removing the duplicate connection, not the first connection to be created
            // so lets check that their connection IDs are the same
View Full Code Here

      }
      if (isValid) {
        // The existing client is valid, so kick the new client
        log.info("Client: " + clientId + " on transport: " + existingClient.getChannel()
            + "' is alive, rejecting new client on transport: " + client.getChannel());
        throw new InvalidClientIDException("Duplicate clientId: " + info);
      } else {
        // A transport error occured or the existing client did not
        // respond in time, so kick it and let the new client connect.
        log.info("Replacing client: " + clientId + " on transport: " + existingClient.getChannel() + " ("
            + ex.getMessage() + ") with client on transport: " + client.getChannel());
View Full Code Here

                    public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception {
                        String clientId = info.getClientId();
                        if (clientId != null && !clientId.isEmpty()) {
                            if (clientId.equalsIgnoreCase("invalid")) {
                                LOG.info("Client ID was invalid");
                                throw new InvalidClientIDException("Bad client Id");
                            } else if (clientId.equalsIgnoreCase("bad-credential")) {
                                LOG.info("User Name was invalid");
                                throw new CredentialException("Unknwon User Name.");
                            }
                        }
View Full Code Here

    @Override
    public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception {
        String clientId = info.getClientId();
        if (clientId == null) {
            throw new InvalidClientIDException("No clientID specified for connection request");
        }

        ConnectionContext oldContext = null;

        synchronized (clientIdSet) {
            oldContext = clientIdSet.get(clientId);
            if (oldContext != null) {
                if (context.isAllowLinkStealing()) {
                    clientIdSet.put(clientId, context);
                } else {
                    throw new InvalidClientIDException("Broker: " + getBrokerName() + " - Client: " + clientId + " already connected from "
                        + oldContext.getConnection().getRemoteAddress());
                }
            } else {
                clientIdSet.put(clientId, context);
            }
View Full Code Here

    @Override
    public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
        String clientId = info.getClientId();
        if (clientId == null) {
            throw new InvalidClientIDException("No clientID specified for connection disconnect request");
        }
        synchronized (clientIdSet) {
            ConnectionContext oldValue = clientIdSet.get(clientId);
            // we may be removing the duplicate connection, not the first connection to be created
            // so lets check that their connection IDs are the same
View Full Code Here

     * @throws InvalidClientIDException if the ClientID of the Connection is a duplicate
     */
    public void registerConnection(BrokerClient client, ConnectionInfo info) throws InvalidClientIDException {
        String clientId = info.getClientId();
        if (clientIds.containsKey(clientId)) {
            throw new InvalidClientIDException("Duplicate clientId: " + info);
        }
        log.info("Adding new client: " + clientId + " on transport: " + client.getChannel());
        clientIds.put(clientId, client);
    }
View Full Code Here

    }

    public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception {
        String clientId = info.getClientId();
        if (clientId == null) {
            throw new InvalidClientIDException("No clientID specified for connection request");
        }
        synchronized (clientIdSet) {
            ConnectionContext oldContext = clientIdSet.get(clientId);
            if (oldContext != null) {
              if (context.isFaultTolerant() || context.isNetworkConnection()){
                //remove the old connection
                try{
                  removeConnection(oldContext, info, new Exception("remove stale client"));
                }catch(Exception e){
                  LOG.warn("Failed to remove stale connection ",e);
                }
              }else{
                throw new InvalidClientIDException("Broker: " + getBrokerName() + " - Client: " + clientId + " already connected from "
                                                   + oldContext.getConnection().getRemoteAddress());
              }
            } else {
                clientIdSet.put(clientId, context);
            }
View Full Code Here

TOP

Related Classes of javax.jms.InvalidClientIDException

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.