public class NovaSecurityGroupExtension extends Object implements SecurityGroupExtension
SecurityGroup
s. Implementation
is optional by providers.Modifier and Type | Field and Description |
---|---|
protected NovaApi |
api |
protected com.google.common.base.Function<SecurityGroupInRegion,SecurityGroup> |
groupConverter |
protected com.google.common.cache.LoadingCache<RegionAndName,SecurityGroupInRegion> |
groupCreator |
protected GroupNamingConvention.Factory |
namingConvention |
protected com.google.common.base.Supplier<Set<String>> |
regionIds |
protected com.google.common.util.concurrent.ListeningExecutorService |
userExecutor |
Constructor and Description |
---|
NovaSecurityGroupExtension(NovaApi api,
com.google.common.util.concurrent.ListeningExecutorService userExecutor,
com.google.common.base.Supplier<Set<String>> regionIds,
com.google.common.base.Function<SecurityGroupInRegion,SecurityGroup> groupConverter,
com.google.common.cache.LoadingCache<RegionAndName,SecurityGroupInRegion> 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 SecurityGroupInRegion>> |
allSecurityGroupsInRegion() |
SecurityGroup |
createSecurityGroup(String name,
Location location)
Create a new @{link SecurityGroup} from the parameters given.
|
SecurityGroup |
createSecurityGroup(String name,
String region) |
SecurityGroup |
getSecurityGroupById(String id)
Get a security group by id.
|
protected com.google.common.base.Function<SecurityGroup,SecurityGroupInRegion> |
groupToGroupInRegion(String region) |
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 SecurityGroupInRegion> |
pollSecurityGroups() |
protected Iterable<? extends SecurityGroupInRegion> |
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 |
supportsExclusionCidrBlocks()
Returns true if this SecurityGroupExtension supports exclusion CIDR groups.
|
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 NovaApi api
protected final com.google.common.util.concurrent.ListeningExecutorService userExecutor
protected final com.google.common.base.Function<SecurityGroupInRegion,SecurityGroup> groupConverter
protected final com.google.common.cache.LoadingCache<RegionAndName,SecurityGroupInRegion> groupCreator
protected final GroupNamingConvention.Factory namingConvention
@Inject public NovaSecurityGroupExtension(NovaApi api, @Named(value="jclouds.user-threads") com.google.common.util.concurrent.ListeningExecutorService userExecutor, com.google.common.base.Supplier<Set<String>> regionIds, com.google.common.base.Function<SecurityGroupInRegion,SecurityGroup> groupConverter, com.google.common.cache.LoadingCache<RegionAndName,SecurityGroupInRegion> 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
public boolean supportsExclusionCidrBlocks()
SecurityGroupExtension
supportsExclusionCidrBlocks
in interface SecurityGroupExtension
protected Iterable<? extends SecurityGroupInRegion> pollSecurityGroups()
protected Iterable<? extends SecurityGroupInRegion> pollSecurityGroupsByRegion(String region)
protected com.google.common.base.Function<String,Set<? extends SecurityGroupInRegion>> allSecurityGroupsInRegion()
protected com.google.common.base.Function<SecurityGroup,SecurityGroupInRegion> groupToGroupInRegion(String region)
Copyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.