Package net.timewalker.ffmq3.security

Examples of net.timewalker.ffmq3.security.Privilege.matches()


        {
            System.out.print("TESTING valid ["+VALID_SELECTORS[n]+"] : ");
           
            MessageSelector selector = new MessageSelector(VALID_SELECTORS[n].getSelector());
            System.out.println(selector);
            boolean matches = selector.matches(getTestMessage());
            assertEquals(VALID_SELECTORS[n].getSelector(),VALID_SELECTORS[n].shouldMatch(), matches);
           
            String render1 = selector.toString();
            selector = new MessageSelector(render1);
            matches = selector.matches(getTestMessage());
View Full Code Here


            boolean matches = selector.matches(getTestMessage());
            assertEquals(VALID_SELECTORS[n].getSelector(),VALID_SELECTORS[n].shouldMatch(), matches);
           
            String render1 = selector.toString();
            selector = new MessageSelector(render1);
            matches = selector.matches(getTestMessage());
            assertEquals(VALID_SELECTORS[n].shouldMatch(), matches);
           
            String render2 = selector.toString();
            if (!render1.equals(render2))
              fail("["+render1+"] <> ["+render2+"]");
View Full Code Here

        {
            System.out.print("TESTING fail on eval ["+FAIL_ON_EVAL_SELECTORS[n]+"] ");
            try
            {
                MessageSelector selector = new MessageSelector(FAIL_ON_EVAL_SELECTORS[n]);
                selector.matches(getTestMessage());
               
                fail("Should have failed : "+FAIL_ON_EVAL_SELECTORS[n]);
            }
            catch (JMSException e)
            {
View Full Code Here

                // Message selector filtering
                MessageSelector selector = subscription.getMessageSelector();
                if (selector != null)
                {
                  srcMessage.ensureDeserializationLevel(MessageSerializationLevel.ALL_HEADERS);
                  if (!selector.matches(srcMessage))
                    continue;
                }
               
              if (subscription.getLocalQueue().put(srcMessage))
              {
View Full Code Here

          {   
                MessageSelector consumerSelector = consumer.getReceiveSelector();
                if (consumerSelector != null)
                {
                  message.ensureDeserializationLevel(MessageSerializationLevel.ALL_HEADERS);
                  if (!consumerSelector.matches(message))
                    return;
                }
          }
 
        if (consumer.mayBlock())
View Full Code Here

                {
                message.ensureDeserializationLevel(MessageSerializationLevel.ALL_HEADERS);
               
                  try
                  {
                      if (!consumerSelector.matches(message))
                        continue;
                  }
                  catch (JMSException e)
                  {
                    ErrorTools.log(e, log);
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
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.