PortForwardManager
, or a direct reference to its impl PortForwardManagerImpl
@Deprecated public class PortForwardManagerClient extends java.lang.Object implements PortForwardManager
PortForwardManager.AssociationListener, PortForwardManager.AssociationMetadata
BrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, 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.
|
void |
addAssociationListener(PortForwardManager.AssociationListener listener,
<any> filter)
Deprecated.
Registers a listener, which will be notified each time a new port mapping is associated.
|
void |
associate(java.lang.String publicIpId,
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,
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) . |
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.
|
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(<any> 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.lang.String |
getCatalogItemId()
Deprecated.
The catalog item ID this object was loaded from.
|
java.util.List<java.lang.String> |
getCatalogItemIdSearchPath()
Deprecated.
An immutable list of ids of catalog items that this item depends on in some way,
with the item that directly defines it implicit, but other items it references explicit.
|
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.
Convenience for calling
Configurable.ConfigurationSupport.get(ConfigKey) ,
via code like config().get(key) . |
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
|
HostAndPort |
getPublicHostAndPort(PortMapping m)
Deprecated.
since 0.7.0; this method will be internal only
|
java.lang.String |
getScope()
Deprecated.
|
boolean |
hasExtension(java.lang.Class<?> extensionType)
Deprecated.
Whether this location has support for the given extension type.
|
HostAndPort |
lookup(Location l,
int privatePort)
Deprecated.
Returns the public ip hostname and public port for use contacting the given endpoint.
|
HostAndPort |
lookup(java.lang.String publicIpId,
int privatePort)
Deprecated.
Returns the public endpoint (host and port) for use contacting the given endpoint.
|
BrooklynObject.RelationSupport<Location> |
relations()
Deprecated.
Relations specify a typed, directed connection between two entities.
|
void |
removeAssociationListener(PortForwardManager.AssociationListener listener)
Deprecated.
|
void |
setParent(Location newParent)
Deprecated.
Set the 'parent' of this location.
|
BrooklynObject.SubscriptionSupport |
subscriptions()
Deprecated.
Subscriptions are the mechanism for receiving notifications of sensor-events (e.g.
|
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(<any> 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, HostAndPort publicEndpoint, Location l, int privatePort)
PortForwardManager
PortForwardManager.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
public void associate(java.lang.String publicIpId, HostAndPort publicEndpoint, int privatePort)
PortForwardManager
PortForwardManager.lookup(String, int)
.associate
in interface PortForwardManager
public HostAndPort lookup(Location l, int privatePort)
PortForwardManager
Will return null if:
lookup
in interface PortForwardManager
#recordPublicIpHostname(String, String)
public 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 Location
getId
in interface Identifiable
public java.lang.String getScope()
getScope
in interface PortForwardManager
public void addAssociationListener(PortForwardManager.AssociationListener listener, <any> 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 Location
toVerboseString
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 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 Location
getDisplayName
in interface BrooklynObject
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.HasConfigKey<T> key)
Location
config().get(key)
public <T> T getConfig(ConfigKey<T> key)
Configurable
Configurable.ConfigurationSupport.get(ConfigKey)
,
via code like config().get(key)
.getConfig
in interface Configurable
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.
This should conform to OSGi specs for symbolic_name:version
but weaker semantics are usually allowed so long as neither segment contains a :
or whitespace.
getCatalogItemId
in interface BrooklynObject
public java.util.List<java.lang.String> getCatalogItemIdSearchPath()
BrooklynObject
items: - id: X - id: Y item: X - id: Z item: Ythe spec for Z will have getCatalogId() of Z and getCatalogItemIdSearchPath() of Y, X. (The self catalog ID is implicit at the head of the search path.)
getCatalogItemIdSearchPath
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.RelationSupport<Location> relations()
BrooklynObject
relations
in interface Location
relations
in interface BrooklynObject
public Configurable.ConfigurationSupport config()
config
in interface Configurable
public BrooklynObject.SubscriptionSupport subscriptions()
BrooklynObject
subscriptions
in interface BrooklynObject