251 Commits

Author SHA1 Message Date
Rohit Yadav
ed0637b8c2 api: Refactor move acl to org.apache.cloudstack
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-06 15:30:58 -08:00
Rohit Yadav
63481ecb34 CLOUDSTACK-212: Move api response classes to cloud-api under org.apache.cloudstack
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-05 16:27:36 -08:00
Rohit Yadav
5119785cf7 Get latest changes, merge branch 'master' into api_refactoring
Conflicts:
	api/src/com/cloud/network/element/RemoteAccessVPNServiceProvider.java
	server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
	server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
	setup/db/db/schema-40to410.sql

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-04 22:21:20 -08:00
Sheng Yang
42c8c73ab6 CLOUDSTACK-306: Introducing IpDeployingRequester and implement inline mode
For LB device in inline mode, the ip deployer(the owner of public ip) is the
firewall in front of it, not itself. So check if it's inline or not, if it's
inline, return the firewall as ip deployer
2013-01-04 19:18:03 -08:00
Sheng Yang
177e157cbf CLOUDSTACK-306: Move inline mode parameter from device to network offering
One F5 device can be used as inline and side-by-side at the same time(for
different networks). So we can define inline or not on network base.
2013-01-04 19:17:58 -08:00
Sheng Yang
717f9dcd4d CLOUDSTACK-306: Implement SRX firewall
Use SRX firewall filter as SRX firewall. The old security policy mechanism
cannot be used as IP based. This would enable SRX's ability to control traffic
for F5 behind it.
2013-01-04 19:17:50 -08:00
Rohit Yadav
596f9d0905 api: Annotate netscaler apis, remove IdentityMapper from everywhere
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-04 17:09:40 -08:00
Rohit Yadav
65a1284e83 srx: Annotate api classes, remove IdentityMapper
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-04 17:00:10 -08:00
Rohit Yadav
4dd5f14e76 f5: Annotate f5 cmd classes, remove IdentityMapper
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-04 16:49:27 -08:00
Rohit Yadav
a2f8f42575 nicira-nvp: Annotate nvp plugin, remove IdentityMapper
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-04 16:33:40 -08:00
Chiradeep Vittal
e37f458a8d Rationalize the interface by injecting all service providers by the service provider interface instead of assuming everybody implements NetworkElement. This is step 2 and includes all the plugins
import cleanups - remove unneeded and add explicit classes

Signed-off-by: Chiradeep Vittal <chiradeep@apache.org>
2013-01-04 15:13:47 -08:00
Kelven Yang
2e9c55f8f6 More Spring issues to bootstrape javalin server 2013-01-04 14:25:12 -08:00
Chiradeep Vittal
b0a1a47d48 Not all network service providers need to be NetworkElements. NetworkElements are only those that are interested in L2 events. Since only NetworkElements were injected, and only in NetworkManagerImpl, this has led to all kinds of contortions. As a first step, enable individual service providers to be injected.
Signed-off-by: Chiradeep Vittal <chiradeep@apache.org>
2013-01-04 12:14:49 -08:00
Rohit Yadav
edb00bb613 Merge branch 'master' into api_refactoring 2013-01-03 08:32:56 -08:00
Hugo Trippaers
282eb5fcf5 Summary: Unittest for nicira plugin
More unittests for the Guru

Add unittests for the Element
2013-01-03 11:57:14 +01:00
Hugo Trippaers
00847482cc Summary: Small fixes for issues found during unittests 2013-01-03 11:56:50 +01:00
Hugo Trippaers
6cf0c5683d 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.
2013-01-03 11:56:26 +01:00
Hugo Trippaers
9122809e00 Summary: nothing to see here, move along
Fix for a stupid mistake.
2013-01-03 11:56:02 +01:00
Rohit Yadav
d235859168 Fix PluggableService to provide interface for ACL adapters etc. to get configs
- Fix interface to return array of strings, or filenames
- Fix StaticRoleBased ACL adapter to process config files by going through all pluggable services
- Refactor interface names

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-02 16:29:39 -08:00
Rohit Yadav
774cb29b0c api: Annotate all remaining cmd classes with APICommand name field
Automates name field filling using following python program which reads from
various *commands.properties.in files and populates name fields based on the
name cmd class mapping defined in them.

