public class PortForwardManagerClient extends java.lang.Object implements PortForwardManager
| Modifier and Type | Method and Description | 
|---|---|
| int | acquirePublicPort(java.lang.String publicIpId)Reserves a unique public port on the given publicIpId. | 
| int | acquirePublicPort(java.lang.String publicIpId,
                 Location l,
                 int privatePort)Reserves a unique public port for the purpose of forwarding to the given target,
 associated with a given location for subsequent lookup purpose. | 
| PortMapping | acquirePublicPortExplicit(java.lang.String publicIpId,
                         int port)Returns old mapping if it existed, null if it is new. | 
| void | associate(java.lang.String publicIpId,
         int publicPort,
         Location l,
         int privatePort)Records a location and private port against a publicIp and public port,
 to support  PortForwardManager.lookup(Location, int). | 
| boolean | forgetPortMapping(PortMapping m) | 
| PortMapping | forgetPortMapping(java.lang.String publicIpId,
                 int publicPort)Clears the given port mapping, returning the mapping if there was one. | 
| boolean | forgetPublicIpHostname(java.lang.String publicIpId)Clears a previous call to  PortForwardManager.recordPublicIpHostname(String, String). | 
| static PortForwardManager | fromAttributeOnEntity(Entity entity,
                     AttributeSensor<PortForwardManager> attributeOnEntity)creates an instance given an entity and  AttributeSensorto retrieve the PortForwardManager | 
| static PortForwardManager | fromMethodOnEntity(Entity entity,
                  java.lang.String getterMethodOnEntity)creates an instance given an entity and an interface method it implements to retrieve the PortForwardManager | 
| static PortForwardManager | fromSupplier(com.google.common.base.Supplier<PortForwardManager> supplier)creates an instance given a supplier; 
 the supplier should be brooklyn-persistable, that is to say
 references should be in terms of entities/locations 
 which can retrieve an authoritative source even under cloning | 
| java.util.Collection<PortMapping> | getLocationPublicIpIds(Location l)Returns the subset of port mappings associated with a given location. | 
| PortMapping | getPortMappingWithPrivateSide(Location l,
                             int privatePort)Returns the mapping to a given private port, or null if none. | 
| java.util.Collection<PortMapping> | getPortMappingWithPublicIpId(java.lang.String publicIpId)Returns the subset of port mappings associated with a given public IP ID. | 
| PortMapping | getPortMappingWithPublicSide(java.lang.String publicIpId,
                            int publicPort)Returns the port mapping for a given publicIpId and public port. | 
| com.google.common.net.HostAndPort | getPublicHostAndPort(PortMapping m)Returns the public host and port for use accessing the given mapping. | 
| java.lang.String | getPublicIpHostname(java.lang.String publicIpId)Returns a recorded public hostname or address. | 
| boolean | isClient()Returns true if this implementation is a client which is immutable/safe for serialization
 i.e. | 
| com.google.common.net.HostAndPort | lookup(Location l,
      int privatePort)Returns the public ip hostname and public port for use contacting the given endpoint. | 
| void | recordPublicIpHostname(java.lang.String publicIpId,
                      java.lang.String hostnameOrPublicIpAddress)Records a public hostname or address to be associated with the given publicIpId for lookup purposes. | 
public static PortForwardManager fromSupplier(com.google.common.base.Supplier<PortForwardManager> supplier)
public static PortForwardManager fromMethodOnEntity(Entity entity, java.lang.String getterMethodOnEntity)
public static PortForwardManager fromAttributeOnEntity(Entity entity, AttributeSensor<PortForwardManager> attributeOnEntity)
AttributeSensor to retrieve the PortForwardManagerpublic int acquirePublicPort(java.lang.String publicIpId)
PortForwardManager
 Often followed by PortForwardManager.associate(String, int, Location, int)
 to enable PortForwardManager.lookup(Location, int).
acquirePublicPort in interface PortForwardManagerpublic PortMapping acquirePublicPortExplicit(java.lang.String publicIpId, int port)
PortForwardManageracquirePublicPortExplicit in interface PortForwardManagerpublic PortMapping getPortMappingWithPublicSide(java.lang.String publicIpId, int publicPort)
PortForwardManagergetPortMappingWithPublicSide in interface PortForwardManagerpublic java.util.Collection<PortMapping> getPortMappingWithPublicIpId(java.lang.String publicIpId)
PortForwardManagergetPortMappingWithPublicIpId in interface PortForwardManagerpublic PortMapping forgetPortMapping(java.lang.String publicIpId, int publicPort)
PortForwardManagerforgetPortMapping in interface PortForwardManagerpublic boolean forgetPortMapping(PortMapping m)
forgetPortMapping in interface PortForwardManagerPortForwardManager.forgetPortMapping(String, int)public void recordPublicIpHostname(java.lang.String publicIpId,
                          java.lang.String hostnameOrPublicIpAddress)
PortForwardManagerConceivably this may have to be access-location specific.
recordPublicIpHostname in interface PortForwardManagerpublic java.lang.String getPublicIpHostname(java.lang.String publicIpId)
PortForwardManagergetPublicIpHostname in interface PortForwardManagerpublic boolean forgetPublicIpHostname(java.lang.String publicIpId)
PortForwardManagerPortForwardManager.recordPublicIpHostname(String, String).forgetPublicIpHostname in interface PortForwardManagerpublic com.google.common.net.HostAndPort getPublicHostAndPort(PortMapping m)
PortForwardManagerConceivably this may have to be access-location specific.
getPublicHostAndPort in interface PortForwardManagerpublic int acquirePublicPort(java.lang.String publicIpId,
                    Location l,
                    int privatePort)
PortForwardManagerIf already allocated, returns the previously allocated.
acquirePublicPort in interface PortForwardManagerpublic com.google.common.net.HostAndPort lookup(Location l, int privatePort)
PortForwardManagerWill return null if:
lookup in interface PortForwardManagerPortForwardManager.recordPublicIpHostname(String, String)public void associate(java.lang.String publicIpId,
             int publicPort,
             Location l,
             int privatePort)
PortForwardManagerPortForwardManager.lookup(Location, int).
 
 Superfluous if PortForwardManager.acquirePublicPort(String, Location, int) was used,
 but strongly recommended if PortForwardManager.acquirePublicPortExplicit(String, int) was used
 e.g. if the location is not known ahead of time.
associate in interface PortForwardManagerpublic java.util.Collection<PortMapping> getLocationPublicIpIds(Location l)
PortForwardManagergetLocationPublicIpIds in interface PortForwardManagerpublic PortMapping getPortMappingWithPrivateSide(Location l, int privatePort)
PortForwardManagergetPortMappingWithPrivateSide in interface PortForwardManagerpublic boolean isClient()
PortForwardManagerisClient in interface PortForwardManager