brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [12/21] incubator-brooklyn git commit: fail fast if invalid mode given via REST API
Date Sat, 15 Nov 2014 00:05:21 GMT
fail fast if invalid mode given via REST API


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/9edd58db
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/9edd58db
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/9edd58db

Branch: refs/heads/master
Commit: 9edd58db490863e3e34758b31a19e3cb1ed8deae
Parents: ed80567
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Thu Nov 13 17:44:00 2014 +0000
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Thu Nov 13 23:38:55 2014 +0000

----------------------------------------------------------------------
 .../src/main/java/brooklyn/rest/resources/ServerResource.java     | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/9edd58db/usage/rest-server/src/main/java/brooklyn/rest/resources/ServerResource.java
----------------------------------------------------------------------
diff --git a/usage/rest-server/src/main/java/brooklyn/rest/resources/ServerResource.java b/usage/rest-server/src/main/java/brooklyn/rest/resources/ServerResource.java
index ceb688c..b96c1b4 100644
--- a/usage/rest-server/src/main/java/brooklyn/rest/resources/ServerResource.java
+++ b/usage/rest-server/src/main/java/brooklyn/rest/resources/ServerResource.java
@@ -249,6 +249,9 @@ public class ServerResource extends AbstractBrooklynRestResource implements
Serv
 
     @Override
     public ManagementNodeState setHighAvailabilityNodeState(HighAvailabilityMode mode) {
+        if (mode==null)
+            throw new IllegalStateException("Missing parameter: mode");
+        
         HighAvailabilityManager haMgr = mgmt().getHighAvailabilityManager();
         ManagementNodeState existingState = haMgr.getNodeState();
         haMgr.changeMode(mode);


Mime
View raw message