cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [31/50] [abbrv] Bring up to date with master
Date Tue, 03 Sep 2013 11:09:36 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/plugins/user-authenticators/ldap/pom.xml
----------------------------------------------------------------------
diff --cc plugins/user-authenticators/ldap/pom.xml
index a00d189,02752ac..1f9dea0
--- a/plugins/user-authenticators/ldap/pom.xml
+++ b/plugins/user-authenticators/ldap/pom.xml
@@@ -15,96 -23,7 +15,96 @@@
    <parent>
      <groupId>org.apache.cloudstack</groupId>
      <artifactId>cloudstack-plugins</artifactId>
-     <version>4.2.0-SNAPSHOT</version>
+     <version>4.3.0-SNAPSHOT</version>
      <relativePath>../../pom.xml</relativePath>
    </parent>
 +
 +  <build>
 +    <plugins>
 +      <plugin>
 +        <groupId>org.codehaus.gmaven</groupId>
 +        <artifactId>gmaven-plugin</artifactId>
 +        <version>1.3</version>
 +        <configuration>
 +          <providerSelection>1.7</providerSelection>
 +        </configuration>
 +        <executions>
 +          <execution>
 +            <goals>
 +              <goal>compile</goal>
 +              <goal>testCompile</goal>
 +            </goals>
 +            <configuration>
 +              <sources>
 +                <fileset>
 +                  <directory>test/groovy</directory>
 +                  <includes>
 +                    <include>**/*.groovy</include>
 +                  </includes>
 +                </fileset>
 +              </sources>
 +            </configuration>
 +          </execution>
 +        </executions>
 +        <dependencies>
 +          <dependency>
 +            <groupId>org.codehaus.gmaven.runtime</groupId>
 +            <artifactId>gmaven-runtime-1.7</artifactId>
 +            <version>1.3</version>
 +            <exclusions>
 +              <exclusion>
 +                <groupId>org.codehaus.groovy</groupId>
 +                <artifactId>groovy-all</artifactId>
 +              </exclusion>
 +            </exclusions>
 +          </dependency>
 +          <dependency>
 +            <groupId>org.codehaus.groovy</groupId>
 +            <artifactId>groovy-all</artifactId>
 +            <version>2.0.5</version>
 +          </dependency>
 +        </dependencies>
 +      </plugin>
 +      <plugin>
 +        <groupId>org.apache.maven.plugins</groupId>
 +        <artifactId>maven-surefire-plugin</artifactId>
 +        <configuration>
 +          <includes>
 +            <include>**/*Spec*</include>
 +          </includes>
 +        </configuration>
 +      </plugin>
 +
 +      <plugin>
 +        <groupId>com.btmatthews.maven.plugins</groupId>
 +        <artifactId>ldap-maven-plugin</artifactId>
 +        <version>1.1.0</version>
 +        <configuration>
 +          <monitorPort>11389</monitorPort>
 +            <monitorKey>ldap</monitorKey>
 +            <daemon>false</daemon>
 +            <rootDn>dc=cloudstack,dc=org</rootDn>
 +            <ldapPort>10389</ldapPort>
 +            <ldifFile>test/resources/cloudstack.org.ldif</ldifFile>
 +        </configuration>
 +      </plugin>
 +
 +    </plugins>
 +  </build>
 +
 +  <dependencies>
 +    <!-- Mandatory dependencies for using Spock -->
 +    <dependency>
 +      <groupId>org.spockframework</groupId>
 +      <artifactId>spock-core</artifactId>
 +      <version>0.7-groovy-2.0</version>
 +    </dependency>
 +
 +    <!-- Optional dependencies for using Spock -->
 +    <dependency> <!-- enables mocking of classes (in addition to interfaces) -->
 +      <groupId>cglib</groupId>
 +      <artifactId>cglib-nodep</artifactId>
 +      <version>2.2</version>
 +    </dependency>
 +  </dependencies>
  </project>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapConfiguration.java
