Add table miss entry for VLAN table

According to OFDPA spec, the VLAN table miss behavior should be
clear_action and goto ACL table

Also improve the log messages

Change-Id: I24842175cf5ca257ae1bc6e17b2fa546a88129d8
diff --git a/drivers/default/src/main/java/org/onosproject/driver/pipeline/CpqdOfdpa2Pipeline.java b/drivers/default/src/main/java/org/onosproject/driver/pipeline/CpqdOfdpa2Pipeline.java
index f8e6636..32cc4eb 100644
--- a/drivers/default/src/main/java/org/onosproject/driver/pipeline/CpqdOfdpa2Pipeline.java
+++ b/drivers/default/src/main/java/org/onosproject/driver/pipeline/CpqdOfdpa2Pipeline.java
@@ -791,8 +791,7 @@
     @Override
     protected void initializePipeline() {
         processPortTable();
-        // vlan table processing not required, as default is to drop packets
-        // which can be accomplished without a table-miss-entry.
+        processVlanTable();
         processTmacTable();
         processIpTable();
         processMulticastIpTable();
@@ -819,12 +818,40 @@
         flowRuleService.apply(ops.build(new FlowRuleOperationsContext() {
             @Override
             public void onSuccess(FlowRuleOperations ops) {
-                log.info("Initialized port table");
+                log.info("Initialized port table on {}", deviceId);
             }
 
             @Override
             public void onError(FlowRuleOperations ops) {
-                log.info("Failed to initialize port table");
+                log.warn("Failed to initialize port table on {}", deviceId);
+            }
+        }));
+    }
+
+    protected void processVlanTable() {
+        //table miss entry
+        FlowRuleOperations.Builder ops = FlowRuleOperations.builder();
+        TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
+        TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder().wipeDeferred();
+        treatment.transition(ACL_TABLE);
+        FlowRule rule = DefaultFlowRule.builder()
+                .forDevice(deviceId)
+                .withSelector(selector.build())
+                .withTreatment(treatment.build())
+                .withPriority(LOWEST_PRIORITY)
+                .fromApp(driverId)
+                .makePermanent()
+                .forTable(VLAN_TABLE).build();
+        ops =  ops.add(rule);
+        flowRuleService.apply(ops.build(new FlowRuleOperationsContext() {
+            @Override
+            public void onSuccess(FlowRuleOperations ops) {
+                log.info("Initialized vlan table on {}", deviceId);
+            }
+
+            @Override
+            public void onError(FlowRuleOperations ops) {
+                log.warn("Failed to initialize vlan table on {}", deviceId);
             }
         }));
     }
@@ -847,12 +874,12 @@
         flowRuleService.apply(ops.build(new FlowRuleOperationsContext() {
             @Override
             public void onSuccess(FlowRuleOperations ops) {
-                log.info("Initialized tmac table");
+                log.info("Initialized tmac table on {}", deviceId);
             }
 
             @Override
             public void onError(FlowRuleOperations ops) {
-                log.info("Failed to initialize tmac table");
+                log.warn("Failed to initialize tmac table on {}", deviceId);
             }
         }));
     }
@@ -875,12 +902,12 @@
         flowRuleService.apply(ops.build(new FlowRuleOperationsContext() {
             @Override
             public void onSuccess(FlowRuleOperations ops) {
-                log.info("Initialized IP table");
+                log.info("Initialized IP table on {}", deviceId);
             }
 
             @Override
             public void onError(FlowRuleOperations ops) {
-                log.info("Failed to initialize unicast IP table");
+                log.warn("Failed to initialize unicast IP table on {}", deviceId);
             }
         }));
     }
@@ -903,12 +930,12 @@
         flowRuleService.apply(ops.build(new FlowRuleOperationsContext() {
             @Override
             public void onSuccess(FlowRuleOperations ops) {
-                log.info("Initialized multicast IP table");
+                log.info("Initialized multicast IP table on {}", deviceId);
             }
 
             @Override
             public void onError(FlowRuleOperations ops) {
-                log.info("Failed to initialize multicast IP table");
+                log.warn("Failed to initialize multicast IP table on {}", deviceId);
             }
         }));
     }
@@ -945,12 +972,12 @@
         flowRuleService.apply(ops.build(new FlowRuleOperationsContext() {
             @Override
             public void onSuccess(FlowRuleOperations ops) {
-                log.info("Initialized MPLS tables");
+                log.info("Initialized MPLS tables on {}", deviceId);
             }
 
             @Override
             public void onError(FlowRuleOperations ops) {
-                log.info("Failed to initialize MPLS tables");
+                log.warn("Failed to initialize MPLS tables on {}", deviceId);
             }
         }));
     }
@@ -973,12 +1000,12 @@
         flowRuleService.apply(ops.build(new FlowRuleOperationsContext() {
             @Override
             public void onSuccess(FlowRuleOperations ops) {
-                log.info("Initialized Bridging table");
+                log.info("Initialized Bridging table on {}", deviceId);
             }
 
             @Override
             public void onError(FlowRuleOperations ops) {
-                log.info("Failed to initialize Bridging table");
+                log.warn("Failed to initialize Bridging table on {}", deviceId);
             }
         }));
     }
@@ -1000,12 +1027,12 @@
         flowRuleService.apply(ops.build(new FlowRuleOperationsContext() {
             @Override
             public void onSuccess(FlowRuleOperations ops) {
-                log.info("Initialized Acl table");
+                log.info("Initialized Acl table on {}", deviceId);
             }
 
             @Override
             public void onError(FlowRuleOperations ops) {
-                log.info("Failed to initialize Acl table");
+                log.warn("Failed to initialize Acl table on {}", deviceId);
             }
         }));
     }