Remove dependency on Exificient due to licensing incompatibility 01/4701/2
authorRobert Varga <rovarga@cisco.com>
Fri, 24 Jan 2014 10:57:06 +0000 (11:57 +0100)
committerRobert Varga <rovarga@cisco.com>
Fri, 24 Jan 2014 13:54:34 +0000 (14:54 +0100)
Exificient is licensed under GPLv2 with no intention to add the
classpath exception (witnessed in at
http://sourceforge.net/p/exificient/discussion/856595/thread/6017013e/).
Remove all dependencies on it, pending reimplementation using a more
open library (OpenEXI looks like a good candidate).

Change-Id: I589367be593ebc275c7551d9e6008b74d8461de5
Signed-off-by: Robert Varga <rovarga@cisco.com>
19 files changed:
opendaylight/commons/opendaylight/pom.xml
opendaylight/distribution/opendaylight/pom.xml
opendaylight/md-sal/sal-binding-it/src/main/java/org/opendaylight/controller/test/sal/binding/it/TestHelper.java
opendaylight/md-sal/test/sal-rest-connector-it/pom.xml
opendaylight/md-sal/test/sal-rest-connector-it/src/test/java/org/opendaylight/controller/test/restconf/it/ServiceProviderController.java
opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSession.java
opendaylight/netconf/netconf-client/src/main/resources/client_hello.xml
opendaylight/netconf/netconf-impl/pom.xml
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/ExiDecoderHandler.java [deleted file]
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/ExiEncoderHandler.java [deleted file]
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-impl/src/main/resources/server_hello.xml
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ExiEncodeDecodeTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITTest.java
opendaylight/netconf/netconf-util/pom.xml
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/ExiParameters.java [deleted file]
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/ExiUtil.java [deleted file]
opendaylight/netconf/pom.xml

index 64c873b347511a7de582b2e3e8c8da594bdbbf17..eb7800fd5bbd9b2f5d9451f6d591cf4e62a7586a 100644 (file)
     <java.version.target>1.7</java.version.target>
     <!-- enforcer version -->
     <enforcer.version>1.3.1</enforcer.version>
-    <exi.version>0.9.2-SNAPSHOT</exi.version>
   </properties>
 
   <dependencyManagement>
         <artifactId>org.openflow.openflowj</artifactId>
         <version>1.0.2</version>
       </dependency>
-      <dependency>
-        <groupId>org.opendaylight.controller.thirdparty</groupId>
-        <artifactId>exificient</artifactId>
-        <version>${exi.version}</version>
-      </dependency>
       <dependency>
         <groupId>org.opendaylight.controller.thirdparty</groupId>
         <artifactId>com.sun.jersey.jersey-servlet</artifactId>
index cdb4e35cdde94678310ac9db4727b79bd60e127a..d3be9160f11c949d02d2ea9b807135bce1b9995b 100644 (file)
           <artifactId>config-persister-impl</artifactId>
           <version>${netconf.version}</version>
         </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller.thirdparty</groupId>
-          <artifactId>exificient</artifactId>
-          <version>${exi.version}</version>
-        </dependency>
         <dependency>
             <groupId>org.apache.servicemix.bundles</groupId>
             <artifactId>org.apache.servicemix.bundles.xerces</artifactId>
index c0dec7c0297a2b8afce2017ab744409db559cf40..b4f6beaa450b90bf40c800fa1bfee71da19b36a4 100644 (file)
@@ -69,8 +69,6 @@ public class TestHelper {
                 mavenBundle("io.netty", "netty-transport").versionAsInProject(), //
                 mavenBundle("io.netty", "netty-common").versionAsInProject(), //
 
-                mavenBundle("org.opendaylight.controller.thirdparty", "exificient", "0.9.2-SNAPSHOT"), //
-
                 mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.xerces", "2.11.0_1"),
                 mavenBundle("org.eclipse.birt.runtime.3_7_1", "org.apache.xml.resolver", "1.2.0"),
 
index c03833d72b8c45c51e4c826194cbdb9f9ea6bf1b..64ca5aeb9bf584e568246265fa3bbef34a1422c6 100644 (file)
             <version>1.0-SNAPSHOT</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-        <groupId>org.opendaylight.controller.thirdparty</groupId>
-        <artifactId>exificient</artifactId>
-        <version>0.9.2</version>
-        </dependency>
         <dependency>
             <groupId>org.ops4j.pax.exam</groupId>
             <artifactId>pax-exam-container-native</artifactId>
index 8763724560a771485d11d3b127a6d2e868c1786d..b5ab8a982a08bfe6d586cdae34b262ef6fc9a7c8 100644 (file)
@@ -227,8 +227,6 @@ public class ServiceProviderController {
                 mavenBundle(YANG, "yang-parser-impl").versionAsInProject(),
                 mavenBundle(YANG, "binding-type-provider").versionAsInProject(),
 
-                mavenBundle("org.opendaylight.controller.thirdparty", "exificient", "0.9.2"),
-
                 mavenBundle("equinoxSDK381", "javax.servlet").versionAsInProject(),
                 mavenBundle("equinoxSDK381", "javax.servlet.jsp").versionAsInProject(),
                 mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds").versionAsInProject(),
index eb7235f04490eaaef675e7f993da23455223222f..6c747dbe244fde8812a17a8f923eff49c67fba4d 100644 (file)
@@ -8,25 +8,16 @@
 package org.opendaylight.controller.netconf.api;
 
 import io.netty.channel.Channel;
-import io.netty.channel.ChannelHandler;
 import org.opendaylight.protocol.framework.AbstractProtocolSession;
-import org.opendaylight.protocol.framework.ProtocolMessageDecoder;
-import org.opendaylight.protocol.framework.ProtocolMessageEncoder;
 import org.opendaylight.protocol.framework.SessionListener;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
-import java.util.Map;
 
 public abstract class NetconfSession extends AbstractProtocolSession<NetconfMessage> {
-
-    private ChannelHandler exiEncoder;
-    private String exiEncoderName;
-    private String removeAfterMessageSentname;
-    private String pmeName,pmdName;
-    protected final  Channel channel;
-    private final  SessionListener sessionListener;
+    protected final Channel channel;
+    private final SessionListener sessionListener;
     private final long sessionId;
     private boolean up = false;
     private static final Logger logger = LoggerFactory.getLogger(NetconfSession.class);
@@ -36,18 +27,6 @@ public abstract class NetconfSession extends AbstractProtocolSession<NetconfMess
         this.channel = channel;
         this.sessionId = sessionId;
         logger.debug("Session {} created", toString());
-
-        ChannelHandler pmd = channel.pipeline().get(ProtocolMessageDecoder.class);
-        ChannelHandler pme = channel.pipeline().get(ProtocolMessageEncoder.class);
-
-        for (Map.Entry<String, ChannelHandler> entry:channel.pipeline().toMap().entrySet()){
-            if (entry.getValue().equals(pmd)){
-                pmdName = entry.getKey();
-            }
-            if (entry.getValue().equals(pme)){
-                pmeName = entry.getKey();
-            }
-        }
     }
     @Override
     public void close() {
@@ -64,15 +43,6 @@ public abstract class NetconfSession extends AbstractProtocolSession<NetconfMess
 
     public void sendMessage(NetconfMessage netconfMessage) {
         channel.writeAndFlush(netconfMessage);
-        if (exiEncoder!=null){
-            if (channel.pipeline().get(exiEncoderName)== null){
-                channel.pipeline().addBefore(pmeName, exiEncoderName, exiEncoder);
-            }
-        }
-        if (removeAfterMessageSentname!=null){
-            channel.pipeline().remove(removeAfterMessageSentname);
-            removeAfterMessageSentname = null;
-        }
     }
 
     @Override
@@ -106,39 +76,5 @@ public abstract class NetconfSession extends AbstractProtocolSession<NetconfMess
     public long getSessionId() {
         return sessionId;
     }
-
-    public <T extends ChannelHandler> T remove(Class<T> handlerType) {
-        return channel.pipeline().remove(handlerType);
-    }
-
-    public <T extends ChannelHandler> T getHandler(Class<T> handlerType) {
-        return channel.pipeline().get(handlerType);
-   }
-
-    public void addFirst(ChannelHandler handler, String name){
-        channel.pipeline().addFirst(name, handler);
-    }
-    public void addLast(ChannelHandler handler, String name){
-        channel.pipeline().addLast(name, handler);
-    }
-
-    public void addExiDecoder(String name,ChannelHandler handler){
-        if (channel.pipeline().get(name)== null){
-            channel.pipeline().addBefore(pmdName, name, handler);
-        }
-    }
-    public void addExiEncoderAfterMessageSent(String name, ChannelHandler handler){
-        this.exiEncoder = handler;
-        this.exiEncoderName = name;
-    }
-
-    public void addExiEncoder(String name, ChannelHandler handler){
-        channel.pipeline().addBefore(pmeName, name, handler);
-    }
-
-    public void removeAfterMessageSent(String handlerName){
-        this.removeAfterMessageSentname = handlerName;
-    }
-
 }
 
index 520627a09899c826f7a7254610cf8e9f7f776b65..46f6f76412e01b8b09c45f209021fff8ec0d270d 100644 (file)
@@ -2,6 +2,5 @@
     <capabilities>
         <capability>urn:ietf:params:netconf:base:1.0</capability>
         <capability>urn:ietf:params:netconf:base:1.1</capability>
-        <capability>urn:ietf:params:netconf:capability:exi:1.0</capability>
     </capabilities>
-</hello>
\ No newline at end of file
+</hello>
index 766772b1e93d17089affe5ab0370576a8578c873..2d56883e30ccafb0706fcabaa0cd281dfa58b150 100644 (file)
                             org.w3c.dom,
                             org.xml.sax,
                             org.opendaylight.controller.netconf.util.messages,
-                            com.siemens.ct.exi.exceptions,
                             io.netty.util.internal,
                             org.opendaylight.controller.netconf.api.monitoring,
                             org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924,
diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/ExiDecoderHandler.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/ExiDecoderHandler.java
deleted file mode 100644 (file)
index 721c0c2..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*\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;\r
-\r
-import io.netty.buffer.ByteBuf;\r
-import io.netty.channel.ChannelHandlerContext;\r
-import io.netty.handler.codec.ByteToMessageDecoder;\r
-\r
-import java.util.List;\r
-\r
-import org.opendaylight.controller.netconf.util.xml.ExiParameters;\r
-import org.opendaylight.controller.netconf.util.xml.ExiUtil;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-public class ExiDecoderHandler extends ByteToMessageDecoder {\r
-\r
-    public static final String HANDLER_NAME;\r
-\r
-    static {\r
-        HANDLER_NAME = "exiDecoder";\r
-    }\r
-\r
-    private final static Logger logger = LoggerFactory\r
-            .getLogger(ExiDecoderHandler.class);\r
-\r
-    private ExiParameters parameters;\r
-\r
-    public ExiDecoderHandler(ExiParameters parameters) {\r
-        this.parameters = parameters;\r
-    }\r
-\r
-    @Override\r
-    protected void decode(ChannelHandlerContext ctx, ByteBuf in,\r
-            List<Object> out) {\r
-        try {\r
-            ExiUtil.decode(in, out, this.parameters);\r
-        } catch (Exception e) {\r
-            throw new IllegalStateException("Unable to decode exi message.");\r
-        }\r
-    }\r
-\r
-}\r
diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/ExiEncoderHandler.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/ExiEncoderHandler.java
deleted file mode 100644 (file)
index e7a5917..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*\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;\r
-\r
-import io.netty.buffer.ByteBuf;\r
-import io.netty.channel.ChannelHandlerContext;\r
-import io.netty.handler.codec.MessageToByteEncoder;\r
-\r
-import org.opendaylight.controller.netconf.util.xml.ExiParameters;\r
-import org.opendaylight.controller.netconf.util.xml.ExiUtil;\r
-\r
-public class ExiEncoderHandler extends MessageToByteEncoder<Object> {\r
-\r
-    public static final String HANDLER_NAME;\r
-    static {\r
-        HANDLER_NAME = "exiEncoder";\r
-    }\r
-\r
-    private ExiParameters parameters;\r
-\r
-    public ExiEncoderHandler(ExiParameters parameters) {\r
-        this.parameters = parameters;\r
-    }\r
-\r
-    @Override\r
-    protected void encode(ChannelHandlerContext ctx, Object msg, ByteBuf out)\r
-            throws Exception {\r
-        try {\r
-            ExiUtil.encode(msg, out, this.parameters);\r
-        } catch (Exception e) {\r
-            throw new IllegalStateException("Unable to encode exi message.");\r
-        }\r
-    }\r
-}\r
index 679e280ba22933822d6c08942c80b548b075c0da..38c1a447e4ba7e3613df52e7dff3bf67cfe4f9be 100644 (file)
@@ -10,12 +10,9 @@ package org.opendaylight.controller.netconf.impl.mapping.operations;
 import org.opendaylight.controller.netconf.api.NetconfSession;\r
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;\r
 import org.opendaylight.controller.netconf.api.NetconfOperationRouter;\r
-import org.opendaylight.controller.netconf.impl.mapping.ExiDecoderHandler;\r
-import org.opendaylight.controller.netconf.impl.mapping.ExiEncoderHandler;\r
 import org.opendaylight.controller.netconf.mapping.api.DefaultNetconfOperation;\r
 import org.opendaylight.controller.netconf.mapping.api.HandlingPriority;\r
 import org.opendaylight.controller.netconf.util.mapping.AbstractNetconfOperation;\r
-import org.opendaylight.controller.netconf.util.xml.ExiParameters;\r
 import org.opendaylight.controller.netconf.util.xml.XmlElement;\r
 import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants;\r
 import org.opendaylight.controller.netconf.util.xml.XmlUtil;\r
@@ -24,8 +21,6 @@ import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;\r
 import org.w3c.dom.Element;\r
 \r
-import com.siemens.ct.exi.exceptions.EXIException;\r
-\r
 public class DefaultStartExi extends AbstractNetconfOperation implements DefaultNetconfOperation {\r
 \r
     public static final String START_EXI = "start-exi";\r
@@ -61,6 +56,9 @@ public class DefaultStartExi extends AbstractNetconfOperation implements Default
                 XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);\r
 \r
 \r
+        throw new UnsupportedOperationException("Not implemented");\r
+\r
+        /*\r
         try {\r
             ExiParameters exiParams = new ExiParameters();\r
             exiParams.setParametersFromXmlElement(operationElement);\r
@@ -76,7 +74,7 @@ public class DefaultStartExi extends AbstractNetconfOperation implements Default
         logger.trace("{} operation successful", START_EXI);\r
         logger.debug("received start-exi message {} ", XmlUtil.toString(document));\r
         return getSchemaResult;\r
-\r
+        */\r
     }\r
 \r
     @Override\r
index d841a6619eab5bc285f4a23eabd3a4b9d9ea43bd..6ea5deb64576f7d936e30f438315e51b823434ef 100644 (file)
@@ -10,14 +10,11 @@ package org.opendaylight.controller.netconf.impl.mapping.operations;
 import org.opendaylight.controller.netconf.api.NetconfSession;\r
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;\r
 import org.opendaylight.controller.netconf.api.NetconfOperationRouter;\r
-import org.opendaylight.controller.netconf.impl.mapping.ExiDecoderHandler;\r
-import org.opendaylight.controller.netconf.impl.mapping.ExiEncoderHandler;\r
 import org.opendaylight.controller.netconf.mapping.api.DefaultNetconfOperation;\r
 import org.opendaylight.controller.netconf.mapping.api.HandlingPriority;\r
 import org.opendaylight.controller.netconf.util.mapping.AbstractNetconfOperation;\r
 import org.opendaylight.controller.netconf.util.xml.XmlElement;\r
 import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants;\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
@@ -50,7 +47,8 @@ public class DefaultStopExi extends AbstractNetconfOperation implements DefaultN
     @Override\r
     protected Element handle(Document document, XmlElement operationElement,\r
             NetconfOperationRouter opRouter) throws NetconfDocumentedException {\r
-\r
+        throw new UnsupportedOperationException("Not implemented");\r
+        /*\r
         netconfSession.remove(ExiDecoderHandler.class);\r
         netconfSession.removeAfterMessageSent(ExiEncoderHandler.HANDLER_NAME);\r
 \r
@@ -60,6 +58,7 @@ public class DefaultStopExi extends AbstractNetconfOperation implements DefaultN
         logger.trace("{} operation successful", STOP_EXI);\r
         logger.debug("received stop-exi message {} ", XmlUtil.toString(document));\r
         return getSchemaResult;\r
+        */\r
     }\r
 \r
     @Override\r
@@ -70,4 +69,4 @@ public class DefaultStopExi extends AbstractNetconfOperation implements DefaultN
     public NetconfSession getNetconfSession() {\r
         return netconfSession;\r
     }\r
-}
\ No newline at end of file
+}\r
index eb4b4b9225b4e8a56f92de3714513d0fcb91a295..6a3f911cd4e0ed5958700b05344ccdb3162b03b2 100644 (file)
@@ -2,7 +2,6 @@
 <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <capabilities>
         <capability>urn:ietf:params:netconf:base:1.0</capability>
