incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [29/54] [abbrv] git commit: Summary: Make canHandle protected
Date Tue, 08 Jan 2013 00:41:19 GMT
Summary: Make canHandle protected

Change access to canHandle so it's easier to unittest. 

Make a note that answers can be null if the host is down, there should
be a way to deal with this, but for now an NPE is an adequate indication
that something is wrong.

Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/6cf0c568
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/6cf0c568
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/6cf0c568

Branch: refs/heads/ui-quick-view-v2
Commit: 6cf0c5683d518bd6dcd6c51bfa0290e96c6804f3
Parents: 9122809
Author: Hugo Trippaers <htrippaers@schubergphilis.com>
Authored: Thu Jan 3 11:47:40 2013 +0100
Committer: Hugo Trippaers <htrippaers@schubergphilis.com>
Committed: Thu Jan 3 11:56:26 2013 +0100

----------------------------------------------------------------------
 .../cloud/network/element/NiciraNvpElement.java    |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6cf0c568/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java
b/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java
index b1e9af2..0a7d042 100644
--- a/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java
+++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java
@@ -173,7 +173,7 @@ public class NiciraNvpElement extends AdapterBase implements
 		return Provider.NiciraNvp;
 	}
 
-	private boolean canHandle(Network network, Service service) {
+	protected boolean canHandle(Network network, Service service) {
 		s_logger.debug("Checking if NiciraNvpElement can handle service "
 				+ service.getName() + " on network " + network.getDisplayText());
 		if (network.getBroadcastDomainType() != BroadcastDomainType.Lswitch) {
@@ -845,6 +845,7 @@ public class NiciraNvpElement extends AdapterBase implements
 			ConfigurePublicIpsOnLogicalRouterCommand cmd = new ConfigurePublicIpsOnLogicalRouterCommand(routermapping.getLogicalRouterUuid(),

 					niciraNvpHost.getDetail("l3gatewayserviceuuid"), cidrs);
 			ConfigurePublicIpsOnLogicalRouterAnswer answer = (ConfigurePublicIpsOnLogicalRouterAnswer)
_agentMgr.easySend(niciraNvpHost.getId(), cmd);
+			//FIXME answer can be null if the host is down
 			return answer.getResult();
 		}
 		else {


Mime
View raw message