----------------------------------------------------------------------
diff --cc plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapConfiguration.java
index 5e56c21,0000000..0cfb37c
mode 100644,000000..100644
--- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapConfiguration.java
+++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapConfiguration.java
@@@ -1,145 -1,0 +1,145 @@@
 +// Licensed to the Apache Software Foundation (ASF) under one
 +// or more contributor license agreements.  See the NOTICE file
 +// distributed with this work for additional information
 +// regarding copyright ownership.  The ASF licenses this file
 +// to you under the Apache License, Version 2.0 (the
 +// "License"); you may not use this file except in compliance
 +// with the License.  You may obtain a copy of the License at
 +//
 +//   http://www.apache.org/licenses/LICENSE-2.0
 +//
 +// Unless required by applicable law or agreed to in writing,
 +// software distributed under the License is distributed on an
 +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 +// KIND, either express or implied.  See the License for the
 +// specific language governing permissions and limitations
 +// under the License.
 +package org.apache.cloudstack.ldap;
 +
 +import java.util.List;
 +
 +import javax.inject.Inject;
 +import javax.naming.directory.SearchControls;
 +
 +import org.apache.cloudstack.api.command.LdapListConfigurationCmd;
 +
- import com.cloud.configuration.dao.ConfigurationDao;
++import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 +import com.cloud.utils.Pair;
 +
 +public class LdapConfiguration {
 +	private final static String factory = "com.sun.jndi.ldap.LdapCtxFactory";
 +
 +	private final static int scope = SearchControls.SUBTREE_SCOPE;
 +
 +	@Inject
 +	private ConfigurationDao _configDao;
 +
 +	@Inject
 +	private LdapManager _ldapManager;
 +
 +	public LdapConfiguration() {
 +	}
 +
 +	public LdapConfiguration(final ConfigurationDao configDao,
 +			final LdapManager ldapManager) {
 +		_configDao = configDao;
 +		_ldapManager = ldapManager;
 +	}
 +
 +	public String getAuthentication() {
 +		if ((getBindPrincipal() == null) && (getBindPassword() == null)) {
 +			return "none";
 +		} else {
 +			return "simple";
 +		}
 +	}
 +
 +	public String getBaseDn() {
 +		return _configDao.getValue("ldap.basedn");
 +	}
 +
 +	public String getBindPassword() {
 +		return _configDao.getValue("ldap.bind.password");
 +	}
 +
 +	public String getBindPrincipal() {
 +		return _configDao.getValue("ldap.bind.principal");
 +	}
 +
 +	public String getEmailAttribute() {
 +		final String emailAttribute = _configDao
 +				.getValue("ldap.email.attribute");
 +		return emailAttribute == null ? "mail" : emailAttribute;
 +	}
 +
 +	public String getFactory() {
 +		return factory;
 +	}
 +
 +	public String getFirstnameAttribute() {
 +		final String firstnameAttribute = _configDao
 +				.getValue("ldap.firstname.attribute");
 +		return firstnameAttribute == null ? "givenname" : firstnameAttribute;
 +	}
 +
 +	public String getLastnameAttribute() {
 +		final String lastnameAttribute = _configDao
 +				.getValue("ldap.lastname.attribute");
 +		return lastnameAttribute == null ? "sn" : lastnameAttribute;
 +	}
 +
 +	public String getProviderUrl() {
 +		final String protocol = getSSLStatus() == true ? "ldaps://" : "ldap://";
 +		final Pair<List<? extends LdapConfigurationVO>, Integer> result = _ldapManager
 +				.listConfigurations(new LdapListConfigurationCmd(_ldapManager));
 +		final StringBuilder providerUrls = new StringBuilder();
 +		String delim = "";
 +		for (final LdapConfigurationVO resource : result.first()) {
 +			final String providerUrl = protocol + resource.getHostname() + ":"
 +					+ resource.getPort();
 +			providerUrls.append(delim).append(providerUrl);
 +			delim = " ";
 +		}
 +		return providerUrls.toString();
 +	}
 +
 +	public String[] getReturnAttributes() {
 +		return new String[] { getUsernameAttribute(), getEmailAttribute(),
 +				getFirstnameAttribute(), getLastnameAttribute() };
 +	}
 +
 +	public int getScope() {
 +		return scope;
 +	}
 +
 +	public String getSearchGroupPrinciple() {
 +		return _configDao.getValue("ldap.search.group.principle");
 +	}
 +
 +	public boolean getSSLStatus() {
 +		boolean sslStatus = false;
 +		if (getTrustStore() != null && getTrustStorePassword() != null) {
 +			sslStatus = true;
 +		}
 +		return sslStatus;
 +	}
 +
 +	public String getTrustStore() {
 +		return _configDao.getValue("ldap.truststore");
 +	}
 +
 +	public String getTrustStorePassword() {
 +		return _configDao.getValue("ldap.truststore.password");
 +	}
 +
 +	public String getUsernameAttribute() {
 +		final String usernameAttribute = _configDao
 +				.getValue("ldap.username.attribute");
 +		return usernameAttribute == null ? "uid" : usernameAttribute;
 +	}
 +
 +	public String getUserObject() {
 +		final String userObject = _configDao.getValue("ldap.user.object");
 +		return userObject == null ? "inetOrgPerson" : userObject;
 +	}
 +}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/plugins/user-authenticators/ldap/test/groovy/org/apache/cloudstack/ldap/LdapConfigurationSpec.groovy
