api_refactor: refactor network apis for admin pkg

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2012-12-04 11:38:40 -08:00
parent feb342ad23
commit 2121fbd469
22 changed files with 49 additions and 49 deletions

View File

@ -21,12 +21,12 @@ import java.util.List;
import javax.naming.NamingException;
import com.cloud.api.commands.CreateDiskOfferingCmd;
import com.cloud.api.commands.CreateNetworkOfferingCmd;
import org.apache.cloudstack.api.admin.network.command.CreateNetworkOfferingCmd;
import com.cloud.api.commands.CreateServiceOfferingCmd;
import com.cloud.api.commands.CreateVlanIpRangeCmd;
import com.cloud.api.commands.CreateZoneCmd;
import com.cloud.api.commands.DeleteDiskOfferingCmd;
import com.cloud.api.commands.DeleteNetworkOfferingCmd;
import org.apache.cloudstack.api.admin.network.command.DeleteNetworkOfferingCmd;
import com.cloud.api.commands.DeletePodCmd;
import com.cloud.api.commands.DeleteServiceOfferingCmd;
import com.cloud.api.commands.DeleteVlanIpRangeCmd;
@ -36,7 +36,7 @@ import com.cloud.api.commands.LDAPRemoveCmd;
import org.apache.cloudstack.api.user.network.command.ListNetworkOfferingsCmd;
import com.cloud.api.commands.UpdateCfgCmd;
import com.cloud.api.commands.UpdateDiskOfferingCmd;
import com.cloud.api.commands.UpdateNetworkOfferingCmd;
import org.apache.cloudstack.api.admin.network.command.UpdateNetworkOfferingCmd;
import com.cloud.api.commands.UpdatePodCmd;
import com.cloud.api.commands.UpdateServiceOfferingCmd;
import com.cloud.api.commands.UpdateZoneCmd;

View File

