public class EC2SecurityGroupExtension extends Object implements SecurityGroupExtension
SecurityGroup
s. Implementation
is optional by providers.Modifier and Type | Field and Description |
---|---|
protected EC2Api |
client |
protected com.google.common.base.Function<SecurityGroup,SecurityGroup> |
groupConverter |
protected com.google.common.cache.LoadingCache<RegionAndName,String> |
groupCreator |
protected com.google.common.base.Supplier<Set<? extends Location>> |
locations |
protected GroupNamingConvention.Factory |
namingConvention |
protected com.google.common.base.Supplier<Set<String>> |
regions |
protected com.google.common.util.concurrent.ListeningExecutorService |
userExecutor |
Constructor and Description |
---|
EC2SecurityGroupExtension(EC2Api client,
com.google.common.util.concurrent.ListeningExecutorService userExecutor,
com.google.common.base.Supplier<Set<String>> regions,
com.google.common.base.Function<SecurityGroup,SecurityGroup> groupConverter,
com.google.common.base.Supplier<Set<? extends Location>> locations,
com.google.common.cache.LoadingCache<RegionAndName,String> groupCreator,
GroupNamingConvention.Factory namingConvention) |
Modifier and Type | Method and Description |
---|---|
SecurityGroup |
addIpPermission(IpPermission ipPermission,
SecurityGroup group)
Add a @{link IpPermission} to an existing @{link SecurityGroup}.
|
SecurityGroup |
addIpPermission(IpProtocol protocol,
int startPort,
int endPort,
com.google.common.collect.Multimap<String,String> tenantIdGroupNamePairs,
Iterable<String> ipRanges,
Iterable<String> groupIds,
SecurityGroup group)
Add a @{link IpPermission} to an existing @{link SecurityGroup}, based on the parameters given.
|
protected com.google.common.base.Function<String,Set<? extends SecurityGroup>> |
allSecurityGroupsInRegion() |
SecurityGroup |
createSecurityGroup(String name,
Location location)
Create a new @{link SecurityGroup} from the parameters given.
|
SecurityGroup |
createSecurityGroup(String name,
String region) |
protected Location |
findLocationWithId(String locationId) |
SecurityGroup |
getSecurityGroupById(String id)
Get a security group by id.
|
Set<SecurityGroup> |
listSecurityGroups()
List security groups.
|
Set<SecurityGroup> |
listSecurityGroupsForNode(String id)
List security groups for a given instance given the instance's ID.
|
Set<SecurityGroup> |
listSecurityGroupsInLocation(Location location)
List security groups in a given @{link Location}.
|
Set<SecurityGroup> |
listSecurityGroupsInLocation(String region) |
protected Iterable<? extends SecurityGroup> |
pollSecurityGroups() |
protected Iterable<? extends SecurityGroup> |
pollSecurityGroupsByRegion(String region) |
SecurityGroup |
removeIpPermission(IpPermission ipPermission,
SecurityGroup group)
Remove a @{link IpPermission} from an existing @{link SecurityGroup}.
|
SecurityGroup |
removeIpPermission(IpProtocol protocol,
int startPort,
int endPort,
com.google.common.collect.Multimap<String,String> tenantIdGroupNamePairs,
Iterable<String> ipRanges,
Iterable<String> groupIds,
SecurityGroup group)
Remove a @{link IpPermission} from an existing @{link SecurityGroup}, based on the parameters given.
|
boolean |
removeSecurityGroup(String id)
Remove an existing @{link SecurityGroup}, and its permissions.
|
boolean |
supportsGroupIds()
Returns true if this SecurityGroupExtension supports group IDs.
|
boolean |
supportsPortRangesForGroups()
Returns true if this SecurityGroupExtension supports port ranges for group authorization.
|
boolean |
supportsTenantIdGroupIdPairs()
Returns true if this SecurityGroupExtension supports tenant ID + group ID pairs.
|
boolean |
supportsTenantIdGroupNamePairs()
Returns true if this SecurityGroupExtension supports tenant ID + group name pairs.
|
protected final EC2Api client
protected final com.google.common.util.concurrent.ListeningExecutorService userExecutor
protected final com.google.common.base.Function<SecurityGroup,SecurityGroup> groupConverter
protected final com.google.common.cache.LoadingCache<RegionAndName,String> groupCreator
protected final GroupNamingConvention.Factory namingConvention
@Inject public EC2SecurityGroupExtension(EC2Api client, @Named(value="jclouds.user-threads") com.google.common.util.concurrent.ListeningExecutorService userExecutor, com.google.common.base.Supplier<Set<String>> regions, com.google.common.base.Function<SecurityGroup,SecurityGroup> groupConverter, com.google.common.base.Supplier<Set<? extends Location>> locations, @Named(value="SECURITY") com.google.common.cache.LoadingCache<RegionAndName,String> groupCreator, GroupNamingConvention.Factory namingConvention)
public Set<SecurityGroup> listSecurityGroups()
SecurityGroupExtension
listSecurityGroups
in interface SecurityGroupExtension
public Set<SecurityGroup> listSecurityGroupsInLocation(Location location)
SecurityGroupExtension
listSecurityGroupsInLocation
in interface SecurityGroupExtension
public Set<SecurityGroup> listSecurityGroupsInLocation(String region)
public Set<SecurityGroup> listSecurityGroupsForNode(String id)
SecurityGroupExtension
listSecurityGroupsForNode
in interface SecurityGroupExtension
public SecurityGroup getSecurityGroupById(String id)
SecurityGroupExtension
getSecurityGroupById
in interface SecurityGroupExtension
public SecurityGroup createSecurityGroup(String name, Location location)
SecurityGroupExtension
createSecurityGroup
in interface SecurityGroupExtension
name
- The name of the security grouplocation
- The @{link Location} of the security grouppublic SecurityGroup createSecurityGroup(String name, String region)
public boolean removeSecurityGroup(String id)
SecurityGroupExtension
removeSecurityGroup
in interface SecurityGroupExtension
id
- The id of the SecurityGroup to delete.public SecurityGroup addIpPermission(IpPermission ipPermission, SecurityGroup group)
SecurityGroupExtension
addIpPermission
in interface SecurityGroupExtension
group
- The SecurityGroup to add the permission to.public SecurityGroup addIpPermission(IpProtocol protocol, int startPort, int endPort, com.google.common.collect.Multimap<String,String> tenantIdGroupNamePairs, Iterable<String> ipRanges, Iterable<String> groupIds, SecurityGroup group)
SecurityGroupExtension
addIpPermission
in interface SecurityGroupExtension
protocol
- The @{link IpProtocol} for the permission.startPort
- The first port in the range to be opened, or -1 for ICMP.endPort
- The last port in the range to be opened, or -1 for ICMP.tenantIdGroupNamePairs
- source of traffic allowed is on basis of another group in a tenant, as opposed to by cidripRanges
- An Iterable of Strings representing the IP range(s) the permission should allow.groupIds
- An Iterable of @{link SecurityGroup} IDs this permission should allow.group
- The SecurityGroup to add the permission to.public SecurityGroup removeIpPermission(IpPermission ipPermission, SecurityGroup group)
SecurityGroupExtension
removeIpPermission
in interface SecurityGroupExtension
group
- The SecurityGroup to remove the permission from.public SecurityGroup removeIpPermission(IpProtocol protocol, int startPort, int endPort, com.google.common.collect.Multimap<String,String> tenantIdGroupNamePairs, Iterable<String> ipRanges, Iterable<String> groupIds, SecurityGroup group)
SecurityGroupExtension
removeIpPermission
in interface SecurityGroupExtension
protocol
- The @{link IpProtocol} for the permission.startPort
- The first port in the range to be opened, or -1 for ICMP.endPort
- The last port in the range to be opened, or -1 for ICMP.tenantIdGroupNamePairs
- source of traffic allowed is on basis of another group in a tenant, as opposed to by cidripRanges
- An Iterable of Strings representing the IP range(s) the permission should allow.groupIds
- An Iterable of @{link SecurityGroup} IDs this permission should allow.group
- The SecurityGroup to remove the permission from.public boolean supportsTenantIdGroupNamePairs()
SecurityGroupExtension
supportsTenantIdGroupNamePairs
in interface SecurityGroupExtension
public boolean supportsTenantIdGroupIdPairs()
SecurityGroupExtension
supportsTenantIdGroupIdPairs
in interface SecurityGroupExtension
public boolean supportsGroupIds()
SecurityGroupExtension
supportsGroupIds
in interface SecurityGroupExtension
public boolean supportsPortRangesForGroups()
SecurityGroupExtension
supportsPortRangesForGroups
in interface SecurityGroupExtension
protected Iterable<? extends SecurityGroup> pollSecurityGroups()
protected Iterable<? extends SecurityGroup> pollSecurityGroupsByRegion(String region)
protected com.google.common.base.Function<String,Set<? extends SecurityGroup>> allSecurityGroupsInRegion()
Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.