PortForwardManager, or a direct reference to its impl PortForwardManagerImpl@Deprecated public class PortForwardManagerClient extends java.lang.Object implements PortForwardManager
PortForwardManager.AssociationListener, PortForwardManager.AssociationMetadataBrooklynObject.TagSupportConfigurable.ConfigurationSupportPORT_FORWARD_MANAGER_STARTING_PORT, SCOPE| Modifier and Type | Method and Description |
|---|---|
int |
acquirePublicPort(java.lang.String publicIpId)
Deprecated.
Reserves a unique public port on the given publicIpId.
|
int |
acquirePublicPort(java.lang.String publicIpId,
Location l,
int privatePort)
Deprecated.
since 0.7.0; use
acquirePublicPort(String), and then use associate(String, HostAndPort, int) or associate(String, HostAndPort, Location, int) |
PortMapping |
acquirePublicPortExplicit(java.lang.String publicIpId,
int publicPort)
Deprecated.
since 0.7.0; use
associate(String, HostAndPort, int) or associate(String, HostAndPort, Location, int) |
void |
addAssociationListener(PortForwardManager.AssociationListener listener,
com.google.common.base.Predicate<? super PortForwardManager.AssociationMetadata> filter)
Deprecated.
Registers a listener, which will be notified each time a new port mapping is associated.
|
void |
associate(java.lang.String publicIpId,
com.google.common.net.HostAndPort publicEndpoint,
int privatePort)
Deprecated.
Records a mapping for publicIpId:privatePort to a public endpoint, such that it can
subsequently be looked up using
PortForwardManager.lookup(String, int). |
void |
associate(java.lang.String publicIpId,
com.google.common.net.HostAndPort publicEndpoint,
Location l,
int privatePort)
Deprecated.
Records a location and private port against a public endpoint (ip and port),
to support
PortForwardManager.lookup(Location, int). |
void |
associate(java.lang.String publicIpId,
int publicPort,
Location l,
int privatePort)
Deprecated.
|
Configurable.ConfigurationSupport |
config()
Deprecated.
|
boolean |
containsLocation(Location potentialDescendent)
Deprecated.
Answers true if this location equals or is an ancestor of the given location.
|
boolean |
forgetPortMapping(PortMapping m)
Deprecated.
since 0.7.0; this method will be internal only
|
boolean |
forgetPortMapping(java.lang.String publicIpId,
int publicPort)
Deprecated.
Clears the given port mapping, returning true if there was a match.
|
boolean |
forgetPortMappings(Location location)
Deprecated.
Clears the port mappings associated with the given location, returning true if there were any matches.
|
boolean |
forgetPortMappings(java.lang.String publicIpId)
Deprecated.
Clears the port mappings associated with the given publicIpId, returning true if there were any matches.
|
boolean |
forgetPublicIpHostname(java.lang.String publicIpId)
Deprecated.
Use
forgetPortMapping(String, int) or #forgetPortMapping(Location, int) |
static PortForwardManager |
fromAttributeOnEntity(Entity entity,
AttributeSensor<PortForwardManager> attributeOnEntity)
Deprecated.
creates an instance given an entity and
AttributeSensor to retrieve the PortForwardManager |
static PortForwardManager |
fromMethodOnEntity(Entity entity,
java.lang.String getterMethodOnEntity)
Deprecated.
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)
Deprecated.
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.Map<java.lang.String,java.lang.Object> |
getAllConfig(boolean includeInherited)
Deprecated.
Returns all config set, either inherited (argument true) or locally-only (argument false).
|
java.lang.String |
getCatalogItemId()
Deprecated.
The catalog item ID this object was loaded from.
|
java.util.Collection<Location> |
getChildren()
Deprecated.
Get the 'children' of this location.
|
<T> T |
getConfig(ConfigKey.HasConfigKey<T> key)
Deprecated.
Convenience method for
config().get(key) |
<T> T |
getConfig(ConfigKey<T> key)
Deprecated.
Returns configuration set at this location or inherited or default.
|
java.lang.String |
getDisplayName()
Deprecated.
Get the name assigned to this location.
|
<T> T |
getExtension(java.lang.Class<T> extensionType)
Deprecated.
Returns an extension of the given type.
|
java.lang.String |
getId()
Deprecated.
A unique id for this location.
|
java.util.Collection<PortMapping> |
getLocationPublicIpIds(Location l)
Deprecated.
since 0.7.0; this method will be internal only
|
Location |
getParent()
Deprecated.
Get the 'parent' of this location.
|
PortMapping |
getPortMappingWithPrivateSide(Location l,
int privatePort)
Deprecated.
since 0.7.0; this method will be internal only
|
java.util.Collection<PortMapping> |
getPortMappingWithPublicIpId(java.lang.String publicIpId)
Deprecated.
since 0.7.0; this method will be internal only
|
PortMapping |
getPortMappingWithPublicSide(java.lang.String publicIpId,
int publicPort)
Deprecated.
since 0.7.0; this method will be internal only
|
com.google.common.net.HostAndPort |
getPublicHostAndPort(PortMapping m)
Deprecated.
since 0.7.0; this method will be internal only
|
java.lang.String |
getPublicIpHostname(java.lang.String publicIpId)
Deprecated.
|
java.lang.String |
getScope()
Deprecated.
|
BrooklynObject.TagSupport |
getTagSupport()
Deprecated.
|
boolean |
hasConfig(ConfigKey<?> key,
boolean includeInherited)
Deprecated.
True iff the indication config key is set, either inherited (second argument true) or locally-only (second argument false).
|
boolean |
hasExtension(java.lang.Class<?> extensionType)
Deprecated.
Whether this location has support for the given extension type.
|
boolean |
isClient()
Deprecated.
|
com.google.common.net.HostAndPort |
lookup(Location l,
int privatePort)
Deprecated.
Returns the public ip hostname and public port for use contacting the given endpoint.
|
com.google.common.net.HostAndPort |
lookup(java.lang.String publicIpId,
int privatePort)
Deprecated.
Returns the public endpoint (host and port) for use contacting the given endpoint.
|
void |
recordPublicIpHostname(java.lang.String publicIpId,
java.lang.String hostnameOrPublicIpAddress)
Deprecated.
|
void |
removeAssociationListener(PortForwardManager.AssociationListener listener)
Deprecated.
|
<T> T |
setConfig(ConfigKey<T> key,
T val)
Deprecated.
|
void |
setParent(Location newParent)
Deprecated.
Set the 'parent' of this location.
|
BrooklynObject.TagSupport |
tags()
Deprecated.
Tags are arbitrary objects which can be attached to an entity for subsequent reference.
|
java.lang.String |
toString()
Deprecated.
|
java.lang.String |
toVerboseString()
Deprecated.
|
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, HostAndPort, int) or PortForwardManager.associate(String, HostAndPort, Location, int)
to enable PortForwardManager.lookup(String, int) or PortForwardManager.lookup(Location, int) respectively.
acquirePublicPort in interface PortForwardManagerpublic void associate(java.lang.String publicIpId,
com.google.common.net.HostAndPort publicEndpoint,
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 void associate(java.lang.String publicIpId,
com.google.common.net.HostAndPort publicEndpoint,
int privatePort)
PortForwardManagerPortForwardManager.lookup(String, int).associate 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 com.google.common.net.HostAndPort lookup(java.lang.String publicIpId,
int privatePort)
PortForwardManagerPortForwardManager.associate(String, HostAndPort, int), to register
the endpoint.
Will return null if there has not been a public endpoint associated with this pairing.lookup in interface PortForwardManagerpublic boolean forgetPortMapping(java.lang.String publicIpId,
int publicPort)
PortForwardManagerforgetPortMapping in interface PortForwardManagerpublic boolean forgetPortMappings(Location location)
PortForwardManagerforgetPortMappings in interface PortForwardManagerpublic boolean forgetPortMappings(java.lang.String publicIpId)
PortForwardManagerforgetPortMappings in interface PortForwardManagerpublic java.lang.String getId()
LocationgetId in interface IdentifiablegetId in interface Locationpublic java.lang.String getScope()
getScope in interface PortForwardManagerpublic void addAssociationListener(PortForwardManager.AssociationListener listener, com.google.common.base.Predicate<? super PortForwardManager.AssociationMetadata> filter)
PortForwardManagerPortForwardManager.associate(String, HostAndPort, int)
and PortForwardManager.associate(String, HostAndPort, Location, int).addAssociationListener in interface PortForwardManagerpublic void removeAssociationListener(PortForwardManager.AssociationListener listener)
removeAssociationListener in interface PortForwardManagerpublic java.lang.String toVerboseString()
toVerboseString in interface PortForwardManagertoVerboseString in interface Location@Deprecated
public int acquirePublicPort(java.lang.String publicIpId,
Location l,
int privatePort)
acquirePublicPort(String), and then use associate(String, HostAndPort, int) or associate(String, HostAndPort, Location, int)If already allocated, returns the previously allocated.
acquirePublicPort in interface PortForwardManager@Deprecated public PortMapping acquirePublicPortExplicit(java.lang.String publicIpId, int publicPort)
associate(String, HostAndPort, int) or associate(String, HostAndPort, Location, int)acquirePublicPortExplicit in interface PortForwardManager@Deprecated
public void associate(java.lang.String publicIpId,
int publicPort,
Location l,
int privatePort)
associate(String, HostAndPort, Location, int)lookup(Location, int).
Superfluous if acquirePublicPort(String, Location, int) was used,
but strongly recommended if acquirePublicPortExplicit(String, int) was used
e.g. if the location is not known ahead of time.
associate in interface PortForwardManager@Deprecated
public void recordPublicIpHostname(java.lang.String publicIpId,
java.lang.String hostnameOrPublicIpAddress)
associate(String, HostAndPort, int) or associate(String, HostAndPort, Location, int)Conceivably this may have to be access-location specific.
recordPublicIpHostname in interface PortForwardManager@Deprecated public java.lang.String getPublicIpHostname(java.lang.String publicIpId)
getPublicIpHostname in interface PortForwardManager@Deprecated public boolean forgetPublicIpHostname(java.lang.String publicIpId)
recordPublicIpHostname(String, String).forgetPublicIpHostname in interface PortForwardManager@Deprecated public boolean isClient()
PortForwardManagerisClient in interface PortForwardManager@Deprecated public PortMapping getPortMappingWithPublicSide(java.lang.String publicIpId, int publicPort)
getPortMappingWithPublicSide in interface PortForwardManager@Deprecated public java.util.Collection<PortMapping> getPortMappingWithPublicIpId(java.lang.String publicIpId)
getPortMappingWithPublicIpId in interface PortForwardManager@Deprecated public boolean forgetPortMapping(PortMapping m)
forgetPortMapping in interface PortForwardManagerforgetPortMapping(String, int)@Deprecated public com.google.common.net.HostAndPort getPublicHostAndPort(PortMapping m)
Conceivably this may have to be access-location specific.
getPublicHostAndPort in interface PortForwardManager@Deprecated public java.util.Collection<PortMapping> getLocationPublicIpIds(Location l)
getLocationPublicIpIds in interface PortForwardManager@Deprecated public PortMapping getPortMappingWithPrivateSide(Location l, int privatePort)
getPortMappingWithPrivateSide in interface PortForwardManagerpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getDisplayName()
LocationgetDisplayName in interface BrooklynObjectgetDisplayName in interface Locationpublic Location getParent()
Locationnull if this location is the tree root.public java.util.Collection<Location> getChildren()
LocationgetChildren in interface Locationpublic void setParent(Location newParent)
Locationnull to indicate that the location should be disconnected
from its parent.
Adds this location as a child of the new parent (see getChildLocations()).public boolean containsLocation(Location potentialDescendent)
LocationcontainsLocation in interface Locationpublic <T> T getConfig(ConfigKey<T> key)
Locationconfig().get(key)public <T> T getConfig(ConfigKey.HasConfigKey<T> key)
Locationconfig().get(key)public boolean hasConfig(ConfigKey<?> key, boolean includeInherited)
Locationpublic java.util.Map<java.lang.String,java.lang.Object> getAllConfig(boolean includeInherited)
LocationgetAllConfig in interface Locationpublic boolean hasExtension(java.lang.Class<?> extensionType)
LocationLocation.getExtension(Class).hasExtension in interface Locationpublic <T> T getExtension(java.lang.Class<T> extensionType)
LocationgetExtension(Object.class) will not match
anything, even though registered extension extend Object.
This will not look at extensions of Location.getParent().
getExtension in interface Locationpublic java.lang.String getCatalogItemId()
BrooklynObjectThis can be used to understand the appropriate classloading context, such as for versioning purposes, as well as meta-information such as branding (maybe you can even get an icon) and potentially things like resource lifecycle (if a software version is being sunsetted).
In some cases this may be set heuristically from context and so may not be accurate. Callers can set an explicit catalog item ID if inferencing is not correct.
getCatalogItemId in interface BrooklynObjectpublic BrooklynObject.TagSupport tags()
BrooklynObjectImmutableMap may be used under the covers; also there is little point!);
and they should be amenable to our persistence (on-disk serialization) and our JSON serialization in the REST API.tags in interface BrooklynObjectpublic BrooklynObject.TagSupport getTagSupport()
getTagSupport in interface BrooklynObjectpublic <T> T setConfig(ConfigKey<T> key, T val)
setConfig in interface Configurablepublic Configurable.ConfigurationSupport config()
config in interface Configurable