-        <capability>urn:ietf:params:netconf:capability:exi:1.0</capability>
     </capabilities>
     <session-id>1</session-id>
 </hello>
index 73eb608f0b7bac686c9dd02b5dbf656b723ed3c8..d7beb5df9b4393eb4e88b8e1ba7f4e42ea9c01e7 100644 (file)
@@ -8,20 +8,10 @@
 package org.opendaylight.controller.netconf.impl;\r
 \r
 import static junit.framework.Assert.assertNotNull;\r
-import io.netty.buffer.ByteBuf;\r
-import io.netty.buffer.Unpooled;\r
-\r
-import java.util.ArrayList;\r
-import java.util.List;\r
 \r
 import org.junit.Test;\r
 import org.opendaylight.controller.netconf.api.NetconfMessage;\r
 import org.opendaylight.controller.netconf.util.test.XmlFileLoader;\r
-import org.opendaylight.controller.netconf.util.xml.ExiParameters;\r
-import org.opendaylight.controller.netconf.util.xml.ExiUtil;\r
-import org.opendaylight.controller.netconf.util.xml.XmlElement;\r
-\r
-\r
 \r
 public class ExiEncodeDecodeTest  {\r
     @Test\r
@@ -33,6 +23,7 @@ public class ExiEncodeDecodeTest  {
         NetconfMessage startExiMessage = XmlFileLoader.xmlFileToNetconfMessage(("netconfMessages/startExi.xml"));\r
         assertNotNull(startExiMessage);\r
 \r
+        /*\r
         ExiParameters exiParams = new ExiParameters();\r
         exiParams.setParametersFromXmlElement(XmlElement.fromDomElement(startExiMessage.getDocument().getDocumentElement()));\r
         assertNotNull(exiParams);\r
@@ -47,5 +38,6 @@ public class ExiEncodeDecodeTest  {
         ByteBuf decodedBuf = (ByteBuf)newOut.get(0);\r
         String decodedString = new String(decodedBuf.array(),"UTF-8");\r
         assertNotNull(decodedString);\r
+        */\r
     }\r
 }\r
