You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ml...@apache.org on 2013/01/10 01:48:36 UTC

[46/52] [partial] Summary: Fixes for api_refactoring

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/ResponseGenerator.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/ResponseGenerator.java b/api/src/com/cloud/api/ResponseGenerator.java
deleted file mode 100755
index ec6c00b..0000000
--- a/api/src/com/cloud/api/ResponseGenerator.java
+++ /dev/null
@@ -1,369 +0,0 @@
-// 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 com.cloud.api;
-
-import java.text.DecimalFormat;
-import java.util.EnumSet;
-import java.util.List;
-
-import com.cloud.api.ApiConstants.HostDetails;
-import com.cloud.api.ApiConstants.VMDetails;
-import com.cloud.api.commands.QueryAsyncJobResultCmd;
-import com.cloud.api.response.AccountResponse;
-import com.cloud.api.response.AsyncJobResponse;
-import com.cloud.api.response.AutoScalePolicyResponse;
-import com.cloud.api.response.AutoScaleVmGroupResponse;
-import com.cloud.api.response.AutoScaleVmProfileResponse;
-import com.cloud.api.response.CapacityResponse;
-import com.cloud.api.response.ClusterResponse;
-import com.cloud.api.response.ConditionResponse;
-import com.cloud.api.response.ConfigurationResponse;
-import com.cloud.api.response.CounterResponse;
-import com.cloud.api.response.CreateCmdResponse;
-import com.cloud.api.response.DiskOfferingResponse;
-import com.cloud.api.response.DomainResponse;
-import com.cloud.api.response.DomainRouterResponse;
-import com.cloud.api.response.EventResponse;
-import com.cloud.api.response.ExtractResponse;
-import com.cloud.api.response.FirewallResponse;
-import com.cloud.api.response.FirewallRuleResponse;
-import com.cloud.api.response.HostResponse;
-import com.cloud.api.response.HypervisorCapabilitiesResponse;
-import com.cloud.api.response.IPAddressResponse;
-import com.cloud.api.response.InstanceGroupResponse;
-import com.cloud.api.response.IpForwardingRuleResponse;
-import com.cloud.api.response.LBStickinessResponse;
-import com.cloud.api.response.LDAPConfigResponse;
-import com.cloud.api.response.ListResponse;
-import com.cloud.api.response.LoadBalancerResponse;
-import com.cloud.api.response.NetworkACLResponse;
-import com.cloud.api.response.NetworkOfferingResponse;
-import com.cloud.api.response.NetworkResponse;
-import com.cloud.api.response.PhysicalNetworkResponse;
-import com.cloud.api.response.PodResponse;
-import com.cloud.api.response.PrivateGatewayResponse;
-import com.cloud.api.response.ProjectAccountResponse;
-import com.cloud.api.response.ProjectInvitationResponse;
-import com.cloud.api.response.ProjectResponse;
-import com.cloud.api.response.ProviderResponse;
-import com.cloud.api.response.RemoteAccessVpnResponse;
-import com.cloud.api.response.ResourceCountResponse;
-import com.cloud.api.response.ResourceLimitResponse;
-import com.cloud.api.response.ResourceTagResponse;
-import com.cloud.api.response.S3Response;
-import com.cloud.api.response.SecurityGroupResponse;
-import com.cloud.api.response.ServiceOfferingResponse;
-import com.cloud.api.response.ServiceResponse;
-import com.cloud.api.response.Site2SiteCustomerGatewayResponse;
-import com.cloud.api.response.Site2SiteVpnConnectionResponse;
-import com.cloud.api.response.Site2SiteVpnGatewayResponse;
-import com.cloud.api.response.SnapshotPolicyResponse;
-import com.cloud.api.response.SnapshotResponse;
-import com.cloud.api.response.StaticRouteResponse;
-import com.cloud.api.response.StorageNetworkIpRangeResponse;
-import com.cloud.api.response.StoragePoolResponse;
-import com.cloud.api.response.SwiftResponse;
-import com.cloud.api.response.SystemVmInstanceResponse;
-import com.cloud.api.response.SystemVmResponse;
-import com.cloud.api.response.TemplatePermissionsResponse;
-import com.cloud.api.response.TemplateResponse;
-import com.cloud.api.response.TrafficTypeResponse;
-import com.cloud.api.response.UserResponse;
-import com.cloud.api.response.UserVmResponse;
-import com.cloud.api.response.VirtualRouterProviderResponse;
-import com.cloud.api.response.VlanIpRangeResponse;
-import com.cloud.api.response.VolumeResponse;
-import com.cloud.api.response.VpcOfferingResponse;
-import com.cloud.api.response.VpcResponse;
-import com.cloud.api.response.VpnUsersResponse;
-import com.cloud.api.response.ZoneResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.capacity.Capacity;
-import com.cloud.configuration.Configuration;
-import com.cloud.configuration.ResourceCount;
-import com.cloud.configuration.ResourceLimit;
-import com.cloud.dc.DataCenter;
-import com.cloud.dc.Pod;
-import com.cloud.dc.StorageNetworkIpRange;
-import com.cloud.dc.Vlan;
-import com.cloud.domain.Domain;
-import com.cloud.event.Event;
-import com.cloud.host.Host;
-import com.cloud.hypervisor.HypervisorCapabilities;
-import com.cloud.network.IpAddress;
-import com.cloud.network.Network;
-import com.cloud.network.Network.Service;
-import com.cloud.network.PhysicalNetwork;
-import com.cloud.network.PhysicalNetworkServiceProvider;
-import com.cloud.network.PhysicalNetworkTrafficType;
-import com.cloud.network.RemoteAccessVpn;
-import com.cloud.network.Site2SiteCustomerGateway;
-import com.cloud.network.Site2SiteVpnConnection;
-import com.cloud.network.Site2SiteVpnGateway;
-import com.cloud.network.VirtualRouterProvider;
-import com.cloud.network.VpnUser;
-import com.cloud.network.as.AutoScalePolicy;
-import com.cloud.network.as.AutoScaleVmGroup;
-import com.cloud.network.as.AutoScaleVmProfile;
-import com.cloud.network.as.Condition;
-import com.cloud.network.as.Counter;
-import com.cloud.network.router.VirtualRouter;
-import com.cloud.network.rules.FirewallRule;
-import com.cloud.network.rules.LoadBalancer;
-import com.cloud.network.rules.PortForwardingRule;
-import com.cloud.network.rules.StaticNatRule;
-import com.cloud.network.rules.StickinessPolicy;
-import com.cloud.network.security.SecurityGroup;
-import com.cloud.network.security.SecurityGroupRules;
-import com.cloud.network.security.SecurityRule;
-import com.cloud.network.vpc.PrivateGateway;
-import com.cloud.network.vpc.StaticRoute;
-import com.cloud.network.vpc.Vpc;
-import com.cloud.network.vpc.VpcOffering;
-import com.cloud.offering.DiskOffering;
-import com.cloud.offering.NetworkOffering;
-import com.cloud.offering.ServiceOffering;
-import com.cloud.org.Cluster;
-import com.cloud.projects.Project;
-import com.cloud.projects.ProjectAccount;
-import com.cloud.projects.ProjectInvitation;
-import com.cloud.server.ResourceTag;
-import com.cloud.storage.S3;
-import com.cloud.storage.Snapshot;
-import com.cloud.storage.StoragePool;
-import com.cloud.storage.Swift;
-import com.cloud.storage.Volume;
-import com.cloud.storage.snapshot.SnapshotPolicy;
-import com.cloud.template.VirtualMachineTemplate;
-import com.cloud.user.Account;
-import com.cloud.user.User;
-import com.cloud.user.UserAccount;
-import com.cloud.uservm.UserVm;
-import com.cloud.vm.InstanceGroup;
-import com.cloud.vm.VirtualMachine;
-
-public interface ResponseGenerator {
-    UserResponse createUserResponse(UserAccount user);
-
-    AccountResponse createAccountResponse(Account account);
-
-    DomainResponse createDomainResponse(Domain domain);
-
-    DiskOfferingResponse createDiskOfferingResponse(DiskOffering offering);
-
-    ResourceLimitResponse createResourceLimitResponse(ResourceLimit limit);
-
-    ResourceCountResponse createResourceCountResponse(ResourceCount resourceCount);
-
-    ServiceOfferingResponse createServiceOfferingResponse(ServiceOffering offering);
-
-    ConfigurationResponse createConfigurationResponse(Configuration cfg);
-
-    SnapshotResponse createSnapshotResponse(Snapshot snapshot);
-
-    SnapshotPolicyResponse createSnapshotPolicyResponse(SnapshotPolicy policy);
-
-    List<UserVmResponse> createUserVmResponse(String objectName, UserVm... userVms);
-
-    List<UserVmResponse> createUserVmResponse(String objectName, EnumSet<VMDetails> details, UserVm... userVms);
-
-    SystemVmResponse createSystemVmResponse(VirtualMachine systemVM);
-
-    DomainRouterResponse createDomainRouterResponse(VirtualRouter router);
-
-    HostResponse createHostResponse(Host host, EnumSet<HostDetails> details);
-
-    HostResponse createHostResponse(Host host);
-
-    VlanIpRangeResponse createVlanIpRangeResponse(Vlan vlan);
-
-    IPAddressResponse createIPAddressResponse(IpAddress ipAddress);
-
-    LoadBalancerResponse createLoadBalancerResponse(LoadBalancer loadBalancer);
-
-    LBStickinessResponse createLBStickinessPolicyResponse(List<? extends StickinessPolicy> stickinessPolicies, LoadBalancer lb);
-
-    LBStickinessResponse createLBStickinessPolicyResponse(StickinessPolicy stickinessPolicy, LoadBalancer lb);
-
-    PodResponse createPodResponse(Pod pod, Boolean showCapacities);
-
-    ZoneResponse createZoneResponse(DataCenter dataCenter, Boolean showCapacities);
-
-    VolumeResponse createVolumeResponse(Volume volume);
-
-    InstanceGroupResponse createInstanceGroupResponse(InstanceGroup group);
-
-    StoragePoolResponse createStoragePoolResponse(StoragePool pool);
-
-    ClusterResponse createClusterResponse(Cluster cluster, Boolean showCapacities);
-
-    FirewallRuleResponse createPortForwardingRuleResponse(PortForwardingRule fwRule);
-
-    IpForwardingRuleResponse createIpForwardingRuleResponse(StaticNatRule fwRule);
-
-    User findUserById(Long userId);
-
-    UserVm findUserVmById(Long vmId);
-
-    Volume findVolumeById(Long volumeId);
-
-    Account findAccountByNameDomain(String accountName, Long domainId);
-
-    VirtualMachineTemplate findTemplateById(Long templateId);
-
-    Host findHostById(Long hostId);
-
-    List<TemplateResponse> createTemplateResponses(long templateId, long zoneId, boolean readyOnly);
-
-    VpnUsersResponse createVpnUserResponse(VpnUser user);
-
-    RemoteAccessVpnResponse createRemoteAccessVpnResponse(RemoteAccessVpn vpn);
-
-    List<TemplateResponse> createTemplateResponses(long templateId, Long zoneId, boolean readyOnly);
-
-    List<TemplateResponse> createTemplateResponses(long templateId, Long snapshotId, Long volumeId, boolean readyOnly);
-
-    ListResponse<SecurityGroupResponse> createSecurityGroupResponses(List<? extends SecurityGroupRules> networkGroups);
-
-    SecurityGroupResponse createSecurityGroupResponseFromSecurityGroupRule(List<? extends SecurityRule> SecurityRules);
-
-    SecurityGroupResponse createSecurityGroupResponse(SecurityGroup group);
-
-    ExtractResponse createExtractResponse(Long uploadId, Long id, Long zoneId, Long accountId, String mode);
-
-    String toSerializedString(CreateCmdResponse response, String responseType);
-
-    AsyncJobResponse createAsyncJobResponse(AsyncJob job);
-
-    EventResponse createEventResponse(Event event);
-
-    TemplateResponse createIsoResponse(VirtualMachineTemplate result);
-
-    List<CapacityResponse> createCapacityResponse(List<? extends Capacity> result, DecimalFormat format);
-
-    TemplatePermissionsResponse createTemplatePermissionsResponse(List<String> accountNames, Long id, boolean isAdmin);
-
-    AsyncJobResponse queryJobResult(QueryAsyncJobResultCmd cmd);
-
-    NetworkOfferingResponse createNetworkOfferingResponse(NetworkOffering offering);
-
-    NetworkResponse createNetworkResponse(Network network);
-
-    UserResponse createUserResponse(User user);
-
-    AccountResponse createUserAccountResponse(UserAccount user);
-
-    Long getSecurityGroupId(String groupName, long accountId);
-
-    List<TemplateResponse> createIsoResponses(long isoId, Long zoneId, boolean readyOnly);
-
-    ProjectResponse createProjectResponse(Project project);
-
-    List<TemplateResponse> createIsoResponses(VirtualMachineTemplate iso, long zoneId, boolean readyOnly);
-
-    List<TemplateResponse> createTemplateResponses(long templateId, Long vmId);
-
-    FirewallResponse createFirewallResponse(FirewallRule fwRule);
-
-    HypervisorCapabilitiesResponse createHypervisorCapabilitiesResponse(HypervisorCapabilities hpvCapabilities);
-
-    ProjectAccountResponse createProjectAccountResponse(ProjectAccount projectAccount);
-
-    ProjectInvitationResponse createProjectInvitationResponse(ProjectInvitation invite);
-
-    SystemVmInstanceResponse createSystemVmInstanceResponse(VirtualMachine systemVM);
-
-    SwiftResponse createSwiftResponse(Swift swift);
-
-    S3Response createS3Response(S3 result);
-
-    PhysicalNetworkResponse createPhysicalNetworkResponse(PhysicalNetwork result);
-
-    ServiceResponse createNetworkServiceResponse(Service service);
-
-    ProviderResponse createNetworkServiceProviderResponse(PhysicalNetworkServiceProvider result);
-
-    TrafficTypeResponse createTrafficTypeResponse(PhysicalNetworkTrafficType result);
-
-    VirtualRouterProviderResponse createVirtualRouterProviderResponse(VirtualRouterProvider result);
-
-    LDAPConfigResponse createLDAPConfigResponse(String hostname, Integer port, Boolean useSSL, String queryFilter, String baseSearch, String dn);
-
-    StorageNetworkIpRangeResponse createStorageNetworkIpRangeResponse(StorageNetworkIpRange result);
-    
-    /**
-     * @param tableName TODO
-     * @param token
-     * @return
-     */
-    Long getIdentiyId(String tableName, String token);
-
-    /**
-     * @param resourceTag
-     * @param keyValueOnly TODO
-     * @return
-     */
-    ResourceTagResponse createResourceTagResponse(ResourceTag resourceTag, boolean keyValueOnly);
-
-    Site2SiteVpnGatewayResponse createSite2SiteVpnGatewayResponse(Site2SiteVpnGateway result);
-   
-
-    /**
-     * @param offering
-     * @return
-     */
-    VpcOfferingResponse createVpcOfferingResponse(VpcOffering offering);
-
-    /**
-     * @param vpc
-     * @return
-     */
-    VpcResponse createVpcResponse(Vpc vpc);
-
-    /**
-     * @param networkACL
-     * @return
-     */
-    NetworkACLResponse createNetworkACLResponse(FirewallRule networkACL);
-
-    /**
-     * @param result
-     * @return
-     */
-    PrivateGatewayResponse createPrivateGatewayResponse(PrivateGateway result);
-
-    /**
-     * @param result
-     * @return
-     */
-    StaticRouteResponse createStaticRouteResponse(StaticRoute result);
-
-    Site2SiteCustomerGatewayResponse createSite2SiteCustomerGatewayResponse(Site2SiteCustomerGateway result);
-
-    Site2SiteVpnConnectionResponse createSite2SiteVpnConnectionResponse(Site2SiteVpnConnection result);
-
-    CounterResponse createCounterResponse(Counter ctr);
-    
-    ConditionResponse createConditionResponse(Condition cndn);
-
-    AutoScalePolicyResponse createAutoScalePolicyResponse(AutoScalePolicy policy);
-
-    AutoScaleVmProfileResponse createAutoScaleVmProfileResponse(AutoScaleVmProfile profile);
-
-    AutoScaleVmGroupResponse createAutoScaleVmGroupResponse(AutoScaleVmGroup vmGroup);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/ResponseObject.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/ResponseObject.java b/api/src/com/cloud/api/ResponseObject.java
deleted file mode 100644
index 2d08fb9..0000000
--- a/api/src/com/cloud/api/ResponseObject.java
+++ /dev/null
@@ -1,78 +0,0 @@
-// 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 com.cloud.api;
-
-public interface ResponseObject {
-    /**
-     * Get the name of the API response
-     * 
-     * @return the name of the API response
-     */
-    String getResponseName();
-
-    /**
-     * Set the name of the API response
-     * 
-     * @param name
-     */
-    void setResponseName(String name);
-
-    /**
-     * Get the name of the API object
-     * 
-     * @return the name of the API object
-     */
-    String getObjectName();
-
-    /**
-     * 
-     * @param name
-     */
-    void setObjectName(String name);
-
-    /**
-     * Returns the object Id
-     */
-    Long getObjectId();
-
-    /**
-     * Returns the job id
-     * 
-     * @return
-     */
-    Long getJobId();
-
-    /**
-     * Sets the job id
-     * 
-     * @param jobId
-     */
-    void setJobId(Long jobId);
-
-    /**
-     * Returns the job status
-     * 
-     * @return
-     */
-    Integer getJobStatus();
-
-    /**
-     * 
-     * @param jobStatus
-     */
-    void setJobStatus(Integer jobStatus);
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/ServerApiException.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/ServerApiException.java b/api/src/com/cloud/api/ServerApiException.java
deleted file mode 100644
index 721cf13..0000000
--- a/api/src/com/cloud/api/ServerApiException.java
+++ /dev/null
@@ -1,52 +0,0 @@
-// 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 com.cloud.api;
-import com.cloud.utils.IdentityProxy;
-import com.cloud.utils.exception.RuntimeCloudException;
-
-@SuppressWarnings("serial")
-public class ServerApiException extends RuntimeCloudException {
-    private int _errorCode;
-    private String _description;
-
-    public ServerApiException() {
-        _errorCode = 0;
-        _description = null;
-    }
-
-    public ServerApiException(int errorCode, String description) {
-        _errorCode = errorCode;
-        _description = description;
-    }
-
-    public int getErrorCode() {
-        return _errorCode;
-    }
-
-    public void setErrorCode(int errorCode) {
-        _errorCode = errorCode;
-    }
-
-    public String getDescription() {
-        return _description;
-    }
-
-    public void setDescription(String description) {
-        _description = description;
-    }
-	
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/.gitignore
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/.gitignore b/api/src/com/cloud/api/commands/.gitignore
index 63e3fa0..6204278 100644
--- a/api/src/com/cloud/api/commands/.gitignore
+++ b/api/src/com/cloud/api/commands/.gitignore
@@ -5,9 +5,9 @@
 # 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

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/ActivateProjectCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/ActivateProjectCmd.java b/api/src/com/cloud/api/commands/ActivateProjectCmd.java
deleted file mode 100644
index b8c4721..0000000
--- a/api/src/com/cloud/api/commands/ActivateProjectCmd.java
+++ /dev/null
@@ -1,101 +0,0 @@
-// 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 com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.BaseCmd.CommandType;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.ProjectResponse;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.projects.Project;
-import com.cloud.user.UserContext;
-
-@Implementation(description="Activates a project", responseObject=ProjectResponse.class, since="3.0.0")
-public class ActivateProjectCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ActivateProjectCmd.class.getName());
-
-    private static final String s_name = "activaterojectresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-    
-    @IdentityMapper(entityTableName="projects")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="id of the project to be modified")
-    private Long id;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-    
-    
-    @Override
-    public long getEntityOwnerId() {
-        Project project= _projectService.getProject(getId());
-        //verify input parameters
-        if (project == null) {
-            throw new InvalidParameterValueException("Unable to find project by id " + getId());
-        } 
-        
-        return _projectService.getProjectOwner(getId()).getId(); 
-    }
- 
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public void execute(){
-        UserContext.current().setEventDetails("Project id: "+ getId());
-        Project project = _projectService.activateProject(getId());
-        if (project != null) {
-            ProjectResponse response = _responseGenerator.createProjectResponse(project);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to activate a project");
-        }
-    }
-    
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_PROJECT_ACTIVATE;
-    }
-    
-    @Override
-    public String getEventDescription() {
-        return  "Activating project: " + id;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/AddAccountToProjectCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AddAccountToProjectCmd.java b/api/src/com/cloud/api/commands/AddAccountToProjectCmd.java
deleted file mode 100644
index 73609fb..0000000
--- a/api/src/com/cloud/api/commands/AddAccountToProjectCmd.java
+++ /dev/null
@@ -1,125 +0,0 @@
-// 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 com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.SuccessResponse;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.projects.Project;
-import com.cloud.user.UserContext;
-import com.cloud.utils.AnnotationHelper;
-
-
-@Implementation(description="Adds acoount to a project", responseObject=SuccessResponse.class, since="3.0.0")
-public class AddAccountToProjectCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(AddAccountToProjectCmd.class.getName());
-
-    private static final String s_name = "addaccounttoprojectresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="projects")
-    @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, required=true, description="id of the project to add the account to")
-    private Long projectId;
-    
-    @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="name of the account to be added to the project")
-    private String accountName;
-    
-    @Parameter(name=ApiConstants.EMAIL, type=CommandType.STRING, description="email to which invitation to the project is going to be sent")
-    private String email;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-
-    public String getAccountName() {
-        return accountName;
-    }
-
-    public Long getProjectId() {
-        return projectId;
-    }
-
-    
-    public String getEmail() {
-        return email;
-    }
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public void execute(){
-        if (accountName == null && email == null) {
-            throw new InvalidParameterValueException("Either accountName or email is required");
-        }
-        
-        UserContext.current().setEventDetails("Project id: "+ projectId + "; accountName " + accountName);
-        boolean result = _projectService.addAccountToProject(getProjectId(), getAccountName(), getEmail());
-        if (result) {
-            SuccessResponse response = new SuccessResponse(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add account to the project");
-        }
-    }
-    
-    @Override
-    public long getEntityOwnerId() {
-        Project project= _projectService.getProject(getProjectId());
-        //verify input parameters
-        if (project == null) {
-        	InvalidParameterValueException ex = new InvalidParameterValueException("Unable to find project with specified id");
-        	ex.addProxyObject(project, getProjectId(), "projectId");            
-            throw ex;
-        } 
-        
-        return _projectService.getProjectOwner(getProjectId()).getId(); 
-    }
-    
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_PROJECT_ACCOUNT_ADD;
-    }
-    
-    @Override
-    public String getEventDescription() {
-        if (accountName != null) {
-            return  "Adding account " + getAccountName() + " to project: " + getProjectId();
-        } else {
-            return  "Sending invitation to email " + email + " to join project: " + getProjectId();
-        }  
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/AddClusterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AddClusterCmd.java b/api/src/com/cloud/api/commands/AddClusterCmd.java
deleted file mode 100755
index 0e10f23..0000000
--- a/api/src/com/cloud/api/commands/AddClusterCmd.java
+++ /dev/null
@@ -1,181 +0,0 @@
-// 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 com.cloud.api.commands;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.ClusterResponse;
-import com.cloud.api.response.ListResponse;
-import com.cloud.exception.DiscoveryException;
-import com.cloud.exception.ResourceInUseException;
-import com.cloud.org.Cluster;
-import com.cloud.user.Account;
-import com.cloud.utils.IdentityProxy;
-
-@Implementation(description="Adds a new cluster", responseObject=ClusterResponse.class)
-public class AddClusterCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(AddClusterCmd.class.getName());
-
-    private static final String s_name = "addclusterresponse";
-    
-    @Parameter(name=ApiConstants.CLUSTER_NAME, type=CommandType.STRING, required=true, description="the cluster name")
-    private String clusterName;
-
-    @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required=false, description="the password for the host")
-    private String password;
-
-    @IdentityMapper(entityTableName="host_pod_ref")
-    @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, required=true, description="the Pod ID for the host")
-    private Long podId;
-
-    @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=false, description="the URL")
-    private String url;
-
-    @Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required=false, description="the username for the cluster")
-    private String username;
-
-    @IdentityMapper(entityTableName="data_center")
-
-    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID for the cluster")
-    private Long zoneId;
-    
-    @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, required=true, description="hypervisor type of the cluster: XenServer,KVM,VMware,Hyperv,BareMetal,Simulator")
-    private String hypervisor;
-    
-    @Parameter(name=ApiConstants.CLUSTER_TYPE, type=CommandType.STRING, required=true, description="type of the cluster: CloudManaged, ExternalManaged")
-    private String clusterType;
-    
-    @Parameter(name=ApiConstants.ALLOCATION_STATE, type=CommandType.STRING, description="Allocation state of this cluster for allocation of new resources")
-    private String allocationState;
-    
-    @Parameter(name = ApiConstants.VSM_USERNAME, type = CommandType.STRING, required = false, description = "the username for the VSM associated with this cluster")
-    private String vsmusername;
-
-    @Parameter(name = ApiConstants.VSM_PASSWORD, type = CommandType.STRING, required = false, description = "the password for the VSM associated with this cluster")
-    private String vsmpassword;
-
-    @Parameter(name = ApiConstants.VSM_IPADDRESS, type = CommandType.STRING, required = false, description = "the ipaddress of the VSM associated with this cluster")
-    private String vsmipaddress;
-    
-    public String getVSMIpaddress() {
-        return vsmipaddress;
-    }
-
-    public String getVSMPassword() {
-        return vsmpassword;
-    }
-
-    public String getVSMUsername() {
-        return vsmusername;
-    }
-
-    public String getClusterName() {
-        return clusterName;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public Long getPodId() {
-        return podId;
-    }
-
-    public String getUrl() {
-        return url;
-    }
-
-    public String getUsername() {
-        return username;
-    }
-
-    public Long getZoneId() {
-        return zoneId;
-    }
-    
-    public String getHypervisor() {
-    	return hypervisor;
-    }
-    
-    @Override
-    public String getCommandName() {
-    	return s_name;
-    }
-    
-    public String getClusterType() {
-    	return clusterType;
-    }
-    
-    public void setClusterType(String type) {
-    	this.clusterType = type;
-    }
-    
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-    
-    public String getAllocationState() {
-    	return allocationState;
-    }
-    
-    public void setAllocationState(String allocationState) {
-    	this.allocationState = allocationState;
-    }    
-
-    @Override
-    public void execute(){
-        try {
-            List<? extends Cluster> result = _resourceService.discoverCluster(this);
-            ListResponse<ClusterResponse> response = new ListResponse<ClusterResponse>();
-            List<ClusterResponse> clusterResponses = new ArrayList<ClusterResponse>();
-            if (result != null && result.size() > 0) {
-                for (Cluster cluster : result) {
-                    ClusterResponse clusterResponse = _responseGenerator.createClusterResponse(cluster, false);
-                    clusterResponses.add(clusterResponse);
-                }
-            } else {
-                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add cluster");
-            }
-
-            response.setResponses(clusterResponses);
-            response.setResponseName(getCommandName());
-            
-            this.setResponseObject(response);
-        } catch (DiscoveryException ex) {
-            s_logger.warn("Exception: ", ex);
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
-        } catch (ResourceInUseException ex) {
-            s_logger.warn("Exception: ", ex);
-            ServerApiException e = new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
-            for (IdentityProxy proxyObj : ex.getIdProxyList()) {
-                e.addProxyObject(proxyObj.getTableName(), proxyObj.getValue(), proxyObj.getidFieldName());
-            }
-            throw e;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/AddHostCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AddHostCmd.java b/api/src/com/cloud/api/commands/AddHostCmd.java
deleted file mode 100755
index a4646a2..0000000
--- a/api/src/com/cloud/api/commands/AddHostCmd.java
+++ /dev/null
@@ -1,161 +0,0 @@
-// 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 com.cloud.api.commands;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.HostResponse;
-import com.cloud.api.response.ListResponse;
-import com.cloud.exception.DiscoveryException;
-import com.cloud.host.Host;
-import com.cloud.user.Account;
-
-@Implementation(description="Adds a new host.", responseObject=HostResponse.class)
-public class AddHostCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(AddHostCmd.class.getName());
-
-    private static final String s_name = "addhostresponse";
-    
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="cluster")
-    @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.LONG, description="the cluster ID for the host")
-    private Long clusterId;
-
-    @Parameter(name=ApiConstants.CLUSTER_NAME, type=CommandType.STRING, description="the cluster name for the host")
-    private String clusterName;
-
-    @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required=true, description="the password for the host")
-    private String password;
-
-    @IdentityMapper(entityTableName="host_pod_ref")
-    @Parameter(name=ApiConstants.POD_ID, required=true, type=CommandType.LONG, description="the Pod ID for the host")
-    private Long podId;
-
-    @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=true, description="the host URL")
-    private String url;
-
-    @Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required=true, description="the username for the host")
-    private String username;
-
-    @IdentityMapper(entityTableName="data_center")
-    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID for the host")
-    private Long zoneId;
-    
-    @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, required=true, description="hypervisor type of the host")
-    private String hypervisor;
-        
-    @Parameter(name=ApiConstants.ALLOCATION_STATE, type=CommandType.STRING, description="Allocation state of this Host for allocation of new resources")
-    private String allocationState;
-
-    @Parameter(name=ApiConstants.HOST_TAGS, type=CommandType.LIST, collectionType=CommandType.STRING, description="list of tags to be added to the host")
-    private List<String> hostTags;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getClusterId() {
-        return clusterId;
-    }
-
-    public String getClusterName() {
-        return clusterName;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public Long getPodId() {
-        return podId;
-    }
-
-    public String getUrl() {
-        return url;
-    }
-
-    public String getUsername() {
-        return username;
-    }
-
-    public Long getZoneId() {
-        return zoneId;
-    }
-    
-    public String getHypervisor() {
-    	return hypervisor;
-    }
-    
-    public List<String> getHostTags() {
-        return hostTags;
-    }
-    
-    public String getAllocationState() {
-    	return allocationState;
-    }    
-    
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-    	return s_name;
-    }
-    
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-    
-    @Override
-    public void execute(){
-        try {
-            List<? extends Host> result = _resourceService.discoverHosts(this);
-            ListResponse<HostResponse> response = new ListResponse<HostResponse>();
-            List<HostResponse> hostResponses = new ArrayList<HostResponse>();
-            if (result != null && result.size() > 0) {
-                for (Host host : result) {
-                    HostResponse hostResponse = _responseGenerator.createHostResponse(host);
-                    hostResponses.add(hostResponse);
-                }
-            } else {
-                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add host");
-            }
-
-            response.setResponses(hostResponses);
-            response.setResponseName(getCommandName());
-            
-            this.setResponseObject(response);
-        } catch (DiscoveryException ex) {
-            s_logger.warn("Exception: ", ex);
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/AddNetworkServiceProviderCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AddNetworkServiceProviderCmd.java b/api/src/com/cloud/api/commands/AddNetworkServiceProviderCmd.java
deleted file mode 100644
index 1e43397..0000000
--- a/api/src/com/cloud/api/commands/AddNetworkServiceProviderCmd.java
+++ /dev/null
@@ -1,138 +0,0 @@
-// 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 com.cloud.api.commands;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCreateCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.ProviderResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.network.PhysicalNetworkServiceProvider;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-
-@Implementation(description="Adds a network serviceProvider to a physical network", responseObject=ProviderResponse.class, since="3.0.0")
-public class AddNetworkServiceProviderCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(AddNetworkServiceProviderCmd.class.getName());
-
-    private static final String s_name = "addnetworkserviceproviderresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-    
-    @IdentityMapper(entityTableName="physical_network")
-    @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, required=true, description="the Physical Network ID to add the provider to")
-    private Long physicalNetworkId;
-
-    @IdentityMapper(entityTableName="physical_network")
-    @Parameter(name=ApiConstants.DEST_PHYSICAL_NETWORK_ID, type=CommandType.LONG, description="the destination Physical Network ID to bridge to")
-    private Long destinationPhysicalNetworkId;
-    
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name for the physical network service provider")
-    private String name;
-    
-    @Parameter(name=ApiConstants.SERVICE_LIST, type=CommandType.LIST, collectionType = CommandType.STRING, description="the list of services to be enabled for this physical network service provider")
-    private List<String> enabledServices;
-
-    @Override
-    public String getEntityTable() {
-        return "physical_network_service_providers";
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-    
-    public Long getPhysicalNetworkId() {
-        return physicalNetworkId;
-    }
-
-    public String getProviderName() {
-        return name;
-    }
-
-    public Long getDestinationPhysicalNetworkId() {
-        return destinationPhysicalNetworkId;
-    }
-
-    public List<String> getEnabledServices() {
-        return enabledServices;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-    
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-    
-    @Override
-    public void execute(){
-        UserContext.current().setEventDetails("Network ServiceProvider Id: "+getEntityId());
-        PhysicalNetworkServiceProvider result = _networkService.getCreatedPhysicalNetworkServiceProvider(getEntityId());
-        if (result != null) {
-            ProviderResponse response = _responseGenerator.createNetworkServiceProviderResponse(result);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        }else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add service provider to physical network");
-        }
-    }
-
-    @Override
-    public void create() throws ResourceAllocationException {
-        PhysicalNetworkServiceProvider result = _networkService.addProviderToPhysicalNetwork(getPhysicalNetworkId(), getProviderName(), getDestinationPhysicalNetworkId(), getEnabledServices());
-        if (result != null) {
-            setEntityId(result.getId());
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add service provider entity to physical network");
-        }        
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_SERVICE_PROVIDER_CREATE;
-    }
-    
-    @Override
-    public String getEventDescription() {
-        return  "Adding physical network ServiceProvider: " + getEntityId();
-    }
-    
-    @Override
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.PhysicalNetworkServiceProvider;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/AddS3Cmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AddS3Cmd.java b/api/src/com/cloud/api/commands/AddS3Cmd.java
deleted file mode 100644
index e046ccc..0000000
--- a/api/src/com/cloud/api/commands/AddS3Cmd.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * 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 com.cloud.api.commands;
-
-import static com.cloud.api.ApiConstants.S3_ACCESS_KEY;
-import static com.cloud.api.ApiConstants.S3_CONNECTION_TIMEOUT;
-import static com.cloud.api.ApiConstants.S3_END_POINT;
-import static com.cloud.api.ApiConstants.S3_HTTPS_FLAG;
-import static com.cloud.api.ApiConstants.S3_MAX_ERROR_RETRY;
-import static com.cloud.api.ApiConstants.S3_SECRET_KEY;
-import static com.cloud.api.ApiConstants.S3_SOCKET_TIMEOUT;
-import static com.cloud.api.ApiConstants.S3_BUCKET_NAME;
-import static com.cloud.api.BaseCmd.CommandType.INTEGER;
-import static com.cloud.api.BaseCmd.CommandType.STRING;
-import static com.cloud.api.BaseCmd.CommandType.BOOLEAN;
-import static com.cloud.user.Account.ACCOUNT_ID_SYSTEM;
-
-import com.cloud.api.BaseCmd;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.S3Response;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.DiscoveryException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.NetworkRuleConflictException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.storage.S3;
-
-@Implementation(description = "Adds S3", responseObject = S3Response.class, since = "4.0.0")
-public final class AddS3Cmd extends BaseCmd {
-
-    private static String COMMAND_NAME = "adds3response";
-
-    @Parameter(name = S3_ACCESS_KEY, type = STRING, required = true,
-            description = "S3 access key")
-    private String accessKey;
-
-    @Parameter(name = S3_SECRET_KEY, type = STRING, required = true,
-            description = "S3 secret key")
-    private String secretKey;
-
-    @Parameter(name = S3_END_POINT, type = STRING, required = false,
-            description = "S3 host name")
-    private String endPoint = null;
-
-    @Parameter(name = S3_BUCKET_NAME, type = STRING, required = true,
-            description = "name of the template storage bucket")
-    private String bucketName;
-
-    @Parameter(name = S3_HTTPS_FLAG, type = BOOLEAN, required = false,
-            description = "connect to the S3 endpoint via HTTPS?")
-    private Boolean httpsFlag = null;
-
-    @Parameter(name = S3_CONNECTION_TIMEOUT, type = INTEGER, required = false,
-            description = "connection timeout (milliseconds)")
-    private Integer connectionTimeout = null;
-
-    @Parameter(name = S3_MAX_ERROR_RETRY, type = INTEGER, required = false,
-            description = "maximum number of times to retry on error")
-    private Integer maxErrorRetry = null;
-
-    @Parameter(name = S3_SOCKET_TIMEOUT, type = INTEGER, required = false,
-            description = "socket timeout (milliseconds)")
-    private Integer socketTimeout = null;
-
-    @Override
-    public void execute() throws ResourceUnavailableException, InsufficientCapacityException,
-            ServerApiException, ConcurrentOperationException, ResourceAllocationException,
-            NetworkRuleConflictException {
-
-        final S3 result;
-
-        try {
-
-            result = _resourceService.discoverS3(this);
-
-            if (result == null) {
-                throw new ServerApiException(INTERNAL_ERROR, "Failed to add S3.");
-            }
-
-        } catch (DiscoveryException e) {
-
-            throw new ServerApiException(INTERNAL_ERROR, "Failed to add S3 due to " + e.getMessage());
-
-        }
-
-        final S3Response response = _responseGenerator.createS3Response(result);
-        response.setResponseName(this.getCommandName());
-        this.setResponseObject(response);
-
-    }
-
-    @Override
-    public boolean equals(final Object thatObject) {
-
-        if (this == thatObject) {
-            return true;
-        }
-
-        if (thatObject == null || this.getClass() != thatObject.getClass()) {
-            return false;
-        }
-
-        final AddS3Cmd thatAddS3Cmd = (AddS3Cmd) thatObject;
-
-        if (this.httpsFlag != null ? !this.httpsFlag.equals(thatAddS3Cmd.httpsFlag) : thatAddS3Cmd.httpsFlag != null) {
-            return false;
-        }
-
-        if (this.accessKey != null ? !this.accessKey.equals(thatAddS3Cmd.accessKey) : thatAddS3Cmd.accessKey != null) {
-            return false;
-        }
-
-        if (this.connectionTimeout != null ? !this.connectionTimeout.equals(thatAddS3Cmd.connectionTimeout) : thatAddS3Cmd.connectionTimeout != null) {
-            return false;
-        }
-
-        if (this.endPoint != null ? !this.endPoint.equals(thatAddS3Cmd.endPoint) : thatAddS3Cmd.endPoint != null) {
-            return false;
-        }
-
-        if (this.maxErrorRetry != null ? !this.maxErrorRetry.equals(thatAddS3Cmd.maxErrorRetry) : thatAddS3Cmd.maxErrorRetry != null) {
-            return false;
-        }
-
-        if (this.secretKey != null ? !this.secretKey.equals(thatAddS3Cmd.secretKey) : thatAddS3Cmd.secretKey != null) {
-            return false;
-        }
-
-        if (this.socketTimeout != null ? !this.socketTimeout.equals(thatAddS3Cmd.socketTimeout) : thatAddS3Cmd.socketTimeout != null) {
-            return false;
-        }
-
-        if (this.bucketName != null ? !this.bucketName.equals(thatAddS3Cmd.bucketName) : thatAddS3Cmd.bucketName != null) {
-            return false;
-        }
-
-        return true;
-
-    }
-
-    @Override
-    public int hashCode() {
-
-        int result = this.accessKey != null ? this.accessKey.hashCode() : 0;
-        result = 31 * result + (this.secretKey != null ? this.secretKey.hashCode() : 0);
-        result = 31 * result + (this.endPoint != null ? this.endPoint.hashCode() : 0);
-        result = 31 * result + (this.bucketName != null ? this.bucketName.hashCode() : 0);
-        result = 31 * result + (this.httpsFlag != null && this.httpsFlag == true ? 1 : 0);
-        result = 31 * result + (this.connectionTimeout != null ? this.connectionTimeout.hashCode() : 0);
-        result = 31 * result + (this.maxErrorRetry != null ? this.maxErrorRetry.hashCode() : 0);
-        result = 31 * result + (this.socketTimeout != null ? this.socketTimeout.hashCode() : 0);
-
-        return result;
-
-    }
-
-    @Override
-    public String getCommandName() {
-        return COMMAND_NAME;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        return ACCOUNT_ID_SYSTEM;
-    }
-
-    public String getAccessKey() {
-        return this.accessKey;
-    }
-
-    public String getSecretKey() {
-        return this.secretKey;
-    }
-
-    public String getEndPoint() {
-        return this.endPoint;
-    }
-
-    public String getBucketName() {
-        return this.bucketName;
-    }
-
-    public Boolean getHttpsFlag() {
-        return this.httpsFlag;
-    }
-
-    public Integer getConnectionTimeout() {
-        return this.connectionTimeout;
-    }
-
-    public Integer getMaxErrorRetry() {
-        return this.maxErrorRetry;
-    }
-
-    public Integer getSocketTimeout() {
-        return this.socketTimeout;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java b/api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java
deleted file mode 100644
index 04f84c1..0000000
--- a/api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java
+++ /dev/null
@@ -1,97 +0,0 @@
-// 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 com.cloud.api.commands;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.HostResponse;
-import com.cloud.exception.DiscoveryException;
-import com.cloud.host.Host;
-import com.cloud.user.Account;
-
-@Implementation(description="Adds secondary storage.", responseObject=HostResponse.class)
-public class AddSecondaryStorageCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(AddSecondaryStorageCmd.class.getName());
-    private static final String s_name = "addsecondarystorageresponse";
-     
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=true, description="the URL for the secondary storage")
-    private String url;
-
-    @IdentityMapper(entityTableName="data_center")
-    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the Zone ID for the secondary storage")
-    private Long zoneId;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public String getUrl() {
-        return url;
-    }
-
-    public Long getZoneId() {
-        return zoneId;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-    	return s_name;
-    }
-    
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-    
-    @Override
-    public void execute(){
-        try {
-            List<? extends Host> result = _resourceService.discoverHosts(this);
-            HostResponse hostResponse = null;
-            if (result != null && result.size() > 0) {
-                for (Host host : result) {
-                    // There should only be one secondary storage host per add
-                    hostResponse = _responseGenerator.createHostResponse(host);
-                    hostResponse.setResponseName(getCommandName());
-                    hostResponse.setObjectName("secondarystorage");
-                    this.setResponseObject(hostResponse);
-                }
-            } else {
-                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add secondary storage");
-            }
-        } catch (DiscoveryException ex) {
-            s_logger.warn("Exception: ", ex);
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/AddSwiftCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AddSwiftCmd.java b/api/src/com/cloud/api/commands/AddSwiftCmd.java
deleted file mode 100644
index 0be4d5f..0000000
--- a/api/src/com/cloud/api/commands/AddSwiftCmd.java
+++ /dev/null
@@ -1,106 +0,0 @@
-// 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 com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.HostResponse;
-import com.cloud.api.response.SwiftResponse;
-import com.cloud.exception.DiscoveryException;
-import com.cloud.storage.Swift;
-import com.cloud.user.Account;
-
-@Implementation(description = "Adds Swift.", responseObject = HostResponse.class, since="3.0.0")
-public class AddSwiftCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(AddSwiftCmd.class.getName());
-    private static final String s_name = "addswiftresponse";
-     
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @Parameter(name = ApiConstants.URL, type = CommandType.STRING, required = true, description = "the URL for swift")
-    private String url;
-
-    @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "the account for swift")
-    private String account;
-
-    @Parameter(name = ApiConstants.USERNAME, type = CommandType.STRING, description = "the username for swift")
-    private String username;
-
-    @Parameter(name = ApiConstants.KEY, type = CommandType.STRING, description = " key for the user for swift")
-    private String key;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public String getUrl() {
-        return url;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    public String getAccount() {
-        return account;
-    }
-
-    public String getUsername() {
-        return username;
-    }
-
-    public String getKey() {
-        return key;
-    }
-
-    @Override
-    public String getCommandName() {
-    	return s_name;
-    }
-    
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-    
-    @Override
-    public void execute(){
-        try {
-            Swift result = _resourceService.discoverSwift(this);
-            SwiftResponse swiftResponse = null;
-            if (result != null) {
-                swiftResponse = _responseGenerator.createSwiftResponse(result);
-                swiftResponse.setResponseName(getCommandName());
-                swiftResponse.setObjectName("swift");
-                this.setResponseObject(swiftResponse);
-            } else {
-                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add Swift");
-            }
-        } catch (DiscoveryException ex) {
-            String errMsg = "Failed to add Swift due to " + ex.toString();
-            s_logger.warn(errMsg, ex);
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, errMsg);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/AddTrafficTypeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AddTrafficTypeCmd.java b/api/src/com/cloud/api/commands/AddTrafficTypeCmd.java
deleted file mode 100644
index 7f3f07e..0000000
--- a/api/src/com/cloud/api/commands/AddTrafficTypeCmd.java
+++ /dev/null
@@ -1,158 +0,0 @@
-// 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 com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCreateCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.TrafficTypeResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.network.PhysicalNetworkTrafficType;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-
-@Implementation(description="Adds traffic type to a physical network", responseObject=TrafficTypeResponse.class, since="3.0.0")
-public class AddTrafficTypeCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(AddTrafficTypeCmd.class.getName());
-
-    private static final String s_name = "addtraffictyperesponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-    
-    @IdentityMapper(entityTableName="physical_network")
-    @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, required=true, description="the Physical Network ID")
-    private Long physicalNetworkId;
-    
-    @Parameter(name=ApiConstants.TRAFFIC_TYPE, type=CommandType.STRING, required=true, description="the trafficType to be added to the physical network")
-    private String trafficType;
-    
-    @Parameter(name=ApiConstants.XEN_NETWORK_LABEL, type=CommandType.STRING, description="The network name label of the physical device dedicated to this traffic on a XenServer host")
-    private String xenLabel;
-    
-    @Parameter(name=ApiConstants.KVM_NETWORK_LABEL, type=CommandType.STRING, description="The network name label of the physical device dedicated to this traffic on a KVM host")
-    private String kvmLabel;
-    
-    @Parameter(name=ApiConstants.VMWARE_NETWORK_LABEL, type=CommandType.STRING, description="The network name label of the physical device dedicated to this traffic on a VMware host")
-    private String vmwareLabel;
-        
-    @Parameter(name=ApiConstants.VLAN, type=CommandType.STRING, description="The VLAN id to be used for Management traffic by VMware host")
-    private String vlan;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-    
-    @Override
-    public String getEntityTable() {
-        return "physical_network_traffic_types";
-    }
-
-    public Long getPhysicalNetworkId() {
-        return physicalNetworkId;
-    }
-
-    public String getTrafficType() {
-        return trafficType;
-    }
-
-    public String getXenLabel() {
-        return xenLabel;
-    }
-
-    public String getKvmLabel() {
-        return kvmLabel;
-    }
-
-    public String getVmwareLabel() {
-        return vmwareLabel;
-    }
-    
-    public String getSimulatorLabel() {
-    	//simulators will have no labels
-    	return null; 
-    }
-
-    public void setVlan(String vlan) {
-        this.vlan = vlan;
-    }
-
-    public String getVlan() {
-        return vlan;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-    
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-    
-    @Override
-    public void execute(){
-        UserContext.current().setEventDetails("TrafficType Id: "+getEntityId());
-        PhysicalNetworkTrafficType result = _networkService.getPhysicalNetworkTrafficType(getEntityId());
-        if (result != null) {
-            TrafficTypeResponse response = _responseGenerator.createTrafficTypeResponse(result);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        }else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add traffic type to physical network");
-        }
-    }
-
-    @Override
-    public void create() throws ResourceAllocationException {
-        PhysicalNetworkTrafficType result = _networkService.addTrafficTypeToPhysicalNetwork(getPhysicalNetworkId(), getTrafficType(), getXenLabel(), getKvmLabel(), getVmwareLabel(), getSimulatorLabel(), getVlan());
-        if (result != null) {
-            setEntityId(result.getId());
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add traffic type to physical network");
-        }        
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_TRAFFIC_TYPE_CREATE;
-    }
-    
-    @Override
-    public String getEventDescription() {
-        return  "Adding physical network traffic type: " + getEntityId();
-    }
-    
-    @Override
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.TrafficType;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/AddVpnUserCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AddVpnUserCmd.java b/api/src/com/cloud/api/commands/AddVpnUserCmd.java
deleted file mode 100644
index 10dc11a..0000000
--- a/api/src/com/cloud/api/commands/AddVpnUserCmd.java
+++ /dev/null
@@ -1,150 +0,0 @@
-// 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 com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCreateCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.VpnUsersResponse;
-import com.cloud.domain.Domain;
-import com.cloud.event.EventTypes;
-import com.cloud.network.VpnUser;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-
-@Implementation(description="Adds vpn users", responseObject=VpnUsersResponse.class)
-public class AddVpnUserCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(AddVpnUserCmd.class.getName());
-
-    private static final String s_name = "addvpnuserresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-    @Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required=true, description="username for the vpn user")
-    private String userName;
-    
-    @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required=true, description="password for the username")
-    private String password;
-    
-    @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="an optional account for the vpn user. Must be used with domainId.")
-    private String accountName;
-    
-    @IdentityMapper(entityTableName="projects")
-    @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="add vpn user to the specific project")
-    private Long projectId;
-
-    @IdentityMapper(entityTableName="domain")
-    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="an optional domainId for the vpn user. If the account parameter is used, domainId must also be used.")
-    private Long domainId;
-    
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-
-	public String getAccountName() {
-		return accountName;
-	}
-
-	public Long getDomainId() {
-		return domainId;
-	}
-
-	public String getUserName() {
-		return userName;
-	}
-	
-	public String getPassword() {
-		return password;
-	}
-	
-	public Long getProjectId() {
-	    return projectId;
-	}
-	
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-	@Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-	@Override
-	public long getEntityOwnerId() {
-        Long accountId = finalyzeAccountId(accountName, domainId, projectId, true);
-        if (accountId == null) {
-            return UserContext.current().getCaller().getId();
-        }
-        
-        return accountId;
-    }
-	
-    public String getEntityTable() {
-    	return "vpn_users";
-    }
-
-	@Override
-	public String getEventDescription() {
-		return "Add Remote Access VPN user for account " + getEntityOwnerId() + " username= " + getUserName();
-	}
-
-	@Override
-	public String getEventType() {
-		return EventTypes.EVENT_VPN_USER_ADD;
-	}
-
-    @Override
-    public void execute(){
-            VpnUser vpnUser = _entityMgr.findById(VpnUser.class, getEntityId());
-            Account account = _entityMgr.findById(Account.class, vpnUser.getAccountId());
-            if (!_ravService.applyVpnUsers(vpnUser.getAccountId(), userName)) {
-                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add vpn user");
-            }
-            
-            VpnUsersResponse vpnResponse = new VpnUsersResponse();
-            vpnResponse.setId(vpnUser.getId());
-            vpnResponse.setUserName(vpnUser.getUsername());
-            vpnResponse.setAccountName(account.getAccountName());
-            
-            vpnResponse.setDomainId(account.getDomainId());
-            vpnResponse.setDomainName(_entityMgr.findById(Domain.class, account.getDomainId()).getName());
-            
-            vpnResponse.setResponseName(getCommandName());
-            vpnResponse.setObjectName("vpnuser");
-            this.setResponseObject(vpnResponse);
-    }
-
-    @Override
-    public void create() {
-        Account owner = _accountService.getAccount(getEntityOwnerId());
-     
-        VpnUser vpnUser = _ravService.addVpnUser(owner.getId(), userName, password);
-        if (vpnUser == null) {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add vpn user");
-        }
-        setEntityId(vpnUser.getId());
-    }	
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java b/api/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java
deleted file mode 100644
index 2a88e87..0000000
--- a/api/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java
+++ /dev/null
@@ -1,121 +0,0 @@
-// 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 com.cloud.api.commands;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.SuccessResponse;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.network.rules.LoadBalancer;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-import com.cloud.utils.StringUtils;
-
-@Implementation(description="Assigns virtual machine or a list of virtual machines to a load balancer rule.", responseObject=SuccessResponse.class)
-public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(AssignToLoadBalancerRuleCmd.class.getName());
-
-    private static final String s_name = "assigntoloadbalancerruleresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="firewall_rules")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the load balancer rule")
-    private Long id;
-
-    @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.VIRTUAL_MACHINE_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, required=true, description="the list of IDs of the virtual machine that are being assigned to the load balancer rule(i.e. virtualMachineIds=1,2,3)")
-    private List<Long> virtualMachineIds;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getLoadBalancerId() {
-        return id;
-    }
-
-    public List<Long> getVirtualMachineIds() {
-        return virtualMachineIds;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        LoadBalancer lb = _entityMgr.findById(LoadBalancer.class, getLoadBalancerId());
-        if (lb == null) {
-            return Account.ACCOUNT_ID_SYSTEM; // bad id given, parent this command to SYSTEM so ERROR events are tracked
-        }
-        return lb.getAccountId();
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_ASSIGN_TO_LOAD_BALANCER_RULE;
-    }
-
-    @Override
-    public String getEventDescription() {
-        return "applying instances for load balancer: " + getLoadBalancerId() + " (ids: " + StringUtils.join(getVirtualMachineIds(), ",") + ")";
-    }
-    
-    @Override
-    public void execute(){
-        UserContext.current().setEventDetails("Load balancer Id: "+getLoadBalancerId()+" VmIds: "+StringUtils.join(getVirtualMachineIds(), ","));
-        boolean result = _lbService.assignToLoadBalancer(getLoadBalancerId(), virtualMachineIds);
-        if (result) {
-            SuccessResponse response = new SuccessResponse(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to assign load balancer rule");
-        }
-    }
-    
-    @Override
-    public String getSyncObjType() {
-        return BaseAsyncCmd.networkSyncObject;
-    }
-
-    @Override
-    public Long getSyncObjId() {
-    	LoadBalancer lb = _lbService.findById(id);
-    	if(lb == null){
-    		throw new InvalidParameterValueException("Unable to find load balancer rule: " + id);
-    	}
-        return lb.getNetworkId();
-    }
-}