import os
search_pattern = "@APICommand("
pattern_len = len(search_pattern)
prop_files = [
"client/tomcatconf/cisconexusvsm_commands.properties.in",
"client/tomcatconf/f5bigip_commands.properties.in",
"client/tomcatconf/junipersrx_commands.properties.in",
"client/tomcatconf/netapp_commands.properties.in",
"client/tomcatconf/netscalerloadbalancer_commands.properties.in",
"client/tomcatconf/nicira-nvp_commands.properties.in",
"client/tomcatconf/simulator_commands.properties.in",]
file_prefixes = [
"plugins/hypervisors/vmware/src/",
"plugins/network-elements/f5/src/",
"plugins/network-elements/juniper-srx/src/",
"plugins/file-systems/netapp/src/",
"plugins/network-elements/netscaler/src/",
"plugins/network-elements/nicira-nvp/src/",
"plugins/hypervisors/simulator/src/",]
counter = 0
for prop_file in prop_files:
    f = open(prop_file, 'r')
    data = f.read()
    f.close()
    file_prefix = file_prefixes[counter]
    apis = filter(lambda x: x.strip()!='' and (not x.startswith('#')), data.split('\n'))
    for api in apis:
        api_name = api.split('=')[0].strip()
        cmd_name = file_prefix + api.split('=')[1].split(';')[0].replace('.', '/').strip() + ".java"
        if not os.path.exists(cmd_name):
            print cmd_name, api_name
        f = open(cmd_name, 'r')
        d = f.read()
        f.close()
        idx = d.find(search_pattern) + pattern_len
        new_str = d[:idx] + "name = \"%s\", " % api_name + d[idx:]
        f = open(cmd_name, 'w')
        f.write(new_str)
        f.close()
    counter += 1

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-28 01:28:47 -08:00
Kelven Yang
259e6d5f74 Fix a few Spring bootstrap issues 2012-12-27 17:46:52 -08:00
Rohit Yadav
7a7fe583e0 Rename Implementation annotation to APICommand
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-26 15:55:34 -08:00
Rohit Yadav
057ac12d23 Enforce InternalIdentity interface on all VO classes that impls long getId()
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-26 15:09:44 -08:00
Rohit Yadav
018b5215e0 api: Annotate apis in various plugins
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 18:03:23 -08:00
Rohit Yadav
1bd47d48ab api: Annotate some nicira apis
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 17:43:42 -08:00
Rohit Yadav
e849d70af1 api: Annotate some juniper-src apis
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 17:41:10 -08:00
Rohit Yadav
296b49c2f8 Merge branch 'master' into test-merge-api
Conflicts:
	api/src/com/cloud/agent/api/BackupSnapshotCommand.java
	api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java
	api/src/com/cloud/agent/api/to/PortForwardingRuleTO.java
	api/src/com/cloud/network/NetworkService.java
	api/src/com/cloud/resource/ResourceService.java
	api/src/org/apache/cloudstack/api/ApiConstants.java
	api/src/org/apache/cloudstack/api/ResponseGenerator.java
	api/src/org/apache/cloudstack/api/response/SSHKeyPairResponse.java
	client/tomcatconf/commands.properties.in
	core/src/com/cloud/storage/SnapshotVO.java
	pom.xml
	server/src/com/cloud/api/ApiDispatcher.java
	server/src/com/cloud/api/ApiResponseHelper.java
	server/src/com/cloud/api/ApiServer.java
	server/src/com/cloud/configuration/ConfigurationManagerImpl.java
	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/rules/RulesManagerImpl.java
	server/src/com/cloud/offerings/NetworkOfferingVO.java
	server/src/com/cloud/resource/ResourceManagerImpl.java
	server/src/com/cloud/upgrade/dao/Upgrade40to41.java
	server/src/com/cloud/vm/UserVmManagerImpl.java
	server/test/com/cloud/vpc/MockNetworkManagerImpl.java
	setup/db/create-schema.sql
	setup/db/db/schema-40to410.sql

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 13:54:46 -08:00
Min Chen
98b022a430 Remove IdentityProxy from plugin response classes.
Signed-off-by: Min Chen <min.chen@citrix.com>
2012-12-19 13:09:02 -08:00
Alex Huang
392feacd27 missed license 2012-12-18 13:04:34 -08:00
Alex Huang
591fb34795 Added dns-notifier as example plugin 2012-12-18 12:01:26 -08:00
Hugo Trippaers
859412c1ce Fix headers
again....
2012-12-14 11:58:25 +01:00
Hugo Trippaers
2235776aed Unittests for NiciraNvpGuestNetworkGuru
These unittests do not depend on the componentlocator but instead are
completely dependent on mock objects. This ensures that they can be run
standalone without any requirements on the environment.