----------------------------------------------------------------------
diff --cc plugins/user-authenticators/ldap/test/groovy/org/apache/cloudstack/ldap/LdapConfigurationSpec.groovy
index bb86625,0000000..c593959
mode 100644,000000..100644
--- a/plugins/user-authenticators/ldap/test/groovy/org/apache/cloudstack/ldap/LdapConfigurationSpec.groovy
+++ b/plugins/user-authenticators/ldap/test/groovy/org/apache/cloudstack/ldap/LdapConfigurationSpec.groovy
@@@ -1,223 -1,0 +1,223 @@@
 +// Licensed to the Apache Software Foundation (ASF) under one
 +// or more contributor license agreements.  See the NOTICE file
 +// distributed with this work for additional information
 +// regarding copyright ownership.  The ASF licenses this file
 +// to you under the Apache License, Version 2.0 (the
 +// "License"); you may not use this file except in compliance
 +// with the License.  You may obtain a copy of the License at
 +//
 +//   http://www.apache.org/licenses/LICENSE-2.0
 +//
 +// Unless required by applicable law or agreed to in writing,
 +// software distributed under the License is distributed on an
 +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 +// KIND, either express or implied.  See the License for the
 +// specific language governing permissions and limitations
 +// under the License.
 +package groovy.org.apache.cloudstack.ldap
 +
