You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2012/12/06 20:14:32 UTC

[7/14] git commit: api_refactor: move admin level domain apis to admin pkg

api_refactor: move admin level domain apis to admin pkg

Signed-off-by: Rohit Yadav <bh...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/ab4fac54
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/ab4fac54
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/ab4fac54

Branch: refs/heads/api_refactoring
Commit: ab4fac54e52b2f4770c9b1b14fb3f7d3d70d4006
Parents: c385367
Author: Rohit Yadav <bh...@apache.org>
Authored: Thu Dec 6 10:44:40 2012 -0800
Committer: Rohit Yadav <bh...@apache.org>
Committed: Thu Dec 6 10:44:40 2012 -0800

----------------------------------------------------------------------
 .../com/cloud/api/commands/CreateDomainCmd.java    |   94 -------------
 .../com/cloud/api/commands/DeleteDomainCmd.java    |  103 ---------------
 .../cloud/api/commands/ListDomainChildrenCmd.java  |  101 --------------
 api/src/com/cloud/api/commands/ListDomainsCmd.java |  101 --------------
 .../com/cloud/api/commands/UpdateDomainCmd.java    |   93 -------------
 api/src/com/cloud/server/ManagementService.java    |    2 +-
 api/src/com/cloud/user/DomainService.java          |    4 +-
 .../api/admin/domain/command/CreateDomainCmd.java  |   94 +++++++++++++
 .../api/admin/domain/command/DeleteDomainCmd.java  |  103 +++++++++++++++
 .../domain/command/ListDomainChildrenCmd.java      |  101 ++++++++++++++
 .../api/admin/domain/command/ListDomainsCmd.java   |  101 ++++++++++++++
 .../api/admin/domain/command/UpdateDomainCmd.java  |   93 +++++++++++++
 client/tomcatconf/commands.properties.in           |   10 +-
 .../src/com/cloud/server/ManagementServerImpl.java |    2 +-
 server/src/com/cloud/user/DomainManagerImpl.java   |    4 +-
 .../test/com/cloud/user/MockDomainManagerImpl.java |    4 +-
 16 files changed, 505 insertions(+), 505 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ab4fac54/api/src/com/cloud/api/commands/CreateDomainCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreateDomainCmd.java b/api/src/com/cloud/api/commands/CreateDomainCmd.java
