public class StubSecurityGroupExtension extends Object implements SecurityGroupExtension
SecurityGroup
s. Implementation
is optional by providers.Constructor and Description |
---|
StubSecurityGroupExtension(ConcurrentMap<String,SecurityGroup> groups,
com.google.common.base.Supplier<Location> location,
javax.inject.Provider<Integer> groupIdProvider,
com.google.common.collect.Multimap<String,SecurityGroup> groupsForNodes) |
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.
|
SecurityGroup |
createSecurityGroup(String name,
Location location)
Create a new @{link SecurityGroup} from the parameters given.
|
SecurityGroup |
getSecurityGroupById(String id)
Get a security group by id.
|
Set<SecurityGroup> |
listSecurityGroups()
List security groups.
|
Set<SecurityGroup> |
listSecurityGroupsForNode(String nodeId)
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}.
|
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.
|
@Inject public StubSecurityGroupExtension(ConcurrentMap<String,SecurityGroup> groups, com.google.common.base.Supplier<Location> location, @Named(value="GROUP_ID") javax.inject.Provider<Integer> groupIdProvider, com.google.common.collect.Multimap<String,SecurityGroup> groupsForNodes)
public Set<SecurityGroup> listSecurityGroups()
SecurityGroupExtension
listSecurityGroups
in interface SecurityGroupExtension
public Set<SecurityGroup> listSecurityGroupsInLocation(Location location)
SecurityGroupExtension
listSecurityGroupsInLocation
in interface SecurityGroupExtension
public Set<SecurityGroup> listSecurityGroupsForNode(String nodeId)
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 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
Copyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.