- import com.cloud.configuration.dao.ConfigurationDao
++import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 +import com.cloud.utils.Pair
 +import org.apache.cloudstack.api.ServerApiException
 +import org.apache.cloudstack.ldap.LdapConfiguration
 +import org.apache.cloudstack.ldap.LdapConfigurationVO
 +import org.apache.cloudstack.ldap.LdapManager
 +
 +import javax.naming.directory.SearchControls
 +
 +class LdapConfigurationSpec extends spock.lang.Specification {
 +    def "Test that getAuthentication returns none"() {
 +		given: "We have a ConfigDao, LdapManager and LdapConfiguration"
 +		def configDao = Mock(ConfigurationDao)
 +		def ldapManager = Mock(LdapManager)
 +		def ldapConfiguration = new LdapConfiguration(configDao, ldapManager)
 +		when: "Get authentication is called"
 +		String authentication = ldapConfiguration.getAuthentication()
 +		then: "none should be returned"
 +		authentication == "none"
 +    }
 +
 +    def "Test that getAuthentication returns simple"() {
 +	given: "We have a configDao, LdapManager and LdapConfiguration with bind principle and
password set"
 +        def configDao = Mock(ConfigurationDao)
 +        def ldapManager = Mock(LdapManager)
 +        def ldapConfiguration = new LdapConfiguration(configDao, ldapManager)
 +        configDao.getValue("ldap.bind.password") >> "password"
 +        configDao.getValue("ldap.bind.principal") >> "cn=rmurphy,dc=cloudstack,dc=org"
 +		when: "Get authentication is called"
 +        String authentication = ldapConfiguration.getAuthentication()
 +		then: "authentication should be set to simple"
 +		authentication == "simple"
 +    }
 +
 +    def "Test that getBaseDn returns dc=cloudstack,dc=org"() {
 +		given: "We have a ConfigDao, LdapManager and ldapConfiguration with a baseDn value set."
 +		def configDao = Mock(ConfigurationDao)
 +		configDao.getValue("ldap.basedn") >> "dc=cloudstack,dc=org"
 +		def ldapManager = Mock(LdapManager)
 +		def ldapConfiguration = new LdapConfiguration(configDao, ldapManager)
 +		when: "Get basedn is called"
 +		String baseDn = ldapConfiguration.getBaseDn();
 +		then: "The set baseDn should be returned"
 +		baseDn == "dc=cloudstack,dc=org"
 +    }
 +
 +    def "Test that getEmailAttribute returns mail"() {
 +		given: "Given that we have a ConfigDao, LdapManager and LdapConfiguration"
 +        def configDao = Mock(ConfigurationDao)
 +        configDao.getValue("ldap.email.attribute") >> "mail"
 +        def ldapManager = Mock(LdapManager)
 +        def ldapConfiguration = new LdapConfiguration(configDao, ldapManager)
 +		when: "Get Email Attribute is called"
 +        String emailAttribute = ldapConfiguration.getEmailAttribute()
 +		then: "mail should be returned"
 +		emailAttribute == "mail"
 +    }
 +
 +    def "Test that getFactory returns com.sun.jndi.ldap.LdapCtxFactory"() {
 +		given: "We have a ConfigDao, LdapManager and LdapConfiguration"
 +		def configDao = Mock(ConfigurationDao)
 +		def ldapManager = Mock(LdapManager)
 +		def ldapConfiguration = new LdapConfiguration(configDao, ldapManager)
 +		when: "Get Factory is scalled"
 +		String factory = ldapConfiguration.getFactory();
 +		then: "com.sun.jndi.ldap.LdapCtxFactory is returned"
 +		factory == "com.sun.jndi.ldap.LdapCtxFactory"
 +    }
 +
 +    def "Test that getFirstnameAttribute returns givenname"() {
 +		given: "We have a ConfigDao, LdapManager and LdapConfiguration"
 +        def configDao = Mock(ConfigurationDao)
 +        configDao.getValue("ldap.firstname.attribute") >> "givenname"
 +        def ldapManager = Mock(LdapManager)
 +        def ldapConfiguration = new LdapConfiguration(configDao, ldapManager)
 +		when: "Get firstname attribute is called"
 +        String firstname = ldapConfiguration.getFirstnameAttribute()
 +		then: "givennam should be returned"
 +        firstname == "givenname"
 +    }
 +
 +    def "Test that getLastnameAttribute returns givenname"() {
 +		given: "We have a ConfigDao, LdapManager and LdapConfiguration"
 +        def configDao = Mock(ConfigurationDao)
 +        configDao.getValue("ldap.lastname.attribute") >> "sn"
 +        def ldapManager = Mock(LdapManager)
 +        def ldapConfiguration = new LdapConfiguration(configDao, ldapManager)
 +		when: "Get Lastname Attribute is scalled "
 +        String lastname = ldapConfiguration.getLastnameAttribute()
 +		then: "sn should be returned"
 +		lastname == "sn"
 +    }
 +
 +    def "Test that getReturnAttributes returns the correct data"() {
 +		given: "We have a ConfigDao, LdapManager and LdapConfiguration"
 +		def configDao = Mock(ConfigurationDao)
 +        configDao.getValue("ldap.firstname.attribute") >> "givenname"
 +        configDao.getValue("ldap.lastname.attribute") >> "sn"
 +        configDao.getValue("ldap.username.attribute") >> "uid"
 +        configDao.getValue("ldap.email.attribute") >> "mail"
 +        def ldapManager = Mock(LdapManager)
 +        def ldapConfiguration = new LdapConfiguration(configDao, ldapManager)
 +		when: "Get return attributes is called"
 +        String[] returnAttributes = ldapConfiguration.getReturnAttributes()
 +		then: "An array containing uid, mail, givenname and sn is returned"
 +        returnAttributes == ["uid", "mail", "givenname", "sn"]
 +    }
 +
 +    def "Test that getScope returns SearchControls.SUBTREE_SCOPE"() {
 +		given: "We have ConfigDao, LdapManager and LdapConfiguration"
 +        def configDao = Mock(ConfigurationDao)
 +        def ldapManager = Mock(LdapManager)
 +        def ldapConfiguration = new LdapConfiguration(configDao, ldapManager)
 +		when: "Get scope is called"
 +        int scope = ldapConfiguration.getScope()
 +		then: "SearchControls.SUBTRE_SCOPE should be returned"
 +		scope == SearchControls.SUBTREE_SCOPE;
 +    }
 +
 +    def "Test that getUsernameAttribute returns uid"() {
 +		given: "We have ConfigDao, LdapManager and LdapConfiguration"
 +		def configDao = Mock(ConfigurationDao)
 +		configDao.getValue("ldap.username.attribute") >> "uid"
 +		def ldapManager = Mock(LdapManager)
 +		def ldapConfiguration = new LdapConfiguration(configDao, ldapManager)
 +		when: "Get Username Attribute is called"
 +		String usernameAttribute = ldapConfiguration.getUsernameAttribute()
 +		then: "uid should be returned"
 +		usernameAttribute == "uid"
 +    }
 +
 +    def "Test that getUserObject returns inetOrgPerson"() {
 +		given: "We have a ConfigDao, LdapManager and LdapConfiguration"
 +		def configDao = Mock(ConfigurationDao)
 +		configDao.getValue("ldap.user.object") >> "inetOrgPerson"
 +		def ldapManager = Mock(LdapManager)
 +		def ldapConfiguration = new LdapConfiguration(configDao, ldapManager)
 +		when: "Get user object is called"
 +		String userObject = ldapConfiguration.getUserObject()
 +		then: "inetOrgPerson is returned"
 +		userObject == "inetOrgPerson"
 +    }
 +
 +    def "Test that providerUrl successfully returns a URL when a configuration is available"()
{
 +		given: "We have a ConfigDao, LdapManager, LdapConfiguration"
 +		def configDao = Mock(ConfigurationDao)
 +		def ldapManager = Mock(LdapManager)
 +		List<LdapConfigurationVO> ldapConfigurationList = new ArrayList()
 +		ldapConfigurationList.add(new LdapConfigurationVO("localhost", 389))
 +		Pair<List<LdapConfigurationVO>, Integer> result = new Pair<List<LdapConfigurationVO>,
Integer>();
 +		result.set(ldapConfigurationList, ldapConfigurationList.size())
 +		ldapManager.listConfigurations(_) >> result
 +
 +		LdapConfiguration ldapConfiguration = new LdapConfiguration(configDao, ldapManager)
 +
 +		when: "A request is made to get the providerUrl"
 +		String providerUrl = ldapConfiguration.getProviderUrl()
 +
 +		then: "The providerUrl should be given."
 +		providerUrl == "ldap://localhost:389"
 +    }
 +
 +	def "Test that get search group principle returns successfully"() {
 +		given: "We have a ConfigDao with a value for ldap.search.group.principle and an LdapConfiguration"
 +		def configDao = Mock(ConfigurationDao)
 +		configDao.getValue("ldap.search.group.principle") >> "cn=cloudstack,cn=users,dc=cloudstack,dc=org"
 +		def ldapManager = Mock(LdapManager)
 +		LdapConfiguration ldapConfiguration = new LdapConfiguration(configDao, ldapManager)
 +
 +		when: "A request is made to get the search group principle"
 +		String result = ldapConfiguration.getSearchGroupPrinciple();
 +
 +		then: "The result holds the same value configDao did"
 +		result == "cn=cloudstack,cn=users,dc=cloudstack,dc=org"
 +	}
 +
 +	def "Test that getTrustStorePassword resopnds"() {
 +		given: "We have a ConfigDao with a value for truststore password"
 +		def configDao = Mock(ConfigurationDao)
 +		configDao.getValue("ldap.truststore.password") >> "password"
 +		def ldapManager = Mock(LdapManager)
 +		LdapConfiguration ldapConfiguration = new LdapConfiguration(configDao, ldapManager)
 +
 +		when: "A request is made to get the truststore password"
 +		String result = ldapConfiguration.getTrustStorePassword()
 +
 +		then: "The result is password"
 +		result == "password";
 +	}
 +
 +	def "Test that getSSLStatus can be true"() {
 +		given: "We have a ConfigDao with values for truststore and truststore password set"
 +		def configDao = Mock(ConfigurationDao)
 +		configDao.getValue("ldap.truststore") >> "/tmp/ldap.ts"
 +		configDao.getValue("ldap.truststore.password") >> "password"
 +		def ldapManager = Mock(LdapManager)
 +		LdapConfiguration ldapConfiguration = new LdapConfiguration(configDao, ldapManager)
 +
 +		when: "A request is made to get the status of SSL"
 +		boolean result = ldapConfiguration.getSSLStatus();
 +
 +		then: "The response should be true"
 +		result == true
 +	}
 +}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/server/src/com/cloud/configuration/Config.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 1243fb8,5550237..2fdc9f2
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@@ -39,11 -40,11 +40,8 @@@ import javax.naming.NamingException
  import javax.naming.directory.DirContext;
  import javax.naming.directory.InitialDirContext;
  
