5626 Commits

Author SHA1 Message Date
Min Chen
e7fa1a86fb Create DB views to improve ListHostsCmd performance.
Signed-off-by: Min Chen <min.chen@citrix.com>
2012-12-22 21:47:05 -08:00
Rohit Yadav
5d8e106602 api: Add method in ApiDispatcher to be reused for both UUID and List<Uuid>
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-22 18:57:26 -08:00
Rohit Yadav
2140ff55ea api: Refactor and move VPN related api cmd classes to command.user.vpn
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-22 16:13:37 -08:00
Rohit Yadav
024f0d95dd api: Use Identity interface instead of java reflect to getId
- Add new interface method to getId
- Fix method definition in AsyncJob
- Get rid of mechanism to getId using reflect, use Identity interface

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-21 19:05:45 -08:00
Rohit Yadav
08892c51a3 api: Fix jobid and entitytype for BaseResponse and QueryAsyncJob*
- Fix jobid serialization issue that broke the UI
- Fix AsyncJob Result and Response
- Get rid of getUuid(), setUuid(), just use getId, setId for uuid...
- All uuids from over the wire are UUIDs

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-21 19:05:45 -08:00
Min Chen
f4a90a151f Merge branch 'api_refactoring' of https://git-wip-us.apache.org/repos/asf/incubator-cloudstack into api_refactoring 2012-12-21 15:11:54 -08:00
Kishan Kavala
3ae5986b87 Update DB version during DB deploy
1. Modified create-schema.sql to add version as 4.1.0 instead of 4.0.0
	2. Removed schema-40to41.sql amd moved the content to schema-40to410.sql
	3. Added to schema-40to410.sql Upgrade40to41.java

Conflicts:
	server/src/com/cloud/upgrade/dao/Upgrade40to41.java
	setup/db/create-schema.sql
	setup/db/db/schema-40to41.sql
	setup/db/db/schema-40to410.sql

Signed-off-by: Min Chen <min.chen@citrix.com>
2012-12-21 15:11:05 -08:00
Rohit Yadav
03b47cb501 api: Temp. fix to be backward compatible to old way of id passing
For some apis, the param=-1 is used to evaluate conditionals. Allow -1 to be passed
for now. This is a APITODO/FIXME to fix stuff in service layer and then only get rid of it.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-21 14:41:14 -08:00
Min Chen
e4dbc2033f Add upgrade script from 4.0 to 4.1.
Signed-off-by: Min Chen <min.chen@citrix.com>
2012-12-20 18:18:06 -08:00
Min Chen
b14b39a69f Remove IdentityProxy from BaseResponse, ExtractResponse. Now
IdentityProxy is only referenced in CreateCmdResponse, which involves
some async job logic change. Since it is not impacting list performance,
will leave it there for now.

Signed-off-by: Min Chen <min.chen@citrix.com>
2012-12-20 16:52:52 -08:00
Min Chen
a88ce6bb7f Remove IdentityProxy from CloudException and ExceptionResponse. 2012-12-19 23:49:44 -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
Min Chen
e397f23f6b Revert "Guard null pointer exceptions."
This reverts commit fc56e29a3ec22035c744e276538e8a20e5923996.

Conflicts:
	server/src/com/cloud/api/ApiResponseHelper.java

Signed-off-by: Min Chen <min.chen@citrix.com>
2012-12-19 11:23:09 -08:00
Min Chen
1d729578d4 Remove IdentityProxy from Response classes.
Signed-off-by: Min Chen <min.chen@citrix.com>
2012-12-18 23:16:38 -08:00
Min Chen
fc56e29a3e Guard null pointer exceptions. 2012-12-18 22:26:38 -08:00
Rohit Yadav
7b6132e8e2 api: Skip empty uuid processing in ApiDispatcher for received params
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-18 18:16:18 -08:00
Rohit Yadav
a9df2cb0f5 api: Fix NullPointerException for listProjects in ProjectJoinDaoImpl
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-18 17:44:18 -08:00
Rohit Yadav
434258080f api: Fix NullPointerException in ApiResponseHelper for DomainResponse
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-18 17:44:17 -08:00
Rohit Yadav
22ee4200c3 api: Fix findByXId to findByUuid in EntityManager and ApiDispatcher
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-18 17:44:17 -08:00
Min Chen
4b75132aa2 Remove IdentityProxy from Response classes.
Signed-off-by: Min Chen <min.chen@citrix.com>
2012-12-18 16:33:12 -08:00
Min Chen
16be94e9d7 Remove IdentityProxy from OfferingResponse, FirewallResponse,
FirewallRuleResponse, HypervisorCapabilitiesResponse, IPAddressResponse.

Signed-off-by: Min Chen <min.chen@citrix.com>
2012-12-18 12:02:08 -08:00
Min Chen
1aa30f03e7 Remove IdentityProxy from AutoScale responses.
Signed-off-by: Min Chen <min.chen@citrix.com>
2012-12-18 11:19:36 -08:00
Min Chen
a390b273ae Merge branch 'api_refactoring' of https://git-wip-us.apache.org/repos/asf/incubator-cloudstack into api_refactoring 2012-12-18 10:07:51 -08:00
Rohit Yadav
5fdce84e81 api: Process UUID and Parameter annotations in ApiDispatcher
- Use @Parameter's entityType and type annotation fields
- Use @Entity annotation in Reponse class to get table info for Dao
- Use findByXId to process all entities and translate UUID to ID
- Handle error in reflection method invoking

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-18 04:16:33 -08:00
Rohit Yadav
837d21bb2d api: Implement findByXId in GenericDaoBase and EntityManagerImpl
Declare and define findByXId() in GenericDao and EntityManager.
This method would return a VO by UUID and EntityManager's interface would
take in the VO Interface.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-18 04:10:36 -08:00
Min Chen
3d344738b1 Fix ControlledEntityResponse interface to remove IdentityProxy for
projectId and domainId.

