api_refactor: refactor register apis

- Split register apis across template, iso and ssh pkgs
- Fix refactored apis, mappings in commands*.in
- Fix comments etc.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2012-12-03 23:54:19 -08:00
parent 316e7f226a
commit add1b9b055
12 changed files with 21 additions and 25 deletions

View File

@ -54,7 +54,7 @@ import org.apache.cloudstack.api.user.vmgroup.command.ListVMGroupsCmd;
import com.cloud.api.commands.ListVlanIpRangesCmd; import com.cloud.api.commands.ListVlanIpRangesCmd;
import com.cloud.api.commands.ListZonesByCmd; import com.cloud.api.commands.ListZonesByCmd;
import com.cloud.api.commands.RebootSystemVmCmd; import com.cloud.api.commands.RebootSystemVmCmd;
import com.cloud.api.commands.RegisterSSHKeyPairCmd; import org.apache.cloudstack.api.user.ssh.command.RegisterSSHKeyPairCmd;
import com.cloud.api.commands.StopSystemVmCmd; import com.cloud.api.commands.StopSystemVmCmd;
import com.cloud.api.commands.UpdateDomainCmd; import com.cloud.api.commands.UpdateDomainCmd;
import com.cloud.api.commands.UpdateHostPasswordCmd; import com.cloud.api.commands.UpdateHostPasswordCmd;

View File

@ -19,14 +19,14 @@ package com.cloud.template;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.util.List; import java.util.List;
import org.apache.cloudstack.api.user.iso.command.RegisterIsoCmd;
import org.apache.cloudstack.api.user.template.command.CopyTemplateCmd; import org.apache.cloudstack.api.user.template.command.CopyTemplateCmd;
import org.apache.cloudstack.api.user.iso.command.DeleteIsoCmd; import org.apache.cloudstack.api.user.iso.command.DeleteIsoCmd;
import org.apache.cloudstack.api.user.template.command.DeleteTemplateCmd; import org.apache.cloudstack.api.user.template.command.DeleteTemplateCmd;
import org.apache.cloudstack.api.user.iso.command.ExtractIsoCmd; import org.apache.cloudstack.api.user.iso.command.ExtractIsoCmd;
import org.apache.cloudstack.api.user.template.command.ExtractTemplateCmd; import org.apache.cloudstack.api.user.template.command.ExtractTemplateCmd;
import com.cloud.api.commands.ListTemplateOrIsoPermissionsCmd; import com.cloud.api.commands.ListTemplateOrIsoPermissionsCmd;
import com.cloud.api.commands.RegisterIsoCmd; import org.apache.cloudstack.api.user.template.command.RegisterTemplateCmd;
import com.cloud.api.commands.RegisterTemplateCmd;
import com.cloud.api.commands.UpdateTemplateOrIsoPermissionsCmd; import com.cloud.api.commands.UpdateTemplateOrIsoPermissionsCmd;
import com.cloud.exception.InternalErrorException; import com.cloud.exception.InternalErrorException;
import com.cloud.exception.ResourceAllocationException; import com.cloud.exception.ResourceAllocationException;

View File

@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the // KIND, either express or implied. See the License for the
// specific language governing permissions and limitations // specific language governing permissions and limitations
// under the License. // under the License.
package com.cloud.api.commands; package org.apache.cloudstack.api.user.iso.command;
import java.util.List; import java.util.List;

View File

@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the // KIND, either express or implied. See the License for the
// specific language governing permissions and limitations // specific language governing permissions and limitations
// under the License. // under the License.
package com.cloud.api.commands; package org.apache.cloudstack.api.user.ssh.command;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;

View File

@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the // KIND, either express or implied. See the License for the
// specific language governing permissions and limitations // specific language governing permissions and limitations
// under the License. // under the License.
package com.cloud.api.commands; package org.apache.cloudstack.api.user.template.command;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.util.Collection; import java.util.Collection;

View File