Includes some fixes to NiciraNvpGuestNetworkGuru and GuestNetworkGuru
2012-12-14 10:41:36 +01:00
Rohit Yadav
e398b1e47a api: Refactor command and response classes to org.apache.cloudstack.api.*
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-07 19:23:24 -08:00
Rohit Yadav
af28c06998 api: move and group all under command, org.apache.cloudstack.command.*
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-07 18:30:54 -08:00
Hugo Trippaers
9c8eba1da3 Fix the tests
Note to self, surefire actually runs with assertions enabled where junit
inside eclipse doesn't. Sure surefire will mark tests as failed when an
assertion is triggered. Take care when mocking stuff.
2012-12-07 17:34:14 +01:00
Hugo Trippaers
2b74b6e827 Start removing the old ant build files
Removed all build.xml files from the plugins
2012-12-07 15:58:56 +01:00
Hugo Trippaers
fa207d2b4d Add unittests for NiciraNvpApi
Added some unittests for the NiciraNvpApi. These tests mainly validate
the logic of the execute methods, which are the main thing in this
class. Other methods are basically wrappers around these functions.

Changed NiciraNvpApi to have a factory method for obtaining the
HttpMethod. This makes it easier to mock it.

Changed the executeMethods in NiciraNvpApi to protected so the unittests
have access.

Fixed a bug in NiciraNvpApi where releaseconnection was not called in
some cases.
2012-12-07 15:55:26 +01:00
Hugo Trippaers
1fbf2a2864 Fix bug in Port Forwarding
Nicira NVP can't handle a range of port when implementing port
forwarding, so return an error message when a rule is being implemented
that uses port ranges.

Include unittest to verify this behaviour
2012-12-06 16:50:56 +01:00
Hugo Trippaers
cfd2a0bdf8 Fixes for some bug discovered while writing unittests
Rewritten handling for static nat and port forwarding, should make some
more sense now and the complex functions are split in smaller units.

Fix a small bug in Match

Add equals function to NatRule that ignores the uuid field.
2012-12-06 14:45:58 +01:00
Hugo Trippaers
22ef646b23 Add more unittests for NiciraNvpResource 2012-12-06 14:45:58 +01:00
Hugo Trippaers
48308ec070 Redoing NatRule usage and some fixes based on issues found while writing
unittests
2012-12-06 14:45:37 +01:00
Hugo Trippaers
700050a713 More unittests for NiciraNvpResource
Add some basic unittest for NatRule
2012-12-06 14:45:09 +01:00
Hugo Trippaers
b0955e43ff Put the mockito version in the central version list 2012-12-06 14:42:59 +01:00
Murali Reddy
6657246cd4 Summary: partical check-in for L4-L7 network services in the shared
network in the advanced zone

Changing the F5, NetScaler, SRX network elemetns to handle both 'isolated networks'
and 'shared networks' in the advanced zone

Bug ID:CLOUDSTACK-312 enable L4-L7 network services in the shared network in the advanced zone
2012-12-06 11:55:19 +05:30
Rohit Yadav
ba8e61bfb5 api_refactoring: for network api refactoring move interfaces so it works
Move ExternalNetworkDeviceManager to cloud-api, as server depends on cloud-api
The api refactoring of one of the api required this interface

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-05 14:53:16 -08:00
Rohit Yadav
456b852c0c api_refactor: refactor loadbalancer apis
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-04 11:25:20 -08:00
Rohit Yadav
658cf56120 api_refactor: move diskoffering to offering
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-04 10:38:53 -08:00
Rohit Yadav
28df57ec75 api_refactor: refactor serviceoffering apis
- Fix refactored apis, mappings in commands*.in
- Fix comments etc.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-04 00:27:19 -08:00
Rohit Yadav
6fc3bc3760 api_refactor: refactor vpn and vm apis
- Refactor VPN and VM APIs to admin and user pkgs
- Names space, org.apache.cloudstack
- Fix refactored apis in commands*.in
- Fix comments etc.
- Expand tabs, remove trailing whitespace

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-03 21:27:02 -08:00
Rohit Yadav
5edfc2760a refactor: remove redundant imports, fix trailing chars 2012-12-03 13:54:37 -08:00