PortForwardManager
, or a direct reference to its impl PortForwardManagerImpl
@Deprecated public class PortForwardManagerClient extends java.lang.Object implements PortForwardManager
PortForwardManager.AssociationListener, PortForwardManager.AssociationMetadata
BrooklynObject.TagSupport
Configurable.ConfigurationSupport
PORT_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 PortForwardManager
public void associate(java.lang.String publicIpId, com.google.common.net.HostAndPort publicEndpoint, Location l, int privatePort)
PortForwardManager
PortForwardManager.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 PortForwardManager
public void associate(java.lang.String publicIpId, com.google.common.net.HostAndPort publicEndpoint, int privatePort)
PortForwardManager
PortForwardManager.lookup(String, int)
.associate
in interface PortForwardManager
public com.google.common.net.HostAndPort lookup(Location l, int privatePort)
PortForwardManager
Will return null if:
lookup
in interface PortForwardManager
PortForwardManager.recordPublicIpHostname(String, String)
public com.google.common.net.HostAndPort lookup(java.lang.String publicIpId, int privatePort)
PortForwardManager
PortForwardManager.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 PortForwardManager
public boolean forgetPortMapping(java.lang.String publicIpId, int publicPort)
PortForwardManager
forgetPortMapping
in interface PortForwardManager
public boolean forgetPortMappings(Location location)
PortForwardManager
forgetPortMappings
in interface PortForwardManager
public boolean forgetPortMappings(java.lang.String publicIpId)
PortForwardManager
forgetPortMappings
in interface PortForwardManager
public java.lang.String getId()
Location
getId
in interface Identifiable
getId
in interface Location
public java.lang.String getScope()
getScope
in interface PortForwardManager
public void addAssociationListener(PortForwardManager.AssociationListener listener, com.google.common.base.Predicate<? super PortForwardManager.AssociationMetadata> filter)
PortForwardManager
PortForwardManager.associate(String, HostAndPort, int)
and PortForwardManager.associate(String, HostAndPort, Location, int)
.addAssociationListener
in interface PortForwardManager
public void removeAssociationListener(PortForwardManager.AssociationListener listener)
removeAssociationListener
in interface PortForwardManager
public java.lang.String toVerboseString()
toVerboseString
in interface PortForwardManager
toVerboseString
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()
PortForwardManager
isClient
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 PortForwardManager
forgetPortMapping(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 PortForwardManager
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getDisplayName()
Location
getDisplayName
in interface BrooklynObject
getDisplayName
in interface Location
public Location getParent()
Location
null
if this location is the tree root.public java.util.Collection<Location> getChildren()
Location
getChildren
in interface Location
public void setParent(Location newParent)
Location
null
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)
Location
containsLocation
in interface Location
public <T> T getConfig(ConfigKey<T> key)
Location
config().get(key)
public <T> T getConfig(ConfigKey.HasConfigKey<T> key)
Location
config().get(key)
public boolean hasConfig(ConfigKey<?> key, boolean includeInherited)
Location
public java.util.Map<java.lang.String,java.lang.Object> getAllConfig(boolean includeInherited)
Location
getAllConfig
in interface Location
public boolean hasExtension(java.lang.Class<?> extensionType)
Location
Location.getExtension(Class)
.hasExtension
in interface Location
public <T> T getExtension(java.lang.Class<T> extensionType)
Location
getExtension(Object.class)
will not match
anything, even though registered extension extend Object
.
This will not look at extensions of Location.getParent()
.
getExtension
in interface Location
public java.lang.String getCatalogItemId()
BrooklynObject
This 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 BrooklynObject
public BrooklynObject.TagSupport tags()
BrooklynObject
ImmutableMap
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 BrooklynObject
public BrooklynObject.TagSupport getTagSupport()
getTagSupport
in interface BrooklynObject
public <T> T setConfig(ConfigKey<T> key, T val)
setConfig
in interface Configurable
public Configurable.ConfigurationSupport config()
config
in interface Configurable