Fix files with windows line endings + Add checkstyle rule to catch this issue

Change-Id: Ic1905f2121c5c2ab66259f7f531c1e36fe58e9d4
diff --git a/core/api/src/main/java/org/onosproject/net/flow/DefaultTypedFlowEntry.java b/core/api/src/main/java/org/onosproject/net/flow/DefaultTypedFlowEntry.java
index afceb14..43a32de 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/DefaultTypedFlowEntry.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/DefaultTypedFlowEntry.java
@@ -1,122 +1,122 @@
-/*

- * Copyright 2015 Open Networking Laboratory

- *

- * Licensed 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 org.onosproject.net.flow;

-

-import static com.google.common.base.MoreObjects.toStringHelper;

-

-/**

- * Default flow entry class with FlowLiveType value, IMMEDIATE_FLOW, SHORT_FLOW, MID_FLOW, LONG_FLOW.

- */

-public class DefaultTypedFlowEntry extends DefaultFlowEntry

-    implements TypedStoredFlowEntry {

-    private FlowLiveType liveType;

-

-    /**

-     * Creates a typed flow entry from flow rule and its statistics, with default flow live type(IMMEDIATE_FLOW).

-     *

-     * @param rule the flow rule

-     * @param state the flow state

-     * @param life the flow duration since creation

-     * @param packets the flow packets count

-     * @param bytes the flow bytes count

-     *

-     */

-    public DefaultTypedFlowEntry(FlowRule rule, FlowEntryState state,

-                            long life, long packets, long bytes) {

-        super(rule, state, life, packets, bytes);

-        this.liveType = FlowLiveType.IMMEDIATE_FLOW;

-    }

-

-    /**

-     * Creates a typed flow entry from flow rule,  with default flow live type(IMMEDIATE_FLOW).

-     *

-     * @param rule the flow rule

-     *

-     */

-    public DefaultTypedFlowEntry(FlowRule rule) {

-        super(rule);

-        this.liveType = FlowLiveType.IMMEDIATE_FLOW;

-    }

-

-    /**

-     * Creates a typed flow entry from flow entry,  with default flow live type(IMMEDIATE_FLOW).

-     *

-     * @param fe the flow entry

-     *

-     */

-    public DefaultTypedFlowEntry(FlowEntry fe) {

-        super(fe, fe.state(), fe.life(), fe.packets(), fe.bytes());

-        this.liveType = FlowLiveType.IMMEDIATE_FLOW;

-    }

-

-    /**

-     * Creates a typed flow entry from flow rule and flow live type.

-     *

-     * @param rule the flow rule

-     * @param liveType the flow live type

-     *

-     */

-    public DefaultTypedFlowEntry(FlowRule rule, FlowLiveType liveType) {

-        super(rule);

-        this.liveType = liveType;

-    }

-

-    /**

-     * Creates a typed flow entry from flow entry and flow live type.

-     *

-     * @param fe the flow rule

-     * @param liveType the flow live type

-     *

-     */

-    public DefaultTypedFlowEntry(FlowEntry fe,  FlowLiveType liveType) {

-        super(fe, fe.state(), fe.life(), fe.packets(), fe.bytes());

-        this.liveType = liveType;

-    }

-

-    /**

-     * Creates a typed flow entry from flow rule, error code and flow live type.

-     *

-     * @param rule the flow rule

-     * @param errType the flow error type

-     * @param errCode the flow error code

-     * @param liveType the flow live type

-     *

-     */

-    public DefaultTypedFlowEntry(FlowRule rule, int errType, int errCode, FlowLiveType liveType) {

-        super(rule, errType, errCode);

-        this.liveType = liveType;

-    }

-

-    @Override

-    public FlowLiveType flowLiveType() {

-        return this.liveType;

-    }

-

-    @Override

-    public void setFlowLiveType(FlowLiveType liveType) {

-        this.liveType = liveType;

-    }

-

-    @Override

-    public String toString() {

-        return toStringHelper(this)

-                .add("entry", super.toString())

-                .add("type", liveType)

-                .toString();

-    }

-}

-

