cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [09/50] [abbrv] git commit: updated refs/heads/vmsync to e2edae1
Date Tue, 18 Jun 2013 03:06:34 GMT
Change listAll to return a boolean and fix a typo

Signed-off-by: Abhinandan Prateek <aprateek@apache.org>


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

Branch: refs/heads/vmsync
Commit: 776301ce6f124767d42fcd58f9c411a002dc310d
Parents: e405703
Author: Ian Duffy <ian@ianduffy.ie>
Authored: Wed Jun 12 17:31:23 2013 +0100
Committer: Abhinandan Prateek <aprateek@apache.org>
Committed: Mon Jun 17 10:23:48 2013 +0530

----------------------------------------------------------------------
 .../api/command/admin/ldap/LDAPConfigCmd.java   | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/776301ce/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java b/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java
index 2976de4..2726f84 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java
@@ -43,10 +43,9 @@ public class LDAPConfigCmd extends BaseCmd  {
     /////////////////////////////////////////////////////
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
-
-    @Parameter(name=ApiConstants.LIST_ALL, type=CommandType.STRING,  description="Hostname
or ip address of the ldap server eg: my.ldap.com")
-    private String listall;
-
+    @Parameter(name=ApiConstants.LIST_ALL, type=CommandType.BOOLEAN,  description="If true
return current LDAP configuration")
+    private Boolean listAll;
+    
     @Parameter(name=ApiConstants.HOST_NAME, type=CommandType.STRING,  description="Hostname
or ip address of the ldap server eg: my.ldap.com")
     private String hostname;
 
@@ -78,10 +77,10 @@ public class LDAPConfigCmd extends BaseCmd  {
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
 
-    public String getListAll() {
-        return listall == null ? "false" : listall;
+    public Boolean getListAll() {
+    	return listAll == null ? Boolean.FALSE : listAll;
     }
-
+    
     public String getBindPassword() {
         return bindPassword;
     }
@@ -156,16 +155,15 @@ public class LDAPConfigCmd extends BaseCmd  {
             InsufficientCapacityException, ServerApiException,
             ConcurrentOperationException, ResourceAllocationException {
           try {
-              if ("true".equalsIgnoreCase(getListAll())){
+              if (getListAll()){
                   // return the existing conf
                   LDAPConfigCmd cmd = _configService.listLDAPConfig(this);
-                  LDAPConfigResponse lr = _responseGenerator.createLDAPConfigResponse(cmd.getHostname(),
cmd.getPort(), cmd.getUseSSL(),
-                          cmd.getQueryFilter(), cmd.getSearchBase(), cmd.getBindDN());
+                  LDAPConfigResponse lr = _responseGenerator.createLDAPConfigResponse(cmd.getHostname(),
cmd.getPort(), cmd.getUseSSL(), cmd.getQueryFilter(), cmd.getSearchBase(), cmd.getBindDN());
                   lr.setResponseName(getCommandName());
                   this.setResponseObject(lr);
               }
               else if (getHostname()==null || getSearchBase() == null || getQueryFilter()
== null) {
-                  throw new InvalidParameterValueException("You need to provide hostname,
serachbase and queryfilter to configure your LDAP server");
+                  throw new InvalidParameterValueException("You need to provide hostname,
searchbase and queryfilter to configure your LDAP server");
               }
               else {
                   boolean result = _configService.updateLDAP(this);


Mime
View raw message