@ -20,9 +20,9 @@ import java.sql.SQLException;
import java.util.List;
import com.cloud.api.commands.CreateStorageNetworkIpRangeCmd;
import com.cloud.api.commands.DeleteStorageNetworkIpRangeCmd;
import com.cloud.api.commands.UpdateStorageNetworkIpRangeCmd;
import com.cloud.api.commands.listStorageNetworkIpRangeCmd;
import org.apache.cloudstack.api.admin.network.command.DeleteStorageNetworkIpRangeCmd;
import org.apache.cloudstack.api.admin.network.command.UpdateStorageNetworkIpRangeCmd;
import org.apache.cloudstack.api.admin.network.command.ListStorageNetworkIpRangeCmd;
import com.cloud.dc.StorageNetworkIpRange;
public interface StorageNetworkService {
@ -30,7 +30,7 @@ public interface StorageNetworkService {
void deleteIpRange(DeleteStorageNetworkIpRangeCmd cmd);
List<StorageNetworkIpRange> listIpRange(listStorageNetworkIpRangeCmd cmd);
List<StorageNetworkIpRange> listIpRange(ListStorageNetworkIpRangeCmd cmd);
StorageNetworkIpRange updateIpRange(UpdateStorageNetworkIpRangeCmd cmd);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.api.commands;
package org.apache.cloudstack.api.admin.network.command;
import java.util.ArrayList;
import java.util.List;
@ -38,8 +38,8 @@ import com.cloud.exception.ResourceUnavailableException;
import com.cloud.user.Account;
@Implementation(description="List a storage network IP range.", responseObject=StorageNetworkIpRangeResponse.class, since="3.0.0")
public class listStorageNetworkIpRangeCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(listStorageNetworkIpRangeCmd.class);
public class ListStorageNetworkIpRangeCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListStorageNetworkIpRangeCmd.class);
String s_name = "liststoragenetworkiprangeresponse";

View File

@ -16,7 +16,7 @@
// under the License.
package org.apache.cloudstack.api.user.network.command;
import com.cloud.api.commands.DeleteNetworkOfferingCmd;
import org.apache.cloudstack.api.admin.network.command.DeleteNetworkOfferingCmd;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;

View File

@ -22,6 +22,7 @@ import java.util.List;
import junit.framework.Assert;
import junit.framework.TestCase;
import org.apache.cloudstack.api.admin.network.command.AddNetworkServiceProviderCmd;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@ -29,7 +30,6 @@ import org.junit.rules.ExpectedException;
import org.mockito.Mockito;
import org.apache.cloudstack.api.ServerApiException;
import com.cloud.api.commands.AddNetworkServiceProviderCmd;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.network.NetworkService;
import com.cloud.network.PhysicalNetworkServiceProvider;

View File

@ -302,9 +302,9 @@ removeVpnUser=org.apache.cloudstack.api.user.vpn.command.RemoveVpnUserCmd;15
listVpnUsers=org.apache.cloudstack.api.user.vpn.command.ListVpnUsersCmd;15
#### network offering commands
createNetworkOffering=com.cloud.api.commands.CreateNetworkOfferingCmd;1
updateNetworkOffering=com.cloud.api.commands.UpdateNetworkOfferingCmd;1
deleteNetworkOffering=com.cloud.api.commands.DeleteNetworkOfferingCmd;1
createNetworkOffering=org.apache.cloudstack.api.admin.network.command.CreateNetworkOfferingCmd;1
updateNetworkOffering=org.apache.cloudstack.api.admin.network.command.UpdateNetworkOfferingCmd;1
deleteNetworkOffering=org.apache.cloudstack.api.admin.network.command.DeleteNetworkOfferingCmd;1
listNetworkOfferings=org.apache.cloudstack.api.user.network.command.ListNetworkOfferingsCmd;15
#### network commands
@ -345,16 +345,16 @@ listHypervisorCapabilities=com.cloud.api.commands.ListHypervisorCapabilitiesCmd;
#### Physical Network commands
createPhysicalNetwork=com.cloud.api.commands.CreatePhysicalNetworkCmd;1
deletePhysicalNetwork=com.cloud.api.commands.DeletePhysicalNetworkCmd;1
listPhysicalNetworks=com.cloud.api.commands.ListPhysicalNetworksCmd;1
updatePhysicalNetwork=com.cloud.api.commands.UpdatePhysicalNetworkCmd;1
deletePhysicalNetwork=org.apache.cloudstack.api.admin.network.command.DeletePhysicalNetworkCmd;1
listPhysicalNetworks=org.apache.cloudstack.api.admin.network.command.ListPhysicalNetworksCmd;1
updatePhysicalNetwork=org.apache.cloudstack.api.admin.network.command.UpdatePhysicalNetworkCmd;1
#### Physical Network Service Provider commands
listSupportedNetworkServices=com.cloud.api.commands.ListSupportedNetworkServicesCmd;1
addNetworkServiceProvider=com.cloud.api.commands.AddNetworkServiceProviderCmd;1
deleteNetworkServiceProvider=com.cloud.api.commands.DeleteNetworkServiceProviderCmd;1
listNetworkServiceProviders=com.cloud.api.commands.ListNetworkServiceProvidersCmd;1
updateNetworkServiceProvider=com.cloud.api.commands.UpdateNetworkServiceProviderCmd;1
listSupportedNetworkServices=org.apache.cloudstack.api.admin.network.command.ListSupportedNetworkServicesCmd;1
addNetworkServiceProvider=org.apache.cloudstack.api.admin.network.command.AddNetworkServiceProviderCmd;1
deleteNetworkServiceProvider=org.apache.cloudstack.api.admin.network.command.DeleteNetworkServiceProviderCmd;1
listNetworkServiceProviders=org.apache.cloudstack.api.admin.network.command.ListNetworkServiceProvidersCmd;1
updateNetworkServiceProvider=org.apache.cloudstack.api.admin.network.command.UpdateNetworkServiceProviderCmd;1
#### Physical Network Traffic Type commands
addTrafficType=com.cloud.api.commands.AddTrafficTypeCmd;1
@ -365,9 +365,9 @@ listTrafficTypeImplementors=com.cloud.api.commands.ListTrafficTypeImplementorsCm
#### Storage Network commands
createStorageNetworkIpRange=com.cloud.api.commands.CreateStorageNetworkIpRangeCmd;1
deleteStorageNetworkIpRange=com.cloud.api.commands.DeleteStorageNetworkIpRangeCmd;1
listStorageNetworkIpRange=com.cloud.api.commands.listStorageNetworkIpRangeCmd;1
updateStorageNetworkIpRange=com.cloud.api.commands.UpdateStorageNetworkIpRangeCmd;1
deleteStorageNetworkIpRange=org.apache.cloudstack.api.admin.network.command.DeleteStorageNetworkIpRangeCmd;1
listStorageNetworkIpRange=org.apache.cloudstack.api.admin.network.command.ListStorageNetworkIpRangeCmd;1
updateStorageNetworkIpRange=org.apache.cloudstack.api.admin.network.command.UpdateStorageNetworkIpRangeCmd;1
### Network Devices commands
addNetworkDevice=com.cloud.api.commands.AddNetworkDeviceCmd;1

View File

@ -38,6 +38,8 @@ import javax.naming.NamingException;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
import org.apache.cloudstack.api.admin.network.command.DeleteNetworkOfferingCmd;
import org.apache.cloudstack.api.admin.network.command.UpdateNetworkOfferingCmd;
import org.apache.log4j.Logger;
import com.cloud.acl.SecurityChecker;
@ -45,12 +47,11 @@ import com.cloud.alert.AlertManager;
import org.apache.cloudstack.api.ApiConstants.LDAPParams;
import com.cloud.api.ApiDBUtils;
import com.cloud.api.commands.CreateDiskOfferingCmd;
import com.cloud.api.commands.CreateNetworkOfferingCmd;
import org.apache.cloudstack.api.admin.network.command.CreateNetworkOfferingCmd;
import com.cloud.api.commands.CreateServiceOfferingCmd;
import com.cloud.api.commands.CreateVlanIpRangeCmd;
import com.cloud.api.commands.CreateZoneCmd;
import com.cloud.api.commands.DeleteDiskOfferingCmd;
import com.cloud.api.commands.DeleteNetworkOfferingCmd;
import com.cloud.api.commands.DeletePodCmd;
import com.cloud.api.commands.DeleteServiceOfferingCmd;
import com.cloud.api.commands.DeleteVlanIpRangeCmd;
@ -60,7 +61,6 @@ import com.cloud.api.commands.LDAPRemoveCmd;
import org.apache.cloudstack.api.user.network.command.ListNetworkOfferingsCmd;
import com.cloud.api.commands.UpdateCfgCmd;
import com.cloud.api.commands.UpdateDiskOfferingCmd;
import com.cloud.api.commands.UpdateNetworkOfferingCmd;
import com.cloud.api.commands.UpdatePodCmd;
import com.cloud.api.commands.UpdateServiceOfferingCmd;
import com.cloud.api.commands.UpdateZoneCmd;

View File

@ -25,12 +25,12 @@ import java.util.Map;
import javax.ejb.Local;
import javax.naming.ConfigurationException;
import org.apache.cloudstack.api.admin.network.command.ListStorageNetworkIpRangeCmd;
import org.apache.cloudstack.api.admin.network.command.UpdateStorageNetworkIpRangeCmd;
import org.apache.log4j.Logger;
import com.cloud.api.commands.CreateStorageNetworkIpRangeCmd;
import com.cloud.api.commands.DeleteStorageNetworkIpRangeCmd;
import com.cloud.api.commands.UpdateStorageNetworkIpRangeCmd;
import com.cloud.api.commands.listStorageNetworkIpRangeCmd;
import org.apache.cloudstack.api.admin.network.command.DeleteStorageNetworkIpRangeCmd;
import com.cloud.dc.HostPodVO;
import com.cloud.dc.StorageNetworkIpRange;
import com.cloud.dc.StorageNetworkIpAddressVO;
@ -304,7 +304,7 @@ public class StorageNetworkManagerImpl implements StorageNetworkManager, Storage
}
@Override
public List<StorageNetworkIpRange> listIpRange(listStorageNetworkIpRangeCmd cmd) {
public List<StorageNetworkIpRange> listIpRange(ListStorageNetworkIpRangeCmd cmd) {
Long rangeId = cmd.getRangeId();
Long podId = cmd.getPodId();
Long zoneId = cmd.getZoneId();

View File

@ -25,12 +25,12 @@ import javax.naming.ConfigurationException;
import javax.naming.NamingException;
import com.cloud.api.commands.CreateDiskOfferingCmd;
import com.cloud.api.commands.CreateNetworkOfferingCmd;
import org.apache.cloudstack.api.admin.network.command.CreateNetworkOfferingCmd;
import com.cloud.api.commands.CreateServiceOfferingCmd;
import com.cloud.api.commands.CreateVlanIpRangeCmd;
import com.cloud.api.commands.CreateZoneCmd;
import com.cloud.api.commands.DeleteDiskOfferingCmd;
import com.cloud.api.commands.DeleteNetworkOfferingCmd;
import org.apache.cloudstack.api.admin.network.command.DeleteNetworkOfferingCmd;
import com.cloud.api.commands.DeletePodCmd;
import com.cloud.api.commands.DeleteServiceOfferingCmd;
import com.cloud.api.commands.DeleteVlanIpRangeCmd;
@ -40,7 +40,7 @@ import com.cloud.api.commands.LDAPRemoveCmd;
import org.apache.cloudstack.api.user.network.command.ListNetworkOfferingsCmd;
import com.cloud.api.commands.UpdateCfgCmd;
import com.cloud.api.commands.UpdateDiskOfferingCmd;
import com.cloud.api.commands.UpdateNetworkOfferingCmd;
import org.apache.cloudstack.api.admin.network.command.UpdateNetworkOfferingCmd;
import com.cloud.api.commands.UpdatePodCmd;
import com.cloud.api.commands.UpdateServiceOfferingCmd;
import com.cloud.api.commands.UpdateZoneCmd;