639 Commits

Author SHA1 Message Date
Kelven Yang
2c5859dbd4 Bring javelin back to the status of being able to start System VMs after another round of master branch merge 2013-01-18 19:15:32 -08:00
Rohit Yadav
64f13e1cd8 DatabaseCreator: Fast forward merge due to recent pull in merge of master 2013-01-18 18:16:04 -08:00
Rohit Yadav
7fbe935c36 Transaction: Fix static, add method to reinit static datasource off a db props file
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-18 18:08:11 -08:00
Rohit Yadav
e688fbfc24 ScriptRunner: Alternate constructor to get verbosity flag
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-18 18:07:37 -08:00
Rohit Yadav
6214b1d4bd db.properties: adding other key value info for dbcreator to work in a generic way
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-18 17:19:55 -08:00
Alex Huang
10d9c019a9 All merge conflicts resolved 2013-01-18 12:14:57 -08:00
Rohit Yadav
ddf9c6586d Transaction: cosmetics fix
The default data source assumption is that db server is on localhost, port 3306
and has user cloud and password cloud. The static variables rely on hardcoded
db.properties file only. We need to fix it

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-17 19:09:38 -08:00
Kelven Yang
17a94b20ec Always use premium setting in ConsoleProxyManager 2013-01-17 18:23:06 -08:00
Kelven Yang
93985ae191 allow nested injection in ComponentContext 2013-01-17 18:23:06 -08:00
frank
fb050894f5 CloudStack CLOUDSTACK-723
Enhanced baremetal servers support on Cisco UCS

able to dump xmlobject
2013-01-17 16:11:15 -08:00
Rohit Yadav
ef07cde449 DBCreator: Fix ScriptRunner to strip comments, reformat code
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-17 16:10:07 -08:00
Kelven Yang
6d155416c2 System VM can start now with Spring bootstraped management server 2013-01-17 14:22:14 -08:00
Alex Huang
cbb7ff1c32 added missing files 2013-01-17 06:50:59 -08:00
Alex Huang
b751b69c55 Merge branch 'javelin' of https://git-wip-us.apache.org/repos/asf/incubator-cloudstack into javelin 2013-01-17 06:50:19 -08:00
Alex Huang
9759ad57f2 Commit the current changes to unit tests 2013-01-17 06:50:11 -08:00
Min Chen
3dabd5fbf3 Clean up ApiServer, ApiServlet and ApiDispatcher flow to handle various CloudRuntimeException
and CloudException in one place, and Introduced ApiErrorCode to handle CloudStack API error
code to standard Http code mapping.

Signed-off-by: Min Chen <min.chen@citrix.com>
2013-01-16 22:36:34 -08:00
Min Chen
bdcfa1919b Clean up ApiServer, ApiServlet and ApiDispatcher in handling various
exceptions, and Introduced ApiErrorCode to handle CloudStack API error
code to standard Http code mapping.
2013-01-16 21:52:48 -08:00
Kelven Yang
497dcd5044 Get rid of PlugService annotation, replace it with Spring standard injection in command classes 2013-01-16 18:44:44 -08:00
Kelven Yang
2be270de89 Separate loadable components like Gurus, Elements, Adapters to componentContext.xml 2013-01-16 16:33:59 -08:00
frank
53473c07b9 CloudStack CLOUDSTACK-723
Enhanced baremetal servers support on Cisco UCS

introduce an python etree like xml helper.
Ok, this is not a new wheel. Frankly speaking, all Java XML API just suc**.
there are two popular types of XML API in java, one class is for data binding, JAXB,
XStream fall into this category. Another class is tree based, like JDOM, XOM ...

for XML api call, data binding library is painful as you have to specify the schema
that how xml stream converts to java object, which means you have to pre-define all
schemas(xsd file for JAXB, java object for XStream ...). This is not productive, because you
must add new schema when XML document grows.

Tree based library shines in this case, for it's able to dynamically create an object tree
from xml stream without any knowledge of its structure. However, all tree based
XML API library fall into below convention:

Element e = root.getChildElement("child1").getChildElement("child2").getChildElement("child3")...getChildElement("childN")

anything wrong with it???

the sadness is if there is no "child2", you will get a NPE with above code, which means you have to judge
before getting.

