Class BaseLoadBalancerService
- java.lang.Object
-
- org.jclouds.loadbalancer.internal.BaseLoadBalancerService
-
- All Implemented Interfaces:
LoadBalancerService
@Singleton public class BaseLoadBalancerService extends Object implements LoadBalancerService
-
-
Field Summary
Fields Modifier and Type Field Description protected LoadBalancerServiceContext
context
protected com.google.common.base.Supplier<Location>
defaultLocationSupplier
protected DestroyLoadBalancerStrategy
destroyLoadBalancerStrategy
protected GetLoadBalancerMetadataStrategy
getLoadBalancerMetadataStrategy
protected ListLoadBalancersStrategy
listLoadBalancersStrategy
protected LoadBalanceNodesStrategy
loadBalancerStrategy
protected com.google.common.base.Supplier<Set<? extends Location>>
locations
protected Logger
logger
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseLoadBalancerService(com.google.common.base.Supplier<Location> defaultLocationSupplier, LoadBalancerServiceContext context, LoadBalanceNodesStrategy loadBalancerStrategy, GetLoadBalancerMetadataStrategy getLoadBalancerMetadataStrategy, DestroyLoadBalancerStrategy destroyLoadBalancerStrategy, ListLoadBalancersStrategy listLoadBalancersStrategy, com.google.common.base.Supplier<Set<? extends Location>> locations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LoadBalancerMetadata
createLoadBalancerInLocation(Location location, String loadBalancerName, String protocol, int loadBalancerPort, int instancePort, Iterable<? extends NodeMetadata> nodes)
void
destroyLoadBalancer(String id)
LoadBalancerServiceContext
getContext()
LoadBalancerMetadata
getLoadBalancerMetadata(String id)
Set<? extends Location>
listAssignableLocations()
The list locations command returns all the valid locations for load balancers.Set<? extends LoadBalancerMetadata>
listLoadBalancers()
-
-
-
Field Detail
-
logger
@Named("jclouds.loadbalancer") protected Logger logger
-
defaultLocationSupplier
protected final com.google.common.base.Supplier<Location> defaultLocationSupplier
-
context
protected final LoadBalancerServiceContext context
-
loadBalancerStrategy
protected final LoadBalanceNodesStrategy loadBalancerStrategy
-
getLoadBalancerMetadataStrategy
protected final GetLoadBalancerMetadataStrategy getLoadBalancerMetadataStrategy
-
destroyLoadBalancerStrategy
protected final DestroyLoadBalancerStrategy destroyLoadBalancerStrategy
-
listLoadBalancersStrategy
protected final ListLoadBalancersStrategy listLoadBalancersStrategy
-
-
Constructor Detail
-
BaseLoadBalancerService
@Inject protected BaseLoadBalancerService(com.google.common.base.Supplier<Location> defaultLocationSupplier, LoadBalancerServiceContext context, LoadBalanceNodesStrategy loadBalancerStrategy, GetLoadBalancerMetadataStrategy getLoadBalancerMetadataStrategy, DestroyLoadBalancerStrategy destroyLoadBalancerStrategy, ListLoadBalancersStrategy listLoadBalancersStrategy, com.google.common.base.Supplier<Set<? extends Location>> locations)
-
-
Method Detail
-
listAssignableLocations
public Set<? extends Location> listAssignableLocations()
The list locations command returns all the valid locations for load balancers. A location has a scope, which is typically region or zone. A region is a general area, like eu-west, where a zone is similar to a datacenter. If a location has a parent, that implies it is within that location. For example a location can be a rack, whose parent is likely to be a zone.- Specified by:
listAssignableLocations
in interfaceLoadBalancerService
-
getContext
public LoadBalancerServiceContext getContext()
- Specified by:
getContext
in interfaceLoadBalancerService
- Returns:
- a reference to the context that created this LoadBalancerService.
-
createLoadBalancerInLocation
public LoadBalancerMetadata createLoadBalancerInLocation(@Nullable Location location, String loadBalancerName, String protocol, int loadBalancerPort, int instancePort, Iterable<? extends NodeMetadata> nodes)
- Specified by:
createLoadBalancerInLocation
in interfaceLoadBalancerService
- Parameters:
location
- null if defaultloadBalancerName
- Load balancer nameprotocol
- LoadBalancer transport protocol to use for routing - TCP or HTTP. This property cannot be modified for the life of the LoadBalancer.loadBalancerPort
- The external TCP port of the LoadBalancer. Valid LoadBalancer ports are - 80, 443 and 1024 through 65535. This property cannot be modified for the life of the LoadBalancer.instancePort
- The InstancePort data type is simple type of type: integer. It is the TCP port on which the server on the instance is listening. Valid instance ports are one (1) through 65535. This property cannot be modified for the life of the LoadBalancer.nodes
- nodes to loadbalance- See Also:
ComputeService
-
getLoadBalancerMetadata
public LoadBalancerMetadata getLoadBalancerMetadata(String id)
- Specified by:
getLoadBalancerMetadata
in interfaceLoadBalancerService
-
destroyLoadBalancer
public void destroyLoadBalancer(String id)
- Specified by:
destroyLoadBalancer
in interfaceLoadBalancerService
-
listLoadBalancers
public Set<? extends LoadBalancerMetadata> listLoadBalancers()
- Specified by:
listLoadBalancers
in interfaceLoadBalancerService
-
-