index 36f30dd328f66367cf2582af790dde7b91263134..5f4bcecff05ed6e75e8725082a618ce517ffad16 100644 (file)
@@ -41,8 +41,6 @@ import org.opendaylight.controller.netconf.impl.NetconfServerDispatcher;
 import org.opendaylight.controller.netconf.impl.NetconfServerSessionListenerFactory;
 import org.opendaylight.controller.netconf.impl.NetconfServerSessionNegotiatorFactory;
 import org.opendaylight.controller.netconf.impl.SessionIdProvider;
-import org.opendaylight.controller.netconf.impl.mapping.ExiDecoderHandler;
-import org.opendaylight.controller.netconf.impl.mapping.ExiEncoderHandler;
 import org.opendaylight.controller.netconf.impl.osgi.NetconfMonitoringServiceImpl;
 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListener;
 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl;
@@ -51,7 +49,6 @@ import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService;
 import org.opendaylight.controller.netconf.ssh.NetconfSSHServer;
 import org.opendaylight.controller.netconf.ssh.authentication.AuthProvider;
 import org.opendaylight.controller.netconf.util.test.XmlFileLoader;
-import org.opendaylight.controller.netconf.util.xml.ExiParameters;
 import org.opendaylight.controller.netconf.util.xml.XmlElement;
 import org.opendaylight.controller.netconf.util.xml.XmlUtil;
 import org.slf4j.Logger;