@ -80,7 +80,7 @@ listSnapshotPolicies=org.apache.cloudstack.api.user.snapshot.command.ListSnapsho
#### template commands #### template commands
createTemplate=org.apache.cloudstack.api.user.template.command.CreateTemplateCmd;15 createTemplate=org.apache.cloudstack.api.user.template.command.CreateTemplateCmd;15
registerTemplate=com.cloud.api.commands.RegisterTemplateCmd;15 registerTemplate=org.apache.cloudstack.api.user.template.command.RegisterTemplateCmd;15
updateTemplate=org.apache.cloudstack.api.user.template.command.UpdateTemplateCmd;15 updateTemplate=org.apache.cloudstack.api.user.template.command.UpdateTemplateCmd;15
copyTemplate=org.apache.cloudstack.api.user.template.command.CopyTemplateCmd;15 copyTemplate=org.apache.cloudstack.api.user.template.command.CopyTemplateCmd;15
deleteTemplate=org.apache.cloudstack.api.user.template.command.DeleteTemplateCmd;15 deleteTemplate=org.apache.cloudstack.api.user.template.command.DeleteTemplateCmd;15
@ -94,7 +94,7 @@ prepareTemplate=com.cloud.api.commands.PrepareTemplateCmd;1
attachIso=org.apache.cloudstack.api.user.iso.command.AttachIsoCmd;15 attachIso=org.apache.cloudstack.api.user.iso.command.AttachIsoCmd;15
detachIso=org.apache.cloudstack.api.user.iso.command.DetachIsoCmd;15 detachIso=org.apache.cloudstack.api.user.iso.command.DetachIsoCmd;15
listIsos=org.apache.cloudstack.api.user.iso.command.ListIsosCmd;15 listIsos=org.apache.cloudstack.api.user.iso.command.ListIsosCmd;15
registerIso=com.cloud.api.commands.RegisterIsoCmd;15 registerIso=org.apache.cloudstack.api.user.iso.command.RegisterIsoCmd;15
updateIso=org.apache.cloudstack.api.user.iso.command.UpdateIsoCmd;15 updateIso=org.apache.cloudstack.api.user.iso.command.UpdateIsoCmd;15
deleteIso=org.apache.cloudstack.api.user.iso.command.DeleteIsoCmd;15 deleteIso=org.apache.cloudstack.api.user.iso.command.DeleteIsoCmd;15
copyIso=org.apache.cloudstack.api.user.template.command.CopyTemplateCmd;15 copyIso=org.apache.cloudstack.api.user.template.command.CopyTemplateCmd;15
@ -316,7 +316,7 @@ restartNetwork=org.apache.cloudstack.api.user.network.command.RestartNetworkCmd;
updateNetwork=org.apache.cloudstack.api.user.network.command.UpdateNetworkCmd;15 updateNetwork=org.apache.cloudstack.api.user.network.command.UpdateNetworkCmd;15
#### SSH key pair commands #### SSH key pair commands
registerSSHKeyPair=com.cloud.api.commands.RegisterSSHKeyPairCmd;15 registerSSHKeyPair=org.apache.cloudstack.api.user.ssh.command.RegisterSSHKeyPairCmd;15
createSSHKeyPair=org.apache.cloudstack.api.user.ssh.command.CreateSSHKeyPairCmd;15 createSSHKeyPair=org.apache.cloudstack.api.user.ssh.command.CreateSSHKeyPairCmd;15
deleteSSHKeyPair=org.apache.cloudstack.api.user.ssh.command.DeleteSSHKeyPairCmd;15 deleteSSHKeyPair=org.apache.cloudstack.api.user.ssh.command.DeleteSSHKeyPairCmd;15
listSSHKeyPairs=org.apache.cloudstack.api.user.ssh.command.ListSSHKeyPairsCmd;15 listSSHKeyPairs=org.apache.cloudstack.api.user.ssh.command.ListSSHKeyPairsCmd;15

View File

