Updated Branches: refs/heads/master 2c9e9eef0 -> ce12d0d70
Submit Midokura SDN controller stubs Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/ce12d0d7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/ce12d0d7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/ce12d0d7 Branch: refs/heads/master Commit: ce12d0d70d96e342ffa3c43ed2f2b8d664add29a Parents: 2c9e9ee Author: [email protected] <[email protected]> Authored: Mon Aug 13 18:51:23 2012 +0530 Committer: Murali Reddy <[email protected]> Committed: Mon Aug 13 18:55:11 2012 +0530 ---------------------------------------------------------------------- api/src/com/cloud/network/Network.java | 1 + .../network/element/MidokuraMidonetElement.java | 133 +++++++++++++++ .../guru/MidokuraMidonetGuestNetworkGuru.java | 46 +++++ .../network/ExternalNetworkDeviceManager.java | 4 +- 4 files changed, 182 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ce12d0d7/api/src/com/cloud/network/Network.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/Network.java b/api/src/com/cloud/network/Network.java index b3461b5..75d94ee 100644 --- a/api/src/com/cloud/network/Network.java +++ b/api/src/com/cloud/network/Network.java @@ -121,6 +121,7 @@ public interface Network extends ControlledEntity { public static final Provider VPCVirtualRouter = new Provider("VpcVirtualRouter", false); public static final Provider None = new Provider("None", false); public static final Provider NiciraNvp = new Provider("NiciraNvp", true); + public static final Provider MidokuraMidonet = new Provider("MidokuraMidonet", true); private String name; private boolean isExternal; http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ce12d0d7/plugins/network-elements/midokura-midonet/build.xml ---------------------------------------------------------------------- diff --git a/plugins/network-elements/midokura-midonet/build.xml b/plugins/network-elements/midokura-midonet/build.xml new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ce12d0d7/plugins/network-elements/midokura-midonet/src/com/cloud/network/element/MidokuraMidonetElement.java ---------------------------------------------------------------------- diff --git a/plugins/network-elements/midokura-midonet/src/com/cloud/network/element/MidokuraMidonetElement.java b/plugins/network-elements/midokura-midonet/src/com/cloud/network/element/MidokuraMidonetElement.java new file mode 100644 index 0000000..5673466 --- /dev/null +++ b/plugins/network-elements/midokura-midonet/src/com/cloud/network/element/MidokuraMidonetElement.java @@ -0,0 +1,133 @@ +/* + * 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.network.element; + +import com.cloud.deploy.DeployDestination; +import com.cloud.exception.ConcurrentOperationException; +import com.cloud.exception.InsufficientCapacityException; +import com.cloud.exception.ResourceUnavailableException; +import com.cloud.network.Network; +import com.cloud.network.Network.Capability; +import com.cloud.network.Network.Provider; +import com.cloud.network.Network.Service; +import com.cloud.network.PhysicalNetworkServiceProvider; +import com.cloud.offering.NetworkOffering; +import com.cloud.utils.component.AdapterBase; +import com.cloud.utils.component.PluggableService; +import com.cloud.vm.NicProfile; +import com.cloud.vm.ReservationContext; +import com.cloud.vm.VirtualMachine; +import com.cloud.vm.VirtualMachineProfile; +import org.apache.log4j.Logger; + +import javax.ejb.Local; +import java.util.Map; +import java.util.Set; + +/** + * User: tomoe + * Date: 8/8/12 + * Time: 1:38 PM + */ + +@Local(value = NetworkElement.class) +public class MidokuraMidonetElement extends AdapterBase implements ConnectivityProvider, PluggableService { + private static final Logger s_logger = Logger.getLogger(MidokuraMidonetElement.class); + + @Override + public Map<Service, Map<Capability, String>> getCapabilities() { + // TODO: implement this. + return null; + } + + @Override + public Provider getProvider() { + // TODO: implement this. + return null; + } + + @Override + public boolean implement(Network network, NetworkOffering offering, DeployDestination dest, + ReservationContext context) + throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { + // TODO: implement this. + return false; + } + + @Override + public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm, + DeployDestination dest, ReservationContext context) + throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { + // TODO: implement this. + return false; + } + + @Override + public boolean release(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm, + ReservationContext context) + throws ConcurrentOperationException, ResourceUnavailableException { + // TODO: implement this. + return false; + } + + @Override + public boolean shutdown(Network network, ReservationContext context, boolean cleanup) + throws ConcurrentOperationException, ResourceUnavailableException { + // TODO: implement this. + return false; + } + + @Override + public boolean destroy(Network network) throws ConcurrentOperationException, ResourceUnavailableException { + // TODO: implement this. + return false; + } + + @Override + public boolean isReady(PhysicalNetworkServiceProvider provider) { + // TODO: implement this. + return false; + } + + @Override + public boolean shutdownProviderInstances(PhysicalNetworkServiceProvider provider, ReservationContext context) + throws ConcurrentOperationException, ResourceUnavailableException { + // TODO: implement this. + return false; + } + + @Override + public boolean canEnableIndividualServices() { + // TODO: implement this. + return false; + } + + @Override + public boolean verifyServicesCombination(Set<Service> services) { + // TODO: implement this. + return false; + } + + @Override + public String getPropertiesFile() { + // TODO: implement this. + return null; + } +} http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ce12d0d7/plugins/network-elements/midokura-midonet/src/com/cloud/network/guru/MidokuraMidonetGuestNetworkGuru.java ---------------------------------------------------------------------- diff --git a/plugins/network-elements/midokura-midonet/src/com/cloud/network/guru/MidokuraMidonetGuestNetworkGuru.java b/plugins/network-elements/midokura-midonet/src/com/cloud/network/guru/MidokuraMidonetGuestNetworkGuru.java new file mode 100644 index 0000000..0526b45 --- /dev/null +++ b/plugins/network-elements/midokura-midonet/src/com/cloud/network/guru/MidokuraMidonetGuestNetworkGuru.java @@ -0,0 +1,46 @@ +/* + * 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.network.guru; + +import com.cloud.dc.DataCenter.NetworkType; +import com.cloud.network.PhysicalNetwork; +import com.cloud.offering.NetworkOffering; +import org.apache.log4j.Logger; + +import javax.ejb.Local; + +/** + * User: tomoe + * Date: 8/8/12 + * Time: 10:46 AM + */ + +@Local(value = NetworkGuru.class) +public class MidokuraMidonetGuestNetworkGuru extends GuestNetworkGuru { + private static final Logger s_logger = Logger.getLogger(MidokuraMidonetGuestNetworkGuru.class); + + + @Override + protected boolean canHandle(NetworkOffering offering, NetworkType networkType, + PhysicalNetwork physicalNetwork) { + // TODO: implement this. + return false; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ce12d0d7/server/src/com/cloud/network/ExternalNetworkDeviceManager.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/network/ExternalNetworkDeviceManager.java b/server/src/com/cloud/network/ExternalNetworkDeviceManager.java index dec0608..b1de86f 100644 --- a/server/src/com/cloud/network/ExternalNetworkDeviceManager.java +++ b/server/src/com/cloud/network/ExternalNetworkDeviceManager.java @@ -40,8 +40,8 @@ public interface ExternalNetworkDeviceManager extends Manager { public static final NetworkDevice F5BigIpLoadBalancer = new NetworkDevice("F5BigIpLoadBalancer", Network.Provider.F5BigIp.getName()); public static final NetworkDevice JuniperSRXFirewall = new NetworkDevice("JuniperSRXFirewall", Network.Provider.JuniperSRX.getName()); public static final NetworkDevice NiciraNvp = new NetworkDevice("NiciraNvp", Network.Provider.NiciraNvp.getName()); - - + public static final NetworkDevice MidokuraMidonet = new NetworkDevice("MidokuraMidonet", Network.Provider.MidokuraMidonet.getName()); + public NetworkDevice(String deviceName, String ntwkServiceprovider) { _name = deviceName; _provider = ntwkServiceprovider;