+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed 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 org.onosproject.net.flow;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+/**
+ * Default flow entry class with FlowLiveType value, IMMEDIATE_FLOW, SHORT_FLOW, MID_FLOW, LONG_FLOW.
+ */
+public class DefaultTypedFlowEntry extends DefaultFlowEntry
+    implements TypedStoredFlowEntry {
+    private FlowLiveType liveType;
+
+    /**
+     * Creates a typed flow entry from flow rule and its statistics, with default flow live type(IMMEDIATE_FLOW).
+     *
+     * @param rule the flow rule
+     * @param state the flow state
+     * @param life the flow duration since creation
+     * @param packets the flow packets count
+     * @param bytes the flow bytes count
+     *
+     */
+    public DefaultTypedFlowEntry(FlowRule rule, FlowEntryState state,
+                            long life, long packets, long bytes) {
+        super(rule, state, life, packets, bytes);
+        this.liveType = FlowLiveType.IMMEDIATE_FLOW;
+    }
+
+    /**
+     * Creates a typed flow entry from flow rule,  with default flow live type(IMMEDIATE_FLOW).
+     *
+     * @param rule the flow rule
+     *
+     */
+    public DefaultTypedFlowEntry(FlowRule rule) {
+        super(rule);
+        this.liveType = FlowLiveType.IMMEDIATE_FLOW;
+    }
+
+    /**
+     * Creates a typed flow entry from flow entry,  with default flow live type(IMMEDIATE_FLOW).
+     *
+     * @param fe the flow entry
+     *
+     */
+    public DefaultTypedFlowEntry(FlowEntry fe) {
+        super(fe, fe.state(), fe.life(), fe.packets(), fe.bytes());
+        this.liveType = FlowLiveType.IMMEDIATE_FLOW;
+    }
+
+    /**
+     * Creates a typed flow entry from flow rule and flow live type.
+     *
+     * @param rule the flow rule
+     * @param liveType the flow live type
+     *
+     */
+    public DefaultTypedFlowEntry(FlowRule rule, FlowLiveType liveType) {
+        super(rule);
+        this.liveType = liveType;
+    }
+
+    /**
+     * Creates a typed flow entry from flow entry and flow live type.
+     *
+     * @param fe the flow rule
+     * @param liveType the flow live type
+     *
+     */
+    public DefaultTypedFlowEntry(FlowEntry fe,  FlowLiveType liveType) {
+        super(fe, fe.state(), fe.life(), fe.packets(), fe.bytes());
+        this.liveType = liveType;
+    }
+
+    /**
+     * Creates a typed flow entry from flow rule, error code and flow live type.
+     *
+     * @param rule the flow rule
+     * @param errType the flow error type
+     * @param errCode the flow error code
+     * @param liveType the flow live type
+     *
+     */
+    public DefaultTypedFlowEntry(FlowRule rule, int errType, int errCode, FlowLiveType liveType) {
+        super(rule, errType, errCode);
+        this.liveType = liveType;
+    }
+
+    @Override
+    public FlowLiveType flowLiveType() {
+        return this.liveType;
+    }
+
+    @Override
+    public void setFlowLiveType(FlowLiveType liveType) {
+        this.liveType = liveType;
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(this)
+                .add("entry", super.toString())
+                .add("type", liveType)
+                .toString();
+    }
+}
+
diff --git a/core/api/src/main/java/org/onosproject/net/flow/TypedStoredFlowEntry.java b/core/api/src/main/java/org/onosproject/net/flow/TypedStoredFlowEntry.java
index 965fd1f..8cdfae7 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/TypedStoredFlowEntry.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/TypedStoredFlowEntry.java
@@ -1,67 +1,67 @@
-/*

- * Copyright 2015 Open Networking Laboratory

- *

- * Licensed 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 org.onosproject.net.flow;

-

-/**

- * Represents a flow live type for a given flow entry.

- */

-public interface TypedStoredFlowEntry extends StoredFlowEntry {

-    enum FlowLiveType {

-        /**

-         * Indicates that this rule has been submitted for addition immediately.

-         * Not necessarily collecting flow stats.

-         */

-        IMMEDIATE_FLOW,

-

-        /**

-         * Indicates that this rule has been submitted for a short time.

-         * Necessarily collecting flow stats every calAndPollInterval.

-         */

-        SHORT_FLOW,

-

-        /**

-         * Indicates that this rule has been submitted for a mid time.

-         * Necessarily collecting flow stats every midPollInterval.

-         */

-        MID_FLOW,

-

-        /**

-         * Indicates that this rule has been submitted for a long time.

-         * Necessarily collecting flow stats every longPollInterval.

-         */

-        LONG_FLOW,

-

-        /**

-         * Indicates that this rule has been submitted for UNKNOWN or ERROR.

-         * Not necessarily collecting flow stats.

-         */

-        UNKNOWN_FLOW

-    }

-

-    /**

-     * Gets the flow live type for this entry.

-     *

-     * @return flow live type

-     */

-    FlowLiveType flowLiveType();

-

-    /**

-     * Sets the new flow live type for this entry.

-     * @param liveType new flow live type.

-     */

-    void setFlowLiveType(FlowLiveType liveType);

-}

