From: Tony Tkacik Date: Wed, 16 Apr 2014 17:07:00 +0000 (+0000) Subject: Merge "BUG-731: do not catch Throwable" X-Git-Tag: autorelease-tag-v20140601202136_82eb3f9~213 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=cb98269f3ccd77787672053054910696e4eea470;hp=b22f57765f9968f49d3fe1c0e5c00c4ffa81cd62 Merge "BUG-731: do not catch Throwable" --- diff --git a/opendaylight/commons/opendaylight/pom.xml b/opendaylight/commons/opendaylight/pom.xml index 140a6ddfe1..f4b2dee848 100644 --- a/opendaylight/commons/opendaylight/pom.xml +++ b/opendaylight/commons/opendaylight/pom.xml @@ -118,6 +118,9 @@ src/main/xtend-gen src/main/yang-gen-config src/main/yang-gen-sal + + + 0000.0002.0035.0-SNAPSHOT @@ -657,6 +660,16 @@ ganymed 1.1-SNAPSHOT + + org.opendaylight.controller.thirdparty + nagasena + ${exi.nagasena.version} + + + org.opendaylight.controller.thirdparty + nagasena-rta + ${exi.nagasena.version} + com.google.code.findbugs jsr305 diff --git a/opendaylight/distribution/opendaylight/pom.xml b/opendaylight/distribution/opendaylight/pom.xml index 776fb7a0f6..291fbdd4a7 100644 --- a/opendaylight/distribution/opendaylight/pom.xml +++ b/opendaylight/distribution/opendaylight/pom.xml @@ -419,6 +419,14 @@ org.opendaylight.controller.thirdparty ganymed + + org.opendaylight.controller.thirdparty + nagasena + + + org.opendaylight.controller.thirdparty + nagasena-rta + org.zeromq jeromq diff --git a/opendaylight/md-sal/pom.xml b/opendaylight/md-sal/pom.xml index 631f1118c5..43ea9f1621 100644 --- a/opendaylight/md-sal/pom.xml +++ b/opendaylight/md-sal/pom.xml @@ -52,7 +52,7 @@ sal-rest-connector sal-netconf-connector - + inventory-manager statistics-manager topology-manager @@ -67,7 +67,7 @@ sal-remoterpc-connector/implementation - + @@ -167,14 +167,13 @@ org.opendaylight.yangtools binding-generator-impl - ${yangtools.version} + ${yangtools.version} org.opendaylight.yangtools yang-parser-impl - ${yangtools.version} + ${yangtools.version} - org.mockito diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/ForwardedBackwardsCompatibleDataBroker.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/ForwardedBackwardsCompatibleDataBroker.java index ee7607306a..ab0dc6e24f 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/ForwardedBackwardsCompatibleDataBroker.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/ForwardedBackwardsCompatibleDataBroker.java @@ -201,6 +201,10 @@ public class ForwardedBackwardsCompatibleDataBroker extends AbstractForwardedDat private final Map, DataObject> original = new HashMap<>(); private TransactionStatus status = TransactionStatus.NEW; + private final Set> posponedRemovedOperational = new HashSet<>(); + private final Set> posponedRemovedConfiguration = new HashSet<>(); + + @Override public final TransactionStatus getStatus() { return status; @@ -214,12 +218,13 @@ public class ForwardedBackwardsCompatibleDataBroker extends AbstractForwardedDat @Override public void putOperationalData(final InstanceIdentifier path, final DataObject data) { - + posponedRemovedOperational.remove(path); doPutWithEnsureParents(getDelegate(), LogicalDatastoreType.OPERATIONAL, path, data); } @Override public void putConfigurationData(final InstanceIdentifier path, final DataObject data) { + posponedRemovedConfiguration.remove(path); DataObject originalObj = readConfigurationData(path); if (originalObj != null) { original.put(path, originalObj); @@ -233,13 +238,12 @@ public class ForwardedBackwardsCompatibleDataBroker extends AbstractForwardedDat @Override public void removeOperationalData(final InstanceIdentifier path) { - doDelete(getDelegate(), LogicalDatastoreType.OPERATIONAL, path); - + posponedRemovedOperational.add(path); } @Override public void removeConfigurationData(final InstanceIdentifier path) { - doDelete(getDelegate(), LogicalDatastoreType.CONFIGURATION, path); + posponedRemovedConfiguration.add(path); } @Override @@ -307,25 +311,34 @@ public class ForwardedBackwardsCompatibleDataBroker extends AbstractForwardedDat return getDelegate().getIdentifier(); } - private void changeStatus(TransactionStatus status) { + private void changeStatus(final TransactionStatus status) { LOG.trace("Transaction {} changed status to {}", getIdentifier(), status); this.status = status; } @Override public ListenableFuture> commit() { + + for(InstanceIdentifier path : posponedRemovedConfiguration) { + doDelete(getDelegate(), LogicalDatastoreType.CONFIGURATION, path); + } + + for(InstanceIdentifier path : posponedRemovedOperational) { + doDelete(getDelegate(), LogicalDatastoreType.OPERATIONAL, path); + } + final ListenableFuture> f = ForwardedBackwardsCompatibleDataBroker.this.commit(this); changeStatus(TransactionStatus.SUBMITED); Futures.addCallback(f, new FutureCallback>() { @Override - public void onSuccess(RpcResult result) { + public void onSuccess(final RpcResult result) { changeStatus(result.getResult()); } @Override - public void onFailure(Throwable t) { + public void onFailure(final Throwable t) { LOG.error("Transaction {} failed to complete", getIdentifier(), t); changeStatus(TransactionStatus.FAILED); } diff --git a/opendaylight/md-sal/sal-binding-it/pom.xml b/opendaylight/md-sal/sal-binding-it/pom.xml index 520935ca90..654ad4a1cc 100644 --- a/opendaylight/md-sal/sal-binding-it/pom.xml +++ b/opendaylight/md-sal/sal-binding-it/pom.xml @@ -245,5 +245,13 @@ antlr4-runtime-osgi-nohead 4.0 + + org.opendaylight.controller.thirdparty + nagasena + + + org.opendaylight.controller.thirdparty + nagasena-rta + diff --git a/opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/AbstractTest.java b/opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/AbstractTest.java index 019fc0eb73..3d78f94861 100644 --- a/opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/AbstractTest.java +++ b/opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/AbstractTest.java @@ -69,7 +69,10 @@ public abstract class AbstractTest { // + "/src/test/resources/logback.xml"), mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(), // mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(), // - mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(), // + mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(), + mavenBundle("org.opendaylight.controller.thirdparty", "nagasena").versionAsInProject(), + mavenBundle("org.opendaylight.controller.thirdparty", "nagasena-rta").versionAsInProject(), + // systemProperty("osgi.bundles.defaultStartLevel").value("4"), systemPackages("sun.nio.ch"), diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/DOMImmutableDataChangeEvent.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/DOMImmutableDataChangeEvent.java index 86f08de615..3dfca40b40 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/DOMImmutableDataChangeEvent.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/DOMImmutableDataChangeEvent.java @@ -1,5 +1,8 @@ package org.opendaylight.controller.md.sal.dom.store.impl; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; import java.util.Map; import java.util.Set; @@ -10,8 +13,6 @@ import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; public final class DOMImmutableDataChangeEvent implements AsyncDataChangeEvent> { @@ -33,10 +34,10 @@ public final class DOMImmutableDataChangeEvent implements private DOMImmutableDataChangeEvent(final Builder change) { original = change.before; updated = change.after; - originalData = change.original.build(); - createdData = change.created.build(); - updatedData = change.updated.build(); - removedPaths = change.removed.build(); + originalData = Collections.unmodifiableMap(change.original); + createdData = Collections.unmodifiableMap(change.created); + updatedData = Collections.unmodifiableMap(change.updated); + removedPaths = Collections.unmodifiableSet(change.removed); scope = change.scope; } @@ -125,10 +126,10 @@ public final class DOMImmutableDataChangeEvent implements private NormalizedNode after; private NormalizedNode before; - private final ImmutableMap.Builder> original = ImmutableMap.builder(); - private final ImmutableMap.Builder> created = ImmutableMap.builder(); - private final ImmutableMap.Builder> updated = ImmutableMap.builder(); - private final ImmutableSet.Builder removed = ImmutableSet.builder(); + private final Map> original = new HashMap<>(); + private final Map> created = new HashMap<>(); + private final Map> updated = new HashMap<>(); + private final Set removed = new HashSet<>(); private Builder(final DataChangeScope scope) { Preconditions.checkNotNull(scope, "Data change scope should not be null."); diff --git a/opendaylight/md-sal/samples/toaster-it/pom.xml b/opendaylight/md-sal/samples/toaster-it/pom.xml index d61393c225..8ca098c3d9 100644 --- a/opendaylight/md-sal/samples/toaster-it/pom.xml +++ b/opendaylight/md-sal/samples/toaster-it/pom.xml @@ -43,6 +43,7 @@ sample-toaster-consumer 1.1-SNAPSHOT + org.opendaylight.controller.samples sample-toaster-provider @@ -81,5 +82,13 @@ 3.8.1.v20120830-144521 test + + org.opendaylight.controller.thirdparty + nagasena + + + org.opendaylight.controller.thirdparty + nagasena-rta + diff --git a/opendaylight/md-sal/samples/toaster-it/src/test/java/org/opendaylight/controller/sample/toaster/it/ToasterTest.java b/opendaylight/md-sal/samples/toaster-it/src/test/java/org/opendaylight/controller/sample/toaster/it/ToasterTest.java index 000783bd07..add523157f 100644 --- a/opendaylight/md-sal/samples/toaster-it/src/test/java/org/opendaylight/controller/sample/toaster/it/ToasterTest.java +++ b/opendaylight/md-sal/samples/toaster-it/src/test/java/org/opendaylight/controller/sample/toaster/it/ToasterTest.java @@ -7,20 +7,9 @@ */ package org.opendaylight.controller.sample.toaster.it; -import static org.junit.Assert.assertEquals; -import static org.opendaylight.controller.test.sal.binding.it.TestHelper.*; -import static org.ops4j.pax.exam.CoreOptions.*; - -import javax.inject.Inject; -import javax.management.JMX; -import javax.management.MBeanServer; -import javax.management.ObjectName; - import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; -import org.opendaylight.controller.config.yang.config.toaster_consumer.impl.ToasterConsumerRuntimeMXBean; -import org.opendaylight.controller.config.yang.config.toaster_provider.impl.ToasterProviderRuntimeMXBean; import org.opendaylight.controller.sample.toaster.provider.api.ToastConsumer; import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.HashBrown; import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.WhiteBread; @@ -31,8 +20,23 @@ import org.ops4j.pax.exam.options.DefaultCompositeOption; import org.ops4j.pax.exam.util.Filter; import org.ops4j.pax.exam.util.PathUtils; +import javax.inject.Inject; +import javax.management.MBeanServer; +import javax.management.ObjectName; import java.lang.management.ManagementFactory; +import static org.junit.Assert.assertEquals; +import static org.opendaylight.controller.test.sal.binding.it.TestHelper.baseModelBundles; +import static org.opendaylight.controller.test.sal.binding.it.TestHelper.bindingAwareSalBundles; +import static org.opendaylight.controller.test.sal.binding.it.TestHelper.configMinumumBundles; +import static org.opendaylight.controller.test.sal.binding.it.TestHelper.flowCapableModelBundles; +import static org.opendaylight.controller.test.sal.binding.it.TestHelper.junitAndMockitoBundles; +import static org.opendaylight.controller.test.sal.binding.it.TestHelper.mdSalCoreBundles; +import static org.ops4j.pax.exam.CoreOptions.mavenBundle; +import static org.ops4j.pax.exam.CoreOptions.options; +import static org.ops4j.pax.exam.CoreOptions.systemPackages; +import static org.ops4j.pax.exam.CoreOptions.systemProperty; + @RunWith(PaxExam.class) public class ToasterTest { @@ -72,7 +76,9 @@ public class ToasterTest { return new DefaultCompositeOption( mavenBundle("org.opendaylight.controller.samples", "sample-toaster-provider").versionAsInProject(), mavenBundle("org.opendaylight.controller.samples", "sample-toaster-consumer").versionAsInProject(), - mavenBundle("org.opendaylight.controller.samples", "sample-toaster").versionAsInProject() + mavenBundle("org.opendaylight.controller.samples", "sample-toaster").versionAsInProject(), + mavenBundle("org.opendaylight.controller.thirdparty", "nagasena").versionAsInProject(), + mavenBundle("org.opendaylight.controller.thirdparty", "nagasena-rta").versionAsInProject() ); } diff --git a/opendaylight/md-sal/topology-manager/pom.xml b/opendaylight/md-sal/topology-manager/pom.xml index 8503864f62..93934fda6d 100644 --- a/opendaylight/md-sal/topology-manager/pom.xml +++ b/opendaylight/md-sal/topology-manager/pom.xml @@ -41,10 +41,6 @@ model-topology 1.1-SNAPSHOT - - org.eclipse.xtend - org.eclipse.xtend.lib - org.osgi org.osgi.core @@ -64,10 +60,6 @@ - - org.eclipse.xtend - xtend-maven-plugin - diff --git a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableNodeMapping.java b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableNodeMapping.java new file mode 100644 index 0000000000..bb406bbf1a --- /dev/null +++ b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableNodeMapping.java @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2014 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.md.controller.topology.manager; + +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNode; +import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNodeBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNodeConnector; +import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNodeConnectorBuilder; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.DestinationBuilder; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.SourceBuilder; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.LinkBuilder; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder; + +public final class FlowCapableNodeMapping { + + private FlowCapableNodeMapping() { + throw new UnsupportedOperationException("Utility class."); + } + + public static NodeKey getNodeKey(final NodeRef ref) { + return ref.getValue().firstKeyOf(Node.class, NodeKey.class); + } + + public static NodeKey getNodeKey(final NodeConnectorRef ref) { + return ref.getValue().firstKeyOf(Node.class, NodeKey.class); + } + + public static NodeConnectorKey getNodeConnectorKey(final NodeConnectorRef ref) { + return ref.getValue().firstKeyOf(NodeConnector.class, NodeConnectorKey.class); + } + + public static NodeId toTopologyNodeId( + final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId) { + return new NodeId(nodeId); + } + + private static NodeId toTopologyNodeId(final NodeConnectorRef source) { + return toTopologyNodeId(getNodeKey(source).getId()); + } + + public static TpId toTerminationPointId(final NodeConnectorId id) { + return new TpId(id); + } + + private static TpId toTerminationPointId(final NodeConnectorRef source) { + return toTerminationPointId(getNodeConnectorKey(source).getId()); + } + + public static org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node toTopologyNode( + final NodeId nodeId, final NodeRef invNodeRef) { + return new NodeBuilder() // + .setNodeId(nodeId) // + .addAugmentation(InventoryNode.class, new InventoryNodeBuilder() // + .setInventoryNodeRef(invNodeRef) // + .build()) // + .build(); + } + + public static TerminationPoint toTerminationPoint(final TpId id, final NodeConnectorRef invNodeConnectorRef) { + return new TerminationPointBuilder() // + .setTpId(id) // + .addAugmentation(InventoryNodeConnector.class, new InventoryNodeConnectorBuilder() // + .setInventoryNodeConnectorRef(invNodeConnectorRef) // + .build()) // + .build(); + } + + public static Link toTopologyLink( + final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.Link link) { + return new LinkBuilder() // + .setSource(new SourceBuilder() // + .setSourceNode(toTopologyNodeId(link.getSource())) // + .setSourceTp(toTerminationPointId(link.getSource())) // + .build()) // + .setDestination(new DestinationBuilder() // + .setDestNode(toTopologyNodeId(link.getDestination())) // + .setDestTp(toTerminationPointId(link.getDestination())) // + .build()) // + .setLinkId(new LinkId(getNodeConnectorKey(link.getSource()).getId())) // + .build(); + } +} diff --git a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableNodeMapping.xtend b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableNodeMapping.xtend deleted file mode 100644 index 017e2b877e..0000000000 --- a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableNodeMapping.xtend +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2014 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.md.controller.topology.manager - -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.IdentifiableItem -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.SourceBuilder -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.DestinationBuilder -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.LinkBuilder -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.LinkKey -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId -import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNodeBuilder -import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNode -import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNodeConnector -import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNodeConnectorBuilder -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode - -class FlowCapableNodeMapping { - - static def NodeKey getNodeKey(NodeRef ref) { - (ref?.value?.path?.get(1) as IdentifiableItem).key - } - - static def NodeKey getNodeKey(NodeConnectorRef ref) { - (ref?.value?.path?.get(1) as IdentifiableItem).key - } - - static def NodeConnectorKey getNodeConnectorKey(NodeConnectorRef ref) { - (ref?.value?.path?.get(2) as IdentifiableItem).key - } - - static def NodeId toToplogyNodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId) { - return new NodeId(nodeId); - } - - static def toTerminationPointId(NodeConnectorId id) { - return new TpId(id); - } - - static def toTopologyNode(NodeId nodeId,NodeRef invNodeRef) { - val nb = new NodeBuilder(); - nb.setNodeId(nodeId) - val inb = new InventoryNodeBuilder - inb.setInventoryNodeRef(invNodeRef) - nb.addAugmentation(InventoryNode,inb.build) - return nb.build(); - } - - static def toTerminationPoint(TpId id, NodeConnectorRef invNodeConnectorRef) { - val tpb = new TerminationPointBuilder - tpb.setTpId(id); - val incb = new InventoryNodeConnectorBuilder - incb.setInventoryNodeConnectorRef(invNodeConnectorRef) - tpb.addAugmentation(InventoryNodeConnector,incb.build()) - return tpb.build(); - } - - static def toTopologyLink(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.Link link) { - val sb = new SourceBuilder(); - sb.setSourceNode(link.source.nodeKey.id.toToplogyNodeId) - sb.setSourceTp(link.source.nodeConnectorKey.id.toTerminationPointId) - val db = new DestinationBuilder(); - db.setDestNode(link.destination.nodeKey.id.toToplogyNodeId) - db.setDestTp(link.destination.nodeConnectorKey.id.toTerminationPointId) - val lb = new LinkBuilder(); - lb.setSource(sb.build()) - lb.setDestination(db.build()); - lb.setLinkId(new LinkId(lb.source.sourceTp.value)) - return lb.build(); - } -} diff --git a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.java b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.java new file mode 100644 index 0000000000..54f1fc0bb4 --- /dev/null +++ b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.java @@ -0,0 +1,249 @@ +/* + * Copyright (c) 2014 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.md.controller.topology.manager; + +import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.getNodeConnectorKey; +import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.getNodeKey; +import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.toTerminationPoint; +import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.toTerminationPointId; +import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.toTopologyLink; +import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.toTopologyNode; +import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.toTopologyNodeId; + +import java.util.concurrent.ExecutionException; + +import org.opendaylight.controller.md.sal.binding.util.TypeSafeDataReader; +import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction; +import org.opendaylight.controller.sal.binding.api.data.DataProviderService; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorUpdated; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdated; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.FlowTopologyDiscoveryListener; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkDiscovered; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkOverutilized; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkRemoved; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkUtilizationNormal; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemoved; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemoved; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdated; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.OpendaylightInventoryListener; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +class FlowCapableTopologyExporter implements // + FlowTopologyDiscoveryListener, // + OpendaylightInventoryListener // +{ + + private final static Logger LOG = LoggerFactory.getLogger(FlowCapableTopologyExporter.class); + public static TopologyKey topology = new TopologyKey(new TopologyId("flow:1")); + + // FIXME: Flow capable topology exporter should use transaction chaining API + private DataProviderService dataService; + + public DataProviderService getDataService() { + return dataService; + } + + public void setDataService(final DataProviderService dataService) { + this.dataService = dataService; + } + + private InstanceIdentifier topologyPath; + + public void start() { + TopologyBuilder tb = new TopologyBuilder(); + tb.setKey(topology); + topologyPath = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, topology).build(); + Topology top = tb.build(); + DataModificationTransaction tx = dataService.beginTransaction(); + tx.putOperationalData(topologyPath, top); + tx.commit(); + } + + @Override + public synchronized void onNodeRemoved(final NodeRemoved notification) { + NodeId nodeId = toTopologyNodeId(getNodeKey(notification.getNodeRef()).getId()); + InstanceIdentifier nodeInstance = toNodeIdentifier(notification.getNodeRef()); + + DataModificationTransaction tx = dataService.beginTransaction(); + tx.removeOperationalData(nodeInstance); + removeAffectedLinks(tx, nodeId); + try { + tx.commit().get(); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Topology state export not successful. ",e); + } + } + + @Override + public synchronized void onNodeUpdated(final NodeUpdated notification) { + FlowCapableNodeUpdated fcnu = notification.getAugmentation(FlowCapableNodeUpdated.class); + if (fcnu != null) { + Node node = toTopologyNode(toTopologyNodeId(notification.getId()), notification.getNodeRef()); + InstanceIdentifier path = getNodePath(toTopologyNodeId(notification.getId())); + DataModificationTransaction tx = dataService.beginTransaction(); + tx.putOperationalData(path, node); + try { + tx.commit().get(); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Topology state export not successful. ",e); + } + } + } + + @Override + public synchronized void onNodeConnectorRemoved(final NodeConnectorRemoved notification) { + InstanceIdentifier tpInstance = toTerminationPointIdentifier(notification + .getNodeConnectorRef()); + TpId tpId = toTerminationPointId(getNodeConnectorKey(notification.getNodeConnectorRef()).getId()); + DataModificationTransaction tx = dataService.beginTransaction(); + tx.removeOperationalData(tpInstance); + removeAffectedLinks(tx, tpId); + try { + tx.commit().get(); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Topology state export not successful. ",e); + } + + } + + @Override + public synchronized void onNodeConnectorUpdated(final NodeConnectorUpdated notification) { + FlowCapableNodeConnectorUpdated fcncu = notification.getAugmentation(FlowCapableNodeConnectorUpdated.class); + if (fcncu != null) { + NodeId nodeId = toTopologyNodeId(getNodeKey(notification.getNodeConnectorRef()).getId()); + TerminationPoint point = toTerminationPoint(toTerminationPointId(notification.getId()), + notification.getNodeConnectorRef()); + InstanceIdentifier path = tpPath(nodeId, point.getKey().getTpId()); + + DataModificationTransaction tx = dataService.beginTransaction(); + tx.putOperationalData(path, point); + if ((fcncu.getState() != null && fcncu.getState().isLinkDown()) + || (fcncu.getConfiguration() != null && fcncu.getConfiguration().isPORTDOWN())) { + removeAffectedLinks(tx, point.getTpId()); + } + try { + tx.commit().get(); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Topology state export not successful. ",e); + } + } + } + + @Override + public synchronized void onLinkDiscovered(final LinkDiscovered notification) { + Link link = toTopologyLink(notification); + InstanceIdentifier path = linkPath(link); + DataModificationTransaction tx = dataService.beginTransaction(); + tx.putOperationalData(path, link); + try { + tx.commit().get(); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Topology state export not successful. ",e); + } + } + + @Override + public synchronized void onLinkOverutilized(final LinkOverutilized notification) { + // NOOP + } + + @Override + public synchronized void onLinkRemoved(final LinkRemoved notification) { + InstanceIdentifier path = linkPath(toTopologyLink(notification)); + DataModificationTransaction tx = dataService.beginTransaction(); + tx.removeOperationalData(path); + ; + } + + @Override + public synchronized void onLinkUtilizationNormal(final LinkUtilizationNormal notification) { + // NOOP + } + + private static InstanceIdentifier toNodeIdentifier(final NodeRef ref) { + org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey invNodeKey = getNodeKey(ref); + + NodeKey nodeKey = new NodeKey(toTopologyNodeId(invNodeKey.getId())); + return InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, topology) + .child(Node.class, nodeKey).build(); + } + + private InstanceIdentifier toTerminationPointIdentifier(final NodeConnectorRef ref) { + org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey invNodeKey = getNodeKey(ref); + NodeConnectorKey invNodeConnectorKey = getNodeConnectorKey(ref); + return tpPath(toTopologyNodeId(invNodeKey.getId()), toTerminationPointId(invNodeConnectorKey.getId())); + } + + private void removeAffectedLinks(final DataModificationTransaction transaction, final NodeId id) { + TypeSafeDataReader reader = TypeSafeDataReader.forReader(transaction); + + Topology topologyData = reader.readOperationalData(topologyPath); + if (topologyData == null) { + return; + } + for (Link link : topologyData.getLink()) { + if (id.equals(link.getSource().getSourceNode()) || id.equals(link.getDestination().getDestNode())) { + InstanceIdentifier path = InstanceIdentifier.builder(topologyPath) + .child(Link.class, link.getKey()).build(); + transaction.removeOperationalData(path); + } + } + } + + private void removeAffectedLinks(final DataModificationTransaction transaction, final TpId id) { + TypeSafeDataReader reader = TypeSafeDataReader.forReader(transaction); + Topology topologyData = reader.readOperationalData(topologyPath); + if (topologyData == null) { + return; + } + for (Link link : topologyData.getLink()) { + if (id.equals(link.getSource().getSourceTp()) || id.equals(link.getDestination().getDestTp())) { + InstanceIdentifier path = InstanceIdentifier.builder(topologyPath) + .child(Link.class, link.getKey()).build(); + transaction.removeOperationalData(path); + } + } + } + + private InstanceIdentifier getNodePath(final NodeId nodeId) { + NodeKey nodeKey = new NodeKey(nodeId); + return InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, topology) + .child(Node.class, nodeKey).build(); + } + + private InstanceIdentifier tpPath(final NodeId nodeId, final TpId tpId) { + NodeKey nodeKey = new NodeKey(nodeId); + TerminationPointKey tpKey = new TerminationPointKey(tpId); + return InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, topology) + .child(Node.class, nodeKey).child(TerminationPoint.class, tpKey).build(); + } + + private InstanceIdentifier linkPath(final Link link) { + InstanceIdentifier linkInstanceId = InstanceIdentifier.builder(NetworkTopology.class) + .child(Topology.class, topology).child(Link.class, link.getKey()).build(); + return linkInstanceId; + } +} diff --git a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.xtend b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.xtend deleted file mode 100644 index 666a8bf57a..0000000000 --- a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.xtend +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2014 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.md.controller.topology.manager - -import com.google.common.collect.FluentIterable -import org.opendaylight.controller.md.sal.binding.util.TypeSafeDataReader -import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction -import org.opendaylight.controller.sal.binding.api.data.DataProviderService -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorUpdated -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdated -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.FlowTopologyDiscoveryListener -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkDiscovered -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkOverutilized -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkRemoved -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkUtilizationNormal -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemoved -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemoved -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdated -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.OpendaylightInventoryListener -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier - -import static extension org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.* - -class FlowCapableTopologyExporter implements // -FlowTopologyDiscoveryListener, // -OpendaylightInventoryListener // -{ - - var TopologyKey topology = new TopologyKey(new TopologyId("flow:1")); - - @Property - var DataProviderService dataService; - - def start() { - val tb = new TopologyBuilder(); - tb.setKey(topology); - val path = InstanceIdentifier.builder(NetworkTopology).child(Topology,topology).toInstance; - val top = tb.build(); - val it = dataService.beginTransaction - putOperationalData(path,top); - commit() - } - - override onNodeRemoved(NodeRemoved notification) { - val nodeId = notification.nodeRef.nodeKey.id.toToplogyNodeId() - val nodeInstance = notification.nodeRef.toNodeIdentifier() - - val it = dataService.beginTransaction - removeOperationalData(nodeInstance); - removeAffectedLinks(it,nodeId) - commit() - - } - - override onNodeUpdated(NodeUpdated notification) { - val fcnu = notification.getAugmentation(FlowCapableNodeUpdated) - if(fcnu != null) { - val node = notification.id.toToplogyNodeId.toTopologyNode(notification.nodeRef) - val path = notification.id.toToplogyNodeId.nodePath; - val it = dataService.beginTransaction - putOperationalData(path, node); - commit() - } - } - - override onNodeConnectorRemoved(NodeConnectorRemoved notification) { - val tpInstance = notification.nodeConnectorRef.toTerminationPointIdentifier; - val tpId = notification.nodeConnectorRef.nodeConnectorKey.id.toTerminationPointId; - val it = dataService.beginTransaction - removeOperationalData(tpInstance); - removeAffectedLinks(it,tpId) - commit() - - } - - override onNodeConnectorUpdated(NodeConnectorUpdated notification) { - val fcncu = notification.getAugmentation(FlowCapableNodeConnectorUpdated) - if(fcncu != null) { - val nodeId = notification.nodeConnectorRef.nodeKey.id.toToplogyNodeId; - val TerminationPoint point = notification.id.toTerminationPointId.toTerminationPoint(notification.nodeConnectorRef); - val path = tpPath(nodeId, point.key.tpId); - - val it = dataService.beginTransaction - putOperationalData(path, point); - if((fcncu.state != null && fcncu.state.linkDown) || (fcncu.configuration != null && fcncu.configuration.PORTDOWN)) { - removeAffectedLinks(it,point.tpId) - } - commit() - } - } - - override onLinkDiscovered(LinkDiscovered notification) { - val link = notification.toTopologyLink; - val path = link.linkPath; - val it = dataService.beginTransaction - putOperationalData(path, link); - commit() - } - - override onLinkOverutilized(LinkOverutilized notification) { - // NOOP - } - - override onLinkRemoved(LinkRemoved notification) { - val path = notification.toTopologyLink.linkPath - val it = dataService.beginTransaction - removeOperationalData(path); - commit() - } - - override onLinkUtilizationNormal(LinkUtilizationNormal notification) { - // NOOP - } - - def InstanceIdentifier toNodeIdentifier(NodeRef ref) { - val invNodeKey = ref.nodeKey - - val nodeKey = new NodeKey(invNodeKey.id.toToplogyNodeId); - return InstanceIdentifier.builder(NetworkTopology).child(Topology, topology).child(Node, nodeKey). - toInstance; - } - - def InstanceIdentifier toTerminationPointIdentifier(NodeConnectorRef ref) { - val invNodeKey = ref.nodeKey - val invNodeConnectorKey = ref.nodeConnectorKey - return tpPath(invNodeKey.id.toToplogyNodeId(), invNodeConnectorKey.id.toTerminationPointId()) - } - - private def void removeAffectedLinks(DataModificationTransaction transaction, NodeId id) { - val reader = TypeSafeDataReader.forReader(transaction) - val topologyPath = InstanceIdentifier.builder(NetworkTopology).child(Topology, topology).toInstance; - val topologyData = reader.readOperationalData(topologyPath); - if (topologyData === null) { - return; - } - val affectedLinkInstances = FluentIterable.from(topologyData.link).filter[ - source.sourceNode == id || destination.destNode == id].transform [ - // - InstanceIdentifier.builder(NetworkTopology).child(Topology, topology).child(Link, key).toInstance - // - ] - for(affectedLink : affectedLinkInstances) { - transaction.removeOperationalData(affectedLink); - } - } - - private def void removeAffectedLinks(DataModificationTransaction transaction, TpId id) { - val reader = TypeSafeDataReader.forReader(transaction) - val topologyPath = InstanceIdentifier.builder(NetworkTopology).child(Topology, topology).toInstance; - val topologyData = reader.readOperationalData(topologyPath); - if (topologyData === null) { - return; - } - val affectedLinkInstances = FluentIterable.from(topologyData.link).filter[ - source.sourceTp == id || destination.destTp == id].transform [ - // - InstanceIdentifier.builder(NetworkTopology).child(Topology, topology).child(Link, key).toInstance - // - ] - for(affectedLink : affectedLinkInstances) { - transaction.removeOperationalData(affectedLink); - } - } - - private def InstanceIdentifier nodePath(NodeId nodeId) { - val nodeKey = new NodeKey(nodeId); - return InstanceIdentifier.builder(NetworkTopology) - .child(Topology, topology) - .child(Node, nodeKey) - .toInstance; - } - - private def InstanceIdentifier tpPath(NodeId nodeId, TpId tpId) { - val nodeKey = new NodeKey(nodeId); - val tpKey = new TerminationPointKey(tpId) - return InstanceIdentifier.builder(NetworkTopology).child(Topology, topology).child(Node, nodeKey). - child(TerminationPoint, tpKey).toInstance; - } - - private def InstanceIdentifier linkPath(Link link) { - val linkInstanceId = InstanceIdentifier.builder(NetworkTopology) - .child(Topology, topology) - .child(Link, link.key) - .toInstance; - return linkInstanceId; - } -} diff --git a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyProvider.java b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyProvider.java new file mode 100644 index 0000000000..e77ba8769c --- /dev/null +++ b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyProvider.java @@ -0,0 +1,86 @@ +/* + * 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.md.controller.topology.manager; + +import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider; +import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext; +import org.opendaylight.controller.sal.binding.api.NotificationProviderService; +import org.opendaylight.controller.sal.binding.api.data.DataProviderService; +import org.opendaylight.yangtools.concepts.Registration; +import org.opendaylight.yangtools.yang.binding.NotificationListener; +import org.osgi.framework.BundleContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class FlowCapableTopologyProvider extends AbstractBindingAwareProvider implements AutoCloseable { + private final static Logger LOG = LoggerFactory.getLogger(FlowCapableTopologyProvider.class); + + private DataProviderService dataService; + + public DataProviderService getDataService() { + return this.dataService; + } + + public void setDataService(final DataProviderService dataService) { + this.dataService = dataService; + } + + private NotificationProviderService notificationService; + + public NotificationProviderService getNotificationService() { + return this.notificationService; + } + + public void setNotificationService(final NotificationProviderService notificationService) { + this.notificationService = notificationService; + } + + private final FlowCapableTopologyExporter exporter = new FlowCapableTopologyExporter(); + private Registration listenerRegistration; + + @Override + public void close() { + + FlowCapableTopologyProvider.LOG.info("FlowCapableTopologyProvider stopped."); + dataService = null; + notificationService = null; + if (this.listenerRegistration != null) { + try { + this.listenerRegistration.close(); + } catch (Exception e) { + throw new IllegalStateException("Exception during close of listener registration.",e); + } + } + } + + /** + * Gets called on start of a bundle. + * + * @param session + */ + @Override + public void onSessionInitiated(final ProviderContext session) { + dataService = session.getSALService(DataProviderService.class); + notificationService = session.getSALService(NotificationProviderService.class); + this.exporter.setDataService(dataService); + this.exporter.start(); + this.listenerRegistration = notificationService.registerNotificationListener(this.exporter); + ; + } + + /** + * Gets called during stop bundle + * + * @param context + * The execution context of the bundle being stopped. + */ + @Override + public void stopImpl(final BundleContext context) { + this.close(); + } +} diff --git a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyProvider.xtend b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyProvider.xtend deleted file mode 100644 index 73e03d1e7d..0000000000 --- a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyProvider.xtend +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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.md.controller.topology.manager - -import org.opendaylight.controller.sal.binding.api.NotificationProviderService -import org.opendaylight.controller.sal.binding.api.data.DataProviderService -import org.opendaylight.yangtools.concepts.Registration -import org.opendaylight.yangtools.yang.binding.NotificationListener -import org.slf4j.LoggerFactory -import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext -import org.osgi.framework.BundleContext; - -class FlowCapableTopologyProvider extends AbstractBindingAwareProvider implements AutoCloseable { - - - - static val LOG = LoggerFactory.getLogger(FlowCapableTopologyProvider); - - @Property - DataProviderService dataService; - - @Property - NotificationProviderService notificationService; - - val FlowCapableTopologyExporter exporter = new FlowCapableTopologyExporter(); - - Registration listenerRegistration - - override close() { - LOG.info("FlowCapableTopologyProvider stopped."); - listenerRegistration?.close(); - } - - /** - * Gets called on start of a bundle. - * @param session - */ - override onSessionInitiated(ProviderContext session) { - dataService = session.getSALService(DataProviderService) - notificationService = session.getSALService(NotificationProviderService) - exporter.setDataService(dataService); - exporter.start(); - listenerRegistration = notificationService.registerNotificationListener(exporter); - } - - /** - * Gets called during stop bundle - * @param context The execution context of the bundle being stopped. - */ - override stopImpl(BundleContext context) { - close(); - } - -} - - diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/NetconfOperationServiceImpl.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/NetconfOperationServiceImpl.java index 95659ddf91..c6248df41b 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/NetconfOperationServiceImpl.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/NetconfOperationServiceImpl.java @@ -8,10 +8,11 @@ package org.opendaylight.controller.netconf.confignetconfconnector.osgi; -import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Optional; -import com.google.common.base.Preconditions; -import com.google.common.collect.Sets; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + import org.opendaylight.controller.config.api.LookupRegistry; import org.opendaylight.controller.config.util.ConfigRegistryJMXClient; import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; @@ -22,10 +23,10 @@ import org.opendaylight.controller.netconf.mapping.api.NetconfOperation; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService; import org.opendaylight.yangtools.yang.model.api.Module; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Optional; +import com.google.common.base.Preconditions; +import com.google.common.collect.Sets; /** * Manages life cycle of {@link YangStoreSnapshot}. @@ -141,6 +142,11 @@ public class NetconfOperationServiceImpl implements NetconfOperationService { public Optional> getLocation() { return Optional.absent(); } + + @Override + public String toString() { + return capability; + } } private static class YangStoreCapability extends BasicCapability { diff --git a/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java b/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java index 9770cc5bee..cd38d3babe 100644 --- a/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java +++ b/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java @@ -74,7 +74,7 @@ import org.opendaylight.controller.config.yang.test.impl.NetconfTestImplModuleMX import org.opendaylight.controller.config.yang.test.impl.Peers; import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; import org.opendaylight.controller.netconf.api.NetconfDocumentedException; -import org.opendaylight.controller.netconf.api.NetconfOperationRouter; +import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter; import org.opendaylight.controller.netconf.confignetconfconnector.operations.Commit; import org.opendaylight.controller.netconf.confignetconfconnector.operations.DiscardChanges; import org.opendaylight.controller.netconf.confignetconfconnector.operations.editconfig.EditConfig; diff --git a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/AbstractNetconfSession.java b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/AbstractNetconfSession.java deleted file mode 100644 index f85d9b9f30..0000000000 --- a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/AbstractNetconfSession.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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.api; - -import io.netty.channel.Channel; -import io.netty.channel.ChannelFuture; - -import java.io.IOException; - -import org.opendaylight.protocol.framework.AbstractProtocolSession; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public abstract class AbstractNetconfSession> extends AbstractProtocolSession implements NetconfSession { - private static final Logger logger = LoggerFactory.getLogger(AbstractNetconfSession.class); - private final L sessionListener; - private final long sessionId; - private boolean up = false; - - private final Channel channel; - - protected AbstractNetconfSession(L sessionListener, Channel channel, long sessionId) { - this.sessionListener = sessionListener; - this.channel = channel; - this.sessionId = sessionId; - logger.debug("Session {} created", sessionId); - } - - protected abstract S thisInstance(); - - @Override - public void close() { - channel.close(); - up = false; - sessionListener.onSessionTerminated(thisInstance(), new NetconfTerminationReason("Session closed")); - } - - @Override - protected void handleMessage(NetconfMessage netconfMessage) { - logger.debug("handling incoming message"); - sessionListener.onMessage(thisInstance(), netconfMessage); - } - - @Override - public ChannelFuture sendMessage(NetconfMessage netconfMessage) { - return channel.writeAndFlush(netconfMessage); - } - - @Override - protected void endOfInput() { - logger.debug("Session {} end of input detected while session was in state {}", toString(), isUp() ? "up" - : "initialized"); - if (isUp()) { - this.sessionListener.onSessionDown(thisInstance(), new IOException("End of input detected. Close the session.")); - } - } - - @Override - protected void sessionUp() { - logger.debug("Session {} up", toString()); - sessionListener.onSessionUp(thisInstance()); - this.up = true; - } - - @Override - public String toString() { - final StringBuffer sb = new StringBuffer("ServerNetconfSession{"); - sb.append("sessionId=").append(sessionId); - sb.append('}'); - return sb.toString(); - } - - public final boolean isUp() { - return up; - } - - public final long getSessionId() { - return sessionId; - } -} - diff --git a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfClientSessionPreferences.java b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfClientSessionPreferences.java new file mode 100644 index 0000000000..58242c725f --- /dev/null +++ b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfClientSessionPreferences.java @@ -0,0 +1,30 @@ +/* + * 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.api; + +/** + * The only input for the start of a NETCONF session is hello-message. + */ +public final class NetconfClientSessionPreferences extends NetconfSessionPreferences { + + private final NetconfMessage startExiMessage; + + public NetconfClientSessionPreferences(final NetconfMessage helloMessage, + final NetconfMessage startExiMessage) { + super(helloMessage); + this.startExiMessage = startExiMessage; + } + + /** + * @return the startExiMessage + */ + public NetconfMessage getStartExiMessage() { + return startExiMessage; + } +} diff --git a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfServerSessionPreferences.java b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfServerSessionPreferences.java index d56213cf16..d63a43e7eb 100644 --- a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfServerSessionPreferences.java +++ b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfServerSessionPreferences.java @@ -15,7 +15,8 @@ public final class NetconfServerSessionPreferences extends NetconfSessionPrefere private final long sessionId; - public NetconfServerSessionPreferences(final NetconfMessage helloMessage, long sessionId) { + public NetconfServerSessionPreferences(final NetconfMessage helloMessage, + long sessionId) { super(helloMessage); this.sessionId = sessionId; } diff --git a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSession.java b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSession.java index e52e71ceea..0bd54979f8 100644 --- a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSession.java +++ b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSession.java @@ -12,5 +12,7 @@ import io.netty.channel.ChannelFuture; import org.opendaylight.protocol.framework.ProtocolSession; public interface NetconfSession extends ProtocolSession { + ChannelFuture sendMessage(NetconfMessage message); + } diff --git a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSessionPreferences.java b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSessionPreferences.java index be3040802c..0f3717abec 100644 --- a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSessionPreferences.java +++ b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSessionPreferences.java @@ -9,6 +9,7 @@ package org.opendaylight.controller.netconf.api; public class NetconfSessionPreferences { + private final NetconfMessage helloMessage; public NetconfSessionPreferences(final NetconfMessage helloMessage) { @@ -21,4 +22,5 @@ public class NetconfSessionPreferences { public NetconfMessage getHelloMessage() { return this.helloMessage; } + } diff --git a/opendaylight/netconf/netconf-client/pom.xml b/opendaylight/netconf/netconf-client/pom.xml index 25ed0e7ab1..9c11cb1af7 100644 --- a/opendaylight/netconf/netconf-client/pom.xml +++ b/opendaylight/netconf/netconf-client/pom.xml @@ -60,6 +60,7 @@ org.opendaylight.controller.netconf.util, org.opendaylight.controller.netconf.util.*, org.opendaylight.protocol.framework, + org.openexi.*, org.slf4j, org.w3c.dom, org.xml.sax, diff --git a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientDispatcher.java b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientDispatcher.java index 43664b3233..20da6aa869 100644 --- a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientDispatcher.java +++ b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientDispatcher.java @@ -8,15 +8,12 @@ package org.opendaylight.controller.netconf.client; +import com.google.common.base.Optional; import io.netty.channel.EventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.util.HashedWheelTimer; import io.netty.util.concurrent.Future; import io.netty.util.concurrent.Promise; - -import java.io.Closeable; -import java.net.InetSocketAddress; - import org.opendaylight.controller.netconf.util.AbstractChannelInitializer; import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader; import org.opendaylight.protocol.framework.AbstractDispatcher; @@ -26,7 +23,8 @@ import org.opendaylight.protocol.framework.SessionListenerFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.base.Optional; +import java.io.Closeable; +import java.net.InetSocketAddress; public class NetconfClientDispatcher extends AbstractDispatcher implements Closeable { diff --git a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSession.java b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSession.java index 2d07dd5833..ad50fedf6b 100644 --- a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSession.java +++ b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSession.java @@ -9,13 +9,17 @@ package org.opendaylight.controller.netconf.client; import io.netty.channel.Channel; - -import java.util.Collection; - -import org.opendaylight.controller.netconf.api.AbstractNetconfSession; +import org.opendaylight.controller.netconf.util.AbstractNetconfSession; +import org.opendaylight.controller.netconf.util.handler.NetconfEXICodec; +import org.opendaylight.controller.netconf.util.handler.NetconfEXIToMessageDecoder; +import org.opendaylight.controller.netconf.util.handler.NetconfMessageToEXIEncoder; +import org.opendaylight.controller.netconf.util.handler.NetconfMessageToXMLEncoder; +import org.opendaylight.controller.netconf.util.handler.NetconfXMLToMessageDecoder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Collection; + public final class NetconfClientSession extends AbstractNetconfSession { private static final Logger logger = LoggerFactory.getLogger(NetconfClientSession.class); @@ -23,7 +27,7 @@ public final class NetconfClientSession extends AbstractNetconfSession capabilities) { - super(sessionListener,channel,sessionId); + super(sessionListener, channel, sessionId); this.capabilities = capabilities; logger.debug("Client Session {} created", toString()); } @@ -32,8 +36,23 @@ public final class NetconfClientSession extends AbstractNetconfSession { + AbstractNetconfSessionNegotiator +{ + private static final Logger logger = LoggerFactory.getLogger(NetconfClientSessionNegotiator.class); + + private static final XPathExpression sessionIdXPath = XMLNetconfUtil + .compileXPath("/netconf:hello/netconf:session-id"); + + private static final String EXI_1_0_CAPABILITY_MARKER = "exi:1.0"; - protected NetconfClientSessionNegotiator(NetconfSessionPreferences sessionPreferences, - Promise promise, Channel channel, Timer timer, NetconfClientSessionListener sessionListener, - long connectionTimeoutMillis) { + protected NetconfClientSessionNegotiator(NetconfClientSessionPreferences sessionPreferences, + Promise promise, + Channel channel, + Timer timer, + NetconfClientSessionListener sessionListener, + long connectionTimeoutMillis) { super(sessionPreferences, promise, channel, timer, sessionListener, connectionTimeoutMillis); } - private static Collection getCapabilities(Document doc) { - XmlElement responseElement = XmlElement.fromDomDocument(doc); - XmlElement capabilitiesElement = responseElement - .getOnlyChildElementWithSameNamespace(XmlNetconfConstants.CAPABILITIES); - List caps = capabilitiesElement.getChildElements(XmlNetconfConstants.CAPABILITY); - return Collections2.transform(caps, new Function() { + @Override + protected void handleMessage(NetconfHelloMessage netconfMessage) { + NetconfClientSession session = super.getSessionForHelloMessage(netconfMessage); + + if (shouldUseExi(netconfMessage.getDocument())){ + logger.info("Netconf session: {} should use exi.", session); + tryToStartExi(session); + } else { + logger.info("Netconf session {} isn't capable using exi.", session); + negotiationSuccessful(session); + } + } + + private boolean shouldUseExi(Document doc) { + return containsExi10Capability(doc) + && containsExi10Capability(sessionPreferences.getHelloMessage().getDocument()); + } + + private boolean containsExi10Capability(final Document doc) { + final NodeList nList = doc.getElementsByTagName(XmlNetconfConstants.CAPABILITY); + for (int i = 0; i < nList.getLength(); i++) { + if (nList.item(i).getTextContent().contains(EXI_1_0_CAPABILITY_MARKER)) { + return true; + } + } + return false; + } - @Nullable + private void tryToStartExi(final NetconfClientSession session) { + final NetconfMessage startExi = sessionPreferences.getStartExiMessage(); + session.sendMessage(startExi).addListener(new ChannelFutureListener() { @Override - public String apply(@Nullable XmlElement input) { - // Trim possible leading/tailing whitespace - return input.getTextContent().trim(); + public void operationComplete(final ChannelFuture f) { + if (!f.isSuccess()) { + logger.warn("Failed to send start-exi message {} on session {}", startExi, session, f.cause()); + } else { + logger.trace("Start-exi message {} sent to socket on session {}", startExi, session); + NetconfClientSessionNegotiator.this.channel.pipeline().addAfter( + AbstractChannelInitializer.NETCONF_MESSAGE_DECODER, ExiConfirmationInboundHandler.EXI_CONFIRMED_HANDLER, + new ExiConfirmationInboundHandler(session)); + } } }); } - private static final XPathExpression sessionIdXPath = XMLNetconfUtil - .compileXPath("/netconf:hello/netconf:session-id"); - private long extractSessionId(Document doc) { final Node sessionIdNode = (Node) XmlUtil.evaluateXPath(sessionIdXPath, doc, XPathConstants.NODE); String textContent = sessionIdNode.getTextContent(); @@ -73,6 +111,52 @@ public class NetconfClientSessionNegotiator extends @Override protected NetconfClientSession getSession(NetconfClientSessionListener sessionListener, Channel channel, NetconfHelloMessage message) { return new NetconfClientSession(sessionListener, channel, extractSessionId(message.getDocument()), - getCapabilities(message.getDocument())); + NetconfMessageUtil.extractCapabilitiesFromHello(message.getDocument())); + } + + /** + * Handler to process response for start-exi message + */ + private final class ExiConfirmationInboundHandler extends ChannelInboundHandlerAdapter { + private static final String EXI_CONFIRMED_HANDLER = "exiConfirmedHandler"; + + private final NetconfClientSession session; + + ExiConfirmationInboundHandler(NetconfClientSession session) { + this.session = session; + } + + @Override + public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { + ctx.pipeline().remove(ExiConfirmationInboundHandler.EXI_CONFIRMED_HANDLER); + + NetconfMessage netconfMessage = (NetconfMessage) msg; + + // Ok response to start-exi, try to add exi handlers + if (NetconfMessageUtil.isOKMessage(netconfMessage)) { + logger.trace("Positive response on start-exi call received on session {}", session); + try { + session.startExiCommunication(sessionPreferences.getStartExiMessage()); + } catch (RuntimeException e) { + // Unable to add exi, continue without exi + logger.warn("Unable to start exi communication, Communication will continue without exi on session {}", session, e); + } + + // Error response + } else if(NetconfMessageUtil.isErrorMessage(netconfMessage)) { + logger.warn( + "Error response to start-exi message {}, Communication will continue without exi on session {}", + XmlUtil.toString(netconfMessage.getDocument()), session); + + // Unexpected response to start-exi, throwing message away, continue without exi + } else { + logger.warn( + "Unexpected response to start-exi message, should be ok, was {}, " + + "Communication will continue without exi and response message will be thrown away on session {}", + XmlUtil.toString(netconfMessage.getDocument()), session); + } + + negotiationSuccessful(session); + } } } diff --git a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorFactory.java b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorFactory.java index cff214401c..07e088e117 100644 --- a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorFactory.java +++ b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorFactory.java @@ -8,62 +8,79 @@ package org.opendaylight.controller.netconf.client; -import io.netty.channel.Channel; -import io.netty.util.Timer; -import io.netty.util.concurrent.Promise; - -import java.io.IOException; -import java.io.InputStream; - +import org.opendaylight.controller.netconf.api.NetconfClientSessionPreferences; import org.opendaylight.controller.netconf.api.NetconfMessage; -import org.opendaylight.controller.netconf.api.NetconfSessionPreferences; import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessage; import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader; -import org.opendaylight.controller.netconf.util.xml.XmlUtil; +import org.opendaylight.controller.netconf.util.messages.NetconfStartExiMessage; +import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; import org.opendaylight.protocol.framework.SessionListenerFactory; import org.opendaylight.protocol.framework.SessionNegotiator; import org.opendaylight.protocol.framework.SessionNegotiatorFactory; -import org.xml.sax.SAXException; +import org.openexi.proc.common.AlignmentType; +import org.openexi.proc.common.EXIOptions; +import org.openexi.proc.common.EXIOptionsException; import com.google.common.base.Optional; import com.google.common.base.Preconditions; +import com.google.common.collect.Sets; + +import io.netty.channel.Channel; +import io.netty.util.Timer; +import io.netty.util.concurrent.Promise; public class NetconfClientSessionNegotiatorFactory implements SessionNegotiatorFactory { + public static final java.util.Set CLIENT_CAPABILITIES = Sets.newHashSet( + XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, + XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_1, + XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_CAPABILITY_EXI_1_0); + + private static final String START_EXI_MESSAGE_ID = "default-start-exi"; + private final Optional additionalHeader; private final long connectionTimeoutMillis; private final Timer timer; + private final EXIOptions options; + + public NetconfClientSessionNegotiatorFactory(Timer timer, + Optional additionalHeader, + long connectionTimeoutMillis) { + this(timer, additionalHeader, connectionTimeoutMillis, DEFAULT_OPTIONS); + } - public NetconfClientSessionNegotiatorFactory(Timer timer, Optional additionalHeader, long connectionTimeoutMillis) { + public NetconfClientSessionNegotiatorFactory(Timer timer, + Optional additionalHeader, + long connectionTimeoutMillis, EXIOptions exiOptions) { this.timer = Preconditions.checkNotNull(timer); this.additionalHeader = additionalHeader; this.connectionTimeoutMillis = connectionTimeoutMillis; - } - - private static NetconfMessage loadHelloMessageTemplate() { - final String helloMessagePath = "/client_hello.xml"; - try (InputStream is = NetconfClientSessionNegotiatorFactory.class.getResourceAsStream(helloMessagePath)) { - Preconditions.checkState(is != null, "Input stream from %s was null", helloMessagePath); - return new NetconfMessage(XmlUtil.readXmlToDocument(is)); - } catch (SAXException | IOException e) { - throw new RuntimeException("Unable to load hello message", e); - } + this.options = exiOptions; } @Override - public SessionNegotiator getSessionNegotiator(SessionListenerFactory sessionListenerFactory, Channel channel, + public SessionNegotiator getSessionNegotiator(SessionListenerFactory sessionListenerFactory, + Channel channel, Promise promise) { - // Hello message needs to be recreated every time - NetconfMessage helloMessage = loadHelloMessageTemplate(); - if(this.additionalHeader.isPresent()) { - helloMessage = new NetconfHelloMessage(helloMessage.getDocument(), additionalHeader.get()); - } else { - helloMessage = new NetconfHelloMessage(helloMessage.getDocument()); - } + NetconfMessage startExiMessage = NetconfStartExiMessage.create(options, START_EXI_MESSAGE_ID); + NetconfHelloMessage helloMessage = NetconfHelloMessage.createClientHello(CLIENT_CAPABILITIES, additionalHeader); - NetconfSessionPreferences proposal = new NetconfSessionPreferences(helloMessage); + NetconfClientSessionPreferences proposal = new NetconfClientSessionPreferences(helloMessage,startExiMessage); return new NetconfClientSessionNegotiator(proposal, promise, channel, timer, - sessionListenerFactory.getSessionListener(), connectionTimeoutMillis); + sessionListenerFactory.getSessionListener(),connectionTimeoutMillis); + } + + private static final EXIOptions DEFAULT_OPTIONS = new EXIOptions(); + static { + try { + DEFAULT_OPTIONS.setPreserveDTD(true); + DEFAULT_OPTIONS.setPreserveNS(true); + DEFAULT_OPTIONS.setPreserveLexicalValues(true); + DEFAULT_OPTIONS.setAlignmentType(AlignmentType.preCompress); + } catch (EXIOptionsException e) { + // Should not happen since DEFAULT_OPTIONS are still the same + throw new IllegalStateException("Unable to create EXI DEFAULT_OPTIONS"); + } } } diff --git a/opendaylight/netconf/netconf-client/src/main/resources/client_hello.xml b/opendaylight/netconf/netconf-client/src/main/resources/client_hello.xml deleted file mode 100644 index 46f6f76412..0000000000 --- a/opendaylight/netconf/netconf-client/src/main/resources/client_hello.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - urn:ietf:params:netconf:base:1.0 - urn:ietf:params:netconf:base:1.1 - - diff --git a/opendaylight/netconf/netconf-impl/pom.xml b/opendaylight/netconf/netconf-impl/pom.xml index 4e78b2e4d6..ffc15d878a 100644 --- a/opendaylight/netconf/netconf-impl/pom.xml +++ b/opendaylight/netconf/netconf-impl/pom.xml @@ -149,6 +149,7 @@ org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.schemas, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.extension.rev131210, org.opendaylight.yangtools.yang.binding, + org.openexi.*, diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSession.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSession.java index 9ddc64f1a1..280375d918 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSession.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSession.java @@ -8,15 +8,18 @@ package org.opendaylight.controller.netconf.impl; -import io.netty.channel.Channel; - import java.text.SimpleDateFormat; import java.util.Date; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.opendaylight.controller.netconf.api.AbstractNetconfSession; import org.opendaylight.controller.netconf.api.monitoring.NetconfManagementSession; +import org.opendaylight.controller.netconf.util.AbstractNetconfSession; +import org.opendaylight.controller.netconf.util.handler.NetconfEXICodec; +import org.opendaylight.controller.netconf.util.handler.NetconfEXIToMessageDecoder; +import org.opendaylight.controller.netconf.util.handler.NetconfMessageToEXIEncoder; +import org.opendaylight.controller.netconf.util.handler.NetconfMessageToXMLEncoder; +import org.opendaylight.controller.netconf.util.handler.NetconfXMLToMessageDecoder; import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.DomainName; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Host; @@ -34,6 +37,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.base.Preconditions; +import io.netty.channel.Channel; public final class NetconfServerSession extends AbstractNetconfSession implements NetconfManagementSession { @@ -124,4 +128,16 @@ public final class NetconfServerSession extends AbstractNetconfSession { - public static final String MESSAGE_ID = "message-id"; static final Logger logger = LoggerFactory.getLogger(NetconfServerSessionListener.class); private final SessionMonitoringService monitoringService; @@ -110,18 +111,17 @@ public class NetconfServerSessionListener implements NetconfSessionListener { - public static final String SERVER_HELLO_XML_LOCATION = "/server_hello.xml"; + private static final Set DEFAULT_CAPABILITIES = Sets.newHashSet( + XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, + XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_CAPABILITY_EXI_1_0); private final Timer timer; - private static final Document helloMessageTemplate = loadHelloMessageTemplate(); private final SessionIdProvider idProvider; private final NetconfOperationProvider netconfOperationProvider; private final long connectionTimeoutMillis; @@ -63,14 +54,6 @@ public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorF this.monitoringService = monitoringService; } - private static Document loadHelloMessageTemplate() { - InputStream resourceAsStream = NetconfServerSessionNegotiatorFactory.class - .getResourceAsStream(SERVER_HELLO_XML_LOCATION); - Preconditions.checkNotNull(resourceAsStream, "Unable to load server hello message blueprint from %s", - SERVER_HELLO_XML_LOCATION); - return NetconfUtil.createMessage(resourceAsStream).getDocument(); - } - /** * * @param defunctSessionListenerFactory will not be taken into account as session listener factory can @@ -99,32 +82,8 @@ public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorF sessionListenerFactory.getSessionListener(), connectionTimeoutMillis); } - private static final XPathExpression sessionIdXPath = XMLNetconfUtil - .compileXPath("/netconf:hello/netconf:session-id"); - private static final XPathExpression capabilitiesXPath = XMLNetconfUtil - .compileXPath("/netconf:hello/netconf:capabilities"); - private NetconfHelloMessage createHelloMessage(long sessionId, CapabilityProvider capabilityProvider) { - Document helloMessageTemplate = getHelloTemplateClone(); - - // change session ID - final Node sessionIdNode = (Node) XmlUtil.evaluateXPath(sessionIdXPath, helloMessageTemplate, - XPathConstants.NODE); - sessionIdNode.setTextContent(String.valueOf(sessionId)); - - // add capabilities from yang store - final Element capabilitiesElement = (Element) XmlUtil.evaluateXPath(capabilitiesXPath, helloMessageTemplate, - XPathConstants.NODE); - - for (String capability : capabilityProvider.getCapabilities()) { - final Element capabilityElement = XmlUtil.createElement(helloMessageTemplate, XmlNetconfConstants.CAPABILITY, Optional.absent()); - capabilityElement.setTextContent(capability); - capabilitiesElement.appendChild(capabilityElement); - } - return new NetconfHelloMessage(helloMessageTemplate); + return NetconfHelloMessage.createServerHello(Sets.union(capabilityProvider.getCapabilities(), DEFAULT_CAPABILITIES), sessionId); } - private synchronized Document getHelloTemplateClone() { - return (Document) helloMessageTemplate.cloneNode(true); - } } diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java index ee0c6ce3ef..1a9f5d7393 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java @@ -12,7 +12,7 @@ import java.io.InputStream; import java.util.Map; import org.opendaylight.controller.netconf.api.NetconfDocumentedException; -import org.opendaylight.controller.netconf.api.NetconfOperationRouter; +import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter; import org.opendaylight.controller.netconf.impl.DefaultCommitNotificationProducer; import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider; import org.opendaylight.controller.netconf.mapping.api.HandlingPriority; diff --git a/opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/DefaultNetconfOperation.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultNetconfOperation.java similarity index 63% rename from opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/DefaultNetconfOperation.java rename to opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultNetconfOperation.java index 314eb3834f..13d4ab290b 100644 --- a/opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/DefaultNetconfOperation.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultNetconfOperation.java @@ -1,14 +1,14 @@ -/* - * 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.mapping.api; - -import org.opendaylight.controller.netconf.api.NetconfSession; - -public interface DefaultNetconfOperation { - void setNetconfSession(NetconfSession s); -} +/* + * 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); +} diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStartExi.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStartExi.java index a2befbadd2..b9b30a5eaa 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStartExi.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStartExi.java @@ -1,77 +1,71 @@ -/* - * 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.NetconfSession; -import org.opendaylight.controller.netconf.mapping.api.DefaultNetconfOperation; -import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation; -import org.opendaylight.controller.netconf.util.xml.XmlElement; -import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; -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; - -import com.google.common.base.Optional; - -public class DefaultStartExi extends AbstractSingletonNetconfOperation implements DefaultNetconfOperation { - - public static final String START_EXI = "start-exi"; - - private NetconfSession netconfSession; - - private static final Logger logger = LoggerFactory.getLogger(DefaultStartExi.class); - - public DefaultStartExi(String netconfSessionIdForReporting) { - super(netconfSessionIdForReporting); - } - - @Override - protected String getOperationName() { - return START_EXI; - } - - @Override - protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException { - - Element getSchemaResult = XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.of(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0)); - - throw new UnsupportedOperationException("Not implemented"); - - /* - try { - ExiParameters exiParams = new ExiParameters(); - exiParams.setParametersFromXmlElement(operationElement); - - netconfSession.addExiDecoder(ExiDecoderHandler.HANDLER_NAME, new ExiDecoderHandler(exiParams)); - netconfSession.addExiEncoderAfterMessageSent(ExiEncoderHandler.HANDLER_NAME,new ExiEncoderHandler(exiParams)); - - } catch (EXIException e) { - getSchemaResult = document - .createElement(XmlNetconfConstants.RPC_ERROR); - } - - logger.trace("{} operation successful", START_EXI); - logger.debug("received start-exi message {} ", XmlUtil.toString(document)); - return getSchemaResult; - */ - } - - @Override - public void setNetconfSession(NetconfSession s) { - netconfSession = s; - } - - public NetconfSession getNetconfSession() { - return netconfSession; - } - - -} +/* + * 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.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.XmlNetconfConstants; +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; + } +} diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStopExi.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStopExi.java index 836f826912..22caeff071 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStopExi.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStopExi.java @@ -1,62 +1,58 @@ -/* - * 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.NetconfSession; -import org.opendaylight.controller.netconf.mapping.api.DefaultNetconfOperation; -import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation; -import org.opendaylight.controller.netconf.util.xml.XmlElement; -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 NetconfSession netconfSession; - - private static final Logger logger = LoggerFactory - .getLogger(DefaultStartExi.class); - - public DefaultStopExi(String netconfSessionIdForReporting) { - super(netconfSessionIdForReporting); - } - - @Override - protected String getOperationName() { - return STOP_EXI; - } - - @Override - protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) - throws NetconfDocumentedException { - throw new UnsupportedOperationException("Not implemented"); - /* - netconfSession.remove(ExiDecoderHandler.class); - netconfSession.removeAfterMessageSent(ExiEncoderHandler.HANDLER_NAME); - - Element getSchemaResult = document.createElement(XmlNetconfConstants.OK); - XmlUtil.addNamespaceAttr(getSchemaResult, - XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0); - logger.trace("{} operation successful", STOP_EXI); - logger.debug("received stop-exi message {} ", XmlUtil.toString(document)); - return getSchemaResult; - */ - } - - @Override - public void setNetconfSession(NetconfSession s) { - this.netconfSession = s; - } - - public NetconfSession getNetconfSession() { - return netconfSession; - } -} +/* + * 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.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.XmlNetconfConstants; +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; + } +} diff --git a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfOperationRouter.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationRouter.java similarity index 62% rename from opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfOperationRouter.java rename to opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationRouter.java index dcd2ffad55..16cca1fee7 100644 --- a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfOperationRouter.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationRouter.java @@ -6,13 +6,15 @@ * and is available at http://www.eclipse.org/legal/epl-v10.html */ -package org.opendaylight.controller.netconf.api; +package org.opendaylight.controller.netconf.impl.osgi; +import org.opendaylight.controller.netconf.api.NetconfDocumentedException; +import org.opendaylight.controller.netconf.impl.NetconfServerSession; import org.w3c.dom.Document; public interface NetconfOperationRouter extends AutoCloseable { - Document onNetconfMessage(Document message, NetconfSession session) + Document onNetconfMessage(Document message, NetconfServerSession session) throws NetconfDocumentedException; diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationRouterImpl.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationRouterImpl.java index 80ba8388ef..bb4c76a4b8 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationRouterImpl.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationRouterImpl.java @@ -11,16 +11,15 @@ import com.google.common.base.Preconditions; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import org.opendaylight.controller.netconf.api.NetconfDocumentedException; -import org.opendaylight.controller.netconf.api.NetconfOperationRouter; -import org.opendaylight.controller.netconf.api.NetconfSession; import org.opendaylight.controller.netconf.impl.DefaultCommitNotificationProducer; +import org.opendaylight.controller.netconf.impl.NetconfServerSession; import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider; import org.opendaylight.controller.netconf.impl.mapping.operations.DefaultCloseSession; import org.opendaylight.controller.netconf.impl.mapping.operations.DefaultCommit; import org.opendaylight.controller.netconf.impl.mapping.operations.DefaultGetSchema; import org.opendaylight.controller.netconf.impl.mapping.operations.DefaultStartExi; import org.opendaylight.controller.netconf.impl.mapping.operations.DefaultStopExi; -import org.opendaylight.controller.netconf.mapping.api.DefaultNetconfOperation; +import org.opendaylight.controller.netconf.impl.mapping.operations.DefaultNetconfOperation; import org.opendaylight.controller.netconf.mapping.api.HandlingPriority; import org.opendaylight.controller.netconf.mapping.api.NetconfOperation; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationChainedExecution; @@ -94,7 +93,7 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter { @Override public synchronized Document onNetconfMessage(Document message, - NetconfSession session) throws NetconfDocumentedException { + NetconfServerSession session) throws NetconfDocumentedException { Preconditions.checkNotNull(allNetconfOperations, "Operation router was not initialized properly"); NetconfOperationExecution netconfOperationExecution; @@ -154,20 +153,20 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter { } private NetconfOperationExecution getNetconfOperationWithHighestPriority( - Document message, NetconfSession session) { + Document message, NetconfServerSession session) { TreeMap sortedByPriority = getSortedNetconfOperationsWithCanHandle( message, session); Preconditions.checkArgument(sortedByPriority.isEmpty() == false, - "No %s available to handleWithNoSubsequentOperations message %s", NetconfOperation.class.getName(), + "No %s available to handle message %s", NetconfOperation.class.getName(), XmlUtil.toString(message)); return NetconfOperationExecution.createExecutionChain(sortedByPriority, sortedByPriority.lastKey()); } private TreeMap getSortedNetconfOperationsWithCanHandle(Document message, - NetconfSession session) { + NetconfServerSession session) { TreeMap sortedPriority = Maps.newTreeMap(); for (NetconfOperation netconfOperation : allNetconfOperations) { diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/util/DeserializerExceptionHandler.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/util/DeserializerExceptionHandler.java index fca3e8bc1b..31c4d4f57e 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/util/DeserializerExceptionHandler.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/util/DeserializerExceptionHandler.java @@ -36,7 +36,7 @@ public final class @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - logger.warn("An exception occured during message handling", cause); + logger.warn("An exception occurred during message handling", cause); handleDeserializerException(ctx, cause); } diff --git a/opendaylight/netconf/netconf-impl/src/main/resources/server_hello.xml b/opendaylight/netconf/netconf-impl/src/main/resources/server_hello.xml deleted file mode 100644 index 6a3f911cd4..0000000000 --- a/opendaylight/netconf/netconf-impl/src/main/resources/server_hello.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - urn:ietf:params:netconf:base:1.0 - - 1 - diff --git a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITTest.java b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITTest.java index ae4a9bf4b2..d169858d35 100644 --- a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITTest.java +++ b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITTest.java @@ -22,16 +22,16 @@ import org.junit.Test; import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver; import org.opendaylight.controller.config.spi.ModuleFactory; import org.opendaylight.controller.config.util.ConfigTransactionJMXClient; +import org.opendaylight.controller.netconf.client.test.TestingNetconfClient; +import org.opendaylight.controller.netconf.confignetconfconnector.osgi.YangStoreException; import org.opendaylight.controller.config.yang.test.impl.DepTestImplModuleFactory; import org.opendaylight.controller.config.yang.test.impl.NetconfTestImplModuleFactory; import org.opendaylight.controller.config.yang.test.impl.NetconfTestImplModuleMXBean; import org.opendaylight.controller.config.yang.test.impl.TestImplModuleFactory; import org.opendaylight.controller.netconf.StubUserManager; import org.opendaylight.controller.netconf.api.NetconfMessage; -import org.opendaylight.controller.netconf.client.test.TestingNetconfClient; import org.opendaylight.controller.netconf.client.NetconfClientDispatcher; import org.opendaylight.controller.netconf.confignetconfconnector.osgi.NetconfOperationServiceFactoryImpl; -import org.opendaylight.controller.netconf.confignetconfconnector.osgi.YangStoreException; import org.opendaylight.controller.netconf.impl.DefaultCommitNotificationProducer; import org.opendaylight.controller.netconf.impl.NetconfServerDispatcher; import org.opendaylight.controller.netconf.impl.osgi.NetconfMonitoringServiceImpl; @@ -68,9 +68,9 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; import static java.util.Collections.emptyList; -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertNotNull; -import static junit.framework.Assert.assertTrue; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; @@ -148,6 +148,7 @@ public class NetconfITTest extends AbstractNetconfConfigTest { } static Collection getBasicYangs() throws IOException { + List paths = Arrays.asList("/META-INF/yang/config.yang", "/META-INF/yang/rpc-context.yang", "/META-INF/yang/config-test.yang", "/META-INF/yang/config-test-impl.yang", "/META-INF/yang/test-types.yang", "/META-INF/yang/ietf-inet-types.yang"); @@ -281,34 +282,6 @@ public class NetconfITTest extends AbstractNetconfConfigTest { } } - /* - @Test - public void testStartExi() throws Exception { - try (TestingNetconfClient netconfClient = createSession(tcpAddress, "1")) { - - - Document rpcReply = netconfClient.sendMessage(this.startExi) - .getDocument(); - assertIsOK(rpcReply); - - ExiParameters exiParams = new ExiParameters(); - exiParams.setParametersFromXmlElement(XmlElement.fromDomDocument(this.startExi.getDocument())); - - netconfClient.getClientSession().addExiDecoder(ExiDecoderHandler.HANDLER_NAME, new ExiDecoderHandler(exiParams)); - netconfClient.getClientSession().addExiEncoder(ExiEncoderHandler.HANDLER_NAME, new ExiEncoderHandler(exiParams)); - - rpcReply = netconfClient.sendMessage(this.editConfig) - .getDocument(); - assertIsOK(rpcReply); - - rpcReply = netconfClient.sendMessage(this.stopExi) - .getDocument(); - assertIsOK(rpcReply); - - } - } - */ - @Test public void testCloseSession() throws Exception { try (TestingNetconfClient netconfClient = createSession(tcpAddress, "1")) { @@ -448,5 +421,4 @@ public class NetconfITTest extends AbstractNetconfConfigTest { }.join(); } - } diff --git a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfMonitoringITTest.java b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfMonitoringITTest.java index f581342a9c..92caea17d5 100644 --- a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfMonitoringITTest.java +++ b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfMonitoringITTest.java @@ -10,7 +10,6 @@ package org.opendaylight.controller.netconf.it; import com.google.common.base.Charsets; import com.google.common.base.Optional; import com.google.common.collect.Sets; -import static org.opendaylight.controller.netconf.util.test.XmlUnitUtil.assertContainsElementWithText; import io.netty.channel.ChannelFuture; import junit.framework.Assert; import org.junit.Before; @@ -18,20 +17,20 @@ import org.junit.Test; import org.mockito.Mock; import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver; import org.opendaylight.controller.config.spi.ModuleFactory; +import org.opendaylight.controller.netconf.client.test.TestingNetconfClient; +import org.opendaylight.controller.netconf.confignetconfconnector.osgi.YangStoreException; import org.opendaylight.controller.netconf.api.NetconfMessage; import org.opendaylight.controller.netconf.api.monitoring.NetconfManagementSession; -import org.opendaylight.controller.netconf.client.test.TestingNetconfClient; import org.opendaylight.controller.netconf.client.NetconfClientDispatcher; import org.opendaylight.controller.netconf.confignetconfconnector.osgi.NetconfOperationServiceFactoryImpl; -import org.opendaylight.controller.netconf.confignetconfconnector.osgi.YangStoreException; import org.opendaylight.controller.netconf.impl.DefaultCommitNotificationProducer; import org.opendaylight.controller.netconf.impl.NetconfServerDispatcher; import org.opendaylight.controller.netconf.impl.osgi.NetconfMonitoringServiceImpl; -import org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider; import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl; import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceSnapshotImpl; import org.opendaylight.controller.netconf.impl.osgi.SessionMonitoringService; import org.opendaylight.controller.netconf.mapping.api.Capability; +import org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService; import org.opendaylight.controller.netconf.monitoring.osgi.NetconfMonitoringActivator; import org.opendaylight.controller.netconf.monitoring.osgi.NetconfMonitoringOperationService; @@ -55,6 +54,7 @@ import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; +import static org.opendaylight.controller.netconf.util.test.XmlUnitUtil.assertContainsElementWithText; public class NetconfMonitoringITTest extends AbstractNetconfConfigTest { @@ -131,7 +131,7 @@ public class NetconfMonitoringITTest extends AbstractNetconfConfigTest { } - @Test(timeout = 5 * 10000) + @Test(timeout = 13 * 10000) public void testClientHelloWithAuth() throws Exception { String fileName = "netconfMessages/client_hello_with_auth.xml"; String hello = XmlFileLoader.fileToString(fileName); diff --git a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/pax/IdentityRefNetconfTest.java b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/pax/IdentityRefNetconfTest.java index 266b245b7f..96a9effcfc 100644 --- a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/pax/IdentityRefNetconfTest.java +++ b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/pax/IdentityRefNetconfTest.java @@ -100,7 +100,11 @@ public class IdentityRefNetconfTest { mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(), mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(), mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(), - mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject()); + mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(), + mavenBundle("org.opendaylight.controller.thirdparty", "nagasena").versionAsInProject(), + mavenBundle("org.opendaylight.controller.thirdparty", "nagasena-rta").versionAsInProject()); + + } private Option testingModules() { diff --git a/opendaylight/netconf/netconf-util/pom.xml b/opendaylight/netconf/netconf-util/pom.xml index b75d3382b1..af8e4fbc39 100644 --- a/opendaylight/netconf/netconf-util/pom.xml +++ b/opendaylight/netconf/netconf-util/pom.xml @@ -54,6 +54,14 @@ xmlunit xmlunit + + org.opendaylight.controller.thirdparty + nagasena + + + org.opendaylight.controller.thirdparty + nagasena-rta + @@ -102,6 +110,7 @@ org.xml.sax, org.xml.sax.helpers, org.opendaylight.controller.config.api, + org.openexi.*, diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/AbstractNetconfSession.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/AbstractNetconfSession.java new file mode 100644 index 0000000000..270af3505f --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/AbstractNetconfSession.java @@ -0,0 +1,139 @@ +/* + * 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.util; + +import java.io.IOException; + +import org.opendaylight.controller.netconf.api.NetconfMessage; +import org.opendaylight.controller.netconf.api.NetconfSession; +import org.opendaylight.controller.netconf.api.NetconfSessionListener; +import org.opendaylight.controller.netconf.api.NetconfTerminationReason; +import org.opendaylight.controller.netconf.util.handler.NetconfEXICodec; +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.opendaylight.protocol.framework.AbstractProtocolSession; +import org.openexi.proc.common.EXIOptionsException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import io.netty.channel.Channel; +import io.netty.channel.ChannelFuture; +import io.netty.channel.ChannelHandler; + +public abstract class AbstractNetconfSession> extends AbstractProtocolSession implements NetconfSession, NetconfExiSession { + private static final Logger logger = LoggerFactory.getLogger(AbstractNetconfSession.class); + private final L sessionListener; + private final long sessionId; + private boolean up = false; + + private ChannelHandler delayedEncoder; + + private final Channel channel; + + protected AbstractNetconfSession(final L sessionListener, final Channel channel, final long sessionId) { + this.sessionListener = sessionListener; + this.channel = channel; + this.sessionId = sessionId; + logger.debug("Session {} created", sessionId); + } + + protected abstract S thisInstance(); + + @Override + public void close() { + channel.close(); + up = false; + sessionListener.onSessionTerminated(thisInstance(), new NetconfTerminationReason("Session closed")); + } + + @Override + protected void handleMessage(final NetconfMessage netconfMessage) { + logger.debug("handling incoming message"); + sessionListener.onMessage(thisInstance(), netconfMessage); + } + + @Override + public ChannelFuture sendMessage(final NetconfMessage netconfMessage) { + final ChannelFuture future = channel.writeAndFlush(netconfMessage); + if (delayedEncoder !=null) { + replaceMessageEncoder(delayedEncoder); + delayedEncoder = null; + } + + return future; + } + + @Override + protected void endOfInput() { + logger.debug("Session {} end of input detected while session was in state {}", toString(), isUp() ? "up" + : "initialized"); + if (isUp()) { + this.sessionListener.onSessionDown(thisInstance(), new IOException("End of input detected. Close the session.")); + } + } + + @Override + protected void sessionUp() { + logger.debug("Session {} up", toString()); + sessionListener.onSessionUp(thisInstance()); + this.up = true; + } + + @Override + public String toString() { + final StringBuffer sb = new StringBuffer(getClass().getSimpleName() + "{"); + sb.append("sessionId=").append(sessionId); + sb.append('}'); + return sb.toString(); + } + + protected T removeHandler(final Class handlerType) { + return this.channel.pipeline().remove(handlerType); + } + + protected void replaceMessageDecoder(final ChannelHandler handler) { + replaceChannelHandler(AbstractChannelInitializer.NETCONF_MESSAGE_DECODER, handler); + } + + protected void replaceMessageEncoder(final ChannelHandler handler) { + replaceChannelHandler(AbstractChannelInitializer.NETCONF_MESSAGE_ENCODER, handler); + } + + protected void replaceMessageEncoderAfterNextMessage(final ChannelHandler handler) { + this.delayedEncoder = handler; + } + + protected void replaceChannelHandler(final String handlerName, final ChannelHandler handler) { + channel.pipeline().replace(handlerName, handlerName, handler); + } + + @Override + public final void startExiCommunication(final NetconfMessage startExiMessage) { + final EXIParameters exiParams; + try { + exiParams = EXIParameters.fromXmlElement(XmlElement.fromDomDocument(startExiMessage.getDocument())); + } catch (final EXIOptionsException e) { + logger.warn("Unable to parse EXI parameters from {} om session {}", XmlUtil.toString(startExiMessage.getDocument()), this, e); + throw new IllegalArgumentException(e); + } + final NetconfEXICodec exiCodec = new NetconfEXICodec(exiParams.getOptions()); + addExiHandlers(exiCodec); + logger.debug("EXI handlers added to pipeline on session {}", this); + } + + protected abstract void addExiHandlers(NetconfEXICodec exiCodec); + + public final boolean isUp() { + return up; + } + + public final long getSessionId() { + return sessionId; + } +} diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/AbstractNetconfSessionNegotiator.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/AbstractNetconfSessionNegotiator.java index 71f08339c8..724b45bc08 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/AbstractNetconfSessionNegotiator.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/AbstractNetconfSessionNegotiator.java @@ -8,9 +8,12 @@ package org.opendaylight.controller.netconf.util; +import com.google.common.base.Optional; +import com.google.common.base.Preconditions; import io.netty.channel.Channel; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.ssl.SslHandler; import io.netty.util.Timeout; import io.netty.util.Timer; @@ -18,11 +21,6 @@ import io.netty.util.TimerTask; import io.netty.util.concurrent.Future; import io.netty.util.concurrent.GenericFutureListener; import io.netty.util.concurrent.Promise; - -import java.util.concurrent.TimeUnit; - -import io.netty.channel.ChannelInboundHandlerAdapter; -import org.opendaylight.controller.netconf.api.AbstractNetconfSession; import org.opendaylight.controller.netconf.api.NetconfMessage; import org.opendaylight.controller.netconf.api.NetconfSessionListener; import org.opendaylight.controller.netconf.api.NetconfSessionPreferences; @@ -39,16 +37,16 @@ import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.NodeList; -import com.google.common.base.Optional; -import com.google.common.base.Preconditions; +import java.util.concurrent.TimeUnit; public abstract class AbstractNetconfSessionNegotiator

, L extends NetconfSessionListener> extends AbstractSessionNegotiator { private static final Logger logger = LoggerFactory.getLogger(AbstractNetconfSessionNegotiator.class); + public static final String NAME_OF_EXCEPTION_HANDLER = "lastExceptionHandler"; - private final P sessionPreferences; + protected final P sessionPreferences; private final L sessionListener; private Timeout timeout; @@ -56,7 +54,7 @@ extends AbstractSessionNegotiator { /** * Possible states for Finite State Machine */ - private enum State { + protected enum State { IDLE, OPEN_WAIT, FAILED, ESTABLISHED } @@ -64,6 +62,7 @@ extends AbstractSessionNegotiator { private final Timer timer; private final long connectionTimeoutMillis; + // TODO shrink constructor protected AbstractNetconfSessionNegotiator(P sessionPreferences, Promise promise, Channel channel, Timer timer, L sessionListener, long connectionTimeoutMillis) { super(promise, channel); @@ -127,7 +126,6 @@ extends AbstractSessionNegotiator { sendMessage((NetconfHelloMessage)helloMessage); changeState(State.OPEN_WAIT); } - private void cancelTimeout() { if(timeout!=null) { timeout.cancel(); @@ -136,7 +134,12 @@ extends AbstractSessionNegotiator { @Override protected void handleMessage(NetconfHelloMessage netconfMessage) { - Preconditions.checkNotNull(netconfMessage != null, "netconfMessage"); + S session = getSessionForHelloMessage(netconfMessage); + negotiationSuccessful(session); + } + + protected final S getSessionForHelloMessage(NetconfHelloMessage netconfMessage) { + Preconditions.checkNotNull(netconfMessage, "netconfMessage"); final Document doc = netconfMessage.getDocument(); @@ -147,22 +150,20 @@ extends AbstractSessionNegotiator { } changeState(State.ESTABLISHED); - S session = getSession(sessionListener, channel, netconfMessage); - - negotiationSuccessful(session); + return getSession(sessionListener, channel, netconfMessage); } /** * Insert chunk framing handlers into the pipeline */ - private void insertChunkFramingToPipeline() { + protected void insertChunkFramingToPipeline() { replaceChannelHandler(channel, AbstractChannelInitializer.NETCONF_MESSAGE_FRAME_ENCODER, FramingMechanismHandlerFactory.createHandler(FramingMechanism.CHUNK)); replaceChannelHandler(channel, AbstractChannelInitializer.NETCONF_MESSAGE_AGGREGATOR, new NetconfChunkAggregator()); } - private boolean shouldUseChunkFraming(Document doc) { + protected boolean shouldUseChunkFraming(Document doc) { return containsBase11Capability(doc) && containsBase11Capability(sessionPreferences.getHelloMessage().getDocument()); } @@ -170,7 +171,7 @@ extends AbstractSessionNegotiator { /** * Remove special handlers for hello message. Insert regular netconf xml message (en|de)coders. */ - private void replaceHelloMessageHandlers() { + protected void replaceHelloMessageHandlers() { replaceChannelHandler(channel, AbstractChannelInitializer.NETCONF_MESSAGE_DECODER, new NetconfXMLToMessageDecoder()); replaceChannelHandler(channel, AbstractChannelInitializer.NETCONF_MESSAGE_ENCODER, new NetconfMessageToXMLEncoder()); } @@ -181,7 +182,7 @@ extends AbstractSessionNegotiator { protected abstract S getSession(L sessionListener, Channel channel, NetconfHelloMessage message); - private synchronized void changeState(final State newState) { + protected synchronized void changeState(final State newState) { logger.debug("Changing state from : {} to : {}", state, newState); Preconditions.checkState(isStateChangePermitted(state, newState), "Cannot change state from %s to %s", state, newState); @@ -208,7 +209,6 @@ extends AbstractSessionNegotiator { if (state == State.OPEN_WAIT && newState == State.FAILED) { return true; } - logger.debug("Transition from {} to {} is not allowed", state, newState); return false; } @@ -217,7 +217,6 @@ extends AbstractSessionNegotiator { * Handler to catch exceptions in pipeline during negotiation */ private final class ExceptionHandlingInboundChannelHandler extends ChannelInboundHandlerAdapter { - @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { logger.warn("An exception occurred during negotiation on channel {}", channel.localAddress(), cause); diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/NetconfExiSession.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/NetconfExiSession.java new file mode 100644 index 0000000000..2a20ba2f61 --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/NetconfExiSession.java @@ -0,0 +1,26 @@ +/* + * 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.util; + +import org.opendaylight.controller.netconf.api.NetconfMessage; + +/** + * Session capable of exi communication according to http://tools.ietf.org/html/draft-varga-netconf-exi-capability-02 + */ +public interface NetconfExiSession { + + /** + * Start exi communication with parameters included in start-exi message + */ + void startExiCommunication(NetconfMessage startExiMessage); + + /** + * Stop exi communication, initiated by stop-exi message + */ + void stopExiCommunication(); +} diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXICodec.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXICodec.java new file mode 100644 index 0000000000..a6e2e52ea5 --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXICodec.java @@ -0,0 +1,59 @@ +package org.opendaylight.controller.netconf.util.handler; + +import com.google.common.base.Preconditions; +import org.openexi.proc.HeaderOptionsOutputType; +import org.openexi.proc.common.EXIOptions; +import org.openexi.proc.common.EXIOptionsException; +import org.openexi.proc.common.GrammarOptions; +import org.openexi.proc.grammars.GrammarCache; +import org.openexi.sax.EXIReader; +import org.openexi.sax.Transmogrifier; + +public final class NetconfEXICodec { + /** + * NETCONF is XML environment, so the use of EXI cookie is not really needed. Adding it + * decreases efficiency of encoding by adding human-readable 4 bytes "EXI$" to the head + * of the stream. This is really useful, so let's output it now. + */ + private static final boolean OUTPUT_EXI_COOKIE = true; + private final EXIOptions exiOptions; + + public NetconfEXICodec(final EXIOptions exiOptions) { + this.exiOptions = Preconditions.checkNotNull(exiOptions); + } + + private GrammarCache getGrammarCache() { + short go = GrammarOptions.DEFAULT_OPTIONS; + if (exiOptions.getPreserveComments()) { + go = GrammarOptions.addCM(go); + } + if (exiOptions.getPreserveDTD()) { + go = GrammarOptions.addDTD(go); + } + if (exiOptions.getPreserveNS()) { + go = GrammarOptions.addNS(go); + } + if (exiOptions.getPreservePIs()) { + go = GrammarOptions.addPI(go); + } + + return new GrammarCache(null, go); + } + + EXIReader getReader() throws EXIOptionsException { + final EXIReader r = new EXIReader(); + r.setPreserveLexicalValues(exiOptions.getPreserveLexicalValues()); + r.setGrammarCache(getGrammarCache()); + return r; + } + + Transmogrifier getTransmogrifier() throws EXIOptionsException { + final Transmogrifier transmogrifier = new Transmogrifier(); + transmogrifier.setAlignmentType(exiOptions.getAlignmentType()); + transmogrifier.setBlockSize(exiOptions.getBlockSize()); + transmogrifier.setGrammarCache(getGrammarCache()); + transmogrifier.setOutputCookie(OUTPUT_EXI_COOKIE); + transmogrifier.setOutputOptions(HeaderOptionsOutputType.all); + return transmogrifier; + } +} diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXIToMessageDecoder.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXIToMessageDecoder.java new file mode 100644 index 0000000000..cbfbfe1c05 --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXIToMessageDecoder.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2014 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.util.handler; + +import java.io.InputStream; +import java.util.List; + +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.sax.SAXTransformerFactory; +import javax.xml.transform.sax.TransformerHandler; + +import org.opendaylight.controller.netconf.api.NetconfMessage; +import org.openexi.sax.EXIReader; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.xml.sax.InputSource; + +import com.google.common.base.Preconditions; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufInputStream; +import io.netty.buffer.ByteBufUtil; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.ByteToMessageDecoder; + +public final class NetconfEXIToMessageDecoder extends ByteToMessageDecoder { + + private static final Logger LOG = LoggerFactory.getLogger(NetconfEXIToMessageDecoder.class); + +// private static final SAXTransformerFactory saxTransformerFactory = (SAXTransformerFactory)SAXTransformerFactory.newInstance(); + + private final NetconfEXICodec codec; + + public NetconfEXIToMessageDecoder(final NetconfEXICodec codec) { + this.codec = Preconditions.checkNotNull(codec); + } + + @Override + protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List out) throws Exception { + /* + * Note that we could loop here and process all the messages, but we can't do that. + * The reason is operation, which has the contract of immediately stopping + * the use of EXI, which means the next message needs to be decoded not by us, but rather + * by the XML decoder. + */ + // If empty Byte buffer is passed to r.parse, EOFException is thrown + + if (in.readableBytes() == 0) { + LOG.debug("No more content in incoming buffer."); + return; + } + + LOG.trace("Received to decode: {}", ByteBufUtil.hexDump(in)); + + final EXIReader r = codec.getReader(); + + final SAXTransformerFactory transformerFactory + = (SAXTransformerFactory) TransformerFactory.newInstance(); + final TransformerHandler handler = transformerFactory.newTransformerHandler(); + r.setContentHandler(handler); + + final DOMResult domResult = new DOMResult(); + handler.setResult(domResult); + + + try (final InputStream is = new ByteBufInputStream(in)) { + r.parse(new InputSource(is)); + } + + out.add(new NetconfMessage((Document) domResult.getNode())); + } +} diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageToEXIEncoder.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageToEXIEncoder.java new file mode 100644 index 0000000000..5edec0d1bd --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageToEXIEncoder.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014 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.util.handler; + +import java.io.ByteArrayInputStream; +import java.io.OutputStream; + +import org.opendaylight.controller.netconf.api.NetconfMessage; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; +import org.openexi.sax.Transmogrifier; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xml.sax.InputSource; + +import com.google.common.base.Preconditions; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufOutputStream; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToByteEncoder; + +public final class NetconfMessageToEXIEncoder extends MessageToByteEncoder { + + private static final Logger LOG = LoggerFactory.getLogger(NetconfMessageToEXIEncoder.class); + + //private static final SAXTransformerFactory saxTransformerFactory = (SAXTransformerFactory)SAXTransformerFactory.newInstance(); + private final NetconfEXICodec codec; + + public NetconfMessageToEXIEncoder(final NetconfEXICodec codec) { + this.codec = Preconditions.checkNotNull(codec); + } + + @Override + protected void encode(final ChannelHandlerContext ctx, final NetconfMessage msg, final ByteBuf out) throws Exception { + LOG.trace("Sent to encode : {}", XmlUtil.toString(msg.getDocument())); + + try (final OutputStream os = new ByteBufOutputStream(out)) { + final Transmogrifier transmogrifier = codec.getTransmogrifier(); + transmogrifier.setOutputStream(os); + + // FIXME transformer not working, see EXILibTest + transmogrifier.encode(new InputSource(new ByteArrayInputStream(XmlUtil.toString(msg.getDocument()).getBytes()))); + //final Transformer transformer = saxTransformerFactory.newTransformer(); + //transformer.transform(new DOMSource(msg.getDocument()), new SAXResult(transmogrifier.getSAXTransmogrifier())); + } + } +} diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageToXMLEncoder.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageToXMLEncoder.java index f9792a6c5b..121ef8d743 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageToXMLEncoder.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfMessageToXMLEncoder.java @@ -24,6 +24,7 @@ import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.opendaylight.controller.netconf.api.NetconfMessage; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Comment; @@ -48,7 +49,7 @@ public class NetconfMessageToXMLEncoder extends MessageToByteEncoder capabilities, + Optional additionalHeaderOptional) { + Document doc = createHelloMessageDoc(capabilities); + return additionalHeaderOptional.isPresent() ? new NetconfHelloMessage(doc, additionalHeaderOptional.get()) + : new NetconfHelloMessage(doc); + } + + private static Document createHelloMessageDoc(Iterable capabilities) { + Document doc = XmlUtil.newDocument(); + Element helloElement = doc.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, + HELLO_TAG); + Element capabilitiesElement = doc.createElement(XmlNetconfConstants.CAPABILITIES); + + for (String capability : Sets.newHashSet(capabilities)) { + Element capElement = doc.createElement(XmlNetconfConstants.CAPABILITY); + capElement.setTextContent(capability); + capabilitiesElement.appendChild(capElement); + } + + helloElement.appendChild(capabilitiesElement); + + doc.appendChild(helloElement); + return doc; + } + + public static NetconfHelloMessage createServerHello(Set capabilities, long sessionId) { + Document doc = createHelloMessageDoc(capabilities); + Element sessionIdElement = doc.createElement(XmlNetconfConstants.SESSION_ID); + sessionIdElement.setTextContent(Long.toString(sessionId)); + doc.getDocumentElement().appendChild(sessionIdElement); + return new NetconfHelloMessage(doc); + } } diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfMessageUtil.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfMessageUtil.java index 91eb86908b..e4d97cf65a 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfMessageUtil.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfMessageUtil.java @@ -8,11 +8,17 @@ package org.opendaylight.controller.netconf.util.messages; +import com.google.common.base.Function; +import com.google.common.collect.Collections2; import org.opendaylight.controller.netconf.api.NetconfMessage; import org.opendaylight.controller.netconf.util.xml.XmlElement; import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; import org.w3c.dom.Document; +import javax.annotation.Nullable; +import java.util.Collection; +import java.util.List; + public final class NetconfMessageUtil { private NetconfMessageUtil() {} @@ -26,10 +32,13 @@ public final class NetconfMessageUtil { } public static boolean isOKMessage(XmlElement xmlElement) { + if(xmlElement.getChildElements().size() != 1) { + return false; + } return xmlElement.getOnlyChildElement().getName().equals(XmlNetconfConstants.OK); } - public static boolean isErrorMEssage(NetconfMessage message) { + public static boolean isErrorMessage(NetconfMessage message) { return isErrorMessage(message.getDocument()); } @@ -38,7 +47,26 @@ public final class NetconfMessageUtil { } public static boolean isErrorMessage(XmlElement xmlElement) { + if(xmlElement.getChildElements().size() != 1) { + return false; + } return xmlElement.getOnlyChildElement().getName().equals(XmlNetconfConstants.RPC_ERROR); + } + + public static Collection extractCapabilitiesFromHello(Document doc) { + XmlElement responseElement = XmlElement.fromDomDocument(doc); + XmlElement capabilitiesElement = responseElement + .getOnlyChildElementWithSameNamespace(XmlNetconfConstants.CAPABILITIES); + List caps = capabilitiesElement.getChildElements(XmlNetconfConstants.CAPABILITY); + return Collections2.transform(caps, new Function() { + + @Nullable + @Override + public String apply(@Nullable XmlElement input) { + // Trim possible leading/tailing whitespace + return input.getTextContent().trim(); + } + }); } } diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfStartExiMessage.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfStartExiMessage.java new file mode 100644 index 0000000000..4fe6adc0a5 --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfStartExiMessage.java @@ -0,0 +1,93 @@ +/* + * 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.util.messages; + +import java.util.List; + +import org.opendaylight.controller.netconf.api.NetconfMessage; +import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants; +import org.opendaylight.controller.netconf.util.xml.XmlUtil; +import org.openexi.proc.common.EXIOptions; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import com.google.common.collect.Lists; + +/** + * Start-exi netconf message. + */ +public final class NetconfStartExiMessage extends NetconfMessage { + + public static final String START_EXI = "start-exi"; + public static final String ALIGNMENT_KEY = "alignment"; + public static final String FIDELITY_KEY = "fidelity"; + public static final String COMMENTS_KEY = "comments"; + public static final String DTD_KEY = "dtd"; + public static final String LEXICAL_VALUES_KEY = "lexical-values"; + public static final String PIS_KEY = "pis"; + public static final String PREFIXES_KEY = "prefixes"; + + private NetconfStartExiMessage(Document doc) { + super(doc); + } + + public static NetconfStartExiMessage create(EXIOptions exiOptions, String messageId) { + Document doc = XmlUtil.newDocument(); + Element rpcElement = doc.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, + XmlNetconfConstants.RPC_KEY); + rpcElement.setAttributeNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, + XmlNetconfConstants.MESSAGE_ID, messageId); + + // TODO draft http://tools.ietf.org/html/draft-varga-netconf-exi-capability-02#section-3.5.1 has no namespace for start-exi element in xml + Element startExiElement = doc.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0, + START_EXI); + + addAlignemnt(exiOptions, doc, startExiElement); + addFidelity(exiOptions, doc, startExiElement); + + rpcElement.appendChild(startExiElement); + + doc.appendChild(rpcElement); + return new NetconfStartExiMessage(doc); + } + + private static void addFidelity(EXIOptions exiOptions, Document doc, Element startExiElement) { + List fidelityElements = Lists.newArrayList(); + createFidelityElement(doc, fidelityElements, exiOptions.getPreserveComments(), COMMENTS_KEY); + createFidelityElement(doc, fidelityElements, exiOptions.getPreserveDTD(), DTD_KEY); + createFidelityElement(doc, fidelityElements, exiOptions.getPreserveLexicalValues(), LEXICAL_VALUES_KEY); + createFidelityElement(doc, fidelityElements, exiOptions.getPreservePIs(), PIS_KEY); + createFidelityElement(doc, fidelityElements, exiOptions.getPreserveNS(), PREFIXES_KEY); + + if (fidelityElements.isEmpty() == false) { + Element fidelityElement = doc.createElementNS( + XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0, FIDELITY_KEY); + for (Element element : fidelityElements) { + fidelityElement.appendChild(element); + } + startExiElement.appendChild(fidelityElement); + } + } + + private static void addAlignemnt(EXIOptions exiOptions, Document doc, Element startExiElement) { + Element alignmentElement = doc.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0, + ALIGNMENT_KEY); + alignmentElement.setTextContent(exiOptions.getAlignmentType().toString()); + startExiElement.appendChild(alignmentElement); + } + + private static void createFidelityElement(Document doc, List fidelityElements, boolean fidelity, String fidelityName) { + + if (fidelity) { + fidelityElements.add(doc.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0, + fidelityName)); + } + + } +} 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 new file mode 100644 index 0000000000..593b77f193 --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/EXIParameters.java @@ -0,0 +1,109 @@ +/* + * 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.util.xml; + +import org.opendaylight.controller.netconf.api.NetconfMessage; +import org.openexi.proc.common.AlignmentType; +import org.openexi.proc.common.EXIOptions; +import org.openexi.proc.common.EXIOptionsException; + +import com.google.common.base.Preconditions; + +public final class EXIParameters { + private static final String EXI_PARAMETER_ALIGNMENT = "alignment"; + private static final String EXI_PARAMETER_BYTE_ALIGNED = "byte-aligned"; + private static final String EXI_PARAMETER_BIT_PACKED = "bit-packed"; + private static final String EXI_PARAMETER_COMPRESSED = "compressed"; + private static final String EXI_PARAMETER_PRE_COMPRESSION = "pre-compression"; + + private static final String EXI_PARAMETER_FIDELITY = "fidelity"; + private static final String EXI_FIDELITY_DTD = "dtd"; + private static final String EXI_FIDELITY_LEXICAL_VALUES = "lexical-values"; + private static final String EXI_FIDELITY_COMMENTS = "comments"; + private static final String EXI_FIDELITY_PIS = "pis"; + private static final String EXI_FIDELITY_PREFIXES = "prefixes"; + + private static final String EXI_PARAMETER_SCHEMA = "schema"; + private static final String EXI_PARAMETER_SCHEMA_NONE = "none"; + private static final String EXI_PARAMETER_SCHEMA_BUILT_IN = "builtin"; + private static final String EXI_PARAMETER_SCHEMA_BASE_1_1 = "base:1.1"; + + private final EXIOptions options; + + private EXIParameters(final EXIOptions options) { + this.options = Preconditions.checkNotNull(options); + } + + public static EXIParameters fromNetconfMessage(final NetconfMessage root) throws EXIOptionsException { + return fromXmlElement(XmlElement.fromDomDocument(root.getDocument())); + } + + public static EXIParameters fromXmlElement(final XmlElement root) throws EXIOptionsException { + final EXIOptions options = new EXIOptions(); + + options.setAlignmentType(AlignmentType.bitPacked); + if (root.getElementsByTagName(EXI_PARAMETER_ALIGNMENT).getLength() > 0) { + if (root.getElementsByTagName(EXI_PARAMETER_BIT_PACKED).getLength() > 0) { + options.setAlignmentType(AlignmentType.bitPacked); + } else if (root.getElementsByTagName(EXI_PARAMETER_BYTE_ALIGNED).getLength() > 0) { + options.setAlignmentType(AlignmentType.byteAligned); + } else if (root.getElementsByTagName(EXI_PARAMETER_COMPRESSED).getLength() > 0) { + options.setAlignmentType(AlignmentType.compress); + } else if (root.getElementsByTagName(EXI_PARAMETER_PRE_COMPRESSION).getLength() > 0) { + options.setAlignmentType(AlignmentType.preCompress); + } + } + + if (root.getElementsByTagName(EXI_PARAMETER_FIDELITY).getLength() > 0) { + if (root.getElementsByTagName(EXI_FIDELITY_DTD).getLength() > 0) { + options.setPreserveDTD(true); + } + if (root.getElementsByTagName(EXI_FIDELITY_LEXICAL_VALUES).getLength() > 0) { + options.setPreserveLexicalValues(true); + } + if (root.getElementsByTagName(EXI_FIDELITY_COMMENTS).getLength() > 0) { + options.setPreserveComments(true); + } + if (root.getElementsByTagName(EXI_FIDELITY_PIS).getLength() > 0) { + options.setPreservePIs(true); + } + if (root.getElementsByTagName(EXI_FIDELITY_PREFIXES).getLength() > 0) { + options.setPreserveNS(true); + } + } + + if (root.getElementsByTagName(EXI_PARAMETER_SCHEMA).getLength() > 0) { +/* + GrammarFactory grammarFactory = GrammarFactory.newInstance(); + if (operationElement + .getElementsByTagName(EXI_PARAMETER_SCHEMA_NONE) + .getLength() > 0) { + this.grammars = grammarFactory.createSchemaLessGrammars(); + } + + if (operationElement.getElementsByTagName( + EXI_PARAMETER_SCHEMA_BUILT_IN).getLength() > 0) { + this.grammars = grammarFactory.createXSDTypesOnlyGrammars(); + } + + if (operationElement.getElementsByTagName( + EXI_PARAMETER_SCHEMA_BASE_1_1).getLength() > 0) { + this.grammars = grammarFactory + .createGrammars(NETCONF_XSD_LOCATION); + } +*/ + + } + + return new EXIParameters(options); + } + + public final EXIOptions getOptions() { + return options; + } +} diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlNetconfConstants.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlNetconfConstants.java index c9f3a8a53b..d0be73843b 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlNetconfConstants.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlNetconfConstants.java @@ -9,6 +9,8 @@ package org.opendaylight.controller.netconf.util.xml; public final class XmlNetconfConstants { + + private XmlNetconfConstants() {} public static final String MOUNTPOINTS = "mountpoints"; @@ -37,8 +39,15 @@ public final class XmlNetconfConstants { public static final String PREFIX = "prefix"; + public static final String MESSAGE_ID = "message-id"; + public static final String SESSION_ID = "session-id"; + // public static final String URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0 = "urn:ietf:params:xml:ns:netconf:base:1.0"; + public static final String URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_1 = "urn:ietf:params:xml:ns:netconf:base:1.1"; + public static final String URN_IETF_PARAMS_XML_NS_NETCONF_EXI_1_0 = "urn:ietf:params:xml:ns:netconf:exi:1.0"; + + public static final String URN_IETF_PARAMS_NETCONF_CAPABILITY_EXI_1_0 = "urn:ietf:params:netconf:capability:exi:1.0"; public static final String URN_IETF_PARAMS_XML_NS_YANG_IETF_NETCONF_MONITORING = "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"; // TODO where to store namespace of config ? public static final String URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG = "urn:opendaylight:params:xml:ns:yang:controller:config"; diff --git a/opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/EXILibTest.java b/opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/EXILibTest.java new file mode 100644 index 0000000000..360e8126ae --- /dev/null +++ b/opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/EXILibTest.java @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2014 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.util; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.StringWriter; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.TransformerFactoryConfigurationError; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.sax.SAXResult; +import javax.xml.transform.sax.SAXTransformerFactory; +import javax.xml.transform.sax.TransformerHandler; +import javax.xml.transform.stream.StreamResult; + +import org.junit.Ignore; +import org.junit.Test; +import org.openexi.proc.common.AlignmentType; +import org.openexi.proc.common.GrammarOptions; +import org.openexi.proc.grammars.GrammarCache; +import org.openexi.sax.EXIReader; +import org.openexi.sax.Transmogrifier; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.xml.sax.InputSource; + +/** + * This test case tests nagasena library used for exi encode/decode. + * + * This library does not work correctly, since it is impossible to encode and then decode DOM xml. + * Encoding DOM using sax Transformer produces invalid xml, that cannot be decoded (Problem seems to be the namespace handling). + * + */ +@Ignore +public class EXILibTest { + + public static final AlignmentType ALIGNMENT_TYPE = AlignmentType.preCompress; + + @Test + public void testExiLibWithSaxTransformer() throws Exception { + final byte[] encode = encodeEXI(getDom2()); + final byte[] encodeWithTransformer = encodeEXITransformer(getDom2()); + + // System.err.println(Arrays.toString(encode)); + // System.err.println(Arrays.toString(encodeWithTransformer)); + + // This works fine (encoded from string) + decodeEXI(encode); + // Error, encoded from Dom with Transformer cannot be decoded, Exception is thrown + // + // either: + // org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces. + // + // or: + // java.lang.NullPointerException + // + // depends on GrammarOptions.addNS(go); option set + decodeEXI(encodeWithTransformer); + } + + private static final SAXTransformerFactory saxTransformerFactory = (SAXTransformerFactory)SAXTransformerFactory.newInstance(); + + public static byte[] encodeEXITransformer(final Element xml) throws Exception { + final Transmogrifier transmogrifier = new Transmogrifier(); + + transmogrifier.setAlignmentType(ALIGNMENT_TYPE); + + final ByteArrayOutputStream out = new ByteArrayOutputStream(); + + transmogrifier.setGrammarCache(getGrammarCache()); + + transmogrifier.setOutputStream(out); + + final Transformer transformer = saxTransformerFactory.newTransformer(); + transformer.transform(new DOMSource(xml), new SAXResult(transmogrifier.getSAXTransmogrifier())); + + return out.toByteArray(); + } + + public static byte[] encodeEXI(final Element xml) throws Exception { + final Transmogrifier transmogrifier = new Transmogrifier(); + + transmogrifier.setAlignmentType(ALIGNMENT_TYPE); + + final ByteArrayOutputStream out = new ByteArrayOutputStream(); + + transmogrifier.setGrammarCache(getGrammarCache()); + + transmogrifier.setOutputStream(out); + + transmogrifier.encode(new InputSource(new ByteArrayInputStream(toString(xml, false).getBytes()))); + + out.flush(); + + return out.toByteArray(); + } + + private static GrammarCache getGrammarCache() { + short go = GrammarOptions.DEFAULT_OPTIONS; + + // This option on or off, nagasena still fails +// go = GrammarOptions.addNS(go); + + return new GrammarCache(null, go); + } + + public static Document decodeEXI(final byte[] input) throws Exception { + + final GrammarCache grammarCache; + final DOMResult domResult = new DOMResult(); + + try(ByteArrayInputStream in = new ByteArrayInputStream(input)) { + + final EXIReader reader = new EXIReader(); + + reader.setAlignmentType(ALIGNMENT_TYPE); + grammarCache = getGrammarCache(); + + reader.setGrammarCache(grammarCache); + + final SAXTransformerFactory transformerFactory + = (SAXTransformerFactory) TransformerFactory.newInstance(); + final TransformerHandler handler = transformerFactory.newTransformerHandler(); + handler.setResult(domResult); + + reader.setContentHandler(handler); + + reader.parse(new InputSource(in)); + } + + return (Document) domResult.getNode(); + } + + public static Element getDom() { + final Element dom; + + final Document d = newDocument(); + + dom = d.createElement("rpc"); + dom.setAttribute("xmlns", "a.b.c"); + dom.setAttribute("message-id", "id"); + dom.appendChild(d.createElement("inner")); + + return dom; + } + + public static Element getDom2() { + final Element dom; + + final Document d = newDocument(); + + dom = d.createElementNS("a.b.c", "rpc"); + dom.setAttribute("message-id", "id"); + dom.appendChild(d.createElement("inner")); + + return dom; + } + + private static final DocumentBuilderFactory BUILDERFACTORY; + + static { + final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + factory.setCoalescing(true); + factory.setIgnoringElementContentWhitespace(true); + factory.setIgnoringComments(true); + BUILDERFACTORY = factory; + } + + private static Document newDocument() { + try { + final DocumentBuilder builder = BUILDERFACTORY.newDocumentBuilder(); + return builder.newDocument(); + } catch (final ParserConfigurationException e) { + throw new RuntimeException("Failed to create document", e); + } + } + + private static String toString(final Element xml, final boolean addXmlDeclaration) { + try { + final Transformer transformer = TransformerFactory.newInstance().newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, addXmlDeclaration ? "no" : "yes"); + + final StreamResult result = new StreamResult(new StringWriter()); + final DOMSource source = new DOMSource(xml); + transformer.transform(source, result); + + return result.getWriter().toString(); + } catch (IllegalArgumentException | TransformerFactoryConfigurationError | TransformerException e) { + throw new RuntimeException("Unable to serialize xml element " + xml, e); + } + } +} diff --git a/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/startExi.xml b/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/startExi.xml index 7e44f74830..e7a483e405 100644 --- a/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/startExi.xml +++ b/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/startExi.xml @@ -1,9 +1,9 @@ - - -pre-compression - - - - - + + +pre-compression + + + + + \ No newline at end of file diff --git a/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/stopExi.xml b/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/stopExi.xml index d131ce7bbd..6c0524a4fc 100644 --- a/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/stopExi.xml +++ b/opendaylight/netconf/netconf-util/src/test/resources/netconfMessages/stopExi.xml @@ -1,3 +1,3 @@ - - + + \ No newline at end of file diff --git a/opendaylight/netconf/pom.xml b/opendaylight/netconf/pom.xml index ab71180ba9..5dbf4423db 100644 --- a/opendaylight/netconf/pom.xml +++ b/opendaylight/netconf/pom.xml @@ -29,6 +29,7 @@ netconf-monitoring ietf-netconf-monitoring ietf-netconf-monitoring-extension + ../../third-party/org.openexi diff --git a/third-party/org.openexi/nagasena-rta/nagasena-rta-0000.0002.0035.0.jar b/third-party/org.openexi/nagasena-rta/nagasena-rta-0000.0002.0035.0.jar new file mode 100644 index 0000000000..060b171529 Binary files /dev/null and b/third-party/org.openexi/nagasena-rta/nagasena-rta-0000.0002.0035.0.jar differ diff --git a/third-party/org.openexi/nagasena-rta/pom.xml b/third-party/org.openexi/nagasena-rta/pom.xml new file mode 100644 index 0000000000..6beba8c28b --- /dev/null +++ b/third-party/org.openexi/nagasena-rta/pom.xml @@ -0,0 +1,65 @@ + + + + + 4.0.0 + + + org.opendaylight.controller.thirdparty + org.openexi + 0000.0002.0035.0-SNAPSHOT + + + org.opendaylight.controller.thirdparty + nagasena-rta + bundle + + + nagasena-rta-0000.0002.0035.0.jar + + + + + + org.codehaus.mojo + truezip-maven-plugin + + + extract + + copy + + compile + + + + ${archive} + ${project.build.outputDirectory} + + ** + + + + + + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.groupId}.${project.artifactId} + + + + + + + diff --git a/third-party/org.openexi/nagasena/nagasena-0000.0002.0035.0.jar b/third-party/org.openexi/nagasena/nagasena-0000.0002.0035.0.jar new file mode 100644 index 0000000000..c566f27d83 Binary files /dev/null and b/third-party/org.openexi/nagasena/nagasena-0000.0002.0035.0.jar differ diff --git a/third-party/org.openexi/nagasena/pom.xml b/third-party/org.openexi/nagasena/pom.xml new file mode 100644 index 0000000000..297f15f201 --- /dev/null +++ b/third-party/org.openexi/nagasena/pom.xml @@ -0,0 +1,65 @@ + + + + + 4.0.0 + + + org.opendaylight.controller.thirdparty + org.openexi + 0000.0002.0035.0-SNAPSHOT + + + org.opendaylight.controller.thirdparty + nagasena + bundle + + + nagasena-0000.0002.0035.0.jar + + + + + + org.codehaus.mojo + truezip-maven-plugin + + + extract + + copy + + compile + + + + ${archive} + ${project.build.outputDirectory} + + ** + + + + + + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.groupId}.${project.artifactId} + + + + + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/allclasses-frame.html b/third-party/org.openexi/nagasena/src/main/resources/doc/allclasses-frame.html new file mode 100644 index 0000000000..11f9ed5153 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/allclasses-frame.html @@ -0,0 +1,85 @@ + + + + + + + +All Classes + + + + + + + + + + +All Classes +
+ + + + + +
AlignmentType +
+BinaryDataHandler +
+BinaryDataSink +
+BinaryDataSource +
+CharacterBuffer +
+Characters +
+EmptySchema +
+EntityResolverEx +
+EventDescription +
+EventType +
+EXIDecoder +
+EXIOptions +
+EXIReader +
+EXISchema +
+EXISchemaFactory +
+EXISchemaFactoryErrorHandler +
+EXISchemaFactoryException +
+EXISchemaReader +
+EXISchemaResolver +
+GrammarCache +
+GrammarOptions +
+HeaderOptionsOutputType +
+QName +
+ReaderSupport +
+SAXTransmogrifier +
+Scanner +
+Transmogrifier +
+TransmogrifierException +
+
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/allclasses-noframe.html b/third-party/org.openexi/nagasena/src/main/resources/doc/allclasses-noframe.html new file mode 100644 index 0000000000..8f32ae6587 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/allclasses-noframe.html @@ -0,0 +1,85 @@ + + + + + + + +All Classes + + + + + + + + + + +All Classes +
+ + + + + +
AlignmentType +
+BinaryDataHandler +
+BinaryDataSink +
+BinaryDataSource +
+CharacterBuffer +
+Characters +
+EmptySchema +
+EntityResolverEx +
+EventDescription +
+EventType +
+EXIDecoder +
+EXIOptions +
+EXIReader +
+EXISchema +
+EXISchemaFactory +
+EXISchemaFactoryErrorHandler +
+EXISchemaFactoryException +
+EXISchemaReader +
+EXISchemaResolver +
+GrammarCache +
+GrammarOptions +
+HeaderOptionsOutputType +
+QName +
+ReaderSupport +
+SAXTransmogrifier +
+Scanner +
+Transmogrifier +
+TransmogrifierException +
+
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/constant-values.html b/third-party/org.openexi/nagasena/src/main/resources/doc/constant-values.html new file mode 100644 index 0000000000..6c4e3d2837 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/constant-values.html @@ -0,0 +1,553 @@ + + + + + + + +Constant Field Values + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Constant Field Values

+
+
+Contents + + + + + + +
+org.openexi.*
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
org.openexi.proc.common.EventDescription
+public static final byteEVENT_AT3
+public static final byteEVENT_BLOB13
+public static final byteEVENT_CH6
+public static final byteEVENT_CM10
+public static final byteEVENT_DTD12
+public static final byteEVENT_ED1
+public static final byteEVENT_EE7
+public static final byteEVENT_ER11
+public static final byteEVENT_NL5
+public static final byteEVENT_NS8
+public static final byteEVENT_PI9
+public static final byteEVENT_SD0
+public static final byteEVENT_SE2
+public static final byteEVENT_TP4
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
org.openexi.proc.common.EventType
+public static final byteITEM_AT12
+public static final byteITEM_AT_WC_ANY_UNTYPED8
+public static final byteITEM_CH3
+public static final byteITEM_CM1
+public static final byteITEM_DTD10
+public static final byteITEM_ED4
+public static final byteITEM_EE9
+public static final byteITEM_ER2
+public static final byteITEM_NS7
+public static final byteITEM_PI0
+public static final byteITEM_SC6
+public static final byteITEM_SCHEMA_AT16
+public static final byteITEM_SCHEMA_AT_INVALID_VALUE23
+public static final byteITEM_SCHEMA_AT_WC_ANY17
+public static final byteITEM_SCHEMA_AT_WC_NS18
+public static final byteITEM_SCHEMA_CH19
+public static final byteITEM_SCHEMA_CH_MIXED20
+public static final byteITEM_SCHEMA_NIL21
+public static final byteITEM_SCHEMA_TYPE22
+public static final byteITEM_SCHEMA_WC_ANY14
+public static final byteITEM_SCHEMA_WC_NS15
+public static final byteITEM_SD13
+public static final byteITEM_SE11
+public static final byteITEM_SE_WC5
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + +
org.openexi.proc.common.GrammarOptions
+public static final shortDEFAULT_OPTIONS2
+public static final shortOPTIONS_UNUSED0
+public static final shortSTRICT_OPTIONS1
+ +

+ +

+ + + + + + + + + + + + +
org.openexi.proc.io.CharacterBuffer
+public static final intBUFSIZE_DEFAULT4096
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
org.openexi.sax.TransmogrifierException
+public static final intPREFIX_BOUND_TO_ANOTHER_NAMESPACE11
+public static final intPREFIX_NOT_BOUND10
+public static final intSAX_ERROR6
+public static final intSCRIBER_ERROR12
+public static final intUNEXPECTED_ATTR2
+public static final intUNEXPECTED_BINARY_VALUE4
+public static final intUNEXPECTED_CHARS3
+public static final intUNEXPECTED_ED8
+public static final intUNEXPECTED_ELEM1
+public static final intUNEXPECTED_END_ELEM7
+public static final intUNEXPECTED_SD9
+public static final intUNHANDLED_SAXPARSER_FEATURE5
+ +

+ +

+ + + + + + + + + + + + +
org.openexi.scomp.EXISchemaFactoryException
+public static final intXMLSCHEMA_ERROR1002
+ +

+ +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/deprecated-list.html b/third-party/org.openexi/nagasena/src/main/resources/doc/deprecated-list.html new file mode 100644 index 0000000000..60ad3edb6c --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/deprecated-list.html @@ -0,0 +1,141 @@ + + + + + + + +Deprecated List + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Deprecated API

+
+
+Contents
    +
+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/help-doc.html b/third-party/org.openexi/nagasena/src/main/resources/doc/help-doc.html new file mode 100644 index 0000000000..81850ce70b --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/help-doc.html @@ -0,0 +1,214 @@ + + + + + + + +API Help + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+How This API Document Is Organized

+
+This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

+Overview

+
+ +

+The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

+

+Package

+
+ +

+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

    +
  • Interfaces (italic)
  • Classes
  • Enums
  • Exceptions
  • Errors
  • Annotation Types
+
+

+Class/Interface

+
+ +

+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
  • Class inheritance diagram
  • Direct Subclasses
  • All Known Subinterfaces
  • All Known Implementing Classes
  • Class/interface declaration
  • Class/interface description +

    +

  • Nested Class Summary
  • Field Summary
  • Constructor Summary
  • Method Summary +

    +

  • Field Detail
  • Constructor Detail
  • Method Detail
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+ +

+Annotation Type

+
+ +

+Each annotation type has its own separate page with the following sections:

    +
  • Annotation Type declaration
  • Annotation Type description
  • Required Element Summary
  • Optional Element Summary
  • Element Detail
+
+ +

+Enum

+
+ +

+Each enum has its own separate page with the following sections:

    +
  • Enum declaration
  • Enum description
  • Enum Constant Summary
  • Enum Constant Detail
+
+

+Tree (Class Hierarchy)

+
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
    +
  • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
  • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+
+

+Deprecated API

+
+The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+

+Index

+
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+

+Prev/Next

+These links take you to the next or previous class, interface, package, or related page.

+Frames/No Frames

+These links show and hide the HTML frames. All pages are available with or without frames. +

+

+Serialized Form

+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. +

+

+Constant Field Values

+The Constant Field Values page lists the static final fields and their values. +

+ + +This help file applies to API documentation generated using the standard doclet. + +
+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/index-all.html b/third-party/org.openexi/nagasena/src/main/resources/doc/index-all.html new file mode 100644 index 0000000000..3fc6b297e3 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/index-all.html @@ -0,0 +1,970 @@ + + + + + + + +Index + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A B C D E F G H I L M N O P Q R S T U V W X _
+

+A

+
+
addCM(short) - +Static method in class org.openexi.proc.common.GrammarOptions +
Sets Preserve Comments to true. +
addDTD(short) - +Static method in class org.openexi.proc.common.GrammarOptions +
Sets Preserve Document Type Definition to true. +
addNS(short) - +Static method in class org.openexi.proc.common.GrammarOptions +
Sets Preserve Namespaces to true. +
addPI(short) - +Static method in class org.openexi.proc.common.GrammarOptions +
Sets Preserve Processing Instructions to true. +
AlignmentType - Enum in org.openexi.proc.common
AlignmentType represents one of the following bit alignment + styles so as to provide an extra degree of control over the + way information is stored in EXI format.
ancestryIds - +Variable in class org.openexi.schema.EXISchema +
  +
+
+

+B

+
+
binaryData(byte[], int, int, BinaryDataSink) - +Method in interface org.openexi.sax.BinaryDataHandler +
Writes a binary value where the schema expects a binary value. +
BinaryDataHandler - Interface in org.openexi.sax
 
BinaryDataSink - Interface in org.openexi.proc.io
BinaryDataSink represents a sink that accepts successive chunks of binary data.
BinaryDataSource - Class in org.openexi.proc.common
 
BinaryDataSource() - +Constructor for class org.openexi.proc.common.BinaryDataSource +
  +
BUFSIZE_DEFAULT - +Static variable in class org.openexi.proc.io.CharacterBuffer +
  +
+
+

+C

+
+
CharacterBuffer - Class in org.openexi.proc.io
 
CharacterBuffer(int) - +Constructor for class org.openexi.proc.io.CharacterBuffer +
  +
Characters - Class in org.openexi.schema
 
Characters(char[], int, int, boolean) - +Constructor for class org.openexi.schema.Characters +
  +
characters - +Variable in class org.openexi.schema.Characters +
  +
CHARACTERS_EMPTY - +Static variable in class org.openexi.schema.Characters +
  +
closeInputStream() - +Method in class org.openexi.proc.io.Scanner +
Close the input stream. +
compile(InputSource) - +Method in class org.openexi.scomp.EXISchemaFactory +
Compile an XML Schema Document into an EXISchema. +
+
+

+D

+
+
DEFAULT_OPTIONS - +Static variable in class org.openexi.proc.common.GrammarOptions +
Indicates that undeclared elements and attributes will be + processed when the XML stream is encoded and decoded. +
+
+

+E

+
+
EmptySchema - Class in org.openexi.schema
EmptySchema provides an EXISchema that supports all datatypes inherent + in XML Schema such as xsd:int and xsd:dateTime, but with no + user-specific definitions.
encode(InputSource) - +Method in class org.openexi.sax.Transmogrifier +
Parses XML input source and converts it to an EXI stream. +
endBinaryData(BinaryDataSink) - +Method in interface org.openexi.sax.BinaryDataHandler +
Mark the end of a binary value. +
EntityResolverEx - Interface in org.openexi.scomp
Extended SAX EntityResolver interface for resolving entities and + schema documents.
equals(Object) - +Method in class org.openexi.proc.common.QName +
  +
equals(Object) - +Method in class org.openexi.schema.Characters +
  +
error(EXISchemaFactoryException) - +Method in interface org.openexi.scomp.EXISchemaFactoryErrorHandler +
Report an error found during schema processing. +
EVENT_AT - +Static variable in interface org.openexi.proc.common.EventDescription +
Attribute event. +
EVENT_BLOB - +Static variable in interface org.openexi.proc.common.EventDescription +
BLOB event (content of an element). +
EVENT_CH - +Static variable in interface org.openexi.proc.common.EventDescription +
Character event (content of an element). +
EVENT_CM - +Static variable in interface org.openexi.proc.common.EventDescription +
Comment event. +
EVENT_DTD - +Static variable in interface org.openexi.proc.common.EventDescription +
Document Type Definition event. +
EVENT_ED - +Static variable in interface org.openexi.proc.common.EventDescription +
End Document event. +
EVENT_EE - +Static variable in interface org.openexi.proc.common.EventDescription +
End Element event. +
EVENT_ER - +Static variable in interface org.openexi.proc.common.EventDescription +
Entity Reference event. +
EVENT_NL - +Static variable in interface org.openexi.proc.common.EventDescription +
Attribute xsi:nil. +
EVENT_NS - +Static variable in interface org.openexi.proc.common.EventDescription +
Namespace declaration event. +
EVENT_PI - +Static variable in interface org.openexi.proc.common.EventDescription +
Processing Instruction event. +
EVENT_SD - +Static variable in interface org.openexi.proc.common.EventDescription +
Start Document event. +
EVENT_SE - +Static variable in interface org.openexi.proc.common.EventDescription +
Start Element event. +
EVENT_TP - +Static variable in interface org.openexi.proc.common.EventDescription +
Attribute xsi:type. +
EventDescription - Interface in org.openexi.proc.common
EventDescription provides accessors to the current EXI event data + during the decode process.
EventType - Class in org.openexi.proc.common
EventType denotes terminal symbols of grammar productions + defined in the EXI 1.0 specification.
EXIDecoder - Class in org.openexi.proc
EXIDecoder provides methods to configure and + instantiate a Scanner object + you can use to parse the contents of an EXI stream.
EXIDecoder() - +Constructor for class org.openexi.proc.EXIDecoder +
Creates an instance of EXIDecoder with the default inflator + buffer size of 8192 bytes. +
EXIDecoder(int, boolean) - +Constructor for class org.openexi.proc.EXIDecoder +
Creates an instance of EXIDecoder with the specified inflator buffer + size. +
EXIOptions - Class in org.openexi.proc.common
EXIOptions provides accessors for values associated with + EXI options in the EXI header of an EXI stream.
EXIReader - Class in org.openexi.sax
EXIReader implements the SAX XMLReader to provide a convenient and + familiar interface for decoding an EXI stream.
EXIReader() - +Constructor for class org.openexi.sax.EXIReader +
  +
EXISchema - Class in org.openexi.schema
EXISchema provides methods to read and write compiled EXI schemas.
EXISchemaFactory - Class in org.openexi.scomp
EXISchemaFactory compiles XML Schema into an EXISchema instance.
EXISchemaFactory() - +Constructor for class org.openexi.scomp.EXISchemaFactory +
  +
EXISchemaFactoryErrorHandler - Interface in org.openexi.scomp
This interface reports exceptions from EXISchemaFactory during schema + processing.
EXISchemaFactoryException - Exception in org.openexi.scomp
Any errors encountered during schema compilation are communicated to + an application as EXISchemaFactoryException objects.
EXISchemaReader - Class in org.openexi.scomp
EXISchemaReader parses EXI-encoded EXI Grammar into an EXISchema.
EXISchemaReader() - +Constructor for class org.openexi.scomp.EXISchemaReader +
  +
EXISchemaResolver - Interface in org.openexi.proc
Developers have the option of implementing the EXISchemaResolver interface + to help EXIReader and EXIDecoder locate the correct grammar cache for parsing + an EXI stream.
+
+

+F

+
+
fatalError(EXISchemaFactoryException) - +Method in interface org.openexi.scomp.EXISchemaFactoryErrorHandler +
Report a fatal error found during schema processing. +
+
+

+G

+
+
getAlignmentType() - +Method in class org.openexi.proc.common.EXIOptions +
Get the bit alignment setting. +
getBinaryDataSource() - +Method in interface org.openexi.proc.common.EventDescription +
Gets the value of an EVENT_BLOB. +
getBlockSize() - +Method in class org.openexi.proc.common.EXIOptions +
Returns the number of element and attribute values that are read and processed + as a group. +
getByteArray() - +Method in class org.openexi.proc.common.BinaryDataSource +
  +
getCharacters() - +Method in interface org.openexi.proc.common.EventDescription +
Gets the value of an EVENT_CH, + Attribute (EVENT_AT, EVENT_NL, EVENT_TP), EVENT_CM, + EVENT_DTD or EVENT_PI event. +
getCode() - +Method in exception org.openexi.sax.TransmogrifierException +
Returns a code that represents the type of the exception. +
getCode() - +Method in exception org.openexi.scomp.EXISchemaFactoryException +
Returns a code that represents the type of the exception. +
getContentHandler() - +Method in class org.openexi.sax.ReaderSupport +
Get the SAX content handler currently in use. +
getDatatypeRepresentationMap() - +Method in class org.openexi.proc.common.EXIOptions +
Returns an array of qualified names that map XMLSchema datatypes to + non-standard equivalents in EXI. +
getDatatypeRepresentationMapBindingsCount() - +Method in class org.openexi.proc.common.EXIOptions +
Returns the number of Datatype Representation Map QName pairs. +
getEventKind() - +Method in interface org.openexi.proc.common.EventDescription +
Gets the event kind of which instance data this EventDescription is describing. +
getEventType() - +Method in interface org.openexi.proc.common.EventDescription +
Returns the EventType from which this event is derived. +
getException() - +Method in exception org.openexi.sax.TransmogrifierException +
Returns an Exception object. +
getException() - +Method in exception org.openexi.scomp.EXISchemaFactoryException +
Returns an Exception object. +
getEXISchema() - +Method in class org.openexi.proc.grammars.GrammarCache +
Gets the compiled EXI Schema. +
getEXISchema() - +Static method in class org.openexi.schema.EmptySchema +
Returns an EXISchema that supports all datatypes inherent in XML Schema. +
getFeature(String) - +Method in class org.openexi.sax.EXIReader +
Get features for the SAX parser. +
getGrammarCache() - +Method in interface org.openexi.sax.SAXTransmogrifier +
Returns the GrammarCache that is in use by this SAXTransmogrifier. +
getGrammarCache() - +Method in class org.openexi.sax.Transmogrifier +
Returns the GrammarCache that was previously set. +
getHeaderOptions() - +Method in class org.openexi.proc.io.Scanner +
Returns the EXI Header options from the header of the + EXI stream, if present. +
getLength() - +Method in class org.openexi.proc.common.BinaryDataSource +
  +
getLocator() - +Method in exception org.openexi.sax.TransmogrifierException +
Returns the locator that is associated with this compilation error. +
getLocator() - +Method in exception org.openexi.scomp.EXISchemaFactoryException +
Returns the locator that is associated with this compilation error. +
getMessage() - +Method in exception org.openexi.sax.TransmogrifierException +
Returns a message that describes the exception. +
getMessage() - +Method in exception org.openexi.scomp.EXISchemaFactoryException +
Returns a message that describes the exception. +
getName() - +Method in interface org.openexi.proc.common.EventDescription +
Gets the name of the EXI event. +
getPrefix() - +Method in interface org.openexi.proc.common.EventDescription +
Gets the namespace prefix of the event. +
getPreserveComments() - +Method in class org.openexi.proc.common.EXIOptions +
Returns whether comments are conserved in the EXI Stream. +
getPreserveDTD() - +Method in class org.openexi.proc.common.EXIOptions +
Returns whether the document type definition is conserved in the EXI Stream. +
getPreserveLexicalValues() - +Method in class org.openexi.proc.common.EXIOptions +
Returns whether lexical values (literal strings) are preserved rather + than the logical values of elements and attributes. +
getPreserveNS() - +Method in class org.openexi.proc.common.EXIOptions +
Returns whether the namespaces are preserved in the EXI stream. +
getPreservePIs() - +Method in class org.openexi.proc.common.EXIOptions +
Returns whether processing instructions are conserved in the EXI Stream. +
getProperty(String) - +Method in class org.openexi.sax.EXIReader +
Use to retrieve the name of the lexical handler, currently the only + property recognized by this class. +
getRemainingBytesCount() - +Method in class org.openexi.proc.common.BinaryDataSource +
  +
getSAXTransmogrifier() - +Method in class org.openexi.sax.Transmogrifier +
Returns the SAXTransmogrifier, which implements both the ContentHandler + and LexicalHandler. +
getStartIndex() - +Method in class org.openexi.proc.common.BinaryDataSource +
  +
getURI() - +Method in interface org.openexi.proc.common.EventDescription +
Gets the URI of the EXI event. +
getValueMaxLength() - +Method in class org.openexi.proc.common.EXIOptions +
Returns the maximum length in characters of strings that will be included + in the String Table. +
getValuePartitionCapacity() - +Method in class org.openexi.proc.common.EXIOptions +
Returns the maximum number of entries in the String Table. +
GrammarCache - Class in org.openexi.proc.grammars
A GrammarCache object represents a set of EXI grammars used + for processing EXI streams using specific grammar options.
GrammarCache(EXISchema) - +Constructor for class org.openexi.proc.grammars.GrammarCache +
Creates an instance of GrammarCache informed by a schema with default + grammar options. +
GrammarCache(short) - +Constructor for class org.openexi.proc.grammars.GrammarCache +
Creates an instance of GrammarCache with the specified grammar options. +
GrammarCache(EXISchema, short) - +Constructor for class org.openexi.proc.grammars.GrammarCache +
Creates an instance of GrammarCache informed by a schema with the + specified grammar options. +
GrammarOptions - Class in org.openexi.proc.common
GrammarOptions computes a short integer that represents settings in the EXI Grammar settings + that determine how an EXI file will be encoded or decoded.
grammarOptions - +Variable in class org.openexi.proc.grammars.GrammarCache +
Short integer that encapsulates GrammarOptions + for the EXI stream. +
+
+

+H

+
+
hasCM(short) - +Static method in class org.openexi.proc.common.GrammarOptions +
Returns true if Preserve Comments is true. +
hasDTD(short) - +Static method in class org.openexi.proc.common.GrammarOptions +
Returns true if Preserve Document Type Definition is true. +
hashCode() - +Method in class org.openexi.schema.Characters +
  +
hasNext() - +Method in class org.openexi.proc.common.BinaryDataSource +
  +
hasNS(short) - +Static method in class org.openexi.proc.common.GrammarOptions +
Returns true if Preserve Namespaces is true. +
hasPI(short) - +Static method in class org.openexi.proc.common.GrammarOptions +
Returns true if Preserve Processing Instructions is true. +
HeaderOptionsOutputType - Enum in org.openexi.proc
This enumeration provides three possible settings for header options output.
+
+

+I

+
+
indexOf(char) - +Method in class org.openexi.schema.Characters +
  +
isFragment() - +Method in class org.openexi.proc.common.EXIOptions +
An XML fragment is a non-compliant XML document with multiple root + elements. +
isPermitDeviation(short) - +Static method in class org.openexi.proc.common.GrammarOptions +
Returns true if DEFAULT_OPTIONS is set to true. +
isSimpleType(int) - +Method in class org.openexi.schema.EXISchema +
  +
isStrict() - +Method in class org.openexi.proc.common.EXIOptions +
The Strict option applies to streams that have an associated XML Schema + and the data in the XML stream is 100% compliant with the schema. +
isVolatile - +Variable in class org.openexi.schema.Characters +
  +
ITEM_AT - +Static variable in class org.openexi.proc.common.EventType +
Event type for an Attribute learned by built-in element grammars + from prior attribute occurrences. +
ITEM_AT_WC_ANY_UNTYPED - +Static variable in class org.openexi.proc.common.EventType +
Wildcard event type for an Attribute where the attribute's defined + datatype (if any) is disregarded. +
ITEM_CH - +Static variable in class org.openexi.proc.common.EventType +
Event type for a Character event (character events store values as strings). +
ITEM_CM - +Static variable in class org.openexi.proc.common.EventType +
Event type for a Comment. +
ITEM_DTD - +Static variable in class org.openexi.proc.common.EventType +
Event type for a Document Type Definition. +
ITEM_ED - +Static variable in class org.openexi.proc.common.EventType +
Event type for End of Document. +
ITEM_EE - +Static variable in class org.openexi.proc.common.EventType +
Event type for End of Element. +
ITEM_ER - +Static variable in class org.openexi.proc.common.EventType +
Event type for an Entity Reference. +
ITEM_NS - +Static variable in class org.openexi.proc.common.EventType +
Event type for a Namespace declaration. +
ITEM_PI - +Static variable in class org.openexi.proc.common.EventType +
Event type for a Processing Instruction. +
ITEM_SC - +Static variable in class org.openexi.proc.common.EventType +
Self-contained items are not supported in this release of OpenEXI. +
ITEM_SCHEMA_AT - +Static variable in class org.openexi.proc.common.EventType +
Event type for AttributeUse that matches an attribute event with + a valid value. +
ITEM_SCHEMA_AT_INVALID_VALUE - +Static variable in class org.openexi.proc.common.EventType +
Event type for AttributeUse that matches an attribute event with an + invalid value. +
ITEM_SCHEMA_AT_WC_ANY - +Static variable in class org.openexi.proc.common.EventType +
Attribute wildcard event type stemming from a schema, where the attribute's + defined datatype (if any) is applied. +
ITEM_SCHEMA_AT_WC_NS - +Static variable in class org.openexi.proc.common.EventType +
Attribute wildcard event type, qualified with a specific namespace, stemming + from a schema where the attribute's defined datatype (if any) is applied. +
ITEM_SCHEMA_CH - +Static variable in class org.openexi.proc.common.EventType +
Event type for a defined Character event in an EXI stream processed + using a schema. +
ITEM_SCHEMA_CH_MIXED - +Static variable in class org.openexi.proc.common.EventType +
Event type for a Character event that occurs in the context of an element + defined so as to permit mixed content (mark up and data) in an EXI + stream processed using a schema. +
ITEM_SCHEMA_NIL - +Static variable in class org.openexi.proc.common.EventType +
Special Attribute that indicates the value of the associated element is + explicitly nil rather than an empty string. +
ITEM_SCHEMA_TYPE - +Static variable in class org.openexi.proc.common.EventType +
Special Attribute that describes a data type for the associated + element. +
ITEM_SCHEMA_WC_ANY - +Static variable in class org.openexi.proc.common.EventType +
Attribute wildcard event type stemming from a schema where the + attribute's defined datatype (if any) is applied. +
ITEM_SCHEMA_WC_NS - +Static variable in class org.openexi.proc.common.EventType +
Event type for an element defined in a namespace in an EXI stream + processed using a schema. +
ITEM_SD - +Static variable in class org.openexi.proc.common.EventType +
Event type for Start Document. +
ITEM_SE - +Static variable in class org.openexi.proc.common.EventType +
Event type for Start Element. +
ITEM_SE_WC - +Static variable in class org.openexi.proc.common.EventType +
Wildcard event type for an element. +
+
+

+L

+
+
length - +Variable in class org.openexi.schema.Characters +
  +
localName - +Variable in class org.openexi.proc.common.QName +
Local name of the datatype. +
+
+

+M

+
+
makeString() - +Method in class org.openexi.schema.Characters +
  +
+
+

+N

+
+
name - +Variable in class org.openexi.proc.common.EventType +
Local name of event type definition. +
namespaceName - +Variable in class org.openexi.proc.common.QName +
If namespaceName is null, this indicates a failure of + namespace-prefix binding. +
next() - +Method in class org.openexi.proc.common.BinaryDataSource +
  +
nextEvent() - +Method in class org.openexi.proc.io.Scanner +
Gets the next event from the EXI stream. +
+
+

+O

+
+
OPTIONS_UNUSED - +Static variable in class org.openexi.proc.common.GrammarOptions +
OPTIONS_UNUSED is an internal value. +
org.openexi.proc - package org.openexi.proc
+ + +The Proc (Processor) package contains the EXIDecoder, which is used to convert EXI streams to XML format.
org.openexi.proc.common - package org.openexi.proc.common
+ + +The common package contains classes, interfaces, and enumerators that define the vocabulary used to describe EXI streams (events, options, alignment, and character string values).
org.openexi.proc.grammars - package org.openexi.proc.grammars
+ + +The grammars package contains the GrammarCache, which combines an XML Schema Definition with EXI grammar options to create an EXI Schema.
org.openexi.proc.io - package org.openexi.proc.io
+ + +The IO package contains the Scanner, which is used by EXIDecoder to read and interpret EXI streams.
org.openexi.sax - package org.openexi.sax
+ + +The SAX package contains the Transmogrifier, which encodes an XML file to an EXI stream, and the EXIReader, which restores an EXI stream to its logical XML equivalent.
org.openexi.schema - package org.openexi.schema
+ + +The schema package contains classes that are used to represent XML Schema Documents (XSDs).
org.openexi.scomp - package org.openexi.scomp
+ + +The scomp (schema compiler) package contains the EXISchemaFactory, which is used to compile XML Schema Documents (XSDs) to EXISchemas.
+
+

+P

+
+
parse(InputStream) - +Method in class org.openexi.scomp.EXISchemaReader +
Parses EXI-encoded EXI Grammar into an EXISchema. +
PREFIX_BOUND_TO_ANOTHER_NAMESPACE - +Static variable in exception org.openexi.sax.TransmogrifierException +
Prefix is bound to another namespace. +
PREFIX_NOT_BOUND - +Static variable in exception org.openexi.sax.TransmogrifierException +
Prefix is not bound. +
processHeader() - +Method in class org.openexi.proc.EXIDecoder +
This method reads and configures any header options present + in the EXI stream, then returns a Scanner + object you can use to parse the values from the EXI stream. +
+
+

+Q

+
+
QName - Class in org.openexi.proc.common
QName is a pair comprised of a namespace name and a local name + to be used in a Datatype Representation Map (DTRM) definition + to denote an XSD datatype or an EXI datatype representation.
QName() - +Constructor for class org.openexi.proc.common.QName +
  +
QName(String, String) - +Constructor for class org.openexi.proc.common.QName +
Creates a QName based on its literal qualified name + (see http://www.w3.org/TR/xml-names/#ns-qualnames + for definition) and namespace name. +
+
+

+R

+
+
ReaderSupport - Class in org.openexi.sax
 
readIn(DataInputStream) - +Static method in class org.openexi.schema.EXISchema +
Reads an EXI Schema from a DataInputStream. +
resolveEntity(String, String, String) - +Method in interface org.openexi.scomp.EntityResolverEx +
This method will be called for resolving schema documents upon + occurrences of XML Schema directives such as "include", "import" and + "redefine" within schemas. +
resolveSchema(String, short) - +Method in interface org.openexi.proc.EXISchemaResolver +
Return a GrammarCache based on a schemaId and grammar options discovered + in the header options of an EXI stream. +
+
+

+S

+
+
SAX_ERROR - +Static variable in exception org.openexi.sax.TransmogrifierException +
SAX error reported by XML parser. +
SAXTransmogrifier - Interface in org.openexi.sax
Applications can directly feed SAX events into a transmogrifier through SAXTransmogrifier.
Scanner - Class in org.openexi.proc.io
The Scanner class provides methods for scanning events + in the body of an EXI stream.
SCRIBER_ERROR - +Static variable in exception org.openexi.sax.TransmogrifierException +
Errors reported by Scriber. +
setAlignmentType(AlignmentType) - +Method in class org.openexi.proc.EXIDecoder +
Set the bit alignment style of the stream to be decoded. +
setAlignmentType(AlignmentType) - +Method in class org.openexi.sax.EXIReader +
Set the bit alignment style used to compile the EXI input stream. +
setAlignmentType(AlignmentType) - +Method in class org.openexi.sax.Transmogrifier +
Set the bit alignment style for the encoded EXI stream. +
setBinaryChunkSize(int) - +Method in class org.openexi.proc.io.Scanner +
Binary values are read in chunks of the specified size when the + use of binary data is enabled. +
setBlockSize(int) - +Method in class org.openexi.proc.EXIDecoder +
Set the size, in number of values, of the information that will be + processed as a chunk of the entire EXI stream. +
setBlockSize(int) - +Method in class org.openexi.sax.EXIReader +
Set the size, in number of values, of the information that will be + processed as a chunk of the entire EXI stream. +
setBlockSize(int) - +Method in class org.openexi.sax.Transmogrifier +
Set the size, in number of values, of the information that will be + processed as a chunk of the entire XML stream. +
setCompilerErrorHandler(EXISchemaFactoryErrorHandler) - +Method in class org.openexi.scomp.EXISchemaFactory +
Set an error handler to report any errors encountered during + schema compilation. +
setContentHandler(ContentHandler) - +Method in class org.openexi.sax.ReaderSupport +
Set a SAX content handler to receive SAX events. +
setDatatypeRepresentationMap(QName[], int) - +Method in class org.openexi.proc.EXIDecoder +
Set a datatype representation map (DTRM). +
setDatatypeRepresentationMap(QName[], int) - +Method in class org.openexi.sax.EXIReader +
Set a datatype representation map. +
setDatatypeRepresentationMap(QName[], int) - +Method in class org.openexi.sax.Transmogrifier +
Set a datatype representation map (DTRM). +
setEnableBinaryData(boolean) - +Method in class org.openexi.proc.EXIDecoder +
Each binary value will be returned as in a EventDescription of EVENT_BLOB + instead of EVENT_CH when enabled. +
setEntityResolver(EntityResolver) - +Method in class org.openexi.sax.Transmogrifier +
Set an external SAX entity resolver. +
setEntityResolver(EntityResolverEx) - +Method in class org.openexi.scomp.EXISchemaFactory +
Set an entity resolver for use to resolve entities and schema documents. +
setEXISchemaResolver(EXISchemaResolver) - +Method in class org.openexi.sax.EXIReader +
Set the EXISchemaResolver to retrieve the schema needed to decode the + current EXI stream. +
setFeature(String, boolean) - +Method in class org.openexi.sax.EXIReader +
Set features for the SAX parser. +
setFragment(boolean) - +Method in class org.openexi.proc.EXIDecoder +
Set whether the document is a fragment. +
setFragment(boolean) - +Method in class org.openexi.sax.EXIReader +
Set to true if the EXI input stream is an XML fragment (a non-compliant + XML document with multiple root elements). +
setFragment(boolean) - +Method in class org.openexi.sax.Transmogrifier +
Set to true if the XML input stream is an XML fragment (a non-compliant + XML document with multiple root elements). +
setGrammarCache(GrammarCache) - +Method in class org.openexi.proc.EXIDecoder +
Set the GrammarCache used in decoding EXI streams. +
setGrammarCache(GrammarCache) - +Method in class org.openexi.sax.ReaderSupport +
Set the GrammarCache used in parsing EXI streams. +
setGrammarCache(GrammarCache) - +Method in class org.openexi.sax.Transmogrifier +
Set the GrammarCache used in transmogrifying XML data to EXI. +
setGrammarCache(GrammarCache, SchemaId) - +Method in class org.openexi.sax.Transmogrifier +
Set the GrammarCache to be used in encoding XML streams into EXI streams + by the transmogrifier. +
setInitialBinaryDataBufferSize(int) - +Method in class org.openexi.proc.EXIDecoder +
  +
setInputStream(InputStream) - +Method in class org.openexi.proc.EXIDecoder +
Set an input stream from which the encoded stream is read. +
setLexicalHandler(LexicalHandler) - +Method in class org.openexi.sax.EXIReader +
Set a SAX lexical handler to receive SAX lexical events. +
setOutputCookie(boolean) - +Method in class org.openexi.sax.Transmogrifier +
Tells the encoder whether to or not to start the stream by + adding an EXI cookie. +
setOutputOptions(HeaderOptionsOutputType) - +Method in class org.openexi.sax.Transmogrifier +
Set the header output options. +
setOutputStream(OutputStream) - +Method in class org.openexi.sax.Transmogrifier +
Set an output stream to which encoded streams are written. +
setPreserveLexicalValues(boolean) - +Method in class org.openexi.proc.EXIDecoder +
Set to true to preserve the original string values from the EXI + stream. +
setPreserveLexicalValues(boolean) - +Method in class org.openexi.sax.EXIReader +
Set to true if the EXI input stream was compiled with the Preserve Lexical + Values set to true. +
setPreserveLexicalValues(boolean) - +Method in class org.openexi.sax.Transmogrifier +
Set to true to preserve the original string values from the XML + stream. +
setPreserveWhitespaces(boolean) - +Method in class org.openexi.sax.Transmogrifier +
Set to true to preserve whitespace (for example, spaces, tabs, and + line breaks) in the encoded EXI stream. +
setProperty(String, Object) - +Method in class org.openexi.sax.EXIReader +
This method wraps the friendlier setLexicalHandler method to provide + syntax familiar to experienced SAX programmers. +
setResolveExternalGeneralEntities(boolean) - +Method in class org.openexi.sax.Transmogrifier +
Change the way a Transmogrifier handles external general entities. +
setSchema(EXISchema, QName[], int) - +Method in class org.openexi.proc.io.Scanner +
  +
setValueMaxLength(int) - +Method in class org.openexi.proc.EXIDecoder +
Set the maximum length of a string that will be stored for reuse in the + String Table. +
setValueMaxLength(int) - +Method in class org.openexi.sax.EXIReader +
Set the maximum length of a string that will be stored for reuse in the + String Table. +
setValueMaxLength(int) - +Method in class org.openexi.sax.Transmogrifier +
Set the maximum length of a string that will be stored for reuse in the + String Table. +
setValuePartitionCapacity(int) - +Method in class org.openexi.proc.EXIDecoder +
Set the maximum number of values in the String Table. +
setValuePartitionCapacity(int) - +Method in class org.openexi.sax.EXIReader +
Set the maximum number of values in the String Table. +
setValuePartitionCapacity(int) - +Method in class org.openexi.sax.Transmogrifier +
Set the maximum number of values in the String Table. +
startBinaryData(long) - +Method in interface org.openexi.sax.BinaryDataHandler +
Mark the start of a binary value. +
startIndex - +Variable in class org.openexi.schema.Characters +
  +
STRICT_OPTIONS - +Static variable in class org.openexi.proc.common.GrammarOptions +
Indicates that undeclared elements and attributes will throw an + exception when the XML stream is encoded and decoded. +
substring(int, int) - +Method in class org.openexi.schema.Characters +
  +
+
+

+T

+
+
Transmogrifier - Class in org.openexi.sax
The Transmogrifier converts an XML stream to an EXI stream.
Transmogrifier() - +Constructor for class org.openexi.sax.Transmogrifier +
Create an instance of the Transmogrifier with a default SAX parser. +
Transmogrifier(SAXParserFactory) - +Constructor for class org.openexi.sax.Transmogrifier +
Create an instance of the Transmogrifier, specifying the SAXParserFactory + from which to create the SAX parser. +
TransmogrifierException - Exception in org.openexi.sax
Exception handler for the Transmogrifier.
turnPermanent() - +Method in class org.openexi.schema.Characters +
  +
+
+

+U

+
+
ucsCount - +Variable in class org.openexi.schema.Characters +
  +
UNEXPECTED_ATTR - +Static variable in exception org.openexi.sax.TransmogrifierException +
Unexpected Attribute. +
UNEXPECTED_BINARY_VALUE - +Static variable in exception org.openexi.sax.TransmogrifierException +
Unexpected Binary value. +
UNEXPECTED_CHARS - +Static variable in exception org.openexi.sax.TransmogrifierException +
Unexpected Character Sequence. +
UNEXPECTED_ED - +Static variable in exception org.openexi.sax.TransmogrifierException +
Unexpected End of Document event. +
UNEXPECTED_ELEM - +Static variable in exception org.openexi.sax.TransmogrifierException +
Unexpected Element. +
UNEXPECTED_END_ELEM - +Static variable in exception org.openexi.sax.TransmogrifierException +
Unexpected End of Element event. +
UNEXPECTED_SD - +Static variable in exception org.openexi.sax.TransmogrifierException +
Unexpected Start of Document event. +
UNHANDLED_SAXPARSER_FEATURE - +Static variable in exception org.openexi.sax.TransmogrifierException +
Unhandled SAX parser feature. +
uri - +Variable in class org.openexi.proc.common.EventType +
URI of event type definition. +
+
+

+V

+
+
valueOf(String) - +Static method in enum org.openexi.proc.common.AlignmentType +
Returns the enum constant of this type with the specified name. +
valueOf(String) - +Static method in enum org.openexi.proc.HeaderOptionsOutputType +
Returns the enum constant of this type with the specified name. +
values() - +Static method in enum org.openexi.proc.common.AlignmentType +
Returns an array containing the constants of this enum type, in +the order they're declared. +
values() - +Static method in enum org.openexi.proc.HeaderOptionsOutputType +
Returns an array containing the constants of this enum type, in +the order they're declared. +
+
+

+W

+
+
warning(EXISchemaFactoryException) - +Method in interface org.openexi.scomp.EXISchemaFactoryErrorHandler +
Report a warning found during schema processing. +
writeOut(DataOutputStream) - +Method in class org.openexi.schema.EXISchema +
Writes out a serialized EXISchema. +
writeXml(OutputStream, boolean) - +Method in class org.openexi.schema.EXISchema +
  +
+
+

+X

+
+
XMLSCHEMA_ERROR - +Static variable in exception org.openexi.scomp.EXISchemaFactoryException +
The underlying XMLSchema parser found an error in the schema. +
+
+

+_

+
+
_isSimpleType(int, int[]) - +Static method in class org.openexi.schema.EXISchema +
  +
+
+A B C D E F G H I L M N O P Q R S T U V W X _ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/index.html b/third-party/org.openexi/nagasena/src/main/resources/doc/index.html new file mode 100644 index 0000000000..f8c172cd85 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/index.html @@ -0,0 +1,40 @@ + + + + + + + +Generated Documentation (Untitled) + + + + + + + + + + + +<H2> +Frame Alert</H2> + +<P> +This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +<BR> +Link to<A HREF="overview-summary.html">Non-frame version.</A> + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/EXIDecoder.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/EXIDecoder.html new file mode 100644 index 0000000000..15bd150a78 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/EXIDecoder.html @@ -0,0 +1,580 @@ + + + + + + + +EXIDecoder + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.proc +
+Class EXIDecoder

+
+java.lang.Object
+  extended by org.openexi.proc.EXIDecoder
+
+
+
+
public class EXIDecoder
extends java.lang.Object
+ + +

+EXIDecoder provides methods to configure and + instantiate a Scanner object + you can use to parse the contents of an EXI stream. +

+ +

+

+ +
+
+ +

+ + + + + + + + + + + + + + +
+Constructor Summary
EXIDecoder() + +
+          Creates an instance of EXIDecoder with the default inflator + buffer size of 8192 bytes.
EXIDecoder(int inflatorBufSize, + boolean useThreadedInflater) + +
+          Creates an instance of EXIDecoder with the specified inflator buffer + size.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ ScannerprocessHeader() + +
+          This method reads and configures any header options present + in the EXI stream, then returns a Scanner + object you can use to parse the values from the EXI stream.
+ voidsetAlignmentType(AlignmentType alignmentType) + +
+          Set the bit alignment style of the stream to be decoded.
+ voidsetBlockSize(int blockSize) + +
+          Set the size, in number of values, of the information that will be + processed as a chunk of the entire EXI stream.
+ voidsetDatatypeRepresentationMap(QName[] dtrm, + int n_bindings) + +
+          Set a datatype representation map (DTRM).
+ voidsetEnableBinaryData(boolean enable) + +
+          Each binary value will be returned as in a EventDescription of EVENT_BLOB + instead of EVENT_CH when enabled.
+ voidsetFragment(boolean isFragment) + +
+          Set whether the document is a fragment.
+ voidsetGrammarCache(GrammarCache grammarCache) + +
+          Set the GrammarCache used in decoding EXI streams.
+ voidsetInitialBinaryDataBufferSize(int initialSize) + +
+           
+ voidsetInputStream(java.io.InputStream istream) + +
+          Set an input stream from which the encoded stream is read.
+ voidsetPreserveLexicalValues(boolean preserveLexicalValues) + +
+          Set to true to preserve the original string values from the EXI + stream.
+ voidsetValueMaxLength(int valueMaxLength) + +
+          Set the maximum length of a string that will be stored for reuse in the + String Table.
+ voidsetValuePartitionCapacity(int valuePartitionCapacity) + +
+          Set the maximum number of values in the String Table.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+EXIDecoder

+
+public EXIDecoder()
+
+
Creates an instance of EXIDecoder with the default inflator + buffer size of 8192 bytes. Buffer size is only used when + the EXI stream is encoded with EXI compression. +

+

+
+ +

+EXIDecoder

+
+public EXIDecoder(int inflatorBufSize,
+                  boolean useThreadedInflater)
+
+
Creates an instance of EXIDecoder with the specified inflator buffer + size. When dynamic memory is limited on the target device, reducing + the buffer size can improve performance and avoid runtime errors. Buffer + size is only used when the EXI stream is encoded with EXI compression. +

+

+
Parameters:
inflatorBufSize - size of the buffer, in bytes.
useThreadedInflater - Inflater will be run in its own thread if true
+
+ + + + + + + + +
+Method Detail
+ +

+setInputStream

+
+public final void setInputStream(java.io.InputStream istream)
+
+
Set an input stream from which the encoded stream is read. +

+

+
Parameters:
istream - InputSream to be read.
+
+
+
+ +

+setAlignmentType

+
+public final void setAlignmentType(AlignmentType alignmentType)
+                            throws org.openexi.proc.common.EXIOptionsException
+
+
Set the bit alignment style of the stream to be decoded. +

+

+
Parameters:
alignmentType - AlignmentType object +
Throws: +
org.openexi.proc.common.EXIOptionsException
+
+
+
+ +

+setFragment

+
+public final void setFragment(boolean isFragment)
+
+
Set whether the document is a fragment. Fragments are nonstandard + XML documents with multiple root elements. Default is false. +

+

+
Parameters:
isFragment - true if the stream is an XML fragment
+
+
+
+ +

+setGrammarCache

+
+public final void setGrammarCache(GrammarCache grammarCache)
+                           throws org.openexi.proc.common.EXIOptionsException
+
+
Set the GrammarCache used in decoding EXI streams. +

+

+
Parameters:
grammarCache - GrammarCache +
Throws: +
org.openexi.proc.common.EXIOptionsException
+
+
+
+ +

+setBlockSize

+
+public final void setBlockSize(int blockSize)
+                        throws org.openexi.proc.common.EXIOptionsException
+
+
Set the size, in number of values, of the information that will be + processed as a chunk of the entire EXI stream. Reducing the block size + can improve performance for devices with limited dynamic memory. + Default is 1,000,000 items (not 1MB, but 1,000,000 complete Attribute + and Element values). Block size is only used when the EXI stream is + encoded with EXI-compression. +

+

+
Parameters:
blockSize - number of values in each processing block. Default is 1,000,000. +
Throws: +
org.openexi.proc.common.EXIOptionsException
+
+
+
+ +

+setValueMaxLength

+
+public final void setValueMaxLength(int valueMaxLength)
+
+
Set the maximum length of a string that will be stored for reuse in the + String Table. By default, there is no maximum length. However, in data + sets that have long, unique strings of information, you can improve + performance by limiting the size to the length of strings that are more + likely to appear more than once. +

+

+
Parameters:
valueMaxLength - maximum length of entries in the String Table.
+
+
+
+ +

+setValuePartitionCapacity

+
+public final void setValuePartitionCapacity(int valuePartitionCapacity)
+
+
Set the maximum number of values in the String Table. By default, there + is no limit. If the target device has limited dynamic memory, limiting + the number of entries in the String Table can improve performance and + reduce the likelihood that you will exceed memory capacity. +

+

+
Parameters:
valuePartitionCapacity - maximum number of entries in the String Table
+
+
+
+ +

+setPreserveLexicalValues

+
+public final void setPreserveLexicalValues(boolean preserveLexicalValues)
+                                    throws org.openexi.proc.common.EXIOptionsException
+
+
Set to true to preserve the original string values from the EXI + stream. For example, a date string might be converted to a different + format when interpreted by the EXIDecoder. Preserving the lexical values + ensures that the identical strings are restored, and not just their + logical values. +

+

+
Parameters:
preserveLexicalValues - true to keep original strings intact +
Throws: +
org.openexi.proc.common.EXIOptionsException
+
+
+
+ +

+setDatatypeRepresentationMap

+
+public final void setDatatypeRepresentationMap(QName[] dtrm,
+                                               int n_bindings)
+                                        throws org.openexi.proc.common.EXIOptionsException
+
+
Set a datatype representation map (DTRM). The DTRM allows you to remap + XMLSchema datatypes to EXI datatypes other than their default equivalents. + The map is created using a sequence of Qualified Name pairs that identify + a datatype definition in the XMLSchema namespace followed by the new + corresponding datatype mapping in the EXI namespace. +

+ For example, the following lines map the boolean datatype from XMLSchema + to the integer datatype in EXI. +
+   QName q1 = new QName("xsd:boolean","http://www.w3.org/2001/XMLSchema");
+   QName q2 = new QName("exi:integer","http://www.w3.org/2009/exi");
+   QName[] dtrm = new QName[2];
+   dtrm = {q1, q2}; // Each mapping requires 2 qualified names.
+   decoderInstance.setDatatypeRepresentationMap(dtrm, 1); // The array, and the number of pairs (1).
+ 
+

+

+
Parameters:
dtrm - a sequence of pairs of datatype QName and datatype representation QName
n_bindings - the number of QName pairs +
Throws: +
org.openexi.proc.common.EXIOptionsException
+
+
+
+ +

+setEnableBinaryData

+
+public final void setEnableBinaryData(boolean enable)
+
+
Each binary value will be returned as in a EventDescription of EVENT_BLOB + instead of EVENT_CH when enabled. +

+

+
Parameters:
enable -
+
+
+
+ +

+setInitialBinaryDataBufferSize

+
+public final void setInitialBinaryDataBufferSize(int initialSize)
+
+
+
+
+
+
+ +

+processHeader

+
+public Scanner processHeader()
+                      throws java.io.IOException,
+                             org.openexi.proc.common.EXIOptionsException
+
+
This method reads and configures any header options present + in the EXI stream, then returns a Scanner + object you can use to parse the values from the EXI stream. +

+

+ +
Returns:
Scanner parsable object with header options applied. +
Throws: +
java.io.IOException +
org.openexi.proc.common.EXIOptionsException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/EXISchemaResolver.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/EXISchemaResolver.html new file mode 100644 index 0000000000..7c90b7d5fb --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/EXISchemaResolver.html @@ -0,0 +1,218 @@ + + + + + + + +EXISchemaResolver + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.proc +
+Interface EXISchemaResolver

+
+
+
public interface EXISchemaResolver
+ + +

+Developers have the option of implementing the EXISchemaResolver interface + to help EXIReader and EXIDecoder locate the correct grammar cache for parsing + an EXI stream. +

+ +

+

+ +
+
+ +

+ + + + + + + + + + + + +
+Method Summary
+ GrammarCacheresolveSchema(java.lang.String schemaId, + short grammarOptions) + +
+          Return a GrammarCache based on a schemaId and grammar options discovered + in the header options of an EXI stream.
+  +

+ + + + + + + + +
+Method Detail
+ +

+resolveSchema

+
+GrammarCache resolveSchema(java.lang.String schemaId,
+                           short grammarOptions)
+
+
Return a GrammarCache based on a schemaId and grammar options discovered + in the header options of an EXI stream. +

+

+
Parameters:
schemaId - the specific schema used to decode an EXI stream
grammarOptions - the specific grammar options used to decode an EXI stream +
Returns:
a GrammarCache object
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/HeaderOptionsOutputType.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/HeaderOptionsOutputType.html new file mode 100644 index 0000000000..db42f8f040 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/HeaderOptionsOutputType.html @@ -0,0 +1,357 @@ + + + + + + + +HeaderOptionsOutputType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.proc +
+Enum HeaderOptionsOutputType

+
+java.lang.Object
+  extended by java.lang.Enum<HeaderOptionsOutputType>
+      extended by org.openexi.proc.HeaderOptionsOutputType
+
+
+
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<HeaderOptionsOutputType>
+
+
+
+
public enum HeaderOptionsOutputType
extends java.lang.Enum<HeaderOptionsOutputType>
+ + +

+This enumeration provides three possible settings for header options output. +

+

    +
  • none – Header options are not included in the header. + The receiver of the document must have precise knowledge of the + settings used to encode the document.

    +
  • +
  • + lessSchemaId – Header options are present. Every + setting used is written out in the header options, except SchemaID. + The receiver of the document must know which schema is used to + encode the document.

    +
  • +
  • + all – All header options are present. Every setting + used is written to the header options, including SchemaID. +
  • +
+

+ +

+

+ +
+
+ +

+ + + + + + + + + + + + + + + + +
+Enum Constant Summary
all + +
+           
lessSchemaId + +
+           
none + +
+           
+  + + + + + + + + + + + + + + + +
+Method Summary
+static HeaderOptionsOutputTypevalueOf(java.lang.String name) + +
+          Returns the enum constant of this type with the specified name.
+static HeaderOptionsOutputType[]values() + +
+          Returns an array containing the constants of this enum type, in +the order they're declared.
+ + + + + + + +
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
+ + + + + + + +
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + +
+Enum Constant Detail
+ +

+none

+
+public static final HeaderOptionsOutputType none
+
+
+
+
+
+ +

+lessSchemaId

+
+public static final HeaderOptionsOutputType lessSchemaId
+
+
+
+
+
+ +

+all

+
+public static final HeaderOptionsOutputType all
+
+
+
+
+ + + + + + + + +
+Method Detail
+ +

+values

+
+public static final HeaderOptionsOutputType[] values()
+
+
Returns an array containing the constants of this enum type, in +the order they're declared. This method may be used to iterate +over the constants as follows: +
+for(HeaderOptionsOutputType c : HeaderOptionsOutputType.values())
+        System.out.println(c);
+
+

+

+ +
Returns:
an array containing the constants of this enum type, in +the order they're declared
+
+
+
+ +

+valueOf

+
+public static HeaderOptionsOutputType valueOf(java.lang.String name)
+
+
Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.) +

+

+
Parameters:
name - the name of the enum constant to be returned. +
Returns:
the enum constant with the specified name +
Throws: +
java.lang.IllegalArgumentException - if this enum type has no constant +with the specified name
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/AlignmentType.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/AlignmentType.html new file mode 100644 index 0000000000..cd6ca90e7d --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/AlignmentType.html @@ -0,0 +1,379 @@ + + + + + + + +AlignmentType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.proc.common +
+Enum AlignmentType

+
+java.lang.Object
+  extended by java.lang.Enum<AlignmentType>
+      extended by org.openexi.proc.common.AlignmentType
+
+
+
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<AlignmentType>
+
+
+
+
public enum AlignmentType
extends java.lang.Enum<AlignmentType>
+ + +

+AlignmentType represents one of the following bit alignment + styles so as to provide an extra degree of control over the + way information is stored in EXI format. +
+

  • bitPacked is the default setting. Data are + stored in the fewest number of bits in sequential streams + that cross byte barriers. Conceptually, 8 boolean values + might be stored in a single byte, for example.

  • +
  • byteAligned stores data using EXI tags with + byte barriers intact. Byte-aligned files are useful for + troubleshooting, because the data are often human-readable + when the values are literally encoded as strings. It + is not meant for data transfer, as the file has not been + optimized.

  • +
  • preCompress is a byte-aligned format that arranges + the data into channels. It is intended for use cases where + file compression is part of the transfer process, so as + not to perform the compression step twice.

  • +
  • compress is not a bit alignment in and of itself, + but the Deflate algorithm requires that files be byte-aligned. + When compression is selected, byte-alignment is used, the + data are arranged in channels, and the file is compressed + at the end of processing.
  • +
+

+ +

+

+ +
+
+ +

+ + + + + + + + + + + + + + + + + + + +
+Enum Constant Summary
bitPacked + +
+           
byteAligned + +
+           
compress + +
+           
preCompress + +
+           
+  + + + + + + + + + + + + + + + +
+Method Summary
+static AlignmentTypevalueOf(java.lang.String name) + +
+          Returns the enum constant of this type with the specified name.
+static AlignmentType[]values() + +
+          Returns an array containing the constants of this enum type, in +the order they're declared.
+ + + + + + + +
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
+ + + + + + + +
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + +
+Enum Constant Detail
+ +

+bitPacked

+
+public static final AlignmentType bitPacked
+
+
+
+
+
+ +

+byteAligned

+
+public static final AlignmentType byteAligned
+
+
+
+
+
+ +

+preCompress

+
+public static final AlignmentType preCompress
+
+
+
+
+
+ +

+compress

+
+public static final AlignmentType compress
+
+
+
+
+ + + + + + + + +
+Method Detail
+ +

+values

+
+public static final AlignmentType[] values()
+
+
Returns an array containing the constants of this enum type, in +the order they're declared. This method may be used to iterate +over the constants as follows: +
+for(AlignmentType c : AlignmentType.values())
+        System.out.println(c);
+
+

+

+ +
Returns:
an array containing the constants of this enum type, in +the order they're declared
+
+
+
+ +

+valueOf

+
+public static AlignmentType valueOf(java.lang.String name)
+
+
Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.) +

+

+
Parameters:
name - the name of the enum constant to be returned. +
Returns:
the enum constant with the specified name +
Throws: +
java.lang.IllegalArgumentException - if this enum type has no constant +with the specified name
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/BinaryDataSource.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/BinaryDataSource.html new file mode 100644 index 0000000000..27a32a0db3 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/BinaryDataSource.html @@ -0,0 +1,349 @@ + + + + + + + +BinaryDataSource + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.proc.common +
+Class BinaryDataSource

+
+java.lang.Object
+  extended by org.openexi.proc.common.BinaryDataSource
+
+
+
+
public final class BinaryDataSource
extends java.lang.Object
+ + +

+

+ +
+
+ +

+ + + + + + + + + + + +
+Constructor Summary
BinaryDataSource() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ byte[]getByteArray() + +
+           
+ intgetLength() + +
+           
+ longgetRemainingBytesCount() + +
+           
+ intgetStartIndex() + +
+           
+ booleanhasNext() + +
+           
+ intnext() + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+BinaryDataSource

+
+public BinaryDataSource()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getByteArray

+
+public final byte[] getByteArray()
+
+
+
+
+
+
+ +

+getStartIndex

+
+public final int getStartIndex()
+
+
+
+
+
+
+ +

+getLength

+
+public final int getLength()
+
+
+
+
+
+
+ +

+getRemainingBytesCount

+
+public final long getRemainingBytesCount()
+
+
+
+
+
+
+ +

+hasNext

+
+public boolean hasNext()
+
+
+
+
+
+
+ +

+next

+
+public int next()
+         throws java.io.IOException
+
+
+ +
Throws: +
java.io.IOException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EXIOptions.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EXIOptions.html new file mode 100644 index 0000000000..27d78e0a99 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EXIOptions.html @@ -0,0 +1,502 @@ + + + + + + + +EXIOptions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.proc.common +
+Class EXIOptions

+
+java.lang.Object
+  extended by org.openexi.proc.common.EXIOptions
+
+
+
+
public final class EXIOptions
extends java.lang.Object
+ + +

+EXIOptions provides accessors for values associated with + EXI options in the EXI header of an EXI stream. +

+ +

+

+ +
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ AlignmentTypegetAlignmentType() + +
+          Get the bit alignment setting.
+ intgetBlockSize() + +
+          Returns the number of element and attribute values that are read and processed + as a group.
+ QName[]getDatatypeRepresentationMap() + +
+          Returns an array of qualified names that map XMLSchema datatypes to + non-standard equivalents in EXI.
+ intgetDatatypeRepresentationMapBindingsCount() + +
+          Returns the number of Datatype Representation Map QName pairs.
+ booleangetPreserveComments() + +
+          Returns whether comments are conserved in the EXI Stream.
+ booleangetPreserveDTD() + +
+          Returns whether the document type definition is conserved in the EXI Stream.
+ booleangetPreserveLexicalValues() + +
+          Returns whether lexical values (literal strings) are preserved rather + than the logical values of elements and attributes.
+ booleangetPreserveNS() + +
+          Returns whether the namespaces are preserved in the EXI stream.
+ booleangetPreservePIs() + +
+          Returns whether processing instructions are conserved in the EXI Stream.
+ intgetValueMaxLength() + +
+          Returns the maximum length in characters of strings that will be included + in the String Table.
+ intgetValuePartitionCapacity() + +
+          Returns the maximum number of entries in the String Table.
+ booleanisFragment() + +
+          An XML fragment is a non-compliant XML document with multiple root + elements.
+ booleanisStrict() + +
+          The Strict option applies to streams that have an associated XML Schema + and the data in the XML stream is 100% compliant with the schema.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Method Detail
+ +

+getAlignmentType

+
+public AlignmentType getAlignmentType()
+
+
Get the bit alignment setting. +

+

+ +
Returns:
AlignmentType
+
+
+
+ +

+isFragment

+
+public boolean isFragment()
+
+
An XML fragment is a non-compliant XML document with multiple root + elements. +

+

+ +
Returns:
true if the stream is an XML fragment.
+
+
+
+ +

+isStrict

+
+public boolean isStrict()
+
+
The Strict option applies to streams that have an associated XML Schema + and the data in the XML stream is 100% compliant with the schema. +

+

+ +
Returns:
true if using strict interpretation of an associated XML Schema.
+
+
+
+ +

+getPreserveComments

+
+public boolean getPreserveComments()
+
+
Returns whether comments are conserved in the EXI Stream. +

+

+ +
Returns:
true if comments are preserved.
+
+
+
+ +

+getPreservePIs

+
+public boolean getPreservePIs()
+
+
Returns whether processing instructions are conserved in the EXI Stream. +

+

+ +
Returns:
true if processing instructions are preserved.
+
+
+
+ +

+getPreserveDTD

+
+public boolean getPreserveDTD()
+
+
Returns whether the document type definition is conserved in the EXI Stream. +

+

+ +
Returns:
true if the document type definition is preserved.
+
+
+
+ +

+getPreserveNS

+
+public boolean getPreserveNS()
+
+
Returns whether the namespaces are preserved in the EXI stream. +

+

+ +
Returns:
true if namespaces are preserved.
+
+
+
+ +

+getBlockSize

+
+public int getBlockSize()
+
+
Returns the number of element and attribute values that are read and processed + as a group. +

+

+ +
Returns:
the current block size. Default is 1,000,000.
+
+
+
+ +

+getValueMaxLength

+
+public int getValueMaxLength()
+
+
Returns the maximum length in characters of strings that will be included + in the String Table. +

+

+ +
Returns:
the maximum length of values added to the String Table. Default is unbounded (-1).
+
+
+
+ +

+getValuePartitionCapacity

+
+public int getValuePartitionCapacity()
+
+
Returns the maximum number of entries in the String Table. +

+

+ +
Returns:
the maximum number of partitions (entries) in the String Table. Default is unbounded (-1).
+
+
+
+ +

+getPreserveLexicalValues

+
+public boolean getPreserveLexicalValues()
+
+
Returns whether lexical values (literal strings) are preserved rather + than the logical values of elements and attributes. +

+

+ +
Returns:
true if lexical values are preserved.
+
+
+
+ +

+getDatatypeRepresentationMapBindingsCount

+
+public int getDatatypeRepresentationMapBindingsCount()
+
+
Returns the number of Datatype Representation Map QName pairs. +

+

+ +
Returns:
the number of DTRM bindings.
+
+
+
+ +

+getDatatypeRepresentationMap

+
+public QName[] getDatatypeRepresentationMap()
+
+
Returns an array of qualified names that map XMLSchema datatypes to + non-standard equivalents in EXI. +

+

+ +
Returns:
an array of qualified names comprising a DTRM.
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EventDescription.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EventDescription.html new file mode 100644 index 0000000000..396802fbc6 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EventDescription.html @@ -0,0 +1,653 @@ + + + + + + + +EventDescription + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.proc.common +
+Interface EventDescription

+
+
All Known Implementing Classes:
EventType
+
+
+
+
public interface EventDescription
+ + +

+

EventDescription provides accessors to the current EXI event data + during the decode process.

+ +

Note that the content of EventDescription is transient, which means + its content may change when the decoder is asked for access to the + next EXI event data.

+

+ +

+

+ +
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+static byteEVENT_AT + +
+          Attribute event.
+static byteEVENT_BLOB + +
+          BLOB event (content of an element).
+static byteEVENT_CH + +
+          Character event (content of an element).
+static byteEVENT_CM + +
+          Comment event.
+static byteEVENT_DTD + +
+          Document Type Definition event.
+static byteEVENT_ED + +
+          End Document event.
+static byteEVENT_EE + +
+          End Element event.
+static byteEVENT_ER + +
+          Entity Reference event.
+static byteEVENT_NL + +
+          Attribute xsi:nil.
+static byteEVENT_NS + +
+          Namespace declaration event.
+static byteEVENT_PI + +
+          Processing Instruction event.
+static byteEVENT_SD + +
+          Start Document event.
+static byteEVENT_SE + +
+          Start Element event.
+static byteEVENT_TP + +
+          Attribute xsi:type.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ BinaryDataSourcegetBinaryDataSource() + +
+          Gets the value of an EVENT_BLOB.
+ CharactersgetCharacters() + +
+          Gets the value of an EVENT_CH, + Attribute (EVENT_AT, EVENT_NL, EVENT_TP), EVENT_CM, + EVENT_DTD or EVENT_PI event.
+ bytegetEventKind() + +
+          Gets the event kind of which instance data this EventDescription is describing.
+ EventTypegetEventType() + +
+          Returns the EventType from which this event is derived.
+ java.lang.StringgetName() + +
+          Gets the name of the EXI event.
+ java.lang.StringgetPrefix() + +
+          Gets the namespace prefix of the event.
+ java.lang.StringgetURI() + +
+          Gets the URI of the EXI event.
+  +

+ + + + + + + + +
+Field Detail
+ +

+EVENT_SD

+
+static final byte EVENT_SD
+
+
Start Document event. +

+

+
See Also:
Constant Field Values
+
+
+ +

+EVENT_ED

+
+static final byte EVENT_ED
+
+
End Document event. +

+

+
See Also:
Constant Field Values
+
+
+ +

+EVENT_SE

+
+static final byte EVENT_SE
+
+
Start Element event. +

+

+
See Also:
Constant Field Values
+
+
+ +

+EVENT_AT

+
+static final byte EVENT_AT
+
+
Attribute event. +

+

+
See Also:
Constant Field Values
+
+
+ +

+EVENT_TP

+
+static final byte EVENT_TP
+
+
Attribute xsi:type. +

+

+
See Also:
Constant Field Values
+
+
+ +

+EVENT_NL

+
+static final byte EVENT_NL
+
+
Attribute xsi:nil. +

+

+
See Also:
Constant Field Values
+
+
+ +

+EVENT_CH

+
+static final byte EVENT_CH
+
+
Character event (content of an element). +

+

+
See Also:
Constant Field Values
+
+
+ +

+EVENT_EE

+
+static final byte EVENT_EE
+
+
End Element event. +

+

+
See Also:
Constant Field Values
+
+
+ +

+EVENT_NS

+
+static final byte EVENT_NS
+
+
Namespace declaration event. +

+

+
See Also:
Constant Field Values
+
+
+ +

+EVENT_PI

+
+static final byte EVENT_PI
+
+
Processing Instruction event. +

+

+
See Also:
Constant Field Values
+
+
+ +

+EVENT_CM

+
+static final byte EVENT_CM
+
+
Comment event. +

+

+
See Also:
Constant Field Values
+
+
+ +

+EVENT_ER

+
+static final byte EVENT_ER
+
+
Entity Reference event. +

+

+
See Also:
Constant Field Values
+
+
+ +

+EVENT_DTD

+
+static final byte EVENT_DTD
+
+
Document Type Definition event. +

+

+
See Also:
Constant Field Values
+
+
+ +

+EVENT_BLOB

+
+static final byte EVENT_BLOB
+
+
BLOB event (content of an element). +

+

+
See Also:
Constant Field Values
+
+ + + + + + + + +
+Method Detail
+ +

+getEventKind

+
+byte getEventKind()
+
+
Gets the event kind of which instance data this EventDescription is describing. +

+

+ +
Returns:
a byte representing the event kind.
+
+
+
+ +

+getURI

+
+java.lang.String getURI()
+
+
Gets the URI of the EXI event. +

+

+ +
Returns:
the URI as a String.
+
+
+
+ +

+getName

+
+java.lang.String getName()
+
+
Gets the name of the EXI event. +

+

+ +
Returns:
the name of the event as a String.
+
+
+
+ +

+getPrefix

+
+java.lang.String getPrefix()
+
+
Gets the namespace prefix of the event. +

+

+ +
Returns:
the prefix as a String.
+
+
+
+ +

+getCharacters

+
+Characters getCharacters()
+
+
Gets the value of an EVENT_CH, + Attribute (EVENT_AT, EVENT_NL, EVENT_TP), EVENT_CM, + EVENT_DTD or EVENT_PI event. +

+

+ +
Returns:
a Characters of the corresponding value
+
+
+
+ +

+getBinaryDataSource

+
+BinaryDataSource getBinaryDataSource()
+
+
Gets the value of an EVENT_BLOB. +

+

+ +
Returns:
a BinaryData of the corresponding value
+
+
+
+ +

+getEventType

+
+EventType getEventType()
+
+
Returns the EventType from which this event is derived. +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EventType.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EventType.html new file mode 100644 index 0000000000..aaef0c43ed --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EventType.html @@ -0,0 +1,829 @@ + + + + + + + +EventType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.proc.common +
+Class EventType

+
+java.lang.Object
+  extended by org.openexi.proc.common.EventCode
+      extended by org.openexi.proc.common.EventType
+
+
+
All Implemented Interfaces:
EventDescription
+
+
+
+
public class EventType
extends org.openexi.proc.common.EventCode
implements EventDescription
+ + +

+EventType denotes terminal symbols of grammar productions + defined in the EXI 1.0 specification. +

+ +

+

+ +
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+static byteITEM_AT + +
+          Event type for an Attribute learned by built-in element grammars + from prior attribute occurrences.
+static byteITEM_AT_WC_ANY_UNTYPED + +
+          Wildcard event type for an Attribute where the attribute's defined + datatype (if any) is disregarded.
+static byteITEM_CH + +
+          Event type for a Character event (character events store values as strings).
+static byteITEM_CM + +
+          Event type for a Comment.
+static byteITEM_DTD + +
+          Event type for a Document Type Definition.
+static byteITEM_ED + +
+          Event type for End of Document.
+static byteITEM_EE + +
+          Event type for End of Element.
+static byteITEM_ER + +
+          Event type for an Entity Reference.
+static byteITEM_NS + +
+          Event type for a Namespace declaration.
+static byteITEM_PI + +
+          Event type for a Processing Instruction.
+static byteITEM_SC + +
+          Self-contained items are not supported in this release of OpenEXI.
+static byteITEM_SCHEMA_AT + +
+          Event type for AttributeUse that matches an attribute event with + a valid value.
+static byteITEM_SCHEMA_AT_INVALID_VALUE + +
+          Event type for AttributeUse that matches an attribute event with an + invalid value.
+static byteITEM_SCHEMA_AT_WC_ANY + +
+          Attribute wildcard event type stemming from a schema, where the attribute's + defined datatype (if any) is applied.
+static byteITEM_SCHEMA_AT_WC_NS + +
+          Attribute wildcard event type, qualified with a specific namespace, stemming + from a schema where the attribute's defined datatype (if any) is applied.
+static byteITEM_SCHEMA_CH + +
+          Event type for a defined Character event in an EXI stream processed + using a schema.
+static byteITEM_SCHEMA_CH_MIXED + +
+          Event type for a Character event that occurs in the context of an element + defined so as to permit mixed content (mark up and data) in an EXI + stream processed using a schema.
+static byteITEM_SCHEMA_NIL + +
+          Special Attribute that indicates the value of the associated element is + explicitly nil rather than an empty string.
+static byteITEM_SCHEMA_TYPE + +
+          Special Attribute that describes a data type for the associated + element.
+static byteITEM_SCHEMA_WC_ANY + +
+          Attribute wildcard event type stemming from a schema where the + attribute's defined datatype (if any) is applied.
+static byteITEM_SCHEMA_WC_NS + +
+          Event type for an element defined in a namespace in an EXI stream + processed using a schema.
+static byteITEM_SD + +
+          Event type for Start Document.
+static byteITEM_SE + +
+          Event type for Start Element.
+static byteITEM_SE_WC + +
+          Wildcard event type for an element.
+ java.lang.Stringname + +
+          Local name of event type definition.
+ java.lang.Stringuri + +
+          URI of event type definition.
+ + + + + + + +
Fields inherited from class org.openexi.proc.common.EventCode
EVENT_CODE_DEPTH_ONE, EVENT_CODE_DEPTH_THREE, EVENT_CODE_DEPTH_TWO, ITEM_TUPLE, itemType, parent, position
+ + + + + + + +
Fields inherited from interface org.openexi.proc.common.EventDescription
EVENT_AT, EVENT_BLOB, EVENT_CH, EVENT_CM, EVENT_DTD, EVENT_ED, EVENT_EE, EVENT_ER, EVENT_NL, EVENT_NS, EVENT_PI, EVENT_SD, EVENT_SE, EVENT_TP
+  + + + + + + + +
+Method Summary
+ + + + + + + +
Methods inherited from class org.openexi.proc.common.EventCode
setParentalContext
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+ + + + + + + +
Methods inherited from interface org.openexi.proc.common.EventDescription
getBinaryDataSource, getCharacters, getEventKind, getEventType, getName, getPrefix, getURI
+  +

+ + + + + + + + +
+Field Detail
+ +

+ITEM_PI

+
+public static final byte ITEM_PI
+
+
Event type for a Processing Instruction. Value is 0. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_CM

+
+public static final byte ITEM_CM
+
+
Event type for a Comment. +
Value is 1. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_ER

+
+public static final byte ITEM_ER
+
+
Event type for an Entity Reference. +
Value is 2. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_CH

+
+public static final byte ITEM_CH
+
+
Event type for a Character event (character events store values as strings). +
Value is 3. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_ED

+
+public static final byte ITEM_ED
+
+
Event type for End of Document. +
Value is 4. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_SE_WC

+
+public static final byte ITEM_SE_WC
+
+
Wildcard event type for an element. OpenEXI will first attempt + to find a corresponding element name in the schema, if present. If + no definition is available, it is given this tag. +
Value is 5. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_SC

+
+public static final byte ITEM_SC
+
+
Self-contained items are not supported in this release of OpenEXI. + Event type for self-contained item. +
Value is 6. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_NS

+
+public static final byte ITEM_NS
+
+
Event type for a Namespace declaration.
+
Value is 7. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_AT_WC_ANY_UNTYPED

+
+public static final byte ITEM_AT_WC_ANY_UNTYPED
+
+
Wildcard event type for an Attribute where the attribute's defined + datatype (if any) is disregarded. + This is the "catch-all" for Attributes that do not match any of the + other Event Types in an EXI stream processed using Default options. +
Value is 8. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_EE

+
+public static final byte ITEM_EE
+
+
Event type for End of Element. +
Value is 9. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_DTD

+
+public static final byte ITEM_DTD
+
+
Event type for a Document Type Definition. +
Value is 10. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_SE

+
+public static final byte ITEM_SE
+
+
Event type for Start Element. +
Value is 11. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_AT

+
+public static final byte ITEM_AT
+
+
Event type for an Attribute learned by built-in element grammars + from prior attribute occurrences. +
Value is 12. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_SD

+
+public static final byte ITEM_SD
+
+
Event type for Start Document. +
Value is 13. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_SCHEMA_WC_ANY

+
+public static final byte ITEM_SCHEMA_WC_ANY
+
+
Attribute wildcard event type stemming from a schema where the + attribute's defined datatype (if any) is applied. +
Value is 14. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_SCHEMA_WC_NS

+
+public static final byte ITEM_SCHEMA_WC_NS
+
+
Event type for an element defined in a namespace in an EXI stream + processed using a schema. +
Value is 15. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_SCHEMA_AT

+
+public static final byte ITEM_SCHEMA_AT
+
+
Event type for AttributeUse that matches an attribute event with + a valid value. +
Value is 16. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_SCHEMA_AT_WC_ANY

+
+public static final byte ITEM_SCHEMA_AT_WC_ANY
+
+
Attribute wildcard event type stemming from a schema, where the attribute's + defined datatype (if any) is applied. +
Value is 17. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_SCHEMA_AT_WC_NS

+
+public static final byte ITEM_SCHEMA_AT_WC_NS
+
+
Attribute wildcard event type, qualified with a specific namespace, stemming + from a schema where the attribute's defined datatype (if any) is applied. +
Value is 18. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_SCHEMA_CH

+
+public static final byte ITEM_SCHEMA_CH
+
+
Event type for a defined Character event in an EXI stream processed + using a schema. +
Value is 19. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_SCHEMA_CH_MIXED

+
+public static final byte ITEM_SCHEMA_CH_MIXED
+
+
Event type for a Character event that occurs in the context of an element + defined so as to permit mixed content (mark up and data) in an EXI + stream processed using a schema. +
Value is 20. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_SCHEMA_NIL

+
+public static final byte ITEM_SCHEMA_NIL
+
+
Special Attribute that indicates the value of the associated element is + explicitly nil rather than an empty string. +
Value is 21. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_SCHEMA_TYPE

+
+public static final byte ITEM_SCHEMA_TYPE
+
+
Special Attribute that describes a data type for the associated + element. For example, the schema might define a String value, but + the XML document being processed can declare that the element contains a + date-time field. +
Value is 22. +

+

+
See Also:
Constant Field Values
+
+
+ +

+ITEM_SCHEMA_AT_INVALID_VALUE

+
+public static final byte ITEM_SCHEMA_AT_INVALID_VALUE
+
+
Event type for AttributeUse that matches an attribute event with an + invalid value. +
Value is 23. +

+

+
See Also:
Constant Field Values
+
+
+ +

+uri

+
+public final java.lang.String uri
+
+
URI of event type definition. +

+

+
+
+
+ +

+name

+
+public final java.lang.String name
+
+
Local name of event type definition. +

+

+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/GrammarOptions.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/GrammarOptions.html new file mode 100644 index 0000000000..7ea6e13a8c --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/GrammarOptions.html @@ -0,0 +1,528 @@ + + + + + + + +GrammarOptions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.proc.common +
+Class GrammarOptions

+
+java.lang.Object
+  extended by org.openexi.proc.common.GrammarOptions
+
+
+
+
public final class GrammarOptions
extends java.lang.Object
+ + +

+GrammarOptions computes a short integer that represents settings in the EXI Grammar settings + that determine how an EXI file will be encoded or decoded. +

+ Values are set using binary switch values (represented as short integers). +

+ If no options have been set, the value is 0 (this is an temporary internal + value, rather than a valid setting). +

+ If an XSD is available, and the file to be processed is 100% compatible with the XSD, choosing + STRICT_OPTIONS (1) provides the best performance. No other options can be set + when files are encoded or decoded in strict mode. +

+ The DEFAULT_OPTIONS setting is 2. The following table lists all of the options and their values. +

+ + + + + + + + +
ConstantValue
STRICT_OPTIONS1
DEFAULT_OPTIONS2
+ ADD_NS4 +
+ ADD_SCN/A* +
+ ADD_DTD16 +
+ ADD_CM32 +
+ ADD_PI64 +
*The self-contained option is not supported in this release. +
+

+ The value of DEFAULT_OPTIONS is 2. When you pass the options variable to an add[??] method, + the binary switch value is added to the current value of the options variable. + The sum of all additional switches becomes a concise list of the selected options. +

+ For example, if you preserve comments and processing instructions, the total is + 98 (2 + 32 + 64). The bitwise options are set correctly, because there is one and only one + combination of options that sums up to 98. +

+ If your application uses the same options every time, you can hard code the numeric value + as a short integer and use it to create your GrammarCache. For example: +

+ GrammarCache gc = new GrammarCache((EXISchema)null,98);
+ 
+ Be careful to use the correct numeric value, to avoid unexpected results. +

+ +

+

+ +
+
+ +

+ + + + + + + + + + + + + + + + + + + +
+Field Summary
+static shortDEFAULT_OPTIONS + +
+          Indicates that undeclared elements and attributes will be + processed when the XML stream is encoded and decoded.
+static shortOPTIONS_UNUSED + +
+          OPTIONS_UNUSED is an internal value.
+static shortSTRICT_OPTIONS + +
+          Indicates that undeclared elements and attributes will throw an + exception when the XML stream is encoded and decoded.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+static shortaddCM(short options) + +
+          Sets Preserve Comments to true.
+static shortaddDTD(short options) + +
+          Sets Preserve Document Type Definition to true.
+static shortaddNS(short options) + +
+          Sets Preserve Namespaces to true.
+static shortaddPI(short options) + +
+          Sets Preserve Processing Instructions to true.
+static booleanhasCM(short options) + +
+          Returns true if Preserve Comments is true.
+static booleanhasDTD(short options) + +
+          Returns true if Preserve Document Type Definition is true.
+static booleanhasNS(short options) + +
+          Returns true if Preserve Namespaces is true.
+static booleanhasPI(short options) + +
+          Returns true if Preserve Processing Instructions is true.
+static booleanisPermitDeviation(short options) + +
+          Returns true if DEFAULT_OPTIONS is set to true.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+OPTIONS_UNUSED

+
+public static final short OPTIONS_UNUSED
+
+
OPTIONS_UNUSED is an internal value. + It indicates that the grammar options value has not yet been set. +

+

+
See Also:
Constant Field Values
+
+
+ +

+DEFAULT_OPTIONS

+
+public static final short DEFAULT_OPTIONS
+
+
Indicates that undeclared elements and attributes will be + processed when the XML stream is encoded and decoded. +

+

+
See Also:
Constant Field Values
+
+
+ +

+STRICT_OPTIONS

+
+public static final short STRICT_OPTIONS
+
+
Indicates that undeclared elements and attributes will throw an + exception when the XML stream is encoded and decoded. When + STRICT_OPTIONS is set, all other Grammar Options are ignored. +

+

+
See Also:
Constant Field Values
+
+ + + + + + + + +
+Method Detail
+ +

+isPermitDeviation

+
+public static boolean isPermitDeviation(short options)
+
+
Returns true if DEFAULT_OPTIONS is set to true. +

+

+
+
+
+
+ +

+hasNS

+
+public static boolean hasNS(short options)
+
+
Returns true if Preserve Namespaces is true. +

+

+
+
+
+
+ +

+hasDTD

+
+public static boolean hasDTD(short options)
+
+
Returns true if Preserve Document Type Definition is true. +

+

+
+
+
+
+ +

+hasCM

+
+public static boolean hasCM(short options)
+
+
Returns true if Preserve Comments is true. +

+

+
+
+
+
+ +

+hasPI

+
+public static boolean hasPI(short options)
+
+
Returns true if Preserve Processing Instructions is true. +

+

+
+
+
+
+ +

+addNS

+
+public static short addNS(short options)
+
+
Sets Preserve Namespaces to true. (Adds 4 to the options value.) +

+

+ +
Returns:
the new options short integer value
+
+
+
+ +

+addDTD

+
+public static short addDTD(short options)
+
+
Sets Preserve Document Type Definition to true. (Adds 16 to the options value.) +

+

+ +
Returns:
the new options short integer value
+
+
+
+ +

+addCM

+
+public static short addCM(short options)
+
+
Sets Preserve Comments to true. (Adds 32 to the options value.) +

+

+ +
Returns:
the new options short integer value
+
+
+
+ +

+addPI

+
+public static short addPI(short options)
+
+
Sets Preserve Processing Instructions to true. (Adds 64 to the options value.) +

+

+ +
Returns:
the new options short integer value
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/QName.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/QName.html new file mode 100644 index 0000000000..61485ec734 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/QName.html @@ -0,0 +1,346 @@ + + + + + + + +QName + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.proc.common +
+Class QName

+
+java.lang.Object
+  extended by org.openexi.proc.common.QName
+
+
+
+
public final class QName
extends java.lang.Object
+ + +

+QName is a pair comprised of a namespace name and a local name + to be used in a Datatype Representation Map (DTRM) definition + to denote an XSD datatype or an EXI datatype representation. +

+ +

+

+ +
+
+ +

+ + + + + + + + + + + + + + + +
+Field Summary
+ java.lang.StringlocalName + +
+          Local name of the datatype.
+ java.lang.StringnamespaceName + +
+          If namespaceName is null, this indicates a failure of + namespace-prefix binding.
+  + + + + + + + + + + + + + +
+Constructor Summary
QName() + +
+           
QName(java.lang.String qname, + java.lang.String uri) + +
+          Creates a QName based on its literal qualified name + (see http://www.w3.org/TR/xml-names/#ns-qualnames + for definition) and namespace name.
+  + + + + + + + + + + + +
+Method Summary
+ booleanequals(java.lang.Object obj) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+namespaceName

+
+public java.lang.String namespaceName
+
+
If namespaceName is null, this indicates a failure of + namespace-prefix binding. No namespace binding for the + unprefixed QName is indicated by an empty namespace + name "". +

+

+
+
+
+ +

+localName

+
+public java.lang.String localName
+
+
Local name of the datatype. +

+

+
+
+ + + + + + + + +
+Constructor Detail
+ +

+QName

+
+public QName()
+
+
+
+ +

+QName

+
+public QName(java.lang.String qname,
+             java.lang.String uri)
+
+
Creates a QName based on its literal qualified name + (see http://www.w3.org/TR/xml-names/#ns-qualnames + for definition) and namespace name. +

+

+
Parameters:
qname - literal qualified name in its entirety
uri - namespace name (nullable) of the QName
See Also:
http://www.w3.org/TR/xml-names/#ns-qualnames
+
+ + + + + + + + +
+Method Detail
+ +

+equals

+
+public boolean equals(java.lang.Object obj)
+
+
+
Overrides:
equals in class java.lang.Object
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-frame.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-frame.html new file mode 100644 index 0000000000..fcab6106d9 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-frame.html @@ -0,0 +1,63 @@ + + + + + + + +org.openexi.proc.common + + + + + + + + + + + +org.openexi.proc.common + + + + +
+Interfaces  + +
+EventDescription
+ + + + + + +
+Classes  + +
+BinaryDataSource +
+EventType +
+EXIOptions +
+GrammarOptions +
+QName
+ + + + + + +
+Enums  + +
+AlignmentType
+ + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-summary.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-summary.html new file mode 100644 index 0000000000..c4f3e1c6fe --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-summary.html @@ -0,0 +1,235 @@ + + + + + + + +org.openexi.proc.common + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package org.openexi.proc.common +

+ + + +The common package contains classes, interfaces, and enumerators that define the vocabulary used to describe EXI streams (events, options, alignment, and character string values). +

+See: +
+          Description +

+ + + + + + + + + +
+Interface Summary
EventDescriptionEventDescription provides accessors to the current EXI event data + during the decode process.
+  + +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+Class Summary
BinaryDataSource 
EventTypeEventType denotes terminal symbols of grammar productions + defined in the EXI 1.0 specification.
EXIOptionsEXIOptions provides accessors for values associated with + EXI options in the EXI header of an EXI stream.
GrammarOptionsGrammarOptions computes a short integer that represents settings in the EXI Grammar settings + that determine how an EXI file will be encoded or decoded.
QNameQName is a pair comprised of a namespace name and a local name + to be used in a Datatype Representation Map (DTRM) definition + to denote an XSD datatype or an EXI datatype representation.
+  + +

+ + + + + + + + + +
+Enum Summary
AlignmentTypeAlignmentType represents one of the following bit alignment + styles so as to provide an extra degree of control over the + way information is stored in EXI format.
+  + +

+

+Package org.openexi.proc.common Description +

+ +

+ + + + + +
+

The common package contains classes, interfaces, and enumerators that define the vocabulary used to describe EXI streams (events, options, alignment, and character string values). +

+
+ +
+

+

+ +

+

+ +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-tree.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-tree.html new file mode 100644 index 0000000000..778ae7c56b --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-tree.html @@ -0,0 +1,166 @@ + + + + + + + +org.openexi.proc.common Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package org.openexi.proc.common +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +

+Interface Hierarchy +

+ +

+Enum Hierarchy +

+
    +
  • java.lang.Object
      +
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) + +
    +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/GrammarCache.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/GrammarCache.html new file mode 100644 index 0000000000..55b03fa67b --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/GrammarCache.html @@ -0,0 +1,362 @@ + + + + + + + +GrammarCache + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.proc.grammars +
+Class GrammarCache

+
+java.lang.Object
+  extended by org.openexi.proc.grammars.GrammarCache
+
+
+
All Implemented Interfaces:
org.openexi.proc.common.IGrammarCache
+
+
+
+
public final class GrammarCache
extends java.lang.Object
implements org.openexi.proc.common.IGrammarCache
+ + +

+A GrammarCache object represents a set of EXI grammars used + for processing EXI streams using specific grammar options. + The GrammarCache is passed as an argument to + the EXIReader and Transmogrifier prior to processing an EXI stream. +

+ +

+

+ +
+
+ +

+ + + + + + + + + + + +
+Field Summary
+ shortgrammarOptions + +
+          Short integer that encapsulates GrammarOptions + for the EXI stream.
+  + + + + + + + + + + + + + + + + +
+Constructor Summary
GrammarCache(EXISchema schema) + +
+          Creates an instance of GrammarCache informed by a schema with default + grammar options.
GrammarCache(EXISchema schema, + short grammarOptions) + +
+          Creates an instance of GrammarCache informed by a schema with the + specified grammar options.
GrammarCache(short grammarOptions) + +
+          Creates an instance of GrammarCache with the specified grammar options.
+  + + + + + + + + + + + +
+Method Summary
+ EXISchemagetEXISchema() + +
+          Gets the compiled EXI Schema.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+ + + + + + + +
Methods inherited from interface org.openexi.proc.common.IGrammarCache
getElementGrammarUse
+  +

+ + + + + + + + +
+Field Detail
+ +

+grammarOptions

+
+public final short grammarOptions
+
+
Short integer that encapsulates GrammarOptions + for the EXI stream. +

+

+
+
+ + + + + + + + +
+Constructor Detail
+ +

+GrammarCache

+
+public GrammarCache(EXISchema schema)
+
+
Creates an instance of GrammarCache informed by a schema with default + grammar options. +

+

+
Parameters:
EXISchema - compiled schema
+
+
+ +

+GrammarCache

+
+public GrammarCache(short grammarOptions)
+
+
Creates an instance of GrammarCache with the specified grammar options. +

+

+
Parameters:
grammarOptions - integer value that represents a grammar option configuration
+
+
+ +

+GrammarCache

+
+public GrammarCache(EXISchema schema,
+                    short grammarOptions)
+
+
Creates an instance of GrammarCache informed by a schema with the + specified grammar options. +

+

+
Parameters:
EXISchema - compiled schema
grammarOptions - integer value that represents a grammar option configuration
+
+ + + + + + + + +
+Method Detail
+ +

+getEXISchema

+
+public EXISchema getEXISchema()
+
+
Gets the compiled EXI Schema. +

+

+
Specified by:
getEXISchema in interface org.openexi.proc.common.IGrammarCache
+
+
+ +
Returns:
an EXI schema.
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-frame.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-frame.html new file mode 100644 index 0000000000..5eb44a3df0 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-frame.html @@ -0,0 +1,33 @@ + + + + + + + +org.openexi.proc.grammars + + + + + + + + + + + +org.openexi.proc.grammars + + + + +
+Classes  + +
+GrammarCache
+ + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-summary.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-summary.html new file mode 100644 index 0000000000..3ae5291fc4 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-summary.html @@ -0,0 +1,184 @@ + + + + + + + +org.openexi.proc.grammars + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package org.openexi.proc.grammars +

+ + + +The grammars package contains the GrammarCache, which combines an XML Schema Definition with EXI grammar options to create an EXI Schema. +

+See: +
+          Description +

+ + + + + + + + + +
+Class Summary
GrammarCacheA GrammarCache object represents a set of EXI grammars used + for processing EXI streams using specific grammar options.
+  + +

+

+Package org.openexi.proc.grammars Description +

+ +

+ + + + + +
+

The grammars package contains the GrammarCache, which combines an XML Schema Definition with EXI grammar options to create an EXI Schema. +

+
+ +
+

+

+ +

+

+ +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-tree.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-tree.html new file mode 100644 index 0000000000..542514937f --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-tree.html @@ -0,0 +1,149 @@ + + + + + + + +org.openexi.proc.grammars Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package org.openexi.proc.grammars +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+
    +
  • java.lang.Object
      +
    • org.openexi.proc.grammars.GrammarCache (implements org.openexi.proc.common.IGrammarCache) +
    +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/BinaryDataSink.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/BinaryDataSink.html new file mode 100644 index 0000000000..0f9e531c25 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/BinaryDataSink.html @@ -0,0 +1,171 @@ + + + + + + + +BinaryDataSink + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.proc.io +
+Interface BinaryDataSink

+
+
+
public interface BinaryDataSink
+ + +

+BinaryDataSink represents a sink that accepts successive chunks of binary data. +

+ +

+

+ +
+
+ +

+ +

+ +


+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/CharacterBuffer.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/CharacterBuffer.html new file mode 100644 index 0000000000..7b7e75e920 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/CharacterBuffer.html @@ -0,0 +1,259 @@ + + + + + + + +CharacterBuffer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.proc.io +
+Class CharacterBuffer

+
+java.lang.Object
+  extended by org.openexi.proc.io.CharacterBuffer
+
+
+
+
public final class CharacterBuffer
extends java.lang.Object
+ + +

+

+ +
+
+ +

+ + + + + + + + + + + +
+Field Summary
+static intBUFSIZE_DEFAULT + +
+           
+  + + + + + + + + + + +
+Constructor Summary
CharacterBuffer(int bufSize) + +
+           
+  + + + + + + + +
+Method Summary
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+BUFSIZE_DEFAULT

+
+public static final int BUFSIZE_DEFAULT
+
+
+
See Also:
Constant Field Values
+
+ + + + + + + + +
+Constructor Detail
+ +

+CharacterBuffer

+
+public CharacterBuffer(int bufSize)
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/Scanner.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/Scanner.html new file mode 100644 index 0000000000..82b51284e6 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/Scanner.html @@ -0,0 +1,354 @@ + + + + + + + +Scanner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.proc.io +
+Class Scanner

+
+java.lang.Object
+  extended by org.openexi.proc.grammars.Apparatus
+      extended by org.openexi.proc.io.Scanner
+
+
+
+
public abstract class Scanner
extends org.openexi.proc.grammars.Apparatus
+ + +

+The Scanner class provides methods for scanning events + in the body of an EXI stream. +

+ +

+

+ +
+
+ +

+ + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from class org.openexi.proc.grammars.Apparatus
CODEC_BASE64BINARY, CODEC_BOOLEAN, CODEC_DATE, CODEC_DATETIME, CODEC_DECIMAL, CODEC_DOUBLE, CODEC_ENUMERATION, CODEC_GDAY, CODEC_GMONTH, CODEC_GMONTHDAY, CODEC_GYEAR, CODEC_GYEARMONTH, CODEC_HEXBINARY, CODEC_INTEGER, CODEC_LEXICAL, CODEC_LIST, CODEC_STRING, CODEC_TIME, currentState, eventTypesWorkSpace, schema, stringTable
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidcloseInputStream() + +
+          Close the input stream.
+ EXIOptionsgetHeaderOptions() + +
+          Returns the EXI Header options from the header of the + EXI stream, if present.
+abstract  EventDescriptionnextEvent() + +
+          Gets the next event from the EXI stream.
+abstract  voidsetBinaryChunkSize(int chunkSize) + +
+          Binary values are read in chunks of the specified size when the + use of binary data is enabled.
+ voidsetSchema(EXISchema schema, + QName[] dtrm, + int n_bindings) + +
+           
+ + + + + + + +
Methods inherited from class org.openexi.proc.grammars.Apparatus
attribute, characters, endDocument, endElement, getAlignmentType, getNextEventCodes, getNextEventTypes, getPreserveLexicalValues, miscContent, nillify, reset, setPreserveLexicalValues, setStringTable, startDocument, startElement, startWildcardElement, undeclaredCharacters, wildcardAttribute, xsitp
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Method Detail
+ +

+setSchema

+
+public void setSchema(EXISchema schema,
+                      QName[] dtrm,
+                      int n_bindings)
+
+
+
Overrides:
setSchema in class org.openexi.proc.grammars.Apparatus
+
+
+
+
+
+
+ +

+nextEvent

+
+public abstract EventDescription nextEvent()
+                                    throws java.io.IOException
+
+
Gets the next event from the EXI stream. +

+

+ +
Returns:
EXIEvent +
Throws: +
java.io.IOException
+
+
+
+ +

+closeInputStream

+
+public void closeInputStream()
+                      throws java.io.IOException
+
+
Close the input stream. +

+

+ +
Throws: +
java.io.IOException
+
+
+
+ +

+getHeaderOptions

+
+public final EXIOptions getHeaderOptions()
+
+
Returns the EXI Header options from the header of the + EXI stream, if present. Otherwise, returns null. +

+

+ +
Returns:
EXIOptions or null if no header options are set.
+
+
+
+ +

+setBinaryChunkSize

+
+public abstract void setBinaryChunkSize(int chunkSize)
+
+
Binary values are read in chunks of the specified size when the + use of binary data is enabled. +

+

+
Parameters:
chunkSize -
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-frame.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-frame.html new file mode 100644 index 0000000000..fe7bf70760 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-frame.html @@ -0,0 +1,46 @@ + + + + + + + +org.openexi.proc.io + + + + + + + + + + + +org.openexi.proc.io + + + + +
+Interfaces  + +
+BinaryDataSink
+ + + + + + +
+Classes  + +
+CharacterBuffer +
+Scanner
+ + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-summary.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-summary.html new file mode 100644 index 0000000000..42831b8609 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-summary.html @@ -0,0 +1,205 @@ + + + + + + + +org.openexi.proc.io + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package org.openexi.proc.io +

+ + + +The IO package contains the Scanner, which is used by EXIDecoder to read and interpret EXI streams. +

+See: +
+          Description +

+ + + + + + + + + +
+Interface Summary
BinaryDataSinkBinaryDataSink represents a sink that accepts successive chunks of binary data.
+  + +

+ + + + + + + + + + + + + +
+Class Summary
CharacterBuffer 
ScannerThe Scanner class provides methods for scanning events + in the body of an EXI stream.
+  + +

+

+Package org.openexi.proc.io Description +

+ +

+ + + + + +
+

The IO package contains the Scanner, which is used by EXIDecoder to read and interpret EXI streams. +

+

+The IO package also contains the non-public Scriber class, which is used by the Transmogrifier to encode EXI streams (which is why this is called the IO package). Scriber settings are fully implemented in the Transmogrifier. +

+
+ +
+

+

+ +

+

+ +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-tree.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-tree.html new file mode 100644 index 0000000000..b0cbe124ae --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-tree.html @@ -0,0 +1,155 @@ + + + + + + + +org.openexi.proc.io Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package org.openexi.proc.io +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+
    +
  • java.lang.Object +
+

+Interface Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-frame.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-frame.html new file mode 100644 index 0000000000..31406d379f --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-frame.html @@ -0,0 +1,55 @@ + + + + + + + +org.openexi.proc + + + + + + + + + + + +org.openexi.proc + + + + +
+Interfaces  + +
+EXISchemaResolver
+ + + + + + +
+Classes  + +
+EXIDecoder
+ + + + + + +
+Enums  + +
+HeaderOptionsOutputType
+ + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-summary.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-summary.html new file mode 100644 index 0000000000..957e54a056 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-summary.html @@ -0,0 +1,219 @@ + + + + + + + +org.openexi.proc + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package org.openexi.proc +

+ + + +The Proc (Processor) package contains the EXIDecoder, which is used to convert EXI streams to XML format. +

+See: +
+          Description +

+ + + + + + + + + +
+Interface Summary
EXISchemaResolverDevelopers have the option of implementing the EXISchemaResolver interface + to help EXIReader and EXIDecoder locate the correct grammar cache for parsing + an EXI stream.
+  + +

+ + + + + + + + + +
+Class Summary
EXIDecoderEXIDecoder provides methods to configure and + instantiate a Scanner object + you can use to parse the contents of an EXI stream.
+  + +

+ + + + + + + + + +
+Enum Summary
HeaderOptionsOutputTypeThis enumeration provides three possible settings for header options output.
+  + +

+

+Package org.openexi.proc Description +

+ +

+ + + + + +
+

The Proc (Processor) package contains the EXIDecoder, which is used to convert EXI streams to XML format. +EXIDecoder uses the org.openexi.proc.io.Scanner to parse EXI streams into a sequence of XML events. org.openexi.sax.EXIReader wraps EXIDecoder to provide a SAX interface for accessing the XML content. +

+

+The EXISchemaResolver interface can be implemented and used to add a hint in the EXI header to help EXIDecoder locate the EXISchema. +

+

The HeaderOptionsOutputType enumerator is used to set the header output options in the Transmogrifier.

+ +
+

+

+ +

+

+ +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-tree.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-tree.html new file mode 100644 index 0000000000..3bf180e361 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-tree.html @@ -0,0 +1,163 @@ + + + + + + + +org.openexi.proc Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package org.openexi.proc +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +

+Interface Hierarchy +

+ +

+Enum Hierarchy +

+
    +
  • java.lang.Object
      +
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) + +
    +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/BinaryDataHandler.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/BinaryDataHandler.html new file mode 100644 index 0000000000..b73a833559 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/BinaryDataHandler.html @@ -0,0 +1,267 @@ + + + + + + + +BinaryDataHandler + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.sax +
+Interface BinaryDataHandler

+
+
All Known Subinterfaces:
SAXTransmogrifier
+
+
+
+
public interface BinaryDataHandler
+ + +

+

+ +
+
+ +

+ + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidbinaryData(byte[] byteArray, + int offset, + int length, + BinaryDataSink binaryDataSink) + +
+          Writes a binary value where the schema expects a binary value.
+ voidendBinaryData(BinaryDataSink binaryDataSink) + +
+          Mark the end of a binary value.
+ BinaryDataSinkstartBinaryData(long totalSize) + +
+          Mark the start of a binary value.
+  +

+ + + + + + + + +
+Method Detail
+ +

+startBinaryData

+
+BinaryDataSink startBinaryData(long totalSize)
+                               throws org.xml.sax.SAXException
+
+
Mark the start of a binary value. +

+

+ +
Throws: +
org.xml.sax.SAXException
+
+
+
+ +

+binaryData

+
+void binaryData(byte[] byteArray,
+                int offset,
+                int length,
+                BinaryDataSink binaryDataSink)
+                throws org.xml.sax.SAXException
+
+
Writes a binary value where the schema expects a binary value. +

+

+ +
Throws: +
org.xml.sax.SAXException
+
+
+
+ +

+endBinaryData

+
+void endBinaryData(BinaryDataSink binaryDataSink)
+                   throws org.xml.sax.SAXException
+
+
Mark the end of a binary value. +

+

+ +
Throws: +
org.xml.sax.SAXException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/EXIReader.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/EXIReader.html new file mode 100644 index 0000000000..228aa7506e --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/EXIReader.html @@ -0,0 +1,645 @@ + + + + + + + +EXIReader + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.sax +
+Class EXIReader

+
+java.lang.Object
+  extended by org.openexi.sax.ReaderSupport
+      extended by org.openexi.sax.EXIReader
+
+
+
All Implemented Interfaces:
org.xml.sax.Attributes, org.xml.sax.XMLReader
+
+
+
+
public final class EXIReader
extends ReaderSupport
implements org.xml.sax.XMLReader
+ + +

+EXIReader implements the SAX XMLReader to provide a convenient and + familiar interface for decoding an EXI stream. +

+ +

+

+ +
+
+ +

+ + + + + + + + + + + +
+Constructor Summary
EXIReader() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ booleangetFeature(java.lang.String name) + +
+          Get features for the SAX parser.
+ java.lang.ObjectgetProperty(java.lang.String name) + +
+          Use to retrieve the name of the lexical handler, currently the only + property recognized by this class.
+ voidsetAlignmentType(AlignmentType alignmentType) + +
+          Set the bit alignment style used to compile the EXI input stream.
+ voidsetBlockSize(int blockSize) + +
+          Set the size, in number of values, of the information that will be + processed as a chunk of the entire EXI stream.
+ voidsetDatatypeRepresentationMap(QName[] dtrm, + int n_bindings) + +
+          Set a datatype representation map.
+ voidsetEXISchemaResolver(EXISchemaResolver schemaResolver) + +
+          Set the EXISchemaResolver to retrieve the schema needed to decode the + current EXI stream.
+ voidsetFeature(java.lang.String name, + boolean value) + +
+          Set features for the SAX parser.
+ voidsetFragment(boolean isFragment) + +
+          Set to true if the EXI input stream is an XML fragment (a non-compliant + XML document with multiple root elements).
+ voidsetLexicalHandler(org.xml.sax.ext.LexicalHandler lexicalHandler) + +
+          Set a SAX lexical handler to receive SAX lexical events.
+ voidsetPreserveLexicalValues(boolean preserveLexicalValues) + +
+          Set to true if the EXI input stream was compiled with the Preserve Lexical + Values set to true.
+ voidsetProperty(java.lang.String name, + java.lang.Object value) + +
+          This method wraps the friendlier setLexicalHandler method to provide + syntax familiar to experienced SAX programmers.
+ voidsetValueMaxLength(int valueMaxLength) + +
+          Set the maximum length of a string that will be stored for reuse in the + String Table.
+ voidsetValuePartitionCapacity(int valuePartitionCapacity) + +
+          Set the maximum number of values in the String Table.
+ + + + + + + +
Methods inherited from class org.openexi.sax.ReaderSupport
getContentHandler, setContentHandler, setGrammarCache
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+ + + + + + + +
Methods inherited from interface org.xml.sax.XMLReader
getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, parse, parse, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler
+ + + + + + + +
Methods inherited from interface org.xml.sax.Attributes
getIndex, getIndex, getLength, getLocalName, getQName, getType, getType, getType, getURI, getValue, getValue, getValue
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+EXIReader

+
+public EXIReader()
+
+
+ + + + + + + + +
+Method Detail
+ +

+setProperty

+
+public final void setProperty(java.lang.String name,
+                              java.lang.Object value)
+                       throws org.xml.sax.SAXNotRecognizedException
+
+
This method wraps the friendlier setLexicalHandler method to provide + syntax familiar to experienced SAX programmers. The only property + supported is:
http://xml.org/sax/properties/lexical-handler
+

+

+
Specified by:
setProperty in interface org.xml.sax.XMLReader
+
+
+
Parameters:
name - must equal "http://xml.org/sax/properties/lexical-handler"
value - an org.xml.sax.ext.LexicalHandler object +
Throws: +
org.xml.sax.SAXNotRecognizedException
+
+
+
+ +

+getProperty

+
+public final java.lang.Object getProperty(java.lang.String name)
+                                   throws org.xml.sax.SAXNotRecognizedException
+
+
Use to retrieve the name of the lexical handler, currently the only + property recognized by this class. Pass the String + "http://xml.org/sax/properties/lexical-handler" as the name. +

+

+
Specified by:
getProperty in interface org.xml.sax.XMLReader
+
+
+ +
Returns:
String name of the lexical handler +
Throws: +
org.xml.sax.SAXNotRecognizedException
+
+
+
+ +

+setFeature

+
+public final void setFeature(java.lang.String name,
+                             boolean value)
+                      throws org.xml.sax.SAXNotRecognizedException,
+                             org.xml.sax.SAXNotSupportedException
+
+
Set features for the SAX parser. The only supported arguments are
+ EXIReader.setFeature("http://xml.org/sax/features/namespaces", true);
and
+ EXIReader.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
+

+

+
Specified by:
setFeature in interface org.xml.sax.XMLReader
+
+
+ +
Throws: +
org.xml.sax.SAXNotRecognizedException +
org.xml.sax.SAXNotSupportedException
+
+
+
+ +

+getFeature

+
+public final boolean getFeature(java.lang.String name)
+                         throws org.xml.sax.SAXNotRecognizedException
+
+
Get features for the SAX parser. +

+

+
Specified by:
getFeature in interface org.xml.sax.XMLReader
+
+
+ +
Returns:
true if the feature is "http://xml.org/sax/features/namespaces" + and false if the feature is "http://xml.org/sax/features/namespace-prefixes" +
Throws: +
org.xml.sax.SAXNotRecognizedException
+
+
+
+ +

+setAlignmentType

+
+public final void setAlignmentType(AlignmentType alignmentType)
+                            throws org.openexi.proc.common.EXIOptionsException
+
+
Set the bit alignment style used to compile the EXI input stream. +

+

+
+
+
+
Parameters:
alignmentType - AlignmentType +
Throws: +
org.openexi.proc.common.EXIOptionsException
+
+
+
+ +

+setFragment

+
+public final void setFragment(boolean isFragment)
+
+
Set to true if the EXI input stream is an XML fragment (a non-compliant + XML document with multiple root elements). +

+

+
+
+
+
Parameters:
isFragment - true if the EXI input stream is an XML fragment.
+
+
+
+ +

+setPreserveLexicalValues

+
+public final void setPreserveLexicalValues(boolean preserveLexicalValues)
+                                    throws org.openexi.proc.common.EXIOptionsException
+
+
Set to true if the EXI input stream was compiled with the Preserve Lexical + Values set to true. The original strings, rather than logical XML + equivalents, are restored in the XML output stream. +

+

+
+
+
+
Parameters:
preserveLexicalValues - set to true if the EXI input stream was compiled with + Preserve Lexical Values set to true. +
Throws: +
org.openexi.proc.common.EXIOptionsException
+
+
+
+ +

+setEXISchemaResolver

+
+public final void setEXISchemaResolver(EXISchemaResolver schemaResolver)
+
+
Set the EXISchemaResolver to retrieve the schema needed to decode the + current EXI stream. +

+

+
+
+
+
Parameters:
schemaResolver - EXISchemaResolver
+
+
+
+ +

+setDatatypeRepresentationMap

+
+public final void setDatatypeRepresentationMap(QName[] dtrm,
+                                               int n_bindings)
+                                        throws org.openexi.proc.common.EXIOptionsException
+
+
Set a datatype representation map. +

+

+
+
+
+
Parameters:
dtrm - a sequence of pairs of datatype qname and datatype representation qname
n_bindings - the number of qname pairs +
Throws: +
org.openexi.proc.common.EXIOptionsException
+
+
+
+ +

+setBlockSize

+
+public final void setBlockSize(int blockSize)
+                        throws org.openexi.proc.common.EXIOptionsException
+
+
Set the size, in number of values, of the information that will be + processed as a chunk of the entire EXI stream. Reducing the block size + can improve performance for devices with limited dynamic memory. + Default is 1,000,000 items (not 1MB, but 1,000,000 complete Attribute + and Element values). Block size is only used when the EXI stream is + encoded with EXI-compression. +

+

+
+
+
+
Parameters:
blockSize - number of values in each processing block. Default is 1,000,000. +
Throws: +
org.openexi.proc.common.EXIOptionsException
+
+
+
+ +

+setValueMaxLength

+
+public final void setValueMaxLength(int valueMaxLength)
+
+
Set the maximum length of a string that will be stored for reuse in the + String Table. By default, there is no maximum length. However, in data + sets that have long, unique strings of information, you can improve + performance by limiting the size to the length of strings that are more + likely to appear more than once. +

+

+
+
+
+
Parameters:
valueMaxLength - maximum length of entries in the String Table.
+
+
+
+ +

+setValuePartitionCapacity

+
+public final void setValuePartitionCapacity(int valuePartitionCapacity)
+
+
Set the maximum number of values in the String Table. By default, there + is no limit. If the target device has limited dynamic memory, limiting + the number of entries in the String Table can improve performance and + reduce the likelihood that you will exceed memory capacity. +

+

+
+
+
+
Parameters:
valuePartitionCapacity - maximum number of entries in the String Table
+
+
+
+ +

+setLexicalHandler

+
+public void setLexicalHandler(org.xml.sax.ext.LexicalHandler lexicalHandler)
+
+
Set a SAX lexical handler to receive SAX lexical events. +

+

+
+
+
+
Parameters:
lexicalHandler - SAX lexical handler
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/ReaderSupport.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/ReaderSupport.html new file mode 100644 index 0000000000..7d392bb5b6 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/ReaderSupport.html @@ -0,0 +1,290 @@ + + + + + + + +ReaderSupport + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.sax +
+Class ReaderSupport

+
+java.lang.Object
+  extended by org.openexi.sax.ReaderSupport
+
+
+
All Implemented Interfaces:
org.xml.sax.Attributes
+
+
+
Direct Known Subclasses:
EXIReader
+
+
+
+
public abstract class ReaderSupport
extends java.lang.Object
implements org.xml.sax.Attributes
+ + +

+

+ +
+
+ +

+ + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ org.xml.sax.ContentHandlergetContentHandler() + +
+          Get the SAX content handler currently in use.
+ voidsetContentHandler(org.xml.sax.ContentHandler contentHandler) + +
+          Set a SAX content handler to receive SAX events.
+ voidsetGrammarCache(GrammarCache grammarCache) + +
+          Set the GrammarCache used in parsing EXI streams.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+ + + + + + + +
Methods inherited from interface org.xml.sax.Attributes
getIndex, getIndex, getLength, getLocalName, getQName, getType, getType, getType, getURI, getValue, getValue, getValue
+  +

+ + + + + + + + +
+Method Detail
+ +

+setContentHandler

+
+public final void setContentHandler(org.xml.sax.ContentHandler contentHandler)
+
+
Set a SAX content handler to receive SAX events. +

+

+
+
+
+
Parameters:
contentHandler - SAX content handler
+
+
+
+ +

+getContentHandler

+
+public final org.xml.sax.ContentHandler getContentHandler()
+
+
Get the SAX content handler currently in use. +

+

+
+
+
+ +
Returns:
ContentHandler SAX content handler.
+
+
+
+ +

+setGrammarCache

+
+public void setGrammarCache(GrammarCache grammarCache)
+                     throws org.openexi.proc.common.EXIOptionsException
+
+
Set the GrammarCache used in parsing EXI streams. +

+

+
+
+
+
Parameters:
grammarCache - GrammarCache +
Throws: +
org.openexi.proc.common.EXIOptionsException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/SAXTransmogrifier.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/SAXTransmogrifier.html new file mode 100644 index 0000000000..15e2e7d77f --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/SAXTransmogrifier.html @@ -0,0 +1,245 @@ + + + + + + + +SAXTransmogrifier + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.sax +
+Interface SAXTransmogrifier

+
+
All Superinterfaces:
BinaryDataHandler, org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler
+
+
+
+
public interface SAXTransmogrifier
extends org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler, BinaryDataHandler
+ + +

+Applications can directly feed SAX events into a transmogrifier through SAXTransmogrifier. +

+ +

+

+ +
+
+ +

+ + + + + + + + + + + + +
+Method Summary
+ GrammarCachegetGrammarCache() + +
+          Returns the GrammarCache that is in use by this SAXTransmogrifier.
+ + + + + + + +
Methods inherited from interface org.xml.sax.ContentHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
+ + + + + + + +
Methods inherited from interface org.xml.sax.ext.LexicalHandler
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity
+ + + + + + + +
Methods inherited from interface org.openexi.sax.BinaryDataHandler
binaryData, endBinaryData, startBinaryData
+  +

+ + + + + + + + +
+Method Detail
+ +

+getGrammarCache

+
+GrammarCache getGrammarCache()
+
+
Returns the GrammarCache that is in use by this SAXTransmogrifier. +

+

+
+
+
+ +
Returns:
a GrammarCache
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/Transmogrifier.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/Transmogrifier.html new file mode 100644 index 0000000000..b857aab51c --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/Transmogrifier.html @@ -0,0 +1,735 @@ + + + + + + + +Transmogrifier + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.sax +
+Class Transmogrifier

+
+java.lang.Object
+  extended by org.openexi.sax.Transmogrifier
+
+
+
+
public final class Transmogrifier
extends java.lang.Object
+ + +

+The Transmogrifier converts an XML stream to an EXI stream. +

+ +

+

+ +
+
+ +

+ + + + + + + + + + + + + + +
+Constructor Summary
Transmogrifier() + +
+          Create an instance of the Transmogrifier with a default SAX parser.
Transmogrifier(javax.xml.parsers.SAXParserFactory saxParserFactory) + +
+          Create an instance of the Transmogrifier, specifying the SAXParserFactory + from which to create the SAX parser.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidencode(org.xml.sax.InputSource is) + +
+          Parses XML input source and converts it to an EXI stream.
+ GrammarCachegetGrammarCache() + +
+          Returns the GrammarCache that was previously set.
+ SAXTransmogrifiergetSAXTransmogrifier() + +
+          Returns the SAXTransmogrifier, which implements both the ContentHandler + and LexicalHandler.
+ voidsetAlignmentType(AlignmentType alignmentType) + +
+          Set the bit alignment style for the encoded EXI stream.
+ voidsetBlockSize(int blockSize) + +
+          Set the size, in number of values, of the information that will be + processed as a chunk of the entire XML stream.
+ voidsetDatatypeRepresentationMap(QName[] dtrm, + int n_bindings) + +
+          Set a datatype representation map (DTRM).
+ voidsetEntityResolver(org.xml.sax.EntityResolver entityResolver) + +
+          Set an external SAX entity resolver.
+ voidsetFragment(boolean isFragment) + +
+          Set to true if the XML input stream is an XML fragment (a non-compliant + XML document with multiple root elements).
+ voidsetGrammarCache(GrammarCache grammarCache) + +
+          Set the GrammarCache used in transmogrifying XML data to EXI.
+ voidsetGrammarCache(GrammarCache grammarCache, + org.openexi.proc.common.SchemaId schemaId) + +
+          Set the GrammarCache to be used in encoding XML streams into EXI streams + by the transmogrifier.
+ voidsetOutputCookie(boolean outputCookie) + +
+          Tells the encoder whether to or not to start the stream by + adding an EXI cookie.
+ voidsetOutputOptions(HeaderOptionsOutputType outputOptions) + +
+          Set the header output options.
+ voidsetOutputStream(java.io.OutputStream ostream) + +
+          Set an output stream to which encoded streams are written.
+ voidsetPreserveLexicalValues(boolean preserveLexicalValues) + +
+          Set to true to preserve the original string values from the XML + stream.
+ voidsetPreserveWhitespaces(boolean preserveWhitespaces) + +
+          Set to true to preserve whitespace (for example, spaces, tabs, and + line breaks) in the encoded EXI stream.
+ voidsetResolveExternalGeneralEntities(boolean resolveExternalGeneralEntities) + +
+          Change the way a Transmogrifier handles external general entities.
+ voidsetValueMaxLength(int valueMaxLength) + +
+          Set the maximum length of a string that will be stored for reuse in the + String Table.
+ voidsetValuePartitionCapacity(int valuePartitionCapacity) + +
+          Set the maximum number of values in the String Table.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+Transmogrifier

+
+public Transmogrifier()
+               throws org.openexi.sax.TransmogrifierRuntimeException
+
+
Create an instance of the Transmogrifier with a default SAX parser. +

+

+ +
Throws: +
TransmogrifierException +
org.openexi.sax.TransmogrifierRuntimeException
+
+
+ +

+Transmogrifier

+
+public Transmogrifier(javax.xml.parsers.SAXParserFactory saxParserFactory)
+               throws org.openexi.sax.TransmogrifierRuntimeException
+
+
Create an instance of the Transmogrifier, specifying the SAXParserFactory + from which to create the SAX parser. +

+

+
Parameters:
saxParserFactory - +
Throws: +
TransmogrifierException +
org.openexi.sax.TransmogrifierRuntimeException
+
+ + + + + + + + +
+Method Detail
+ +

+setResolveExternalGeneralEntities

+
+public void setResolveExternalGeneralEntities(boolean resolveExternalGeneralEntities)
+                                       throws TransmogrifierException
+
+
Change the way a Transmogrifier handles external general entities. When the value + of resolveExternalGeneralEntities is set to true, a Transmogrifier will try to + resolve external general entities. Otherwise, external general entities will not + be resolved. +

+

+
Parameters:
resolveExternalGeneralEntities - +
Throws: +
TransmogrifierException - Thrown when the underlying XMLReader does not + support the specified behavior.
+
+
+
+ +

+setOutputStream

+
+public final void setOutputStream(java.io.OutputStream ostream)
+
+
Set an output stream to which encoded streams are written. +

+

+
Parameters:
ostream - output stream
+
+
+
+ +

+setAlignmentType

+
+public final void setAlignmentType(AlignmentType alignmentType)
+                            throws org.openexi.proc.common.EXIOptionsException
+
+
Set the bit alignment style for the encoded EXI stream. +

+

+
Parameters:
alignmentType - AlignmentType. + Default is bit-packed. +
Throws: +
org.openexi.proc.common.EXIOptionsException
+
+
+
+ +

+setFragment

+
+public final void setFragment(boolean isFragment)
+
+
Set to true if the XML input stream is an XML fragment (a non-compliant + XML document with multiple root elements). +

+

+
Parameters:
isFragment - true if the XML input stream is an XML fragment.
+
+
+
+ +

+setBlockSize

+
+public final void setBlockSize(int blockSize)
+                        throws org.openexi.proc.common.EXIOptionsException
+
+
Set the size, in number of values, of the information that will be + processed as a chunk of the entire XML stream. Reducing the block size + can improve performance for devices with limited dynamic memory. + Default is 1,000,000 items (not 1MB, but 1,000,000 complete Attribute + and Element values). Block size is only used when the EXI stream is + encoded with EXI-compression. +

+

+
Parameters:
blockSize - number of values in each processing block. Default is 1,000,000. +
Throws: +
org.openexi.proc.common.EXIOptionsException
+
+
+
+ +

+setValueMaxLength

+
+public final void setValueMaxLength(int valueMaxLength)
+
+
Set the maximum length of a string that will be stored for reuse in the + String Table. By default, there is no maximum length. However, in data + sets that have long, unique strings of information, you can improve + performance by limiting the size to the length of strings that are more + likely to appear more than once. +

+

+
Parameters:
valueMaxLength - maximum length of entries in the String Table.
+
+
+
+ +

+setValuePartitionCapacity

+
+public final void setValuePartitionCapacity(int valuePartitionCapacity)
+
+
Set the maximum number of values in the String Table. By default, there + is no limit. If the target device has limited dynamic memory, limiting + the number of entries in the String Table can improve performance and + reduce the likelihood that you will exceed memory capacity. +

+

+
Parameters:
valuePartitionCapacity - maximum number of entries in the String Table
+
+
+
+ +

+setPreserveLexicalValues

+
+public final void setPreserveLexicalValues(boolean preserveLexicalValues)
+                                    throws org.openexi.proc.common.EXIOptionsException
+
+
Set to true to preserve the original string values from the XML + stream. For example, a date string might be converted to a different + format when interpreted by the Transmogrifier. Preserving the lexical values + ensures that the identical strings are restored, and not just their + logical values. +

+

+
Parameters:
preserveLexicalValues - true to keep original strings intact +
Throws: +
org.openexi.proc.common.EXIOptionsException
+
+
+
+ +

+setGrammarCache

+
+public final void setGrammarCache(GrammarCache grammarCache)
+                           throws org.openexi.proc.common.EXIOptionsException
+
+
Set the GrammarCache used in transmogrifying XML data to EXI. +

+

+
Parameters:
grammarCache - GrammarCache +
Throws: +
org.openexi.proc.common.EXIOptionsException
+
+
+
+ +

+setGrammarCache

+
+public final void setGrammarCache(GrammarCache grammarCache,
+                                  org.openexi.proc.common.SchemaId schemaId)
+                           throws org.openexi.proc.common.EXIOptionsException
+
+
Set the GrammarCache to be used in encoding XML streams into EXI streams + by the transmogrifier. + The SchemaId contains the string that is written in the header when + HeaderOptionsOutputType.all is set. +

+

+
Parameters:
grammarCache - GrammarCache
schemaId - +
Throws: +
org.openexi.proc.common.EXIOptionsException
+
+
+
+ +

+getGrammarCache

+
+public final GrammarCache getGrammarCache()
+
+
Returns the GrammarCache that was previously set. +

+

+ +
Returns:
a GrammarCache
+
+
+
+ +

+setDatatypeRepresentationMap

+
+public final void setDatatypeRepresentationMap(QName[] dtrm,
+                                               int n_bindings)
+                                        throws org.openexi.proc.common.EXIOptionsException
+
+
Set a datatype representation map (DTRM). The DTRM allows you to remap + XMLSchema datatypes to EXI datatypes other than their default equivalents. + The map is created using a sequence of Qualified Name pairs that identify + a datatype definition in the XMLSchema namespace followed by the new + corresponding datatype mapping in the EXI namespace. +

+ For example, the following lines map the boolean datatype from XMLSchema + to the integer datatype in EXI. +
+   QName q1 = new QName("xsd:boolean","http://www.w3.org/2001/XMLSchema");
+   QName q2 = new QName("exi:integer","http://www.w3.org/2009/exi");
+   QName[] dtrm = new QName[2];
+   dtrm = {q1, q2}; // Each mapping requires 2 qualified names.
+   transmogrifierInstance.setDatatypeRepresentationMap(dtrm, 1); // The array, and the number of pairs (1).
+ 
+

+

+
Parameters:
dtrm - a sequence of pairs of datatype QName and datatype representation QName
n_bindings - the number of QName pairs +
Throws: +
org.openexi.proc.common.EXIOptionsException
+
+
+
+ +

+setEntityResolver

+
+public final void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
+
+
Set an external SAX entity resolver. +

+

+
Parameters:
entityResolver - EntityResolver
+
+
+
+ +

+setOutputCookie

+
+public final void setOutputCookie(boolean outputCookie)
+
+
Tells the encoder whether to or not to start the stream by + adding an EXI cookie. +

+

+
Parameters:
outputCookie - true to include the EXI cookie
+
+
+
+ +

+setOutputOptions

+
+public final void setOutputOptions(HeaderOptionsOutputType outputOptions)
+                            throws org.openexi.proc.common.EXIOptionsException
+
+
Set the header output options. Choices are set using the + HeaderOptionsOutputType enumeration. + Options are all, lessSchemaID (that is, all values + except for the SchemaId), or none. +

+

+
Parameters:
outputOptions - HeaderOptionsOutputType +
Throws: +
org.openexi.proc.common.EXIOptionsException
+
+
+
+ +

+setPreserveWhitespaces

+
+public final void setPreserveWhitespaces(boolean preserveWhitespaces)
+
+
Set to true to preserve whitespace (for example, spaces, tabs, and + line breaks) in the encoded EXI stream. By default, non-essential whitespace + is removed from the encoded stream. +

+

+
Parameters:
preserveWhitespaces - true to retain whitespace in the encoded EXI stream
+
+
+
+ +

+encode

+
+public void encode(org.xml.sax.InputSource is)
+            throws TransmogrifierException,
+                   java.io.IOException
+
+
Parses XML input source and converts it to an EXI stream. +

+

+
Parameters:
is - XML input source +
Throws: +
TransmogrifierException +
java.io.IOException
+
+
+
+ +

+getSAXTransmogrifier

+
+public SAXTransmogrifier getSAXTransmogrifier()
+
+
Returns the SAXTransmogrifier, which implements both the ContentHandler + and LexicalHandler. SAX programmers can connect the SAXTransmogrifier to + their favorite XML Parser to convert SAX events into an EXI stream. +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/TransmogrifierException.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/TransmogrifierException.html new file mode 100644 index 0000000000..55e1e1feaa --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/TransmogrifierException.html @@ -0,0 +1,566 @@ + + + + + + + +TransmogrifierException + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.sax +
+Class TransmogrifierException

+
+java.lang.Object
+  extended by java.lang.Throwable
+      extended by java.lang.Exception
+          extended by org.openexi.sax.TransmogrifierException
+
+
+
All Implemented Interfaces:
java.io.Serializable
+
+
+
+
public final class TransmogrifierException
extends java.lang.Exception
+ + +

+Exception handler for the Transmogrifier. +

+ +

+

+
See Also:
Serialized Form +
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+static intPREFIX_BOUND_TO_ANOTHER_NAMESPACE + +
+          Prefix is bound to another namespace.
+static intPREFIX_NOT_BOUND + +
+          Prefix is not bound.
+static intSAX_ERROR + +
+          SAX error reported by XML parser.
+static intSCRIBER_ERROR + +
+          Errors reported by Scriber.
+static intUNEXPECTED_ATTR + +
+          Unexpected Attribute.
+static intUNEXPECTED_BINARY_VALUE + +
+          Unexpected Binary value.
+static intUNEXPECTED_CHARS + +
+          Unexpected Character Sequence.
+static intUNEXPECTED_ED + +
+          Unexpected End of Document event.
+static intUNEXPECTED_ELEM + +
+          Unexpected Element.
+static intUNEXPECTED_END_ELEM + +
+          Unexpected End of Element event.
+static intUNEXPECTED_SD + +
+          Unexpected Start of Document event.
+static intUNHANDLED_SAXPARSER_FEATURE + +
+          Unhandled SAX parser feature.
+  + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ intgetCode() + +
+          Returns a code that represents the type of the exception.
+ java.lang.ExceptiongetException() + +
+          Returns an Exception object.
+ org.xml.sax.LocatorgetLocator() + +
+          Returns the locator that is associated with this compilation error.
+ java.lang.StringgetMessage() + +
+          Returns a message that describes the exception.
+ + + + + + + +
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+UNEXPECTED_ELEM

+
+public static final int UNEXPECTED_ELEM
+
+
Unexpected Element. +

+

+
See Also:
Constant Field Values
+
+
+ +

+UNEXPECTED_ATTR

+
+public static final int UNEXPECTED_ATTR
+
+
Unexpected Attribute. +

+

+
See Also:
Constant Field Values
+
+
+ +

+UNEXPECTED_CHARS

+
+public static final int UNEXPECTED_CHARS
+
+
Unexpected Character Sequence. +

+

+
See Also:
Constant Field Values
+
+
+ +

+UNEXPECTED_BINARY_VALUE

+
+public static final int UNEXPECTED_BINARY_VALUE
+
+
Unexpected Binary value. +

+

+
See Also:
Constant Field Values
+
+
+ +

+UNHANDLED_SAXPARSER_FEATURE

+
+public static final int UNHANDLED_SAXPARSER_FEATURE
+
+
Unhandled SAX parser feature. +

+

+
See Also:
Constant Field Values
+
+
+ +

+SAX_ERROR

+
+public static final int SAX_ERROR
+
+
SAX error reported by XML parser. +

+

+
See Also:
Constant Field Values
+
+
+ +

+UNEXPECTED_END_ELEM

+
+public static final int UNEXPECTED_END_ELEM
+
+
Unexpected End of Element event. +

+

+
See Also:
Constant Field Values
+
+
+ +

+UNEXPECTED_ED

+
+public static final int UNEXPECTED_ED
+
+
Unexpected End of Document event. +

+

+
See Also:
Constant Field Values
+
+
+ +

+UNEXPECTED_SD

+
+public static final int UNEXPECTED_SD
+
+
Unexpected Start of Document event. +

+

+
See Also:
Constant Field Values
+
+
+ +

+PREFIX_NOT_BOUND

+
+public static final int PREFIX_NOT_BOUND
+
+
Prefix is not bound. +

+

+
See Also:
Constant Field Values
+
+
+ +

+PREFIX_BOUND_TO_ANOTHER_NAMESPACE

+
+public static final int PREFIX_BOUND_TO_ANOTHER_NAMESPACE
+
+
Prefix is bound to another namespace. +

+

+
See Also:
Constant Field Values
+
+
+ +

+SCRIBER_ERROR

+
+public static final int SCRIBER_ERROR
+
+
Errors reported by Scriber. +

+

+
See Also:
Constant Field Values
+
+ + + + + + + + +
+Method Detail
+ +

+getCode

+
+public int getCode()
+
+
Returns a code that represents the type of the exception. +

+

+ +
Returns:
error code
+
+
+
+ +

+getMessage

+
+public java.lang.String getMessage()
+
+
Returns a message that describes the exception. +

+

+
Overrides:
getMessage in class java.lang.Throwable
+
+
+ +
Returns:
error message
+
+
+
+ +

+getException

+
+public java.lang.Exception getException()
+
+
Returns an Exception object. +

+

+ +
Returns:
the error as an Exception instance
+
+
+
+ +

+getLocator

+
+public org.xml.sax.Locator getLocator()
+
+
Returns the locator that is associated with this compilation error. +

+

+ +
Returns:
a Locator if available, otherwise null
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-frame.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-frame.html new file mode 100644 index 0000000000..22e45d692b --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-frame.html @@ -0,0 +1,61 @@ + + + + + + + +org.openexi.sax + + + + + + + + + + + +org.openexi.sax + + + + +
+Interfaces  + +
+BinaryDataHandler +
+SAXTransmogrifier
+ + + + + + +
+Classes  + +
+EXIReader +
+ReaderSupport +
+Transmogrifier
+ + + + + + +
+Exceptions  + +
+TransmogrifierException
+ + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-summary.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-summary.html new file mode 100644 index 0000000000..b0e720814c --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-summary.html @@ -0,0 +1,224 @@ + + + + + + + +org.openexi.sax + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package org.openexi.sax +

+ + + +The SAX package contains the Transmogrifier, which encodes an XML file to an EXI stream, and the EXIReader, which restores an EXI stream to its logical XML equivalent. +

+See: +
+          Description +

+ + + + + + + + + + + + + +
+Interface Summary
BinaryDataHandler 
SAXTransmogrifierApplications can directly feed SAX events into a transmogrifier through SAXTransmogrifier.
+  + +

+ + + + + + + + + + + + + + + + + +
+Class Summary
EXIReaderEXIReader implements the SAX XMLReader to provide a convenient and + familiar interface for decoding an EXI stream.
ReaderSupport 
TransmogrifierThe Transmogrifier converts an XML stream to an EXI stream.
+  + +

+ + + + + + + + + +
+Exception Summary
TransmogrifierExceptionException handler for the Transmogrifier.
+  + +

+

+Package org.openexi.sax Description +

+ +

+ + + + + +
+

The SAX package contains the Transmogrifier, which encodes an XML file to an EXI stream, and the EXIReader, which restores an EXI stream to its logical XML equivalent. These classes are wrappers for the Scriber and EXIDecoder, respectively, and are primarily meant to provide access to EXI using familiar SAX syntax. +

+
+ +
+

+

+ +

+

+ +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-tree.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-tree.html new file mode 100644 index 0000000000..f4184bf934 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-tree.html @@ -0,0 +1,171 @@ + + + + + + + +org.openexi.sax Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package org.openexi.sax +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+
    +
  • java.lang.Object +
+

+Interface Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/Characters.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/Characters.html new file mode 100644 index 0000000000..022f5be35a --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/Characters.html @@ -0,0 +1,486 @@ + + + + + + + +Characters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.schema +
+Class Characters

+
+java.lang.Object
+  extended by org.openexi.schema.Characters
+
+
+
+
public final class Characters
extends java.lang.Object
+ + +

+

+ +
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+ char[]characters + +
+           
+static CharactersCHARACTERS_EMPTY + +
+           
+ booleanisVolatile + +
+           
+ intlength + +
+           
+ intstartIndex + +
+           
+ intucsCount + +
+           
+  + + + + + + + + + + +
+Constructor Summary
Characters(char[] characters, + int startIndex, + int length, + boolean isVolatile) + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ booleanequals(java.lang.Object object) + +
+           
+ inthashCode() + +
+           
+ intindexOf(char c) + +
+           
+ java.lang.StringmakeString() + +
+           
+ java.lang.Stringsubstring(int beginIndex, + int endIndex) + +
+           
+ voidturnPermanent() + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+isVolatile

+
+public boolean isVolatile
+
+
+
+
+
+ +

+characters

+
+public char[] characters
+
+
+
+
+
+ +

+startIndex

+
+public int startIndex
+
+
+
+
+
+ +

+length

+
+public final int length
+
+
+
+
+
+ +

+ucsCount

+
+public final int ucsCount
+
+
+
+
+
+ +

+CHARACTERS_EMPTY

+
+public static final Characters CHARACTERS_EMPTY
+
+
+
+
+ + + + + + + + +
+Constructor Detail
+ +

+Characters

+
+public Characters(char[] characters,
+                  int startIndex,
+                  int length,
+                  boolean isVolatile)
+
+
+ + + + + + + + +
+Method Detail
+ +

+turnPermanent

+
+public void turnPermanent()
+
+
+
+
+
+
+ +

+indexOf

+
+public int indexOf(char c)
+
+
+
+
+
+
+ +

+substring

+
+public java.lang.String substring(int beginIndex,
+                                  int endIndex)
+
+
+
+
+
+
+ +

+hashCode

+
+public int hashCode()
+
+
+
Overrides:
hashCode in class java.lang.Object
+
+
+
+
+
+
+ +

+equals

+
+public boolean equals(java.lang.Object object)
+
+
+
Overrides:
equals in class java.lang.Object
+
+
+
+
+
+
+ +

+makeString

+
+public java.lang.String makeString()
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/EXISchema.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/EXISchema.html new file mode 100644 index 0000000000..f3c472ec5e --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/EXISchema.html @@ -0,0 +1,355 @@ + + + + + + + +EXISchema + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.schema +
+Class EXISchema

+
+java.lang.Object
+  extended by org.openexi.schema.EXISchema
+
+
+
+
public final class EXISchema
extends java.lang.Object
+ + +

+EXISchema provides methods to read and write compiled EXI schemas. +

+ +

+

+ +
+
+ +

+ + + + + + + + + + + +
+Field Summary
+ byte[]ancestryIds + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+static boolean_isSimpleType(int tp, + int[] types) + +
+           
+ booleanisSimpleType(int tp) + +
+           
+static EXISchemareadIn(java.io.DataInputStream in) + +
+          Reads an EXI Schema from a DataInputStream.
+ voidwriteOut(java.io.DataOutputStream out) + +
+          Writes out a serialized EXISchema.
+ voidwriteXml(java.io.OutputStream out, + boolean whole) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+ancestryIds

+
+public transient byte[] ancestryIds
+
+
+
+
+ + + + + + + + +
+Method Detail
+ +

+isSimpleType

+
+public boolean isSimpleType(int tp)
+
+
+
+
+
+
+ +

+_isSimpleType

+
+public static boolean _isSimpleType(int tp,
+                                    int[] types)
+
+
+
+
+
+
+ +

+readIn

+
+public static EXISchema readIn(java.io.DataInputStream in)
+                        throws java.io.IOException,
+                               java.lang.ClassNotFoundException
+
+
Reads an EXI Schema from a DataInputStream. +

+

+
Parameters:
in - DataInputStream containing a serialized EXISchema +
Returns:
EXISchema +
Throws: +
IOException, - ClassNotFoundException +
java.io.IOException +
java.lang.ClassNotFoundException
+
+
+
+ +

+writeOut

+
+public void writeOut(java.io.DataOutputStream out)
+              throws java.io.IOException
+
+
Writes out a serialized EXISchema. +

+

+
Parameters:
out - DataOutputStream to receive the serialized EXISchema +
Throws: +
java.io.IOException
+
+
+
+ +

+writeXml

+
+public void writeXml(java.io.OutputStream out,
+                     boolean whole)
+              throws java.io.IOException
+
+
+ +
Throws: +
java.io.IOException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/EmptySchema.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/EmptySchema.html new file mode 100644 index 0000000000..2a932cc5fb --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/EmptySchema.html @@ -0,0 +1,229 @@ + + + + + + + +EmptySchema + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.schema +
+Class EmptySchema

+
+java.lang.Object
+  extended by org.openexi.schema.EmptySchema
+
+
+
+
public final class EmptySchema
extends java.lang.Object
+ + +

+EmptySchema provides an EXISchema that supports all datatypes inherent + in XML Schema such as xsd:int and xsd:dateTime, but with no + user-specific definitions. This is to support the use of dynamic + datatype associations discovered within elements during processing. +

+ +

+

+ +
+
+ +

+ + + + + + + + + + + + +
+Method Summary
+static EXISchemagetEXISchema() + +
+          Returns an EXISchema that supports all datatypes inherent in XML Schema.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Method Detail
+ +

+getEXISchema

+
+public static EXISchema getEXISchema()
+
+
Returns an EXISchema that supports all datatypes inherent in XML Schema. + Calls to this method always return the same object. +

+

+ +
Returns:
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-frame.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-frame.html new file mode 100644 index 0000000000..4fdd831792 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-frame.html @@ -0,0 +1,37 @@ + + + + + + + +org.openexi.schema + + + + + + + + + + + +org.openexi.schema + + + + +
+Classes  + +
+Characters +
+EmptySchema +
+EXISchema
+ + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-summary.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-summary.html new file mode 100644 index 0000000000..53242f2e32 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-summary.html @@ -0,0 +1,195 @@ + + + + + + + +org.openexi.schema + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package org.openexi.schema +

+ + + +The schema package contains classes that are used to represent XML Schema Documents (XSDs). +

+See: +
+          Description +

+ + + + + + + + + + + + + + + + + +
+Class Summary
Characters 
EmptySchemaEmptySchema provides an EXISchema that supports all datatypes inherent + in XML Schema such as xsd:int and xsd:dateTime, but with no + user-specific definitions.
EXISchemaEXISchema provides methods to read and write compiled EXI schemas.
+  + +

+

+Package org.openexi.schema Description +

+ +

+ + + + + +
+

The schema package contains classes that are used to represent XML Schema Documents (XSDs). EXISchema.writeOut writes an EXISchema to a DataOutputStream (which is typically saved to disk). EXISchema.readIn returns an EXISchema from a DataInputStream (typically from a file on disk), saving the step of processing the schema at runtime. +

+

+EmptySchema is used to create an explicit schema object with default settings. This is to enable the EXIDecoder and Transmogrifier to process element tags that have embedded datatype overrides. +

+ +
+

+

+ +

+

+ +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-tree.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-tree.html new file mode 100644 index 0000000000..dda7f6246f --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-tree.html @@ -0,0 +1,148 @@ + + + + + + + +org.openexi.schema Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package org.openexi.schema +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactory.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactory.html new file mode 100644 index 0000000000..7a95df8e6d --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactory.html @@ -0,0 +1,308 @@ + + + + + + + +EXISchemaFactory + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.scomp +
+Class EXISchemaFactory

+
+java.lang.Object
+  extended by EXISchemaStruct
+      extended by org.openexi.scomp.EXISchemaFactory
+
+
+
+
public class EXISchemaFactory
extends EXISchemaStruct
+ + +

+EXISchemaFactory compiles XML Schema into an EXISchema instance. +

+ +

+

+ +
+
+ +

+ + + + + + + + + + + +
+Constructor Summary
EXISchemaFactory() + +
+           
+  + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ EXISchemacompile(org.xml.sax.InputSource inputSource) + +
+          Compile an XML Schema Document into an EXISchema.
+ voidsetCompilerErrorHandler(EXISchemaFactoryErrorHandler errorHandler) + +
+          Set an error handler to report any errors encountered during + schema compilation.
+ voidsetEntityResolver(EntityResolverEx entityResolver) + +
+          Set an entity resolver for use to resolve entities and schema documents.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+EXISchemaFactory

+
+public EXISchemaFactory()
+
+
+ + + + + + + + +
+Method Detail
+ +

+setCompilerErrorHandler

+
+public void setCompilerErrorHandler(EXISchemaFactoryErrorHandler errorHandler)
+
+
Set an error handler to report any errors encountered during + schema compilation. +

+

+
Parameters:
errorHandler - Error handler
+
+
+
+ +

+setEntityResolver

+
+public void setEntityResolver(EntityResolverEx entityResolver)
+
+
Set an entity resolver for use to resolve entities and schema documents. +

+

+
Parameters:
entityResolverEx - extended SAX entity resolver
+
+
+
+ +

+compile

+
+public final EXISchema compile(org.xml.sax.InputSource inputSource)
+                        throws java.io.IOException,
+                               EXISchemaFactoryException
+
+
Compile an XML Schema Document into an EXISchema. +

+

+
Parameters:
is - XML Schema Document stream from an InputSource +
Returns:
an EXISchema instance +
Throws: +
java.io.IOException +
EXISchemaFactoryException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactoryErrorHandler.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactoryErrorHandler.html new file mode 100644 index 0000000000..48648e4635 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactoryErrorHandler.html @@ -0,0 +1,268 @@ + + + + + + + +EXISchemaFactoryErrorHandler + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.scomp +
+Interface EXISchemaFactoryErrorHandler

+
+
+
public interface EXISchemaFactoryErrorHandler
+ + +

+This interface reports exceptions from EXISchemaFactory during schema + processing. Users of EXISchemaFactory need to provide an + implementation of this interface to receive errors from EXISchemaFactory. +

+ +

+

+
Author:
+
Dennis Dawson
+ +
+
+ +

+ + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voiderror(EXISchemaFactoryException exc) + +
+          Report an error found during schema processing.
+ voidfatalError(EXISchemaFactoryException exc) + +
+          Report a fatal error found during schema processing.
+ voidwarning(EXISchemaFactoryException exc) + +
+          Report a warning found during schema processing.
+  +

+ + + + + + + + +
+Method Detail
+ +

+warning

+
+void warning(EXISchemaFactoryException exc)
+             throws EXISchemaFactoryException
+
+
Report a warning found during schema processing. +

+

+
Parameters:
exc - warning found +
Throws: +
EXISchemaFactoryException - at the discretion of the application
+
+
+
+ +

+error

+
+void error(EXISchemaFactoryException exc)
+           throws EXISchemaFactoryException
+
+
Report an error found during schema processing. Note that errors are + recoverable only as far as the schema processor is concerned. They might + be fatal at the application level. +

+

+
Parameters:
exc - error found +
Throws: +
EXISchemaFactoryException - at the discretion of the application
+
+
+
+ +

+fatalError

+
+void fatalError(EXISchemaFactoryException exc)
+                throws EXISchemaFactoryException
+
+
Report a fatal error found during schema processing. +

+

+
Parameters:
exc - fatal error found +
Throws: +
EXISchemaFactoryException - at the discretion of the application
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactoryException.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactoryException.html new file mode 100644 index 0000000000..598f7db597 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactoryException.html @@ -0,0 +1,350 @@ + + + + + + + +EXISchemaFactoryException + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.scomp +
+Class EXISchemaFactoryException

+
+java.lang.Object
+  extended by java.lang.Throwable
+      extended by java.lang.Exception
+          extended by org.openexi.scomp.EXISchemaFactoryException
+
+
+
All Implemented Interfaces:
java.io.Serializable
+
+
+
+
public class EXISchemaFactoryException
extends java.lang.Exception
+ + +

+Any errors encountered during schema compilation are communicated to + an application as EXISchemaFactoryException objects. +

+ +

+

+
See Also:
EXISchemaFactoryErrorHandler, +Serialized Form
Author:
+
Dennis Dawson
+ +
+
+ +

+ + + + + + + + + + + +
+Field Summary
+static intXMLSCHEMA_ERROR + +
+          The underlying XMLSchema parser found an error in the schema.
+  + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ intgetCode() + +
+          Returns a code that represents the type of the exception.
+ java.lang.ExceptiongetException() + +
+          Returns an Exception object.
+ org.xml.sax.LocatorgetLocator() + +
+          Returns the locator that is associated with this compilation error.
+ java.lang.StringgetMessage() + +
+          Returns a message that describes the exception.
+ + + + + + + +
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+XMLSCHEMA_ERROR

+
+public static final int XMLSCHEMA_ERROR
+
+
The underlying XMLSchema parser found an error in the schema. +

+

+
See Also:
Constant Field Values
+
+ + + + + + + + +
+Method Detail
+ +

+getCode

+
+public int getCode()
+
+
Returns a code that represents the type of the exception. +

+

+ +
Returns:
error code
+
+
+
+ +

+getMessage

+
+public java.lang.String getMessage()
+
+
Returns a message that describes the exception. +

+

+
Overrides:
getMessage in class java.lang.Throwable
+
+
+ +
Returns:
error message
+
+
+
+ +

+getException

+
+public java.lang.Exception getException()
+
+
Returns an Exception object. +

+

+ +
Returns:
an Exception instance for the current exception.
+
+
+
+ +

+getLocator

+
+public org.xml.sax.Locator getLocator()
+
+
Returns the locator that is associated with this compilation error. +

+

+ +
Returns:
a Locator if available, otherwise null
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaReader.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaReader.html new file mode 100644 index 0000000000..6249b50feb --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaReader.html @@ -0,0 +1,264 @@ + + + + + + + +EXISchemaReader + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.scomp +
+Class EXISchemaReader

+
+java.lang.Object
+  extended by EXISchemaStruct
+      extended by org.openexi.scomp.EXISchemaReader
+
+
+
+
public final class EXISchemaReader
extends EXISchemaStruct
+ + +

+EXISchemaReader parses EXI-encoded EXI Grammar into an EXISchema. +

+ +

+

+ +
+
+ +

+ + + + + + + + + + + +
+Constructor Summary
EXISchemaReader() + +
+           
+  + + + + + + + + + + + +
+Method Summary
+ EXISchemaparse(java.io.InputStream inputStream) + +
+          Parses EXI-encoded EXI Grammar into an EXISchema.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+EXISchemaReader

+
+public EXISchemaReader()
+
+
+ + + + + + + + +
+Method Detail
+ +

+parse

+
+public EXISchema parse(java.io.InputStream inputStream)
+                throws java.io.IOException,
+                       org.openexi.proc.common.EXIOptionsException
+
+
Parses EXI-encoded EXI Grammar into an EXISchema. +

+

+
Parameters:
inputStream - EXI-encoded EXI Grammar +
Returns:
EXISchema +
Throws: +
java.io.IOException +
org.openexi.proc.common.EXIOptionsException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EntityResolverEx.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EntityResolverEx.html new file mode 100644 index 0000000000..cd12bdddb1 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EntityResolverEx.html @@ -0,0 +1,241 @@ + + + + + + + +EntityResolverEx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.openexi.scomp +
+Interface EntityResolverEx

+
+
All Superinterfaces:
org.xml.sax.EntityResolver
+
+
+
+
public interface EntityResolverEx
extends org.xml.sax.EntityResolver
+ + +

+Extended SAX EntityResolver interface for resolving entities and + schema documents. +

+ +

+

+ +
+
+ +

+ + + + + + + + + + + + +
+Method Summary
+ org.xml.sax.InputSourceresolveEntity(java.lang.String publicId, + java.lang.String systemId, + java.lang.String namespaceURI) + +
+          This method will be called for resolving schema documents upon + occurrences of XML Schema directives such as "include", "import" and + "redefine" within schemas.
+ + + + + + + +
Methods inherited from interface org.xml.sax.EntityResolver
resolveEntity
+  +

+ + + + + + + + +
+Method Detail
+ +

+resolveEntity

+
+org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
+                                      java.lang.String systemId,
+                                      java.lang.String namespaceURI)
+                                      throws org.xml.sax.SAXException,
+                                             java.io.IOException
+
+
This method will be called for resolving schema documents upon + occurrences of XML Schema directives such as "include", "import" and + "redefine" within schemas. +

+

+
+
+
+
Parameters:
publicId - Public identifier of the schema document that is being resolved
systemId - System identifier of the schema document that is being resolved
namespaceURI - Target namespace name of the schema document that is being resolved +
Returns:
InputSource that represents the schema document if resolved otherwise null +
Throws: +
org.xml.sax.SAXException +
java.io.IOException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-frame.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-frame.html new file mode 100644 index 0000000000..65600a98d7 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-frame.html @@ -0,0 +1,59 @@ + + + + + + + +org.openexi.scomp + + + + + + + + + + + +org.openexi.scomp + + + + +
+Interfaces  + +
+EntityResolverEx +
+EXISchemaFactoryErrorHandler
+ + + + + + +
+Classes  + +
+EXISchemaFactory +
+EXISchemaReader
+ + + + + + +
+Exceptions  + +
+EXISchemaFactoryException
+ + + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-summary.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-summary.html new file mode 100644 index 0000000000..a35b92a223 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-summary.html @@ -0,0 +1,222 @@ + + + + + + + +org.openexi.scomp + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package org.openexi.scomp +

+ + + +The scomp (schema compiler) package contains the EXISchemaFactory, which is used to compile XML Schema Documents (XSDs) to EXISchemas. +

+See: +
+          Description +

+ + + + + + + + + + + + + +
+Interface Summary
EntityResolverExExtended SAX EntityResolver interface for resolving entities and + schema documents.
EXISchemaFactoryErrorHandlerThis interface reports exceptions from EXISchemaFactory during schema + processing.
+  + +

+ + + + + + + + + + + + + +
+Class Summary
EXISchemaFactoryEXISchemaFactory compiles XML Schema into an EXISchema instance.
EXISchemaReaderEXISchemaReader parses EXI-encoded EXI Grammar into an EXISchema.
+  + +

+ + + + + + + + + +
+Exception Summary
EXISchemaFactoryExceptionAny errors encountered during schema compilation are communicated to + an application as EXISchemaFactoryException objects.
+  + +

+

+Package org.openexi.scomp Description +

+ +

+ + + + + +
+

The scomp (schema compiler) package contains the EXISchemaFactory, which is used to compile XML Schema Documents (XSDs) to EXISchemas. Developers can implement the interface EXISchemaFactoryErrorHandler to capture and report runtime exceptions from EXISchemaFactory. +

+
+ +
+

+

+ +

+

+ +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-tree.html b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-tree.html new file mode 100644 index 0000000000..93d1752d5a --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-tree.html @@ -0,0 +1,162 @@ + + + + + + + +org.openexi.scomp Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package org.openexi.scomp +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +

+Interface Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/overview-frame.html b/third-party/org.openexi/nagasena/src/main/resources/doc/overview-frame.html new file mode 100644 index 0000000000..045191d7df --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/overview-frame.html @@ -0,0 +1,55 @@ + + + + + + + +Overview + + + + + + + + + + + + + + + +
+
+ + + + + +
All Classes +

+ +Packages +
+org.openexi.proc +
+org.openexi.proc.common +
+org.openexi.proc.grammars +
+org.openexi.proc.io +
+org.openexi.sax +
+org.openexi.schema +
+org.openexi.scomp +
+

+ +

+  + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/overview-summary.html b/third-party/org.openexi/nagasena/src/main/resources/doc/overview-summary.html new file mode 100644 index 0000000000..1a299fd622 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/overview-summary.html @@ -0,0 +1,227 @@ + + + + + + + +Overview + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +


+
+

+OpenEXI Nagasena +

+
+ + + +OpenEXI is a W3C open source API for converting XML files to the Efficient XML Interchange format (EXI). +

+See: +
+          Description +

+ + + + + + + + + +The Proc (Processor) package contains the EXIDecoder, which is used to convert EXI streams to XML format. + + + + + +The common package contains classes, interfaces, and enumerators that define the vocabulary used to describe EXI streams (events, options, alignment, and character string values). + + + + + +The grammars package contains the GrammarCache, which combines an XML Schema Definition with EXI grammar options to create an EXI Schema. + + + + + +The IO package contains the Scanner, which is used by EXIDecoder to read and interpret EXI streams. + + + + + +The SAX package contains the Transmogrifier, which encodes an XML file to an EXI stream, and the EXIReader, which restores an EXI stream to its logical XML equivalent. + + + + + +The schema package contains classes that are used to represent XML Schema Documents (XSDs). + + + + + +The scomp (schema compiler) package contains the EXISchemaFactory, which is used to compile XML Schema Documents (XSDs) to EXISchemas. + +
+Packages
org.openexi.proc +
org.openexi.proc.common +
org.openexi.proc.grammars +
org.openexi.proc.io +
org.openexi.sax +
org.openexi.schema +
org.openexi.scomp +
+ +

+

+ + + + + +
+

OpenEXI is a W3C open source API for converting XML files to the Efficient XML Interchange format (EXI). +

+

You can learn more about OpenEXI by visiting the OpenEXI homepage at openexi.sourceforge.net. +

+ +
+

+

+ +

+

+ +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/overview-tree.html b/third-party/org.openexi/nagasena/src/main/resources/doc/overview-tree.html new file mode 100644 index 0000000000..8409fdb317 --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/overview-tree.html @@ -0,0 +1,190 @@ + + + + + + + +Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For All Packages

+
+
+
Package Hierarchies:
org.openexi.proc, org.openexi.proc.common, org.openexi.proc.grammars, org.openexi.proc.io, org.openexi.sax, org.openexi.schema, org.openexi.scomp
+
+

+Class Hierarchy +

+ +

+Interface Hierarchy +

+ +

+Enum Hierarchy +

+
    +
  • java.lang.Object +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/package-list b/third-party/org.openexi/nagasena/src/main/resources/doc/package-list new file mode 100644 index 0000000000..746aadc8bd --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/package-list @@ -0,0 +1,7 @@ +org.openexi.proc +org.openexi.proc.common +org.openexi.proc.grammars +org.openexi.proc.io +org.openexi.sax +org.openexi.schema +org.openexi.scomp diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/resources/inherit.gif b/third-party/org.openexi/nagasena/src/main/resources/doc/resources/inherit.gif new file mode 100644 index 0000000000..c814867a13 Binary files /dev/null and b/third-party/org.openexi/nagasena/src/main/resources/doc/resources/inherit.gif differ diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/serialized-form.html b/third-party/org.openexi/nagasena/src/main/resources/doc/serialized-form.html new file mode 100644 index 0000000000..c3688f526d --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/serialized-form.html @@ -0,0 +1,269 @@ + + + + + + + +Serialized Form + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Serialized Form

+
+
+ + + + + +
+Package org.openexi.sax
+ +

+ + + + + +
+Class org.openexi.sax.TransmogrifierException extends java.lang.Exception implements Serializable
+ +

+serialVersionUID: -4536662596727577640L + +

+ + + + + +
+Serialized Fields
+ +

+m_code

+
+int m_code
+
+
+
+
+
+

+m_message

+
+java.lang.String m_message
+
+
+
+
+
+

+m_exception

+
+java.lang.Exception m_exception
+
+
+
+
+
+

+m_locator

+
+org.xml.sax.Locator m_locator
+
+
+
+
+
+ + + + + +
+Package org.openexi.scomp
+ +

+ + + + + +
+Class org.openexi.scomp.EXISchemaFactoryException extends java.lang.Exception implements Serializable
+ +

+serialVersionUID: 3816521974819647026L + +

+ + + + + +
+Serialized Fields
+ +

+m_code

+
+int m_code
+
+
+
+
+
+

+m_message

+
+java.lang.String m_message
+
+
+
+
+
+

+m_exception

+
+java.lang.Exception m_exception
+
+
+
+
+
+

+m_locator

+
+org.xml.sax.Locator m_locator
+
+
+
+
+ +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/third-party/org.openexi/nagasena/src/main/resources/doc/stylesheet.css b/third-party/org.openexi/nagasena/src/main/resources/doc/stylesheet.css new file mode 100644 index 0000000000..14c3737e8a --- /dev/null +++ b/third-party/org.openexi/nagasena/src/main/resources/doc/stylesheet.css @@ -0,0 +1,29 @@ +/* Javadoc style sheet */ + +/* Define colors, fonts and other style attributes here to override the defaults */ + +/* Page background color */ +body { background-color: #FFFFFF } + +/* Headings */ +h1 { font-size: 145% } + +/* Table colors */ +.TableHeadingColor { background: #CCCCFF } /* Dark mauve */ +.TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ +.TableRowColor { background: #FFFFFF } /* White */ + +/* Font used in left-hand frame lists */ +.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif } +.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } +.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } + +/* Navigation bar fonts and colors */ +.NavBarCell1 { background-color:#EEEEFF;} /* Light mauve */ +.NavBarCell1Rev { background-color:#00008B;} /* Dark Blue */ +.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} +.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} + +.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} +.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} + diff --git a/third-party/org.openexi/pom.xml b/third-party/org.openexi/pom.xml new file mode 100644 index 0000000000..d623ef8cdc --- /dev/null +++ b/third-party/org.openexi/pom.xml @@ -0,0 +1,50 @@ + + + + + 4.0.0 + + + org.opendaylight.controller + commons.thirdparty + 1.1.2-SNAPSHOT + ../commons/thirdparty + + + org.opendaylight.controller.thirdparty + org.openexi + 0000.0002.0035.0-SNAPSHOT + pom + + 3.0.4 + + + + nagasena + nagasena-rta + + + + + + + org.codehaus.mojo + truezip-maven-plugin + 1.1 + + + org.apache.felix + maven-bundle-plugin + 2.4.0 + + + + + +