- import org.apache.log4j.Logger;
- import org.springframework.stereotype.Component;
- 
  import org.apache.cloudstack.acl.SecurityChecker;
 -import org.apache.cloudstack.api.ApiConstants.LDAPParams;
  import org.apache.cloudstack.api.command.admin.config.UpdateCfgCmd;
 -import org.apache.cloudstack.api.command.admin.ldap.LDAPConfigCmd;
 -import org.apache.cloudstack.api.command.admin.ldap.LDAPRemoveCmd;
  import org.apache.cloudstack.api.command.admin.network.CreateNetworkOfferingCmd;
  import org.apache.cloudstack.api.command.admin.network.DeleteNetworkOfferingCmd;
  import org.apache.cloudstack.api.command.admin.network.UpdateNetworkOfferingCmd;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --cc server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
index 29b899c,74211d4..3ec146b
--- a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
@@@ -25,7 -25,11 +25,9 @@@ import javax.inject.Inject
  import javax.naming.ConfigurationException;
  import javax.naming.NamingException;
  
+ import org.springframework.stereotype.Component;
+ 
  import org.apache.cloudstack.api.command.admin.config.UpdateCfgCmd;
 -import org.apache.cloudstack.api.command.admin.ldap.LDAPConfigCmd;
 -import org.apache.cloudstack.api.command.admin.ldap.LDAPRemoveCmd;
  import org.apache.cloudstack.api.command.admin.network.CreateNetworkOfferingCmd;
  import org.apache.cloudstack.api.command.admin.network.DeleteNetworkOfferingCmd;
  import org.apache.cloudstack.api.command.admin.network.UpdateNetworkOfferingCmd;
