Package net.timewalker.ffmq3.management

Examples of net.timewalker.ffmq3.management.InvalidDescriptorException


        return consumer;
    }
   
    private LocalQueueBrowser lookupBrowser( AbstractQueueBrowserQuery query ) throws JMSException
    {
        LocalSession localSession = lookupSession(query);
        LocalQueueBrowser browser = (LocalQueueBrowser)localSession.lookupRegisteredBrowser(query.getBrowserId());
        if (browser == null)
            throw new FFMQException("Invalid browser id : "+query.getBrowserId(),"NETWORK_ERROR");
        return browser;
    }
View Full Code Here


   * @see net.timewalker.ffmq3.utils.Checkable#check()
   */
  public void check() throws JMSException
    {
      if (StringTools.isEmpty(name))
          throw new InvalidDescriptorException("Missing user name in security descriptor");
      if (password == null)
          throw new InvalidDescriptorException("Missing password definition for user "+name);
    }
View Full Code Here

   * @see net.timewalker.ffmq3.utils.Checkable#check()
   */
  public void check() throws JMSException
  {
    if (jdniInitialContextFactoryName == null)
      throw new InvalidDescriptorException("Missing peer property : 'jdniInitialContextFactoryName'");
    if (jndiConnectionFactoryName == null)
      throw new InvalidDescriptorException("Missing peer property : 'jndiConnectionFactoryName'");
    if (providerURL == null)
      throw new InvalidDescriptorException("Missing peer property : 'providerURL'");
  }
View Full Code Here

   * @see net.timewalker.ffmq3.utils.Checkable#check()
   */
  public void check() throws JMSException
  {
    if (destinationType == null)
      throw new InvalidDescriptorException("Missing destination reference property : 'destinationType'");
    if (!destinationType.equals("queue") && !destinationType.equals("topic"))
      throw new InvalidDescriptorException("Destination reference property 'destinationType' should be one of : queue, topic");
    if (destinationName == null)
      throw new InvalidDescriptorException("Missing destination reference property : 'destinationName'");
  }
View Full Code Here

   * @see net.timewalker.ffmq3.utils.xml.Descriptor#check()
   */
  public void check() throws JMSException
  {
    if (name == null)
      throw new InvalidDescriptorException("Missing bridge property : 'name'");
    if (enabled == null)
      throw new InvalidDescriptorException("Missing bridge property : 'enabled'");
    if (retryInterval == null)
      throw new InvalidDescriptorException("Missing bridge property : 'retryInterval'");
    if (getRetryInterval() < 0)
      throw new InvalidDescriptorException("Bridge property 'retryInterval' should be >= 0");
    if (commitSourceFirst == null)
      throw new InvalidDescriptorException("Missing bridge property : 'commitSourceFirst'");
    if (producerTransacted == null)
      throw new InvalidDescriptorException("Missing bridge property : 'producerTransacted'");
    if (consumerTransacted == null)
      throw new InvalidDescriptorException("Missing bridge property : 'consumerTransacted'");
    if (!isConsumerTransacted())
    {
      if (consumerAcknowledgeMode == -1)
        throw new InvalidDescriptorException("Missing bridge property : 'consumerAcknowledgeMode'");
    }
    if (producerDeliveryMode == -1)
      throw new InvalidDescriptorException("Missing bridge property : 'producerDeliveryMode'");
   
    source.check();
    target.check();
    sourceDestination.check();
    targetDestination.check();
View Full Code Here

     * @see net.timewalker.ffmq3.utils.Checkable#check()
     */
    public void check() throws JMSException
    {
        if (StringTools.isEmpty(name))
            throw new InvalidDescriptorException("Missing descriptor property : name");

        checkMinValue(maxNonPersistentMessages, 0, "maximum non persistent messages");
        checkMinValue(initialBlockCount,        0, "initial block count");
        checkMinValue(maxBlockCount,            0, "maximum block count");

        if (maxBlockCount < initialBlockCount)
            throw new InvalidDescriptorException("Maximum block count should be greater or equal than initial block count");
       
        if (maxBlockCount > 0)
        {
            if (rawDataFolder == null || StringTools.isEmpty(rawDataFolder))
                throw new InvalidDescriptorException("Missing destination raw data folder");
            if (dataFolder == null || StringTools.isEmpty(dataFolder.getName()))
                throw new InvalidDescriptorException("Missing destination data folder");
           
            checkMinValue(blockSize,1024,"block size");
            if (initialBlockCount != maxBlockCount)
                checkMinValue(autoExtendAmount,1,"auto extend amount");

            if (useJournal)
            {
                checkMinValue(maxJournalSize,1024,"maximum journal size");
                checkMinValue(maxWriteBatchSize,1,"maximum write batch size");
                checkMinValue(journalOutputBuffer,1024,"journal output buffer size");
                checkMinValue(maxUncommittedJournalSize,1024,"maximum uncommitted journal size");
                checkMinValue(maxUncommittedStoreSize,1024,"maximum uncommitted store size");
            }
        }

        if (initialBlockCount == 0 && maxNonPersistentMessages == 0)
            throw new InvalidDescriptorException("Destination cannot store any message !");
    }
View Full Code Here

    }
   
    private void checkMinValue( long value , long min , String name ) throws InvalidDescriptorException
    {
        if (value < min)
            throw new InvalidDescriptorException("Missing or invalid value : "+name+" ("+value+"), should be >= "+min);
    }
View Full Code Here

            // Check temporary destinations scope (JMS Spec 4.4.3 p2)
            session.checkTemporaryDestinationScope(localTopic);
           
            // Deploy a local queue for this consumer
            TopicDefinition topicDef = this.localTopic.getDefinition();
            QueueDefinition tempDef = topicDef.createQueueDefinition(topicRef.getTopicName(), subscriberId, !isDurable());           
            if (engine.localQueueExists(tempDef.getName()))
                this.localQueue = engine.getLocalQueue(tempDef.getName());
            else
                this.localQueue = engine.createQueue(tempDef);
           
            // Register on both the queue and topic
            this.localQueue.registerConsumer(this);
View Full Code Here

           
            // Check temporary destinations scope (JMS Spec 4.4.3 p2)
            session.checkTemporaryDestinationScope(localTopic);
           
            // Deploy a local queue for this consumer
            TopicDefinition topicDef = this.localTopic.getDefinition();
            QueueDefinition tempDef = topicDef.createQueueDefinition(topicRef.getTopicName(), subscriberId, !isDurable());           
            if (engine.localQueueExists(tempDef.getName()))
                this.localQueue = engine.getLocalQueue(tempDef.getName());
            else
                this.localQueue = engine.createQueue(tempDef);
           
View Full Code Here

   */
  public void checkPermission(String resourceName, String action) throws JMSException
  {
    for (int i = 0; i < privileges.size(); i++)
    {
      Privilege privilege = (Privilege)privileges.get(i);
      if (privilege.matches(resourceName, action))
        return;
    }
    throw new FFMQException("Access denied to resource '"+resourceName+"' for action '"+action+"'","ACCESS_DENIED");
  }
View Full Code Here

TOP

Related Classes of net.timewalker.ffmq3.management.InvalidDescriptorException

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.