+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed 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 org.onosproject.net.flow;
+
+/**
+ * Represents a flow live type for a given flow entry.
+ */
+public interface TypedStoredFlowEntry extends StoredFlowEntry {
+    enum FlowLiveType {
+        /**
+         * Indicates that this rule has been submitted for addition immediately.
+         * Not necessarily collecting flow stats.
+         */
+        IMMEDIATE_FLOW,
+
+        /**
+         * Indicates that this rule has been submitted for a short time.
+         * Necessarily collecting flow stats every calAndPollInterval.
+         */
+        SHORT_FLOW,
+
+        /**
+         * Indicates that this rule has been submitted for a mid time.
+         * Necessarily collecting flow stats every midPollInterval.
+         */
+        MID_FLOW,
+
+        /**
+         * Indicates that this rule has been submitted for a long time.
+         * Necessarily collecting flow stats every longPollInterval.
+         */
+        LONG_FLOW,
+
+        /**
+         * Indicates that this rule has been submitted for UNKNOWN or ERROR.
+         * Not necessarily collecting flow stats.
+         */
+        UNKNOWN_FLOW
+    }
+
+    /**
+     * Gets the flow live type for this entry.
+     *
+     * @return flow live type
+     */
+    FlowLiveType flowLiveType();
+
+    /**
+     * Sets the new flow live type for this entry.
+     * @param liveType new flow live type.
+     */
+    void setFlowLiveType(FlowLiveType liveType);
+}
diff --git a/core/api/src/main/java/org/onosproject/net/statistic/FlowStatisticService.java b/core/api/src/main/java/org/onosproject/net/statistic/FlowStatisticService.java
index 5216839..544364d 100644
--- a/core/api/src/main/java/org/onosproject/net/statistic/FlowStatisticService.java
+++ b/core/api/src/main/java/org/onosproject/net/statistic/FlowStatisticService.java
@@ -1,106 +1,106 @@
-/*

- * Copyright 2015 Open Networking Laboratory

- *

- * Licensed 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 org.onosproject.net.statistic;

-

-import org.onosproject.net.ConnectPoint;

-import org.onosproject.net.Device;

-import org.onosproject.net.PortNumber;

-import org.onosproject.net.flow.TypedStoredFlowEntry;

-import org.onosproject.net.flow.instructions.Instruction;

-

-import java.util.List;

-import java.util.Map;

-

-/**

- * Service for obtaining individual flow statistic information about device and link in the system.

- * Basic statistics are obtained from the StatisticService

- */

-public interface FlowStatisticService {

-

-    /**

-     * Obtain the summary load list for the device with the given link.

-     *

-     * @param device the Device  to query.

-     * @return map of summary flow entry load

-     */

-    Map<ConnectPoint, SummaryFlowEntryWithLoad> loadSummary(Device device);

-

-    /**

-     * Obtain the summary load for the device with the given link or port.

-     *

-     * @param device the Device to query.

-     * @param pNumber the port number to query.

-     * @return summary flow entry load

-     */

-    SummaryFlowEntryWithLoad loadSummary(Device device, PortNumber pNumber);

-

-    /**

-     * Obtain the set of the flow type and load list for the device with the given link.

-     *

-     * @param device the Device  to query.

-     * @param liveType the FlowLiveType  to filter, null means no filtering .

-     * @param instType the InstructionType to filter, null means no filtering.

-     * @return map of flow entry load

-     */

-    Map<ConnectPoint, List<TypedFlowEntryWithLoad>> loadAllByType(Device device,

-                                                                  TypedStoredFlowEntry.FlowLiveType liveType,

-                                                                  Instruction.Type instType);

-

-    /**

-     * Obtain the flow type and load list for the device with the given link or port.

-     *

-     * @param device the Device to query.

-     * @param pNumber the port number of the Device to query

-     * @param liveType the FlowLiveType  to filter, null means no filtering .

-     * @param instType the InstructionType to filter, null means no filtering.

-     * @return list of flow entry load

-     */

-    List<TypedFlowEntryWithLoad> loadAllByType(Device device, PortNumber pNumber,

-                                               TypedStoredFlowEntry.FlowLiveType liveType,

-                                               Instruction.Type instType);

-

-    /**

-     * Obtain the set of the flow type and load topn list for the device with the given link.

-     *

-     * @param device the Device  to query.

-     * @param liveType the FlowLiveType  to filter, null means no filtering .

-     * @param instType the InstructionType to filter, null means no filtering.

-     * @param topn the top number to filter, null means no filtering.

-     * @return map of flow entry load

-     */

-    Map<ConnectPoint, List<TypedFlowEntryWithLoad>> loadTopnByType(Device device,

-                                                                   TypedStoredFlowEntry.FlowLiveType liveType,

-                                                                   Instruction.Type instType,

-                                                                   int topn);

-

-    /**

-     * Obtain the flow type and load topn list for the device with the given link or port.

-     *

-     * @param device the Device  to query.

-     * @param pNumber the port number of the Device to query

-     * @param liveType the FlowLiveType  to filter, null means no filtering .

-     * @param instType the InstructionType to filter, null means no filtering.

-     * @param topn topn //FIXME what?

-     * @return list of flow entry load

-     */

-    List<TypedFlowEntryWithLoad> loadTopnByType(Device device, PortNumber pNumber,

-                                                TypedStoredFlowEntry.FlowLiveType liveType,

-                                                Instruction.Type instType,

-                                                int topn);

-}

-

-