@@@ -371,15 -319,33 +317,6 @@@ public class MockConfigurationManagerIm
      }
  
      /* (non-Javadoc)
-      * @see com.cloud.configuration.ConfigurationService#getDiskOffering(long)
-      */
-     @Override
-     public DiskOffering getDiskOffering(long diskOfferingId) {
-         // TODO Auto-generated method stub
-         return null;
-     }
- 
-     /* (non-Javadoc)
 -     * @see com.cloud.configuration.ConfigurationService#updateLDAP(org.apache.cloudstack.api.commands.LDAPConfigCmd)
 -     */
 -    @Override
 -    public boolean updateLDAP(LDAPConfigCmd cmd) throws NamingException {
 -        // TODO Auto-generated method stub
 -        return false;
 -    }
 -
 -    /* (non-Javadoc)
 -     * @see com.cloud.configuration.ConfigurationService#removeLDAP(org.apache.cloudstack.api.commands.LDAPRemoveCmd)
 -     */
 -    @Override
 -    public boolean removeLDAP(LDAPRemoveCmd cmd) {
 -        // TODO Auto-generated method stub
 -        return false;
 -    }
 -
 -    /* (non-Javadoc)
 -     * @see com.cloud.configuration.ConfigurationService#listLDAPConfig(org.apache.cloudstack.api.commands.LDAPConfigCmd)
 -     */
 -    @Override
 -    public LDAPConfigCmd listLDAPConfig(LDAPConfigCmd cmd) {
 -        // TODO Auto-generated method stub
 -        return null;
 -    }
 -
 -    /* (non-Javadoc)
       * @see com.cloud.configuration.ConfigurationService#isOfferingForVpc(com.cloud.offering.NetworkOffering)
       */
      @Override
@@@ -655,4 -576,4 +547,4 @@@
  	}
  
  
--}
++}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --cc setup/db/db/schema-410to420.sql
index 43c6c74,6be91ea..ad3076f
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@@ -2142,36 -2241,69 +2241,89 @@@ CREATE VIEW `cloud`.`project_view` A
              left join
          `cloud`.`project_account` pacct ON projects.id = pacct.project_id;
  
+ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server',
'network.loadbalancer.haproxy.max.conn', '4096', 'Load Balancer(haproxy) maximum number of
concurrent connections(global max)');
+ 
+ ALTER TABLE `cloud`.`network_offerings` ADD COLUMN `concurrent_connections` int(10) unsigned
COMMENT 'Load Balancer(haproxy) maximum number of concurrent connections(global max)';
+ 
+         
+ ALTER TABLE `cloud`.`sync_queue` MODIFY `queue_size` smallint(6) NOT NULL DEFAULT '0' COMMENT
'number of items being processed by the queue';
+ ALTER TABLE `cloud`.`sync_queue` MODIFY `queue_size_limit` smallint(6) NOT NULL DEFAULT
'1' COMMENT 'max number of items the queue can process concurrently';
+ 
+ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server',
'ucs.sync.blade.interval', '3600', 'the interval cloudstack sync with UCS manager for available
blades in case user remove blades from chassis without notifying CloudStack');
+ 
+ ALTER TABLE `cloud`.`usage_event` ADD COLUMN `virtual_size` bigint unsigned;
+ ALTER TABLE `cloud_usage`.`usage_event` ADD COLUMN `virtual_size` bigint unsigned;
+ ALTER TABLE `cloud_usage`.`usage_storage` ADD COLUMN `virtual_size` bigint unsigned;
+ ALTER TABLE `cloud_usage`.`cloud_usage` ADD COLUMN `virtual_size` bigint unsigned;
+ 
+ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server',
'kvm.ssh.to.agent', 'true', 'Specify whether or not the management server is allowed to SSH
into KVM Agents');
+ 
+ #update the account_vmstats_view - count only user vms
+ DROP VIEW IF EXISTS `cloud`.`account_vmstats_view`;
+ CREATE VIEW `cloud`.`account_vmstats_view` AS
+     SELECT 
+         account_id, state, count(*) as vmcount
+     from
+         `cloud`.`vm_instance`
+     where
+         vm_type = 'User'
+     group by account_id , state;
+ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server',
'network.loadbalancer.haproxy.max.conn', '4096', 'Load Balancer(haproxy) maximum number of
concurrent connections(global max)');
+ 
+ 
+ DROP TABLE IF EXISTS `cloud_usage`.`usage_vmsnapshot`;
+ CREATE TABLE `cloud_usage`.`usage_vmsnapshot` (
+   `id` bigint(20) unsigned NOT NULL,
+   `zone_id` bigint(20) unsigned NOT NULL,
+   `account_id` bigint(20) unsigned NOT NULL,
+   `domain_id` bigint(20) unsigned NOT NULL,
+   `vm_id` bigint(20) unsigned NOT NULL,
+   `disk_offering_id` bigint(20) unsigned,
+   `size` bigint(20),
+   `created` datetime NOT NULL,
+   `processed` datetime,
+   INDEX `i_usage_vmsnapshot` (`account_id`,`id`,`vm_id`,`created`)
+ ) ENGINE=InnoDB CHARSET=utf8;
+ 
+ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server',
'healthcheck.update.interval', '600', 'Time Interval to fetch the LB health check states (in
sec)');
+ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Snapshots', 'DEFAULT', 'SnapshotManager',
'kvm.snapshot.enabled', 'false', 'whether snapshot is enabled for KVM hosts');
+ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server',
'eip.use.multiple.netscalers', 'false', 'Should be set to true, if there will be multiple
NetScaler devices providing EIP service in a zone');
+ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Snapshots', 'DEFAULT', 'SnapshotManager',
'snapshot.backup.rightafter', 'true', 'backup snapshot right after snapshot is taken');
+ 
+ DELETE FROM `cloud`.`configuration` where name='vmware.guest.vswitch';
+ DELETE FROM `cloud`.`configuration` where name='vmware.private.vswitch';
+ DELETE FROM `cloud`.`configuration` where name='vmware.public.vswitch';
+ 
+ 
+ UPDATE `cloud`.`autoscale_vmgroups` set uuid=id WHERE uuid is NULL;
+ UPDATE `cloud`.`autoscale_vmprofiles` set uuid=id WHERE uuid is NULL;
+ UPDATE `cloud`.`autoscale_policies` set uuid=id WHERE uuid is NULL;
+ UPDATE `cloud`.`counter` set uuid=id WHERE uuid is NULL;
+ UPDATE `cloud`.`conditions` set uuid=id WHERE uuid is NULL;
+ update `cloud`.`configuration` set component = 'SnapshotManager' where category = 'Snapshots'
and component = 'none';
+ 
+ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'management-server',
'storage.cache.replacement.lru.interval', '30', 'time interval for unused data on cache storage
(in days).');
+ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'management-server',
'storage.cache.replacement.enabled', 'true', 'enable or disable cache storage replacement
algorithm.');
+ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'management-server',
'storage.cache.replacement.interval', '86400', 'time interval between cache replacement threads
(in seconds).');
+ INSERT IGNORE INTO `cloud`.`configuration` VALUES ("Advanced", 'DEFAULT', 'management-server',
'vmware.nested.virtualization', 'false', 'When set to true this will enable nested virtualization
when this is supported by the hypervisor');
+ 
 +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server',
'ldap.bind.principal', NULL, 'Specifies the bind principal to use for bind to LDAP');
 +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server',
'ldap.bind.password', NULL, 'Specifies the password to use for binding to LDAP');
 +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server',
'ldap.username.attribute', 'uid', 'Sets the username attribute used within LDAP');
 +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server',
'ldap.email.attribute', 'mail', 'Sets the email attribute used within LDAP');
 +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server',
'ldap.firstname.attribute', 'givenname', 'Sets the firstname attribute used within LDAP');
 +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server',
'ldap.lastname.attribute', 'sn', 'Sets the lastname attribute used within LDAP');
 +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server',