@@ -301,8 +298,8 @@ public class NetconfITTest extends AbstractConfigTest {
         }
     }
 
+    /*
     @Test
-//    @Ignore
     public void testStartExi() throws Exception {
         try (NetconfClient netconfClient = createSession(tcpAddress, "1")) {
 
@@ -327,6 +324,7 @@ public class NetconfITTest extends AbstractConfigTest {
 
         }
     }
+    */
 
     @Test
     public void testCloseSession() throws Exception {
index 71b7fa6eac991d0274c4ff1da12cbc28c2aabf02..3c96897a2ccaba64ec7ad7eff10dffa076fad6d3 100644 (file)
             <artifactId>netty-handler</artifactId>
             <version>${netconf.netty.version}</version>
         </dependency>
-        <dependency>
+        <!--dependency>
             <groupId>com.siemens.ct.exi</groupId>
             <artifactId>exificient</artifactId>
-        </dependency>
+        </dependency-->
         <dependency>
             <groupId>org.opendaylight.controller.thirdparty</groupId>
             <artifactId>ganymed</artifactId>
                             org.slf4j,
                             org.w3c.dom,
                             org.xml.sax,
-                            com.siemens.ct.exi,
-                            com.siemens.ct.exi.api.sax,
-                            com.siemens.ct.exi.grammars,
-                            com.siemens.ct.exi.helpers,
-                            com.siemens.ct.exi.exceptions,
-                            com.siemens.ct.exi.api.dom,
                             org.xml.sax.helpers,
                             org.opendaylight.controller.config.api,
                         </Import-Package>
diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/ExiParameters.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/ExiParameters.java
deleted file mode 100644 (file)
index 7109971..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*\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.util.xml;\r
-\r
-import com.siemens.ct.exi.CodingMode;\r
-import com.siemens.ct.exi.FidelityOptions;\r
-import com.siemens.ct.exi.GrammarFactory;\r
-import com.siemens.ct.exi.exceptions.EXIException;\r
-import com.siemens.ct.exi.grammars.Grammars;\r
-\r
-public class ExiParameters {\r
-\r
-    private static final String EXI_PARAMETER_ALIGNMENT = "alignment";\r
-    private static final String EXI_PARAMETER_BYTE_ALIGNED = "byte-aligned";\r
-    private static final String EXI_PARAMETER_COMPRESSED = "compressed";\r
-\r
-    private static final String EXI_PARAMETER_FIDELITY = "fidelity";\r
-    private static final String EXI_FIDELITY_DTD = "dtd";\r
-    private static final String EXI_FIDELITY_LEXICAL_VALUES = "lexical-values";\r
-    private static final String EXI_FIDELITY_COMMENTS = "comments";\r
-    private static final String EXI_FIDELITY_PIS = "pis";\r
-    private static final String EXI_FIDELITY_PREFIXES = "prefixes";\r
-\r
-    private static final String EXI_PARAMETER_SCHEMA = "schema";\r
-    private static final String EXI_PARAMETER_SCHEMA_NONE = "none";\r
-    private static final String EXI_PARAMETER_SCHEMA_BUILT_IN = "builtin";\r
-    private static final String EXI_PARAMETER_SCHEMA_BASE_1_1 = "base:1.1";\r
-\r
-    private static final String NETCONF_XSD_LOCATION = "";\r
-\r
-    private FidelityOptions fidelityOptions;\r
-    private Grammars grammars;\r
-    private CodingMode codingMode = CodingMode.BIT_PACKED;\r
-\r
-    public void setParametersFromXmlElement(XmlElement operationElement)\r
-            throws EXIException {\r
-\r
-        if (operationElement.getElementsByTagName(EXI_PARAMETER_ALIGNMENT)\r
-                .getLength() > 0) {\r
-\r
-            if (operationElement.getElementsByTagName(\r
-                    EXI_PARAMETER_BYTE_ALIGNED)\r
-                    .getLength() > 0) {\r
-                this.codingMode = CodingMode.BYTE_PACKED;\r
-            }\r
-\r
-            if (operationElement.getElementsByTagName(\r
-                    EXI_PARAMETER_BYTE_ALIGNED).getLength() > 0) {\r
-                this.codingMode = CodingMode.BYTE_PACKED;\r
-            }\r
-            if (operationElement.getElementsByTagName(EXI_PARAMETER_COMPRESSED)\r
-                    .getLength() > 0) {\r
-                this.codingMode = CodingMode.COMPRESSION;\r
-            }\r
-        }\r
-\r
-        if (operationElement.getElementsByTagName(EXI_PARAMETER_FIDELITY)\r
-                .getLength() > 0) {\r
-\r
-            this.fidelityOptions = FidelityOptions.createDefault();\r
-\r
-            if (operationElement.getElementsByTagName(EXI_FIDELITY_DTD)\r
-                    .getLength() > 0) {\r
-                this.fidelityOptions.setFidelity(FidelityOptions.FEATURE_DTD,\r
-                        true);\r
-            }\r
-            if (operationElement.getElementsByTagName(\r
-                    EXI_FIDELITY_LEXICAL_VALUES)\r
-                    .getLength() > 0) {\r
-                this.fidelityOptions.setFidelity(\r
-                        FidelityOptions.FEATURE_LEXICAL_VALUE, true);\r
-            }\r
-\r
-            if (operationElement.getElementsByTagName(EXI_FIDELITY_COMMENTS)\r
-                    .getLength() > 0) {\r
-                this.fidelityOptions.setFidelity(\r
-                        FidelityOptions.FEATURE_COMMENT, true);\r
-            }\r
-\r
-            if (operationElement.getElementsByTagName(EXI_FIDELITY_PIS)\r
-                    .getLength() > 0) {\r
-                this.fidelityOptions.setFidelity(FidelityOptions.FEATURE_PI,\r
-                        true);\r
-            }\r
-\r
-            if (operationElement.getElementsByTagName(EXI_FIDELITY_PREFIXES)\r
-                    .getLength() > 0) {\r
-                this.fidelityOptions.setFidelity(\r
-                        FidelityOptions.FEATURE_PREFIX, true);\r
-            }\r
-\r
-        }\r
-\r
-        if (operationElement.getElementsByTagName(EXI_PARAMETER_SCHEMA)\r
-                .getLength() > 0) {\r
-\r
-            GrammarFactory grammarFactory = GrammarFactory.newInstance();\r
-            if (operationElement\r
-                    .getElementsByTagName(EXI_PARAMETER_SCHEMA_NONE)\r
-                    .getLength() > 0) {\r
-                this.grammars = grammarFactory.createSchemaLessGrammars();\r
-            }\r
-\r
-            if (operationElement.getElementsByTagName(\r
-                    EXI_PARAMETER_SCHEMA_BUILT_IN).getLength() > 0) {\r
-                this.grammars = grammarFactory.createXSDTypesOnlyGrammars();\r
-            }\r
-\r
-            if (operationElement.getElementsByTagName(\r
-                    EXI_PARAMETER_SCHEMA_BASE_1_1).getLength() > 0) {\r
-                this.grammars = grammarFactory\r
-                        .createGrammars(NETCONF_XSD_LOCATION);\r
-            }\r
-\r
-        }\r
-    }\r
-\r
-    public FidelityOptions getFidelityOptions() {\r
-        return fidelityOptions;\r
-    }\r
-\r
-    public Grammars getGrammars() {\r
-        return grammars;\r
-    }\r
-\r
-    public CodingMode getCodingMode() {\r
-        return codingMode;\r
-    }\r
-\r
-}\r
diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/ExiUtil.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/ExiUtil.java
deleted file mode 100644 (file)
index 82bbb66..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*\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.util.xml;\r
-\r
-import io.netty.buffer.ByteBuf;\r
-import io.netty.buffer.EmptyByteBuf;\r
-import io.netty.buffer.Unpooled;\r
-\r
-import java.io.ByteArrayInputStream;\r
-import java.io.ByteArrayOutputStream;\r
-import java.io.IOException;\r
-import java.util.List;\r
-\r
-import javax.xml.parsers.ParserConfigurationException;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-import org.w3c.dom.Document;\r
-import org.xml.sax.SAXException;\r
-\r
-import com.siemens.ct.exi.EXIFactory;\r
-import com.siemens.ct.exi.api.dom.DOMBuilder;\r
-import com.siemens.ct.exi.api.dom.DOMWriter;\r
-import com.siemens.ct.exi.exceptions.EXIException;\r
-import com.siemens.ct.exi.helpers.DefaultEXIFactory;\r
-\r
-public class ExiUtil {\r
-\r
-    private final static Logger logger = LoggerFactory.getLogger(ExiUtil.class);\r
-\r
-\r
-\r
-    public static void encode(final Object msg, final ByteBuf out,\r
-            ExiParameters parameters)\r
-            throws EXIException, IOException, SAXException {\r
-        final byte[] bytes = toExi(msg, parameters);\r
-        out.writeBytes(bytes);\r
-    }\r
-\r
-    public static void decode(ByteBuf in, List<Object> out,\r
-            ExiParameters parameters) throws ParserConfigurationException, EXIException, IOException\r
-             {\r
-        if (in instanceof EmptyByteBuf){\r
-            return;\r
-        }\r
-\r
-        EXIFactory exiFactory = DefaultEXIFactory.newInstance();\r
-        if (parameters.getGrammars() != null) {\r
-            exiFactory.setGrammars(parameters.getGrammars());\r
-        }\r
-\r
-        if (parameters.getFidelityOptions() != null) {\r
-            exiFactory.setFidelityOptions(parameters.getFidelityOptions());\r
-        }\r
-\r
-        exiFactory.setCodingMode(parameters.getCodingMode());\r
-        try (ByteArrayInputStream exiIS = new ByteArrayInputStream(((ByteBuf)in).readBytes(((ByteBuf)in).readableBytes()).array())){\r
-            DOMBuilder domBuilder = new DOMBuilder(exiFactory);\r
-            ByteBuf result = Unpooled.copiedBuffer(XmlUtil.toString(domBuilder.parse(exiIS)).getBytes());\r
-            exiIS.close();\r
-            out.add(result);\r
-        }\r
-    }\r
-\r
-    private static byte[] toExi(Object msg, ExiParameters parameters) throws EXIException, IOException,\r
-            SAXException {\r
-\r
-        if (!(msg instanceof ByteBuf)){\r
-              return Unpooled.EMPTY_BUFFER.array();\r
-        }\r
-\r
-        EXIFactory exiFactory = DefaultEXIFactory.newInstance();\r
-        if (parameters.getGrammars() != null) {\r
-            exiFactory.setGrammars(parameters.getGrammars());\r
-        }\r
-\r
-        if (parameters.getFidelityOptions() != null) {\r
-            exiFactory.setFidelityOptions(parameters.getFidelityOptions());\r
-        }\r
-\r
-        Document doc = XmlUtil.readXmlToDocument(new String( ((ByteBuf)msg).readBytes(((ByteBuf)msg).readableBytes()).array(),"UTF-8"));\r
-        exiFactory.setCodingMode(parameters.getCodingMode());\r
-\r
-        try (ByteArrayOutputStream exiOS = new ByteArrayOutputStream()){\r
-            DOMWriter domWriter = new DOMWriter(exiFactory);\r
-            domWriter.setOutput(exiOS);\r
-            domWriter.encode(doc) ;\r
-            exiOS.close();\r
-            return exiOS.toByteArray();\r
-        }\r
-    }\r
-\r
-}\r
index 3a96b422637d796789a46bde64069eec2b318086..b70586f432b954fcc0ba1443cfcc73c253888708 100644 (file)
@@ -28,7 +28,6 @@
         <module>netconf-client</module>
         <module>netconf-ssh</module>
         <module>../../third-party/ganymed</module>
-        <module>../../third-party/com.siemens.ct.exi</module>
         <module>netconf-monitoring</module>
         <module>ietf-netconf-monitoring</module>
         <module>ietf-netconf-monitoring-extension</module>
@@ -51,7 +50,6 @@
         <maven.bundle.version>2.4.0</maven.bundle.version>
         <slf4j.version>1.7.2</slf4j.version>
         <netconf.netty.version>4.0.10.Final</netconf.netty.version>
-        <ct.exi.version>0.9.2</ct.exi.version>
     </properties>
 
     <dependencies>
                 <artifactId>logback-config</artifactId>
                 <version>${config.version}</version>
             </dependency>
-            <dependency>
-                <groupId>com.siemens.ct.exi</groupId>
-                <artifactId>exificient</artifactId>
-                <version>${ct.exi.version}</version>
-            </dependency>
         </dependencies>
     </dependencyManagement>