X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetworkconfiguration%2Fneutron%2Fnorthbound%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetworkconfig%2Fneutron%2Fnorthbound%2FNeutronPortRequest.java;fp=opendaylight%2Fnetworkconfiguration%2Fneutron%2Fnorthbound%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetworkconfig%2Fneutron%2Fnorthbound%2FNeutronPortRequest.java;h=3bfac8a4fdf4d04a8131f10c6bf74f8df017ef03;hp=0000000000000000000000000000000000000000;hb=42c32160bfd41de57189bb246fec5ffb48ed8e9e;hpb=edf5bfcee83c750853253ccfd991ba7000f5f65b diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortRequest.java new file mode 100644 index 0000000000..3bfac8a4fd --- /dev/null +++ b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortRequest.java @@ -0,0 +1,65 @@ +/* + * Copyright IBM Corporation, 2013. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +package org.opendaylight.controller.networkconfig.neutron.northbound; + +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import org.opendaylight.controller.networkconfig.neutron.NeutronPort; + +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) +public class NeutronPortRequest implements INeutronRequest { + // See OpenStack Network API v2.0 Reference for description of + // annotated attributes + + @XmlElement(name="port") + NeutronPort singletonPort; + + @XmlElement(name="ports") + List bulkRequest; + + @XmlElement(name="ports_links") + List links; + + NeutronPortRequest() { + } + + public NeutronPortRequest(List bulkRequest, List links) { + this.bulkRequest = bulkRequest; + this.links = links; + this.singletonPort = null; + } + + NeutronPortRequest(List bulk) { + bulkRequest = bulk; + singletonPort = null; + } + + NeutronPortRequest(NeutronPort port) { + singletonPort = port; + } + + @Override + public NeutronPort getSingleton() { + return singletonPort; + } + + @Override + public boolean isSingleton() { + return (singletonPort != null); + } + + @Override + public List getBulk() { + return bulkRequest; + } +}