Package com.sun.messaging.jmq.jmsserver.core

Examples of com.sun.messaging.jmq.jmsserver.core.Destination


                   DestState.PAUSED : pauseType.intValue());

    if (destination == null)  {
                    Iterator itr = Destination.getAllDestinations();
                    while (itr.hasNext()) {
                        Destination d =(Destination)itr.next();

      /*
       * Skip internal, admin, or temp destinations.
       * Skipping temp destinations may need to be
       * revisited.
       */
      if (d.isInternal() || d.isAdmin() || d.isTemporary())  {
          continue;
      }

                        d.pauseDestination(pauseval);
                    }
    } else  {
                    Destination d = Destination.getDestination(destination,
                      DestType.isQueue(type.intValue()));
                    if (d == null) {
                        String msg = Globals.getBrokerResources().getString(
                             BrokerResources.I_PAUSED_DST_NOT_EXIST,
                       (DestType.isQueue(type.intValue()) ? " queue:" :
                           " topic:") +destination );

                        errMsg = msg;
                        status = Status.NOT_FOUND;
                        logger.log(Logger.ERROR,msg);
                    } else {
      if (d.isInternal() || d.isAdmin())  {
                             errMsg = Globals.getBrokerResources().getString(
                                 BrokerResources.I_PAUSED_ADMIN,
                                (DestType.isQueue(type.intValue()) ? " queue:" :
                                 " topic:") +destination );
                            logger.log(Logger.INFO, errMsg);

                            status = Status.ERROR;
      } else  {
                            d.pauseDestination(pauseval);
      }
                    }
                }
            }
        } catch (IOException e) {
View Full Code Here


  return (cxnId);
    }

    public static Destination getDestination(ConsumerUID cid)  {
        Consumer con = Consumer.getConsumer(cid);
        Destination d = null;

  if (con != null)  {
            d = con.getFirstDestination();
  }
View Full Code Here

  ArrayList<String> al = new ArrayList<String>();
  Set dests = con.getDestinations();
    if (dests == null) return null;
  Iterator itr = dests.iterator();
  while (itr.hasNext()) {
      Destination dest = (Destination)itr.next();
      al.add(dest.getDestinationName());
  }

  if (al.size() > 0)  {
      ret = new String [ al.size() ];
      ret = (String[])al.toArray(ret);
View Full Code Here

  return(id.getName());
    }

    private static String getDestinationType(ConsumerUID cid)  {
  Destination d = ConsumerUtil.getDestination(cid);

  if (d == null)  {
      return (null);
  }

  return(d.isQueue() ? DestinationType.QUEUE : DestinationType.TOPIC);
    }
View Full Code Here

                selector = null;
            }

            boolean notFound = false;

            Destination d = null;
            if (DestinationUID.isWildcard(destination)) {
                // retrieve the list of destinations
                pkt.setWildcard(true);
                // see if there are any destinations that match
                DestinationUID duid = DestinationUID.getUID(destination, type);
                List l = Destination.findMatchingIDs(duid);
                if (l.isEmpty()) {
                    notFound = true;
                }

            } else {
                d =  Destination.getDestination(destination,
                       DestType.isQueue(type));
                notFound = ( d == null);
            }

            if (notFound) {
                // not found
                status = Status.NOT_FOUND;
                reason = "destination not found";
                hash.put("JMQCanCreate", Boolean.valueOf(
                        Destination.canAutoCreate(DestType.isQueue(type))));
            } else {
                if (d != null)
                    hash.put("JMQDestType", new Integer(d.getType()));
            }
           
        } catch (SelectorFormatException ex) {
            reason = ex.getMessage();
            status = Status.BAD_REQUEST;
View Full Code Here

    {
        if (cleanList != null && !cleanList.isEmpty()) {
            Iterator itr = cleanList.iterator();
            while (itr.hasNext()) {
                PacketReference ref = (PacketReference)itr.next();
                Destination d= ref.getDestination();
                try {
                    if (ref.isDead()) {
                        d.removeDeadMessage(ref);
                    } else {
                        d.removeMessage(ref.getSysMessageID(),
                           RemoveReason.ACKNOWLEDGED);
                    }
                } catch (Exception ex) {
                    Object[] eparam = {(ref == null ? "null":ref.toString()),
                                       (d == null ? "null":d.getUniqueName()), ex.getMessage()};
                    String emsg = Globals.getBrokerResources().getKString(
                                      BrokerResources.E_CLEANUP_MSG_AFTER_ACK, eparam);
                    if (DEBUG) {
                    logger.logStack(Logger.INFO, emsg, ex);
                    } else {
View Full Code Here

         } catch (SelectorFormatException ex) {
              returnmap.put("JMQStatus", new Integer(Status.BAD_REQUEST));
              return returnmap;
         }
        
         Destination d =  Destination.getDestination(destination,
                       DestType.isQueue(type));

         if (d == null) {
             returnmap.put("JMQCanCreate", Boolean.valueOf(
                   Destination.canAutoCreate(
                        DestType.isQueue(type))));
             returnmap.put("JMQStatus", new Integer(Status.NOT_FOUND));
         } else {
             returnmap.put("JMQDestType", new Integer(d.getType()));
             returnmap.put("JMQStatus", new Integer(Status.OK));
         }
         return returnmap;
     }
View Full Code Here

          throws BrokerException, SelectorFormatException, IOException
      {
          DataHandler handler = (DataHandler)
                      pr.getHandler(PacketType.MESSAGE);

          Destination d = null;
          PacketReference ref = null;
          Set s = null;
          boolean route = false;
          boolean isadmin = con.isAdminConnection();
          try {
               d = Destination.getDestination(
                      msg.getDestination(), msg.getIsQueue());
               if (d == null) {
                   throw new BrokerException("Unknown Destination:" + msg.getDestination());
               }
   
               Producer pausedProducer = handler.checkFlow(msg, con);
               boolean transacted = (msg.getTransactionID() != 0);
               if (DEBUG) {
               Globals.getLogger().log(Logger.INFO,
               "ProtocolImpl.PROCESS MESSAGE["+msg+"]TID="+msg.getTransactionID()+" on connection "+con);
               }
   
                // OK generate a ref. This checks message size and
                // will be needed for later operations
                ref = handler.createReference(msg, d.getDestinationUID(), con, isadmin);
   
                // dont bother calling route if there are no messages
                //
                // to improve performance, we route and later forward
                route = handler.queueMessage(d, ref, transacted);
View Full Code Here

            checkAccessPermission(PacketType.CREATE_DESTINATION, dname, dtype, con);
        if (DestType.isTemporary(dtype)) {
            boolean storeTemps = con.getConnectionUID().
                            getCanReconnect();
            long reconnectTime = con.getReconnectInterval();
            Destination d = Destination.createTempDestination(
                         dname, dtype, con.getConnectionUID(),
                         storeTemps, reconnectTime);
            if (con.getConnectionUID().equals(d.getConnectionUID())) {
                        con.attachTempDestination(d.getDestinationUID());
            }
            return d;

        }
        return Destination.getDestination(dname, dtype, true,
View Full Code Here

      getBody = Boolean.FALSE;
  }

        if (destination != null) {
            try {
                Destination d= Destination.getDestination(destination,
                          DestType.isQueue(destType.intValue()));

                if (d != null) {
                    if (DEBUG) {
                        d.debug();
                    }

        if (msgID != null)  {
      d.load();

            SysMessageID sysMsgID = SysMessageID.get(msgID);
                        PacketReference  pr = getPacketReference(sysMsgID);

      if (pr != null)  {
          HashMap h = constructMessageInfo(sysMsgID,
              getBody.booleanValue(),
              destNameType);

          v.add(h);
      } else  {
          /*
                            errMsg= rb.getString(rb.X_MSG_NOT_FOUND, msgID);
          */
                            errMsg= "Could not locate message "
          + msgID
          + " in destination "
          + destination;
                            status = Status.NOT_FOUND;
      }
        } else  {
            SysMessageID sysMsgIDs[] = d.getSysMessageIDs(startIndex, maxNumMsgs);

            for (int i = 0;i < sysMsgIDs.length; ++i)  {
          HashMap h = constructMessageInfo(sysMsgIDs[i],
            getBody.booleanValue(),
            destNameType);
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.jmsserver.core.Destination

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.