Merge "Fix checkstyle warnings in opendaylight/netconf"
authorTony Tkacik <ttkacik@cisco.com>
Fri, 7 Nov 2014 14:30:01 +0000 (14:30 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 7 Nov 2014 14:30:01 +0000 (14:30 +0000)
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultNetconfOperation.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStartExi.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStopExi.java
opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/exi/EXIParameters.java
opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/startExi.xml
opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/stopExi.xml

index 13d4ab290b3c333d25e2e50ec66f15e79e19ec7f..2646b7e26ea4300b3f7a8ba770d0bd9243026b66 100644 (file)
@@ -1,14 +1,14 @@
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.netconf.impl.mapping.operations;\r
-\r
-import org.opendaylight.controller.netconf.impl.NetconfServerSession;\r
-\r
-public interface DefaultNetconfOperation {\r
-    void setNetconfSession(NetconfServerSession s);\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  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.netconf.impl.mapping.operations;
+
+import org.opendaylight.controller.netconf.impl.NetconfServerSession;
+
+public interface DefaultNetconfOperation {
+    void setNetconfSession(NetconfServerSession s);
+}
index cccb1a3ac362e35c6f0efcd5836b3c5a51e1a320..6de185ac1c1da4948fc343a4be19759362af03f0 100644 (file)
@@ -1,71 +1,71 @@
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.netconf.impl.mapping.operations;\r
-\r
-import org.opendaylight.controller.netconf.api.NetconfDocumentedException;\r
-import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorSeverity;\r
-import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorTag;\r
-import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorType;\r
-import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;\r
-import org.opendaylight.controller.netconf.api.NetconfMessage;\r
-import org.opendaylight.controller.netconf.impl.NetconfServerSession;\r
-import org.opendaylight.controller.netconf.mapping.api.NetconfOperationChainedExecution;\r
-import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation;\r
-import org.opendaylight.controller.netconf.util.xml.XmlElement;\r
-import org.opendaylight.controller.netconf.util.xml.XmlUtil;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-import org.w3c.dom.Document;\r
-import org.w3c.dom.Element;\r
-public class DefaultStartExi extends AbstractSingletonNetconfOperation implements DefaultNetconfOperation {\r
-    public static final String START_EXI = "start-exi";\r
-\r
-    private static final Logger logger = LoggerFactory.getLogger(DefaultStartExi.class);\r
-    private NetconfServerSession netconfSession;\r
-\r
-    public DefaultStartExi(String netconfSessionIdForReporting) {\r
-        super(netconfSessionIdForReporting);\r
-    }\r
-\r
-    @Override\r
-    public Document handle(Document message,\r
-                           NetconfOperationChainedExecution subsequentOperation) throws NetconfDocumentedException {\r
-        logger.debug("Received start-exi message {} ", XmlUtil.toString(message));\r
-\r
-        try {\r
-            netconfSession.startExiCommunication(new NetconfMessage(message));\r
-        } catch (IllegalArgumentException e) {\r
-            throw new NetconfDocumentedException("Failed to parse EXI parameters", ErrorType.protocol,\r
-                    ErrorTag.operation_failed, ErrorSeverity.error);\r
-        }\r
-\r
-        return super.handle(message, subsequentOperation);\r
-    }\r
-\r
-    @Override\r
-    protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException {\r
-        Element getSchemaResult = document.createElementNS( XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.OK);\r
-        logger.trace("{} operation successful", START_EXI);\r
-        return getSchemaResult;\r
-    }\r
-\r
-    @Override\r
-    protected String getOperationName() {\r
-        return START_EXI;\r
-    }\r
-\r
-    @Override\r
-    protected String getOperationNamespace() {\r
-        return XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0;\r
-    }\r
-\r
-    @Override\r
-    public void setNetconfSession(NetconfServerSession s) {\r
-        netconfSession = s;\r
-    }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  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.netconf.impl.mapping.operations;
+
+import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
+import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorSeverity;
+import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorTag;
+import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorType;
+import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
+import org.opendaylight.controller.netconf.api.NetconfMessage;
+import org.opendaylight.controller.netconf.impl.NetconfServerSession;
+import org.opendaylight.controller.netconf.mapping.api.NetconfOperationChainedExecution;
+import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation;
+import org.opendaylight.controller.netconf.util.xml.XmlElement;
+import org.opendaylight.controller.netconf.util.xml.XmlUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+public class DefaultStartExi extends AbstractSingletonNetconfOperation implements DefaultNetconfOperation {
+    public static final String START_EXI = "start-exi";
+
+    private static final Logger logger = LoggerFactory.getLogger(DefaultStartExi.class);
+    private NetconfServerSession netconfSession;
+
+    public DefaultStartExi(String netconfSessionIdForReporting) {
+        super(netconfSessionIdForReporting);
+    }
+
+    @Override
+    public Document handle(Document message,
+                           NetconfOperationChainedExecution subsequentOperation) throws NetconfDocumentedException {
+        logger.debug("Received start-exi message {} ", XmlUtil.toString(message));
+
+        try {
+            netconfSession.startExiCommunication(new NetconfMessage(message));
+        } catch (IllegalArgumentException e) {
+            throw new NetconfDocumentedException("Failed to parse EXI parameters", ErrorType.protocol,
+                    ErrorTag.operation_failed, ErrorSeverity.error);
+        }
+
+        return super.handle(message, subsequentOperation);
+    }
+
+    @Override
+    protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException {
+        Element getSchemaResult = document.createElementNS( XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.OK);
+        logger.trace("{} operation successful", START_EXI);
+        return getSchemaResult;
+    }
+
+    @Override
+    protected String getOperationName() {
+        return START_EXI;
+    }
+
+    @Override
+    protected String getOperationNamespace() {
+        return XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0;
+    }
+
+    @Override
+    public void setNetconfSession(NetconfServerSession s) {
+        netconfSession = s;
+    }
+}
index 2a24ae32fa0cad9bef292cd53cc8718424692b7c..233638d5b08d57b608957d1f18085535918f80f6 100644 (file)
@@ -1,58 +1,58 @@
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.netconf.impl.mapping.operations;\r
-\r
-import org.opendaylight.controller.netconf.api.NetconfDocumentedException;\r
-import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;\r
-import org.opendaylight.controller.netconf.impl.NetconfServerSession;\r
-import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation;\r
-import org.opendaylight.controller.netconf.util.xml.XmlElement;\r
-import org.opendaylight.controller.netconf.util.xml.XmlUtil;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-import org.w3c.dom.Document;\r
-import org.w3c.dom.Element;\r
-\r
-public class DefaultStopExi extends AbstractSingletonNetconfOperation implements DefaultNetconfOperation {\r
-\r
-    public static final String STOP_EXI = "stop-exi";\r
-    private NetconfServerSession netconfSession;\r
-\r
-    private static final Logger logger = LoggerFactory\r
-            .getLogger(DefaultStartExi.class);\r
-\r
-    public DefaultStopExi(String netconfSessionIdForReporting) {\r
-        super(netconfSessionIdForReporting);\r
-    }\r
-\r
-    @Override\r
-    protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException {\r
-        logger.debug("Received stop-exi message {} ", XmlUtil.toString(operationElement));\r
-\r
-        netconfSession.stopExiCommunication();\r
-\r
-        Element getSchemaResult = document.createElementNS( XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.OK);\r
-        logger.trace("{} operation successful", STOP_EXI);\r
-        return getSchemaResult;\r
-    }\r
-\r
-    @Override\r
-    protected String getOperationName() {\r
-        return STOP_EXI;\r
-    }\r
-\r
-    @Override\r
-    protected String getOperationNamespace() {\r
-        return XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0;\r
-    }\r
-\r
-    @Override\r
-    public void setNetconfSession(NetconfServerSession s) {\r
-        this.netconfSession = s;\r
-    }\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  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.netconf.impl.mapping.operations;
+
+import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
+import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
+import org.opendaylight.controller.netconf.impl.NetconfServerSession;
+import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation;
+import org.opendaylight.controller.netconf.util.xml.XmlElement;
+import org.opendaylight.controller.netconf.util.xml.XmlUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class DefaultStopExi extends AbstractSingletonNetconfOperation implements DefaultNetconfOperation {
+
+    public static final String STOP_EXI = "stop-exi";
+    private NetconfServerSession netconfSession;
+
+    private static final Logger logger = LoggerFactory
+            .getLogger(DefaultStartExi.class);
+
+    public DefaultStopExi(String netconfSessionIdForReporting) {
+        super(netconfSessionIdForReporting);
+    }
+
+    @Override
+    protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException {
+        logger.debug("Received stop-exi message {} ", XmlUtil.toString(operationElement));
+
+        netconfSession.stopExiCommunication();
+
+        Element getSchemaResult = document.createElementNS( XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.OK);
+        logger.trace("{} operation successful", STOP_EXI);
+        return getSchemaResult;
+    }
+
+    @Override
+    protected String getOperationName() {
+        return STOP_EXI;
+    }
+
+    @Override
+    protected String getOperationNamespace() {
+        return XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0;
+    }
+
+    @Override
+    public void setNetconfSession(NetconfServerSession s) {
+        this.netconfSession = s;
+    }
+}
index 531ba3ccb725589d76725ebfc9ecdae7ecdd35bc..ccd7dead9f1a9a782743d423650fd5153005e1eb 100644 (file)
@@ -48,18 +48,18 @@ public final class EXIParameters {
             final String alignmentTextContent = alignmentElement.getTextContent().trim();
 
             switch (alignmentTextContent) {
-                case EXI_PARAMETER_BIT_PACKED:
-                    options.setAlignmentType(AlignmentType.bitPacked);
-                    break;
-                case EXI_PARAMETER_BYTE_ALIGNED:
-                    options.setAlignmentType(AlignmentType.byteAligned);
-                    break;
-                case EXI_PARAMETER_COMPRESSED:
-                    options.setAlignmentType(AlignmentType.compress);
-                    break;
-                case EXI_PARAMETER_PRE_COMPRESSION:
-                    options.setAlignmentType(AlignmentType.preCompress);
-                    break;
+            case EXI_PARAMETER_BIT_PACKED:
+                options.setAlignmentType(AlignmentType.bitPacked);
+                break;
+            case EXI_PARAMETER_BYTE_ALIGNED:
+                options.setAlignmentType(AlignmentType.byteAligned);
+                break;
+            case EXI_PARAMETER_COMPRESSED:
+                options.setAlignmentType(AlignmentType.compress);
+                break;
+            case EXI_PARAMETER_PRE_COMPRESSION:
+                options.setAlignmentType(AlignmentType.preCompress);
+                break;
             }
         }
 
index e7a483e4056a9f8c4ccb2aa1c1cbcc9e6d2b2032..5e94ac6110ca73d84817222f566cf965ff01d62d 100644 (file)
@@ -1,9 +1,9 @@
-<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" a="64" message-id="a">\r
-<start-exi xmlns="urn:ietf:params:xml:ns:netconf:exi:1.0">\r
-<alignment>pre-compression</alignment>\r
-<fidelity>\r
-<dtd/>\r
-<lexical-values/>\r
-</fidelity>\r
-</start-exi>\r
-</rpc>
\ No newline at end of file
+<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" a="64" message-id="a">
+<start-exi xmlns="urn:ietf:params:xml:ns:netconf:exi:1.0">
+<alignment>pre-compression</alignment>
+<fidelity>
+<dtd/>
+<lexical-values/>
+</fidelity>
+</start-exi>
+</rpc>
index 6c0524a4fce9d9059e8fd32b6fc2a21cd7c1ff60..170c753993f174d5aeeba66ca7e157ec5a7ad757 100644 (file)
@@ -1,3 +1,3 @@
-<rpc message-id="a" a="64" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">\r
-    <stop-exi xmlns="urn:ietf:params:xml:ns:netconf:exi:1.0"/>\r
-</rpc>
\ No newline at end of file
+<rpc message-id="a" a="64" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+    <stop-exi xmlns="urn:ietf:params:xml:ns:netconf:exi:1.0"/>
+</rpc>