deleted file mode 100644
index 62598f2..0000000
--- a/api/src/com/cloud/api/commands/CreateDomainCmd.java
+++ /dev/null
@@ -1,94 +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 org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.DomainResponse;
-import com.cloud.domain.Domain;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-
-@Implementation(description="Creates a domain", responseObject=DomainResponse.class)
-public class CreateDomainCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateDomainCmd.class.getName());
-
-    private static final String s_name = "createdomainresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="creates domain with this name")
-    private String domainName;
-
-    @IdentityMapper(entityTableName="domain")
-    @Parameter(name=ApiConstants.PARENT_DOMAIN_ID, type=CommandType.LONG, description="assigns new domain a parent domain by domain ID of the parent.  If no parent domain is specied, the ROOT domain is assumed.")
-    private Long parentDomainId;
-
-    @Parameter(name=ApiConstants.NETWORK_DOMAIN, type=CommandType.STRING, description="Network domain for networks in the domain")
-    private String networkDomain;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public String getDomainName() {
-        return domainName;
-    }
-
-    public Long getParentDomainId() {
-        return parentDomainId;
-    }
-
-    public String getNetworkDomain() {
-        return networkDomain;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// 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("Domain Name: "+getDomainName()+((getParentDomainId()!=null)?", Parent DomainId :"+getParentDomainId():""));
-        Domain domain = _domainService.createDomain(getDomainName(), getParentDomainId(), getNetworkDomain());
-        if (domain != null) {
-            DomainResponse response = _responseGenerator.createDomainResponse(domain);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create domain");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ab4fac54/api/src/com/cloud/api/commands/DeleteDomainCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/DeleteDomainCmd.java b/api/src/com/cloud/api/commands/DeleteDomainCmd.java
deleted file mode 100644
index 07e1b8e..0000000
--- a/api/src/com/cloud/api/commands/DeleteDomainCmd.java
+++ /dev/null
@@ -1,103 +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 org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.SuccessResponse;
-import com.cloud.domain.Domain;
-import com.cloud.event.EventTypes;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-
-@Implementation(description="Deletes a specified domain", responseObject=SuccessResponse.class)
-public class DeleteDomainCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteDomainCmd.class.getName());
-    private static final String s_name = "deletedomainresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="domain")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="ID of domain to delete")
-    private Long id;
-
-    @Parameter(name=ApiConstants.CLEANUP, type=CommandType.BOOLEAN, description="true if all domain resources (child domains, accounts) have to be cleaned up, false otherwise")
-    private Boolean cleanup;
-
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    public Boolean getCleanup() {
-        return cleanup;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        Domain domain = _entityMgr.findById(Domain.class, getId());
-        if (domain != null) {
-            return domain.getAccountId();
-        }
-
-        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_DOMAIN_DELETE;
-    }
-
-    @Override
-    public String getEventDescription() {
-        return  "deleting domain: " + getId();
-    }
-
-    @Override
-    public void execute(){
-        UserContext.current().setEventDetails("Domain Id: "+getId());
-        boolean result = _domainService.deleteDomain(id, cleanup);
-        if (result) {
-            SuccessResponse response = new SuccessResponse(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete domain");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ab4fac54/api/src/com/cloud/api/commands/ListDomainChildrenCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/ListDomainChildrenCmd.java b/api/src/com/cloud/api/commands/ListDomainChildrenCmd.java
deleted file mode 100644
index e432c0f..0000000
--- a/api/src/com/cloud/api/commands/ListDomainChildrenCmd.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 java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseListCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import com.cloud.api.response.DomainResponse;
-import com.cloud.api.response.ListResponse;
-import com.cloud.domain.Domain;
-import com.cloud.utils.Pair;
-
-@Implementation(description="Lists all children domains belonging to a specified domain", responseObject=DomainResponse.class)
-public class ListDomainChildrenCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListDomainChildrenCmd.class.getName());
-
-    private static final String s_name = "listdomainchildrenresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="domain")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="list children domain by parent domain ID.")
-    private Long id;
-
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="list children domains by name")
-    private String domainName;
-
-    @Parameter(name=ApiConstants.IS_RECURSIVE, type=CommandType.BOOLEAN, description="to return the entire tree, use the value \"true\". To return the first level children, use the value \"false\".")
-    private Boolean recursive;
-
-    @Parameter(name=ApiConstants.LIST_ALL, type=CommandType.BOOLEAN, description="If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false")
-    private Boolean listAll;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    public String getDomainName() {
-        return domainName;
-    }
-
-    public boolean listAll() {
-        return listAll == null ? false : listAll;
-    }
-
-    public boolean isRecursive() {
-        return recursive == null ? false : recursive;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public void execute(){
-        Pair<List<? extends Domain>, Integer> result = _domainService.searchForDomainChildren(this);
-        ListResponse<DomainResponse> response = new ListResponse<DomainResponse>();
-        List<DomainResponse> domainResponses = new ArrayList<DomainResponse>();
-        for (Domain domain : result.first()) {
-            DomainResponse domainResponse = _responseGenerator.createDomainResponse(domain);
-            domainResponse.setObjectName("domain");
-            domainResponses.add(domainResponse);
-        }
-
-        response.setResponses(domainResponses, result.second());
-        response.setResponseName(getCommandName());
-        this.setResponseObject(response);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ab4fac54/api/src/com/cloud/api/commands/ListDomainsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/ListDomainsCmd.java b/api/src/com/cloud/api/commands/ListDomainsCmd.java
deleted file mode 100644
index 7e4b613..0000000
--- a/api/src/com/cloud/api/commands/ListDomainsCmd.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 java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseListCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import com.cloud.api.response.DomainResponse;
-import com.cloud.api.response.ListResponse;
-import com.cloud.domain.Domain;
-import com.cloud.utils.Pair;
-
-@Implementation(description="Lists domains and provides detailed information for listed domains", responseObject=DomainResponse.class)
-public class ListDomainsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListDomainsCmd.class.getName());
-
-    private static final String s_name = "listdomainsresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="domain")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="List domain by domain ID.")
-    private Long id;
-
-    @Parameter(name=ApiConstants.LEVEL, type=CommandType.INTEGER, description="List domains by domain level.")
-    private Integer level;
-
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="List domain by domain name.")
-    private String domainName;
-
-    @Parameter(name=ApiConstants.LIST_ALL, type=CommandType.BOOLEAN, description="If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false")
-    private Boolean listAll;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    public Integer getLevel() {
-        return level;
-    }
-
-    public String getDomainName() {
-        return domainName;
-    }
-
-    public boolean listAll() {
-        return listAll == null ? false : listAll;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public void execute(){
-        Pair<List<? extends Domain>, Integer> result = _domainService.searchForDomains(this);
-        ListResponse<DomainResponse> response = new ListResponse<DomainResponse>();
-        List<DomainResponse> domainResponses = new ArrayList<DomainResponse>();
-        for (Domain domain : result.first()) {
-            DomainResponse domainResponse = _responseGenerator.createDomainResponse(domain);
-            domainResponse.setObjectName("domain");
-            domainResponses.add(domainResponse);
-        }
-
-        response.setResponses(domainResponses, result.second());
-        response.setResponseName(getCommandName());
-        this.setResponseObject(response);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ab4fac54/api/src/com/cloud/api/commands/UpdateDomainCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateDomainCmd.java b/api/src/com/cloud/api/commands/UpdateDomainCmd.java
deleted file mode 100644
index 950dff6..0000000
--- a/api/src/com/cloud/api/commands/UpdateDomainCmd.java
+++ /dev/null
@@ -1,93 +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 org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.DomainResponse;
-import com.cloud.domain.Domain;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-
-@Implementation(description="Updates a domain with a new name", responseObject=DomainResponse.class)
-public class UpdateDomainCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateDomainCmd.class.getName());
-    private static final String s_name = "updatedomainresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="domain")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="ID of domain to update")
-    private Long id;
-
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="updates domain with this name")
-    private String domainName;
-
-    @Parameter(name=ApiConstants.NETWORK_DOMAIN, type=CommandType.STRING, description="Network domain for the domain's networks; empty string will update domainName with NULL value")
-    private String networkDomain;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    public String getDomainName() {
-        return domainName;
-    }
-
-    public String getNetworkDomain() {
-        return networkDomain;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// 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("Domain Id: "+getId());
-        Domain domain = _mgr.updateDomain(this);
-        if (domain != null) {
-            DomainResponse response = _responseGenerator.createDomainResponse(domain);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update domain");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ab4fac54/api/src/com/cloud/server/ManagementService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/server/ManagementService.java b/api/src/com/cloud/server/ManagementService.java
index 936bb79..e77fe15 100755
--- a/api/src/com/cloud/server/ManagementService.java
+++ b/api/src/com/cloud/server/ManagementService.java
@@ -57,7 +57,7 @@ import org.apache.cloudstack.api.user.zone.command.ListZonesByCmd;
 import org.apache.cloudstack.api.admin.systemvm.command.RebootSystemVmCmd;
 import org.apache.cloudstack.api.user.ssh.command.RegisterSSHKeyPairCmd;
 import org.apache.cloudstack.api.admin.systemvm.command.StopSystemVmCmd;
-import com.cloud.api.commands.UpdateDomainCmd;
+import org.apache.cloudstack.api.admin.domain.command.UpdateDomainCmd;
 import org.apache.cloudstack.api.user.iso.command.UpdateIsoCmd;
 import org.apache.cloudstack.api.user.vmgroup.command.UpdateVMGroupCmd;
 import org.apache.cloudstack.api.admin.systemvm.command.UpgradeSystemVMCmd;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ab4fac54/api/src/com/cloud/user/DomainService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/user/DomainService.java b/api/src/com/cloud/user/DomainService.java
index 3d31244..78c9a54 100644
--- a/api/src/com/cloud/user/DomainService.java
+++ b/api/src/com/cloud/user/DomainService.java
@@ -18,8 +18,8 @@ package com.cloud.user;
 
 import java.util.List;
 
-import com.cloud.api.commands.ListDomainChildrenCmd;
-import com.cloud.api.commands.ListDomainsCmd;
+import org.apache.cloudstack.api.admin.domain.command.ListDomainChildrenCmd;
+import org.apache.cloudstack.api.admin.domain.command.ListDomainsCmd;
 import com.cloud.domain.Domain;
 import com.cloud.exception.PermissionDeniedException;
 import com.cloud.utils.Pair;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ab4fac54/api/src/org/apache/cloudstack/api/admin/domain/command/CreateDomainCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/domain/command/CreateDomainCmd.java b/api/src/org/apache/cloudstack/api/admin/domain/command/CreateDomainCmd.java
new file mode 100644
index 0000000..86e7705
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/admin/domain/command/CreateDomainCmd.java
@@ -0,0 +1,94 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.admin.domain.command;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.IdentityMapper;
+import org.apache.cloudstack.api.Implementation;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import com.cloud.api.response.DomainResponse;
+import com.cloud.domain.Domain;
+import com.cloud.user.Account;
+import com.cloud.user.UserContext;
+
+@Implementation(description="Creates a domain", responseObject=DomainResponse.class)
+public class CreateDomainCmd extends BaseCmd {
+    public static final Logger s_logger = Logger.getLogger(CreateDomainCmd.class.getName());
+
+    private static final String s_name = "createdomainresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="creates domain with this name")
+    private String domainName;
+
+    @IdentityMapper(entityTableName="domain")
+    @Parameter(name=ApiConstants.PARENT_DOMAIN_ID, type=CommandType.LONG, description="assigns new domain a parent domain by domain ID of the parent.  If no parent domain is specied, the ROOT domain is assumed.")
+    private Long parentDomainId;
+
+    @Parameter(name=ApiConstants.NETWORK_DOMAIN, type=CommandType.STRING, description="Network domain for networks in the domain")
+    private String networkDomain;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public String getDomainName() {
+        return domainName;
+    }
+
+    public Long getParentDomainId() {
+        return parentDomainId;
+    }
+
+    public String getNetworkDomain() {
+        return networkDomain;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// 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("Domain Name: "+getDomainName()+((getParentDomainId()!=null)?", Parent DomainId :"+getParentDomainId():""));
+        Domain domain = _domainService.createDomain(getDomainName(), getParentDomainId(), getNetworkDomain());
+        if (domain != null) {
+            DomainResponse response = _responseGenerator.createDomainResponse(domain);
+            response.setResponseName(getCommandName());
+            this.setResponseObject(response);
+        } else {
+            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create domain");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ab4fac54/api/src/org/apache/cloudstack/api/admin/domain/command/DeleteDomainCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/domain/command/DeleteDomainCmd.java b/api/src/org/apache/cloudstack/api/admin/domain/command/DeleteDomainCmd.java
new file mode 100644
index 0000000..2c372ba
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/admin/domain/command/DeleteDomainCmd.java
@@ -0,0 +1,103 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.admin.domain.command;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.IdentityMapper;
+import org.apache.cloudstack.api.Implementation;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import com.cloud.api.response.SuccessResponse;
+import com.cloud.domain.Domain;
+import com.cloud.event.EventTypes;
+import com.cloud.user.Account;
+import com.cloud.user.UserContext;
+
+@Implementation(description="Deletes a specified domain", responseObject=SuccessResponse.class)
+public class DeleteDomainCmd extends BaseAsyncCmd {
+    public static final Logger s_logger = Logger.getLogger(DeleteDomainCmd.class.getName());
+    private static final String s_name = "deletedomainresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @IdentityMapper(entityTableName="domain")
+    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="ID of domain to delete")
+    private Long id;
+
+    @Parameter(name=ApiConstants.CLEANUP, type=CommandType.BOOLEAN, description="true if all domain resources (child domains, accounts) have to be cleaned up, false otherwise")
+    private Boolean cleanup;
+
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getId() {
+        return id;
+    }
+
+    public Boolean getCleanup() {
+        return cleanup;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public long getEntityOwnerId() {
+        Domain domain = _entityMgr.findById(Domain.class, getId());
+        if (domain != null) {
+            return domain.getAccountId();
+        }
+
+        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
+    }
+
+    @Override
+    public String getEventType() {
+        return EventTypes.EVENT_DOMAIN_DELETE;
+    }
+
+    @Override
+    public String getEventDescription() {
+        return  "deleting domain: " + getId();
+    }
+
+    @Override
+    public void execute(){
+        UserContext.current().setEventDetails("Domain Id: "+getId());
+        boolean result = _domainService.deleteDomain(id, cleanup);
+        if (result) {
+            SuccessResponse response = new SuccessResponse(getCommandName());
+            this.setResponseObject(response);
+        } else {
+            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete domain");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ab4fac54/api/src/org/apache/cloudstack/api/admin/domain/command/ListDomainChildrenCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/domain/command/ListDomainChildrenCmd.java b/api/src/org/apache/cloudstack/api/admin/domain/command/ListDomainChildrenCmd.java
new file mode 100644
index 0000000..5aee062
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/admin/domain/command/ListDomainChildrenCmd.java
@@ -0,0 +1,101 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.admin.domain.command;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseListCmd;
+import org.apache.cloudstack.api.IdentityMapper;
+import org.apache.cloudstack.api.Implementation;
+import org.apache.cloudstack.api.Parameter;
+import com.cloud.api.response.DomainResponse;
+import com.cloud.api.response.ListResponse;
+import com.cloud.domain.Domain;
+import com.cloud.utils.Pair;
+
+@Implementation(description="Lists all children domains belonging to a specified domain", responseObject=DomainResponse.class)
+public class ListDomainChildrenCmd extends BaseListCmd {
+    public static final Logger s_logger = Logger.getLogger(ListDomainChildrenCmd.class.getName());
+
+    private static final String s_name = "listdomainchildrenresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @IdentityMapper(entityTableName="domain")
+    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="list children domain by parent domain ID.")
+    private Long id;
+
+    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="list children domains by name")
+    private String domainName;
+
+    @Parameter(name=ApiConstants.IS_RECURSIVE, type=CommandType.BOOLEAN, description="to return the entire tree, use the value \"true\". To return the first level children, use the value \"false\".")
+    private Boolean recursive;
+
+    @Parameter(name=ApiConstants.LIST_ALL, type=CommandType.BOOLEAN, description="If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false")
+    private Boolean listAll;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getId() {
+        return id;
+    }
+
+    public String getDomainName() {
+        return domainName;
+    }
+
+    public boolean listAll() {
+        return listAll == null ? false : listAll;
+    }
+
+    public boolean isRecursive() {
+        return recursive == null ? false : recursive;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public void execute(){
+        Pair<List<? extends Domain>, Integer> result = _domainService.searchForDomainChildren(this);
+        ListResponse<DomainResponse> response = new ListResponse<DomainResponse>();
+        List<DomainResponse> domainResponses = new ArrayList<DomainResponse>();
+        for (Domain domain : result.first()) {
+            DomainResponse domainResponse = _responseGenerator.createDomainResponse(domain);
+            domainResponse.setObjectName("domain");
+            domainResponses.add(domainResponse);
+        }
+
+        response.setResponses(domainResponses, result.second());
+        response.setResponseName(getCommandName());
+        this.setResponseObject(response);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ab4fac54/api/src/org/apache/cloudstack/api/admin/domain/command/ListDomainsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/domain/command/ListDomainsCmd.java b/api/src/org/apache/cloudstack/api/admin/domain/command/ListDomainsCmd.java
new file mode 100644
index 0000000..e35f772
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/admin/domain/command/ListDomainsCmd.java
@@ -0,0 +1,101 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.admin.domain.command;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseListCmd;
+import org.apache.cloudstack.api.IdentityMapper;
+import org.apache.cloudstack.api.Implementation;
+import org.apache.cloudstack.api.Parameter;
+import com.cloud.api.response.DomainResponse;
+import com.cloud.api.response.ListResponse;
+import com.cloud.domain.Domain;
+import com.cloud.utils.Pair;
+
+@Implementation(description="Lists domains and provides detailed information for listed domains", responseObject=DomainResponse.class)
+public class ListDomainsCmd extends BaseListCmd {
+    public static final Logger s_logger = Logger.getLogger(ListDomainsCmd.class.getName());
+
+    private static final String s_name = "listdomainsresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @IdentityMapper(entityTableName="domain")
+    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="List domain by domain ID.")
+    private Long id;
+
+    @Parameter(name=ApiConstants.LEVEL, type=CommandType.INTEGER, description="List domains by domain level.")
+    private Integer level;
+
+    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="List domain by domain name.")
+    private String domainName;
+
+    @Parameter(name=ApiConstants.LIST_ALL, type=CommandType.BOOLEAN, description="If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false")
+    private Boolean listAll;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getId() {
+        return id;
+    }
+
+    public Integer getLevel() {
+        return level;
+    }
+
+    public String getDomainName() {
+        return domainName;
+    }
+
+    public boolean listAll() {
+        return listAll == null ? false : listAll;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public void execute(){
+        Pair<List<? extends Domain>, Integer> result = _domainService.searchForDomains(this);
+        ListResponse<DomainResponse> response = new ListResponse<DomainResponse>();
+        List<DomainResponse> domainResponses = new ArrayList<DomainResponse>();
+        for (Domain domain : result.first()) {
+            DomainResponse domainResponse = _responseGenerator.createDomainResponse(domain);
+            domainResponse.setObjectName("domain");
+            domainResponses.add(domainResponse);
+        }
+
+        response.setResponses(domainResponses, result.second());
+        response.setResponseName(getCommandName());
+        this.setResponseObject(response);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ab4fac54/api/src/org/apache/cloudstack/api/admin/domain/command/UpdateDomainCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/domain/command/UpdateDomainCmd.java b/api/src/org/apache/cloudstack/api/admin/domain/command/UpdateDomainCmd.java
new file mode 100644
index 0000000..972b46f
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/admin/domain/command/UpdateDomainCmd.java
@@ -0,0 +1,93 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.admin.domain.command;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.IdentityMapper;
+import org.apache.cloudstack.api.Implementation;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import com.cloud.api.response.DomainResponse;
+import com.cloud.domain.Domain;
+import com.cloud.user.Account;
+import com.cloud.user.UserContext;
+
+@Implementation(description="Updates a domain with a new name", responseObject=DomainResponse.class)
+public class UpdateDomainCmd extends BaseCmd {
+    public static final Logger s_logger = Logger.getLogger(UpdateDomainCmd.class.getName());
+    private static final String s_name = "updatedomainresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @IdentityMapper(entityTableName="domain")
+    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="ID of domain to update")
+    private Long id;
+
+    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="updates domain with this name")
+    private String domainName;
+
+    @Parameter(name=ApiConstants.NETWORK_DOMAIN, type=CommandType.STRING, description="Network domain for the domain's networks; empty string will update domainName with NULL value")
+    private String networkDomain;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getId() {
+        return id;
+    }
+
+    public String getDomainName() {
+        return domainName;
+    }
+
+    public String getNetworkDomain() {
+        return networkDomain;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// 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("Domain Id: "+getId());
+        Domain domain = _mgr.updateDomain(this);
+        if (domain != null) {
+            DomainResponse response = _responseGenerator.createDomainResponse(domain);
+            response.setResponseName(getCommandName());
+            this.setResponseObject(response);
+        } else {
+            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update domain");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ab4fac54/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in
index a5d609e..822d344 100755
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@ -39,11 +39,11 @@ enableUser=org.apache.cloudstack.api.admin.user.command.EnableUserCmd;7
 getUser=org.apache.cloudstack.api.admin.user.command.GetUserCmd;1
 
 #### Domain commands
-createDomain=com.cloud.api.commands.CreateDomainCmd;1
-updateDomain=com.cloud.api.commands.UpdateDomainCmd;1
-deleteDomain=com.cloud.api.commands.DeleteDomainCmd;1
-listDomains=com.cloud.api.commands.ListDomainsCmd;7
-listDomainChildren=com.cloud.api.commands.ListDomainChildrenCmd;7
+createDomain=org.apache.cloudstack.api.admin.domain.command.CreateDomainCmd;1
+updateDomain=org.apache.cloudstack.api.admin.domain.command.UpdateDomainCmd;1
+deleteDomain=org.apache.cloudstack.api.admin.domain.command.DeleteDomainCmd;1
+listDomains=org.apache.cloudstack.api.admin.domain.command.ListDomainsCmd;7
+listDomainChildren=org.apache.cloudstack.api.admin.domain.command.ListDomainChildrenCmd;7
 
 ####Cloud Identifier commands
 getCloudIdentifier=org.apache.cloudstack.api.user.resource.command.GetCloudIdentifierCmd;15

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ab4fac54/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index 7ee9fdf..ecaa8cb 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -90,7 +90,7 @@ import org.apache.cloudstack.api.admin.systemvm.command.ListSystemVMsCmd;
 import com.cloud.api.commands.ListVlanIpRangesCmd;
 import org.apache.cloudstack.api.admin.systemvm.command.RebootSystemVmCmd;
 import org.apache.cloudstack.api.admin.systemvm.command.StopSystemVmCmd;
-import com.cloud.api.commands.UpdateDomainCmd;
+import org.apache.cloudstack.api.admin.domain.command.UpdateDomainCmd;
 import org.apache.cloudstack.api.admin.host.command.UpdateHostPasswordCmd;
 import org.apache.cloudstack.api.user.iso.command.UpdateIsoCmd;
 import com.cloud.api.commands.UpdateTemplateOrIsoCmd;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ab4fac54/server/src/com/cloud/user/DomainManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/user/DomainManagerImpl.java b/server/src/com/cloud/user/DomainManagerImpl.java
index c234616..3e8e226 100644
--- a/server/src/com/cloud/user/DomainManagerImpl.java
+++ b/server/src/com/cloud/user/DomainManagerImpl.java
@@ -24,10 +24,10 @@ import java.util.Set;
 import javax.ejb.Local;
 import javax.naming.ConfigurationException;
 
+import org.apache.cloudstack.api.admin.domain.command.ListDomainChildrenCmd;
 import org.apache.log4j.Logger;
 
-import com.cloud.api.commands.ListDomainChildrenCmd;
-import com.cloud.api.commands.ListDomainsCmd;
+import org.apache.cloudstack.api.admin.domain.command.ListDomainsCmd;
 import com.cloud.configuration.ResourceLimit;
 import com.cloud.configuration.dao.ResourceCountDao;
 import com.cloud.domain.Domain;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ab4fac54/server/test/com/cloud/user/MockDomainManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/user/MockDomainManagerImpl.java b/server/test/com/cloud/user/MockDomainManagerImpl.java
index 4266f35..dc98692 100644
--- a/server/test/com/cloud/user/MockDomainManagerImpl.java
+++ b/server/test/com/cloud/user/MockDomainManagerImpl.java
@@ -23,8 +23,8 @@ import java.util.Set;
 import javax.ejb.Local;
 import javax.naming.ConfigurationException;
 
-import com.cloud.api.commands.ListDomainChildrenCmd;
-import com.cloud.api.commands.ListDomainsCmd;
+import org.apache.cloudstack.api.admin.domain.command.ListDomainChildrenCmd;
+import org.apache.cloudstack.api.admin.domain.command.ListDomainsCmd;
 import com.cloud.domain.Domain;
 import com.cloud.domain.DomainVO;
 import com.cloud.exception.PermissionDeniedException;