Package org.hornetq.spi.core.security

Examples of org.hornetq.spi.core.security.HornetQSecurityManager


   /**
    * @return
    */
   protected HornetQSecurityManager installSecurity(TestableServer server)
   {
      HornetQSecurityManager securityManager = server.getServer().getSecurityManager();
      securityManager.addUser("a", "b");
      Role role = new Role("arole", true, true, true, true, true, true, true);
      Set<Role> roles = new HashSet<Role>();
      roles.add(role);
      server.getServer().getSecurityRepository().addMatch("#", roles);
      securityManager.addRole("a", "arole");
      return securityManager;
   }
View Full Code Here


      String login = (String)headers.get(Stomp.Headers.Connect.LOGIN);
      String passcode = (String)headers.get(Stomp.Headers.Connect.PASSCODE);
      String clientID = (String)headers.get(Stomp.Headers.Connect.CLIENT_ID);
      String requestID = (String)headers.get(Stomp.Headers.Connect.REQUEST_ID);

      HornetQSecurityManager sm = server.getSecurityManager();
     
      // The sm will be null case security is not enabled...
      if (sm != null)
      {
         sm.validateUser(login, passcode);
      }

      connection.setLogin(login);
      connection.setPasscode(passcode);
      connection.setClientID(clientID);
View Full Code Here

      try
      {
         server.start();
         HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
         HornetQSecurityManager securityManager = server.getSecurityManager();
         securityManager.addUser("auser", "pass");
         Role role = new Role("arole", false, false, true, false, false, false, false);
         Set<Role> roles = new HashSet<Role>();
         roles.add(role);
         securityRepository.addMatch(SecurityTest.addressA, roles);
         securityManager.addRole("auser", "arole");
         ClientSessionFactory cf = locator.createSessionFactory();
         ClientSession session = cf.createSession("auser", "pass", false, true, true, false, -1);
         session.createQueue(SecurityTest.addressA, SecurityTest.queueA, true);
         try
         {
View Full Code Here

      try
      {
         server.start();
         HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
         HornetQSecurityManager securityManager = server.getSecurityManager();
         securityManager.addUser("auser", "pass");
         Role role = new Role("arole", false, false, false, false, true, false, false);
         Set<Role> roles = new HashSet<Role>();
         roles.add(role);
         securityRepository.addMatch(SecurityTest.addressA, roles);
         securityManager.addRole("auser", "arole");
         ClientSessionFactory cf = locator.createSessionFactory();
         ClientSession session = cf.createSession("auser", "pass", false, true, true, false, -1);
         session.createQueue(SecurityTest.addressA, SecurityTest.queueA, false);
         session.close();
      }
View Full Code Here

      try
      {
         server.start();
         HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
         HornetQSecurityManager securityManager = server.getSecurityManager();
         securityManager.addUser("auser", "pass");
         Role role = new Role("arole", false, false, false, false, false, false, false);
         Set<Role> roles = new HashSet<Role>();
         roles.add(role);
         securityRepository.addMatch(SecurityTest.addressA, roles);
         securityManager.addRole("auser", "arole");
         ClientSessionFactory cf = locator.createSessionFactory();
         ClientSession session = cf.createSession("auser", "pass", false, true, true, false, -1);
         try
         {
            session.createQueue(SecurityTest.addressA, SecurityTest.queueA, false);
View Full Code Here

      try
      {
         server.start();
         HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
         HornetQSecurityManager securityManager = server.getSecurityManager();
         securityManager.addUser("auser", "pass");
         Role role = new Role("arole", false, false, false, false, true, true, false);
         Set<Role> roles = new HashSet<Role>();
         roles.add(role);
         securityRepository.addMatch(SecurityTest.addressA, roles);
         securityManager.addRole("auser", "arole");
         ClientSessionFactory cf = locator.createSessionFactory();
         ClientSession session = cf.createSession("auser", "pass", false, true, true, false, -1);
         session.createQueue(SecurityTest.addressA, SecurityTest.queueA, false);
         session.deleteQueue(SecurityTest.queueA);
         session.close();
View Full Code Here

      try
      {
         server.start();
         HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
         HornetQSecurityManager securityManager = server.getSecurityManager();
         securityManager.addUser("auser", "pass");
         Role role = new Role("arole", false, false, false, false, true, false, false);
         Set<Role> roles = new HashSet<Role>();
         roles.add(role);
         securityRepository.addMatch(SecurityTest.addressA, roles);
         securityManager.addRole("auser", "arole");
         ClientSessionFactory cf = locator.createSessionFactory();
         ClientSession session = cf.createSession("auser", "pass", false, true, true, false, -1);
         session.createQueue(SecurityTest.addressA, SecurityTest.queueA, false);
         try
         {
View Full Code Here

      try
      {
         server.start();
         HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
         HornetQSecurityManager securityManager = server.getSecurityManager();
         securityManager.addUser("auser", "pass");
         Role role = new Role("arole", true, false, true, false, false, false, false);
         Set<Role> roles = new HashSet<Role>();
         roles.add(role);
         securityRepository.addMatch(SecurityTest.addressA, roles);
         securityManager.addRole("auser", "arole");
         locator.setBlockOnNonDurableSend(true);
         ClientSessionFactory cf = locator.createSessionFactory();
         ClientSession session = cf.createSession("auser", "pass", false, true, true, false, -1);
         session.createQueue(SecurityTest.addressA, SecurityTest.queueA, true);
         ClientProducer cp = session.createProducer(SecurityTest.addressA);
View Full Code Here

      try
      {
         server.start();
         HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
         HornetQSecurityManager securityManager = server.getSecurityManager();
         securityManager.addUser("auser", "pass");
         Role role = new Role("arole", false, false, true, false, false, false, false);
         Set<Role> roles = new HashSet<Role>();
         roles.add(role);
         securityRepository.addMatch(SecurityTest.addressA, roles);
         securityManager.addRole("auser", "arole");
         locator.setBlockOnNonDurableSend(true);
         ClientSessionFactory cf = locator.createSessionFactory();
         ClientSession session = cf.createSession("auser", "pass", false, true, true, false, -1);
         session.createQueue(SecurityTest.addressA, SecurityTest.queueA, true);
         ClientProducer cp = session.createProducer(SecurityTest.addressA);
View Full Code Here

      try
      {
         server.start();
         HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
         HornetQSecurityManager securityManager = server.getSecurityManager();
         securityManager.addUser("auser", "pass");
         Role role = new Role("arole", false, false, true, false, false, false, false);
         Set<Role> roles = new HashSet<Role>();
         roles.add(role);
         securityRepository.addMatch(SecurityTest.addressA, roles);
         securityManager.addRole("auser", "arole");
         ClientSessionFactory cf = locator.createSessionFactory();
         ClientSession session = cf.createSession("auser", "pass", false, true, true, false, -1);
         session.createQueue(SecurityTest.addressA, SecurityTest.queueA, true);
         ClientProducer cp = session.createProducer(SecurityTest.addressA);
         cp.send(session.createMessage(false));
View Full Code Here

TOP

Related Classes of org.hornetq.spi.core.security.HornetQSecurityManager

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.