+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed 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 org.onosproject.net.statistic;
+
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.Device;
+import org.onosproject.net.PortNumber;
+import org.onosproject.net.flow.TypedStoredFlowEntry;
+import org.onosproject.net.flow.instructions.Instruction;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Service for obtaining individual flow statistic information about device and link in the system.
+ * Basic statistics are obtained from the StatisticService
+ */
+public interface FlowStatisticService {
+
+    /**
+     * Obtain the summary load list for the device with the given link.
+     *
+     * @param device the Device  to query.
+     * @return map of summary flow entry load
+     */
+    Map<ConnectPoint, SummaryFlowEntryWithLoad> loadSummary(Device device);
+
+    /**
+     * Obtain the summary load for the device with the given link or port.
+     *
+     * @param device the Device to query.
+     * @param pNumber the port number to query.
+     * @return summary flow entry load
+     */
+    SummaryFlowEntryWithLoad loadSummary(Device device, PortNumber pNumber);
+
+    /**
+     * Obtain the set of the flow type and load list for the device with the given link.
+     *
+     * @param device the Device  to query.
+     * @param liveType the FlowLiveType  to filter, null means no filtering .
+     * @param instType the InstructionType to filter, null means no filtering.
+     * @return map of flow entry load
+     */
+    Map<ConnectPoint, List<TypedFlowEntryWithLoad>> loadAllByType(Device device,
+                                                                  TypedStoredFlowEntry.FlowLiveType liveType,
+                                                                  Instruction.Type instType);
+
+    /**
+     * Obtain the flow type and load list for the device with the given link or port.
+     *
+     * @param device the Device to query.
+     * @param pNumber the port number of the Device to query
+     * @param liveType the FlowLiveType  to filter, null means no filtering .
+     * @param instType the InstructionType to filter, null means no filtering.
+     * @return list of flow entry load
+     */
+    List<TypedFlowEntryWithLoad> loadAllByType(Device device, PortNumber pNumber,
+                                               TypedStoredFlowEntry.FlowLiveType liveType,
+                                               Instruction.Type instType);
+
+    /**
+     * Obtain the set of the flow type and load topn list for the device with the given link.
+     *
+     * @param device the Device  to query.
+     * @param liveType the FlowLiveType  to filter, null means no filtering .
+     * @param instType the InstructionType to filter, null means no filtering.
+     * @param topn the top number to filter, null means no filtering.
+     * @return map of flow entry load
+     */
+    Map<ConnectPoint, List<TypedFlowEntryWithLoad>> loadTopnByType(Device device,
+                                                                   TypedStoredFlowEntry.FlowLiveType liveType,
+                                                                   Instruction.Type instType,
+                                                                   int topn);
+
+    /**
+     * Obtain the flow type and load topn list for the device with the given link or port.
+     *
+     * @param device the Device  to query.
+     * @param pNumber the port number of the Device to query
+     * @param liveType the FlowLiveType  to filter, null means no filtering .
+     * @param instType the InstructionType to filter, null means no filtering.
+     * @param topn topn //FIXME what?
+     * @return list of flow entry load
+     */
+    List<TypedFlowEntryWithLoad> loadTopnByType(Device device, PortNumber pNumber,
+                                                TypedStoredFlowEntry.FlowLiveType liveType,
+                                                Instruction.Type instType,
+                                                int topn);
+}
+
+
diff --git a/core/api/src/main/java/org/onosproject/net/statistic/FlowStatisticStore.java b/core/api/src/main/java/org/onosproject/net/statistic/FlowStatisticStore.java
index 3c2aa89..a27e167 100644
--- a/core/api/src/main/java/org/onosproject/net/statistic/FlowStatisticStore.java
+++ b/core/api/src/main/java/org/onosproject/net/statistic/FlowStatisticStore.java
@@ -1,65 +1,65 @@
-/*

- * Copyright 2015 Open Networking Laboratory

- *

- * Licensed 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 org.onosproject.net.statistic;

-

-import org.onosproject.net.ConnectPoint;

-import org.onosproject.net.flow.FlowEntry;

-import org.onosproject.net.flow.FlowRule;

-

-import java.util.Set;

-

-/**

- * Flow Store to house the computed statistics.

- */

-public interface FlowStatisticStore {

-    /**

-     * Remove entries associated with this rule.

-     *

-     * @param rule {@link org.onosproject.net.flow.FlowRule}

-     */

-    void removeFlowStatistic(FlowRule rule);

-

-    /**

-     * Adds a flow stats observation for a flow rule. The previous flow will be removed.

-     *

-     * @param rule a {@link org.onosproject.net.flow.FlowEntry}

-     */

-    void addFlowStatistic(FlowEntry rule);

-

-    /**

-     * Updates a stats observation for a flow rule. The old flow stats will be moved to previous stats.

-     *

-     * @param rule a {@link org.onosproject.net.flow.FlowEntry}

-     */

-    void updateFlowStatistic(FlowEntry rule);

-

-    /**

-     * Fetches the current observed flow stats values.

-     *

-     * @param connectPoint the port to fetch information for

-     * @return set of current flow rules

-     */

-    Set<FlowEntry> getCurrentFlowStatistic(ConnectPoint connectPoint);

-

-    /**

-     * Fetches the current observed flow stats values.

-     *

-     * @param connectPoint the port to fetch information for

-     * @return set of current values

-     */

-    Set<FlowEntry> getPreviousFlowStatistic(ConnectPoint connectPoint);

-}

