public class SecurityGroupEditor
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SecurityGroupEditor.AmbiguousGroupName |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
JCLOUDS_PREFIX_REGEX |
Constructor and Description |
---|
SecurityGroupEditor(org.jclouds.domain.Location location,
org.jclouds.compute.extensions.SecurityGroupExtension securityGroupExtension)
Constructor for editor that never retries requests if the attempted operation fails.
|
SecurityGroupEditor(org.jclouds.domain.Location location,
org.jclouds.compute.extensions.SecurityGroupExtension securityGroupExtension,
<any> isExceptionRetryable)
Deprecated.
since 0.10.0 Ideally it should be possible to determine a suitable predicate internally to
this class by instantiating a type appropriate to the underlying cloud. TODO investigate and implement.
|
Modifier and Type | Method and Description |
---|---|
org.jclouds.compute.domain.SecurityGroup |
addPermission(org.jclouds.compute.domain.SecurityGroup group,
org.jclouds.net.domain.IpPermission permission)
Add a permission to the security group.
|
org.jclouds.compute.domain.SecurityGroup |
addPermissions(org.jclouds.compute.domain.SecurityGroup group,
java.lang.Iterable<org.jclouds.net.domain.IpPermission> permissions)
Add permissions to the security group, using
addPermission(SecurityGroup, IpPermission) . |
org.jclouds.compute.domain.SecurityGroup |
createSecurityGroup(java.lang.String name)
Create the security group.
|
<any> |
findSecurityGroupByName(java.lang.String name)
Find a security group with the given name.
|
java.lang.Iterable<org.jclouds.compute.domain.SecurityGroup> |
findSecurityGroupsMatching(Predicate predicate) |
org.jclouds.domain.Location |
getLocation()
Get the location in which security groups will be created or searched.
|
java.util.Set<org.jclouds.compute.domain.SecurityGroup> |
getSecurityGroupsForNode(java.lang.String nodeId) |
java.util.Set<org.jclouds.compute.domain.SecurityGroup> |
listSecurityGroupsForNode(java.lang.String nodeId) |
org.jclouds.compute.domain.SecurityGroup |
removePermission(org.jclouds.compute.domain.SecurityGroup group,
org.jclouds.net.domain.IpPermission permission) |
org.jclouds.compute.domain.SecurityGroup |
removePermissions(org.jclouds.compute.domain.SecurityGroup group,
java.lang.Iterable<org.jclouds.net.domain.IpPermission> permissions) |
boolean |
removeSecurityGroup(org.jclouds.compute.domain.SecurityGroup group)
Removes a security group and its permissions.
|
boolean |
removeSecurityGroup(java.lang.String groupId)
Removes a security group and its permissions.
|
java.lang.String |
toString() |
public static final java.lang.String JCLOUDS_PREFIX_REGEX
public SecurityGroupEditor(org.jclouds.domain.Location location, org.jclouds.compute.extensions.SecurityGroupExtension securityGroupExtension)
location
- JClouds location where security groups will be managed.securityGroupExtension
- The JClouds security group extension from the compute service for this location.@Deprecated public SecurityGroupEditor(org.jclouds.domain.Location location, org.jclouds.compute.extensions.SecurityGroupExtension securityGroupExtension, <any> isExceptionRetryable)
location
- JClouds location where security groups will be managed.securityGroupExtension
- The JClouds security group extension from the compute service for this location.isExceptionRetryable
- used to determine for an exception whether to retry the operation that failed.public org.jclouds.domain.Location getLocation()
public java.util.Set<org.jclouds.compute.domain.SecurityGroup> getSecurityGroupsForNode(java.lang.String nodeId)
public org.jclouds.compute.domain.SecurityGroup createSecurityGroup(java.lang.String name)
JCLOUDS_PREFIX_REGEX
. This method is idempotent.name
- Name of the group to createpublic boolean removeSecurityGroup(org.jclouds.compute.domain.SecurityGroup group)
group
- The security group.public boolean removeSecurityGroup(java.lang.String groupId)
groupId
- The jclouds id (provider id) of the group (including region code)public java.util.Set<org.jclouds.compute.domain.SecurityGroup> listSecurityGroupsForNode(java.lang.String nodeId)
public java.lang.Iterable<org.jclouds.compute.domain.SecurityGroup> findSecurityGroupsMatching(Predicate predicate)
public <any> findSecurityGroupByName(java.lang.String name)
JCLOUDS_PREFIX_REGEX
. For convenience this method accepts names either with or without
the prefix.name
- Name of the group to find.SecurityGroupEditor.AmbiguousGroupName
- in the unexpected case that the cloud returns more than one matching group.public org.jclouds.compute.domain.SecurityGroup addPermissions(org.jclouds.compute.domain.SecurityGroup group, java.lang.Iterable<org.jclouds.net.domain.IpPermission> permissions)
addPermission(SecurityGroup, IpPermission)
.group
- The group to updatepermissions
- The new permissionspublic org.jclouds.compute.domain.SecurityGroup addPermission(org.jclouds.compute.domain.SecurityGroup group, org.jclouds.net.domain.IpPermission permission)
group
- The group to updatepermission
- The new permissionpublic org.jclouds.compute.domain.SecurityGroup removePermission(org.jclouds.compute.domain.SecurityGroup group, org.jclouds.net.domain.IpPermission permission)
public org.jclouds.compute.domain.SecurityGroup removePermissions(org.jclouds.compute.domain.SecurityGroup group, java.lang.Iterable<org.jclouds.net.domain.IpPermission> permissions)
public java.lang.String toString()
toString
in class java.lang.Object