Package org.jclouds.ec2.compute.domain

Examples of org.jclouds.ec2.compute.domain.RegionNameAndIngressRules


      replay(client);

      CreateSecurityGroupIfNeeded function = new CreateSecurityGroupIfNeeded(client, tester);

      assertEquals("group", function.load(new RegionNameAndIngressRules("region", "group", new int[] { 22 }, true)));

      verify(client);

   }
View Full Code Here


      client.createSecurityGroupInRegion("region", "group", "group");

      replay(client);

      CreateSecurityGroupIfNeeded function = new CreateSecurityGroupIfNeeded(client, tester);
      function.load(new RegionNameAndIngressRules("region", "group", new int[] { 22 }, true));
   }
View Full Code Here

      // setup expectations
      expect(options.getGroupIds()).andReturn(ImmutableSet.<String> of());
      expect(options.getGroups()).andReturn(groupNames).atLeastOnce();
      expect(options.getInboundPorts()).andReturn(ports).atLeastOnce();
      RegionNameAndIngressRules regionNameAndIngressRules = new RegionNameAndIngressRules(region, generatedMarkerGroup,
            ports, shouldAuthorizeSelf);
      expect(strategy.securityGroupMap.getUnchecked(regionNameAndIngressRules)).andReturn(group);

      // replay mocks
      replay(options);
View Full Code Here

      // setup expectations
      expect(options.getGroupIds()).andReturn(ImmutableSet.<String> of());
      expect(options.getGroups()).andReturn(groupNames).atLeastOnce();
      expect(options.getInboundPorts()).andReturn(ports).atLeastOnce();
      RegionNameAndIngressRules regionNameAndIngressRules = new RegionNameAndIngressRules(region, generatedMarkerGroup,
            ports, shouldAuthorizeSelf);
      expect(strategy.securityGroupMap.getUnchecked(regionNameAndIngressRules)).andReturn(generatedMarkerGroup);

      // replay mocks
      replay(options);
View Full Code Here

      // setup expectations
      expect(options.getGroupIds()).andReturn(ImmutableSet.<String> of());
      expect(options.getGroups()).andReturn(groupNames).atLeastOnce();
      expect(options.getInboundPorts()).andReturn(ports).atLeastOnce();
      RegionNameAndIngressRules regionNameAndIngressRules = new RegionNameAndIngressRules(region, generatedMarkerGroup,
            ports, shouldAuthorizeSelf);
      expect(strategy.securityGroupMap.getUnchecked(regionNameAndIngressRules)).andReturn(generatedMarkerGroup);

      // replay mocks
      replay(options);
View Full Code Here

      AWSEC2TemplateOptions options = createMock(AWSEC2TemplateOptions.class);

      // setup expectations
      expect(options.getGroupIds()).andReturn(ImmutableSet.<String> of());
      expect(options.getGroups()).andReturn(groupNames).atLeastOnce();
      RegionNameAndIngressRules regionNameAndIngressRules = new RegionNameAndIngressRules(region, generatedMarkerGroup,
            ports, shouldAuthorizeSelf);

      expect(strategy.securityGroupMap.getUnchecked(regionNameAndIngressRules))
            .andReturn(groupExisted ? "group" : null);
View Full Code Here

      AWSEC2TemplateOptions options = createMock(AWSEC2TemplateOptions.class);

      // setup expectations
      expect(options.getGroupIds()).andReturn(ImmutableSet.<String> of("group1", "group2"));
      expect(options.getGroups()).andReturn(groupNames).atLeastOnce();
      RegionNameAndIngressRules regionNameAndIngressRules = new RegionNameAndIngressRules(region, generatedMarkerGroup,
            ports, shouldAuthorizeSelf);

      expect(strategy.securityGroupMap.getUnchecked(regionNameAndIngressRules))
            .andReturn(groupExisted ? "group" : null);
View Full Code Here

     
      if (client.getSecurityGroupApi().get().describeSecurityGroupsInRegion(region, groupName).size() > 0) {
         logger.debug(">> deleting securityGroup(%s)", groupName);
         client.getSecurityGroupApi().get().deleteSecurityGroupInRegion(region, groupName);
         // TODO: test this clear happens
         securityGroupMap.invalidate(new RegionNameAndIngressRules(region, groupName, null, false));
         logger.debug("<< deleted securityGroup(%s)", groupName);
      }
   }
View Full Code Here

      }
   }
  
   public SecurityGroup createSecurityGroup(String name, String region) {
      String markerGroup = namingConvention.create().sharedNameForGroup(name);
      RegionNameAndIngressRules regionAndName = new RegionNameAndIngressRules(region, markerGroup, new int[] {},
                                                                              false);

      groupCreator.getUnchecked(regionAndName);

      return getSecurityGroupById(regionAndName.slashEncode());
   }
View Full Code Here

      String groupName = parts[1];
     
      if (client.getSecurityGroupApi().get().describeSecurityGroupsInRegion(region, groupName).size() > 0) {
         client.getSecurityGroupApi().get().deleteSecurityGroupInRegion(region, groupName);
         // TODO: test this clear happens
         groupCreator.invalidate(new RegionNameAndIngressRules(region, groupName, null, false));
         return true;
      }

      return false;
   }
View Full Code Here

TOP

Related Classes of org.jclouds.ec2.compute.domain.RegionNameAndIngressRules

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.