+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed 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 org.onosproject.net.statistic;
+
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.flow.FlowEntry;
+import org.onosproject.net.flow.FlowRule;
+
+import java.util.Set;
+
+/**
+ * Flow Store to house the computed statistics.
+ */
+public interface FlowStatisticStore {
+    /**
+     * Remove entries associated with this rule.
+     *
+     * @param rule {@link org.onosproject.net.flow.FlowRule}
+     */
+    void removeFlowStatistic(FlowRule rule);
+
+    /**
+     * Adds a flow stats observation for a flow rule. The previous flow will be removed.
+     *
+     * @param rule a {@link org.onosproject.net.flow.FlowEntry}
+     */
+    void addFlowStatistic(FlowEntry rule);
+
+    /**
+     * Updates a stats observation for a flow rule. The old flow stats will be moved to previous stats.
+     *
+     * @param rule a {@link org.onosproject.net.flow.FlowEntry}
+     */
+    void updateFlowStatistic(FlowEntry rule);
+
+    /**
+     * Fetches the current observed flow stats values.
+     *
+     * @param connectPoint the port to fetch information for
+     * @return set of current flow rules
+     */
+    Set<FlowEntry> getCurrentFlowStatistic(ConnectPoint connectPoint);
+
+    /**
+     * Fetches the current observed flow stats values.
+     *
+     * @param connectPoint the port to fetch information for
+     * @return set of current values
+     */
+    Set<FlowEntry> getPreviousFlowStatistic(ConnectPoint connectPoint);
+}
diff --git a/core/api/src/main/java/org/onosproject/net/statistic/SummaryFlowEntryWithLoad.java b/core/api/src/main/java/org/onosproject/net/statistic/SummaryFlowEntryWithLoad.java
index 1ec427c..e98774c 100644
--- a/core/api/src/main/java/org/onosproject/net/statistic/SummaryFlowEntryWithLoad.java
+++ b/core/api/src/main/java/org/onosproject/net/statistic/SummaryFlowEntryWithLoad.java
@@ -1,157 +1,157 @@
-/*

- * Copyright 2015 Open Networking Laboratory

- *

- * Licensed 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 org.onosproject.net.statistic;

-

-import org.onosproject.net.ConnectPoint;

-

-/**

- * Summary Load classified by flow live type.

- */

-public class SummaryFlowEntryWithLoad {

-    private ConnectPoint cp;

-    private Load totalLoad;

-    private Load immediateLoad;

-    private Load shortLoad;

-    private Load midLoad;

-    private Load longLoad;

-    private Load unknownLoad;

-

-    /**

-     * Creates a new summary flow entry having load for the given connect point and total load.

-     *

-     * @param cp        connect point

-     * @param totalLoad total load

-     */

-    public SummaryFlowEntryWithLoad(ConnectPoint cp, Load totalLoad) {

-        this.cp = cp;

-        this.totalLoad = totalLoad;

-        this.immediateLoad = new DefaultLoad();

-        this.shortLoad = new DefaultLoad();

-        this.midLoad = new DefaultLoad();

-        this.longLoad = new DefaultLoad();

-        this.unknownLoad = new DefaultLoad();

-    }

-

-    /**

-     * Creates a new summary flow entry having load for the given connect point

-     * and total, immediate, short, mid, and long load.

-     *

-     * @param cp        connect point

-     * @param totalLoad total load

-     * @param immediateLoad immediate load

-     * @param shortLoad short load

-     * @param midLoad mid load

-     * @param longLoad long load

-     */

-    public SummaryFlowEntryWithLoad(ConnectPoint cp,

-                                    Load totalLoad, Load immediateLoad, Load shortLoad, Load midLoad, Load longLoad) {

-        this.cp = cp;

-        this.totalLoad = totalLoad;

-        this.immediateLoad = immediateLoad;

-        this.shortLoad = shortLoad;

-        this.midLoad = midLoad;

-        this.longLoad = longLoad;

-        this.unknownLoad = new DefaultLoad();

-    }

-

-    /**

-     * Creates a new summary flow entry having load for the given connect point

-     * and total, immediate, short, mid, long, and unknown load.

-     *

-     * @param cp        connect point

-     * @param totalLoad total load

-     * @param immediateLoad immediate load

-     * @param shortLoad short load

-     * @param midLoad mid load

-     * @param longLoad long load

-     * @param unknownLoad long load

-     */

-    public SummaryFlowEntryWithLoad(ConnectPoint cp,

-                                    Load totalLoad, Load immediateLoad,

-                                    Load shortLoad, Load midLoad, Load longLoad, Load unknownLoad) {

-        this.cp = cp;

-        this.totalLoad = totalLoad;

-        this.immediateLoad = immediateLoad;

-        this.shortLoad = shortLoad;

-        this.midLoad = midLoad;

-        this.longLoad = longLoad;

-        this.unknownLoad = unknownLoad;

-    }

-

-    /**

-     * Returns connect point.

-     *

-     * @return connect point

-     */

-    public ConnectPoint connectPoint() {

-        return cp;

-    }

-

-    /**

-     * Returns total load of connect point.

-     *

-     * @return total load

-     */

-    public Load totalLoad() {

-        return totalLoad;

-    }

-

-    /**

-     * Returns immediate load of connect point.

-     *

-     * @return immediate load

-     */

-    public Load immediateLoad() {

-        return immediateLoad;

-    }

-

-    /**

-     * Returns short load of connect point.

-     *

-     * @return short load

-     */

-    public Load shortLoad() {

-        return shortLoad;

-    }

-

-    /**

-     * Returns mid load of connect point.

-     *

-     * @return mid load

-     */

-    public Load midLoad() {

-        return midLoad;

-    }

-

-    /**

-     * Returns long load of connect point.

-     *

-     * @return long load

-     */

-    public Load longLoad() {

-        return longLoad;

-    }

-

-    /**

-     * Returns unknown load of connect point.

-     *

-     * @return unknown load

-     */

-    public Load unknownLoad() {

-        return unknownLoad;

-    }

-}