Signed-off-by: Min Chen <min.chen@citrix.com>
2012-12-17 23:24:08 -08:00
Min Chen
57eda4e3f4 Merge branch 'api_refactoring' of https://git-wip-us.apache.org/repos/asf/incubator-cloudstack into api_refactoring 2012-12-17 23:03:55 -08:00
Rohit Yadav
d54d8cbcd7 api: Fix ApiServer's handle() which runs on integration.api.port
- Fix URI parsing using apache hc
- Remove bloated c-like parsing code
- Fix param processing
- TODO: To use Guava's multimap

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-17 20:51:51 -08:00
Min Chen
79f8c104eb Remove IdentityProxy from GuestOSResponse and GuestOSCategoryResponse.
Signed-off-by: Min Chen <min.chen@citrix.com>
2012-12-17 18:01:31 -08:00
Min Chen
e017dc2c00 commit ba3fef5d0650c42463d0f225f4ca14b5f9046c44
Author: Min Chen <min.chen@citrix.com>
Date:   Mon Dec 17 17:42:30 2012 -0800

    Remove IdentityProxy from AlertResponse and AsyncJobResponse.

Signed-off-by: Min Chen <min.chen@citrix.com>
2012-12-17 17:44:39 -08:00
Min Chen
348d3ae448 Conflicts:
api/src/org/apache/cloudstack/api/response/AccountResponse.java

Signed-off-by: Min Chen <min.chen@citrix.com>
2012-12-17 15:41:56 -08:00
Rohit Yadav
de8aa86542 api: Work in progress code in ApiDispatcher to process annotations
- All id params are now uuids, basically for documentation
- Use injections and not component locator
- Remove resourceType field checking, it's now called entityType
- Fix indents

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-17 10:00:27 -08:00
Rohit Yadav
f8a483fc5a api: Include cloudstack-version in both xml and json api response
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-16 21:37:03 -08:00
Rohit Yadav
59fc89abe3 api: Fix ApiServer role base acl logic and response type value
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-16 18:13:29 -08:00
Min Chen
c167ad45e3 Move view based VO and Dao classes to cloud-server module to hide the
details from API client, also extract query related methods into
QueryService interface.
2012-12-14 10:47:58 -08:00
Rohit Yadav
88b7af18e6 api: Revert "Move all the DB view DAOs from cloud-server to cloud-api for future api-server package."
Reverting commit as we don't want the daos to move to cloud-api.
We'll eventually breakout cloud-server and create cloud-api-server for the standalone
api server.

This reverts commit 7597a38f7a255e49b73c833918f30b51504e0c53.
2012-12-13 09:42:28 -08:00
Min Chen
7597a38f7a Move all the DB view DAOs from cloud-server to cloud-api for future api-server package.
BUG-ID: CLOUDSTACK-527

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-13 09:28:42 -08:00
Rohit Yadav
7dbdf786cc api: FIXME for api access checker adapter
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-12 14:21:38 -08:00
Min Chen
472f4f91b9 Refactor ListProjectInvitationsCmd and ProjectInvitationResponse. 2012-12-12 09:04:43 -08:00
Min Chen
3661f7f992 Fix several bugs of new refactored list apis. 2012-12-11 17:37:16 -08:00
Min Chen
9c93fee0dc Refactor ListProjectAccountCmd and ProjectAccountResponse. 2012-12-11 15:49:15 -08:00
Rohit Yadav
c455cf9271 api: refactor common code to get classname for an api in ApiServer
- Refactor common code to get classname from apiname
- Fix search mechanism within api access checker adapter to:
  * check permissions
  * get class name for an apiname

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-11 14:17:47 -08:00
Rohit Yadav
79b54e6ac1 api: Fix obj injections in ApiServer
- Inject classes using Inject annotation
- Don't misuse component locator

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-11 14:16:25 -08:00
Rohit Yadav
6ce68b93cc api: Fix APIAccessChecker and StaticRoleBasedAPIAccessChecker
- Add getCmd api interface in APIAccessChecker adapter to get cmd properties
- Add mechanism in StaticRoleBasedAPIAccessChecker to get config properties
- Add public interface to get the cmd properties for the adapter impl

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-11 14:10:36 -08:00
Rohit Yadav
f4892fbb84 api: remove those evil extra newlines
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-11 13:38:32 -08:00
Min Chen
8735716ba0 Refactor ListProjectsCmd and ProjectResponse. 2012-12-11 12:51:08 -08:00
Min Chen
c83323fea7 api: Refactoring ListUsersCmd and UserResponse.
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-10 17:45:40 -08:00
Rohit Yadav
8c4096dc59 api: Have apiserver injected by component locator
- Instantiate apiserver by injection, so all its entities are also created and injected
- Make the constructor protected

Thanks to Alex for helping out on this one.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-10 17:38:44 -08:00
Rohit Yadav
2146687112 api: initialize vars in constructor of StaticRoleBasedAPIAccessChecker
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-10 17:28:06 -08:00
Rohit Yadav
151a7643ce api: Don't silently fail apiserver instance initialization
- ApiServer instance assumes cloudstartup servlet will initialize it
- Check and log if initialization fails

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-10 16:27:33 -08:00