And, why so verbose?? why not:

Element e = root.child1.child2.child3...childN ???

Ok I am joking, it's impossible in Java the world knows Java is a static language.

but you can actually do:

Element e = root.get("child1.child2.child3");

or

List<Element> e = root.getAsList("child1.child2.child3")

this is known as XPath style(though XPATH use '/'), python etree has supported it.

so I did this toy for my UCS xml api call, it's quite like etree which is easy to use, for example:

<components.xml>
    <system-integrity-checker class="com.cloud.upgrade.DatabaseUpgradeChecker">
        <checker name="ManagementServerNode" class="com.cloud.cluster.ManagementServerNode"/>
        <checker name="EncryptionSecretKeyChecker" class="com.cloud.utils.crypt.EncryptionSecretKeyChecker"/>
        <checker name="DatabaseIntegrityChecker" class="com.cloud.upgrade.DatabaseIntegrityChecker"/>
        <checker name="DatabaseUpgradeChecker" class="com.cloud.upgrade.PremiumDatabaseUpgradeChecker"/>
    </system-integrity-checker>
</components.xml>

XmlObject xo = XmlObjectParser.parseFromFile("~/components.xml.in");
List<XmlObject> checkers = xo.getAsList("system-integrity-checker.checker");

then you get a list of XmlObject which represent each 'checker' element:

XmlObject firstChecker = checkers.get(0);
// firstChecker.get("name") == "ManagementServerNode"
// firstChecker.get("class") == "com.cloud.cluster.ManagementServerNode"
// firstChecker.getTag() == "checker"
// firstChecker.getText() == "" if it's <checker/>xxx</checker>, then getText() == "xxx"

example 2:
<checker name="ManagementServerNode" class="com.cloud.cluster.ManagementServerNode"/>
    <system-integrity-checker class="com.cloud.upgrade.DatabaseUpgradeChecker">
        <checker name="ManagementServerNode" class="com.cloud.cluster.ManagementServerNode"/>
    </system-integrity-checker>
</components.xml>

yout can do:

XmlObject xo = XmlObjectParser.parseFromFile("~/components.xml.in");
XmlObject checker = xo.get("system-integrity-checker.checker");

then it returns a single object as we only have one "checker" in xml stream,

or you still do

List<XmlObject> checkers = xo.getAsList("system-integrity-checker.checker");

it returns a list which only contains one element of "checker"

if you do:

XmlObject checker = xo.get("system-integrity-checker.checker.this_middle_element_doesnt_exist.some_element");

it returns a null without any exception, so you don't have to worry if a parent element is missing when getting a leaf element

again it's not a new wheel, I just hate JAVA xml api
2013-01-16 16:27:21 -08:00
Kelven Yang
727fab71cb Disable StorageProvider, storageType introduced in Javelin new code, temporarily, to make existing code run 2013-01-16 14:16:01 -08:00
Kelven Yang
4c1257bf18 Handle proxy object situation in dispatching API command 2013-01-16 11:28:09 -08:00
Min Chen
97cb16944f Merge branch 'master' into api_limit 2013-01-15 18:18:34 -08:00
Min Chen
8608925216 Consolidate RuntimeCloudException and CloudRuntimeException into one
class CloudRuntimeException, and removed RuntimeCloudException to avoid
confusion.
2013-01-15 18:07:08 -08:00
Min Chen
4355d06a86 Reuse APIChecker adapter interface for APi Rate limit checking and optimize ApiRateLimitService interface.
Signed-off-by: Min Chen <min.chen@citrix.com>
2013-01-15 15:53:19 -08:00
Kelven Yang
af67d87662 Fix issues with @DB support in Spring environment 2013-01-15 12:35:03 -08:00
Hugo Trippaers
2d69a1855d Summary: Begone pesky tabs 2013-01-15 10:00:58 +01:00
Hugo Trippaers
a0ade283b7 Summary: Add initial support for OpenVswitch to the KVM hypervisor
Create OvsVifDriver to deal with openvswitch specifics for plugging
intefaces

Create a parameter to set the bridge type to use in
LibvirtComputingResource. 
Create several functions to get bridge information from openvswitch

