Examples of DestinationInfo


Examples of com.sun.messaging.jmq.util.admin.DestinationInfo

      handleSetterException(
    DestinationAttributes.USE_DMQ, e);
  }
    }
    public Boolean getUseDMQ()  {
  DestinationInfo di = DestinationUtil.getDestinationInfo(d);

  return (Boolean.valueOf(di.useDMQ));
    }
View Full Code Here

Examples of com.sun.messaging.jmq.util.admin.DestinationInfo

   
           Iterator itr = Destination.getAllDestinations();
    
           while (itr.hasNext()) {
               Destination d = (Destination)itr.next();
               DestinationInfo dd= getDestinationInfo(d);
               v.add(dd);
           }
       }

       // Send reply
View Full Code Here

Examples of com.sun.messaging.jmq.util.admin.DestinationInfo

       return true;
   }


    public static DestinationInfo getDestinationInfo(Destination d) {
        DestinationInfo di = new DestinationInfo();
        di.nMessages=d.size();
        di.nMessageBytes=d.byteSize();
        di.nConsumers=d.getConsumerCount();
        di.nfConsumers=d.getFailoverConsumerCount();
        di.naConsumers=d.getActiveConsumerCount();
View Full Code Here

Examples of com.sun.messaging.jmq.util.admin.DestinationInfo

     * @param cmd_msg  The administration message
     * @param cmd_props The properties from the administration message
     */
    public boolean handle(IMQConnection con, Packet cmd_msg,
               Hashtable cmd_props) {
  DestinationInfo info;

  info = (DestinationInfo)getBodyObject(cmd_msg);

  if ( DEBUG ) {
            logger.log(Logger.DEBUG, this.getClass().getName() + ": " +
                "Creating destination: " + cmd_props + ": " + info.toString());
        }

  Packet reply = new Packet(con.useDirectBuffers());
  reply.setPacketType(PacketType.OBJECT_MESSAGE);

        int status = Status.OK;
        String errMsg = null;

        // Default attributes of the destination
        int type = DestType.DEST_TYPE_QUEUE | DestType.DEST_FLAVOR_SINGLE;
        int maxMessages = -1;
        SizeString maxMessageBytes = null;
        SizeString maxMessageSize = null;

        HAMonitorService hamonitor = Globals.getHAMonitorService();
        if (hamonitor != null && hamonitor.inTakeover()) {
            status = Status.ERROR;
            errMsg =  rb.getString(rb.E_CANNOT_PROCEED_TAKEOVER_IN_PROCESS);

            logger.log(Logger.ERROR, this.getClass().getName() + ": " + errMsg);
  } else if (MemoryGlobals.MEM_DISALLOW_CREATE_DEST) {
            status = Status.ERROR;
            errMsg = rb.W_LOW_MEM_REJECT_DEST;
        } else if (info.isModified(DestinationInfo.NAME)) {
            if (info.isModified(DestinationInfo.TYPE)) {
                type = info.type;
            }
            if (info.isModified(DestinationInfo.MAX_MESSAGES)) {
                maxMessages = info.maxMessages;
            }
            if (info.isModified(DestinationInfo.MAX_MESSAGE_BYTES)) {
                maxMessageBytes = new SizeString();
                maxMessageBytes.setBytes(info.maxMessageBytes);
            }
            if (info.isModified(DestinationInfo.MAX_MESSAGE_SIZE)) {
                maxMessageSize = new SizeString();
                maxMessageSize.setBytes(info.maxMessageSize);
            }

        } else {
            status = Status.ERROR;
            errMsg = rb.X_NO_DEST_NAME_SET;
        }
        //
        //XXX create destination
        if (status == Status.OK) {

            if (DestType.destNameIsInternal(info.name)) {
                status = Status.ERROR;
                errMsg =  rb.getKString( rb.X_CANNOT_CREATE_INTERNAL_DEST,
                            info.name,
          DestType.INTERNAL_DEST_PREFIX);
      } else  {
                if (isValidDestinationName(info.name)) {

                    try {
                        Destination.createDestination(info.name,
                          type);
                    } catch (Exception ex) {
                        status = Status.ERROR;
                        errMsg =  rb.getString( rb.X_CREATE_DEST_EXCEPTION,
                            info.name, getMessageFromException(ex));
                       if (ex instanceof ConflictException)
                           logger.log(Logger.INFO, errMsg, ex);
                       else
                           logger.logStack(Logger.INFO, errMsg, ex);
                    }
                } else {
                    status = Status.ERROR;
                    errMsg =  rb.getKString( rb.X_DEST_NAME_INVALID,
                            info.name);
                }
      }
        }

        if (status == Status.OK) {
            try {

                Destination d = Destination.getDestination(info.name, DestType.isQueue(type));

                d.setCapacity(maxMessages);
                d.setByteCapacity(maxMessageBytes);
                d.setMaxByteSize(maxMessageSize);
                if (info.isModified(info.DEST_SCOPE)) {
                    int scope = info.destScope;
                    d.setScope(scope)
                }
                if (info.isModified(info.DEST_LIMIT)) {
                    int destlimit = info.destLimitBehavior;
                    d.setLimitBehavior(destlimit);
                }
                if (info.isModified(info.DEST_PREFETCH)) {
                    int prefetch = info.maxPrefetch;
                    d.setMaxPrefetch(prefetch);
                }
                if (info.isModified(info.DEST_CDP)) {
                    int clusterdeliverypolicy = info.destCDP;
                    d.setClusterDeliveryPolicy(clusterdeliverypolicy);
                }
                if (info.isModified(info.MAX_ACTIVE_CONSUMERS)) {
                    int maxcons = info.maxActiveConsumers;
                    d.setMaxActiveConsumers(maxcons);
                }
                if (info.isModified(info.MAX_PRODUCERS)) {
                    int maxp = info.maxProducers;
                    d.setMaxProducers(maxp);
                }
                if (info.isModified(info.MAX_FAILOVER_CONSUMERS)) {
                    int maxcons = info.maxFailoverConsumers;
                    d.setMaxFailoverConsumers(maxcons);
                }
                if (info.isModified(info.MAX_SHARED_CONSUMERS)) {
                    int maxsharedcons = info.maxNumSharedConsumers;
                    d.setMaxSharedConsumers(maxsharedcons);
                }
                if (info.isModified(info.SHARE_FLOW_LIMIT)) {
                    int sflowlimit = info.sharedConsumerFlowLimit;
                    d.setSharedFlowLimit(sflowlimit);
                }
                if (info.isModified(info.USE_DMQ)) {
                    boolean dmq = info.useDMQ;
                    d.setUseDMQ(dmq);
                }
                if (info.isModified(info.VALIDATE_XML_SCHEMA_ENABLED)) {
                    d.setValidateXMLSchemaEnabled(info.validateXMLSchemaEnabled);
                }
                if (info.isModified(info.XML_SCHEMA_URI_LIST)) {
                    d.setXMLSchemaUriList(info.XMLSchemaUriList);
                }
                if (info.isModified(info.RELOAD_XML_SCHEMA_ON_FAILURE)) {
                    d.setReloadXMLSchemaOnFailure(info.reloadXMLSchemaOnFailure);
                }
                d.update();
             
                // audit logging for create destination
View Full Code Here

Examples of com.sun.messaging.jmq.util.admin.DestinationInfo

    /*
     * Get DestinationInfo object from Destination object.
     */
    public static DestinationInfo getDestinationInfo(Destination d)  {
  DestinationInfo di = GetDestinationsHandler.getDestinationInfo(d);

  return (di);
    }
View Full Code Here

Examples of com.sun.messaging.jmq.util.admin.DestinationInfo

        return m;
    }

    public static DestinationInfo getDestinationInfoFromAttrs(String type,
            String destName, AttributeList attrs)  {
  DestinationInfo info = new DestinationInfo();

  info.setName(destName);

  if (type.equals(DestinationType.QUEUE))  {
      info.setType(DestType.DEST_TYPE_QUEUE);
  } else if (type.equals(DestinationType.TOPIC))  {
      info.setType(DestType.DEST_TYPE_TOPIC);
  }

  if (attrs == null)  {
      return (info);
  }

  /*
   * We assume that type checking was already handled
   */

  for (Iterator i = attrs.iterator(); i.hasNext();) {
      Attribute attr = (Attribute) i.next();
      String name = attr.getName();
      Object value = attr.getValue();

      if (name.equals(DestinationAttributes.CONSUMER_FLOW_LIMIT))  {
    info.setPrefetch(((Long)value).intValue());
      }

      if (name.equals(DestinationAttributes.LOCAL_ONLY))  {
    info.setScope(((Boolean)value).booleanValue());
      }

      if (name.equals(DestinationAttributes.LIMIT_BEHAVIOR))  {
    info.setLimitBehavior( toInternalDestLimitBehavior((String)value) );
      }

      if (name.equals(DestinationAttributes.LOCAL_DELIVERY_PREFERRED))  {
    int cdp;

    if (((Boolean)value).booleanValue())  {
        cdp = ClusterDeliveryPolicy.LOCAL_PREFERRED;
    } else  {
        cdp = ClusterDeliveryPolicy.DISTRIBUTED;
    }
    info.setClusterDeliveryPolicy(cdp);
      }

      if (name.equals(DestinationAttributes.MAX_BYTES_PER_MSG))  {
    info.setMaxMessageSize(((Long)value).longValue());
      }

      if (name.equals(DestinationAttributes.MAX_NUM_ACTIVE_CONSUMERS))  {
    info.setMaxActiveConsumers(((Integer)value).intValue());
      }

      if (name.equals(DestinationAttributes.MAX_NUM_BACKUP_CONSUMERS))  {
    info.setMaxFailoverConsumers(((Integer)value).intValue());
      }

      if (name.equals(DestinationAttributes.MAX_NUM_MSGS))  {
    info.setMaxMessages(((Long)value).intValue());
      }

      if (name.equals(DestinationAttributes.MAX_NUM_PRODUCERS))  {
    info.setMaxProducers(((Integer)value).intValue());
      }

      if (name.equals(DestinationAttributes.MAX_TOTAL_MSG_BYTES))  {
    info.setMaxMessageBytes(((Long)value).longValue());
      }

      if (name.equals(DestinationAttributes.USE_DMQ))  {
    info.setUseDMQ(((Boolean)value).booleanValue());
      }
  }

  return (info);
    }
View Full Code Here

Examples of com.tibco.tibjms.admin.DestinationInfo

            throw new HermesException(ex);
         }
      }
      else
      {
         DestinationInfo info = getDestinationInfo(destination);

         if (info != null)
         {
            return (int) info.getPendingMessageCount();
         }
         else
         {
            return 0;
         }
View Full Code Here

Examples of io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DestinationInfo

   
    /**
     * @return a new object instance
     */
    public DataStructure createObject() {
        return new DestinationInfo();
    }
View Full Code Here

Examples of org.apache.activemq.apollo.openwire.command.DestinationInfo

    /**
     * @return a new object instance
     */
    public DataStructure createObject() {
        return new DestinationInfo();
    }
View Full Code Here

Examples of org.apache.activemq.command.DestinationInfo

                }
            }
        } else if (data.getClass() == DestinationInfo.class) {
            // It's a destination info - we want to pass up
            // information about temporary destinations
            DestinationInfo destInfo = (DestinationInfo)data;
            BrokerId[] path = destInfo.getBrokerPath();
            if (path != null && path.length >= networkTTL) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Ignoring Subscription " + destInfo + " restricted to " + networkTTL + " network hops only");
                }
                return;
            }
            if (contains(destInfo.getBrokerPath(), localBrokerPath[0])) {
                // Ignore this consumer as it's a consumer we locally sent to
                // the broker.
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Ignoring sub " + destInfo + " already routed through this broker once");
                }
                return;
            }
            destInfo.setConnectionId(localConnectionInfo.getConnectionId());
            if (destInfo.getDestination() instanceof ActiveMQTempDestination) {
                // re-set connection id so comes from here
                ActiveMQTempDestination tempDest = (ActiveMQTempDestination)destInfo.getDestination();
                tempDest.setConnectionId(localSessionInfo.getSessionId().getConnectionId());
            }
            destInfo.setBrokerPath(appendToBrokerPath(destInfo.getBrokerPath(), getRemoteBrokerPath()));
            LOG.debug("Replying destination control command: " + destInfo);
            localBroker.oneway(destInfo);
        } else if (data.getClass() == RemoveInfo.class) {
            ConsumerId id = (ConsumerId)((RemoveInfo)data).getObjectId();
            removeDemandSubscription(id);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.