[GitHub] brooklyn-server pull request #318: Delete most deprecated methods from PortF...

2017-02-28 Thread sjcorbett
Github user sjcorbett closed the pull request at:

https://github.com/apache/brooklyn-server/pull/318


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #318: Delete most deprecated methods from PortF...

2016-09-22 Thread ahgittin
Github user ahgittin commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/318#discussion_r80026503
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/location/access/PortForwardManagerImpl.java
 ---
@@ -83,9 +83,6 @@
 
 private final Map> associationListeners = new 
ConcurrentHashMap>();
 
-@Deprecated
-protected final Map publicIpIdToHostname = new 
LinkedHashMap();
--- End diff --

@sjcorbett my strategy when deprecating fields is to mark it deprecated and 
transient for one major release, make sure all accessors transform it, and make 
sure at least one accessor gets exercised.

this should ensure that if state from one version is carried through 
subsequent major versions it will migrate.

however there is not currently any way to force exercising in all cases i 
don't think (we could introduce a method `postRebind()` for that purpose?).  
for now i suggest keep it in perpetuity with a comment `// kept for persistence 
from previous versions; see https://github.com/apache/brooklyn-server/pull/318`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #318: Delete most deprecated methods from PortF...

2016-09-08 Thread sjcorbett
Github user sjcorbett commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/318#discussion_r78008532
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/location/access/PortForwardManagerImpl.java
 ---
@@ -83,9 +83,6 @@
 
 private final Map> associationListeners = new 
ConcurrentHashMap>();
 
-@Deprecated
-protected final Map publicIpIdToHostname = new 
LinkedHashMap();
--- End diff --

Is there a strategy for removing deprecated fields short of making them 
private and leaving them forever? Not sure we can do anything sensible to 
transform its data during rebind. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #318: Delete most deprecated methods from PortF...

2016-09-06 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/318#discussion_r77644975
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/location/access/PortForwardManagerImpl.java
 ---
@@ -83,9 +83,6 @@
 
 private final Map> associationListeners = new 
ConcurrentHashMap>();
 
-@Deprecated
-protected final Map publicIpIdToHostname = new 
LinkedHashMap();
--- End diff --

Wonder how this will affect rebinding. I believe PFMs are persisted.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #318: Delete most deprecated methods from PortF...

2016-09-06 Thread neykov
Github user neykov commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/318#discussion_r77644176
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/location/access/PortForwardManagerImpl.java
 ---
@@ -356,117 +343,18 @@ private AssociationMetadata 
associationMetadataFromPortMapping(PortMapping portM
 
 
 
///
-// Deprecated
-
///
-
-@Override
-@Deprecated
-public PortMapping acquirePublicPortExplicit(String publicIpId, int 
port) {
-PortMapping mapping = new PortMapping(publicIpId, port, null, -1);
-log.debug("assigning explicit public port "+port+" at 
"+publicIpId);
-PortMapping result;
-synchronized (mutex) {
-result = mappings.put(makeKey(publicIpId, port), mapping);
-}
-onChanged();
-return result;
-}
-
-@Override
-@Deprecated
-public boolean forgetPortMapping(PortMapping m) {
-return forgetPortMapping(m.publicIpId, m.publicPort);
-}
-
-@Override
-@Deprecated
-public void recordPublicIpHostname(String publicIpId, String 
hostnameOrPublicIpAddress) {
-log.debug("recording public IP "+publicIpId+" associated with 
"+hostnameOrPublicIpAddress);
-synchronized (mutex) {
-String old = publicIpIdToHostname.put(publicIpId, 
hostnameOrPublicIpAddress);
-if (old!=null && !old.equals(hostnameOrPublicIpAddress))
-log.warn("Changing hostname recorded against public IP 
"+publicIpId+"; from "+old+" to "+hostnameOrPublicIpAddress);
-}
-onChanged();
-}
-
-@Override
-@Deprecated
-public String getPublicIpHostname(String publicIpId) {
-synchronized (mutex) {
-return publicIpIdToHostname.get(publicIpId);
-}
-}
-
-@Override
-@Deprecated
-public boolean forgetPublicIpHostname(String publicIpId) {
-log.debug("forgetting public IP "+publicIpId+" association");
-boolean result;
-synchronized (mutex) {
-result = (publicIpIdToHostname.remove(publicIpId) != null);
-}
-onChanged();
-return result;
-}
-
-@Override
-@Deprecated
-public int acquirePublicPort(String publicIpId, Location l, int 
privatePort) {
-int publicPort;
-synchronized (mutex) {
-PortMapping old = getPortMappingWithPrivateSide(l, 
privatePort);
-// only works for 1 public IP ID per location (which is the 
norm)
-if (old!=null && old.publicIpId.equals(publicIpId)) {
-log.debug("request to acquire public port at 
"+publicIpId+" for "+l+":"+privatePort+", reusing old assignment "+old);
-return old.getPublicPort();
-}
-
-publicPort = acquirePublicPort(publicIpId);
-log.debug("request to acquire public port at "+publicIpId+" 
for "+l+":"+privatePort+", allocating "+publicPort);
-associateImpl(publicIpId, publicPort, l, privatePort);
-}
-onChanged();
-return publicPort;
-}
-
-@Override
-@Deprecated
-public void associate(String publicIpId, int publicPort, Location l, 
int privatePort) {
-synchronized (mutex) {
-associateImpl(publicIpId, publicPort, l, privatePort);
-}
-onChanged();
-}
-
-protected void associateImpl(String publicIpId, int publicPort, 
Location l, int privatePort) {
-synchronized (mutex) {
-PortMapping mapping = new PortMapping(publicIpId, publicPort, 
l, privatePort);
-PortMapping oldMapping = 
getPortMappingWithPublicSide(publicIpId, publicPort);
-log.debug("associating public port "+publicPort+" on 
"+publicIpId+" with private port "+privatePort+" at "+l+" ("+mapping+")"
-+(oldMapping == null ? "" : " (overwriting 
"+oldMapping+" )"));
-mappings.put(makeKey(publicIpId, publicPort), mapping);
-}
-}
-
-
///
 // Internal only; make protected when deprecated interface method 
removed
 
///
--- End diff --

Can remove TODO now.


---
If your project is set up for it, you can reply to this email and have your
reply appear o

[GitHub] brooklyn-server pull request #318: Delete most deprecated methods from PortF...

2016-09-02 Thread sjcorbett
GitHub user sjcorbett opened a pull request:

https://github.com/apache/brooklyn-server/pull/318

Delete most deprecated methods from PortForwardManager

They've been deprecated since 0.7.0.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/sjcorbett/brooklyn-server pfm-deprecated

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/brooklyn-server/pull/318.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #318


commit fc7708da163aefa28da2ced5990e63aa0cd9050e
Author: Sam Corbett 
Date:   2016-09-02T15:01:21Z

Delete most deprecated methods from PortForwardManager

They've been deprecated since 0.7.0.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---