Change OLT app to push Q-in-Q tagging flows rather than transparent VLAN flows.

Device VLAN is set through configuration, subscriber VLAN can be added using
CLI (eventually this will come through a call from the AAA app).

Moving towards generalizing this app as an 'Access Device' app rather than purely OLT.

Change-Id: I9b82b39f6a2dee2c6f10f3fd13b261f3e0313db7
diff --git a/drivers/src/main/java/org/onosproject/driver/pipeline/OLTPipeline.java b/drivers/src/main/java/org/onosproject/driver/pipeline/OLTPipeline.java
index eebb2e2..c735af3 100644
--- a/drivers/src/main/java/org/onosproject/driver/pipeline/OLTPipeline.java
+++ b/drivers/src/main/java/org/onosproject/driver/pipeline/OLTPipeline.java
@@ -30,7 +30,6 @@
 import org.onosproject.net.device.DeviceDescription;
 import org.onosproject.net.device.DeviceProvider;
 import org.onosproject.net.device.DeviceProviderRegistry;
-import org.onosproject.net.device.DeviceProviderService;
 import org.onosproject.net.device.DeviceService;
 import org.onosproject.net.driver.AbstractHandlerBehaviour;
 import org.onosproject.net.flow.DefaultFlowRule;
@@ -86,13 +85,13 @@
         flowRuleService = serviceDirectory.get(FlowRuleService.class);
         coreService = serviceDirectory.get(CoreService.class);
 
-        try {
+        /*try {
             DeviceProviderService providerService = registry.register(provider);
             providerService.deviceConnected(deviceId,
                                             description(deviceId, DEVICE, OLT));
         } finally {
             registry.unregister(provider);
-        }
+        }*/
 
         appId = coreService.registerApplication(
                 "org.onosproject.driver.OLTPipeline");
@@ -109,12 +108,12 @@
                                                 PacketPriority.CONTROL.priorityValue(),
                                                 appId, 0, true, null);
 
-        flowRuleService.applyFlowRules(flowRule);
+        //flowRuleService.applyFlowRules(flowRule);
     }
 
     @Override
     public void filter(FilteringObjective filter) {
-        throw new UnsupportedOperationException("Single table does not filter.");
+        throw new UnsupportedOperationException("OLT does not filter.");
     }
 
     @Override
@@ -140,19 +139,11 @@
 
         TrafficSelector selector = fwd.selector();
         TrafficTreatment treatment = fwd.treatment();
-        if ((fwd.treatment().deferred().size() == 0) &&
-                (fwd.treatment().immediate().size() == 0) &&
-                (fwd.treatment().tableTransition() == null) &&
-                (!fwd.treatment().clearedDeferred())) {
-            TrafficTreatment.Builder flowTreatment = DefaultTrafficTreatment.builder();
-            flowTreatment.add(Instructions.createDrop());
-            treatment = flowTreatment.build();
-        }
 
         FlowRule.Builder ruleBuilder = DefaultFlowRule.builder()
                 .forDevice(deviceId)
                 .withSelector(selector)
-                .withTreatment(fwd.treatment())
+                .withTreatment(treatment)
                 .fromApp(fwd.appId())
                 .withPriority(fwd.priority());
 
@@ -162,9 +153,7 @@
             ruleBuilder.makeTemporary(fwd.timeout());
         }
 
-
         switch (fwd.op()) {
-
             case ADD:
                 flowBuilder.add(ruleBuilder.build());
                 break;
@@ -190,16 +179,16 @@
                 }
             }
         }));
-
     }
 
     @Override
     public void next(NextObjective nextObjective) {
-        throw new UnsupportedOperationException("Single table does not next hop.");
+        throw new UnsupportedOperationException("OLT does not next hop.");
     }
 
     /**
      * Build a device description.
+     *
      * @param deviceId a deviceId
      * @param key the key of the annotation
      * @param value the value for the annotation