Add a check to detect the libvirt version and throw an exception when
the version is to low ( < 0.9.11 )

Fix classpath loading in Script.findScript to deal with missing path
separators at the end.

Add notification to the BridgeVifDriver that lswitch broadcast type is
not supported.
2013-01-15 09:09:14 +01:00
Rohit Yadav
0a31945ee5 PluggableService: Fix interface to return list of cmd classes
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-14 19:01:26 -08:00
Rohit Yadav
ea3f5ecb54 Fix license for xml files in javelin
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-12 06:31:47 -08:00
Rohit Yadav
38eaa04b98 Pull changes from master into javelin
- Disables simulator plugin, breaks build, available via simulator profile
- Fixes spring injections
- Fix api,acl plugins, ApiServer, ApiDispatcher
- Fix other merge conflicts

Conflicts:
	docs/en-US/external-firewalls-and-load-balancers.xml
	plugins/acl/static-role-based/src/org/apache/cloudstack/acl/StaticRoleBasedAPIAccessChecker.java
	server/src/com/cloud/api/ApiDispatcher.java
	server/src/com/cloud/api/ApiServer.java
	server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
	utils/test/com/cloud/utils/log/CglibThrowableRendererTest.java

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-12 06:02:54 -08:00
Rohit Yadav
7960dd429b utils: Fix getByUuid to accept string arg, it's not gonna be anything else
Due to generic programming, most classes declare Daos with ID as Long, so they
get the getUuid(Long) definition, it has to be getUuid(String), uuid is not
gonna be anything else. Fix GenericDaoBase and GenericDao.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-11 18:44:19 -08:00
Kelven Yang
f57dcaa820 Loadable components to be in separted Spring component bundling 2013-01-11 15:33:15 -08:00
Noa Resare
1033200b0b CLOUDSTACK-933: CglibThrowableRendererTest writing stack traces...
Improve CglibThrowableRenderer test case

Log to a separate Logger instead of the default one to avoid spurious
stack traces in test run output.

Actually verify that registering CglibThrowableRenderer with the
alternative log hierarchy actually removes call trace lines that
contains the string <generated>
2013-01-11 17:09:44 -05:00
Alex Huang
757e1a931b cleanup warnings in utils 2013-01-10 17:19:30 -08:00
Alex Huang
1294cdc701 pulled from master 2013-01-10 16:01:01 -08:00
Alex Huang
d6f44a4d6a merged from master 2013-01-10 15:55:42 -08:00
Rohit Yadav
c4e890c55d PluggableService: Refactor method to return map of key value pairs
- Makes plugins self contained so they decide their properties file format
- PluggableService creates the contract that implementing entity will return a
  properties map which is apiname:rolemask (both are strings)

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-10 15:55:02 -08:00
Rohit Yadav
f2ae0ae5ae PropertiesUtil: Refactor process config file method in utils, return map of key=value
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-10 15:55:01 -08:00
Alex Huang
f922c6fc03 Keep removing 2013-01-10 14:46:52 -08:00
Alex Huang
56e5fbdee2 removed import of componentlocator and inject from all files 2013-01-10 11:44:47 -08:00
Alex Huang
395de6f2b3 merge from latest pull 2013-01-10 11:07:11 -08:00
Alex Huang
f40e7b7511 removed componentlocator and inject 2013-01-10 11:05:20 -08:00
Min Chen
7f8262d45e Remove IdentityProxy and IdentityTypeAdapter class.
Signed-off-by: Min Chen <min.chen@citrix.com>
2013-01-09 17:40:58 -08:00
Kelven Yang
cf5d935d81 Seperate configurable components out and let them be loaded from Spring configuration file 2013-01-09 14:39:16 -08:00
Alex Huang
b6c56736e5 merge from master 2013-01-09 05:20:36 -08:00
Alex Huang
0bcb64605f all built with the latest 2013-01-09 05:02:39 -08:00
Alex Huang
14bd345f1f merge compiles 2013-01-09 04:41:27 -08:00
Rohit Yadav
db297a338f utils: Reflection utilities to get cmd, annotation and fields
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-08 18:54:29 -08:00
Kelven Yang
b274c570f9 Cleanup places that use explicit wiring of the components 2013-01-08 17:45:33 -08:00