+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed 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 org.onosproject.net.statistic;
+
+import org.onosproject.net.ConnectPoint;
+
+/**
+ * Summary Load classified by flow live type.
+ */
+public class SummaryFlowEntryWithLoad {
+    private ConnectPoint cp;
+    private Load totalLoad;
+    private Load immediateLoad;
+    private Load shortLoad;
+    private Load midLoad;
+    private Load longLoad;
+    private Load unknownLoad;
+
+    /**
+     * Creates a new summary flow entry having load for the given connect point and total load.
+     *
+     * @param cp        connect point
+     * @param totalLoad total load
+     */
+    public SummaryFlowEntryWithLoad(ConnectPoint cp, Load totalLoad) {
+        this.cp = cp;
+        this.totalLoad = totalLoad;
+        this.immediateLoad = new DefaultLoad();
+        this.shortLoad = new DefaultLoad();
+        this.midLoad = new DefaultLoad();
+        this.longLoad = new DefaultLoad();
+        this.unknownLoad = new DefaultLoad();
+    }
+
+    /**
+     * Creates a new summary flow entry having load for the given connect point
+     * and total, immediate, short, mid, and long load.
+     *
+     * @param cp        connect point
+     * @param totalLoad total load
+     * @param immediateLoad immediate load
+     * @param shortLoad short load
+     * @param midLoad mid load
+     * @param longLoad long load
+     */
+    public SummaryFlowEntryWithLoad(ConnectPoint cp,
+                                    Load totalLoad, Load immediateLoad, Load shortLoad, Load midLoad, Load longLoad) {
+        this.cp = cp;
+        this.totalLoad = totalLoad;
+        this.immediateLoad = immediateLoad;
+        this.shortLoad = shortLoad;
+        this.midLoad = midLoad;
+        this.longLoad = longLoad;
+        this.unknownLoad = new DefaultLoad();
+    }
+
+    /**
+     * Creates a new summary flow entry having load for the given connect point
+     * and total, immediate, short, mid, long, and unknown load.
+     *
+     * @param cp        connect point
+     * @param totalLoad total load
+     * @param immediateLoad immediate load
+     * @param shortLoad short load
+     * @param midLoad mid load
+     * @param longLoad long load
+     * @param unknownLoad long load
+     */
+    public SummaryFlowEntryWithLoad(ConnectPoint cp,
+                                    Load totalLoad, Load immediateLoad,
+                                    Load shortLoad, Load midLoad, Load longLoad, Load unknownLoad) {
+        this.cp = cp;
+        this.totalLoad = totalLoad;
+        this.immediateLoad = immediateLoad;
+        this.shortLoad = shortLoad;
+        this.midLoad = midLoad;
+        this.longLoad = longLoad;
+        this.unknownLoad = unknownLoad;
+    }
+
+    /**
+     * Returns connect point.
+     *
+     * @return connect point
+     */
+    public ConnectPoint connectPoint() {
+        return cp;
+    }
+
+    /**
+     * Returns total load of connect point.
+     *
+     * @return total load
+     */
+    public Load totalLoad() {
+        return totalLoad;
+    }
+
+    /**
+     * Returns immediate load of connect point.
+     *
+     * @return immediate load
+     */
+    public Load immediateLoad() {
+        return immediateLoad;
+    }
+
+    /**
+     * Returns short load of connect point.
+     *
+     * @return short load
+     */
+    public Load shortLoad() {
+        return shortLoad;
+    }
+
+    /**
+     * Returns mid load of connect point.
+     *
+     * @return mid load
+     */
+    public Load midLoad() {
+        return midLoad;
+    }
+
+    /**
+     * Returns long load of connect point.
+     *
+     * @return long load
+     */
+    public Load longLoad() {
+        return longLoad;
+    }
+
+    /**
+     * Returns unknown load of connect point.
+     *
+     * @return unknown load
+     */
+    public Load unknownLoad() {
+        return unknownLoad;
+    }
+}
diff --git a/core/api/src/main/java/org/onosproject/net/statistic/TypedFlowEntryWithLoad.java b/core/api/src/main/java/org/onosproject/net/statistic/TypedFlowEntryWithLoad.java
index a4cbd7d..9d23ade 100644
--- a/core/api/src/main/java/org/onosproject/net/statistic/TypedFlowEntryWithLoad.java
+++ b/core/api/src/main/java/org/onosproject/net/statistic/TypedFlowEntryWithLoad.java
@@ -1,171 +1,171 @@
-/*

- * Copyright 2015 Open Networking Laboratory

- *

- * Licensed 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 org.onosproject.net.statistic;

-

-import org.onosproject.net.ConnectPoint;

-import org.onosproject.net.flow.FlowEntry;

-import org.onosproject.net.flow.TypedStoredFlowEntry;

-import org.onosproject.net.flow.DefaultTypedFlowEntry;

-

-import static com.google.common.base.Preconditions.checkNotNull;

-

-/**

- * Load of flow entry of flow live type.

- */

