Package javax.management.relation

Examples of javax.management.relation.RoleList


                                              Trivial.class, server));
         roleCX2Values.add(createRoleValueBean("x:relation=c,role=1,bean=4",
                                              Trivial.class, server));
         roleCX2 = new Role("roleC2", roleCX2Values);

         rolesCX = new RoleList();
         rolesCX.add(roleCX1);
         rolesCX.add(roleCX2);
      }
      catch(Exception e)
      {
View Full Code Here


         ArrayList roleCZ2Values = new ArrayList();
         roleCZ2Values.add(createRoleValueBean("x:relation=c,role=1,bean=1",
                                              Trivial.class, null));
         roleCZ2 = new Role("roleC2", roleCZ2Values);

         rolesCZ = new RoleList();
         rolesCZ.add(roleCZ2);
      }
      catch(Exception e)
      {
         fail(e.toString());
View Full Code Here

                                              Trivial.class, null));
         roleCZZValues.add(createRoleValueBean("x:relation=c,role=1,bean=5",
                                              Trivial.class, server));
         roleCZZ = new Role("roleC2", roleCZZValues);

         rolesCZZ = new RoleList();
         rolesCZZ.add(roleCZZ);

         ArrayList roleCZZZValues = new ArrayList();
         roleCZZZValues.add(createRoleValueBean("x:relation=c,role=1x,bean=1",
                                              Trivial.class, null));
         roleCZZZValues.add(createRoleValueBean("x:relation=c,role=1x,bean=2",
                                              Trivial.class, null));
         roleCZZZValues.add(createRoleValueBean("x:relation=c,role=1x,bean=3",
                                              Trivial.class, null));
         roleCZZZ = new Role("roleC2", roleCZZZValues);

         rolesCZZZ = new RoleList();
         rolesCZZZ.add(roleCZZZ);
      }
      catch(Exception e)
      {
         fail(e.toString());
View Full Code Here

{
   static final String TYPE = "RoleList";

   public void serialize(QName name, Attributes attributes, Object value, SerializationContext context) throws IOException
   {
      RoleList list = (RoleList)value;
      context.startElement(name, attributes);
      for (Iterator i = list.iterator(); i.hasNext();)
      {
         Role item = (Role)i.next();
         context.serialize(Constants.QNAME_LITERAL_ITEM, null, item);
      }
      context.endElement();
View Full Code Here

   public void testRemoveRelationType() throws Exception
   {
      registerRelationService(true);
      registerMBeans();

      RoleList roleList = new RoleList();

      createRoleList(mbeanObjectName1, "owner", roleList);
      createRoleList(mbeanObjectName2, "car", roleList);

      m_relationService.createRelationType("testValidRelationTypeNameRemoval", createRoleInfos("car", "owner"));
View Full Code Here

   public void testAddRelation_correctRolesReturned() throws Exception
   {
      registerRelationService(true);
      registerMBeans();

      RoleList roleList = new RoleList();
      createRoleList(mbeanObjectName1, "owner", roleList);
      createRoleList(mbeanObjectName2, "car", roleList);

      ObjectName relationSupportObjectName = new ObjectName("relationDomain:name=aRelationSupport");
      SimpleRelationTestSupport relationSupport = new SimpleRelationTestSupport("relationID",
                                                                                m_relationServiceObjectName,
                                                                                "relationTypeName",
                                                                                roleList);

      m_server.registerMBean(relationSupport, relationSupportObjectName);

      /* create the relationType */
      m_relationService.createRelationType("relationTypeName", createRoleInfos("car", "owner"));

      /* now add the relation */
      m_relationService.addRelation(relationSupportObjectName);

      ////////////////////////////////////////////////////////////////////////////////////////////////

      RoleList roleList1 = new RoleList();
      createRoleList(mbeanObjectName3, "parent", roleList1);
      createRoleList(mbeanObjectName4, "child", roleList1);

      ObjectName relationSupportObjectName2 = new ObjectName("relationDomain:name=aRelationSupport2");
      SimpleRelationTestSupport relationSupport2 = new SimpleRelationTestSupport("relationID2",
                                                                                 m_relationServiceObjectName,
                                                                                 "relationTypeName2",
                                                                                 roleList1);

      m_server.registerMBean(relationSupport2, relationSupportObjectName2);

      m_relationService.createRelationType("relationTypeName2", createRoleInfos("parent", "child"));
      m_relationService.addRelation(relationSupportObjectName2);

      ///////////////// validate querying roles for relationId2(added second) returns the correct roles ////////////////////////////////
      RoleResult result1 = m_relationService.getAllRoles("relationID2");
      RoleList actual1 = result1.getRoles();
      // we have to do this as role does not have an equals or hashcode, must check if it is added it will break compatibility!!!!
      final Role role = (Role)roleList1.get(0);
      boolean success = false;
      for (Iterator iterator = actual1.iterator(); iterator.hasNext();)
      {
         Role role1 = (Role)iterator.next();
         String roleName = role1.getRoleName();
         if (roleName.equals(role.getRoleName())) success = true;
      }
      assertTrue(success);

      ///////////////////// validate querying roles for relaionID (added first) returns the expected roles ///////////////////////////////
      RoleResult result = m_relationService.getAllRoles("relationID");
      RoleList actual = result.getRoles();

      final Role role2 = (Role)roleList.get(0);
      boolean success2 = false;
      for (Iterator iterator = actual.iterator(); iterator.hasNext();)
      {
         Role role1 = (Role)iterator.next();
         String roleName = role1.getRoleName();
         if (roleName.equals(role2.getRoleName())) success2 = true;
      }
View Full Code Here

   public void testAddRelation() throws Exception
   {
      registerRelationService(true);
      registerMBeans();

      RoleList roleList = new RoleList();
      createRoleList(mbeanObjectName1, "owner", roleList);
      createRoleList(mbeanObjectName2, "car", roleList);

      ObjectName relationSupportObjectName = new ObjectName("relationDomain:name=aRelationSupport");
      SimpleRelationTestSupport relationSupport = new SimpleRelationTestSupport("relationID",
View Full Code Here

   public void testGetRoleInfo() throws Exception
   {
      registerRelationService(true);
      registerMBeans();

      RoleList roleList = new RoleList();
      createRoleList(mbeanObjectName1, "owner", roleList);
      createRoleList(mbeanObjectName2, "car", roleList);

      ObjectName relationSupportObjectName = new ObjectName("relationDomain:name=aRelationSupport");
      SimpleRelationTestSupport relationSupport = new SimpleRelationTestSupport("relationID",
View Full Code Here

   public void tesetGetAllRelationIds() throws Exception
   {
      registerRelationService(true);
      registerMBeans();

      RoleList roleList = new RoleList();
      createRoleList(mbeanObjectName1, "owner", roleList);
      createRoleList(mbeanObjectName2, "car", roleList);

      /* create the relationType first then creaste the relation*/
      m_relationService.createRelationType("relationTypeName1", createRoleInfos("car", "owner"));
View Full Code Here

   public void testCreateRelation() throws Exception
   {
      registerRelationService(true);
      registerMBeans();
      RoleList roleList = new RoleList();
      createRoleList(mbeanObjectName1, "owner", roleList);
      createRoleList(mbeanObjectName2, "car", roleList);

      /* create the relationType first then creaste the relation*/
      String relationTypeName = "relationTypeName";
View Full Code Here

TOP

Related Classes of javax.management.relation.RoleList

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.