'ldap.user.object', 'inetOrgPerson', 'Sets the object type of users within LDAP');
 +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server',
'ldap.basedn', NULL, 'Sets the basedn for LDAP');
 +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server',
'ldap.search.group.principle', NULL, 'Sets the principle of the group that users must be a
member of');
 +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server',
'ldap.truststore', NULL, 'Sets the path to the truststore to use for LDAP SSL');
 +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server',
'ldap.truststore.password', NULL, 'Sets the password for the truststore');
 +
 +
 +CREATE TABLE `cloud`.`ldap_configuration` (
 +  `id` bigint unsigned NOT NULL auto_increment COMMENT 'id',
 +  `hostname` varchar(255) NOT NULL COMMENT 'the hostname of the ldap server',
 +  `port` int(10) COMMENT 'port that the ldap server is listening on',
 +  PRIMARY KEY  (`id`)
 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 +
- INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server',
'network.loadbalancer.haproxy.max.conn', '4096', 'Load Balancer(haproxy) maximum number of
concurrent connections(global max)');
- 
- ALTER TABLE `cloud`.`network_offerings` ADD COLUMN `concurrent_connections` int(10) unsigned
COMMENT 'Load Balancer(haproxy) maximum number of concurrent connections(global max)';
- 
- ALTER TABLE `cloud`.`sync_queue` MODIFY `queue_size` smallint(6) NOT NULL DEFAULT '0' COMMENT
'number of items being processed by the queue';
- ALTER TABLE `cloud`.`sync_queue` MODIFY `queue_size_limit` smallint(6) NOT NULL DEFAULT
'1' COMMENT 'max number of items the queue can process concurrently';
- 
- INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server',
'ucs.sync.blade.interval', '3600', 'the interval cloudstack sync with UCS manager for available
blades in case user remove blades from chassis without notifying CloudStack');
- 
- ALTER TABLE `cloud`.`usage_event` ADD COLUMN `virtual_size` bigint unsigned;
- ALTER TABLE `cloud_usage`.`usage_event` ADD COLUMN `virtual_size` bigint unsigned;
- ALTER TABLE `cloud_usage`.`usage_storage` ADD COLUMN `virtual_size` bigint unsigned;
- ALTER TABLE `cloud_usage`.`cloud_usage` ADD COLUMN `virtual_size` bigint unsigned;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/tools/apidoc/gen_toc.py
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/ui/css/cloudstack3.css
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/ui/dictionary.jsp
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/ui/index.jsp
----------------------------------------------------------------------
diff --cc ui/index.jsp
index e193c22,0ac48c9..086495a
--- a/ui/index.jsp
+++ b/ui/index.jsp
@@@ -429,10 -443,10 +443,10 @@@ under the License
                        <span wizard-field="default-network" conditional-field="select-network"></span>
                      </div>
                      <div class="edit">
-                       <a href="5"><fmt:message key="label.edit"/></a>
+                       <a href="6"><fmt:message key="label.edit"/></a>
                      </div>
                    </div>
 -                  
 +
                    <!-- Security groups -->
                    <div class="select odd">
                      <div class="name">

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/ui/scripts/accounts.js
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/ui/scripts/autoscaler.js
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/ui/scripts/globalSettings.js
----------------------------------------------------------------------
diff --cc ui/scripts/globalSettings.js
index 48b71d4,bee6ae3..d703e64
--- a/ui/scripts/globalSettings.js
+++ b/ui/scripts/globalSettings.js
@@@ -329,4 -440,4 +329,4 @@@
              }
          }
      };
--})(cloudStack);
++})(cloudStack);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/ui/scripts/system.js
----------------------------------------------------------------------
diff --cc ui/scripts/system.js
index 56eaec3,78f0242..6a4f606
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@@ -16643,4 -16253,4 +16253,4 @@@
  
          return [];
      };
--})($, cloudStack);
++})($, cloudStack);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/ui/scripts/ui/dialog.js
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/ui/scripts/ui/widgets/listView.js
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/ui/scripts/ui/widgets/multiEdit.js
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdba0dde/ui/scripts/zoneWizard.js
----------------------------------------------------------------------
diff --cc ui/scripts/zoneWizard.js
index 15fedb5,0ecddee..de319d5
--- a/ui/scripts/zoneWizard.js
+++ b/ui/scripts/zoneWizard.js
@@@ -4320,4 -4261,4 +4261,4 @@@
              });
          }
      };
--}(cloudStack, jQuery));
++}(cloudStack, jQuery));


Mime
View raw message