-public class TypedFlowEntryWithLoad {

-    private ConnectPoint cp;

-    private TypedStoredFlowEntry tfe;

-    private Load load;

-

-    //TODO: make this variables class, and share with NewAdaptivceFlowStatsCollector class

-    private static final int CAL_AND_POLL_INTERVAL = 5; // means SHORT_POLL_INTERVAL

-    private static final int MID_POLL_INTERVAL = 10;

-    private static final int LONG_POLL_INTERVAL = 15;

-

-    /**

-     * Creates a new typed flow entry with load.

-     *

-     * @param cp connect point

-     * @param tfe typed flow entry

-     * @param load load

-     */

-    public TypedFlowEntryWithLoad(ConnectPoint cp, TypedStoredFlowEntry tfe, Load load) {

-        this.cp = cp;

-        this.tfe = tfe;

-        this.load = load;

-    }

-

-    /**

-     * Creates a new typed flow entry with load.

-     *

-     * @param cp connect point

-     * @param tfe typed flow entry

-     */

-    public TypedFlowEntryWithLoad(ConnectPoint cp, TypedStoredFlowEntry tfe) {

-        this.cp = cp;

-        this.tfe = tfe;

-        this.load = new DefaultLoad(tfe.bytes(), 0, typedPollInterval(tfe));

-    }

-

-    /**

-     * Creates a new typed flow entry with load.

-     *

-     * @param cp connect point

-     * @param fe flow entry

-     */

-    public TypedFlowEntryWithLoad(ConnectPoint cp, FlowEntry fe) {

-        this.cp = cp;

-        this.tfe = newTypedStoredFlowEntry(fe);

-        this.load = new DefaultLoad(fe.bytes(), 0, typedPollInterval(this.tfe));

-    }

-

-    public ConnectPoint connectPoint() {

-        return cp;

-    }

-    public TypedStoredFlowEntry typedStoredFlowEntry() {

-        return tfe;

-    }

-    public Load load() {

-        return load;

-    }

-    public void setLoad(Load load) {

-        this.load = load;

-    }

-

-    /**

-     * Returns short polling interval.

-     *

-     * @return short poll interval

-     */

-    public static int shortPollInterval() {

-        return CAL_AND_POLL_INTERVAL;

-    }

-

-    /**

-     * Returns mid polling interval.

-     *

-     * @return mid poll interval

-     */

-    public static int midPollInterval() {

-        return MID_POLL_INTERVAL;

-    }

-

-    /**

-     * Returns long polling interval.

-     *

-     * @return long poll interval

-     */

-    public static int longPollInterval() {

-        return LONG_POLL_INTERVAL;

-    }

-

-    /**

-     * Returns average polling interval.

-     *

-     * @return average poll interval

-     */

-    public static int avgPollInterval() {

-        return (CAL_AND_POLL_INTERVAL + MID_POLL_INTERVAL + LONG_POLL_INTERVAL) / 3;

-    }

-

-    /**

-     * Returns current typed flow entry's polling interval.

-     *

-     * @param tfe typed flow entry

-     * @return typed poll interval

-     */

-    public static long typedPollInterval(TypedStoredFlowEntry tfe) {

-        checkNotNull(tfe, "TypedStoredFlowEntry cannot be null");

-

-        switch (tfe.flowLiveType()) {

-            case LONG_FLOW:

-                return LONG_POLL_INTERVAL;

-            case MID_FLOW:

-                return MID_POLL_INTERVAL;

-            case SHORT_FLOW:

-            case IMMEDIATE_FLOW:

-            default:

-                return CAL_AND_POLL_INTERVAL;

-        }

-    }

-

-    /**

-     * Creates a new typed flow entry with the given flow entry fe.

-     *

-     * @param fe flow entry

-     * @return new typed flow entry

-     */

-    public static TypedStoredFlowEntry newTypedStoredFlowEntry(FlowEntry fe) {

-        if (fe == null) {

-            return null;

-        }

-

-        long life = fe.life();

-

-        if (life >= LONG_POLL_INTERVAL) {

-            return new DefaultTypedFlowEntry(fe, TypedStoredFlowEntry.FlowLiveType.LONG_FLOW);

-        } else if (life >= MID_POLL_INTERVAL) {

-            return new DefaultTypedFlowEntry(fe, TypedStoredFlowEntry.FlowLiveType.MID_FLOW);

-        } else if (life >= CAL_AND_POLL_INTERVAL) {

-            return new DefaultTypedFlowEntry(fe, TypedStoredFlowEntry.FlowLiveType.SHORT_FLOW);

-        } else if (life >= 0) {

-            return new DefaultTypedFlowEntry(fe, TypedStoredFlowEntry.FlowLiveType.IMMEDIATE_FLOW);

-        } else { // life < 0

-            return new DefaultTypedFlowEntry(fe, TypedStoredFlowEntry.FlowLiveType.UNKNOWN_FLOW);

-        }

-    }

-}