@ -22,10 +22,10 @@ import java.util.List;
import javax.ejb.Local; import javax.ejb.Local;
import org.apache.cloudstack.api.user.iso.command.DeleteIsoCmd; import org.apache.cloudstack.api.user.iso.command.DeleteIsoCmd;
import org.apache.cloudstack.api.user.iso.command.RegisterIsoCmd;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import com.cloud.api.commands.RegisterIsoCmd; import org.apache.cloudstack.api.user.template.command.RegisterTemplateCmd;
import com.cloud.api.commands.RegisterTemplateCmd;
import com.cloud.configuration.Resource.ResourceType; import com.cloud.configuration.Resource.ResourceType;
import com.cloud.dc.DataCenterVO; import com.cloud.dc.DataCenterVO;
import com.cloud.event.EventTypes; import com.cloud.event.EventTypes;

View File

@ -44,6 +44,7 @@ import javax.crypto.spec.SecretKeySpec;
import org.apache.cloudstack.api.user.iso.command.ListIsosCmd; import org.apache.cloudstack.api.user.iso.command.ListIsosCmd;
import org.apache.cloudstack.api.user.ssh.command.DeleteSSHKeyPairCmd; import org.apache.cloudstack.api.user.ssh.command.DeleteSSHKeyPairCmd;
import org.apache.cloudstack.api.user.ssh.command.RegisterSSHKeyPairCmd;
import org.apache.cloudstack.api.user.template.command.ListTemplatesCmd; import org.apache.cloudstack.api.user.template.command.ListTemplatesCmd;
import org.apache.cloudstack.api.user.template.command.UpdateTemplateCmd; import org.apache.cloudstack.api.user.template.command.UpdateTemplateCmd;
import org.apache.cloudstack.api.user.vmgroup.command.ListVMGroupsCmd; import org.apache.cloudstack.api.user.vmgroup.command.ListVMGroupsCmd;
@ -88,7 +89,6 @@ import com.cloud.api.commands.ListSystemVMsCmd;
import com.cloud.api.commands.ListVlanIpRangesCmd; import com.cloud.api.commands.ListVlanIpRangesCmd;
import com.cloud.api.commands.ListZonesByCmd; import com.cloud.api.commands.ListZonesByCmd;
import com.cloud.api.commands.RebootSystemVmCmd; import com.cloud.api.commands.RebootSystemVmCmd;
import com.cloud.api.commands.RegisterSSHKeyPairCmd;
import com.cloud.api.commands.StopSystemVmCmd; import com.cloud.api.commands.StopSystemVmCmd;
import com.cloud.api.commands.UpdateDomainCmd; import com.cloud.api.commands.UpdateDomainCmd;
import com.cloud.api.commands.UpdateHostPasswordCmd; import com.cloud.api.commands.UpdateHostPasswordCmd;

View File

@ -26,14 +26,14 @@ import java.util.List;
import javax.ejb.Local; import javax.ejb.Local;
import org.apache.cloudstack.api.user.iso.command.DeleteIsoCmd; import org.apache.cloudstack.api.user.iso.command.DeleteIsoCmd;
import org.apache.cloudstack.api.user.iso.command.RegisterIsoCmd;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import com.cloud.agent.AgentManager; import com.cloud.agent.AgentManager;
import com.cloud.agent.api.Answer; import com.cloud.agent.api.Answer;
import com.cloud.agent.api.storage.DeleteTemplateCommand; import com.cloud.agent.api.storage.DeleteTemplateCommand;
import org.apache.cloudstack.api.user.template.command.DeleteTemplateCmd; import org.apache.cloudstack.api.user.template.command.DeleteTemplateCmd;
import com.cloud.api.commands.RegisterIsoCmd; import org.apache.cloudstack.api.user.template.command.RegisterTemplateCmd;
import com.cloud.api.commands.RegisterTemplateCmd;
import com.cloud.configuration.Resource.ResourceType; import com.cloud.configuration.Resource.ResourceType;
import com.cloud.dc.DataCenterVO; import com.cloud.dc.DataCenterVO;
import com.cloud.event.EventTypes; import com.cloud.event.EventTypes;

View File

