Examples of ZoneSecurityGroupNameAndPorts


Examples of org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneSecurityGroupNameAndPorts

   public void testWhenNotFoundCreatesANewSecurityGroup() throws Exception {
      Predicate<AtomicReference<ZoneAndName>> returnSecurityGroupExistsInZone = Predicates.alwaysFalse();

      SecurityGroupInZone securityGroupInZone = createMock(SecurityGroupInZone.class);

      ZoneSecurityGroupNameAndPorts input = new ZoneSecurityGroupNameAndPorts("zone", "groupName", ImmutableSet
               .<Integer> of(22, 8080));

      Function<ZoneSecurityGroupNameAndPorts, SecurityGroupInZone> groupCreator = Functions.forMap(ImmutableMap
               .<ZoneSecurityGroupNameAndPorts, SecurityGroupInZone> of(input, securityGroupInZone));
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneSecurityGroupNameAndPorts

      CreateSecurityGroupIfNeeded fn = new CreateSecurityGroupIfNeeded(apiCanCreateSecurityGroup);

      // we can find it
      assertEquals(fn.apply(
               new ZoneSecurityGroupNameAndPorts("az-1.region-a.geo-1", "jclouds_mygroup", ImmutableSet.of(22, 8080)))
               .toString(), new SecurityGroupInZone(new ParseComputeServiceTypicalSecurityGroupTest().expected(),
               "az-1.region-a.geo-1").toString());

   }
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneSecurityGroupNameAndPorts

      CreateSecurityGroupIfNeeded fn = new CreateSecurityGroupIfNeeded(apiWhenSecurityGroupsExist);

      // we can find it
      assertEquals(fn.apply(
               new ZoneSecurityGroupNameAndPorts("az-1.region-a.geo-1", "jclouds_mygroup", ImmutableSet.of(22, 8080)))
               .toString(), new SecurityGroupInZone(new ParseComputeServiceTypicalSecurityGroupTest().expected(),
               "az-1.region-a.geo-1").toString());

   }
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneSecurityGroupNameAndPorts

                  templateOptions);
      } else if (securityGroupExtensionPresent) {
         if (!templateOptions.getSecurityGroupNames().isPresent() && inboundPorts.size() > 0) {
            String securityGroupName = namingConvention.create().sharedNameForGroup(group);
            try {
               securityGroupCache.get(new ZoneSecurityGroupNameAndPorts(zone, securityGroupName, inboundPorts));
            } catch (ExecutionException e) {
               throw Throwables.propagate(e.getCause());
            }
            templateOptions.securityGroupNames(securityGroupName);
         }
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneSecurityGroupNameAndPorts

   private SecurityGroupInZone createNewSecurityGroup(ZoneAndName in) {
      checkState(
               checkNotNull(in, "zoneSecurityGroupNameAndPorts") instanceof ZoneSecurityGroupNameAndPorts,
               "programming error: when issuing get to this cacheloader, you need to pass an instance of ZoneSecurityGroupNameAndPorts, not %s",
               in);
      ZoneSecurityGroupNameAndPorts zoneSecurityGroupNameAndPorts = ZoneSecurityGroupNameAndPorts.class.cast(in);
      return groupCreator.apply(zoneSecurityGroupNameAndPorts);
   }
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneSecurityGroupNameAndPorts

      CreateSecurityGroupIfNeeded fn = new CreateSecurityGroupIfNeeded(apiCanCreateSecurityGroup);

      // we can find it
      assertEquals(fn.apply(
               new ZoneSecurityGroupNameAndPorts("az-1.region-a.geo-1", "jclouds_mygroup", ImmutableSet.of(22, 8080)))
               .toString(), new SecurityGroupInZone(new ParseComputeServiceTypicalSecurityGroupTest().expected(),
               "az-1.region-a.geo-1").toString());

   }
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneSecurityGroupNameAndPorts

      CreateSecurityGroupIfNeeded fn = new CreateSecurityGroupIfNeeded(apiWhenSecurityGroupsExist);

      // we can find it
      assertEquals(fn.apply(
               new ZoneSecurityGroupNameAndPorts("az-1.region-a.geo-1", "jclouds_mygroup", ImmutableSet.of(22, 8080)))
               .toString(), new SecurityGroupInZone(new ParseComputeServiceTypicalSecurityGroupTest().expected(),
               "az-1.region-a.geo-1").toString());

   }
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneSecurityGroupNameAndPorts

   public void testWhenNotFoundCreatesANewSecurityGroup() throws Exception {
      Predicate<AtomicReference<ZoneAndName>> returnSecurityGroupExistsInZone = Predicates.alwaysFalse();

      SecurityGroupInZone securityGroupInZone = createMock(SecurityGroupInZone.class);

      ZoneSecurityGroupNameAndPorts input = new ZoneSecurityGroupNameAndPorts("zone", "groupName", ImmutableSet
               .<Integer> of(22, 8080));

      Function<ZoneSecurityGroupNameAndPorts, SecurityGroupInZone> groupCreator = Functions.forMap(ImmutableMap
               .<ZoneSecurityGroupNameAndPorts, SecurityGroupInZone> of(input, securityGroupInZone));
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneSecurityGroupNameAndPorts

   private SecurityGroupInZone createNewSecurityGroup(ZoneAndName in) {
      checkState(
               checkNotNull(in, "zoneSecurityGroupNameAndPorts") instanceof ZoneSecurityGroupNameAndPorts,
               "programming error: when issuing get to this cacheloader, you need to pass an instance of ZoneSecurityGroupNameAndPorts, not %s",
               in);
      ZoneSecurityGroupNameAndPorts zoneSecurityGroupNameAndPorts = ZoneSecurityGroupNameAndPorts.class.cast(in);
      return groupCreator.apply(zoneSecurityGroupNameAndPorts);
   }
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneSecurityGroupNameAndPorts

      return createSecurityGroup(name, zone);
   }

   public SecurityGroup createSecurityGroup(String name, String zone) {
      String markerGroup = namingConvention.create().sharedNameForGroup(name);
      ZoneSecurityGroupNameAndPorts zoneAndName = new ZoneSecurityGroupNameAndPorts(zone, markerGroup, ImmutableSet.<Integer> of());

      SecurityGroupInZone rawGroup = groupCreator.apply(zoneAndName);
      return groupConverter.apply(rawGroup);
   }
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.