+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed 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 org.onosproject.net.statistic;
+
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.flow.FlowEntry;
+import org.onosproject.net.flow.TypedStoredFlowEntry;
+import org.onosproject.net.flow.DefaultTypedFlowEntry;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Load of flow entry of flow live type.
+ */
+public class TypedFlowEntryWithLoad {
+    private ConnectPoint cp;
+    private TypedStoredFlowEntry tfe;
+    private Load load;
+
+    //TODO: make this variables class, and share with NewAdaptivceFlowStatsCollector class
+    private static final int CAL_AND_POLL_INTERVAL = 5; // means SHORT_POLL_INTERVAL
+    private static final int MID_POLL_INTERVAL = 10;
+    private static final int LONG_POLL_INTERVAL = 15;
+
+    /**
+     * Creates a new typed flow entry with load.
+     *
+     * @param cp connect point
+     * @param tfe typed flow entry
+     * @param load load
+     */
+    public TypedFlowEntryWithLoad(ConnectPoint cp, TypedStoredFlowEntry tfe, Load load) {
+        this.cp = cp;
+        this.tfe = tfe;
+        this.load = load;
+    }
+
+    /**
+     * Creates a new typed flow entry with load.
+     *
+     * @param cp connect point
+     * @param tfe typed flow entry
+     */
+    public TypedFlowEntryWithLoad(ConnectPoint cp, TypedStoredFlowEntry tfe) {
+        this.cp = cp;
+        this.tfe = tfe;
+        this.load = new DefaultLoad(tfe.bytes(), 0, typedPollInterval(tfe));
+    }
+
+    /**
+     * Creates a new typed flow entry with load.
+     *
+     * @param cp connect point
+     * @param fe flow entry
+     */
+    public TypedFlowEntryWithLoad(ConnectPoint cp, FlowEntry fe) {
+        this.cp = cp;
+        this.tfe = newTypedStoredFlowEntry(fe);
+        this.load = new DefaultLoad(fe.bytes(), 0, typedPollInterval(this.tfe));
+    }
+
+    public ConnectPoint connectPoint() {
+        return cp;
+    }
+    public TypedStoredFlowEntry typedStoredFlowEntry() {
+        return tfe;
+    }
+    public Load load() {
+        return load;
+    }
+    public void setLoad(Load load) {
+        this.load = load;
+    }
+
+    /**
+     * Returns short polling interval.
+     *
+     * @return short poll interval
+     */
+    public static int shortPollInterval() {
+        return CAL_AND_POLL_INTERVAL;
+    }
+
+    /**
+     * Returns mid polling interval.
+     *
+     * @return mid poll interval
+     */
+    public static int midPollInterval() {
+        return MID_POLL_INTERVAL;
+    }
+
+    /**
+     * Returns long polling interval.
+     *
+     * @return long poll interval
+     */
+    public static int longPollInterval() {
+        return LONG_POLL_INTERVAL;
+    }
+
+    /**
+     * Returns average polling interval.
+     *
+     * @return average poll interval
+     */
+    public static int avgPollInterval() {
+        return (CAL_AND_POLL_INTERVAL + MID_POLL_INTERVAL + LONG_POLL_INTERVAL) / 3;
+    }
+
+    /**
+     * Returns current typed flow entry's polling interval.
+     *
+     * @param tfe typed flow entry
+     * @return typed poll interval
+     */
+    public static long typedPollInterval(TypedStoredFlowEntry tfe) {
+        checkNotNull(tfe, "TypedStoredFlowEntry cannot be null");
+
+        switch (tfe.flowLiveType()) {
+            case LONG_FLOW:
+                return LONG_POLL_INTERVAL;
+            case MID_FLOW:
+                return MID_POLL_INTERVAL;
+            case SHORT_FLOW:
+            case IMMEDIATE_FLOW:
+            default:
+                return CAL_AND_POLL_INTERVAL;
+        }
+    }
+
+    /**
+     * Creates a new typed flow entry with the given flow entry fe.
+     *
+     * @param fe flow entry
+     * @return new typed flow entry
+     */
+    public static TypedStoredFlowEntry newTypedStoredFlowEntry(FlowEntry fe) {
+        if (fe == null) {
+            return null;
+        }
+
+        long life = fe.life();
+
+        if (life >= LONG_POLL_INTERVAL) {
+            return new DefaultTypedFlowEntry(fe, TypedStoredFlowEntry.FlowLiveType.LONG_FLOW);
+        } else if (life >= MID_POLL_INTERVAL) {
+            return new DefaultTypedFlowEntry(fe, TypedStoredFlowEntry.FlowLiveType.MID_FLOW);
+        } else if (life >= CAL_AND_POLL_INTERVAL) {
+            return new DefaultTypedFlowEntry(fe, TypedStoredFlowEntry.FlowLiveType.SHORT_FLOW);
+        } else if (life >= 0) {
+            return new DefaultTypedFlowEntry(fe, TypedStoredFlowEntry.FlowLiveType.IMMEDIATE_FLOW);
+        } else { // life < 0
+            return new DefaultTypedFlowEntry(fe, TypedStoredFlowEntry.FlowLiveType.UNKNOWN_FLOW);
+        }
+    }
+}