@ -19,9 +19,9 @@ package com.cloud.template;
import java.util.Map; import java.util.Map;
import org.apache.cloudstack.api.user.iso.command.DeleteIsoCmd; import org.apache.cloudstack.api.user.iso.command.DeleteIsoCmd;
import org.apache.cloudstack.api.user.iso.command.RegisterIsoCmd;
import org.apache.cloudstack.api.user.template.command.DeleteTemplateCmd; import org.apache.cloudstack.api.user.template.command.DeleteTemplateCmd;
import com.cloud.api.commands.RegisterIsoCmd; import org.apache.cloudstack.api.user.template.command.RegisterTemplateCmd;
import com.cloud.api.commands.RegisterTemplateCmd;
import com.cloud.exception.ResourceAllocationException; import com.cloud.exception.ResourceAllocationException;
import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.VMTemplateVO; import com.cloud.storage.VMTemplateVO;

View File

@ -21,14 +21,14 @@ import java.util.Map;
import javax.naming.ConfigurationException; import javax.naming.ConfigurationException;
import org.apache.cloudstack.api.user.iso.command.RegisterIsoCmd;
import org.apache.cloudstack.api.user.template.command.RegisterTemplateCmd;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
import com.cloud.api.ApiDBUtils; import com.cloud.api.ApiDBUtils;
import org.apache.cloudstack.api.user.iso.command.DeleteIsoCmd; import org.apache.cloudstack.api.user.iso.command.DeleteIsoCmd;
import org.apache.cloudstack.api.user.template.command.DeleteTemplateCmd; import org.apache.cloudstack.api.user.template.command.DeleteTemplateCmd;
import com.cloud.api.commands.RegisterIsoCmd;
import com.cloud.api.commands.RegisterTemplateCmd;
import com.cloud.configuration.Resource.ResourceType; import com.cloud.configuration.Resource.ResourceType;
import com.cloud.configuration.dao.ConfigurationDao; import com.cloud.configuration.dao.ConfigurationDao;
import com.cloud.dc.DataCenterVO; import com.cloud.dc.DataCenterVO;

View File

@ -35,10 +35,7 @@ import javax.ejb.Local;
import javax.naming.ConfigurationException; import javax.naming.ConfigurationException;
import org.apache.cloudstack.api.user.iso.command.*; import org.apache.cloudstack.api.user.iso.command.*;
import org.apache.cloudstack.api.user.template.command.CopyTemplateCmd; import org.apache.cloudstack.api.user.template.command.*;
import org.apache.cloudstack.api.user.template.command.ExtractTemplateCmd;
import org.apache.cloudstack.api.user.template.command.ListTemplatePermissionsCmd;
import org.apache.cloudstack.api.user.template.command.UpdateTemplatePermissionsCmd;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import com.cloud.acl.SecurityChecker.AccessType; import com.cloud.acl.SecurityChecker.AccessType;
@ -50,10 +47,9 @@ import com.cloud.agent.api.storage.DestroyCommand;
import com.cloud.agent.api.storage.PrimaryStorageDownloadAnswer; import com.cloud.agent.api.storage.PrimaryStorageDownloadAnswer;
import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand; import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand;
import com.cloud.agent.api.to.SwiftTO; import com.cloud.agent.api.to.SwiftTO;
import org.apache.cloudstack.api.user.template.command.DeleteTemplateCmd;
import com.cloud.api.commands.ListTemplateOrIsoPermissionsCmd; import com.cloud.api.commands.ListTemplateOrIsoPermissionsCmd;
import com.cloud.api.commands.RegisterIsoCmd; import org.apache.cloudstack.api.user.iso.command.RegisterIsoCmd;
import com.cloud.api.commands.RegisterTemplateCmd; import org.apache.cloudstack.api.user.template.command.RegisterTemplateCmd;
import com.cloud.api.commands.UpdateTemplateOrIsoPermissionsCmd; import com.cloud.api.commands.UpdateTemplateOrIsoPermissionsCmd;
import com.cloud.async.AsyncJobManager; import com.cloud.async.AsyncJobManager;
import com.cloud.async.AsyncJobVO; import com.cloud.async.AsyncJobVO;