Package org.hornetq.core.protocol.stomp

Examples of org.hornetq.core.protocol.stomp.HornetQStompException


         HornetQServerLogger.LOGGER.stompTXAckNorSupported();
      }

      if (subscriptionID == null)
      {
         response = new HornetQStompException("subscription header is required").getFrame();
         return response;
      }

      try
      {
View Full Code Here


                        {
                           decoder.headerName = holder.getString();
                        }
                        catch (UnsupportedEncodingException e)
                        {
                           throw new HornetQStompException("Encoding exception", e);
                        }

                        holder.reset();

                        decoder.inHeaderName = false;

                        decoder.headerBytesCopyStart = decoder.pos;

                        decoder.headerValueWhitespace = true;
                     }
                  }

                  decoder.whiteSpaceOnly = false;

                  break;
               }
               case StompDecoder.LN:
               {
                  if (isEscaping)
                  {
                     holder.append(StompDecoder.NEW_LINE);
                     isEscaping = false;
                  }
                  else
                  {
                     holder.append(b);
                  }
                  break;
               }
               case StompDecoder.NEW_LINE:
               {
                  if (decoder.whiteSpaceOnly)
                  {
                     // Headers are terminated by a blank line
                     decoder.readingHeaders = false;

                     break outer;
                  }

                  String headerValue;
                  try
                  {
                     headerValue = holder.getString();
                  }
                  catch (UnsupportedEncodingException e)
                  {
                     throw new HornetQStompException("Encoding exception.", e);
                  }
                  holder.reset();

                  decoder.headers.put(decoder.headerName, headerValue);
View Full Code Here

      }
      else
      {
         if (destination == null)
         {
            response = new HornetQStompException("Must specify the subscription's id or " +
                  "the destination you are unsubscribing from").getFrame();
            return response;
         }
         subscriptionID = "subscription/" + destination;
      }
View Full Code Here

      }
      else
      {
         if (destination == null)
         {
            HornetQStompException error = BUNDLE.needIDorDestination();
            response = error.getFrame();
            return response;
         }
         subscriptionID = "subscription/" + destination;
      }
View Full Code Here

         HornetQServerLogger.LOGGER.stompTXAckNorSupported();
      }

      if (messageID == null)
      {
         HornetQStompException error = BUNDLE.noIDInAck();
         error.setHandler(connection.getFrameHandler());
         return error.getFrame();
      }

      try
      {
         connection.acknowledge(messageID, null);
View Full Code Here

                        {
                           headerName = holder.getString();
                        }
                        catch (UnsupportedEncodingException e)
                        {
                           throw new HornetQStompException("Encoding exception", e);
                        }

                        holder.reset();

                        inHeaderName = false;
View Full Code Here

   private void handleHeartBeat(String heartBeatHeader) throws HornetQStompException
   {
      String[] params = heartBeatHeader.split(",");
      if (params.length != 2)
      {
         throw new HornetQStompException("Incorrect heartbeat header " + heartBeatHeader);
      }

      //client ping
      long minPingInterval = Long.valueOf(params[0]);
      //client receive ping
View Full Code Here

         HornetQServerLogger.LOGGER.stompTXAckNorSupported();
      }

      if (messageID == null)
      {
         return new HornetQStompException(connection, "No id header in ACK/NACK frame.").getFrame();
      }

      try
      {
         connection.acknowledge(messageID, null);
View Full Code Here

                        {
                           headerName = holder.getString();
                        }
                        catch (UnsupportedEncodingException e)
                        {
                           throw new HornetQStompException("Encoding exception", e);
                        }

                        holder.reset();

                        inHeaderName = false;

                        headerValueWhitespace = true;
                     }
                  }

                  whiteSpaceOnly = false;

                  break;
               }
               case LN:
               {
                  if (isEscaping)
                  {
                     holder.append(NEW_LINE);
                     isEscaping = false;
                  }
                  else
                  {
                     holder.append(b);
                  }
                  break;
               }
               case RT:
               {
                  if (isEscaping)
                  {
                     holder.append(CR);
                     isEscaping = false;
                  }
                  else
                  {
                     holder.append(b);
                  }
                  break;
               }
               case CR:
               {
                  if (nextEOLChar)
                  {
                     throw new HornetQStompException("Invalid char in parsing headers: two consecutive carriage returns");
                  }
                  nextEOLChar = true;
                  break;
               }
               case NEW_LINE:
               {
                  nextEOLChar = false;
                  if (whiteSpaceOnly)
                  {
                     // Headers are terminated by a blank line
                     readingHeaders = false;
                     break outer;
                  }

                  String headerValue;
                  try
                  {
                     headerValue = holder.getString();
                  }
                  catch (UnsupportedEncodingException e)
                  {
                     throw new HornetQStompException("Encoding exception.", e);
                  }
                  holder.reset();

                  if (!headers.containsKey(headerName))
                  {
View Full Code Here

         response = e.getFrame();
      }
      catch (UnsupportedEncodingException e)
      {
         HornetQServerLogger.LOGGER.errorEncodingStompPacket(e);
         response = new HornetQStompException("Encoding error.", e).getFrame();
      }

      return response;
   }
View Full Code Here

TOP

Related Classes of org.hornetq.core.protocol.stomp.HornetQStompException

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.