import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GroupModInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MeterModInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetAsyncInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.TableModInput;
-
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupOutput;
-
import org.opendaylight.yangtools.yang.common.RpcResult;
/**
*/
Future<RpcResult<UpdateMeterOutput>> meterMod(MeterModInput input, SwitchConnectionDistinguisher cookie);
+ /**
+ * send multipart request message to switch
+ *
+ * @param input
+ * - multipart request message
+ * @param cookie
+ * - to identify connection if null then feel free to send via
+ * any connection
+ * @return - the future
+ */
+ Future<RpcResult<java.lang.Void>> multipartRequest(MultipartRequestInput input, SwitchConnectionDistinguisher cookie);
+
/**
* send packet out message to switch
*
import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
import org.opendaylight.openflowplugin.openflow.md.core.ConnectionConductor;
import org.opendaylight.openflowplugin.openflow.md.core.SwitchConnectionDistinguisher;
-
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.UpdateMeterOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.UpdateMeterOutputBuilder;
-
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GroupModInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MeterModInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MeterModInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestInput;
@Override
public Future<RpcResult<UpdateFlowOutput>> flowMod(FlowModInput input, SwitchConnectionDistinguisher cookie) {
-
+
// Set Xid before invoking RPC on OFLibrary
- // TODO : Cleaner approach is to use a copy constructor once it is implemented
+ // TODO : Cleaner approach is to use a copy constructor once it is implemented
Long Xid = session.getNextXid();
FlowModInputBuilder mdInput = new FlowModInputBuilder();
mdInput.setXid(Xid);
mdInput.setVersion(input.getVersion());
LOG.debug("Calling OFLibrary flowMod");
Future<RpcResult<Void>> response = getConnectionAdapter(cookie).flowMod(mdInput.build());
-
+
// Send the same Xid back to caller - MessageDrivenSwitch
UpdateFlowOutputBuilder flowModOutput = new UpdateFlowOutputBuilder();
String stringXid =Xid.toString();
BigInteger bigIntXid = new BigInteger( stringXid );
flowModOutput.setTransactionId(new TransactionId(bigIntXid));
-
+
UpdateFlowOutput result = flowModOutput.build();
Collection<RpcError> errors = Collections.emptyList();
RpcResult<UpdateFlowOutput> rpcResult = Rpcs.getRpcResult(true, result, errors);
-
+
// solution 1: sending directly and hooking listener to get error
// hookup listener to catch the possible error with no reference to returned future-object
LOG.debug("Returning to ModelDrivenSwitch for flowMod RPC");
return Futures.immediateFuture(rpcResult);
-
+
}
@Override
@Override
public Future<RpcResult<UpdateGroupOutput>> groupMod(GroupModInput input, SwitchConnectionDistinguisher cookie) {
-
+
// Set Xid before invoking RPC on OFLibrary
// TODO : Cleaner approach is to use a copy constructor once it is implemented
Long Xid = session.getNextXid();
mdInput.setVersion(input.getVersion());
LOG.debug("Calling OFLibrary groupMod");
Future<RpcResult<Void>> response = getConnectionAdapter(cookie).groupMod(mdInput.build());
-
+
// Send the same Xid back to caller - MessageDrivenSwitch
UpdateGroupOutputBuilder groupModOutput = new UpdateGroupOutputBuilder();
String stringXid =Xid.toString();
UpdateGroupOutput result = groupModOutput.build();
Collection<RpcError> errors = Collections.emptyList();
RpcResult<UpdateGroupOutput> rpcResult = Rpcs.getRpcResult(true, result, errors);
-
+
// solution 1: sending directly and hooking listener to get error
// hookup listener to catch the possible error with no reference to returned future-object
LOG.debug("Returning to ModelDrivenSwitch for groupMod RPC");
return Futures.immediateFuture(rpcResult);
-
+
}
@Override
public Future<RpcResult<UpdateMeterOutput>> meterMod(MeterModInput input, SwitchConnectionDistinguisher cookie) {
-
+
// Set Xid before invoking RPC on OFLibrary
// TODO : Cleaner approach is to use a copy constructor once it is implemented
Long Xid = session.getNextXid();
mdInput.setVersion(input.getVersion());
LOG.debug("Calling OFLibrary meterMod");
Future<RpcResult<Void>> response = getConnectionAdapter(cookie).meterMod(mdInput.build());
-
+
// Send the same Xid back to caller - MessageDrivenSwitch
UpdateMeterOutputBuilder meterModOutput = new UpdateMeterOutputBuilder();
String stringXid =Xid.toString();
UpdateMeterOutput result = meterModOutput.build();
Collection<RpcError> errors = Collections.emptyList();
RpcResult<UpdateMeterOutput> rpcResult = Rpcs.getRpcResult(true, result, errors);
-
+
// solution 1: sending directly and hooking listener to get error
// hookup listener to catch the possible error with no reference to returned future-object
LOG.debug("Returning to ModelDrivenSwitch for meterMod RPC");
return Futures.immediateFuture(rpcResult);
-
+
+ }
+
+ @Override
+ public Future<RpcResult<java.lang.Void>> multipartRequest(MultipartRequestInput input, SwitchConnectionDistinguisher cookie) {
+ return getConnectionAdapter(cookie).multipartRequest(input);
}
@Override