Merge changes Ic434bf4a,I05a3fb18,I47a3783d,I8234bbfd
authorTony Tkacik <ttkacik@cisco.com>
Thu, 20 Nov 2014 09:05:53 +0000 (09:05 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 20 Nov 2014 09:05:53 +0000 (09:05 +0000)
* changes:
  Fix checkstyle warnings in netconf-cli
  Fix checkstyle warnings ietf-netconf-monitoring
  Fix checkstyle warnings for netconf-testtool
  Fix checkstyle warnings for config-netconf-connector

335 files changed:
opendaylight/adsal/switchmanager/integrationtest/src/test/java/org/opendaylight/controller/switchmanager/internal/SwitchManagerIT.java
opendaylight/adsal/topologymanager/integrationtest/src/test/java/org/opendaylight/controller/topologymanager/TopologyManagerIT.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ServiceReferenceRegistryImpl.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/InterfacesHelper.java
opendaylight/distribution/opendaylight/opendaylight-application.launch [deleted file]
opendaylight/distribution/opendaylight/opendaylight-assembleit-fast.launch [deleted file]
opendaylight/distribution/opendaylight/opendaylight-assembleit-full.launch [deleted file]
opendaylight/distribution/opendaylight/opendaylight-assembleit-noclean.launch [deleted file]
opendaylight/distribution/opendaylight/opendaylight-assembleit-skiput.launch [deleted file]
opendaylight/distribution/opendaylight/opendaylight-assembleit-sonar.launch [deleted file]
opendaylight/distribution/opendaylight/opendaylight-assembleit.launch [deleted file]
opendaylight/distribution/opendaylight/opendaylight-local.target [deleted file]
opendaylight/distribution/opendaylight/opendaylight-osgi-launcher-local.launch [deleted file]
opendaylight/distribution/opendaylight/opendaylight-osgi-launcher.launch [deleted file]
opendaylight/distribution/opendaylight/opendaylight-sonar-fast.launch [deleted file]
opendaylight/distribution/opendaylight/opendaylight-sonar.launch [deleted file]
opendaylight/distribution/opendaylight/opendaylight.target [deleted file]
opendaylight/distribution/opendaylight/pom.xml [deleted file]
opendaylight/distribution/opendaylight/runsanity.bat [deleted file]
opendaylight/distribution/opendaylight/runsanity.sh [deleted file]
opendaylight/distribution/opendaylight/src/assemble/bin.xml [deleted file]
opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini [deleted file]
opendaylight/distribution/opendaylight/src/main/resources/configuration/context.xml [deleted file]
opendaylight/distribution/opendaylight/src/main/resources/configuration/cors-config.xml [deleted file]
opendaylight/distribution/opendaylight/src/main/resources/configuration/logback.xml [deleted file]
opendaylight/distribution/opendaylight/src/main/resources/configuration/startup/README [deleted file]
opendaylight/distribution/opendaylight/src/main/resources/configuration/tomcat-logging.properties [deleted file]
opendaylight/distribution/opendaylight/src/main/resources/configuration/tomcat-server.xml [deleted file]
opendaylight/distribution/opendaylight/src/main/resources/functions.sh [deleted file]
opendaylight/distribution/opendaylight/src/main/resources/run.bat [deleted file]
opendaylight/distribution/opendaylight/src/main/resources/run.sh [deleted file]
opendaylight/distribution/opendaylight/src/main/resources/version.properties [deleted file]
opendaylight/distribution/sanitytest/pom.xml [deleted file]
opendaylight/distribution/sanitytest/src/main/java/org/opendaylight/controller/distribution/Sanity.java [deleted file]
opendaylight/distribution/sanitytest/src/main/java/org/opendaylight/controller/sanitytest/internal/Activator.java [deleted file]
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/TestDriver.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ConfigParams.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/DefaultConfigParamsImpl.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftState.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/IsolatedLeaderCheck.java [new file with mode: 0644]
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeader.java [new file with mode: 0644]
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractRaftActorBehavior.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Candidate.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/IsolatedLeader.java [new file with mode: 0644]
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Leader.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/IsolatedLeaderTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/NormalizedNodeSerializer.java
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/xml/codec/XmlUtilsTest.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContext.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedConfigDataStoreProviderModule.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedOperationalDataStoreProviderModule.java
opendaylight/md-sal/sal-distributed-datastore/src/main/yang/distributed-datastore-provider.yang
opendaylight/md-sal/sal-dom-broker/pom.xml
opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/jdbc/JDBCServer.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/config/yang/md/sal/connector/netconf/NetconfConnectorModule.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/schema/mapping/NetconfMessageTransformer.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestCodec.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestconfImpl.java
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/cnsn/to/json/test/CnSnToJsonLeafrefType.java
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/json/to/cnsn/test/JsonLeafrefToCnSnTest.java
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/XmlAndJsonToCnSnLeafRefTest.java
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/xml/to/cnsn/test/XmlToCnSnTest.java
opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/cont-augment-module.yang
opendaylight/md-sal/sal-rest-connector/src/test/resources/cnsn-to-json/leafref/xml/data_ref_to_not_leaf.xml
opendaylight/md-sal/sal-rest-connector/src/test/resources/leafref/json/jsondata.json
opendaylight/md-sal/sal-rest-connector/src/test/resources/leafref/xml/xmldata.xml
opendaylight/md-sal/sal-rest-connector/src/test/resources/xml-to-cnsn/leafref/leafref-module
opendaylight/md-sal/sal-rest-connector/src/test/resources/xml-to-cnsn/leafref/xml/data.xml
opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.java
opendaylight/md-sal/topology-manager/src/test/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporterTest.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/Activator.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiator.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/SubtreeFilter.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiatorTest.java [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/SubtreeFilterTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/osgi/NetconfImplActivatorTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceFactoryTrackerTest.java
opendaylight/netconf/netconf-impl/src/test/resources/subtree/10/post-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/10/pre-filter.xml [new file with mode: 0644]
opendaylight/netconf/netconf-impl/src/test/resources/subtree/10/request.xml [new file with mode: 0644]
pom.xml
third-party/commons/thirdparty/pom.xml [deleted file]
third-party/jersey-servlet/pom.xml [deleted file]
third-party/net.sf.jung2/pom.xml [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/blockmodel/StructurallyEquivalent.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/blockmodel/VertexPartition.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/blockmodel/package.html [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/cluster/BicomponentClusterer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/cluster/EdgeBetweennessClusterer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/cluster/VoltageClusterer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/cluster/WeakComponentClusterer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/cluster/package.html [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/filters/EdgePredicateFilter.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/filters/Filter.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/filters/FilterUtils.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/filters/KNeighborhoodFilter.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/filters/VertexPredicateFilter.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/filters/package.html [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/flows/EdmondsKarpMaxFlow.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/flows/package.html [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/EvolvingGraphGenerator.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/GraphGenerator.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/Lattice2DGenerator.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/package.html [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/BarabasiAlbertGenerator.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/EppsteinPowerLawGenerator.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/ErdosRenyiGenerator.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/KleinbergSmallWorldGenerator.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/MixedRandomGraphGenerator.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/package.html [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/importance/AbstractRanker.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/importance/BetweennessCentrality.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/importance/KStepMarkov.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/importance/Ranking.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/importance/RelativeAuthorityRanker.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/importance/WeightedNIPaths.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/AbstractLayout.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/AggregateLayout.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/BalloonLayout.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/CircleLayout.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/DAGLayout.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/FRLayout.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/FRLayout2.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/GraphElementAccessor.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/ISOMLayout.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/KKLayout.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/Layout.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/LayoutDecorator.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/PolarPoint.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/RadialTreeLayout.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/RadiusGraphElementAccessor.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/SpringLayout.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/SpringLayout2.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/StaticLayout.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/TreeLayout.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/package.html [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/util/RandomLocationTransformer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/util/Relaxer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/util/VisRunner.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/util/package.html [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/matrix/MatrixElementOperations.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/matrix/RealMatrixElementOperations.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/matrix/package.html [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/metrics/Metrics.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/metrics/StructuralHoles.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/metrics/TriadicCensus.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/metrics/package.html [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/package.html [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/AbstractIterativeScorer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/AbstractIterativeScorerWithPriors.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/BarycenterScorer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/BetweennessCentrality.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/ClosenessCentrality.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/DegreeScorer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/DistanceCentralityScorer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/EdgeScorer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/EigenvectorCentrality.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/HITS.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/HITSWithPriors.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/KStepMarkov.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/PageRank.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/PageRankWithPriors.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/VertexScorer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/VoltageScorer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/package.html [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/DelegateToEdgeTransformer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/ScoringUtils.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/UniformDegreeWeight.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/UniformInOut.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/VEPair.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/VertexScoreTransformer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/package.html [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/BFSDistanceLabeler.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/DijkstraDistance.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/DijkstraShortestPath.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/Distance.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/DistanceStatistics.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/MinimumSpanningForest.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/MinimumSpanningForest2.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/PrimMinimumSpanningTree.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/ShortestPath.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/ShortestPathUtils.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/UnweightedShortestPath.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/package.html [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/transformation/DirectionTransformer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/transformation/FoldingTransformer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/transformation/VertexPartitionCollapser.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/transformation/package.html [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/BasicMapEntry.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/ConstantMap.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/DiscreteDistribution.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/Indexer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/IterativeContext.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/IterativeProcess.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/KMeansClusterer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/MapBinaryHeap.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/MapSettableTransformer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/SelfLoopEdgePredicate.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/SettableTransformer.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/WeightedChoice.java [deleted file]
third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/package.html [deleted file]
third-party/openflowj/LICENSE [deleted file]
third-party/openflowj/Makefile [deleted file]
third-party/openflowj/README [deleted file]
third-party/openflowj/eclipse_codestyle.xml [deleted file]
third-party/openflowj/lib/commons-cli-1.2.jar [deleted file]
third-party/openflowj/lib/junit-4.8.1.jar [deleted file]
third-party/openflowj/pom.xml [deleted file]
third-party/openflowj/src/main/java/org/openflow/example/SelectListener.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/example/SelectLoop.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/example/SimpleController.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/example/cli/Option.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/example/cli/Options.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/example/cli/ParseException.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/example/cli/SimpleCLI.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/io/OFMessageAsyncStream.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/io/OFMessageInStream.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/io/OFMessageOutStream.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/Instantiable.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFBarrierReply.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFBarrierRequest.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFEchoReply.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFEchoRequest.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFError.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFFeaturesReply.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFFeaturesRequest.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFFlowMod.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFFlowRemoved.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFGetConfigReply.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFGetConfigRequest.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFHello.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFMatch.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFMatchBeanInfo.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFMessage.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFPacketIn.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFPacketOut.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFPhysicalPort.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFPort.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFPortMod.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFPortStatus.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFQueueConfigReply.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFQueueConfigRequest.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFSetConfig.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFStatisticsMessageBase.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFStatisticsReply.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFStatisticsRequest.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFSwitchConfig.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFType.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/OFVendor.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/ActionVendorOutputNextHop.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/OFAction.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionDataLayer.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionDataLayerDestination.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionDataLayerSource.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionEnqueue.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionNetworkLayerAddress.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionNetworkLayerDestination.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionNetworkLayerSource.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionNetworkTypeOfService.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionOutput.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionStripVirtualLan.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionTransportLayer.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionTransportLayerDestination.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionTransportLayerSource.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionType.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionVendor.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionVirtualLanIdentifier.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionVirtualLanPriorityCodePoint.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/factory/BasicFactory.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFActionFactory.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFActionFactoryAware.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFMessageFactory.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFMessageFactoryAware.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFQueuePropertyFactory.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFQueuePropertyFactoryAware.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFStatisticsFactory.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFStatisticsFactoryAware.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/queue/OFPacketQueue.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/queue/OFQueueProperty.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/queue/OFQueuePropertyMinRate.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/queue/OFQueuePropertyType.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFAggregateStatisticsReply.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFAggregateStatisticsRequest.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFDescriptionStatistics.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFFlowStatisticsReply.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFFlowStatisticsRequest.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFPortStatisticsReply.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFPortStatisticsRequest.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFQueueStatisticsReply.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFQueueStatisticsRequest.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFStatistics.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFStatisticsType.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFTableStatistics.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFVendorStatistics.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/util/HexString.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/util/LRULinkedHashMap.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/util/StringByteSerializer.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/util/U16.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/util/U32.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/util/U64.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/util/U8.java [deleted file]
third-party/openflowj/src/main/java/org/openflow/util/Unsigned.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/io/OFMessageAsyncStreamTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/BasicFactoryTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/OFActionTypeTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/OFBarrierReplyTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/OFBarrierRequestTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/OFErrorTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/OFFeaturesReplyTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/OFFlowRemovedTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/OFGetConfigReplyTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/OFGetConfigRequestTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/OFMatchTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/OFPortConfigTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/OFPortStatusTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/OFQueueConfigTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/OFSetConfigTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/OFStatisticsReplyTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/OFStatisticsRequestTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/OFStatisticsTypeTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/OFTypeTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/OFVendorTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/protocol/queue/OFQueuePropertyTypeTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/util/HexStringTest.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/util/OFTestCase.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/util/U16Test.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/util/U32Test.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/util/U64Test.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/util/U8Test.java [deleted file]
third-party/openflowj/src/test/java/org/openflow/util/UnsignedTest.java [deleted file]
third-party/org.apache.catalina.filters.CorsFilter/README [deleted file]
third-party/org.apache.catalina.filters.CorsFilter/pom.xml [deleted file]
third-party/org.apache.catalina.filters.CorsFilter/src/main/java/org/apache/catalina/filters/CorsFilter.java [deleted file]

index 64098ec5157b6b4c216393c2c00b615fce032806..3963abf26540c40229cff6079e77a6fa2f9ae94b 100644 (file)
@@ -155,7 +155,7 @@ public class SwitchManagerIT {
         assertFalse(debugit);
 
         // Now lets create a hosttracker for testing purpose
-        ServiceReference s = bc.getServiceReference(ISwitchManager.class
+        ServiceReference<?> s = bc.getServiceReference(ISwitchManager.class
                 .getName());
         if (s != null) {
             this.switchManager = (ISwitchManager) bc.getService(s);
index 08934f32c78c5640fe2926017f2cafee8e58a03b..c2fc8aaa8efd0b85886bf9a65b7ccb5ee5de0b52 100644 (file)
@@ -159,7 +159,7 @@ public class TopologyManagerIT {
 
         Set<Property> properties = new HashSet<Property>();
 
-        ServiceReference r = bc.getServiceReference(IPluginInTopologyService.class
+        ServiceReference<?> r = bc.getServiceReference(IPluginInTopologyService.class
                 .getName());
         TopologyServices topologyServices = null;
         if (r != null) {
index 0f881e95add37a0ac925ff1b835ba2813cc6c4b0..0dff41402ebd747bb69c3805d216a1e5f7e45b8e 100644 (file)
@@ -8,7 +8,8 @@
 package org.opendaylight.controller.config.manager.impl;
 
 import static com.google.common.base.Preconditions.checkNotNull;
-
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -71,22 +72,22 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
             }
 
             @Override
-            public Set<ObjectName> lookupConfigBeans(String moduleName) {
+            public Set<ObjectName> lookupConfigBeans(final String moduleName) {
                 throw new UnsupportedOperationException();
             }
 
             @Override
-            public Set<ObjectName> lookupConfigBeans(String moduleName, String instanceName) {
+            public Set<ObjectName> lookupConfigBeans(final String moduleName, final String instanceName) {
                 throw new UnsupportedOperationException();
             }
 
             @Override
-            public ObjectName lookupConfigBean(String moduleName, String instanceName) throws InstanceNotFoundException {
+            public ObjectName lookupConfigBean(final String moduleName, final String instanceName) throws InstanceNotFoundException {
                 throw new UnsupportedOperationException();
             }
 
             @Override
-            public void checkConfigBeanExists(ObjectName objectName) throws InstanceNotFoundException {
+            public void checkConfigBeanExists(final ObjectName objectName) throws InstanceNotFoundException {
                 throw new InstanceNotFoundException("Cannot find " + objectName + " - Tried to use mocking registry");
             }
 
@@ -110,7 +111,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
                     }
 
                     @Override
-                    public ServiceReferenceJMXRegistration registerMBean(ServiceReferenceMXBeanImpl object, ObjectName on) throws InstanceAlreadyExistsException {
+                    public ServiceReferenceJMXRegistration registerMBean(final ServiceReferenceMXBeanImpl object, final ObjectName on) throws InstanceAlreadyExistsException {
                         throw new UnsupportedOperationException();
                     }
 
@@ -128,9 +129,9 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
     /**
      * Static constructor for transaction controller. Take current state as seen by config registry, allow writing new data.
      */
-    public static SearchableServiceReferenceWritableRegistry createSRWritableRegistry(ServiceReferenceReadableRegistry oldReadableRegistry,
-                                                    ConfigTransactionLookupRegistry txLookupRegistry,
-                                                    Map<String, Map.Entry<ModuleFactory, BundleContext>> currentlyRegisteredFactories) {
+    public static SearchableServiceReferenceWritableRegistry createSRWritableRegistry(final ServiceReferenceReadableRegistry oldReadableRegistry,
+                                                    final ConfigTransactionLookupRegistry txLookupRegistry,
+                                                    final Map<String, Map.Entry<ModuleFactory, BundleContext>> currentlyRegisteredFactories) {
 
         if (txLookupRegistry == null) {
             throw new IllegalArgumentException("txLookupRegistry is null");
@@ -148,8 +149,8 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
     /**
      * Copy back state to config registry after commit.
      */
-    public static CloseableServiceReferenceReadableRegistry createSRReadableRegistry(ServiceReferenceWritableRegistry oldWritableRegistry,
-                                                                            LookupRegistry lookupRegistry, BaseJMXRegistrator baseJMXRegistrator) {
+    public static CloseableServiceReferenceReadableRegistry createSRReadableRegistry(final ServiceReferenceWritableRegistry oldWritableRegistry,
+                                                                            final LookupRegistry lookupRegistry, final BaseJMXRegistrator baseJMXRegistrator) {
         ServiceReferenceRegistryImpl old = (ServiceReferenceRegistryImpl) oldWritableRegistry;
 
         // even if factories do change, nothing in the mapping can change between transactions
@@ -163,7 +164,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
     /**
      * Fill refNames and mBeans maps from old instance
      */
-    private static void copy(ServiceReferenceRegistryImpl old, ServiceReferenceRegistryImpl newRegistry, String nullableDstTransactionName) {
+    private static void copy(final ServiceReferenceRegistryImpl old, final ServiceReferenceRegistryImpl newRegistry, final String nullableDstTransactionName) {
         for (Entry<ServiceReference, Entry<ServiceReferenceMXBeanImpl, ServiceReferenceJMXRegistration>> refNameEntry : old.mBeans.entrySet()) {
             ObjectName currentImplementation;
             ObjectName currentImplementationSrc = refNameEntry.getValue().getKey().getCurrentImplementation();
@@ -182,7 +183,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
         }
     }
 
-    private static Map<String, ModuleFactory> extractFactoriesMap(Map<String, Map.Entry<ModuleFactory, BundleContext>> currentlyRegisteredFactories) {
+    private static Map<String, ModuleFactory> extractFactoriesMap(final Map<String, Map.Entry<ModuleFactory, BundleContext>> currentlyRegisteredFactories) {
         Map<String, ModuleFactory> result = new HashMap<>();
         for (Entry<String, Entry<ModuleFactory, BundleContext>> entry : currentlyRegisteredFactories.entrySet()) {
             result.put(entry.getKey(), entry.getValue().getKey());
@@ -190,9 +191,9 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
         return result;
     }
 
-    private ServiceReferenceRegistryImpl(Map<String, ModuleFactory> factories, LookupRegistry lookupRegistry,
-                                         ServiceReferenceTransactionRegistratorFactory serviceReferenceRegistratorFactory,
-                                         boolean writable) {
+    private ServiceReferenceRegistryImpl(final Map<String, ModuleFactory> factories, final LookupRegistry lookupRegistry,
+                                         final ServiceReferenceTransactionRegistratorFactory serviceReferenceRegistratorFactory,
+                                         final boolean writable) {
         this.factories = factories;
         this.writable = writable;
         this.lookupRegistry = lookupRegistry;
@@ -213,10 +214,10 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
             Set<String> qNames = InterfacesHelper.getQNames(siAnnotations);
             allAnnotations.addAll(siAnnotations);
             allQNameSet.addAll(qNames);
-            modifiableFactoryNamesToQNames.put(entry.getKey(), Collections.unmodifiableSet(qNames));
+            modifiableFactoryNamesToQNames.put(entry.getKey(), qNames);
         }
-        this.factoryNamesToQNames = Collections.unmodifiableMap(modifiableFactoryNamesToQNames);
-        this.allQNames = Collections.unmodifiableSet(allQNameSet);
+        this.factoryNamesToQNames = ImmutableMap.copyOf(modifiableFactoryNamesToQNames);
+        this.allQNames = ImmutableSet.copyOf(allQNameSet);
         // fill namespacesToAnnotations
         Map<String /* namespace */, Map<String /* localName */, ServiceInterfaceAnnotation>> modifiableNamespacesToAnnotations =
                 new HashMap<>();
@@ -235,13 +236,13 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
             ofNamespace.put(sia.localName(), sia);
             modifiableServiceQNamesToAnnotations.put(sia.value(), sia);
         }
-        this.namespacesToAnnotations = Collections.unmodifiableMap(modifiableNamespacesToAnnotations);
-        this.serviceQNamesToAnnotations = Collections.unmodifiableMap(modifiableServiceQNamesToAnnotations);
+        this.namespacesToAnnotations = ImmutableMap.copyOf(modifiableNamespacesToAnnotations);
+        this.serviceQNamesToAnnotations = ImmutableMap.copyOf(modifiableServiceQNamesToAnnotations);
         LOGGER.trace("factoryNamesToQNames:{}", this.factoryNamesToQNames);
     }
 
     @Override
-    public Map<ServiceInterfaceAnnotation, String /* service ref name */> findServiceInterfaces(ModuleIdentifier moduleIdentifier) {
+    public Map<ServiceInterfaceAnnotation, String /* service ref name */> findServiceInterfaces(final ModuleIdentifier moduleIdentifier) {
         Map<ServiceInterfaceAnnotation, String /* service ref name */> result = modulesToServiceRef.get(moduleIdentifier);
         if (result == null) {
             return Collections.emptyMap();
@@ -250,7 +251,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
     }
 
     @Override
-    public synchronized Set<String> lookupServiceInterfaceNames(ObjectName objectName) throws InstanceNotFoundException {
+    public synchronized Set<String> lookupServiceInterfaceNames(final ObjectName objectName) throws InstanceNotFoundException {
         lookupRegistry.checkConfigBeanExists(objectName);
 
         String factoryName = ObjectNameUtil.getFactoryName(objectName);
@@ -264,7 +265,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
     }
 
     @Override
-    public synchronized String getServiceInterfaceName(String namespace, String localName) {
+    public synchronized String getServiceInterfaceName(final String namespace, final String localName) {
         Map<String /* localName */, ServiceInterfaceAnnotation> ofNamespace = namespacesToAnnotations.get(namespace);
         if (ofNamespace == null) {
             LOGGER.error("Cannot find namespace {} in {}", namespace, namespacesToAnnotations);
@@ -295,7 +296,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
         return result;
     }
 
-    private ObjectName getObjectName(ModuleIdentifier moduleIdentifier) {
+    private ObjectName getObjectName(final ModuleIdentifier moduleIdentifier) {
         ObjectName on;
         try {
             on = lookupRegistry.lookupConfigBean(moduleIdentifier.getFactoryName(), moduleIdentifier.getInstanceName());
@@ -307,7 +308,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
     }
 
     @Override
-    public synchronized ObjectName lookupConfigBeanByServiceInterfaceName(String serviceInterfaceQName, String refName) {
+    public synchronized ObjectName lookupConfigBeanByServiceInterfaceName(final String serviceInterfaceQName, final String refName) {
         ServiceReference serviceReference = new ServiceReference(serviceInterfaceQName, refName);
         ModuleIdentifier moduleIdentifier = refNames.get(serviceReference);
         if (moduleIdentifier == null) {
@@ -318,7 +319,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
     }
 
     @Override
-    public synchronized Map<String /* refName */, ObjectName> lookupServiceReferencesByServiceInterfaceName(String serviceInterfaceQName) {
+    public synchronized Map<String /* refName */, ObjectName> lookupServiceReferencesByServiceInterfaceName(final String serviceInterfaceQName) {
         Map<String, Map<String, ObjectName>> serviceMapping = getServiceMapping();
         Map<String, ObjectName> innerMap = serviceMapping.get(serviceInterfaceQName);
         if (innerMap == null) {
@@ -329,7 +330,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
     }
 
     @Override
-    public synchronized ObjectName getServiceReference(String serviceInterfaceQName, String refName) throws InstanceNotFoundException {
+    public synchronized ObjectName getServiceReference(final String serviceInterfaceQName, final String refName) throws InstanceNotFoundException {
         ServiceReference serviceReference = new ServiceReference(serviceInterfaceQName, refName);
         if (mBeans.containsKey(serviceReference) == false) {
             throw new InstanceNotFoundException("Cannot find " + serviceReference);
@@ -338,7 +339,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
     }
 
     @Override
-    public synchronized void checkServiceReferenceExists(ObjectName objectName) throws InstanceNotFoundException {
+    public synchronized void checkServiceReferenceExists(final ObjectName objectName) throws InstanceNotFoundException {
         String actualTransactionName = ObjectNameUtil.getTransactionName(objectName);
         String expectedTransactionName = serviceReferenceRegistrator.getNullableTransactionName();
         if (writable & actualTransactionName == null || (writable && actualTransactionName.equals(expectedTransactionName) == false)) {
@@ -362,19 +363,19 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
     }
 
     @Override
-    public synchronized ObjectName saveServiceReference(String serviceInterfaceName, String refName, ObjectName moduleON)  throws InstanceNotFoundException {
+    public synchronized ObjectName saveServiceReference(final String serviceInterfaceName, final String refName, final ObjectName moduleON)  throws InstanceNotFoundException {
         assertWritable();
         ServiceReference serviceReference = new ServiceReference(serviceInterfaceName, refName);
         return saveServiceReference(serviceReference, moduleON);
     }
 
-    private synchronized ObjectName saveServiceReference(ServiceReference serviceReference, ObjectName moduleON)
+    private synchronized ObjectName saveServiceReference(final ServiceReference serviceReference, final ObjectName moduleON)
             throws InstanceNotFoundException{
         return saveServiceReference(serviceReference, moduleON, false);
     }
 
-    private synchronized ObjectName saveServiceReference(ServiceReference serviceReference, ObjectName moduleON,
-                                                         boolean skipChecks) throws InstanceNotFoundException {
+    private synchronized ObjectName saveServiceReference(final ServiceReference serviceReference, final ObjectName moduleON,
+                                                         final boolean skipChecks) throws InstanceNotFoundException {
 
         // make sure it is found
         if (skipChecks == false) {
@@ -443,13 +444,13 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
             }
 
             @Override
-            public ServiceReferenceJMXRegistration setValue(ServiceReferenceJMXRegistration value) {
+            public ServiceReferenceJMXRegistration setValue(final ServiceReferenceJMXRegistration value) {
                 throw new UnsupportedOperationException();
             }
         };
     }
 
-    private ObjectName getServiceON(ServiceReference serviceReference) {
+    private ObjectName getServiceON(final ServiceReference serviceReference) {
         if (writable) {
             return ObjectNameUtil.createTransactionServiceON(serviceReferenceRegistrator.getNullableTransactionName(),
                     serviceReference.getServiceInterfaceQName(), serviceReference.getRefName());
@@ -459,12 +460,12 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
     }
 
     @Override
-    public synchronized void removeServiceReference(String serviceInterfaceName, String refName) throws InstanceNotFoundException{
+    public synchronized void removeServiceReference(final String serviceInterfaceName, final String refName) throws InstanceNotFoundException{
         ServiceReference serviceReference = new ServiceReference(serviceInterfaceName, refName);
         removeServiceReference(serviceReference);
     }
 
-    private synchronized void removeServiceReference(ServiceReference serviceReference) throws InstanceNotFoundException {
+    private synchronized void removeServiceReference(final ServiceReference serviceReference) throws InstanceNotFoundException {
         LOGGER.debug("Removing service reference {} from {}", serviceReference, this);
         assertWritable();
         // is the qName known?
@@ -496,7 +497,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
     }
 
     @Override
-    public synchronized boolean removeServiceReferences(ObjectName moduleObjectName) throws InstanceNotFoundException {
+    public synchronized boolean removeServiceReferences(final ObjectName moduleObjectName) throws InstanceNotFoundException {
         lookupRegistry.checkConfigBeanExists(moduleObjectName);
         String factoryName = ObjectNameUtil.getFactoryName(moduleObjectName);
         // check that service interface name exist
@@ -505,7 +506,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
     }
 
 
-    private boolean removeServiceReferences(ObjectName moduleObjectName, Set<String> qNames) throws InstanceNotFoundException {
+    private boolean removeServiceReferences(final ObjectName moduleObjectName, final Set<String> qNames) throws InstanceNotFoundException {
         ObjectNameUtil.checkType(moduleObjectName, ObjectNameUtil.TYPE_MODULE);
         assertWritable();
         Set<ServiceReference> serviceReferencesLinkingTo = findServiceReferencesLinkingTo(moduleObjectName, qNames);
@@ -515,7 +516,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
         return serviceReferencesLinkingTo.isEmpty() == false;
     }
 
-    private Set<ServiceReference> findServiceReferencesLinkingTo(ObjectName moduleObjectName, Set<String> serviceInterfaceQNames) {
+    private Set<ServiceReference> findServiceReferencesLinkingTo(final ObjectName moduleObjectName, final Set<String> serviceInterfaceQNames) {
         String factoryName = ObjectNameUtil.getFactoryName(moduleObjectName);
         if (serviceInterfaceQNames == null) {
             LOGGER.warn("Possible error in code: cannot find factoryName {} in {}, object name {}", factoryName, factoryNamesToQNames, moduleObjectName);
index 5cb1513d9cfa037448d24937e30dfe0ac9bc5a95..f4d732c65c262cb65fe29f09e2ed954e5f1f2995 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.controller.config.manager.impl.util;
 
+import com.google.common.collect.ImmutableSet;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashSet;
@@ -18,7 +19,7 @@ import org.opendaylight.controller.config.api.annotations.ServiceInterfaceAnnota
 import org.opendaylight.controller.config.spi.Module;
 import org.opendaylight.controller.config.spi.ModuleFactory;
 
-public class InterfacesHelper {
+public final class InterfacesHelper {
 
     private InterfacesHelper() {
     }
@@ -126,7 +127,7 @@ public class InterfacesHelper {
         for (ServiceInterfaceAnnotation sia: siAnnotations) {
             qNames.add(sia.value());
         }
-        return Collections.unmodifiableSet(qNames);
+        return ImmutableSet.copyOf(qNames);
     }
 
     public static Set<ServiceInterfaceAnnotation> getServiceInterfaceAnnotations(final ModuleFactory factory) {
diff --git a/opendaylight/distribution/opendaylight/opendaylight-application.launch b/opendaylight/distribution/opendaylight/opendaylight-application.launch
deleted file mode 100644 (file)
index cd9fc94..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/sal"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="4"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
-<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;sourceLookupDirector&gt;&#10;&lt;sourceContainers duplicates=&quot;false&quot;&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;switchmanager.northbound&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;commons.northbound&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;configuration&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;configuration.implementation&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;containermanager&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;flowprogrammer.northbound&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;forwarding.staticrouting.northbound&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;hosttracker&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;hosttracker.northbound&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;protocol_plugins.openflow&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;statistics.northbound&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;subnets.northbound&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;topology.northbound&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;containermanager.implementation&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;devices.web&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;flows.web&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;samples.simpleforwarding&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;topology.web&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;troubleshoot.web&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;clustering.services&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;mactracker&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;sal&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;slicemanager&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;switchmanager&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;topologymanager&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;arphandler&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;clustering.services-implementation&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;clustering.test&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;configuration.web&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;forwarding.ipswitch&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;forwarding.staticrouting&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;forwardingrulesmanager.implementation&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;forwardingrulesmanager&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;home.web&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;monitor&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;northboundtest&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;onep.topology.southbound&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;openflowj&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;protocol_plugin.openflow&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;routing.dijkstra_implementation&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;sal.implementation&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;slicemanager.implementation&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;statisticsmanager&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;tifmgr&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;usermanager&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;web&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;/sourceContainers&gt;&#10;&lt;/sourceLookupDirector&gt;&#10;"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/distribution.opendaylight/target/distribution.opendaylight-osgipackage/opendaylight/lib/org.eclipse.equinox.launcher-1.3.0.v20120522-1813.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/distribution.opendaylight/target/distribution.opendaylight-osgipackage/opendaylight/lib/org.eclipse.osgi-3.8.1.v20120830-144521.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/distribution.opendaylight/target/distribution.opendaylight-osgipackage/opendaylight/lib/org.eclipse.virgo.kernel.equinox.extensions-3.6.0.RELEASE.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
-<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.equinox.launcher.Main"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-console -consoleLog"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="sal"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djava.io.tmpdir=${workspace_loc:distribution.opendaylight/target/distribution.opendaylight-osgipackage/opendaylight}/work/tmp -Dosgi.install.area=${workspace_loc:distribution.opendaylight/target/distribution.opendaylight-osgipackage} -Dosgi.configuration.area=${workspace_loc:distribution.opendaylight/target/distribution.opendaylight-osgipackage/opendaylight}/configuration -Dosgi.frameworkClassPath=file:${workspace_loc:distribution.opendaylight/target/distribution.opendaylight-osgipackage/opendaylight}/lib/org.eclipse.osgi-3.8.1.v20120830-144521.jar,file:${workspace_loc:distribution.opendaylight/target/distribution.opendaylight-osgipackage/opendaylight}/lib/org.eclipse.virgo.kernel.equinox.extensions-3.6.0.RELEASE.jar,file:${workspace_loc:distribution.opendaylight/target/distribution.opendaylight-osgipackage/opendaylight}/lib/org.eclipse.equinox.launcher-1.3.0.v20120522-1813.jar -Dosgi.framework=file:${workspace_loc:distribution.opendaylight/target/distribution.opendaylight-osgipackage/opendaylight}/lib/org.eclipse.osgi-3.8.1.v20120830-144521.jar"/>
-<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:distribution.opendaylight/target/distribution.opendaylight-osgipackage/opendaylight}"/>
-</launchConfiguration>
diff --git a/opendaylight/distribution/opendaylight/opendaylight-assembleit-fast.launch b/opendaylight/distribution/opendaylight/opendaylight-assembleit-fast.launch
deleted file mode 100644 (file)
index bc5c53c..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
-<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
-<stringAttribute key="M2_GOALS" value="clean install"/>
-<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
-<booleanAttribute key="M2_OFFLINE" value="false"/>
-<stringAttribute key="M2_PROFILES" value="fastreassembly"/>
-<listAttribute key="M2_PROPERTIES">
-<listEntry value="fastreassembly.directory=${workspace_loc:/distribution.opendaylight/target/distribution.opendaylight-osgipackage/opendaylight/plugins}"/>
-</listAttribute>
-<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
-<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
-<intAttribute key="M2_THREADS" value="1"/>
-<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
-<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
-<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/distribution.opendaylight&quot; type=&quot;4&quot;/&gt;&#10;&lt;/resources&gt;}"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx768m -XX:MaxPermSize=256m"/>
-<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${selected_resource_loc}"/>
-</launchConfiguration>
diff --git a/opendaylight/distribution/opendaylight/opendaylight-assembleit-full.launch b/opendaylight/distribution/opendaylight/opendaylight-assembleit-full.launch
deleted file mode 100644 (file)
index 82b9fe2..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
-<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
-<stringAttribute key="M2_GOALS" value="clean install"/>
-<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
-<booleanAttribute key="M2_OFFLINE" value="false"/>
-<stringAttribute key="M2_PROFILES" value="docs,integrationtests"/>
-<listAttribute key="M2_PROPERTIES"/>
-<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
-<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
-<intAttribute key="M2_THREADS" value="1"/>
-<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
-<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
-<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/distribution.opendaylight&quot; type=&quot;4&quot;/&gt;&#10;&lt;/resources&gt;}"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx768m -XX:MaxPermSize=256m"/>
-<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/releasepom}"/>
-</launchConfiguration>
diff --git a/opendaylight/distribution/opendaylight/opendaylight-assembleit-noclean.launch b/opendaylight/distribution/opendaylight/opendaylight-assembleit-noclean.launch
deleted file mode 100644 (file)
index f42f657..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
-<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
-<stringAttribute key="M2_GOALS" value="install"/>
-<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
-<booleanAttribute key="M2_OFFLINE" value="false"/>
-<stringAttribute key="M2_PROFILES" value=""/>
-<listAttribute key="M2_PROPERTIES"/>
-<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
-<booleanAttribute key="M2_SKIP_TESTS" value="true"/>
-<intAttribute key="M2_THREADS" value="1"/>
-<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
-<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
-<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/distribution.opendaylight&quot; type=&quot;4&quot;/&gt;&#10;&lt;/resources&gt;}"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx768m -XX:MaxPermSize=256m"/>
-<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/releasepom}"/>
-</launchConfiguration>
diff --git a/opendaylight/distribution/opendaylight/opendaylight-assembleit-skiput.launch b/opendaylight/distribution/opendaylight/opendaylight-assembleit-skiput.launch
deleted file mode 100644 (file)
index 753839c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
-<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
-<stringAttribute key="M2_GOALS" value="clean install"/>
-<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
-<booleanAttribute key="M2_OFFLINE" value="false"/>
-<stringAttribute key="M2_PROFILES" value=""/>
-<listAttribute key="M2_PROPERTIES">
-<listEntry value="skipTests=true"/>
-<listEntry value="skipIT=true"/>
-<listEntry value="enunciate.skip=true"/>
-</listAttribute>
-<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
-<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
-<intAttribute key="M2_THREADS" value="1"/>
-<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
-<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
-<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/distribution.opendaylight&quot; type=&quot;4&quot;/&gt;&#10;&lt;/resources&gt;}"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx768m -XX:MaxPermSize=256m"/>
-<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/releasepom}"/>
-</launchConfiguration>
diff --git a/opendaylight/distribution/opendaylight/opendaylight-assembleit-sonar.launch b/opendaylight/distribution/opendaylight/opendaylight-assembleit-sonar.launch
deleted file mode 100644 (file)
index b498f90..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
-<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
-<stringAttribute key="M2_GOALS" value="clean install sonar:sonar"/>
-<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
-<booleanAttribute key="M2_OFFLINE" value="false"/>
-<stringAttribute key="M2_PROFILES" value=""/>
-<listAttribute key="M2_PROPERTIES">
-<listEntry value="maven.test.skip=true"/>
-</listAttribute>
-<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
-<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
-<intAttribute key="M2_THREADS" value="1"/>
-<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
-<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
-<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/distribution.opendaylight&quot; type=&quot;4&quot;/&gt;&#10;&lt;/resources&gt;}"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx768m -XX:MaxPermSize=256m"/>
-<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/releasepom}"/>
-</launchConfiguration>
diff --git a/opendaylight/distribution/opendaylight/opendaylight-assembleit.launch b/opendaylight/distribution/opendaylight/opendaylight-assembleit.launch
deleted file mode 100644 (file)
index 0edd2a7..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
-<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
-<stringAttribute key="M2_GOALS" value="clean install"/>
-<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
-<booleanAttribute key="M2_OFFLINE" value="false"/>
-<stringAttribute key="M2_PROFILES" value=""/>
-<listAttribute key="M2_PROPERTIES"/>
-<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
-<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
-<intAttribute key="M2_THREADS" value="1"/>
-<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
-<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
-<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/distribution.opendaylight&quot; type=&quot;4&quot;/&gt;&#10;&lt;/resources&gt;}"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx768m -XX:MaxPermSize=256m"/>
-<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/releasepom}"/>
-</launchConfiguration>
diff --git a/opendaylight/distribution/opendaylight/opendaylight-local.target b/opendaylight/distribution/opendaylight/opendaylight-local.target
deleted file mode 100644 (file)
index a7780fe..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde version="3.8"?><target name="opendaylight-local" sequenceNumber="6">
-<locations>
-<location path="${workspace_loc:/distribution.opendaylight/}/../p2site/target/repository" type="Directory"/>
-</locations>
-</target>
diff --git a/opendaylight/distribution/opendaylight/opendaylight-osgi-launcher-local.launch b/opendaylight/distribution/opendaylight/opendaylight-osgi-launcher-local.launch
deleted file mode 100644 (file)
index 98de065..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.pde.ui.EquinoxLauncher">
-<booleanAttribute key="append.args" value="true"/>
-<booleanAttribute key="automaticAdd" value="true"/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<stringAttribute key="bad_container_name" value="/distribution.opendaylight/opendaylight-osgi-launche"/>
-<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="checked" value="[NONE]"/>
-<booleanAttribute key="clearConfig" value="true"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/opendaylight-osgi-launcher-local"/>
-<booleanAttribute key="default" value="true"/>
-<booleanAttribute key="default_auto_start" value="true"/>
-<intAttribute key="default_start_level" value="4"/>
-<stringAttribute key="deselected_workspace_plugins" value="org.opendaylight.controller.clustering.stub,org.opendaylight.controller.protocol_plugins.stub"/>
-<booleanAttribute key="includeOptional" value="false"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.ignoreApp=true &#10;-Dosgi.noShutdown=true &#10;-Dorg.osgi.framework.system.packages.extra=sun.reflect,sun.reflect.misc,sun.misc&#10;-Dosgi.hook.configurators.include=org.eclipse.virgo.kernel.equinox.extensions.hooks.ExtensionsHookConfigurator&#10;-Dlogback.configurationFile=${project_loc:/distribution.opendaylight}/src/main/resources/configuration/logback.xml&#10;-Dorg.eclipse.gemini.web.tomcat.config.path=${project_loc:/distribution.opendaylight}/src/main/resources/configuration/tomcat-server.xml&#10;-Dosgi.frameworkClassPath=file:${project_loc:/distribution.opendaylight}/../p2site/target/repository/plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar,file:${project_loc:/distribution.opendaylight}/../p2site/target/repository/plugins/org.eclipse.virgo.kernel.equinox.extensions_3.6.0.RELEASE.jar,file:${project_loc:/distribution.opendaylight}/../p2site/target/repository/plugins/org.eclipse.osgi_3.8.1.v20120830-144521.jar"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<stringAttribute key="target_bundles" value="ch.qos.logback.classic@default:default,ch.qos.logback.core@default:default,javax.activation@default:default,javax.annotation@default:default,javax.el@default:default,javax.persistence@default:default,javax.servlet.jsp@default:default,javax.servlet@default:default,javax.xml.rpc@default:default,org.apache.commons.io@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.launcher@default:default,org.eclipse.equinox.util@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useCustomFeatures" value="false"/>
-<booleanAttribute key="useDefaultConfigArea" value="true"/>
-<stringAttribute key="workspace_bundles" value="com.cisco.csdn.debugtools.osgidbg@default:default,org.opendaylight.controller.appauth@default:default,org.opendaylight.controller.arphandler@default:default,org.opendaylight.controller.bundlescanner.implementation@default:default,org.opendaylight.controller.bundlescanner@default:default,org.opendaylight.controller.clustering.services-implementation@default:default,org.opendaylight.controller.clustering.services@default:default,org.opendaylight.controller.clustering.test@default:default,org.opendaylight.controller.commons.northbound@default:default,org.opendaylight.controller.concepts@default:default,org.opendaylight.controller.configuration.implementation@default:default,org.opendaylight.controller.configuration@default:default,org.opendaylight.controller.connectionmanager.implementation@default:default,org.opendaylight.controller.connectionmanager@default:default,org.opendaylight.controller.containermanager.implementation@default:default,org.opendaylight.controller.containermanager.it.implementation@default:default,org.opendaylight.controller.containermanager.northbound@default:default,org.opendaylight.controller.containermanager@default:default,org.opendaylight.controller.devices.web@default:default,org.opendaylight.controller.flowprogrammer.northbound@default:default,org.opendaylight.controller.flows.web@default:default,org.opendaylight.controller.forwarding.staticrouting.northbound@default:default,org.opendaylight.controller.forwarding.staticrouting@default:default,org.opendaylight.controller.forwardingrulesmanager.implementation@default:default,org.opendaylight.controller.forwardingrulesmanager@default:default,org.opendaylight.controller.hosttracker.implementation@default:default,org.opendaylight.controller.hosttracker.northbound@default:default,org.opendaylight.controller.hosttracker@default:default,org.opendaylight.controller.hosttracker_new.implementation@default:default,org.opendaylight.controller.hosttracker_new@default:default,org.opendaylight.controller.logging.bridge@default:default,org.opendaylight.controller.model.flow-base@default:default,org.opendaylight.controller.model.flow-service@default:default,org.opendaylight.controller.model.flow-statistics@default:default,org.opendaylight.controller.model.inventory@default:default,org.opendaylight.controller.networkconfig.bridgedomain.northbound@default:default,org.opendaylight.controller.protocol_plugins.openflow@default:default,org.opendaylight.controller.routing.dijkstra_implementation@default:default,org.opendaylight.controller.sal-binding-api@default:default,org.opendaylight.controller.sal-common-util@default:default,org.opendaylight.controller.sal-common@default:default,org.opendaylight.controller.sal.connection.implementation@default:default,org.opendaylight.controller.sal.connection@default:default,org.opendaylight.controller.sal.implementation@default:default,org.opendaylight.controller.sal.networkconfiguration.implementation@default:default,org.opendaylight.controller.sal.networkconfiguration@default:default,org.opendaylight.controller.sal@default:default,org.opendaylight.controller.samples.loadbalancer.northbound@default:default,org.opendaylight.controller.samples.loadbalancer@default:default,org.opendaylight.controller.samples.sample-toaster-consumer@default:default,org.opendaylight.controller.samples.sample-toaster-provider@default:default,org.opendaylight.controller.samples.sample-toaster@default:default,org.opendaylight.controller.samples.simpleforwarding@default:default,org.opendaylight.controller.security@default:false,org.opendaylight.controller.statistics.northbound@default:default,org.opendaylight.controller.statisticsmanager.implementation@default:default,org.opendaylight.controller.statisticsmanager@default:default,org.opendaylight.controller.subnets.northbound@default:default,org.opendaylight.controller.switchmanager.implementation@default:default,org.opendaylight.controller.switchmanager.northbound@default:default,org.opendaylight.controller.switchmanager@default:default,org.opendaylight.controller.thirdparty.com.sun.jersey.jersey-servlet@default:default,org.opendaylight.controller.thirdparty.net.sf.jung2@default:default,org.opendaylight.controller.thirdparty.org.apache.catalina.filters.CorsFilter@default:false,org.opendaylight.controller.thirdparty.org.openflow.openflowj@default:default,org.opendaylight.controller.topology.northbound@default:default,org.opendaylight.controller.topology.web@default:default,org.opendaylight.controller.topologymanager@default:default,org.opendaylight.controller.troubleshoot.web@default:default,org.opendaylight.controller.usermanager.implementation@default:default,org.opendaylight.controller.usermanager@default:default,org.opendaylight.controller.web@default:default"/>
-</launchConfiguration>
diff --git a/opendaylight/distribution/opendaylight/opendaylight-osgi-launcher.launch b/opendaylight/distribution/opendaylight/opendaylight-osgi-launcher.launch
deleted file mode 100644 (file)
index b14197f..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.pde.ui.EquinoxLauncher">
-<booleanAttribute key="append.args" value="true"/>
-<booleanAttribute key="automaticAdd" value="true"/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<stringAttribute key="bad_container_name" value="/distribution.opendaylight/opendaylight-osgi-launche"/>
-<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="checked" value="[NONE]"/>
-<booleanAttribute key="clearConfig" value="true"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/opendaylight-osgi-launcher"/>
-<booleanAttribute key="default" value="true"/>
-<booleanAttribute key="default_auto_start" value="true"/>
-<intAttribute key="default_start_level" value="4"/>
-<stringAttribute key="deselected_workspace_plugins" value="org.opendaylight.controller.clustering.stub,org.opendaylight.controller.protocol_plugins.stub"/>
-<booleanAttribute key="includeOptional" value="false"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.ignoreApp=true &#10;-Dosgi.noShutdown=true &#10;-Dorg.osgi.framework.system.packages.extra=sun.reflect,sun.reflect.misc,sun.misc&#10;-Dosgi.hook.configurators.include=org.eclipse.virgo.kernel.equinox.extensions.hooks.ExtensionsHookConfigurator&#10;-Dlogback.configurationFile=${project_loc:/distribution.opendaylight}/src/main/resources/configuration/logback.xml&#10;-Dorg.eclipse.gemini.web.tomcat.config.path=${project_loc:/distribution.opendaylight}/src/main/resources/configuration/tomcat-server.xml&#10;-Dosgi.frameworkClassPath=file:${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar,file:${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipse.virgo.kernel.equinox.extensions_3.6.0.RELEASE.jar,file:${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipse.osgi_3.8.1.v20120830-144521.jar"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<stringAttribute key="target_bundles" value="ch.qos.logback.classic@default:default,ch.qos.logback.core@default:default,javax.activation@default:default,javax.annotation@default:default,javax.el@default:default,javax.persistence@default:default,javax.servlet.jsp@default:default,javax.servlet@default:default,javax.xml.rpc@default:default,org.apache.commons.io@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.launcher@default:default,org.eclipse.equinox.util@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useCustomFeatures" value="false"/>
-<booleanAttribute key="useDefaultConfigArea" value="true"/>
-<stringAttribute key="workspace_bundles" value="com.cisco.csdn.debugtools.osgidbg@default:default,org.opendaylight.controller.appauth@default:default,org.opendaylight.controller.arphandler@default:default,org.opendaylight.controller.bundlescanner.implementation@default:default,org.opendaylight.controller.bundlescanner@default:default,org.opendaylight.controller.clustering.services-implementation@default:default,org.opendaylight.controller.clustering.services@default:default,org.opendaylight.controller.clustering.test@default:default,org.opendaylight.controller.commons.northbound@default:default,org.opendaylight.controller.concepts@default:default,org.opendaylight.controller.configuration.implementation@default:default,org.opendaylight.controller.configuration@default:default,org.opendaylight.controller.connectionmanager.implementation@default:default,org.opendaylight.controller.connectionmanager@default:default,org.opendaylight.controller.containermanager.implementation@default:default,org.opendaylight.controller.containermanager.it.implementation@default:default,org.opendaylight.controller.containermanager.northbound@default:default,org.opendaylight.controller.containermanager@default:default,org.opendaylight.controller.devices.web@default:default,org.opendaylight.controller.flowprogrammer.northbound@default:default,org.opendaylight.controller.flows.web@default:default,org.opendaylight.controller.forwarding.staticrouting.northbound@default:default,org.opendaylight.controller.forwarding.staticrouting@default:default,org.opendaylight.controller.forwardingrulesmanager.implementation@default:default,org.opendaylight.controller.forwardingrulesmanager@default:default,org.opendaylight.controller.hosttracker.implementation@default:default,org.opendaylight.controller.hosttracker.northbound@default:default,org.opendaylight.controller.hosttracker@default:default,org.opendaylight.controller.hosttracker_new.implementation@default:default,org.opendaylight.controller.hosttracker_new@default:default,org.opendaylight.controller.logging.bridge@default:default,org.opendaylight.controller.model.flow-base@default:default,org.opendaylight.controller.model.flow-service@default:default,org.opendaylight.controller.model.flow-statistics@default:default,org.opendaylight.controller.model.inventory@default:default,org.opendaylight.controller.networkconfig.bridgedomain.northbound@default:default,org.opendaylight.controller.protocol_plugins.openflow@default:default,org.opendaylight.controller.routing.dijkstra_implementation@default:default,org.opendaylight.controller.sal-binding-api@default:default,org.opendaylight.controller.sal-common-util@default:default,org.opendaylight.controller.sal-common@default:default,org.opendaylight.controller.sal.connection.implementation@default:default,org.opendaylight.controller.sal.connection@default:default,org.opendaylight.controller.sal.implementation@default:default,org.opendaylight.controller.sal.networkconfiguration.implementation@default:default,org.opendaylight.controller.sal.networkconfiguration@default:default,org.opendaylight.controller.sal@default:default,org.opendaylight.controller.samples.loadbalancer.northbound@default:default,org.opendaylight.controller.samples.loadbalancer@default:default,org.opendaylight.controller.samples.sample-toaster-consumer@default:default,org.opendaylight.controller.samples.sample-toaster-provider@default:default,org.opendaylight.controller.samples.sample-toaster@default:default,org.opendaylight.controller.samples.simpleforwarding@default:default,org.opendaylight.controller.security@default:false,org.opendaylight.controller.statistics.northbound@default:default,org.opendaylight.controller.statisticsmanager.implementation@default:default,org.opendaylight.controller.statisticsmanager@default:default,org.opendaylight.controller.subnets.northbound@default:default,org.opendaylight.controller.switchmanager.implementation@default:default,org.opendaylight.controller.switchmanager.northbound@default:default,org.opendaylight.controller.switchmanager@default:default,org.opendaylight.controller.thirdparty.com.sun.jersey.jersey-servlet@default:default,org.opendaylight.controller.thirdparty.net.sf.jung2@default:default,org.opendaylight.controller.thirdparty.org.apache.catalina.filters.CorsFilter@default:false,org.opendaylight.controller.thirdparty.org.openflow.openflowj@default:default,org.opendaylight.controller.topology.northbound@default:default,org.opendaylight.controller.topology.web@default:default,org.opendaylight.controller.topologymanager@default:default,org.opendaylight.controller.troubleshoot.web@default:default,org.opendaylight.controller.usermanager.implementation@default:default,org.opendaylight.controller.usermanager@default:default,org.opendaylight.controller.web@default:default"/>
-</launchConfiguration>
diff --git a/opendaylight/distribution/opendaylight/opendaylight-sonar-fast.launch b/opendaylight/distribution/opendaylight/opendaylight-sonar-fast.launch
deleted file mode 100644 (file)
index 6d5a588..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
-<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
-<stringAttribute key="M2_GOALS" value="sonar:sonar"/>
-<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
-<booleanAttribute key="M2_OFFLINE" value="false"/>
-<stringAttribute key="M2_PROFILES" value=""/>
-<listAttribute key="M2_PROPERTIES"/>
-<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
-<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
-<intAttribute key="M2_THREADS" value="1"/>
-<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
-<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
-<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/distribution.opendaylight&quot; type=&quot;4&quot;/&gt;&#10;&lt;/resources&gt;}"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx768m -XX:MaxPermSize=256m"/>
-<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${selected_resource_loc}"/>
-</launchConfiguration>
diff --git a/opendaylight/distribution/opendaylight/opendaylight-sonar.launch b/opendaylight/distribution/opendaylight/opendaylight-sonar.launch
deleted file mode 100644 (file)
index bb66bd8..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
-<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
-<stringAttribute key="M2_GOALS" value="sonar:sonar"/>
-<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
-<booleanAttribute key="M2_OFFLINE" value="false"/>
-<stringAttribute key="M2_PROFILES" value=""/>
-<listAttribute key="M2_PROPERTIES"/>
-<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
-<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
-<intAttribute key="M2_THREADS" value="1"/>
-<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
-<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
-<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/distribution.opendaylight&quot; type=&quot;4&quot;/&gt;&#10;&lt;/resources&gt;}"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx768m -XX:MaxPermSize=256m"/>
-<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/releasepom}"/>
-</launchConfiguration>
diff --git a/opendaylight/distribution/opendaylight/opendaylight.target b/opendaylight/distribution/opendaylight/opendaylight.target
deleted file mode 100644 (file)
index 7ae309c..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde version="3.8"?><target name="opendaylight" sequenceNumber="4">
-<locations>
-<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="slicer" includeSource="true" type="InstallableUnit">
-<unit id="org.apache.jasper" version="7.0.32.v201211201952"/>
-<unit id="javax.servlet.jsp.jstl.impl" version="1.2.0.v201210211230"/>
-<unit id="org.springframework.context" version="3.1.3.RELEASE"/>
-<unit id="org.eclipse.gemini.web.extender" version="2.2.0.RELEASE"/>
-<unit id="jackson-jaxrs" version="1.9.8"/>
-<unit id="com.sun.jersey.jersey-server" version="1.17.0"/>
-<unit id="org.eclipse.jdt.core.compiler.batch" version="3.8.0.I20120518-2145"/>
-<unit id="org.springframework.web" version="3.1.3.RELEASE"/>
-<unit id="com.google.gson" version="2.1.0"/>
-<unit id="org.springframework.security.config" version="3.1.3.RELEASE"/>
-<unit id="org.springframework.transaction" version="3.1.3.RELEASE"/>
-<unit id="org.eclipse.virgo.util.math" version="3.6.0.RELEASE"/>
-<unit id="org.apache.el" version="7.0.32.v201211081135"/>
-<unit id="org.springframework.web.servlet" version="3.1.3.RELEASE"/>
-<unit id="org.apache.felix.dependencymanager.shell" version="3.0.1"/>
-<unit id="log4j.over.slf4j" version="1.7.2"/>
-<unit id="com.springsource.org.aopalliance" version="1.0.0"/>
-<unit id="javax.annotation" version="1.1.0.v201209060031"/>
-<unit id="jcl.over.slf4j" version="1.7.2"/>
-<unit id="javax.mail.glassfish" version="1.4.1.v201108011116"/>
-<unit id="slf4j.api" version="1.7.2"/>
-<unit id="org.springframework.expression" version="3.1.3.RELEASE"/>
-<unit id="jackson-mapper-asl" version="1.9.8"/>
-<unit id="org.eclipse.gemini.web.tomcat" version="2.2.0.RELEASE"/>
-<unit id="org.apache.felix.gogo.command" version="0.8.0.v201108120515"/>
-<unit id="org.springframework.asm" version="3.1.3.RELEASE"/>
-<unit id="org.eclipse.equinox.ds" version="1.4.0.v20120522-1841"/>
-<unit id="org.eclipse.equinox.console" version="1.0.0.v20120522-1841"/>
-<unit id="org.apache.catalina" version="7.0.32.v201211201336"/>
-<unit id="chameleon-mbeans" version="1.0.0"/>
-<unit id="javax.servlet.jsp.jstl" version="1.2.0.v201105211821"/>
-<unit id="org.apache.felix.gogo.runtime" version="0.8.0.v201108120515"/>
-<unit id="org.apache.tomcat.util" version="7.0.32.v201211201952"/>
-<unit id="jackson-core-asl" version="1.9.8"/>
-<unit id="javax.activation" version="1.1.0.v201211130549"/>
-<unit id="org.eclipse.gemini.web.core" version="2.2.0.RELEASE"/>
-<unit id="org.eclipse.virgo.util.osgi" version="3.6.0.RELEASE"/>
-<unit id="org.apache.commons.io" version="2.3.0"/>
-<unit id="javax.servlet.jsp" version="2.2.0.v201112011158"/>
-<unit id="org.apache.tomcat.api" version="7.0.32.v201211081135"/>
-<unit id="com.sun.jersey.core" version="1.17.0"/>
-<unit id="org.springframework.security.taglibs" version="3.1.3.RELEASE"/>
-<unit id="org.springframework.security.web" version="3.1.3.RELEASE"/>
-<unit id="com.sun.jersey.client" version="1.17.0"/>
-<unit id="org.springframework.aop" version="3.1.3.RELEASE"/>
-<unit id="org.apache.coyote" version="7.0.32.v201211201952"/>
-<unit id="org.eclipse.virgo.kernel.equinox.extensions" version="3.6.0.RELEASE"/>
-<unit id="org.eclipse.osgi.services" version="3.3.100.v20120522-1822"/>
-<unit id="org.eclipse.virgo.util.common" version="3.6.0.RELEASE"/>
-<unit id="org.eclipse.equinox.util" version="1.0.400.v20120522-2049"/>
-<unit id="org.springframework.core" version="3.1.3.RELEASE"/>
-<unit id="org.apache.commons.fileupload" version="1.2.2"/>
-<unit id="org.codehaus.jettison.jettison" version="1.3.3"/>
-<unit id="org.eclipse.virgo.util.io" version="3.6.0.RELEASE"/>
-<unit id="org.apache.felix.gogo.shell" version="0.8.0.v201110170705"/>
-<unit id="org.apache.commons.lang3" version="3.1.0"/>
-<unit id="org.eclipse.equinox.cm" version="1.0.400.v20120522-1841"/>
-<unit id="org.springframework.beans" version="3.1.3.RELEASE"/>
-<unit id="javax.servlet" version="3.0.0.v201112011016"/>
-<unit id="org.eclipse.equinox.launcher" version="1.3.0.v20120522-1813"/>
-<unit id="javax.persistence" version="2.0.4.v201112161009"/>
-<unit id="org.eclipse.osgi" version="3.8.1.v20120830-144521"/>
-<unit id="ch.qos.logback.core" version="1.0.9"/>
-<unit id="javax.ejb" version="3.1.1.v201204261316"/>
-<unit id="org.apache.catalina.ha" version="7.0.32.v201211201952"/>
-<unit id="org.springframework.context.support" version="3.1.3.RELEASE"/>
-<unit id="org.eclipse.virgo.util.osgi.manifest" version="3.6.0.RELEASE"/>
-<unit id="javax.xml.rpc" version="1.1.0.v201005080400"/>
-<unit id="ch.qos.logback.classic" version="1.0.9"/>
-<unit id="org.springframework.security.core" version="3.1.3.RELEASE"/>
-<unit id="javax.el" version="2.2.0.v201108011116"/>
-<unit id="org.apache.juli.extras" version="7.0.32.v201211081135"/>
-<unit id="org.jboss.spec.javax.transaction.jboss-transaction-api_1.1_spec" version="1.0.1.Final"/>
-<unit id="org.apache.catalina.tribes" version="7.0.32.v201211201952"/>
-<unit id="org.eclipse.virgo.util.parser.manifest" version="3.6.0.RELEASE"/>
-<unit id="org.apache.felix.dependencymanager" version="3.1.0"/>
-<repository location="http://nexus.opendaylight.org/content/repositories/controllerp2site/"/>
-</location>
-</locations>
-</target>
diff --git a/opendaylight/distribution/opendaylight/pom.xml b/opendaylight/distribution/opendaylight/pom.xml
deleted file mode 100644 (file)
index cd02759..0000000
+++ /dev/null
@@ -1,1440 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.opendaylight.controller</groupId>
-    <artifactId>commons.opendaylight</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../commons/opendaylight</relativePath>
-  </parent>
-  <artifactId>distribution.opendaylight</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
-  <packaging>pom</packaging>
-  <prerequisites>
-    <maven>3.0</maven>
-  </prerequisites>
-
-  <dependencies>
-    <dependency>
-      <groupId>ch.qos.logback</groupId>
-      <artifactId>logback-classic</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>ch.qos.logback</groupId>
-      <artifactId>logback-core</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-annotations</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-core</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-databind</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>com.fasterxml.jackson.datatype</groupId>
-      <artifactId>jackson-datatype-json-org</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>com.fasterxml.jackson.jaxrs</groupId>
-      <artifactId>jackson-jaxrs-base</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>com.fasterxml.jackson.jaxrs</groupId>
-      <artifactId>jackson-jaxrs-json-provider</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>com.fasterxml.jackson.module</groupId>
-      <artifactId>jackson-module-jaxb-annotations</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>com.google.code.gson</groupId>
-      <artifactId>gson</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-client</artifactId>
-    </dependency>
-    <!-- Jersey for JAXRS -->
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-server</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>commons-codec</groupId>
-      <artifactId>commons-codec</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>commons-fileupload</groupId>
-      <artifactId>commons-fileupload</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>commons-io</groupId>
-      <artifactId>commons-io</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>commons-net</groupId>
-      <artifactId>commons-net</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>eclipselink</groupId>
-      <artifactId>javax.persistence</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>eclipselink</groupId>
-      <artifactId>javax.resource</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>equinoxSDK381</groupId>
-      <artifactId>javax.servlet</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>equinoxSDK381</groupId>
-      <artifactId>javax.servlet.jsp</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>equinoxSDK381</groupId>
-      <artifactId>org.apache.felix.gogo.command</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>equinoxSDK381</groupId>
-      <artifactId>org.apache.felix.gogo.runtime</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>equinoxSDK381</groupId>
-      <artifactId>org.apache.felix.gogo.shell</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>equinoxSDK381</groupId>
-      <artifactId>org.eclipse.equinox.cm</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>equinoxSDK381</groupId>
-      <artifactId>org.eclipse.equinox.console</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>equinoxSDK381</groupId>
-      <artifactId>org.eclipse.equinox.ds</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>equinoxSDK381</groupId>
-      <artifactId>org.eclipse.equinox.launcher</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>equinoxSDK381</groupId>
-      <artifactId>org.eclipse.equinox.util</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>equinoxSDK381</groupId>
-      <artifactId>org.eclipse.osgi</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>equinoxSDK381</groupId>
-      <artifactId>org.eclipse.osgi.services</artifactId>
-    </dependency>
-    <!-- Gemini Web -->
-    <dependency>
-      <groupId>geminiweb</groupId>
-      <artifactId>org.eclipse.gemini.web.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>geminiweb</groupId>
-      <artifactId>org.eclipse.gemini.web.extender</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>geminiweb</groupId>
-      <artifactId>org.eclipse.gemini.web.tomcat</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>geminiweb</groupId>
-      <artifactId>org.eclipse.virgo.kernel.equinox.extensions</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>geminiweb</groupId>
-      <artifactId>org.eclipse.virgo.util.common</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>geminiweb</groupId>
-      <artifactId>org.eclipse.virgo.util.io</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>geminiweb</groupId>
-      <artifactId>org.eclipse.virgo.util.math</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>geminiweb</groupId>
-      <artifactId>org.eclipse.virgo.util.osgi</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>geminiweb</groupId>
-      <artifactId>org.eclipse.virgo.util.osgi.manifest</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>geminiweb</groupId>
-      <artifactId>org.eclipse.virgo.util.parser.manifest</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-buffer</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-codec</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-codec-http</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-common</artifactId>
-    </dependency>
-
-    <!--Netty-->
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-handler</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-transport</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>javax.activation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>javax.annotation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>javax.ejb</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>javax.el</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>javax.mail.glassfish</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>javax.servlet.jsp.jstl</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>javax.servlet.jsp.jstl.impl</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>javax.xml.rpc</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>org.apache.catalina</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>org.apache.catalina.ha</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>org.apache.catalina.tribes</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>org.apache.coyote</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>org.apache.el</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>org.apache.jasper</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>org.apache.juli.extras</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>org.apache.tomcat.api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>org.apache.tomcat.util</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.aopalliance</groupId>
-      <artifactId>com.springsource.org.aopalliance</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.commons</groupId>
-      <artifactId>commons-lang3</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.dependencymanager</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.dependencymanager.shell</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.fileinstall</artifactId>
-    </dependency>
-    <!-- felix webconsole -->
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.webconsole</artifactId>
-      <classifier>all</classifier>
-    </dependency>
-
-    <dependency>
-      <groupId>org.codehaus.jettison</groupId>
-      <artifactId>jettison</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.eclipse.equinox.http</groupId>
-      <artifactId>servlet</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.eclipse.persistence</groupId>
-      <artifactId>org.eclipse.persistence.antlr</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.eclipse.persistence</groupId>
-      <artifactId>org.eclipse.persistence.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.eclipse.persistence</groupId>
-      <artifactId>org.eclipse.persistence.moxy</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.javassist</groupId>
-      <artifactId>javassist</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.spec.javax.transaction</groupId>
-      <artifactId>jboss-transaction-api_1.1_spec</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.jolokia</groupId>
-      <artifactId>jolokia-osgi</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.json</groupId>
-      <artifactId>json</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>appauth</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>arphandler</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>bundlescanner</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>bundlescanner.implementation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>clustering.services</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>clustering.services-implementation</artifactId>
-    </dependency>
-
-    <!-- testing dependencies I'm pretty sure we should trim -->
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>clustering.test</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>commons.httpclient</artifactId>
-    </dependency>
-
-    <!-- Northbound bundles -->
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>commons.northbound</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>configuration</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>configuration.implementation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>connectionmanager</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>connectionmanager.implementation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>connectionmanager.northbound</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>containermanager</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>containermanager.implementation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>containermanager.northbound</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>controllermanager.northbound</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>devices.web</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>flowprogrammer.northbound</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>flows.web</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>forwarding.staticrouting</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>forwarding.staticrouting.northbound</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>forwardingrulesmanager</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>forwardingrulesmanager.implementation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>hosttracker</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>hosttracker.implementation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>hosttracker.northbound</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>httpservice-bridge</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>jolokia-bridge</artifactId>
-    </dependency>
-    <!-- Debug and logging -->
-
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>logging.bridge</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>networkconfig.bridgedomain.northbound</artifactId>
-    </dependency>
-
-    <!--  Neutron -->
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>networkconfig.neutron</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>networkconfig.neutron.implementation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>networkconfig.neutron.northbound</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>osgi-brandfragment.web</artifactId>
-    </dependency>
-
-    <!-- Southbound bundles -->
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>protocol_plugins.openflow</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>routing.dijkstra_implementation</artifactId>
-    </dependency>
-
-    <!-- SAL bundles -->
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal</artifactId>
-    </dependency>
-
-    <!-- SAL Extension bundles -->
-
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal.connection</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal.connection.implementation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal.implementation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal.networkconfiguration</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal.networkconfiguration.implementation</artifactId>
-    </dependency>
-
-    <!-- samples -->
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>samples.loadbalancer</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>samples.loadbalancer.northbound</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>samples.simpleforwarding</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>security</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>statistics.northbound</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>statisticsmanager</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>statisticsmanager.implementation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>subnets.northbound</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>switchmanager</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>switchmanager.implementation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>switchmanager.northbound</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>topology.northbound</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>topology.web</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>topologymanager</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>troubleshoot.web</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>usermanager</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>usermanager.implementation</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>usermanager.northbound</artifactId>
-    </dependency>
-
-    <!--  Web bundles -->
-
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>web</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.thirdparty</groupId>
-      <artifactId>com.sun.jersey.jersey-servlet</artifactId>
-    </dependency>
-
-    <!-- Third parties from opendaylight released -->
-    <dependency>
-      <groupId>org.opendaylight.controller.thirdparty</groupId>
-      <artifactId>net.sf.jung2</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.thirdparty</groupId>
-      <artifactId>org.openflow.openflowj</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.ow2.asm</groupId>
-      <artifactId>asm-all</artifactId>
-    </dependency>
-    <!-- Visual VM hook -->
-    <dependency>
-      <groupId>org.ow2.chameleon.management</groupId>
-      <artifactId>chameleon-mbeans</artifactId>
-    </dependency>
-
-    <!-- Third party depedencies -->
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>jcl-over-slf4j</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>log4j-over-slf4j</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>org.springframework.aop</artifactId>
-    </dependency>
-    <!-- Add Pax Exam -->
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>org.springframework.asm</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>org.springframework.beans</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>org.springframework.context</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>org.springframework.context.support</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>org.springframework.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>org.springframework.expression</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>org.springframework.transaction</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>org.springframework.web</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>org.springframework.web.servlet</artifactId>
-    </dependency>
-    <!-- Spring security -->
-    <dependency>
-      <groupId>org.springframework.security</groupId>
-      <artifactId>spring-security-config</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework.security</groupId>
-      <artifactId>spring-security-core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework.security</groupId>
-      <artifactId>spring-security-taglibs</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework.security</groupId>
-      <artifactId>spring-security-web</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>virgomirror</groupId>
-      <artifactId>org.eclipse.jdt.core.compiler.batch</artifactId>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <version>2.8</version>
-        <executions>
-          <execution>
-            <id>unpack-provided-configs</id>
-            <goals>
-              <goal>unpack-dependencies</goal>
-            </goals>
-            <phase>generate-resources</phase>
-            <configuration>
-               <outputDirectory>${project.build.directory}/configuration</outputDirectory>
-               <includeArtifactIds>sal-rest-connector-config,config-netty-config,md-sal-config,netconf-config,toaster-config,netconf-connector-config,sal-clustering-config</includeArtifactIds>
-               <includes>**\/*.xml,**/*.conf</includes>
-               <excludeTransitive>true</excludeTransitive>
-               <ignorePermissions>false</ignorePermissions>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <version>2.3</version>
-        <executions>
-          <execution>
-            <id>distro-assembly</id>
-            <goals>
-              <goal>single</goal>
-            </goals>
-            <phase>package</phase>
-            <configuration>
-              <descriptors>
-                <descriptor>src/assemble/bin.xml</descriptor>
-              </descriptors>
-              <finalName>${project.artifactId}</finalName>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-
-      <!--Make checkstyle ignore initial xml configuration files by overriding its configuration from parent-->
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-checkstyle-plugin</artifactId>
-        <configuration>
-          <excludes>**\/target\/,**\/bin\/,**\/target-ide\/,**\/configuration\/initial\/</excludes>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>buildnumber-maven-plugin</artifactId>
-        <version>1.2</version>
-        <configuration>
-          <doCheck>false</doCheck>
-          <doUpdate>false</doUpdate>
-          <revisionOnScmFailure>VersionUnknown</revisionOnScmFailure>
-        </configuration>
-        <executions>
-          <execution>
-            <goals>
-              <goal>create</goal>
-            </goals>
-            <phase>validate</phase>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
-    <tag>HEAD</tag>
-    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
-  </scm>
-
-  <profiles>
-    <profile>
-      <id>notduringrelease</id>
-      <activation>
-        <property>
-          <name>!DOINGRELEASE</name>
-        </property>
-      </activation>
-      <dependencies>
-        <dependency>
-          <groupId>${project.groupId}</groupId>
-          <artifactId>ietf-netconf-monitoring</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>${project.groupId}</groupId>
-          <artifactId>ietf-netconf-monitoring-extension</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>commons-lang</groupId>
-          <artifactId>commons-lang</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.apache.servicemix.bundles</groupId>
-          <artifactId>org.apache.servicemix.bundles.xerces</artifactId>
-          <version>2.11.0_1</version>
-        </dependency>
-        <dependency>
-          <groupId>org.bouncycastle</groupId>
-          <artifactId>bcpkix-jdk15on</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.bouncycastle</groupId>
-          <artifactId>bcprov-jdk15on</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.eclipse.birt.runtime.3_7_1</groupId>
-          <artifactId>org.apache.xml.resolver</artifactId>
-          <version>1.2.0</version>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>concepts</artifactId>
-        </dependency>
-
-        <!-- config-->
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>config-api</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>config-manager</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>config-util</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>config-netconf-connector</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>config-persister-api</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>config-persister-directory-xml-adapter</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>config-persister-file-xml-adapter</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>config-persister-impl</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>filter-valve</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>logback-config</artifactId>
-        </dependency>
-
-        <!-- Netconf -->
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>netconf-api</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>netconf-client</artifactId>
-        </dependency>
-
-        <!--Netconf config-->
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>netconf-config-dispatcher</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>netconf-impl</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>netconf-mapping-api</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>netconf-monitoring</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>netconf-netty-util</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>netconf-ssh</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>netconf-auth</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>netconf-usermanager</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>netconf-tcp</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>netconf-util</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>netty-config-api</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>netty-event-executor-config</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>netty-threadgroup-config</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>netty-timer-config</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>protocol-framework</artifactId>
-        </dependency>
-
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-binding-api</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-binding-broker-impl</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-binding-config</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-binding-util</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-broker-impl</artifactId>
-        </dependency>
-        <!-- md-sal -->
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-common</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-common-api</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-common-impl</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-common-util</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-compatibility</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-connector-api</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-core-api</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-core-spi</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-inmemory-datastore</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-netconf-connector</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-remote</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-rest-connector</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-rest-connector-config</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>config-netty-config</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>md-sal-config</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>netconf-config</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>netconf-connector-config</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller.samples</groupId>
-          <artifactId>toaster-config</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-rest-docgen</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-restconf-broker</artifactId>
-        </dependency>
-
-
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>shutdown-api</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>shutdown-impl</artifactId>
-        </dependency>
-
-        <!-- threadpool -->
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>threadpool-config-api</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>threadpool-config-impl</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>yang-jmx-generator</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller.md</groupId>
-          <artifactId>forwardingrules-manager</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller.md</groupId>
-          <artifactId>inventory-manager</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller.md</groupId>
-          <artifactId>statistics-manager</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller.md</groupId>
-          <artifactId>topology-lldp-discovery</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>liblldp</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller.md</groupId>
-          <artifactId>topology-manager</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller.model</groupId>
-          <artifactId>model-flow-base</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller.model</groupId>
-          <artifactId>model-flow-service</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller.model</groupId>
-          <artifactId>model-flow-statistics</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller.model</groupId>
-          <artifactId>model-inventory</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller.model</groupId>
-          <artifactId>model-topology</artifactId>
-        </dependency>
-
-        <!-- toaster example I'm pretty sure we should trim -->
-        <dependency>
-          <groupId>org.opendaylight.controller.samples</groupId>
-          <artifactId>sample-toaster</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller.samples</groupId>
-          <artifactId>sample-toaster-consumer</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller.samples</groupId>
-          <artifactId>sample-toaster-provider</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.apache.sshd</groupId>
-          <artifactId>sshd-core</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>binding-generator-api</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>binding-generator-impl</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>binding-data-codec</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>binding-generator-spi</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>binding-generator-util</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>binding-model-api</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>binding-type-provider</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>concepts</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>object-cache-api</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>object-cache-guava</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>restconf-client-api</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>restconf-client-impl</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>util</artifactId>
-        </dependency>
-        <!-- yangtools dependencies I'm pretty sure we can trim -->
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>yang-binding</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>yang-common</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>yang-data-api</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>yang-data-impl</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>yang-data-util</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>yang-model-api</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>yang-model-util</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>yang-parser-api</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>yang-parser-impl</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>yang-data-codec-gson</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools</groupId>
-          <artifactId>yang-data-composite-node</artifactId>
-        </dependency>
-        <!-- yang model dependencies -->
-        <dependency>
-          <groupId>org.opendaylight.yangtools.model</groupId>
-          <artifactId>ietf-inet-types</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools.model</groupId>
-          <artifactId>ietf-restconf</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools.model</groupId>
-          <artifactId>ietf-topology</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools.model</groupId>
-          <artifactId>ietf-yang-types</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools.model</groupId>
-          <artifactId>ietf-yang-types-20130715</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools.model</groupId>
-          <artifactId>opendaylight-l2-types</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools.model</groupId>
-          <artifactId>yang-ext</artifactId>
-        </dependency>
-
-        <dependency>
-          <groupId>org.opendaylight.yangtools.thirdparty</groupId>
-          <artifactId>antlr4-runtime-osgi-nohead</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.yangtools.thirdparty</groupId>
-          <artifactId>xtend-lib-osgi</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.openexi</groupId>
-          <artifactId>nagasena</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.openexi</groupId>
-          <artifactId>nagasena-rta</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.zeromq</groupId>
-          <artifactId>jeromq</artifactId>
-          <version>0.3.1</version>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-clustering-config</artifactId>
-        </dependency>
-          <dependency>
-              <groupId>org.eclipse.jetty</groupId>
-              <artifactId>jetty-servlets</artifactId>
-              <version>8.1.14.v20131031</version>
-          </dependency>
-          <dependency>
-              <groupId>org.eclipse.jetty</groupId>
-              <artifactId>jetty-client</artifactId>
-              <version>8.1.14.v20131031</version>
-          </dependency>
-          <dependency>
-              <groupId>org.eclipse.jetty</groupId>
-              <artifactId>jetty-continuation</artifactId>
-              <version>8.1.14.v20131031</version>
-          </dependency>
-          <dependency>
-              <groupId>org.eclipse.jetty</groupId>
-              <artifactId>jetty-util</artifactId>
-              <version>8.1.14.v20131031</version>
-          </dependency>
-          <dependency>
-              <groupId>org.eclipse.jetty</groupId>
-              <artifactId>jetty-server</artifactId>
-              <version>8.1.14.v20131031</version>
-          </dependency>
-          <dependency>
-              <groupId>org.eclipse.jetty</groupId>
-              <artifactId>jetty-io</artifactId>
-              <version>8.1.14.v20131031</version>
-          </dependency>
-          <dependency>
-              <groupId>org.eclipse.jetty</groupId>
-              <artifactId>jetty-http</artifactId>
-              <version>8.1.14.v20131031</version>
-          </dependency>
-      </dependencies>
-    </profile>
-    <profile>
-      <id>integrationtests</id>
-      <activation>
-        <activeByDefault>false</activeByDefault>
-      </activation>
-      <dependencies>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sanitytest</artifactId>
-        </dependency>
-      </dependencies>
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-dependency-plugin</artifactId>
-            <version>2.8</version>
-            <configuration>
-              <artifactItems>
-                <artifactItem>
-                  <groupId>org.opendaylight.controller</groupId>
-                  <artifactId>sanitytest</artifactId>
-                  <type>jar</type>
-                </artifactItem>
-              </artifactItems>
-            </configuration>
-            <dependencies>
-              <dependency>
-                <groupId>org.opendaylight.controller</groupId>
-                <artifactId>sanitytest</artifactId>
-                <version>${sanitytest.version}</version>
-              </dependency>
-            </dependencies>
-            <executions>
-              <execution>
-                <id>copy</id>
-                <goals>
-                  <goal>copy</goal>
-                </goals>
-                <phase>package</phase>
-              </execution>
-              <execution>
-                <id>unpack-provided-configs</id>
-                <goals>
-                  <goal>unpack-dependencies</goal>
-                </goals>
-                <phase>generate-resources</phase>
-                <configuration>
-                   <outputDirectory>${project.build.directory}/configuration</outputDirectory>
-                    <includeArtifactIds>sal-rest-connector-config,config-netty-config,md-sal-config,netconf-config,toaster-config,netconf-connector-config,sal-clustering-config</includeArtifactIds>
-                    <includes>**\/*.xml,**/*.conf</includes>
-                   <excludeTransitive>true</excludeTransitive>
-                   <ignorePermissions>false</ignorePermissions>
-                </configuration>
-              </execution>
-            </executions>
-          </plugin>
-          <plugin>
-            <groupId>org.codehaus.mojo</groupId>
-            <artifactId>exec-maven-plugin</artifactId>
-            <version>1.2.1</version>
-            <configuration>
-              <executable>${java.home}/bin/java</executable>
-              <arguments>
-                <argument>-cp</argument>
-                <argument>./target/dependency/*</argument>
-                <argument>org.opendaylight.controller.distribution.Sanity</argument>
-              </arguments>
-              <environmentVariables>
-                <JAVA_HOME>${java.home}</JAVA_HOME>
-              </environmentVariables>
-            </configuration>
-            <executions>
-              <execution>
-                <id>sanity-test</id>
-                <goals>
-                  <goal>exec</goal>
-                </goals>
-                <phase>package</phase>
-              </execution>
-            </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-    <profile>
-      <id>docs</id>
-      <activation>
-        <activeByDefault>false</activeByDefault>
-      </activation>
-      <dependencies>
-        <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>swagger-ui</artifactId>
-          <version>0.1.0-SNAPSHOT</version>
-        </dependency>
-      </dependencies>
-    </profile>
-  </profiles>
-</project>
diff --git a/opendaylight/distribution/opendaylight/runsanity.bat b/opendaylight/distribution/opendaylight/runsanity.bat
deleted file mode 100644 (file)
index f219828..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-rem Inject the sanitytest jar as a controller plugin
-copy .\target\dependency\sanitytest*.jar .\target\distribution.opendaylight-osgipackage\opendaylight\plugins
-
-rem Store the current working directory in a variable so that we can get back to it later
-set cwd=%cd%
-
-rem Switch to the distribution folder
-cd .\target\distribution.opendaylight-osgipackage\opendaylight
-
-rem Run the controller
-cmd.exe /c run.bat
-
-rem Store the exit value of the controller in a variable
-set success=%ERRORLEVEL%
-
-rem Switch back to the directory from which this script was invoked
-cd %cwd%
-
-rem Remove the sanitytest jar from the plugins directory
-del .\target\distribution.opendaylight-osgipackage\opendaylight\plugins\sanitytest*.jar
-
-rem Exit using the exit code that we had captured earlier after running the controller
-exit /b %SUCCESS%
\ No newline at end of file
diff --git a/opendaylight/distribution/opendaylight/runsanity.sh b/opendaylight/distribution/opendaylight/runsanity.sh
deleted file mode 100755 (executable)
index 4ee9555..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-# Inject the sanitytest jar as a controller plugin
-cp ./target/dependency/sanitytest*.jar ./target/distribution.opendaylight-osgipackage/opendaylight/plugins
-
-# Store the current working directory in a variable so that we can get back to it later
-cwd=`pwd`
-
-# Switch to the distribution folder
-cd ./target/distribution.opendaylight-osgipackage/opendaylight/
-
-# Run the controller
-./run.sh
-
-# Store the exit value of the controller in a variable
-success=`echo $?`
-
-# Switch back to the directory from which this script was invoked
-cd $cwd
-
-# Remove the sanitytest jar from the plugins directory
-rm ./target/distribution.opendaylight-osgipackage/opendaylight/plugins/sanitytest*.jar
-
-# Exit using the exit code that we had captured earlier after running the controller
-exit $success
-
diff --git a/opendaylight/distribution/opendaylight/src/assemble/bin.xml b/opendaylight/distribution/opendaylight/src/assemble/bin.xml
deleted file mode 100644 (file)
index e5fc98a..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
-  <id>osgipackage</id>
-  <formats>
-    <format>dir</format>
-    <format>zip</format>
-  </formats>
-  <includeBaseDirectory>false</includeBaseDirectory>
-  <dependencySets>
-    <dependencySet>
-      <outputDirectory>opendaylight/plugins</outputDirectory>
-      <excludes>
-        <exclude>equinoxSDK381:org.eclipse.osgi</exclude>
-        <exclude>equinoxSDK381:org.eclipse.equinox.console</exclude>
-        <exclude>equinoxSDK381:org.eclipse.equinox.launcher</exclude>
-        <exclude>equinoxSDK381:org.eclipse.equinox.ds</exclude>
-        <exclude>equinoxSDK381:org.eclipse.equinox.util</exclude>
-        <exclude>equinoxSDK381:org.eclipse.osgi.services</exclude>
-        <exclude>virgomirror:org.eclipse.jdt.core.compiler.batch</exclude>
-        <exclude>org.apache.felix:org.apache.felix.fileinstall</exclude>
-        <exclude>geminiweb:org.eclipse.virgo.kernel.equinox.extensions</exclude>
-        <exclude>org.slf4j:slf4j-api</exclude>
-        <exclude>ch.qos.logback:logback-core</exclude>
-        <exclude>ch.qos.logback:logback-classic</exclude>
-        <exclude>com.sun.jersey:jersey-core</exclude>
-        <exclude>com.sun.jersey:jersey-server</exclude>
-        <exclude>org.opendaylight.controller:logging.bridge</exclude>
-        <exclude>org.opendaylight.controller:sanitytest</exclude>
-      </excludes>
-      <outputFileNameMapping>
-        ${artifact.groupId}.${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}
-      </outputFileNameMapping>
-      <unpack>false</unpack>
-      <scope>runtime</scope>
-      <useTransitiveDependencies>false</useTransitiveDependencies>
-    </dependencySet>
-    <dependencySet>
-      <outputDirectory>opendaylight/lib</outputDirectory>
-      <includes>
-        <include>equinoxSDK381:org.eclipse.osgi</include>
-        <include>equinoxSDK381:org.eclipse.equinox.console</include>
-        <include>equinoxSDK381:org.eclipse.equinox.launcher</include>
-        <include>equinoxSDK381:org.eclipse.equinox.ds</include>
-        <include>equinoxSDK381:org.eclipse.equinox.util</include>
-        <include>equinoxSDK381:org.eclipse.osgi.services</include>
-        <include>virgomirror:org.eclipse.jdt.core.compiler.batch</include>
-        <include>org.apache.felix:org.apache.felix.fileinstall</include>
-        <include>geminiweb:org.eclipse.virgo.kernel.equinox.extensions</include>
-        <include>org.slf4j:slf4j-api</include>
-        <include>ch.qos.logback:logback-core</include>
-        <include>ch.qos.logback:logback-classic</include>
-        <include>com.sun.jersey:jersey-core</include>
-        <include>com.sun.jersey:jersey-server</include>
-        <include>org.opendaylight.controller:logging.bridge</include>
-      </includes>
-      <useTransitiveDependencies>false</useTransitiveDependencies>
-      <outputFileNameMapping>
-        ${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}
-      </outputFileNameMapping>
-      <unpack>false</unpack>
-      <scope>runtime</scope>
-    </dependencySet>
-  </dependencySets>
-  <fileSets>
-    <fileSet>
-      <directory>
-        src/main/resources/
-      </directory>
-      <excludes>
-        <exclude>version.properties</exclude>
-        <exclude>configuration/config.ini</exclude>
-      </excludes>
-      <outputDirectory>
-        opendaylight/
-      </outputDirectory>
-    </fileSet>
-    <fileSet>
-      <directory>${project.build.directory}/configuration/initial</directory>
-      <outputDirectory>/opendaylight/configuration/initial</outputDirectory>
-      <excludes>
-        <exclude>**/META-INF/**</exclude>
-      </excludes>
-    </fileSet>
-  </fileSets>
-  <files>
-    <file>
-      <source>src/main/resources/version.properties</source>
-      <outputDirectory>opendaylight</outputDirectory>
-      <filtered>true</filtered>
-    </file>
-      <file>
-        <source>src/main/resources/configuration/config.ini</source>
-        <outputDirectory>opendaylight/configuration</outputDirectory>
-        <filtered>true</filtered>
-      </file>
-  </files>
-</assembly>
diff --git a/opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini b/opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini
deleted file mode 100644 (file)
index 691d83d..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-osgi.bundles=\
-    reference\:file\:../lib/org.apache.felix.fileinstall-3.1.6.jar@1:start,\
-    reference\:file\:../lib/org.eclipse.jdt.core.compiler.batch-3.8.0.I20120518-2145.jar@1:start,\
-    reference\:file\:../lib/org.eclipse.equinox.ds-1.4.0.v20120522-1841.jar@2:start,\
-    reference\:file\:../lib/org.eclipse.equinox.util-1.0.400.v20120522-2049.jar@2:start,\
-    reference\:file\:../lib/org.eclipse.osgi.services-3.3.100.v20120522-1822@2:start,\
-    reference\:file\:../lib/org.eclipse.equinox.console-1.0.0.v20120522-1841.jar@start,\
-    reference\:file\:../lib/slf4j-api-1.7.2.jar@1:start,\
-    reference\:file\:../lib/logback-classic-1.0.9.jar@1:start,\
-    reference\:file\:../lib/logback-core-1.0.9.jar@1:start,\
-    reference\:file\:../lib/logging.bridge-${logging.bridge.version}@1:start,\
-    reference\:file\:../lib/jersey-core-1.17.jar@2:start,\
-    reference\:file\:../lib/jersey-server-1.17.jar@2:start
-
-# Netconf startup configuration
-
-# Netconf tcp address:port is optional
-#netconf.tcp.address=127.0.0.1
-#netconf.tcp.port=8383
-
-# Netconf tcp address:port is optional
-netconf.ssh.address=0.0.0.0
-netconf.ssh.port=1830
-netconf.ssh.pk.path = ./configuration/RSA.pk
-netconf.ssh.default.user = netconf
-netconf.ssh.default.password = netconf
-
-
-netconf.config.persister.active=1,2
-# read startup configuration
-netconf.config.persister.1.storageAdapterClass=org.opendaylight.controller.config.persist.storage.directory.xml.XmlDirectoryStorageAdapter
-netconf.config.persister.1.properties.directoryStorage=configuration/initial/
-# include only xml files, files with other extensions will be skipped, multiple extensions are permitted e.g. netconf.config.persister.1.properties.includeExtensions=xml,cfg,config
-netconf.config.persister.1.properties.includeExtensions=xml
-netconf.config.persister.1.readonly=true
-
-netconf.config.persister.2.storageAdapterClass=org.opendaylight.controller.config.persist.storage.file.xml.XmlFileStorageAdapter
-netconf.config.persister.2.properties.fileStorage=configuration/current/controller.currentconfig.xml
-netconf.config.persister.2.properties.numberOfBackups=1
-
-# Set Default start level for framework
-osgi.bundles.defaultStartLevel=4
-# Extra packages to import from the boot class loader
-org.osgi.framework.system.packages.extra=sun.reflect,sun.reflect.misc,sun.misc,sun.nio.ch
-# This is not Eclipse App
-eclipse.ignoreApp=true
-# Don't shutdown equinox if the eclipse App has ended,
-# which is our case because we are not running any eclipse application
-osgi.noShutdown=true
-# Clean any cached data on restart of the framework
-osgi.clean=true
-
-# https://bugs.eclipse.org/bugs/show_bug.cgi?id=325578
-# Extend the framework to avoid the resources to be presented with
-# a URL of type bundleresource: but to be presented as file:
-osgi.hook.configurators.include=org.eclipse.virgo.kernel.equinox.extensions.hooks.ExtensionsHookConfigurator
-
-# Directory from where the fileinstall will monitor for new bundles
-felix.fileinstall.dir=./plugins
-# Immediately learn new bundles at startup
-felix.fileinstall.noInitialDelay=true
-# Auto start the bundles at level 4
-felix.fileinstall.start.level=4
-# Avoid to auto-install following bundles, that means those need
-# to be started manually or in other way like osgi.bundles
-felix.fileinstall.filter=^(?!org.apache.felix.fileinstall).*
-
-# logback configuration
-logback.configurationFile=configuration/logback.xml
-
-# Container configuration
-container.profile = Container
-
-# Connection manager configuration
-connection.scheme = ANY_CONTROLLER_ONE_MASTER
-
-# Embedded Tomcat configuration File
-org.eclipse.gemini.web.tomcat.config.path=configuration/tomcat-server.xml
-org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true
-
-# Open Flow related system parameters
-# TCP port on which the controller is listening (default 6633)
-# of.listenPort=6633
-# IP address of the controller (default: wild card)
-# of.address = 127.0.0.1
-# The time (in milliseconds) the controller will wait for a response after sending a Barrier Request or a Statistic Request message (default 2000 msec)
-# of.messageResponseTimer=2000
-# The switch liveness timeout value (default 60500 msec)
-# of.switchLivenessTimeout=60500
-# The size of the queue holding pending statistics requests (default 64). For large networks of n switches, it is recommended to set the queue size to n
-# of.statsQueueSize = 64
-# The flow statistics polling interval in second (default 10 sec)
-# of.flowStatsPollInterval=10
-# The port statistics polling interval in second (default 5 sec)
-# of.portStatsPollInterval=5
-# The description statistics polling interval in second (default 60 sec)
-# of.descStatsPollInterval=60
-# The table statistics polling interval in second (default 10 sec)
-# of.tableStatsPollInterval=10
-# The maximum number of asynchronous messages can be sent before sending a Barrier Request (default 100)
-# of.barrierMessagePriorCount=100
-# The interval which determines how often the discovery packets should be sent (default 300 sec)
-# of.discoveryInterval=300
-# The timeout multiple of discovery interval
-# of.discoveryTimeoutMultiple=2
-# For newly added ports, allow one more retry if the elapsed time exceeds this threshold (default 30 sec)
-# of.discoveryThreshold=30
-# The maximum number of ports handled in one discovery batch (default 512)
-# of.discoveryBatchMaxPorts=512
-
-# OVSDB configuration
-# ovsdb plugin supports both active and passive connections. It listens on port 6640 by default for Active connections.
-ovsdb.listenPort=6640
-
-# ovsdb creates Openflow nodes/bridges. This configuration configures the bridge's Openflow version.
-# default Openflow version = 1.3, we also support 1.0.
-ovsdb.of.version=1.3
-
-# ovsdb can be configured with ml2 to perform l3 forwarding. The config below enables that functionality, which is
-# disabled by default.
-# ovsdb.l3.fwd.enabled=yes
-
-# ovsdb can be configured with ml2 to perform l3 forwarding. When used in that scenario, the mac address of the default
-# gateway --on the external subnet-- is expected to be resolved from its inet address. The config below overrides that
-# specific arp/neighDiscovery lookup.
-# ovsdb.l3gateway.mac=00:00:5E:00:02:01
-
-# TLS configuration
-# To enable TLS, set secureChannelEnabled=true and specify the location of controller Java KeyStore and TrustStore files.
-# The Java KeyStore contains controller's private key and certificate. The Java TrustStore contains the trusted certificate
-# entries, including switches' Certification Authority (CA) certificates. For example,
-# secureChannelEnabled=true
-# controllerKeyStore=./configuration/ctlKeyStore
-# controllerKeyStorePassword=xxxxxxxx (this password should match the password used for KeyStore generation and at least 6 characters)
-# controllerTrustStore=./configuration/ctlTrustStore
-# controllerTrustStorePassword=xxxxxxxx (this password should match the password used for TrustStore generation and at least 6 characters)
-
-secureChannelEnabled=false
-controllerKeyStore=
-controllerKeyStorePassword=
-controllerTrustStore=
-controllerTrustStorePassword=
-
-# User Manager configurations
-enableStrongPasswordCheck = false
-
-#Jolokia configurations
-org.jolokia.listenForHttpService=false
-
-# Logging configuration for Tomcat-JUL logging
-java.util.logging.config.file=configuration/tomcat-logging.properties
-
-#Hosttracker hostsdb key scheme setting
-hosttracker.keyscheme=IP
-
-# LISP Flow Mapping configuration
-# Map-Register messages overwrite existing RLOC sets in EID-to-RLOC mappings
-lisp.mappingOverwrite = true
-# Enable the Solicit-Map-Request (SMR) mechanism
-lisp.smr = false
-
-#RESTConf websocket listen port (default is 8181)
-restconf.websocket.port=8181
diff --git a/opendaylight/distribution/opendaylight/src/main/resources/configuration/context.xml b/opendaylight/distribution/opendaylight/src/main/resources/configuration/context.xml
deleted file mode 100644 (file)
index 90b9ddf..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<Context crossContext="true" sessionCookiePath="/" useHttpOnly="false"/>
diff --git a/opendaylight/distribution/opendaylight/src/main/resources/configuration/cors-config.xml b/opendaylight/distribution/opendaylight/src/main/resources/configuration/cors-config.xml
deleted file mode 100644 (file)
index c148b83..0000000
+++ /dev/null
@@ -1,67 +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
-  -->
-
-<Host>
-  <!-- Filters are allowed here, only serving as a template -->
-  <filter-template>
-    <filter-name>CorsFilter</filter-name>
-    <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
-    <init-param>
-      <param-name>cors.allowed.origins</param-name>
-      <param-value>*</param-value>
-    </init-param>
-    <init-param>
-      <param-name>cors.allowed.methods</param-name>
-      <param-value>GET,POST,HEAD,OPTIONS,PUT,DELETE</param-value>
-    </init-param>
-    <init-param>
-      <param-name>cors.allowed.headers</param-name>
-      <param-value>Content-Type,X-Requested-With,accept,authorization,
-        origin,Origin,Access-Control-Request-Method,Access-Control-Request-Headers
-      </param-value>
-    </init-param>
-    <init-param>
-      <param-name>cors.exposed.headers</param-name>
-      <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
-    </init-param>
-    <init-param>
-      <param-name>cors.support.credentials</param-name>
-      <param-value>true</param-value>
-    </init-param>
-    <init-param>
-      <param-name>cors.preflight.maxage</param-name>
-      <param-value>10</param-value>
-    </init-param>
-  </filter-template>
-
-  <Context path="/restconf">
-    <filter>
-      <filter-name>CorsFilter</filter-name>
-      <!-- init params can be added/overriden if template is used -->
-    </filter>
-    <!-- references to templates without <filter> declaration are not allowed -->
-    <filter-mapping>
-      <filter-name>CorsFilter</filter-name>
-      <url-pattern>/*</url-pattern>
-    </filter-mapping>
-  </Context>
-
-  <Context path="/apidoc">
-    <filter>
-      <filter-name>CorsFilter</filter-name>
-      <!-- init params can be added/overriden if template is used -->
-    </filter>
-    <!-- references to templates without <filter> declaration are not allowed -->
-    <filter-mapping>
-      <filter-name>CorsFilter</filter-name>
-      <url-pattern>/*</url-pattern>
-    </filter-mapping>
-  </Context>
-
-
-</Host>
diff --git a/opendaylight/distribution/opendaylight/src/main/resources/configuration/logback.xml b/opendaylight/distribution/opendaylight/src/main/resources/configuration/logback.xml
deleted file mode 100644 (file)
index b73244b..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
- <configuration scan="true">
-
-  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-    <encoder>
-      <pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} %X{akkaSource} - %msg%n</pattern>
-    </encoder>
-  </appender>
-  <appender name="opendaylight.log" class="ch.qos.logback.core.rolling.RollingFileAppender">
-    <file>logs/opendaylight.log</file>
-
-    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-      <fileNamePattern>logs/opendaylight.%d.log.zip</fileNamePattern>
-      <maxHistory>1</maxHistory>
-    </rollingPolicy>
-
-    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
-      <maxFileSize>10MB</maxFileSize>
-    </triggeringPolicy>
-
-    <encoder>
-      <pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{35} - %msg%n</pattern>
-    </encoder>
-  </appender>
-  <appender name="audit-file" class="ch.qos.logback.core.FileAppender">
-        <file>logs/audit.log</file>
-        <append>true</append>
-        <encoder>
-            <pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} %msg %n</pattern>
-        </encoder>
-  </appender>
-  <root level="error">
-    <appender-ref ref="STDOUT" />
-    <appender-ref ref="opendaylight.log" />
-  </root>
-
-  <!--  Base log level  -->
-  <logger name="org.opendaylight" level="INFO"/>
-
-
-  <!-- Controller log level -->
-  <logger name="org.opendaylight.controller" level="INFO"/>
-
-  <!-- OSGi logging bridge -->
-  <logger name="org.opendaylight.controller.logging.bridge" level="WARN"/>
-  <logger name="org.opendaylight.controller.logging.bridge.internal" level="WARN"/>
-
-  <!-- Netty -->
-  <logger name="io.netty" level="WARN"/>
-
-  <!-- Openflow Protocol Plugin -->
-  <logger name="org.opendaylight.controller.protocol_plugin.openflow" level="INFO"/>
-  <logger name="org.opendaylight.controller.protocol_plugin.openflow.internal.DiscoveryService" level="INFO"/>
-  <logger name="org.opendaylight.controller.protocol_plugin.openflow.internal.InventoryService" level="INFO"/>
-  <logger name="org.opendaylight.controller.protocol_plugin.openflow.internal.InventoryServiceShim" level="INFO"/>
-  <logger name="org.opendaylight.controller.protocol_plugin.openflow.internal.TopologyServices" level="INFO"/>
-  <logger name="org.opendaylight.controller.protocol_plugin.openflow.internal.TopologyServiceShim" level="INFO"/>
-  <logger name="org.opendaylight.controller.protocol_plugin.openflow.core.internal.Controller" level="INFO"/>
-  <logger name="org.opendaylight.controller.protocol_plugin.openflow.core.internal.SwitchHandler" level="INFO"/>
-  <logger name="org.opendaylight.controller.protocol_plugin.openflow.core.internal.SwitchIOSecureService" level="INFO"/>
-  <!-- SAL  -->
-  <logger name="org.opendaylight.controller.sal" level="INFO"/>
-  <logger name="org.opendaylight.controller.sal.implementation" level="INFO"/>
-  <logger name="org.opendaylight.controller.sal.implementation.internal.Inventory" level="INFO"/>
-  <logger name="org.opendaylight.controller.sal.implementation.internal.Topology" level="INFO"/>
-     <!-- remoterpc router and remoterpc routing table -->
-  <logger name="org.opendaylight.controller.sal.connector.remoterpc" level="INFO" />
-  <!-- Functional Modules -->
-  <logger name="org.opendaylight.controller.arphandler" level="INFO"/>
-  <logger name="org.opendaylight.controller.hosttracker" level="INFO"/>
-  <logger name="org.opendaylight.controller.routing" level="INFO"/>
-  <logger name="org.opendaylight.controller.forwardingrulesmanager" level="INFO"/>
-  <logger name="org.opendaylight.controller.forwarding.ipswitch" level="INFO"/>
-  <logger name="org.opendaylight.controller.switchmanager" level="INFO"/>
-  <logger name="org.opendaylight.controller.topologymanager" level="INFO"/>
-  <logger name="org.opendaylight.controller.usermanager" level="INFO"/>
-  <!-- Web modules -->
-  <logger name="org.opendaylight.controller.web" level="INFO"/>
-
-  <!-- Clustering -->
-  <logger name="org.opendaylight.controller.cluster" level="INFO"/>
-  <logger name="org.opendaylight.controller.cluster.datastore.node" level="INFO"/>
-
-  <!--
-       Unsynchronized controller startup causes models to crop up in random
-       order, which results in temporary inability to fully resolve a model,
-       which is usually resolved. Do not flood console, but keep the messages,
-       as they may be indicating and error.
-  -->
-  <logger name="org.opendaylight.yangtools.yang.parser.util.ModuleDependencySort" level="INFO" additivity="false">
-    <appender-ref ref="opendaylight.log"/>
-  </logger>
-
-  <!-- BGPCEP plugin -->
-  <logger name="org.opendaylight.protocol" level="INFO"/>
-  <logger name="org.opendaylight.bgpcep" level="INFO"/>
-
-  <!-- To debug MD-SAL schema loading issues, uncomment this -->
-  <!--logger name="org.opendaylight.yangtools.yang.parser.impl.util.URLSchemaContextResolver" level="DEBUG"/>
-  <logger name="org.opendaylight.yangtools.sal.binding.generator.impl.RuntimeGeneratedMappingServiceImpl" level="TRACE"/-->
-
-  <!-- additivity=false ensures analytics data only goes to the analytics log -->
-  <logger name="audit" level="INFO" additivity="false">
-       <appender-ref ref="audit-file"/>
-  </logger>
-</configuration>
diff --git a/opendaylight/distribution/opendaylight/src/main/resources/configuration/startup/README b/opendaylight/distribution/opendaylight/src/main/resources/configuration/startup/README
deleted file mode 100644 (file)
index 2da70ff..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Directory where the opendaylight controller modules store their configuration files
diff --git a/opendaylight/distribution/opendaylight/src/main/resources/configuration/tomcat-logging.properties b/opendaylight/distribution/opendaylight/src/main/resources/configuration/tomcat-logging.properties
deleted file mode 100644 (file)
index 3dbd992..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-############################################################
-# Configuration file for tomcat logging
-############################################################
-# Handlers:
-# "handlers" specifies a comma separated list of log Handler
-# classes.  These handlers will be installed during VM startup.
-# Note that these classes must be on the system classpath.
-# Following line configures a ConsoleHandler and a FileHandler
-
-handlers= java.util.logging.FileHandler,java.util.logging.ConsoleHandler
-
-############################################################
-# Handler specific properties
-# Describes specific configuration info for Handlers
-# JUL does not support rolling file handler based on date
-# For now we will keep count of files to 5 with rolling size of 10MB
-############################################################
-
-java.util.logging.FileHandler.pattern = logs/tomcat%g.log
-java.util.logging.FileHandler.limit = 104857600
-java.util.logging.FileHandler.count = 5
-java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
-java.util.logging.FileHandler.append = true
-java.util.logging.FileHandler.level = INFO
-
-# Limit the message that are printed on the console to SEVERE and above.
-java.util.logging.ConsoleHandler.level = WARNING
-java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
-
-# SimpleFormatter output format to print one-line log message like this:
-# <YYYY>-<MM>-<DD> <HH>:<MM>:<SS> <TimeZone> [<SOURCE>] ><LOG_LEVEL> <LOGGER> <MESSAGE> <THROWABLE>
-#
-java.util.logging.SimpleFormatter.format=%1$tF %1$tT %1$tZ [%3$s] %4$s %2$s %5$s%6$s%n
-
-############################################################
-# Facility specific properties.
-# Provides extra control for each logger.
-############################################################
-
-# For example, set the com.xyz.foo logger to only log SEVERE
-# messages
-#org.apache.catalina = SEVERE
diff --git a/opendaylight/distribution/opendaylight/src/main/resources/configuration/tomcat-server.xml b/opendaylight/distribution/opendaylight/src/main/resources/configuration/tomcat-server.xml
deleted file mode 100644 (file)
index da2500b..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-<Server>
-  <!--APR library loader. Documentation at /docs/apr.html -->
-  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
-  <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
-  <Listener className="org.apache.catalina.core.JasperListener" />
-  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
-  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
-  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
-  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
-
-  <Service name="Catalina">
-    <Connector port="8080" protocol="HTTP/1.1"
-               connectionTimeout="20000"
-               redirectPort="8443" />
-
-<!--
-        Please remove the comments around the following Connector tag to enable HTTPS Authentication support.
-        Remember to add a valid keystore in the configuration folder.
-        More info : http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
--->
-
- <!--
-    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
-               maxThreads="150" scheme="https" secure="true"
-               clientAuth="false" sslProtocol="TLS"
-               keystoreFile="configuration/keystore"
-               keystorePass="changeit"/>
- -->
-
-    <Engine name="Catalina" defaultHost="localhost">
-      <Host name="localhost" appBase=""
-            unpackWARs="false" autoDeploy="false"
-            deployOnStartup="false" createDirs="false">
-        <Realm className="org.opendaylight.controller.security.ControllerCustomRealm" />
-            <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-
-        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
-                        prefix="web_access_log_" suffix=".txt" resolveHosts="false"
-                        rotatable="true" fileDateFormat="yyyy-MM"
-                        pattern="%{yyyy-MM-dd HH:mm:ss.SSS z}t - [%a] - %r"/>
-
-          <Valve className="org.opendaylight.controller.filtervalve.cors.FilterValve"
-                 configurationFile="configuration/cors-config.xml"
-                  />
-      </Host>
-    </Engine>
-  </Service>
-</Server>
diff --git a/opendaylight/distribution/opendaylight/src/main/resources/functions.sh b/opendaylight/distribution/opendaylight/src/main/resources/functions.sh
deleted file mode 100644 (file)
index 21dd4c1..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-
-# Function harvestHelp searches in run.sh part for line starting with "##<name command>".
-# Next lines starting with "#<text>" will be printed without first char # (=help content).
-# Help content has to end with "##" on new line.
-# Example:
-##foo
-#   Foo is world wide used synnonym for bar.
-##
-function harvestHelp() {
-    key="$1"
-    if [ -z "${key}" ]; then
-         key='HELP'
-    fi
-    echo
-    sed -rn "/^##${key}$/,/^##/ p" $0 | sed -r '1 d; $ d; s/^#/  /'
-    grep "##${key}" $0 > /dev/null
-}
diff --git a/opendaylight/distribution/opendaylight/src/main/resources/run.bat b/opendaylight/distribution/opendaylight/src/main/resources/run.bat
deleted file mode 100644 (file)
index ce13e33..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-@ECHO OFF
-SETLOCAL ENABLEDELAYEDEXPANSION
-
-IF NOT EXIST "%JAVA_HOME%" (
-    ECHO JAVA_HOME environment variable is not set
-    EXIT /B 2
-)
-
-SET basedir=%~dp0
-SET debugport=8000
-SET consoleport=2400
-SET jmxport=1088
-SET jvmMaxMemory=
-SET extraJVMOpts=
-SET consoleOpts=-console -consoleLog
-SET PID=
-SET JAVA_H=%JAVA_HOME%\bin\jps.exe
-
-:LOOP
-IF "%~1" NEQ "" (
-    SET CARG=%~1
-    IF "!CARG!"=="-debug" (
-       SET debugEnabled=true
-       SHIFT
-       GOTO :LOOP
-    )
-    IF "!CARG!"=="-debugsuspend" (
-       SET debugEnabled=true
-       SET debugSuspended=true
-       SHIFT
-       GOTO :LOOP
-    )
-    IF "!CARG!"=="-debugport" (
-       SET debugEnabled=true
-       SET debugport=%~2
-       SHIFT & SHIFT
-       GOTO :LOOP
-    )
-    IF "!CARG!"=="-jmx" (
-       SET jmxEnabled=true
-       SHIFT
-       GOTO :LOOP
-    )
-    IF "!CARG!"=="-jmxport" (
-       SET jmxEnabled=true
-       SET jmxport=%~2
-       SHIFT & SHIFT
-       GOTO :LOOP
-    )
-    IF "!CARG!"=="-start" (
-       SET startEnabled=true
-       SHIFT
-       GOTO :LOOP
-    )
-    IF "!CARG!"=="-consoleport" (
-       SET consoleport=%~2
-       SHIFT & SHIFT
-       GOTO :LOOP
-    )
-    IF "!CARG!"=="-console" (
-       SHIFT
-       GOTO :LOOP
-    )
-    IF "!CARG!"=="-status" (
-       for /F "TOKENS=1" %%G in ('""!JAVA_H!" -lvV ^| find /I "opendaylight""') do (
-           set PID=%%G
-       )
-       if "!PID!" NEQ "" (
-           ECHO Controller is running with PID !PID!
-       ) else (
-           ECHO Controller is not running.
-       )
-       GOTO :EOF
-    )
-    IF "!CARG!"=="-stop" (
-       for /F "TOKENS=1" %%G in ('""!JAVA_H!" -lvV ^| find /I "opendaylight""') do (
-           set PID=%%G
-       )
-       if "!PID!" NEQ "" (
-           ECHO Stopping controller PID !PID!
-           TASKKILL /F /PID !PID!
-       ) else (
-           ECHO Controller is not running.
-       )
-       GOTO :EOF
-    )
-    IF "!CARG:~0,4!"=="-Xmx" (
-       SET jvmMaxMemory=!CARG!
-       SHIFT
-       GOTO :LOOP
-    )
-    IF "!CARG:~0,2!"=="-D" (
-       SET extraJVMOpts=!extraJVMOpts! !CARG!
-       SHIFT
-       GOTO :LOOP
-    )
-    IF "!CARG:~0,2!"=="-X" (
-       SET extraJVMOpts=!extraJVMOpts! !CARG!
-       SHIFT
-       GOTO :LOOP
-    )
-    IF "!CARG!"=="-help" (
-        SHIFT
-        SET CARG=%2
-        IF "!CARG!" NEQ "" (
-             CALL:!CARG!
-        ) ELSE (
-              CALL:helper
-         )
-        GOTO :EOF
-    )
-
-    ECHO "Unknown option: !CARG!"
-    EXIT /B 1
-)
-
-IF "%debugEnabled%" NEQ "" (
-    REM ECHO "DEBUG enabled"
-    SET extraJVMOpts=!extraJVMOpts! -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=%debugport%
-)
-
-IF "%debugSuspended%" NEQ "" (
-    REM ECHO "DEBUG enabled suspended"
-    SET extraJVMOpts=!extraJVMOpts! -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%debugport%
-)
-
-IF "%jvmMaxMemory%"=="" (
-    SET jvmMaxMemory=-Xmx1G
-    ECHO Setting maximum memory to 1G.
-)
-
-SET extraJVMOpts=!extraJVMOpts!  %jvmMaxMemory%
-
-IF "%jmxEnabled%" NEQ "" (
-    REM ECHO "JMX enabled "
-    SET extraJVMOpts=!extraJVMOpts! -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=%jmxport% -Dcom.sun.management.jmxremote
-)
-IF "%startEnabled%" NEQ "" (
-    REM ECHO "START enabled "
-    SET consoleOpts=-console %consoleport% -consoleLog
-)
-
-REM       Check if controller is already running
-for /F "TOKENS=1" %%G in ('""!JAVA_H!" -lvV ^| find /I "opendaylight""') do (
-    SET PID=%%G
-)
-if "!PID!" NEQ "" (
-   ECHO Controller is already running with PID !PID!
-   EXIT /B 1
-)
-
-
-REM       Now set the classpath:
-SET cp="%basedir%lib\org.eclipse.osgi-3.8.1.v20120830-144521.jar;%basedir%lib\org.eclipse.virgo.kernel.equinox.extensions-3.6.0.RELEASE.jar;%basedir%lib\org.eclipse.equinox.launcher-1.3.0.v20120522-1813.jar"
-
-REM       Now set framework classpath
-SET fwcp="file:\%basedir%lib\org.eclipse.osgi-3.8.1.v20120830-144521.jar,file:\%basedir%lib\org.eclipse.virgo.kernel.equinox.extensions-3.6.0.RELEASE.jar,file:\%basedir%lib\org.eclipse.equinox.launcher-1.3.0.v20120522-1813.jar"
-
-SET RUN_CMD="%JAVA_HOME%\bin\java.exe" -Dopendaylight.controller !extraJVMOpts! -Djava.io.tmpdir="%basedir%work\tmp" -Djava.awt.headless=true -Dosgi.install.area=%basedir% -Dosgi.configuration.area="%basedir%configuration" -Dosgi.frameworkClassPath=%fwcp% -Dosgi.framework="file:\%basedir%lib\org.eclipse.osgi-3.8.1.v20120830-144521.jar" -classpath %cp% org.eclipse.equinox.launcher.Main %consoleOpts%
-
-ECHO !RUN_CMD!
-
-if "%startEnabled%" NEQ "" (
-    START /B cmd /C CALL !RUN_CMD! > %basedir%\logs\controller.out 2>&1
-    ECHO Running controller in the background.
-    EXIT /B 1
-) else (
-    !RUN_CMD!
-    EXIT /B %ERRORLEVEL%
-)
-
-:helper
-echo. For more information on a specific command, type -help command-name.
-echo.
-echo   jmx              ^[-jmx^]
-echo   jmxport          ^[-jmxport ^<num^>^] - DEFAULT is 1088
-echo   debug            ^[-debug^]
-echo   debugsuspend     ^[-debugsuspend^]
-echo   debugport        ^[-debugport ^<num^>^] - DEFAULT is 8000
-echo   start            ^[-start ^[^<console port^>^]^] - DEFAULT port is 2400
-echo   stop             ^[-stop^]
-echo   status           ^[-status^]
-echo   console          ^[-console^]
-echo   agentpath        ^[-agentpath:^<path to lib^>^]
-exit/B 1
-
-:debugsuspend
-ECHO.
-ECHO. debugsuspend     ^[-debugsuspend^]
-ECHO.
-ECHO. This command sets suspend on true in runjdwp in extra JVM options. If its true, VMStartEvent has a suspendPolicy of SUSPEND_ALL. If its false, VMStartEvent has a suspendPolicy of SUSPEND_NONE.
-ECHO.
-EXIT /B 1
-
-:debugport
-ECHO.
-ECHO. debugport        ^[-debugport ^<num^>^] - DEFAULT is 8000
-ECHO.
-ECHO. Set address for settings in runjdwp in extra JVM options.
-ECHO. The address is transport address for the connection.
-ECHO. The address has to be in the range ^[1024,65535^]. If the option was not call, port will be set to default value.
-ECHO.
-EXIT /B 1
-
-:jmxport
-ECHO.
-ECHO. jmxport          ^[-jmxport ^<num^>^] - DEFAULT is 1088
-ECHO.
-ECHO.    Set jmx port for com.sun.management.jmxremote.port in JMX support. Port has to be in the range ^[1024,65535^]. If this option was not call, port will be set to default value.
-ECHO.
-EXIT /B 1
-
-:debug
-ECHO.
-ECHO. debug            [-debug]
-ECHO.
-ECHO. Run ODL controller with -Xdebug and -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=^$^{debugport^}
-ECHO.
-ECHO.    -Xdebug enables debugging capabilities in the JVM which are used by the Java Virtual Machine Tools Interface (JVMTI). JVMTI is a low-level debugging interface used by debuggers and profiling tools.
-ECHO.
-ECHO.    -Xrunjdwp option loads the JPDA reference implementation of JDWP. This library resides in the target VM and uses JVMDI and JNI to interact with it. It uses a transport and the JDWP protocol to communicate with a separate debugger application.
-ECHO.
-ECHO. settings for -Xrunjdwp:
-ECHO.            transport -  name of the transport to use in connecting to debugger application
-ECHO.            server    -  if 'y', listen for a debugger application to attach; otherwise, attach to the debugger application at the specified address
-ECHO.                      -  if 'y' and no address is specified, choose a transport address at which to listen for a debugger application, and print the address to the standard output stream
-ECHO.            suspend   -  if 'y', VMStartEvent has a suspend Policy of SUSPEND_ALL
-ECHO.                      -  if 'n', VMStartEvent has a suspend policy of SUSPEND_NONE
-ECHO.            address   -  transport address for the connection
-ECHO.                      -  if server=n, attempt to attach to debugger application at this address
-ECHO.          -  if server=y, listen for a connection at this address
-ECHO.
-EXIT /B 1
-
-:jmx
-ECHO.
-ECHO. jmx              [-jmx]
-ECHO.
-ECHO. Add JMX support. With settings for extra JVM options: -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=^$^{jmxport^} -Dcom.sun.management.jmxremote
-ECHO. jmxport can by set with option -jmxport ^<num^>. Default num for the option is 1088.
-ECHO.
-EXIT /B 1
-
-:stop
-ECHO.
-ECHO. stop             ^[-stop^]
-ECHO.
-ECHO. If a controller is running, the command stop controller. Pid will be clean.
-ECHO.
-EXIT /B 1
-
-:status
-ECHO.
-ECHO. status           ^[-status^]
-ECHO.
-ECHO. Find out whether a controller is running and print it.
-ECHO.
-EXIT /B 1
-
-:start
-ECHO.
-ECHO. start            ^[-start ^[^<console port^>^]^]
-ECHO.
-ECHO.    If controller is not running, the command with argument^(for set port, where controller has start^) will start new controller on a port. The port has to be in the range ^[1024,65535^]. If this option was not call, port will be set to default value. Pid will be create.
-EXIT /B 1
-
-:console
-ECHO.
-ECHO. console          [-console]
-ECHO.     Default option.
-EXIT /B 1
-
-:agentpath
-ECHO.
-ECHO. agentpath        ^[-agentpath:^<path to lib^>^]
-ECHO.
-ECHO.    Agentpath option passes path to agent to jvm in order to load native agent library, e.g. yourkit profiler agent.
-EXIT /B 1
-
-
diff --git a/opendaylight/distribution/opendaylight/src/main/resources/run.sh b/opendaylight/distribution/opendaylight/src/main/resources/run.sh
deleted file mode 100755 (executable)
index b032469..0000000
+++ /dev/null
@@ -1,331 +0,0 @@
-#!/bin/bash
-
-##HELP
-# For more information on a specific command, type -help command-name.
-#
-#   jmx              [-jmx]
-#   jmxport          [-jmxport <num>] - DEFAULT is 1088
-#   debug            [-debug]
-#   debugsuspend     [-debugsuspend]
-#   debugport        [-debugport <num>] - DEFAULT is 8000
-#   start            [-start [<console port>]] - DEFAULT port is 2400
-#   stop             [-stop]
-#   status           [-status]
-#   console          [-console]
-#   agentpath        [-agentpath:<path to lib>]
-##
-
-platform='unknown'
-unamestr=`uname`
-if [[ "$unamestr" == 'Linux' ]]; then
-   platform='linux'
-elif [[ "$unamestr" == 'Darwin' ]]; then
-   platform='osx'
-fi
-
-if [[ $platform == 'linux' ]]; then
-   fullpath=`readlink -f $0`
-
-   if [[ -z ${JAVA_HOME} ]]; then
-      # Find the actual location of the Java launcher:
-      java_launcher=`command -v java`
-      java_launcher=`readlink -f "${java_launcher}"`
-
-      # Compute the Java home from the location of the Java launcher:
-      export JAVA_HOME="${java_launcher%/bin/java}"
-    fi
-elif [[ $platform == 'osx' ]]; then
-   TARGET_FILE=$0
-   cd `dirname "$TARGET_FILE"`
-   TARGET_FILE=`basename $TARGET_FILE`
-
-   # Iterate down a (possible) chain of symlinks
-   while [ -L "$TARGET_FILE" ]
-   do
-       TARGET_FILE=`readlink "$TARGET_FILE"`
-       cd `dirname "$TARGET_FILE"`
-       TARGET_FILE=`basename "$TARGET_FILE"`
-   done
-
-   # Compute the canonicalized name by finding the physical path
-   # for the directory we're in and appending the target file.
-   PHYS_DIR=`pwd -P`
-   RESULT=$PHYS_DIR/$TARGET_FILE
-   fullpath=$RESULT
-
-   [[ -z ${JAVA_HOME} ]] && [[ -x "/usr/libexec/java_home" ]] && export JAVA_HOME=`/usr/libexec/java_home -v 1.7`;
-
-fi
-
-[[ -z ${JAVA_HOME} ]] && echo "Need to set JAVA_HOME environment variable" && exit -1;
-[[ ! -x ${JAVA_HOME}/bin/java ]] && echo "Cannot find an executable \
-JVM at path ${JAVA_HOME}/bin/java check your JAVA_HOME" && exit -1;
-
-if [ -z ${ODL_BASEDIR} ]; then
-    basedir=`dirname "${fullpath}"`
-else
-    basedir=${ODL_BASEDIR}
-fi
-
-if [ -z ${ODL_DATADIR} ]; then
-    datadir=`dirname "${fullpath}"`
-else
-    datadir=${ODL_DATADIR}
-fi
-
-if [ -z ${TMP} ]; then
-    pidfile="/tmp/opendaylight.PID"
-else
-    pidfile="${TMP}/opendaylight.PID"
-fi
-debug=0
-debugsuspend=0
-debugport=8000
-debugportread=""
-startdaemon=0
-daemonport=2400
-daemonportread=""
-jmxport=1088
-jmxportread=""
-startjmx=0
-stopdaemon=0
-statusdaemon=0
-consolestart=1
-dohelp=0
-jvmMaxMemory="-Xmx1G"
-extraJVMOpts=""
-agentPath=""
-unknown_option=0
-helper=""
-while true ; do
-    case "$1" in
-        -debug) debug=1; shift ;;
-        -help) dohelp=1; shift;  helper=$1; break ;;
-        -jmx) startjmx=1; shift ;;
-        -debugsuspend) debugsuspend=1; shift ;;
-        -debugport) shift; debugportread="$1"; if [[ "${debugportread}" =~ ^[0-9]+$ ]] ; then debugport=${debugportread}; shift; else echo "-debugport expects a number but was not found"; exit -1; fi;;
-        -jmxport) shift; jmxportread="$1"; if [[ "${jmxportread}" =~ ^[0-9]+$ ]] ; then jmxport=${jmxportread}; shift; else echo "-jmxport expects a number but was not found"; exit -1; fi;;
-        -start) startdaemon=1; shift; daemonportread="$1"; if [[ "${daemonportread}" =~ ^[0-9]+$ ]] ; then daemonport=${daemonportread}; shift; fi;;
-        -stop) stopdaemon=1; shift ;;
-        -status) statusdaemon=1; shift ;;
-        -console) shift ;;
-        -Xmx*) jvmMaxMemory="$1"; shift;;
-        -D*) extraJVMOpts="${extraJVMOpts} $1"; shift;;
-        -X*) extraJVMOpts="${extraJVMOpts} $1"; shift;;
-        -J*) extraJVMOpts="${extraJVMOpts} -$(echo "$1" | cut -d'J' -f2)"; shift;;
-        -agentpath:*) agentPath="$1"; shift;;
-        "") break ;;
-        *) echo "Unknown option $1"; unknown_option=1; break ;;
-    esac
-done
-
-
-
-if [ "${unknown_option}" -eq 1 ]; then
-    echo "Use -help for more information."
-    exit 1
-fi
-
-
-if [ "${dohelp}" -eq 1 ]; then
-    . ${basedir}/functions.sh
-    harvestHelp ${helper}
-    echo -e '\nFor other information type -help.\n'
-    exit 1
-fi
-
-extraJVMOpts="${extraJVMOpts} ${jvmMaxMemory}"
-
-##debugport
-#debugport        [-debugport <num>] - DEFAULT is 8000
-#
-#    Set address for settings in runjdwp in extra JVM options.
-#    The address is transport address for the connection.
-#    The address has to be in the range [1024,65535]. If this option was not call, port will be set to default value.
-##
-# Validate debug port
-if [[ "${debugport}" -lt 1024 ]] || [[ "${debugport}" -gt 65535 ]]; then
-    echo "Debug Port not in the range [1024,65535] ${debugport}"
-    exit -1
-fi
-
-# Validate daemon console port
-if [[ "${daemonport}" -lt 1024 ]] || [[ "${daemonport}" -gt 65535 ]]; then
-    echo "Daemon console Port not in the range [1024,65535] value is ${daemonport}"
-    exit -1
-fi
-
-##jmxport
-#jmxport          [-jmxport <num>] - DEFAULT is 1088
-#
-#    Set jmx port for com.sun.management.jmxremote.port in JMX support. Port has to be in the range [1024,65535]. If this option was not call, port will be set to default value.
-##
-# Validate jmx port
-if [[ "${jmxport}" -lt 1024 ]] || [[ "${jmxport}" -gt 65535 ]]; then
-    echo "JMX Port not in the range [1024,65535] value is ${jmxport}"
-    exit -1
-fi
-##debug
-#debug            [-debug]
-#
-#Run ODL controller with -Xdebug and -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=\${debugport}
-#-Xdebug enables debugging capabilities in the JVM which are used by the Java Virtual Machine Tools Interface (JVMTI). JVMTI is a low-level debugging interface used by debuggers and profiling tools.
-#-Xrunjdwp option loads the JPDA reference implementation of JDWP. This library resides in the target VM and uses JVMDI and JNI to interact with it. It uses a transport and the JDWP protocol to
-#communicate with a separate debugger application.
-#settings for -Xrunjdwp:
-#            transport -  name of the transport to use in connecting to debugger application
-#            server    -  if “y”, listen for a debugger application to attach; otherwise, attach to the debugger application at the specified address
-#                      -  if “y” and no address is specified, choose a transport address at which to listen for a debugger application, and print the address to the standard output stream
-#            suspend   -  if “y”, VMStartEvent has a suspend Policy of SUSPEND_ALL
-#                      -  if “n”, VMStartEvent has a suspend policy of SUSPEND_NONE
-#            address   -  transport address for the connection
-#                      -  if server=n, attempt to attach to debugger application at this address
-#          -  if server=y, listen for a connection at this address
-##
-
-##debugsuspend
-#debugsuspend     [-debugsuspend]
-#
-#This command sets suspend on true in runjdwp in extra JVM options. If its true, VMStartEvent has a suspendPolicy of SUSPEND_ALL. If its false, VMStartEvent has a suspendPolicy of SUSPEND_NONE.
-##
-# Debug options
-if [ "${debugsuspend}" -eq 1 ]; then
-    extraJVMOpts="${extraJVMOpts} -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${debugport}"
-elif [ "${debug}" -eq 1 ]; then
-    extraJVMOpts="${extraJVMOpts} -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=${debugport}"
-fi
-##jmx
-#jmx              [-jmx]
-#
-#Add JMX support. With settings for extra JVM options: -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=\${jmxport} -Dcom.sun.management.jmxremote
-#jmxport can by set with command -jmxport <num>. Default num for the option is 1088.
-##
-# Add JMX support
-if [ "${startjmx}" -eq 1 ]; then
-    extraJVMOpts="${extraJVMOpts} -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=${jmxport} -Dcom.sun.management.jmxremote"
-fi
-
-########################################
-# Now add to classpath the OSGi JAR
-########################################
-CLASSPATH=${CLASSPATH}:${basedir}/lib/org.eclipse.osgi-3.8.1.v20120830-144521.jar
-FWCLASSPATH=file:"${basedir}"/lib/org.eclipse.osgi-3.8.1.v20120830-144521.jar
-
-########################################
-# Now add the extensions
-########################################
-
-# Extension 1: this is used to be able to convert all the
-# bundleresouce: URL in file: so packages that are not OSGi ready can
-# still work. Notably this is the case for spring classes
-CLASSPATH=${CLASSPATH}:${basedir}/lib/org.eclipse.virgo.kernel.equinox.extensions-3.6.0.RELEASE.jar
-FWCLASSPATH=${FWCLASSPATH},file:${basedir}/lib/org.eclipse.virgo.kernel.equinox.extensions-3.6.0.RELEASE.jar
-
-########################################
-# Now add the launcher
-########################################
-CLASSPATH=${CLASSPATH}:${basedir}/lib/org.eclipse.equinox.launcher-1.3.0.v20120522-1813.jar
-FWCLASSPATH=${FWCLASSPATH},file:${basedir}/lib/org.eclipse.equinox.launcher-1.3.0.v20120522-1813.jar
-
-cd $basedir
-
-##stop
-#stop             [-stop]
-#
-#If a controller is running, the command stop controller. Pid will be clean.
-##
-if [ "${stopdaemon}" -eq 1 ]; then
-    if [ -e "${pidfile}" ]; then
-        daemonpid=`cat "${pidfile}"`
-        kill "${daemonpid}"
-        rm -f "${pidfile}"
-        echo "Controller with PID: ${daemonpid} -- Stopped!"
-        exit 0
-    else
-        echo "Doesn't seem any Controller daemon is currently running"
-        exit -1
-    fi
-fi
-
-##status
-#status           [-status]
-#
-#Find out whether a controller is running and print it.
-##
-if [ "${statusdaemon}" -eq 1 ]; then
-    if [ -e "${pidfile}" ]; then
-        daemonpid=`cat "${pidfile}"`
-        ps -p ${daemonpid} > /dev/null
-        daemonexists=$?
-        if [ "${daemonexists}" -eq 0 ]; then
-            echo "Controller with PID: ${daemonpid} -- Running!"
-            exit 0
-        else
-            echo "Controller with PID: ${daemonpid} -- Doesn't seem to exist"
-            rm -f "${pidfile}"
-            exit 1
-        fi
-    else
-        echo "Doesn't seem any Controller daemon is currently running, at least no PID file has been found"
-        exit -1
-    fi
-fi
-
-iotmpdir=`echo "${datadir}" | sed 's/ /\\ /g'`
-bdir=`echo "${basedir}" | sed 's/ /\\ /g'`
-confarea=`echo "${datadir}" | sed 's/ /\\ /g'`
-fwclasspath=`echo "${FWCLASSPATH}" | sed 's/ /\\ /g'`
-
-##start
-#start            [-start [<console port>]]
-#
-#    If controller is not running, the command with argument(for set port, where controller has start) will start new controller on a port. The port has to be in the range [1024,65535]. If this option was not call, port will be set to default value. Pid will be create.
-##
-##console
-#console          [-console]
-#
-#    Default option.
-##
-##agentpath
-#agentpath        [-agentpath:<path to lib>]
-#
-#   Agentpath option passes path to agent to jvm in order to load native agent library, e.g. yourkit profiler agent.
-##
-echo "JVM maximum memory was set to ${jvmMaxMemory}."
-if [ "${startdaemon}" -eq 1 ]; then
-    if [ -e "${pidfile}" ]; then
-        echo "Another instance of controller running, check with $0 -status"
-        exit -1
-    fi
-    $JAVA_HOME/bin/java ${extraJVMOpts} \
-        ${agentPath} \
-        -Djava.io.tmpdir="${iotmpdir}/work/tmp" \
-        -Dosgi.install.area="${bdir}" \
-        -Dosgi.configuration.area="${confarea}/configuration" \
-        -Dosgi.frameworkClassPath="${fwclasspath}" \
-        -Dosgi.framework=file:"${bdir}/lib/org.eclipse.osgi-3.8.1.v20120830-144521.jar" \
-        -Djava.awt.headless=true \
-        -classpath "${CLASSPATH}" \
-        org.eclipse.equinox.launcher.Main \
-        -console ${daemonport} \
-        -consoleLog &
-    daemonpid=$!
-    echo ${daemonpid} > ${pidfile}
-elif [ "${consolestart}" -eq 1 ]; then
-    if [ -e "${pidfile}" ]; then
-        echo "Another instance of controller running, check with $0 -status"
-        exit -1
-    fi
-    $JAVA_HOME/bin/java ${extraJVMOpts} \
-        ${agentPath} \
-        -Djava.io.tmpdir="${iotmpdir}/work/tmp" \
-        -Dosgi.install.area="${bdir}" \
-        -Dosgi.configuration.area="${confarea}/configuration" \
-        -Dosgi.frameworkClassPath="${fwclasspath}" \
-        -Dosgi.framework=file:"${bdir}/lib/org.eclipse.osgi-3.8.1.v20120830-144521.jar" \
-        -Djava.awt.headless=true \
-        -classpath "${CLASSPATH}" \
-        org.eclipse.equinox.launcher.Main \
-        -console \
-        -consoleLog
-fi
diff --git a/opendaylight/distribution/opendaylight/src/main/resources/version.properties b/opendaylight/distribution/opendaylight/src/main/resources/version.properties
deleted file mode 100644 (file)
index 90af49d..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-org.opendaylight.controller.version = 0.1
-org.opendaylight.controller.build.scm.version = ${buildNumber}
-org.opendaylight.controller.build.user = ${env.USER}
-org.opendaylight.controller.build.workspace = **********
-org.opendaylight.controller.build.timestamp = ${timestamp}
-org.opendaylight.controller.build.machine = **********
diff --git a/opendaylight/distribution/sanitytest/pom.xml b/opendaylight/distribution/sanitytest/pom.xml
deleted file mode 100644 (file)
index 9955afa..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.opendaylight.controller</groupId>
-    <artifactId>commons.opendaylight</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../commons/opendaylight</relativePath>
-  </parent>
-
-  <artifactId>sanitytest</artifactId>
-  <version>0.5.0-SNAPSHOT</version>
-  <packaging>bundle</packaging>
-  <dependencies>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>org.opendaylight.controller.sanitytest</Export-Package>
-            <Import-Package>javax.xml.bind.annotation,
-              org.osgi.service.component,
-              org.slf4j,
-              org.eclipse.osgi.framework.console,
-              org.osgi.framework,
-              org.eclipse.osgi.baseadaptor,
-              org.eclipse.osgi.framework.adaptor,
-              org.osgi.framework.wiring</Import-Package>
-            <Bundle-Activator>org.opendaylight.controller.sanitytest.internal.Activator</Bundle-Activator>
-          </instructions>
-          <manifestLocation>${project.basedir}/META-INF</manifestLocation>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
-    <tag>HEAD</tag>
-    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
-  </scm>
-</project>
diff --git a/opendaylight/distribution/sanitytest/src/main/java/org/opendaylight/controller/distribution/Sanity.java b/opendaylight/distribution/sanitytest/src/main/java/org/opendaylight/controller/distribution/Sanity.java
deleted file mode 100644 (file)
index 9e6d43a..0000000
+++ /dev/null
@@ -1,55 +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.controller.distribution;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class Sanity {
-
-    static void copy(InputStream in, OutputStream out) throws IOException {
-      while (true) {
-        int c = in.read();
-        if (c == -1) break;
-        out.write((char)c);
-      }
-    }
-
-    public static void main(String[] args) throws IOException, InterruptedException {
-        String cwd = System.getProperty("user.dir");
-
-        System.out.println("Current working directory = " + cwd);
-
-        String os = System.getProperty("os.name").toLowerCase();
-        List<String> script = new ArrayList<String>();
-
-        if(os.contains("windows")){
-            script.add("cmd.exe");
-            script.add("/c");
-            script.add("runsanity.bat");
-        } else {
-            script.add("./runsanity.sh");
-        }
-
-        ProcessBuilder processBuilder = new ProcessBuilder();
-        processBuilder.inheritIO().command(script);
-        Process p = processBuilder.start();
-
-        copy(p.getInputStream(), System.out);
-
-        p.waitFor();
-
-        System.out.println("Test exited with exitValue = " + p.exitValue());
-
-        System.exit(p.exitValue());
-    }
-}
diff --git a/opendaylight/distribution/sanitytest/src/main/java/org/opendaylight/controller/sanitytest/internal/Activator.java b/opendaylight/distribution/sanitytest/src/main/java/org/opendaylight/controller/sanitytest/internal/Activator.java
deleted file mode 100644 (file)
index 60db1b3..0000000
+++ /dev/null
@@ -1,108 +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.controller.sanitytest.internal;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.wiring.BundleRevision;
-
-public class Activator implements BundleActivator {
-    //10 Second initial, 1 second subsequent
-    private static final int INITIAL_DELAY = 10000;
-    private static final int SUBSEQUENT_DELAY = 1000;
-    private static final int MAX_ATTEMPTS = 120;
-
-
-    private String stateToString(int state) {
-        switch (state) {
-        case Bundle.ACTIVE:
-            return "ACTIVE";
-        case Bundle.INSTALLED:
-            return "INSTALLED";
-        case Bundle.RESOLVED:
-            return "RESOLVED";
-        case Bundle.UNINSTALLED:
-            return "UNINSTALLED";
-        case Bundle.STARTING:
-            return "STARTING";
-        default:
-            return "Not CONVERTED: state value is " + state;
-        }
-    }
-
-    public void start(final BundleContext bundleContext) throws Exception {
-        Timer monitorTimer = new Timer("monitor timer", true);
-        monitorTimer.schedule(new TimerTask() {
-            @Override
-            public void run() {
-                int countup = 0;
-                boolean failed = false;
-                boolean resolved = false;
-                while (!resolved) {
-                    resolved = true;
-                    failed = false;
-                    for(Bundle bundle : bundleContext.getBundles()){
-                        /*
-                         * A bundle should be ACTIVE, unless it a fragment, in which case it should be RESOLVED
-                         */
-                        int state = bundle.getState();
-                        if ((bundle.adapt(BundleRevision.class).getTypes() & BundleRevision.TYPE_FRAGMENT) != 0) {
-                            //fragment
-                            if (state != Bundle.RESOLVED) {
-                                System.out.println("------ Failed to activate/resolve fragment = " + bundle.getSymbolicName() + " state = " + stateToString(bundle.getState()));
-                                failed = true;
-                                if (state == Bundle.STARTING)
-                                    resolved = false;
-                            }
-                        } else {
-                            if(state != Bundle.ACTIVE) {
-                                System.out.println("------ Failed to activate/resolve bundle = " + bundle.getSymbolicName() + " state = " + stateToString(bundle.getState()));
-                                failed = true;
-                                if (state == Bundle.STARTING)
-                                    resolved = false;
-                            }
-                        }
-                    }
-                    if (!resolved) {
-                        countup++;
-                        if (countup < MAX_ATTEMPTS) {
-                            System.out.println("all bundles haven't finished starting, will repeat");
-                            try {
-                                Thread.sleep(SUBSEQUENT_DELAY);
-                            } catch (Exception e) {
-                                System.out.println("Thread.sleep interuptted.");
-                                break;
-                            }
-                        } else
-                            resolved = true;
-                    }
-                }
-
-                if(failed){
-                    System.out.flush();
-                    System.out.println("exiting with 1 as failed");
-                    System.out.close();
-                    Runtime.getRuntime().exit(1);
-                } else {
-                    System.out.flush();
-                    System.out.println("exiting with 0 as succeeded");
-                    System.out.close();
-                    Runtime.getRuntime().exit(0);
-                }
-            }
-        }, INITIAL_DELAY);
-    }
-
-    public void stop(BundleContext bundleContext) throws Exception {
-
-    }
-}
index 8e4a44cf20f7a5b9b6474424ccba8e4d99e1dee3..6dfa4afd6b6951a351790d0fb87679b40d19dc90 100644 (file)
@@ -80,7 +80,7 @@ public class ExampleActor extends RaftActor {
         } else if (message instanceof PrintRole) {
             if(LOG.isDebugEnabled()) {
                 String followers = "";
-                if (getRaftState() == RaftState.Leader) {
+                if (getRaftState() == RaftState.Leader || getRaftState() == RaftState.IsolatedLeader) {
                     followers = ((Leader)this.getCurrentBehavior()).printFollowerStates();
                     LOG.debug("{} = {}, Peers={}, followers={}", getId(), getRaftState(), getPeers(), followers);
                 } else {
index f202a8bb1d6bc9c12b71c013fc0fd5e9daf990bf..de6169791ed4cb4405e6f47e85e0ed3535155fd1 100644 (file)
@@ -44,6 +44,11 @@ public class TestDriver {
      *  stopLoggingForClient:{nodeName}
      *  printNodes
      *  printState
+     *
+     *  Note: when run on IDE and on debug log level, the debug logs in
+     *  AbstractUptypedActor and AbstractUptypedPersistentActor would need to be commented out.
+     *  Also RaftActor handleCommand(), debug log which prints for every command other than AE/AER
+     *
      * @param args
      * @throws Exception
      */
index bff2a2779733761bff220e7e1223e85c46d18a73..433c3f7e4b832d081de375e8b792f19f1ca4caa4 100644 (file)
@@ -62,4 +62,10 @@ public interface ConfigParams {
      * The number of journal log entries to batch on recovery before applying.
      */
     int getJournalRecoveryLogBatchSize();
+
+    /**
+     * The interval in which the leader needs to check itself if its isolated
+     * @return FiniteDuration
+     */
+    FiniteDuration getIsolatedCheckInterval();
 }
index dc4145358aa332febafa690baa549fbfccfa91b2..a2092234d54134fbe3de765d17041ad766d689c4 100644 (file)
@@ -44,6 +44,8 @@ public class DefaultConfigParamsImpl implements ConfigParams {
     private FiniteDuration heartBeatInterval = HEART_BEAT_INTERVAL;
     private long snapshotBatchCount = SNAPSHOT_BATCH_COUNT;
     private int journalRecoveryLogBatchSize = JOURNAL_RECOVERY_LOG_BATCH_SIZE;
+    private FiniteDuration isolatedLeaderCheckInterval =
+        new FiniteDuration(HEART_BEAT_INTERVAL.length() * 1000, HEART_BEAT_INTERVAL.unit());
 
     public void setHeartBeatInterval(FiniteDuration heartBeatInterval) {
         this.heartBeatInterval = heartBeatInterval;
@@ -57,6 +59,10 @@ public class DefaultConfigParamsImpl implements ConfigParams {
         this.journalRecoveryLogBatchSize = journalRecoveryLogBatchSize;
     }
 
+    public void setIsolatedLeaderCheckInterval(FiniteDuration isolatedLeaderCheckInterval) {
+        this.isolatedLeaderCheckInterval = isolatedLeaderCheckInterval;
+    }
+
     @Override
     public long getSnapshotBatchCount() {
         return snapshotBatchCount;
@@ -87,4 +93,9 @@ public class DefaultConfigParamsImpl implements ConfigParams {
     public int getJournalRecoveryLogBatchSize() {
         return journalRecoveryLogBatchSize;
     }
+
+    @Override
+    public FiniteDuration getIsolatedCheckInterval() {
+        return isolatedLeaderCheckInterval;
+    }
 }
index 65114eb6591d471860c756f780fe9d65ffab1e0d..216ad4103dc4409182e0c590e63afdd2b34e2aa0 100644 (file)
@@ -3,5 +3,6 @@ package org.opendaylight.controller.cluster.raft;
 public enum RaftState {
     Candidate,
     Follower,
-    Leader
+    Leader,
+    IsolatedLeader;
 }
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/IsolatedLeaderCheck.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/IsolatedLeaderCheck.java
new file mode 100644 (file)
index 0000000..36fd813
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * 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.cluster.raft.base.messages;
+
+/**
+ * Message sent by the IsolatedLeaderCheck scheduler in the Leader to itself
+ * in order to check if its isolated.
+ */
+public class IsolatedLeaderCheck {
+}
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeader.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeader.java
new file mode 100644 (file)
index 0000000..d85ac8e
--- /dev/null
@@ -0,0 +1,738 @@
+/*
+ * 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.cluster.raft.behaviors;
+
+import akka.actor.ActorRef;
+import akka.actor.ActorSelection;
+import akka.actor.Cancellable;
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.protobuf.ByteString;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+import org.opendaylight.controller.cluster.raft.ClientRequestTracker;
+import org.opendaylight.controller.cluster.raft.ClientRequestTrackerImpl;
+import org.opendaylight.controller.cluster.raft.FollowerLogInformation;
+import org.opendaylight.controller.cluster.raft.FollowerLogInformationImpl;
+import org.opendaylight.controller.cluster.raft.RaftActorContext;
+import org.opendaylight.controller.cluster.raft.RaftState;
+import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
+import org.opendaylight.controller.cluster.raft.base.messages.CaptureSnapshot;
+import org.opendaylight.controller.cluster.raft.base.messages.InitiateInstallSnapshot;
+import org.opendaylight.controller.cluster.raft.base.messages.Replicate;
+import org.opendaylight.controller.cluster.raft.base.messages.SendHeartBeat;
+import org.opendaylight.controller.cluster.raft.base.messages.SendInstallSnapshot;
+import org.opendaylight.controller.cluster.raft.messages.AppendEntries;
+import org.opendaylight.controller.cluster.raft.messages.AppendEntriesReply;
+import org.opendaylight.controller.cluster.raft.messages.InstallSnapshot;
+import org.opendaylight.controller.cluster.raft.messages.InstallSnapshotReply;
+import org.opendaylight.controller.cluster.raft.messages.RaftRPC;
+import org.opendaylight.controller.cluster.raft.messages.RequestVoteReply;
+import scala.concurrent.duration.FiniteDuration;
+
+/**
+ * The behavior of a RaftActor when it is in the Leader state
+ * <p/>
+ * Leaders:
+ * <ul>
+ * <li> Upon election: send initial empty AppendEntries RPCs
+ * (heartbeat) to each server; repeat during idle periods to
+ * prevent election timeouts (§5.2)
+ * <li> If command received from client: append entry to local log,
+ * respond after entry applied to state machine (§5.3)
+ * <li> If last log index ≥ nextIndex for a follower: send
+ * AppendEntries RPC with log entries starting at nextIndex
+ * <ul>
+ * <li> If successful: update nextIndex and matchIndex for
+ * follower (§5.3)
+ * <li> If AppendEntries fails because of log inconsistency:
+ * decrement nextIndex and retry (§5.3)
+ * </ul>
+ * <li> If there exists an N such that N > commitIndex, a majority
+ * of matchIndex[i] ≥ N, and log[N].term == currentTerm:
+ * set commitIndex = N (§5.3, §5.4).
+ */
+public abstract class AbstractLeader extends AbstractRaftActorBehavior {
+    protected final Map<String, FollowerLogInformation> followerToLog = new HashMap<>();
+    protected final Map<String, FollowerToSnapshot> mapFollowerToSnapshot = new HashMap<>();
+
+    protected final Set<String> followers;
+
+    private Cancellable heartbeatSchedule = null;
+
+    private List<ClientRequestTracker> trackerList = new ArrayList<>();
+
+    protected final int minReplicationCount;
+
+    protected final int minIsolatedLeaderPeerCount;
+
+    private Optional<ByteString> snapshot;
+
+    public AbstractLeader(RaftActorContext context) {
+        super(context);
+
+        followers = context.getPeerAddresses().keySet();
+
+        for (String followerId : followers) {
+            FollowerLogInformation followerLogInformation =
+                new FollowerLogInformationImpl(followerId,
+                    new AtomicLong(context.getCommitIndex()),
+                    new AtomicLong(-1),
+                    context.getConfigParams().getElectionTimeOutInterval());
+
+            followerToLog.put(followerId, followerLogInformation);
+        }
+
+        leaderId = context.getId();
+
+        if(LOG.isDebugEnabled()) {
+            LOG.debug("Election:Leader has following peers: {}", followers);
+        }
+
+        minReplicationCount = getMajorityVoteCount(followers.size());
+
+        // the isolated Leader peer count will be 1 less than the majority vote count.
+        // this is because the vote count has the self vote counted in it
+        // for e.g
+        // 0 peers = 1 votesRequired , minIsolatedLeaderPeerCount = 0
+        // 2 peers = 2 votesRequired , minIsolatedLeaderPeerCount = 1
+        // 4 peers = 3 votesRequired, minIsolatedLeaderPeerCount = 2
+        minIsolatedLeaderPeerCount = minReplicationCount > 0 ? (minReplicationCount - 1) : 0;
+
+        snapshot = Optional.absent();
+
+        // Immediately schedule a heartbeat
+        // Upon election: send initial empty AppendEntries RPCs
+        // (heartbeat) to each server; repeat during idle periods to
+        // prevent election timeouts (§5.2)
+        scheduleHeartBeat(new FiniteDuration(0, TimeUnit.SECONDS));
+    }
+
+    private Optional<ByteString> getSnapshot() {
+        return snapshot;
+    }
+
+    @VisibleForTesting
+    void setSnapshot(Optional<ByteString> snapshot) {
+        this.snapshot = snapshot;
+    }
+
+    @Override
+    protected RaftActorBehavior handleAppendEntries(ActorRef sender,
+        AppendEntries appendEntries) {
+
+        if(LOG.isDebugEnabled()) {
+            LOG.debug(appendEntries.toString());
+        }
+
+        return this;
+    }
+
+    @Override
+    protected RaftActorBehavior handleAppendEntriesReply(ActorRef sender,
+        AppendEntriesReply appendEntriesReply) {
+
+        if(! appendEntriesReply.isSuccess()) {
+            if(LOG.isDebugEnabled()) {
+                LOG.debug(appendEntriesReply.toString());
+            }
+        }
+
+        // Update the FollowerLogInformation
+        String followerId = appendEntriesReply.getFollowerId();
+        FollowerLogInformation followerLogInformation =
+            followerToLog.get(followerId);
+
+        if(followerLogInformation == null){
+            LOG.error("Unknown follower {}", followerId);
+            return this;
+        }
+
+        followerLogInformation.markFollowerActive();
+
+        if (appendEntriesReply.isSuccess()) {
+            followerLogInformation
+                .setMatchIndex(appendEntriesReply.getLogLastIndex());
+            followerLogInformation
+                .setNextIndex(appendEntriesReply.getLogLastIndex() + 1);
+        } else {
+
+            // TODO: When we find that the follower is out of sync with the
+            // Leader we simply decrement that followers next index by 1.
+            // Would it be possible to do better than this? The RAFT spec
+            // does not explicitly deal with it but may be something for us to
+            // think about
+
+            followerLogInformation.decrNextIndex();
+        }
+
+        // Now figure out if this reply warrants a change in the commitIndex
+        // If there exists an N such that N > commitIndex, a majority
+        // of matchIndex[i] ≥ N, and log[N].term == currentTerm:
+        // set commitIndex = N (§5.3, §5.4).
+        for (long N = context.getCommitIndex() + 1; ; N++) {
+            int replicatedCount = 1;
+
+            for (FollowerLogInformation info : followerToLog.values()) {
+                if (info.getMatchIndex().get() >= N) {
+                    replicatedCount++;
+                }
+            }
+
+            if (replicatedCount >= minReplicationCount) {
+                ReplicatedLogEntry replicatedLogEntry = context.getReplicatedLog().get(N);
+                if (replicatedLogEntry != null &&
+                    replicatedLogEntry.getTerm() == currentTerm()) {
+                    context.setCommitIndex(N);
+                }
+            } else {
+                break;
+            }
+        }
+
+        // Apply the change to the state machine
+        if (context.getCommitIndex() > context.getLastApplied()) {
+            applyLogToStateMachine(context.getCommitIndex());
+        }
+
+        return this;
+    }
+
+    protected ClientRequestTracker removeClientRequestTracker(long logIndex) {
+
+        ClientRequestTracker toRemove = findClientRequestTracker(logIndex);
+        if(toRemove != null) {
+            trackerList.remove(toRemove);
+        }
+
+        return toRemove;
+    }
+
+    protected ClientRequestTracker findClientRequestTracker(long logIndex) {
+        for (ClientRequestTracker tracker : trackerList) {
+            if (tracker.getIndex() == logIndex) {
+                return tracker;
+            }
+        }
+        return null;
+    }
+
+    @Override
+    protected RaftActorBehavior handleRequestVoteReply(ActorRef sender,
+        RequestVoteReply requestVoteReply) {
+        return this;
+    }
+
+    @Override
+    public RaftState state() {
+        return RaftState.Leader;
+    }
+
+    @Override
+    public RaftActorBehavior handleMessage(ActorRef sender, Object originalMessage) {
+        Preconditions.checkNotNull(sender, "sender should not be null");
+
+        Object message = fromSerializableMessage(originalMessage);
+
+        if (message instanceof RaftRPC) {
+            RaftRPC rpc = (RaftRPC) message;
+            // If RPC request or response contains term T > currentTerm:
+            // set currentTerm = T, convert to follower (§5.1)
+            // This applies to all RPC messages and responses
+            if (rpc.getTerm() > context.getTermInformation().getCurrentTerm()) {
+                context.getTermInformation().updateAndPersist(rpc.getTerm(), null);
+
+                return switchBehavior(new Follower(context));
+            }
+        }
+
+        try {
+            if (message instanceof SendHeartBeat) {
+                sendHeartBeat();
+                return this;
+
+            } else if(message instanceof InitiateInstallSnapshot) {
+                installSnapshotIfNeeded();
+
+            } else if(message instanceof SendInstallSnapshot) {
+                // received from RaftActor
+                setSnapshot(Optional.of(((SendInstallSnapshot) message).getSnapshot()));
+                sendInstallSnapshot();
+
+            } else if (message instanceof Replicate) {
+                replicate((Replicate) message);
+
+            } else if (message instanceof InstallSnapshotReply){
+                handleInstallSnapshotReply((InstallSnapshotReply) message);
+
+            }
+        } finally {
+            scheduleHeartBeat(context.getConfigParams().getHeartBeatInterval());
+        }
+
+        return super.handleMessage(sender, message);
+    }
+
+    private void handleInstallSnapshotReply(InstallSnapshotReply reply) {
+        String followerId = reply.getFollowerId();
+        FollowerToSnapshot followerToSnapshot = mapFollowerToSnapshot.get(followerId);
+        FollowerLogInformation followerLogInformation = followerToLog.get(followerId);
+        followerLogInformation.markFollowerActive();
+
+        if (followerToSnapshot != null &&
+            followerToSnapshot.getChunkIndex() == reply.getChunkIndex()) {
+
+            if (reply.isSuccess()) {
+                if(followerToSnapshot.isLastChunk(reply.getChunkIndex())) {
+                    //this was the last chunk reply
+                    if(LOG.isDebugEnabled()) {
+                        LOG.debug("InstallSnapshotReply received, " +
+                                "last chunk received, Chunk:{}. Follower:{} Setting nextIndex:{}",
+                            reply.getChunkIndex(), followerId,
+                            context.getReplicatedLog().getSnapshotIndex() + 1
+                        );
+                    }
+
+                    followerLogInformation.setMatchIndex(
+                        context.getReplicatedLog().getSnapshotIndex());
+                    followerLogInformation.setNextIndex(
+                        context.getReplicatedLog().getSnapshotIndex() + 1);
+                    mapFollowerToSnapshot.remove(followerId);
+
+                    if(LOG.isDebugEnabled()) {
+                        LOG.debug("followerToLog.get(followerId).getNextIndex().get()=" +
+                            followerToLog.get(followerId).getNextIndex().get());
+                    }
+
+                    if (mapFollowerToSnapshot.isEmpty()) {
+                        // once there are no pending followers receiving snapshots
+                        // we can remove snapshot from the memory
+                        setSnapshot(Optional.<ByteString>absent());
+                    }
+
+                } else {
+                    followerToSnapshot.markSendStatus(true);
+                }
+            } else {
+                LOG.info("InstallSnapshotReply received, " +
+                        "sending snapshot chunk failed, Will retry, Chunk:{}",
+                    reply.getChunkIndex()
+                );
+                followerToSnapshot.markSendStatus(false);
+            }
+
+        } else {
+            LOG.error("ERROR!!" +
+                    "FollowerId in InstallSnapshotReply not known to Leader" +
+                    " or Chunk Index in InstallSnapshotReply not matching {} != {}",
+                followerToSnapshot.getChunkIndex(), reply.getChunkIndex()
+            );
+        }
+    }
+
+    private void replicate(Replicate replicate) {
+        long logIndex = replicate.getReplicatedLogEntry().getIndex();
+
+        if(LOG.isDebugEnabled()) {
+            LOG.debug("Replicate message {}", logIndex);
+        }
+
+        // Create a tracker entry we will use this later to notify the
+        // client actor
+        trackerList.add(
+            new ClientRequestTrackerImpl(replicate.getClientActor(),
+                replicate.getIdentifier(),
+                logIndex)
+        );
+
+        if (followers.size() == 0) {
+            context.setCommitIndex(logIndex);
+            applyLogToStateMachine(logIndex);
+        } else {
+            sendAppendEntries();
+        }
+    }
+
+    private void sendAppendEntries() {
+        // Send an AppendEntries to all followers
+        for (String followerId : followers) {
+            ActorSelection followerActor = context.getPeerActorSelection(followerId);
+
+            if (followerActor != null) {
+                FollowerLogInformation followerLogInformation = followerToLog.get(followerId);
+                long followerNextIndex = followerLogInformation.getNextIndex().get();
+                boolean isFollowerActive = followerLogInformation.isFollowerActive();
+                List<ReplicatedLogEntry> entries = null;
+
+                if (mapFollowerToSnapshot.get(followerId) != null) {
+                    // if install snapshot is in process , then sent next chunk if possible
+                    if (isFollowerActive && mapFollowerToSnapshot.get(followerId).canSendNextChunk()) {
+                        sendSnapshotChunk(followerActor, followerId);
+                    } else {
+                        // we send a heartbeat even if we have not received a reply for the last chunk
+                        sendAppendEntriesToFollower(followerActor, followerNextIndex,
+                            Collections.<ReplicatedLogEntry>emptyList());
+                    }
+
+                } else {
+                    long leaderLastIndex = context.getReplicatedLog().lastIndex();
+                    long leaderSnapShotIndex = context.getReplicatedLog().getSnapshotIndex();
+
+                    if (isFollowerActive &&
+                        context.getReplicatedLog().isPresent(followerNextIndex)) {
+                        // FIXME : Sending one entry at a time
+                        entries = context.getReplicatedLog().getFrom(followerNextIndex, 1);
+
+                    } else if (isFollowerActive && followerNextIndex >= 0 &&
+                        leaderLastIndex >= followerNextIndex ) {
+                        // if the followers next index is not present in the leaders log, and
+                        // if the follower is just not starting and if leader's index is more than followers index
+                        // then snapshot should be sent
+
+                        if(LOG.isDebugEnabled()) {
+                            LOG.debug("InitiateInstallSnapshot to follower:{}," +
+                                    "follower-nextIndex:{}, leader-snapshot-index:{},  " +
+                                    "leader-last-index:{}", followerId,
+                                followerNextIndex, leaderSnapShotIndex, leaderLastIndex
+                            );
+                        }
+                        actor().tell(new InitiateInstallSnapshot(), actor());
+
+                        // we would want to sent AE as the capture snapshot might take time
+                        entries =  Collections.<ReplicatedLogEntry>emptyList();
+
+                    } else {
+                        //we send an AppendEntries, even if the follower is inactive
+                        // in-order to update the followers timestamp, in case it becomes active again
+                        entries =  Collections.<ReplicatedLogEntry>emptyList();
+                    }
+
+                    sendAppendEntriesToFollower(followerActor, followerNextIndex, entries);
+
+                }
+            }
+        }
+    }
+
+    private void sendAppendEntriesToFollower(ActorSelection followerActor, long followerNextIndex,
+        List<ReplicatedLogEntry> entries) {
+        followerActor.tell(
+            new AppendEntries(currentTerm(), context.getId(),
+                prevLogIndex(followerNextIndex),
+                prevLogTerm(followerNextIndex), entries,
+                context.getCommitIndex()).toSerializable(),
+            actor()
+        );
+    }
+
+    /**
+     * An installSnapshot is scheduled at a interval that is a multiple of
+     * a HEARTBEAT_INTERVAL. This is to avoid the need to check for installing
+     * snapshots at every heartbeat.
+     *
+     * Install Snapshot works as follows
+     * 1. Leader sends a InitiateInstallSnapshot message to self
+     * 2. Leader then initiates the capture snapshot by sending a CaptureSnapshot message to actor
+     * 3. RaftActor on receipt of the CaptureSnapshotReply (from Shard), stores the received snapshot in the replicated log
+     * and makes a call to Leader's handleMessage , with SendInstallSnapshot message.
+     * 4. Leader , picks the snapshot from im-mem ReplicatedLog and sends it in chunks to the Follower
+     * 5. On complete, Follower sends back a InstallSnapshotReply.
+     * 6. On receipt of the InstallSnapshotReply for the last chunk, Leader marks the install complete for that follower
+     * and replenishes the memory by deleting the snapshot in Replicated log.
+     *
+     */
+    private void installSnapshotIfNeeded() {
+        for (String followerId : followers) {
+            ActorSelection followerActor =
+                context.getPeerActorSelection(followerId);
+
+            if(followerActor != null) {
+                FollowerLogInformation followerLogInformation =
+                    followerToLog.get(followerId);
+
+                long nextIndex = followerLogInformation.getNextIndex().get();
+
+                if (!context.getReplicatedLog().isPresent(nextIndex) &&
+                    context.getReplicatedLog().isInSnapshot(nextIndex)) {
+                    LOG.info("{} follower needs a snapshot install", followerId);
+                    if (snapshot.isPresent()) {
+                        // if a snapshot is present in the memory, most likely another install is in progress
+                        // no need to capture snapshot
+                        sendSnapshotChunk(followerActor, followerId);
+
+                    } else {
+                        initiateCaptureSnapshot();
+                        //we just need 1 follower who would need snapshot to be installed.
+                        // when we have the snapshot captured, we would again check (in SendInstallSnapshot)
+                        // who needs an install and send to all who need
+                        break;
+                    }
+
+                }
+            }
+        }
+    }
+
+    // on every install snapshot, we try to capture the snapshot.
+    // Once a capture is going on, another one issued will get ignored by RaftActor.
+    private void initiateCaptureSnapshot() {
+        LOG.info("Initiating Snapshot Capture to Install Snapshot, Leader:{}", getLeaderId());
+        ReplicatedLogEntry lastAppliedEntry = context.getReplicatedLog().get(context.getLastApplied());
+        long lastAppliedIndex = -1;
+        long lastAppliedTerm = -1;
+
+        if (lastAppliedEntry != null) {
+            lastAppliedIndex = lastAppliedEntry.getIndex();
+            lastAppliedTerm = lastAppliedEntry.getTerm();
+        } else if (context.getReplicatedLog().getSnapshotIndex() > -1)  {
+            lastAppliedIndex = context.getReplicatedLog().getSnapshotIndex();
+            lastAppliedTerm = context.getReplicatedLog().getSnapshotTerm();
+        }
+
+        boolean isInstallSnapshotInitiated = true;
+        actor().tell(new CaptureSnapshot(lastIndex(), lastTerm(),
+                lastAppliedIndex, lastAppliedTerm, isInstallSnapshotInitiated),
+            actor());
+    }
+
+
+    private void sendInstallSnapshot() {
+        for (String followerId : followers) {
+            ActorSelection followerActor = context.getPeerActorSelection(followerId);
+
+            if(followerActor != null) {
+                FollowerLogInformation followerLogInformation = followerToLog.get(followerId);
+                long nextIndex = followerLogInformation.getNextIndex().get();
+
+                if (!context.getReplicatedLog().isPresent(nextIndex) &&
+                    context.getReplicatedLog().isInSnapshot(nextIndex)) {
+                    sendSnapshotChunk(followerActor, followerId);
+                }
+            }
+        }
+    }
+
+    /**
+     *  Sends a snapshot chunk to a given follower
+     *  InstallSnapshot should qualify as a heartbeat too.
+     */
+    private void sendSnapshotChunk(ActorSelection followerActor, String followerId) {
+        try {
+            if (snapshot.isPresent()) {
+                followerActor.tell(
+                    new InstallSnapshot(currentTerm(), context.getId(),
+                        context.getReplicatedLog().getSnapshotIndex(),
+                        context.getReplicatedLog().getSnapshotTerm(),
+                        getNextSnapshotChunk(followerId,snapshot.get()),
+                        mapFollowerToSnapshot.get(followerId).incrementChunkIndex(),
+                        mapFollowerToSnapshot.get(followerId).getTotalChunks()
+                    ).toSerializable(),
+                    actor()
+                );
+                LOG.info("InstallSnapshot sent to follower {}, Chunk: {}/{}",
+                    followerActor.path(), mapFollowerToSnapshot.get(followerId).getChunkIndex(),
+                    mapFollowerToSnapshot.get(followerId).getTotalChunks());
+            }
+        } catch (IOException e) {
+            LOG.error(e, "InstallSnapshot failed for Leader.");
+        }
+    }
+
+    /**
+     * Acccepts snaphot as ByteString, enters into map for future chunks
+     * creates and return a ByteString chunk
+     */
+    private ByteString getNextSnapshotChunk(String followerId, ByteString snapshotBytes) throws IOException {
+        FollowerToSnapshot followerToSnapshot = mapFollowerToSnapshot.get(followerId);
+        if (followerToSnapshot == null) {
+            followerToSnapshot = new FollowerToSnapshot(snapshotBytes);
+            mapFollowerToSnapshot.put(followerId, followerToSnapshot);
+        }
+        ByteString nextChunk = followerToSnapshot.getNextChunk();
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Leader's snapshot nextChunk size:{}", nextChunk.size());
+        }
+        return nextChunk;
+    }
+
+    private void sendHeartBeat() {
+        if (followers.size() > 0) {
+            sendAppendEntries();
+        }
+    }
+
+    private void stopHeartBeat() {
+        if (heartbeatSchedule != null && !heartbeatSchedule.isCancelled()) {
+            heartbeatSchedule.cancel();
+        }
+    }
+
+    private void scheduleHeartBeat(FiniteDuration interval) {
+        if(followers.size() == 0){
+            // Optimization - do not bother scheduling a heartbeat as there are
+            // no followers
+            return;
+        }
+
+        stopHeartBeat();
+
+        // Schedule a heartbeat. When the scheduler triggers a SendHeartbeat
+        // message is sent to itself.
+        // Scheduling the heartbeat only once here because heartbeats do not
+        // need to be sent if there are other messages being sent to the remote
+        // actor.
+        heartbeatSchedule = context.getActorSystem().scheduler().scheduleOnce(
+            interval, context.getActor(), new SendHeartBeat(),
+            context.getActorSystem().dispatcher(), context.getActor());
+    }
+
+    @Override
+    public void close() throws Exception {
+        stopHeartBeat();
+    }
+
+    @Override
+    public String getLeaderId() {
+        return context.getId();
+    }
+
+    protected boolean isLeaderIsolated() {
+        int minPresent = minIsolatedLeaderPeerCount;
+        for (FollowerLogInformation followerLogInformation : followerToLog.values()) {
+            if (followerLogInformation.isFollowerActive()) {
+                --minPresent;
+                if (minPresent == 0) {
+                    break;
+                }
+            }
+        }
+        return (minPresent != 0);
+    }
+
+    /**
+     * Encapsulates the snapshot bytestring and handles the logic of sending
+     * snapshot chunks
+     */
+    protected class FollowerToSnapshot {
+        private ByteString snapshotBytes;
+        private int offset = 0;
+        // the next snapshot chunk is sent only if the replyReceivedForOffset matches offset
+        private int replyReceivedForOffset;
+        // if replyStatus is false, the previous chunk is attempted
+        private boolean replyStatus = false;
+        private int chunkIndex;
+        private int totalChunks;
+
+        public FollowerToSnapshot(ByteString snapshotBytes) {
+            this.snapshotBytes = snapshotBytes;
+            replyReceivedForOffset = -1;
+            chunkIndex = 1;
+            int size = snapshotBytes.size();
+            totalChunks = ( size / context.getConfigParams().getSnapshotChunkSize()) +
+                ((size % context.getConfigParams().getSnapshotChunkSize()) > 0 ? 1 : 0);
+            if(LOG.isDebugEnabled()) {
+                LOG.debug("Snapshot {} bytes, total chunks to send:{}",
+                    size, totalChunks);
+            }
+        }
+
+        public ByteString getSnapshotBytes() {
+            return snapshotBytes;
+        }
+
+        public int incrementOffset() {
+            if(replyStatus) {
+                // if prev chunk failed, we would want to sent the same chunk again
+                offset = offset + context.getConfigParams().getSnapshotChunkSize();
+            }
+            return offset;
+        }
+
+        public int incrementChunkIndex() {
+            if (replyStatus) {
+                // if prev chunk failed, we would want to sent the same chunk again
+                chunkIndex =  chunkIndex + 1;
+            }
+            return chunkIndex;
+        }
+
+        public int getChunkIndex() {
+            return chunkIndex;
+        }
+
+        public int getTotalChunks() {
+            return totalChunks;
+        }
+
+        public boolean canSendNextChunk() {
+            // we only send a false if a chunk is sent but we have not received a reply yet
+            return replyReceivedForOffset == offset;
+        }
+
+        public boolean isLastChunk(int chunkIndex) {
+            return totalChunks == chunkIndex;
+        }
+
+        public void markSendStatus(boolean success) {
+            if (success) {
+                // if the chunk sent was successful
+                replyReceivedForOffset = offset;
+                replyStatus = true;
+            } else {
+                // if the chunk sent was failure
+                replyReceivedForOffset = offset;
+                replyStatus = false;
+            }
+        }
+
+        public ByteString getNextChunk() {
+            int snapshotLength = getSnapshotBytes().size();
+            int start = incrementOffset();
+            int size = context.getConfigParams().getSnapshotChunkSize();
+            if (context.getConfigParams().getSnapshotChunkSize() > snapshotLength) {
+                size = snapshotLength;
+            } else {
+                if ((start + context.getConfigParams().getSnapshotChunkSize()) > snapshotLength) {
+                    size = snapshotLength - start;
+                }
+            }
+
+            if(LOG.isDebugEnabled()) {
+                LOG.debug("length={}, offset={},size={}",
+                    snapshotLength, start, size);
+            }
+            return getSnapshotBytes().substring(start, start + size);
+
+        }
+    }
+
+    // called from example-actor for printing the follower-states
+    public String printFollowerStates() {
+        StringBuilder sb = new StringBuilder();
+        for(FollowerLogInformation followerLogInformation : followerToLog.values()) {
+            boolean isFollowerActive = followerLogInformation.isFollowerActive();
+            sb.append("{"+followerLogInformation.getId() + " state:" + isFollowerActive + "},");
+
+        }
+        return "[" + sb.toString() + "]";
+    }
+
+    @VisibleForTesting
+    void markFollowerActive(String followerId) {
+        followerToLog.get(followerId).markFollowerActive();
+    }
+}
index eed74bba82fbf8a4f8e4c1b5431887451c49d59d..f235221da940d4cb21c491e78b9624c2afa18a80 100644 (file)
@@ -390,7 +390,7 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
     }
 
     protected RaftActorBehavior switchBehavior(RaftActorBehavior behavior) {
-        LOG.info("Switching from behavior {} to {}", this.state(), behavior.state());
+        LOG.info("{} :- Switching from behavior {} to {}", context.getId(), this.state(), behavior.state());
         try {
             close();
         } catch (Exception e) {
@@ -399,4 +399,27 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
 
         return behavior;
     }
+
+    protected int getMajorityVoteCount(int numPeers) {
+        // Votes are required from a majority of the peers including self.
+        // The numMajority field therefore stores a calculated value
+        // of the number of votes required for this candidate to win an
+        // election based on it's known peers.
+        // If a peer was added during normal operation and raft replicas
+        // came to know about them then the new peer would also need to be
+        // taken into consideration when calculating this value.
+        // Here are some examples for what the numMajority would be for n
+        // peers
+        // 0 peers = 1 numMajority -: (0 + 1) / 2 + 1 = 1
+        // 2 peers = 2 numMajority -: (2 + 1) / 2 + 1 = 2
+        // 4 peers = 3 numMajority -: (4 + 1) / 2 + 1 = 3
+
+        int numMajority = 0;
+        if (numPeers > 0) {
+            int self = 1;
+            numMajority = (numPeers + self) / 2 + 1;
+        }
+        return numMajority;
+
+    }
 }
index 4a3e2c5d664406844edaddee6308abf112b0f79c..702417273ff586fc635ebcb65e15fa4c8bd64885 100644 (file)
@@ -56,25 +56,7 @@ public class Candidate extends AbstractRaftActorBehavior {
             LOG.debug("Election:Candidate has following peers: {}", peers);
         }
 
-        if(peers.size() > 0) {
-            // Votes are required from a majority of the peers including self.
-            // The votesRequired field therefore stores a calculated value
-            // of the number of votes required for this candidate to win an
-            // election based on it's known peers.
-            // If a peer was added during normal operation and raft replicas
-            // came to know about them then the new peer would also need to be
-            // taken into consideration when calculating this value.
-            // Here are some examples for what the votesRequired would be for n
-            // peers
-            // 0 peers = 1 votesRequired (0 + 1) / 2 + 1 = 1
-            // 2 peers = 2 votesRequired (2 + 1) / 2 + 1 = 2
-            // 4 peers = 3 votesRequired (4 + 1) / 2 + 1 = 3
-            int noOfPeers = peers.size();
-            int self = 1;
-            votesRequired = (noOfPeers + self) / 2 + 1;
-        } else {
-            votesRequired = 0;
-        }
+        votesRequired = getMajorityVoteCount(peers.size());
 
         startNewTerm();
         scheduleElection(electionDuration());
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/IsolatedLeader.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/IsolatedLeader.java
new file mode 100644 (file)
index 0000000..4f77711
--- /dev/null
@@ -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.cluster.raft.behaviors;
+
+import akka.actor.ActorRef;
+import org.opendaylight.controller.cluster.raft.RaftActorContext;
+import org.opendaylight.controller.cluster.raft.RaftState;
+import org.opendaylight.controller.cluster.raft.messages.AppendEntriesReply;
+
+/**
+ * Leader which is termed as isolated.
+ * <p/>
+ * If the reply from the majority of the followers  is not received then the leader changes its behavior
+ * to IsolatedLeader. An isolated leader may have followers and they would continue to receive replicated messages.
+ * <p/>
+ * A schedule is run, at an interval of (10 * Heartbeat-time-interval),  in the Leader
+ * to check if its isolated or not.
+ * <p/>
+ * In the Isolated Leader , on every AppendEntriesReply, we aggressively check if the leader is isolated.
+ * If no, then the state is switched back to Leader.
+ *
+ */
+public class IsolatedLeader extends AbstractLeader {
+    public IsolatedLeader(RaftActorContext context) {
+        super(context);
+    }
+
+    // we received an Append Entries reply, we should switch the Behavior to Leader
+    @Override
+    protected RaftActorBehavior handleAppendEntriesReply(ActorRef sender,
+        AppendEntriesReply appendEntriesReply) {
+        RaftActorBehavior ret = super.handleAppendEntriesReply(sender, appendEntriesReply);
+
+        // it can happen that this isolated leader interacts with a new leader in the cluster and
+        // changes its state to Follower, hence we only need to switch to Leader if the state is still Isolated
+        if (ret.state() == RaftState.IsolatedLeader && !isLeaderIsolated()) {
+            LOG.info("IsolatedLeader {} switching from IsolatedLeader to Leader", leaderId);
+            return switchBehavior(new Leader(context));
+        }
+        return ret;
+    }
+
+    @Override
+    public RaftState state() {
+        return RaftState.IsolatedLeader;
+    }
+}
index d83362b58081c0e4c4576a848bf10ca29d8fc7da..0dd39001136a25416c241eb8fb69085266d3752c 100644 (file)
@@ -9,42 +9,14 @@
 package org.opendaylight.controller.cluster.raft.behaviors;
 
 import akka.actor.ActorRef;
-import akka.actor.ActorSelection;
 import akka.actor.Cancellable;
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
-import com.google.protobuf.ByteString;
-import org.opendaylight.controller.cluster.raft.ClientRequestTracker;
-import org.opendaylight.controller.cluster.raft.ClientRequestTrackerImpl;
-import org.opendaylight.controller.cluster.raft.FollowerLogInformation;
-import org.opendaylight.controller.cluster.raft.FollowerLogInformationImpl;
 import org.opendaylight.controller.cluster.raft.RaftActorContext;
-import org.opendaylight.controller.cluster.raft.RaftState;
-import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
-import org.opendaylight.controller.cluster.raft.base.messages.CaptureSnapshot;
 import org.opendaylight.controller.cluster.raft.base.messages.InitiateInstallSnapshot;
-import org.opendaylight.controller.cluster.raft.base.messages.Replicate;
-import org.opendaylight.controller.cluster.raft.base.messages.SendHeartBeat;
-import org.opendaylight.controller.cluster.raft.base.messages.SendInstallSnapshot;
-import org.opendaylight.controller.cluster.raft.messages.AppendEntries;
-import org.opendaylight.controller.cluster.raft.messages.AppendEntriesReply;
-import org.opendaylight.controller.cluster.raft.messages.InstallSnapshot;
-import org.opendaylight.controller.cluster.raft.messages.InstallSnapshotReply;
-import org.opendaylight.controller.cluster.raft.messages.RaftRPC;
-import org.opendaylight.controller.cluster.raft.messages.RequestVoteReply;
+import org.opendaylight.controller.cluster.raft.base.messages.IsolatedLeaderCheck;
 import scala.concurrent.duration.FiniteDuration;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicLong;
-
 /**
  * The behavior of a RaftActor when it is in the Leader state
  * <p/>
@@ -67,546 +39,41 @@ import java.util.concurrent.atomic.AtomicLong;
  * of matchIndex[i] ≥ N, and log[N].term == currentTerm:
  * set commitIndex = N (§5.3, §5.4).
  */
-public class Leader extends AbstractRaftActorBehavior {
-
-
-    protected final Map<String, FollowerLogInformation> followerToLog = new HashMap<>();
-    protected final Map<String, FollowerToSnapshot> mapFollowerToSnapshot = new HashMap<>();
-
-    private final Set<String> followers;
-
-    private Cancellable heartbeatSchedule = null;
+public class Leader extends AbstractLeader {
     private Cancellable installSnapshotSchedule = null;
-
-    private List<ClientRequestTracker> trackerList = new ArrayList<>();
-
-    private final int minReplicationCount;
-
-    private Optional<ByteString> snapshot;
+    private Cancellable isolatedLeaderCheckSchedule = null;
 
     public Leader(RaftActorContext context) {
         super(context);
 
-        followers = context.getPeerAddresses().keySet();
-
-        for (String followerId : followers) {
-            FollowerLogInformation followerLogInformation =
-                new FollowerLogInformationImpl(followerId,
-                    new AtomicLong(context.getCommitIndex()),
-                    new AtomicLong(-1),
-                    context.getConfigParams().getElectionTimeOutInterval());
-
-            followerToLog.put(followerId, followerLogInformation);
-        }
-
-        if(LOG.isDebugEnabled()) {
-            LOG.debug("Election:Leader has following peers: {}", followers);
-        }
-
-        if (followers.size() > 0) {
-            minReplicationCount = (followers.size() + 1) / 2 + 1;
-        } else {
-            minReplicationCount = 0;
-        }
-
-        snapshot = Optional.absent();
-
-        // Immediately schedule a heartbeat
-        // Upon election: send initial empty AppendEntries RPCs
-        // (heartbeat) to each server; repeat during idle periods to
-        // prevent election timeouts (§5.2)
-        scheduleHeartBeat(new FiniteDuration(0, TimeUnit.SECONDS));
-
-        scheduleInstallSnapshotCheck(
-            new FiniteDuration(context.getConfigParams().getHeartBeatInterval().length() * 1000,
-                context.getConfigParams().getHeartBeatInterval().unit())
-        );
-
-    }
-
-    private Optional<ByteString> getSnapshot() {
-        return snapshot;
-    }
-
-    @VisibleForTesting
-    void setSnapshot(Optional<ByteString> snapshot) {
-        this.snapshot = snapshot;
-    }
-
-    @Override protected RaftActorBehavior handleAppendEntries(ActorRef sender,
-        AppendEntries appendEntries) {
-
-        if(LOG.isDebugEnabled()) {
-            LOG.debug(appendEntries.toString());
-        }
-
-        return this;
-    }
-
-    @Override protected RaftActorBehavior handleAppendEntriesReply(ActorRef sender,
-        AppendEntriesReply appendEntriesReply) {
-
-        if(! appendEntriesReply.isSuccess()) {
-            if(LOG.isDebugEnabled()) {
-                LOG.debug(appendEntriesReply.toString());
-            }
-        }
-
-        // Update the FollowerLogInformation
-        String followerId = appendEntriesReply.getFollowerId();
-        FollowerLogInformation followerLogInformation =
-            followerToLog.get(followerId);
-
-        if(followerLogInformation == null){
-            LOG.error("Unknown follower {}", followerId);
-            return this;
-        }
-
-        followerLogInformation.markFollowerActive();
-
-        if (appendEntriesReply.isSuccess()) {
-            followerLogInformation
-                .setMatchIndex(appendEntriesReply.getLogLastIndex());
-            followerLogInformation
-                .setNextIndex(appendEntriesReply.getLogLastIndex() + 1);
-        } else {
-
-            // TODO: When we find that the follower is out of sync with the
-            // Leader we simply decrement that followers next index by 1.
-            // Would it be possible to do better than this? The RAFT spec
-            // does not explicitly deal with it but may be something for us to
-            // think about
-
-            followerLogInformation.decrNextIndex();
-        }
-
-        // Now figure out if this reply warrants a change in the commitIndex
-        // If there exists an N such that N > commitIndex, a majority
-        // of matchIndex[i] ≥ N, and log[N].term == currentTerm:
-        // set commitIndex = N (§5.3, §5.4).
-        for (long N = context.getCommitIndex() + 1; ; N++) {
-            int replicatedCount = 1;
-
-            for (FollowerLogInformation info : followerToLog.values()) {
-                if (info.getMatchIndex().get() >= N) {
-                    replicatedCount++;
-                }
-            }
-
-            if (replicatedCount >= minReplicationCount) {
-                ReplicatedLogEntry replicatedLogEntry =
-                    context.getReplicatedLog().get(N);
-                if (replicatedLogEntry != null
-                    && replicatedLogEntry.getTerm()
-                    == currentTerm()) {
-                    context.setCommitIndex(N);
-                }
-            } else {
-                break;
-            }
-        }
-
-        // Apply the change to the state machine
-        if (context.getCommitIndex() > context.getLastApplied()) {
-            applyLogToStateMachine(context.getCommitIndex());
-        }
-
-        return this;
-    }
-
-    protected ClientRequestTracker removeClientRequestTracker(long logIndex) {
-
-        ClientRequestTracker toRemove = findClientRequestTracker(logIndex);
-        if(toRemove != null) {
-            trackerList.remove(toRemove);
-        }
-
-        return toRemove;
-    }
-
-    protected ClientRequestTracker findClientRequestTracker(long logIndex) {
-        for (ClientRequestTracker tracker : trackerList) {
-            if (tracker.getIndex() == logIndex) {
-                return tracker;
-            }
-        }
-
-        return null;
-    }
-
-    @Override protected RaftActorBehavior handleRequestVoteReply(ActorRef sender,
-        RequestVoteReply requestVoteReply) {
-        return this;
-    }
+        scheduleInstallSnapshotCheck(context.getConfigParams().getIsolatedCheckInterval());
 
-    @Override public RaftState state() {
-        return RaftState.Leader;
+        scheduleIsolatedLeaderCheck(
+            new FiniteDuration(context.getConfigParams().getHeartBeatInterval().length() * 10,
+                context.getConfigParams().getHeartBeatInterval().unit()));
     }
 
     @Override public RaftActorBehavior handleMessage(ActorRef sender, Object originalMessage) {
         Preconditions.checkNotNull(sender, "sender should not be null");
 
-        Object message = fromSerializableMessage(originalMessage);
-
-        if (message instanceof RaftRPC) {
-            RaftRPC rpc = (RaftRPC) message;
-            // If RPC request or response contains term T > currentTerm:
-            // set currentTerm = T, convert to follower (§5.1)
-            // This applies to all RPC messages and responses
-            if (rpc.getTerm() > context.getTermInformation().getCurrentTerm()) {
-                context.getTermInformation().updateAndPersist(rpc.getTerm(), null);
-
-                return switchBehavior(new Follower(context));
-            }
-        }
-
-        try {
-            if (message instanceof SendHeartBeat) {
-                sendHeartBeat();
-                return this;
-
-            } else if(message instanceof InitiateInstallSnapshot) {
-                installSnapshotIfNeeded();
-
-            } else if(message instanceof SendInstallSnapshot) {
-                // received from RaftActor
-                setSnapshot(Optional.of(((SendInstallSnapshot) message).getSnapshot()));
-                sendInstallSnapshot();
-
-            } else if (message instanceof Replicate) {
-                replicate((Replicate) message);
-
-            } else if (message instanceof InstallSnapshotReply){
-                handleInstallSnapshotReply(
-                    (InstallSnapshotReply) message);
-            }
-        } finally {
-            scheduleHeartBeat(context.getConfigParams().getHeartBeatInterval());
-        }
-
-        return super.handleMessage(sender, message);
-    }
-
-    private void handleInstallSnapshotReply(InstallSnapshotReply reply) {
-        String followerId = reply.getFollowerId();
-        FollowerToSnapshot followerToSnapshot = mapFollowerToSnapshot.get(followerId);
-        FollowerLogInformation followerLogInformation = followerToLog.get(followerId);
-        followerLogInformation.markFollowerActive();
-
-        if (followerToSnapshot != null &&
-            followerToSnapshot.getChunkIndex() == reply.getChunkIndex()) {
-
-            if (reply.isSuccess()) {
-                if(followerToSnapshot.isLastChunk(reply.getChunkIndex())) {
-                    //this was the last chunk reply
-                    if(LOG.isDebugEnabled()) {
-                        LOG.debug("InstallSnapshotReply received, " +
-                                "last chunk received, Chunk:{}. Follower:{} Setting nextIndex:{}",
-                            reply.getChunkIndex(), followerId,
-                            context.getReplicatedLog().getSnapshotIndex() + 1
-                        );
-                    }
-
-                    followerLogInformation.setMatchIndex(
-                        context.getReplicatedLog().getSnapshotIndex());
-                    followerLogInformation.setNextIndex(
-                        context.getReplicatedLog().getSnapshotIndex() + 1);
-                    mapFollowerToSnapshot.remove(followerId);
-
-                    if(LOG.isDebugEnabled()) {
-                        LOG.debug("followerToLog.get(followerId).getNextIndex().get()=" +
-                            followerToLog.get(followerId).getNextIndex().get());
-                    }
-
-                    if (mapFollowerToSnapshot.isEmpty()) {
-                        // once there are no pending followers receiving snapshots
-                        // we can remove snapshot from the memory
-                        setSnapshot(Optional.<ByteString>absent());
-                    }
-
-                } else {
-                    followerToSnapshot.markSendStatus(true);
-                }
-            } else {
-                LOG.info("InstallSnapshotReply received, " +
-                        "sending snapshot chunk failed, Will retry, Chunk:{}",
-                    reply.getChunkIndex()
-                );
-                followerToSnapshot.markSendStatus(false);
+        if (originalMessage instanceof IsolatedLeaderCheck) {
+            if (isLeaderIsolated()) {
+                LOG.info("At least {} followers need to be active, Switching {} from Leader to IsolatedLeader",
+                    minIsolatedLeaderPeerCount, leaderId);
+                return switchBehavior(new IsolatedLeader(context));
             }
-
-        } else {
-            LOG.error("ERROR!!" +
-                    "FollowerId in InstallSnapshotReply not known to Leader" +
-                    " or Chunk Index in InstallSnapshotReply not matching {} != {}",
-                followerToSnapshot.getChunkIndex(), reply.getChunkIndex()
-            );
-        }
-    }
-
-    private void replicate(Replicate replicate) {
-        long logIndex = replicate.getReplicatedLogEntry().getIndex();
-
-        if(LOG.isDebugEnabled()) {
-            LOG.debug("Replicate message {}", logIndex);
         }
 
-        // Create a tracker entry we will use this later to notify the
-        // client actor
-        trackerList.add(
-            new ClientRequestTrackerImpl(replicate.getClientActor(),
-                replicate.getIdentifier(),
-                logIndex)
-        );
-
-        if (followers.size() == 0) {
-            context.setCommitIndex(logIndex);
-            applyLogToStateMachine(logIndex);
-        } else {
-            sendAppendEntries();
-        }
+        return super.handleMessage(sender, originalMessage);
     }
 
-    private void sendAppendEntries() {
-        // Send an AppendEntries to all followers
-        for (String followerId : followers) {
-            ActorSelection followerActor = context.getPeerActorSelection(followerId);
-
-            if (followerActor != null) {
-                FollowerLogInformation followerLogInformation = followerToLog.get(followerId);
-                long followerNextIndex = followerLogInformation.getNextIndex().get();
-                boolean isFollowerActive = followerLogInformation.isFollowerActive();
-                List<ReplicatedLogEntry> entries = null;
-
-                if (mapFollowerToSnapshot.get(followerId) != null) {
-                    // if install snapshot is in process , then sent next chunk if possible
-                    if (isFollowerActive && mapFollowerToSnapshot.get(followerId).canSendNextChunk()) {
-                        sendSnapshotChunk(followerActor, followerId);
-                    } else {
-                        // we send a heartbeat even if we have not received a reply for the last chunk
-                        sendAppendEntriesToFollower(followerActor, followerNextIndex,
-                            Collections.<ReplicatedLogEntry>emptyList());
-                    }
-
-                } else {
-                    long leaderLastIndex = context.getReplicatedLog().lastIndex();
-                    long leaderSnapShotIndex = context.getReplicatedLog().getSnapshotIndex();
-
-                    if (isFollowerActive &&
-                        context.getReplicatedLog().isPresent(followerNextIndex)) {
-                        // FIXME : Sending one entry at a time
-                        entries = context.getReplicatedLog().getFrom(followerNextIndex, 1);
-
-                    } else if (isFollowerActive && followerNextIndex >= 0 &&
-                        leaderLastIndex >= followerNextIndex ) {
-                        // if the followers next index is not present in the leaders log, and
-                        // if the follower is just not starting and if leader's index is more than followers index
-                        // then snapshot should be sent
-
-                        if(LOG.isDebugEnabled()) {
-                            LOG.debug("InitiateInstallSnapshot to follower:{}," +
-                                    "follower-nextIndex:{}, leader-snapshot-index:{},  " +
-                                    "leader-last-index:{}", followerId,
-                                followerNextIndex, leaderSnapShotIndex, leaderLastIndex
-                            );
-                        }
-                        actor().tell(new InitiateInstallSnapshot(), actor());
-
-                        // we would want to sent AE as the capture snapshot might take time
-                        entries =  Collections.<ReplicatedLogEntry>emptyList();
-
-                    } else {
-                        //we send an AppendEntries, even if the follower is inactive
-                        // in-order to update the followers timestamp, in case it becomes active again
-                        entries =  Collections.<ReplicatedLogEntry>emptyList();
-                    }
-
-                    sendAppendEntriesToFollower(followerActor, followerNextIndex, entries);
-
-                }
-            }
-        }
-    }
-
-    private void sendAppendEntriesToFollower(ActorSelection followerActor, long followerNextIndex,
-        List<ReplicatedLogEntry> entries) {
-        followerActor.tell(
-            new AppendEntries(currentTerm(), context.getId(),
-                prevLogIndex(followerNextIndex),
-                prevLogTerm(followerNextIndex), entries,
-                context.getCommitIndex()).toSerializable(),
-            actor()
-        );
-    }
-
-    /**
-     * An installSnapshot is scheduled at a interval that is a multiple of
-     * a HEARTBEAT_INTERVAL. This is to avoid the need to check for installing
-     * snapshots at every heartbeat.
-     *
-     * Install Snapshot works as follows
-     * 1. Leader sends a InitiateInstallSnapshot message to self
-     * 2. Leader then initiates the capture snapshot by sending a CaptureSnapshot message to actor
-     * 3. RaftActor on receipt of the CaptureSnapshotReply (from Shard), stores the received snapshot in the replicated log
-     * and makes a call to Leader's handleMessage , with SendInstallSnapshot message.
-     * 4. Leader , picks the snapshot from im-mem ReplicatedLog and sends it in chunks to the Follower
-     * 5. On complete, Follower sends back a InstallSnapshotReply.
-     * 6. On receipt of the InstallSnapshotReply for the last chunk, Leader marks the install complete for that follower
-     * and replenishes the memory by deleting the snapshot in Replicated log.
-     *
-     */
-    private void installSnapshotIfNeeded() {
-        for (String followerId : followers) {
-            ActorSelection followerActor =
-                context.getPeerActorSelection(followerId);
-
-            if(followerActor != null) {
-                FollowerLogInformation followerLogInformation =
-                    followerToLog.get(followerId);
-
-                long nextIndex = followerLogInformation.getNextIndex().get();
-
-                if (!context.getReplicatedLog().isPresent(nextIndex) &&
-                    context.getReplicatedLog().isInSnapshot(nextIndex)) {
-                    LOG.info("{} follower needs a snapshot install", followerId);
-                    if (snapshot.isPresent()) {
-                        // if a snapshot is present in the memory, most likely another install is in progress
-                        // no need to capture snapshot
-                        sendSnapshotChunk(followerActor, followerId);
-
-                    } else {
-                        initiateCaptureSnapshot();
-                        //we just need 1 follower who would need snapshot to be installed.
-                        // when we have the snapshot captured, we would again check (in SendInstallSnapshot)
-                        // who needs an install and send to all who need
-                        break;
-                    }
-
-                }
-            }
-        }
-    }
-
-    // on every install snapshot, we try to capture the snapshot.
-    // Once a capture is going on, another one issued will get ignored by RaftActor.
-    private void initiateCaptureSnapshot() {
-        LOG.info("Initiating Snapshot Capture to Install Snapshot, Leader:{}", getLeaderId());
-        ReplicatedLogEntry lastAppliedEntry = context.getReplicatedLog().get(context.getLastApplied());
-        long lastAppliedIndex = -1;
-        long lastAppliedTerm = -1;
-
-        if (lastAppliedEntry != null) {
-            lastAppliedIndex = lastAppliedEntry.getIndex();
-            lastAppliedTerm = lastAppliedEntry.getTerm();
-        } else if (context.getReplicatedLog().getSnapshotIndex() > -1)  {
-            lastAppliedIndex = context.getReplicatedLog().getSnapshotIndex();
-            lastAppliedTerm = context.getReplicatedLog().getSnapshotTerm();
-        }
-
-        boolean isInstallSnapshotInitiated = true;
-        actor().tell(new CaptureSnapshot(lastIndex(), lastTerm(),
-                lastAppliedIndex, lastAppliedTerm, isInstallSnapshotInitiated),
-            actor());
-    }
-
-
-    private void sendInstallSnapshot() {
-        for (String followerId : followers) {
-            ActorSelection followerActor = context.getPeerActorSelection(followerId);
-
-            if(followerActor != null) {
-                FollowerLogInformation followerLogInformation = followerToLog.get(followerId);
-                long nextIndex = followerLogInformation.getNextIndex().get();
-
-                if (!context.getReplicatedLog().isPresent(nextIndex) &&
-                    context.getReplicatedLog().isInSnapshot(nextIndex)) {
-                    sendSnapshotChunk(followerActor, followerId);
-                }
-            }
-        }
-    }
-
-    /**
-     *  Sends a snapshot chunk to a given follower
-     *  InstallSnapshot should qualify as a heartbeat too.
-     */
-    private void sendSnapshotChunk(ActorSelection followerActor, String followerId) {
-        try {
-            if (snapshot.isPresent()) {
-                followerActor.tell(
-                    new InstallSnapshot(currentTerm(), context.getId(),
-                        context.getReplicatedLog().getSnapshotIndex(),
-                        context.getReplicatedLog().getSnapshotTerm(),
-                        getNextSnapshotChunk(followerId,snapshot.get()),
-                        mapFollowerToSnapshot.get(followerId).incrementChunkIndex(),
-                        mapFollowerToSnapshot.get(followerId).getTotalChunks()
-                    ).toSerializable(),
-                    actor()
-                );
-                LOG.info("InstallSnapshot sent to follower {}, Chunk: {}/{}",
-                    followerActor.path(), mapFollowerToSnapshot.get(followerId).getChunkIndex(),
-                    mapFollowerToSnapshot.get(followerId).getTotalChunks());
-            }
-        } catch (IOException e) {
-            LOG.error(e, "InstallSnapshot failed for Leader.");
-        }
-    }
-
-    /**
-     * Acccepts snaphot as ByteString, enters into map for future chunks
-     * creates and return a ByteString chunk
-     */
-    private ByteString getNextSnapshotChunk(String followerId, ByteString snapshotBytes) throws IOException {
-        FollowerToSnapshot followerToSnapshot = mapFollowerToSnapshot.get(followerId);
-        if (followerToSnapshot == null) {
-            followerToSnapshot = new FollowerToSnapshot(snapshotBytes);
-            mapFollowerToSnapshot.put(followerId, followerToSnapshot);
-        }
-        ByteString nextChunk = followerToSnapshot.getNextChunk();
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Leader's snapshot nextChunk size:{}", nextChunk.size());
-        }
-        return nextChunk;
-    }
-
-    private void sendHeartBeat() {
-        if (followers.size() > 0) {
-            sendAppendEntries();
-        }
-    }
-
-    private void stopHeartBeat() {
-        if (heartbeatSchedule != null && !heartbeatSchedule.isCancelled()) {
-            heartbeatSchedule.cancel();
-        }
-    }
-
-    private void stopInstallSnapshotSchedule() {
+    protected void stopInstallSnapshotSchedule() {
         if (installSnapshotSchedule != null && !installSnapshotSchedule.isCancelled()) {
             installSnapshotSchedule.cancel();
         }
     }
 
-    private void scheduleHeartBeat(FiniteDuration interval) {
-        if(followers.size() == 0){
-            // Optimization - do not bother scheduling a heartbeat as there are
-            // no followers
-            return;
-        }
-
-        stopHeartBeat();
-
-        // Schedule a heartbeat. When the scheduler triggers a SendHeartbeat
-        // message is sent to itself.
-        // Scheduling the heartbeat only once here because heartbeats do not
-        // need to be sent if there are other messages being sent to the remote
-        // actor.
-        heartbeatSchedule = context.getActorSystem().scheduler().scheduleOnce(
-            interval, context.getActor(), new SendHeartBeat(),
-            context.getActorSystem().dispatcher(), context.getActor());
-    }
-
-    private void scheduleInstallSnapshotCheck(FiniteDuration interval) {
+    protected void scheduleInstallSnapshotCheck(FiniteDuration interval) {
         if(followers.size() == 0){
             // Optimization - do not bother scheduling a heartbeat as there are
             // no followers
@@ -624,122 +91,22 @@ public class Leader extends AbstractRaftActorBehavior {
                 context.getActorSystem().dispatcher(), context.getActor());
     }
 
-
-
-    @Override public void close() throws Exception {
-        stopHeartBeat();
-    }
-
-    @Override public String getLeaderId() {
-        return context.getId();
-    }
-
-    /**
-     * Encapsulates the snapshot bytestring and handles the logic of sending
-     * snapshot chunks
-     */
-    protected class FollowerToSnapshot {
-        private ByteString snapshotBytes;
-        private int offset = 0;
-        // the next snapshot chunk is sent only if the replyReceivedForOffset matches offset
-        private int replyReceivedForOffset;
-        // if replyStatus is false, the previous chunk is attempted
-        private boolean replyStatus = false;
-        private int chunkIndex;
-        private int totalChunks;
-
-        public FollowerToSnapshot(ByteString snapshotBytes) {
-            this.snapshotBytes = snapshotBytes;
-            replyReceivedForOffset = -1;
-            chunkIndex = 1;
-            int size = snapshotBytes.size();
-            totalChunks = ( size / context.getConfigParams().getSnapshotChunkSize()) +
-                ((size % context.getConfigParams().getSnapshotChunkSize()) > 0 ? 1 : 0);
-            if(LOG.isDebugEnabled()) {
-                LOG.debug("Snapshot {} bytes, total chunks to send:{}",
-                    size, totalChunks);
-            }
-        }
-
-        public ByteString getSnapshotBytes() {
-            return snapshotBytes;
-        }
-
-        public int incrementOffset() {
-            if(replyStatus) {
-                // if prev chunk failed, we would want to sent the same chunk again
-                offset = offset + context.getConfigParams().getSnapshotChunkSize();
-            }
-            return offset;
-        }
-
-        public int incrementChunkIndex() {
-            if (replyStatus) {
-                // if prev chunk failed, we would want to sent the same chunk again
-                chunkIndex =  chunkIndex + 1;
-            }
-            return chunkIndex;
-        }
-
-        public int getChunkIndex() {
-            return chunkIndex;
-        }
-
-        public int getTotalChunks() {
-            return totalChunks;
-        }
-
-        public boolean canSendNextChunk() {
-            // we only send a false if a chunk is sent but we have not received a reply yet
-            return replyReceivedForOffset == offset;
-        }
-
-        public boolean isLastChunk(int chunkIndex) {
-            return totalChunks == chunkIndex;
-        }
-
-        public void markSendStatus(boolean success) {
-            if (success) {
-                // if the chunk sent was successful
-                replyReceivedForOffset = offset;
-                replyStatus = true;
-            } else {
-                // if the chunk sent was failure
-                replyReceivedForOffset = offset;
-                replyStatus = false;
-            }
-        }
-
-        public ByteString getNextChunk() {
-            int snapshotLength = getSnapshotBytes().size();
-            int start = incrementOffset();
-            int size = context.getConfigParams().getSnapshotChunkSize();
-            if (context.getConfigParams().getSnapshotChunkSize() > snapshotLength) {
-                size = snapshotLength;
-            } else {
-                if ((start + context.getConfigParams().getSnapshotChunkSize()) > snapshotLength) {
-                    size = snapshotLength - start;
-                }
-            }
-
-            if(LOG.isDebugEnabled()) {
-                LOG.debug("length={}, offset={},size={}",
-                    snapshotLength, start, size);
-            }
-            return getSnapshotBytes().substring(start, start + size);
-
+    protected void stopIsolatedLeaderCheckSchedule() {
+        if (isolatedLeaderCheckSchedule != null && !isolatedLeaderCheckSchedule.isCancelled()) {
+            isolatedLeaderCheckSchedule.cancel();
         }
     }
 
-    // called from example-actor for printing the follower-states
-    public String printFollowerStates() {
-        StringBuilder sb = new StringBuilder();
-        for(FollowerLogInformation followerLogInformation : followerToLog.values()) {
-            boolean isFollowerActive = followerLogInformation.isFollowerActive();
-            sb.append("{"+followerLogInformation.getId() + " state:" + isFollowerActive + "},");
+    protected void scheduleIsolatedLeaderCheck(FiniteDuration isolatedCheckInterval) {
+        isolatedLeaderCheckSchedule = context.getActorSystem().scheduler().schedule(isolatedCheckInterval, isolatedCheckInterval,
+            context.getActor(), new IsolatedLeaderCheck(),
+            context.getActorSystem().dispatcher(), context.getActor());
+    }
 
-        }
-        return "[" + sb.toString() + "]";
+    @Override public void close() throws Exception {
+        stopInstallSnapshotSchedule();
+        stopIsolatedLeaderCheckSchedule();
+        super.close();
     }
 
     @VisibleForTesting
diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/IsolatedLeaderTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/IsolatedLeaderTest.java
new file mode 100644 (file)
index 0000000..708068a
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * 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.cluster.raft.behaviors;
+
+import akka.actor.ActorRef;
+import akka.actor.Props;
+import akka.testkit.JavaTestKit;
+import java.util.HashMap;
+import java.util.Map;
+import org.junit.Test;
+import org.opendaylight.controller.cluster.raft.MockRaftActorContext;
+import org.opendaylight.controller.cluster.raft.RaftActorContext;
+import org.opendaylight.controller.cluster.raft.RaftState;
+import org.opendaylight.controller.cluster.raft.messages.AppendEntriesReply;
+import org.opendaylight.controller.cluster.raft.utils.DoNothingActor;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+public class IsolatedLeaderTest  extends AbstractRaftActorBehaviorTest {
+
+    private ActorRef leaderActor =
+        getSystem().actorOf(Props.create(DoNothingActor.class));
+
+    private ActorRef senderActor =
+        getSystem().actorOf(Props.create(DoNothingActor.class));
+
+    @Override
+    protected RaftActorBehavior createBehavior(
+        RaftActorContext actorContext) {
+        return new Leader(actorContext);
+    }
+
+    @Override
+    protected RaftActorContext createActorContext() {
+        return createActorContext(leaderActor);
+    }
+
+
+    @Test
+    public void testHandleMessageWithThreeMembers() {
+        new JavaTestKit(getSystem()) {{
+            String followerAddress1 = "akka://test/user/$a";
+            String followerAddress2 = "akka://test/user/$b";
+
+            MockRaftActorContext leaderActorContext = (MockRaftActorContext) createActorContext();
+            Map<String, String> peerAddresses = new HashMap<>();
+            peerAddresses.put("follower-1", followerAddress1);
+            peerAddresses.put("follower-2", followerAddress2);
+            leaderActorContext.setPeerAddresses(peerAddresses);
+
+            IsolatedLeader isolatedLeader = new IsolatedLeader(leaderActorContext);
+            assertTrue(isolatedLeader.state() == RaftState.IsolatedLeader);
+
+            // in a 3 node cluster, even if 1 follower is returns a reply, the isolatedLeader is not isolated
+            RaftActorBehavior behavior = isolatedLeader.handleMessage(senderActor,
+                new AppendEntriesReply("follower-1", isolatedLeader.lastTerm() - 1, true,
+                    isolatedLeader.lastIndex() - 1, isolatedLeader.lastTerm() - 1));
+
+            assertEquals(RaftState.Leader, behavior.state());
+
+            behavior = isolatedLeader.handleMessage(senderActor,
+                new AppendEntriesReply("follower-2", isolatedLeader.lastTerm() - 1, true,
+                    isolatedLeader.lastIndex() -1, isolatedLeader.lastTerm() -1 ));
+
+            assertEquals(RaftState.Leader, behavior.state());
+        }};
+    }
+
+    @Test
+    public void testHandleMessageWithFiveMembers() {
+        new JavaTestKit(getSystem()) {{
+
+            String followerAddress1 = "akka://test/user/$a";
+            String followerAddress2 = "akka://test/user/$b";
+            String followerAddress3 = "akka://test/user/$c";
+            String followerAddress4 = "akka://test/user/$d";
+
+            MockRaftActorContext leaderActorContext = (MockRaftActorContext) createActorContext();
+            Map<String, String> peerAddresses = new HashMap<>();
+            peerAddresses.put("follower-1", followerAddress1);
+            peerAddresses.put("follower-2", followerAddress2);
+            peerAddresses.put("follower-3", followerAddress3);
+            peerAddresses.put("follower-4", followerAddress4);
+            leaderActorContext.setPeerAddresses(peerAddresses);
+
+            IsolatedLeader isolatedLeader = new IsolatedLeader(leaderActorContext);
+            assertEquals(RaftState.IsolatedLeader, isolatedLeader.state());
+
+            // in a 5 member cluster, atleast 2 followers need to be active and return a reply
+            RaftActorBehavior behavior = isolatedLeader.handleMessage(senderActor,
+                new AppendEntriesReply("follower-1", isolatedLeader.lastTerm() - 1, true,
+                    isolatedLeader.lastIndex() -1, isolatedLeader.lastTerm() -1 ));
+
+            assertEquals(RaftState.IsolatedLeader, behavior.state());
+
+            behavior = isolatedLeader.handleMessage(senderActor,
+                new AppendEntriesReply("follower-2", isolatedLeader.lastTerm() - 1, true,
+                    isolatedLeader.lastIndex() -1, isolatedLeader.lastTerm() -1 ));
+
+            assertEquals(RaftState.Leader, behavior.state());
+
+            behavior = isolatedLeader.handleMessage(senderActor,
+                new AppendEntriesReply("follower-3", isolatedLeader.lastTerm() - 1, true,
+                    isolatedLeader.lastIndex() -1, isolatedLeader.lastTerm() -1 ));
+
+            assertEquals(RaftState.Leader, behavior.state());
+        }};
+    }
+
+    @Test
+    public void testHandleMessageFromAnotherLeader() {
+        new JavaTestKit(getSystem()) {{
+            String followerAddress1 = "akka://test/user/$a";
+            String followerAddress2 = "akka://test/user/$b";
+
+            MockRaftActorContext leaderActorContext = (MockRaftActorContext) createActorContext();
+            Map<String, String> peerAddresses = new HashMap<>();
+            peerAddresses.put("follower-1", followerAddress1);
+            peerAddresses.put("follower-2", followerAddress2);
+            leaderActorContext.setPeerAddresses(peerAddresses);
+
+            IsolatedLeader isolatedLeader = new IsolatedLeader(leaderActorContext);
+            assertTrue(isolatedLeader.state() == RaftState.IsolatedLeader);
+
+            // if an append-entries reply is received by the isolated-leader, and that reply
+            // has a term  > than its own term, then IsolatedLeader switches to Follower
+            // bowing itself to another leader in the cluster
+            RaftActorBehavior behavior = isolatedLeader.handleMessage(senderActor,
+                new AppendEntriesReply("follower-1", isolatedLeader.lastTerm() + 1, true,
+                    isolatedLeader.lastIndex() + 1, isolatedLeader.lastTerm() + 1));
+
+            assertEquals(RaftState.Follower, behavior.state());
+        }};
+
+    }
+}
index 168eb3e5f22c9752dcbe089fe2e87393713d2650..6b534deb1f5db6e8f7b773ddd2004f6b0f44ee71 100644 (file)
@@ -1,10 +1,20 @@
 package org.opendaylight.controller.cluster.raft.behaviors;
 
 import akka.actor.ActorRef;
+import akka.actor.PoisonPill;
 import akka.actor.Props;
+import akka.actor.Terminated;
 import akka.testkit.JavaTestKit;
 import com.google.common.base.Optional;
+import com.google.common.util.concurrent.Uninterruptibles;
 import com.google.protobuf.ByteString;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
 import org.junit.Assert;
 import org.junit.Test;
 import org.opendaylight.controller.cluster.raft.DefaultConfigParamsImpl;
@@ -18,6 +28,7 @@ import org.opendaylight.controller.cluster.raft.base.messages.ApplyLogEntries;
 import org.opendaylight.controller.cluster.raft.base.messages.ApplyState;
 import org.opendaylight.controller.cluster.raft.base.messages.CaptureSnapshot;
 import org.opendaylight.controller.cluster.raft.base.messages.InitiateInstallSnapshot;
+import org.opendaylight.controller.cluster.raft.base.messages.IsolatedLeaderCheck;
 import org.opendaylight.controller.cluster.raft.base.messages.Replicate;
 import org.opendaylight.controller.cluster.raft.base.messages.SendHeartBeat;
 import org.opendaylight.controller.cluster.raft.base.messages.SendInstallSnapshot;
@@ -31,15 +42,6 @@ import org.opendaylight.controller.cluster.raft.utils.MessageCollectorActor;
 import org.opendaylight.controller.protobuff.messages.cluster.raft.AppendEntriesMessages;
 import org.opendaylight.controller.protobuff.messages.cluster.raft.InstallSnapshotMessages;
 import scala.concurrent.duration.FiniteDuration;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -941,10 +943,82 @@ public class LeaderTest extends AbstractRaftActorBehaviorTest {
                 raftActorBehavior = leader.handleRequestVoteReply(getRef(), new RequestVoteReply(1, false));
 
                 assertEquals(RaftState.Leader, raftActorBehavior.state());
+            }};
+    }
 
+    @Test
+    public void testIsolatedLeaderCheckNoFollowers() {
+        new JavaTestKit(getSystem()) {{
+            ActorRef leaderActor = getTestActor();
 
-            }};
+            MockRaftActorContext leaderActorContext =
+                new MockRaftActorContext("leader", getSystem(), leaderActor);
+
+            Map<String, String> peerAddresses = new HashMap<>();
+            leaderActorContext.setPeerAddresses(peerAddresses);
 
+            Leader leader = new Leader(leaderActorContext);
+            RaftActorBehavior behavior = leader.handleMessage(leaderActor, new IsolatedLeaderCheck());
+            Assert.assertTrue(behavior instanceof Leader);
+        }};
+    }
+
+    @Test
+    public void testIsolatedLeaderCheckTwoFollowers() throws Exception {
+        new JavaTestKit(getSystem()) {{
+
+            ActorRef followerActor1 = getTestActor();
+            ActorRef followerActor2 = getTestActor();
+
+            MockRaftActorContext leaderActorContext = (MockRaftActorContext) createActorContext();
+
+            Map<String, String> peerAddresses = new HashMap<>();
+            peerAddresses.put("follower-1", followerActor1.path().toString());
+            peerAddresses.put("follower-2", followerActor2.path().toString());
+
+            leaderActorContext.setPeerAddresses(peerAddresses);
+
+            Leader leader = new Leader(leaderActorContext);
+            leader.stopIsolatedLeaderCheckSchedule();
+
+            leader.markFollowerActive("follower-1");
+            leader.markFollowerActive("follower-2");
+            RaftActorBehavior behavior = leader.handleMessage(leaderActor, new IsolatedLeaderCheck());
+            Assert.assertTrue("Behavior not instance of Leader when all followers are active",
+                behavior instanceof Leader);
+
+            // kill 1 follower and verify if that got killed
+            final JavaTestKit probe = new JavaTestKit(getSystem());
+            probe.watch(followerActor1);
+            followerActor1.tell(PoisonPill.getInstance(), ActorRef.noSender());
+            final Terminated termMsg1 = probe.expectMsgClass(Terminated.class);
+            assertEquals(termMsg1.getActor(), followerActor1);
+
+            //sleep enough for all the follower stopwatches to lapse
+            Uninterruptibles.sleepUninterruptibly(leaderActorContext.getConfigParams().
+                getElectionTimeOutInterval().toMillis(), TimeUnit.MILLISECONDS);
+
+            leader.markFollowerActive("follower-2");
+            behavior = leader.handleMessage(leaderActor, new IsolatedLeaderCheck());
+            Assert.assertTrue("Behavior not instance of Leader when majority of followers are active",
+                behavior instanceof Leader);
+
+            // kill 2nd follower and leader should change to Isolated leader
+            followerActor2.tell(PoisonPill.getInstance(), null);
+            probe.watch(followerActor2);
+            followerActor2.tell(PoisonPill.getInstance(), ActorRef.noSender());
+            final Terminated termMsg2 = probe.expectMsgClass(Terminated.class);
+            assertEquals(termMsg2.getActor(), followerActor2);
+
+            //sleep enough for the remaining the follower stopwatches to lapse
+            Uninterruptibles.sleepUninterruptibly(leaderActorContext.getConfigParams().
+                getElectionTimeOutInterval().toMillis(), TimeUnit.MILLISECONDS);
+
+            behavior = leader.handleMessage(leaderActor, new IsolatedLeaderCheck());
+            Assert.assertTrue("Behavior not instance of IsolatedLeader when majority followers are inactive",
+                behavior instanceof IsolatedLeader);
+
+        }};
     }
 
     class MockLeader extends Leader {
index fae7eb1a33434bdc52fc3534fe3ee45eee553870..c7bf7d1f7ac2d90d9eb548b5a73a05701f5bab92 100644 (file)
@@ -179,7 +179,7 @@ public class NormalizedNodeSerializer {
                 ValueSerializer.serialize(builder, this, value);
 
             } else if (value instanceof Iterable) {
-                Iterable iterable = (Iterable) value;
+                Iterable<?> iterable = (Iterable<?>) value;
 
                 for (Object o : iterable) {
                     if (o instanceof NormalizedNode) {
index 2574bd681eeaf72762a8ff8c047fd0d5567f3390..cac58587a5ca3acac688c923d47af3846484e4b7 100644 (file)
@@ -92,7 +92,7 @@ public class XmlUtilsTest {
 
     YangInstanceIdentifier instance = (YangInstanceIdentifier) secondNode.getValue();
     Iterable<YangInstanceIdentifier.PathArgument> iterable = instance.getPathArguments();
-    Iterator it = iterable.iterator();
+    Iterator<YangInstanceIdentifier.PathArgument> it = iterable.iterator();
     YangInstanceIdentifier.NodeIdentifier firstPath = (YangInstanceIdentifier.NodeIdentifier) it.next();
     Assert.assertEquals("node", firstPath.getNodeType().getLocalName());
     YangInstanceIdentifier.NodeIdentifierWithPredicates secondPath = (YangInstanceIdentifier.NodeIdentifierWithPredicates)it.next();
index 2048bde613868ed7bb6ea30e8fa25776d7ecc9a4..e18c00ec4b0b5449ddc071175b379372528796f4 100644 (file)
@@ -119,6 +119,7 @@ public class DatastoreContext {
         private Timeout shardLeaderElectionTimeout = new Timeout(30, TimeUnit.SECONDS);
         private boolean persistent = true;
         private ConfigurationReader configurationReader = new FileConfigurationReader();
+        private int shardIsolatedLeaderCheckIntervalInMillis = shardHeartbeatIntervalInMillis * 10;
 
         public Builder shardTransactionIdleTimeout(Duration shardTransactionIdleTimeout) {
             this.shardTransactionIdleTimeout = shardTransactionIdleTimeout;
@@ -180,18 +181,24 @@ public class DatastoreContext {
             return this;
         }
 
-
         public Builder persistent(boolean persistent){
             this.persistent = persistent;
             return this;
         }
 
+        public Builder shardIsolatedLeaderCheckIntervalInMillis(int shardIsolatedLeaderCheckIntervalInMillis) {
+            this.shardIsolatedLeaderCheckIntervalInMillis = shardIsolatedLeaderCheckIntervalInMillis;
+            return this;
+        }
+
         public DatastoreContext build() {
             DefaultConfigParamsImpl raftConfig = new DefaultConfigParamsImpl();
             raftConfig.setHeartBeatInterval(new FiniteDuration(shardHeartbeatIntervalInMillis,
                     TimeUnit.MILLISECONDS));
             raftConfig.setJournalRecoveryLogBatchSize(shardJournalRecoveryLogBatchSize);
             raftConfig.setSnapshotBatchCount(shardSnapshotBatchCount);
+            raftConfig.setIsolatedLeaderCheckInterval(
+                new FiniteDuration(shardIsolatedLeaderCheckIntervalInMillis, TimeUnit.MILLISECONDS));
 
             return new DatastoreContext(dataStoreProperties, raftConfig, dataStoreMXBeanType,
                     operationTimeoutInSeconds, shardTransactionIdleTimeout,
index 2f3fbdcef17ee9b6fc86226ad80d93c2e36ab42b..8eb653a44feb54731c840549d54ca24cafacc292 100644 (file)
@@ -63,6 +63,8 @@ public class DistributedConfigDataStoreProviderModule extends
                 .shardTransactionCommitQueueCapacity(
                         props.getShardTransactionCommitQueueCapacity().getValue().intValue())
                 .persistent(props.getPersistent().booleanValue())
+                .shardIsolatedLeaderCheckIntervalInMillis(
+                    props.getShardIsolatedLeaderCheckIntervalInMillis().getValue())
                 .build();
 
         return DistributedDataStoreFactory.createInstance("config", getConfigSchemaServiceDependency(),
index ecb3a910178484af829cba489c7f33ec30b33662..2a12aff4ef321b35c79c9ca491ac532045f56a36 100644 (file)
@@ -63,6 +63,8 @@ public class DistributedOperationalDataStoreProviderModule extends
                 .shardTransactionCommitQueueCapacity(
                         props.getShardTransactionCommitQueueCapacity().getValue().intValue())
                 .persistent(props.getPersistent().booleanValue())
+                .shardIsolatedLeaderCheckIntervalInMillis(
+                    props.getShardIsolatedLeaderCheckIntervalInMillis().getValue())
                 .build();
 
         return DistributedDataStoreFactory.createInstance("operational",
index 995e98f38fff30f1340df40ad0162e19b9d7c264..4d3d438b3267b857457e4f7a5c767c52a9338c6a 100644 (file)
@@ -153,6 +153,13 @@ module distributed-datastore-provider {
             type boolean;
             description "Enable or disable data persistence";
          }
+
+        leaf shard-isolated-leader-check-interval-in-millis {
+            default 5000;
+            type heartbeat-interval-type;
+            description "The interval at which the leader of the shard will check if its majority
+                        followers are active and term itself as isolated";
+        }
     }
 
     // Augments the 'configuration' choice node under modules/module.
index 264709f687adcb8ab13cf4a7149099324dd9c476..60581f99cb26d40a016b285b8c7ae49fb8b8fd39 100644 (file)
   <packaging>bundle</packaging>
 
   <dependencies>
-    <dependency>
-      <groupId>com.github.romix</groupId>
-      <artifactId>java-concurrent-hash-trie-map</artifactId>
-    </dependency>
     <dependency>
       <groupId>com.google.guava</groupId>
       <artifactId>guava</artifactId>
                             org.opendaylight.yangtools.yang.util,
                             org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.dom.impl.rev131028.*</Private-Package>
             <Import-Package>*</Import-Package>
-            <Embed-Dependency>java-concurrent-hash-trie-map;inline=true</Embed-Dependency>
           </instructions>
         </configuration>
       </plugin>
index 5be701f82e64497fea4ef863dfd7a147bd360499..5979771d28c88e1ad765bfa5d83053b5974a724c 100644 (file)
@@ -121,7 +121,7 @@ public class JDBCServer extends Thread {
             while (entry.getValue().next()) {
                 Map rec = entry.getValue().getCurrent();
                 Map newRec = new HashMap();
-                for (Iterator iter = rec.entrySet().iterator(); iter.hasNext();) {
+                for (Iterator<?> iter = rec.entrySet().iterator(); iter.hasNext();) {
                     Map.Entry e = (Map.Entry) iter.next();
                     String key = (String) e.getKey();
                     Object value = e.getValue();
index bca47af5c0b3deddaeb1bacd1c86346892eaeafa..97e294016d908936cbe2fe9e28c94d94027cc7d7 100644 (file)
@@ -9,8 +9,9 @@ package org.opendaylight.controller.config.yang.md.sal.connector.netconf;
 
 import static org.opendaylight.controller.config.api.JmxAttributeValidationException.checkCondition;
 import static org.opendaylight.controller.config.api.JmxAttributeValidationException.checkNotNull;
-
 import com.google.common.base.Optional;
+import io.netty.util.concurrent.EventExecutor;
+import java.math.BigDecimal;
 import java.net.InetSocketAddress;
 import java.util.List;
 import java.util.concurrent.ExecutorService;
@@ -120,13 +121,7 @@ public final class NetconfConnectorModule extends org.opendaylight.controller.co
         final NetconfClientDispatcher dispatcher = getClientDispatcherDependency();
         listener.initializeRemoteConnection(dispatcher, clientConfig);
 
-        return new AutoCloseable() {
-            @Override
-            public void close() throws Exception {
-                listener.close();
-                salFacade.close();
-            }
-        };
+        return new MyAutoCloseable(listener, salFacade);
     }
 
     private Optional<NetconfSessionCapabilities> getUserCapabilities() {
@@ -155,9 +150,12 @@ public final class NetconfConnectorModule extends org.opendaylight.controller.co
 
     public NetconfReconnectingClientConfiguration getClientConfig(final NetconfDeviceCommunicator listener) {
         final InetSocketAddress socketAddress = getSocketAddress();
-        final ReconnectStrategy strategy = getReconnectStrategy();
         final long clientConnectionTimeoutMillis = getConnectionTimeoutMillis();
 
+        final ReconnectStrategyFactory sf = new MyReconnectStrategyFactory(
+            getEventExecutorDependency(), getMaxConnectionAttempts(), getBetweenAttemptsTimeoutMillis(), getSleepFactor());
+        final ReconnectStrategy strategy = sf.createReconnectStrategy();
+
         return NetconfReconnectingClientConfigurationBuilder.create()
         .withAddress(socketAddress)
         .withConnectionTimeoutMillis(clientConnectionTimeoutMillis)
@@ -167,30 +165,54 @@ public final class NetconfConnectorModule extends org.opendaylight.controller.co
         .withProtocol(getTcpOnly() ?
                 NetconfClientConfiguration.NetconfClientProtocol.TCP :
                 NetconfClientConfiguration.NetconfClientProtocol.SSH)
-        .withConnectStrategyFactory(new ReconnectStrategyFactory() {
-            @Override
-            public ReconnectStrategy createReconnectStrategy() {
-                return getReconnectStrategy();
-            }
-        })
+        .withConnectStrategyFactory(sf)
         .build();
     }
 
-    private ReconnectStrategy getReconnectStrategy() {
-        final Long connectionAttempts;
-        if (getMaxConnectionAttempts() != null && getMaxConnectionAttempts() > 0) {
-            connectionAttempts = getMaxConnectionAttempts();
-        } else {
-            logger.trace("Setting {} on {} to infinity", maxConnectionAttemptsJmxAttribute, this);
-            connectionAttempts = null;
+    private static final class MyAutoCloseable implements AutoCloseable {
+        private final RemoteDeviceHandler<NetconfSessionCapabilities> salFacade;
+        private final NetconfDeviceCommunicator listener;
+
+        public MyAutoCloseable(final NetconfDeviceCommunicator listener,
+                final RemoteDeviceHandler<NetconfSessionCapabilities> salFacade) {
+            this.listener = listener;
+            this.salFacade = salFacade;
         }
-        final double sleepFactor = getSleepFactor().doubleValue();
-        final int minSleep = getBetweenAttemptsTimeoutMillis();
-        final Long maxSleep = null;
-        final Long deadline = null;
 
-        return new TimedReconnectStrategy(getEventExecutorDependency(), getBetweenAttemptsTimeoutMillis(),
-                minSleep, sleepFactor, maxSleep, connectionAttempts, deadline);
+        @Override
+        public void close() {
+            listener.close();
+            salFacade.close();
+        }
+    }
+
+    private static final class MyReconnectStrategyFactory implements ReconnectStrategyFactory {
+        private final Long connectionAttempts;
+        private final EventExecutor executor;
+        private final double sleepFactor;
+        private final int minSleep;
+
+        MyReconnectStrategyFactory(final EventExecutor executor, final Long maxConnectionAttempts, final int minSleep, final BigDecimal sleepFactor) {
+            if (maxConnectionAttempts != null && maxConnectionAttempts > 0) {
+                connectionAttempts = maxConnectionAttempts;
+            } else {
+                logger.trace("Setting {} on {} to infinity", maxConnectionAttemptsJmxAttribute, this);
+                connectionAttempts = null;
+            }
+
+            this.sleepFactor = sleepFactor.doubleValue();
+            this.executor = executor;
+            this.minSleep = minSleep;
+        }
+
+        @Override
+        public ReconnectStrategy createReconnectStrategy() {
+            final Long maxSleep = null;
+            final Long deadline = null;
+
+            return new TimedReconnectStrategy(executor, minSleep,
+                    minSleep, sleepFactor, maxSleep, connectionAttempts, deadline);
+        }
     }
 
     private InetSocketAddress getSocketAddress() {
index 02819c15c78b4408c91ff56a725e013017a0b55b..2971865a70fb50f65e7c032295bf5bf5963a33df 100644 (file)
@@ -67,18 +67,18 @@ public class NetconfMessageTransformer implements MessageTransformer<NetconfMess
             if(schemaContext.isPresent()) {
                 if (NetconfMessageTransformUtil.isDataEditOperation(rpc)) {
                     final DataNodeContainer schemaForEdit = NetconfMessageTransformUtil.createSchemaForEdit(schemaContext.get());
-                    w3cPayload = XmlDocumentUtils.toDocument(rpcPayload, schemaForEdit, codecProvider);
+                    w3cPayload = XmlDocumentUtils.toDocument(rpcPayload, schemaContext.get(), schemaForEdit, codecProvider);
                 } else if (NetconfMessageTransformUtil.isGetOperation(rpc)) {
                     final DataNodeContainer schemaForGet = NetconfMessageTransformUtil.createSchemaForGet(schemaContext.get());
-                    w3cPayload = XmlDocumentUtils.toDocument(rpcPayload, schemaForGet, codecProvider);
+                    w3cPayload = XmlDocumentUtils.toDocument(rpcPayload, schemaContext.get(), schemaForGet, codecProvider);
                 } else if (NetconfMessageTransformUtil.isGetConfigOperation(rpc)) {
                     final DataNodeContainer schemaForGetConfig = NetconfMessageTransformUtil.createSchemaForGetConfig(schemaContext.get());
-                    w3cPayload = XmlDocumentUtils.toDocument(rpcPayload, schemaForGetConfig, codecProvider);
+                    w3cPayload = XmlDocumentUtils.toDocument(rpcPayload, schemaContext.get(), schemaForGetConfig, codecProvider);
                 } else {
                     final Optional<RpcDefinition> schemaForRpc = NetconfMessageTransformUtil.findSchemaForRpc(rpc, schemaContext.get());
                     if(schemaForRpc.isPresent()) {
                         final DataNodeContainer schemaForGetConfig = NetconfMessageTransformUtil.createSchemaForRpc(schemaForRpc.get());
-                        w3cPayload = XmlDocumentUtils.toDocument(rpcPayload, schemaForGetConfig, codecProvider);
+                        w3cPayload = XmlDocumentUtils.toDocument(rpcPayload, schemaContext.get(), schemaForGetConfig, codecProvider);
                     } else {
                         w3cPayload = toRpcRequestWithoutSchema(rpcPayload, codecProvider);
                     }
index 665fafacc893b7b05235daaa34f8e709d6f2702f..ceac03e3d97eccabca05633652179ce1bb3acb1c 100644 (file)
@@ -88,11 +88,6 @@ public class RestCodec {
                             "Value is not instance of IdentityrefTypeDefinition but is {}. Therefore NULL is used as translation of  - {}",
                             input == null ? "null" : input.getClass(), String.valueOf(input));
                     return null;
-                } else if (type instanceof LeafrefTypeDefinition) {
-                    if (input instanceof IdentityValuesDTO) {
-                        return LEAFREF_DEFAULT_CODEC.deserialize(((IdentityValuesDTO) input).getOriginValue());
-                    }
-                    return LEAFREF_DEFAULT_CODEC.deserialize(input);
                 } else if (type instanceof InstanceIdentifierTypeDefinition) {
                     if (input instanceof IdentityValuesDTO) {
                         return instanceIdentifier.deserialize(input);
@@ -232,7 +227,7 @@ public class RestCodec {
             IdentityValue valueWithNamespace = data.getValuesWithNamespaces().get(0);
             Module module = getModuleByNamespace(valueWithNamespace.getNamespace(), mountPoint);
             if (module == null) {
-                logger.info("Module by namespace '{}' of first node in instance-identiefier was not found.",
+                logger.info("Module by namespace '{}' of first node in instance-identifier was not found.",
                         valueWithNamespace.getNamespace());
                 logger.info("Instance-identifier will be translated as NULL for data - {}",
                         String.valueOf(valueWithNamespace.getValue()));
index cd860efab75073e13cf0cd2cfd93e12fd7200a5e..ded398a33d0f0390beab6f8e723412182a8172ce 100644 (file)
@@ -84,7 +84,9 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 import org.opendaylight.yangtools.yang.model.api.type.IdentityrefTypeDefinition;
+import org.opendaylight.yangtools.yang.model.api.type.LeafrefTypeDefinition;
 import org.opendaylight.yangtools.yang.model.util.EmptyType;
+import org.opendaylight.yangtools.yang.model.util.SchemaContextUtil;
 import org.opendaylight.yangtools.yang.parser.builder.impl.ContainerSchemaNodeBuilder;
 import org.opendaylight.yangtools.yang.parser.builder.impl.LeafSchemaNodeBuilder;
 import org.slf4j.Logger;
@@ -1241,7 +1243,9 @@ public class RestconfImpl implements RestconfService {
                 try {
                     this.normalizeNode(nodeWrap, schema, null, mountPoint);
                 } catch (IllegalArgumentException e) {
-                    throw new RestconfDocumentedException(e.getMessage(), ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
+                    RestconfDocumentedException restconfDocumentedException = new RestconfDocumentedException(e.getMessage(), ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
+                    restconfDocumentedException.addSuppressed(e);
+                    throw restconfDocumentedException;
                 }
                 if (nodeWrap instanceof CompositeNodeWrapper) {
                     return ((CompositeNodeWrapper) nodeWrap).unwrap();
@@ -1319,11 +1323,14 @@ public class RestconfImpl implements RestconfService {
         final Object value = simpleNode.getValue();
         Object inputValue = value;
         TypeDefinition<? extends Object> typeDefinition = this.typeDefinition(schema);
-        if ((typeDefinition instanceof IdentityrefTypeDefinition)) {
-            if ((value instanceof String)) {
-                inputValue = new IdentityValuesDTO(simpleNode.getNamespace().toString(), (String) value, null,
-                        (String) value);
-            } // else value is already instance of IdentityValuesDTO
+
+        // For leafrefs, extract the type it is pointing to
+        if(typeDefinition instanceof LeafrefTypeDefinition) {
+            typeDefinition = SchemaContextUtil.getBaseTypeForLeafRef(((LeafrefTypeDefinition) typeDefinition), mountPoint == null ? this.controllerContext.getGlobalSchema() : mountPoint.getSchemaContext(), schema);
+        }
+
+        if (typeDefinition instanceof IdentityrefTypeDefinition) {
+            inputValue = parseToIdentityValuesDTO(simpleNode, value, inputValue);
         }
 
         Object outputValue = inputValue;
@@ -1336,6 +1343,14 @@ public class RestconfImpl implements RestconfService {
         simpleNode.setValue(outputValue);
     }
 
+    private Object parseToIdentityValuesDTO(final SimpleNodeWrapper simpleNode, final Object value, Object inputValue) {
+        if ((value instanceof String)) {
+            inputValue = new IdentityValuesDTO(simpleNode.getNamespace().toString(), (String) value, null,
+                    (String) value);
+        } // else value is already instance of IdentityValuesDTO
+        return inputValue;
+    }
+
     private void normalizeCompositeNode(final CompositeNodeWrapper compositeNodeBuilder,
             final DataNodeContainer schema, final DOMMountPoint mountPoint, final QName currentAugment) {
         final List<NodeWrapper<?>> children = compositeNodeBuilder.getValues();
index b5d3528e95857cd95c9956522bf633f99edc6763..fa79fb7677d264969a6473ef8dfcc5d37c317a32 100644 (file)
@@ -63,7 +63,7 @@ public class CnSnToJsonLeafrefType extends YangAndXmlAndDataSchemaLoader {
     @Test
     public void leafrefToNotLeafTest() {
         String json = toJson("/cnsn-to-json/leafref/xml/data_ref_to_not_leaf.xml");
-        validateJson(".*\"cont-augment-module\\p{Blank}*:\\p{Blank}*lf6\":\\p{Blank}*\"44.33\".*", json);
+        validateJson(".*\"cont-augment-module\\p{Blank}*:\\p{Blank}*lf6\":\\p{Blank}*\"44\".*", json);
     }
 
     /**
index 59696bc534803935ab5c0c0126d0a43fc2c75fa5..bdd74e8f9617a634235814304f21a3362eefeb6f 100644 (file)
@@ -51,9 +51,7 @@ public class JsonLeafrefToCnSnTest extends YangAndXmlAndDataSchemaLoader {
         }
 
         assertNotNull(lf2);
-        assertTrue(lf2.getValue() instanceof String);
-        assertEquals("121", lf2.getValue());
-
+        assertEquals(121, lf2.getValue());
     }
 
 }
index 1c8e53e69ff5091d9a9013947d09cb6381d5723a..7b216ef1ba54f276628349a534871f4694852c00 100644 (file)
@@ -12,17 +12,27 @@ import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
 import java.net.URISyntaxException;
+
 import javax.ws.rs.WebApplicationException;
+
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.opendaylight.controller.sal.rest.impl.JsonToCompositeNodeProvider;
 import org.opendaylight.controller.sal.rest.impl.XmlToCompositeNodeProvider;
+import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.data.api.Node;
-import org.opendaylight.yangtools.yang.data.api.SimpleNode;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
 public class XmlAndJsonToCnSnLeafRefTest extends YangAndXmlAndDataSchemaLoader {
 
+    final QName refContQName = QName.create("referenced:module", "2014-04-17", "cont");
+    final QName refLf1QName = QName.create(refContQName, "lf1");
+    final QName contQName = QName.create("leafref:module", "2014-04-17", "cont");
+    final QName lf1QName = QName.create(contQName, "lf1");
+    final QName lf2QName = QName.create(contQName, "lf2");
+    final QName lf3QName = QName.create(contQName, "lf3");
+
     @BeforeClass
     public static void initialize() {
         dataLoad("/leafref/yang", 2, "leafref-module", "cont");
@@ -36,7 +46,11 @@ public class XmlAndJsonToCnSnLeafRefTest extends YangAndXmlAndDataSchemaLoader {
         CompositeNode cnSn = (CompositeNode)node;
 
         TestUtils.normalizeCompositeNode(cnSn, modules, schemaNodePath);
-        verifyContPredicate(cnSn, "/ns:cont/ns:lf1", "/cont/lf1", "/ns:cont/ns:lf1", "../lf1");
+
+        verifyContPredicate(cnSn, "lf4", YangInstanceIdentifier.builder().node(refContQName).node(refLf1QName).build());
+        verifyContPredicate(cnSn, "lf2", YangInstanceIdentifier.builder().node(contQName).node(lf1QName).build());
+        verifyContPredicate(cnSn, "lf3", YangInstanceIdentifier.builder().node(contQName).node(lf2QName).build());
+        verifyContPredicate(cnSn, "lf5", YangInstanceIdentifier.builder().node(contQName).node(lf3QName).build());
     }
 
     @Test
@@ -47,31 +61,23 @@ public class XmlAndJsonToCnSnLeafRefTest extends YangAndXmlAndDataSchemaLoader {
         CompositeNode cnSn = (CompositeNode)node;
 
         TestUtils.normalizeCompositeNode(cnSn, modules, schemaNodePath);
-        verifyContPredicate(cnSn, "/leafref-module:cont/leafref-module:lf1", "/leafref-module:cont/leafref-module:lf1",
-                "/referenced-module:cont/referenced-module:lf1", "/leafref-module:cont/leafref-module:lf1");
+
+        verifyContPredicate(cnSn, "lf4", YangInstanceIdentifier.builder().node(refContQName).node(refLf1QName).build());
+        verifyContPredicate(cnSn, "lf2", YangInstanceIdentifier.builder().node(contQName).node(lf1QName).build());
+        verifyContPredicate(cnSn, "lf3", YangInstanceIdentifier.builder().node(contQName).node(lf2QName).build());
+        verifyContPredicate(cnSn, "lf5", YangInstanceIdentifier.builder().node(contQName).node(lf3QName).build());
     }
 
-    private void verifyContPredicate(CompositeNode cnSn, String... values) throws URISyntaxException {
-        Object lf2Value = null;
-        Object lf3Value = null;
-        Object lf4Value = null;
-        Object lf5Value = null;
-
-        for (Node<?> node : cnSn.getValue()) {
-            if (node.getNodeType().getLocalName().equals("lf2")) {
-                lf2Value = ((SimpleNode<?>) node).getValue();
-            } else if (node.getNodeType().getLocalName().equals("lf3")) {
-                lf3Value = ((SimpleNode<?>) node).getValue();
-            } else if (node.getNodeType().getLocalName().equals("lf4")) {
-                lf4Value = ((SimpleNode<?>) node).getValue();
-            } else if (node.getNodeType().getLocalName().equals("lf5")) {
-                lf5Value = ((SimpleNode<?>) node).getValue();
+    private void verifyContPredicate(CompositeNode cnSn, String leafName, Object value) throws URISyntaxException {
+        Object parsed = null;
+
+        for (final Node<?> node : cnSn.getValue()) {
+            if (node.getNodeType().getLocalName().equals(leafName)) {
+                parsed = node.getValue();
             }
         }
-        assertEquals(values[0], lf2Value);
-        assertEquals(values[1], lf3Value);
-        assertEquals(values[2], lf4Value);
-        assertEquals(values[3], lf5Value);
+
+        assertEquals(value, parsed);
     }
 
 }
index d0af29e913fa633381c176ff1796a2fbd3f41c29..64568da769cad13132806df5bb551edd51bcaf20 100644 (file)
@@ -54,8 +54,7 @@ public class XmlToCnSnTest extends YangAndXmlAndDataSchemaLoader {
         }
 
         assertNotNull(lf2);
-        assertTrue(lf2.getValue() instanceof String);
-        assertEquals("121", lf2.getValue());
+        assertEquals(121, lf2.getValue());
     }
 
     @Test
index afc23b7946cf93b4e73b4c1c31255986562db1da..27b2dae2434dc63e1fb464de0cb62ea88b9157cc 100644 (file)
@@ -1,42 +1,42 @@
 module cont-augment-module {
-  namespace "cont:augment:module";  
+  namespace "cont:augment:module";
 
   prefix "cntaugmod";
-  
+
   import main-module {prefix mamo; revision-date 2013-12-2;}
-         
+
   revision 2013-12-2 {
-  
+
   }
-  
+
   augment "/mamo:cont" {
        leaf-list lflst1 {
                type leafref {
-                       path "../lf1";
+                       path "../mamo:lf1";
                }
-       }       
-       
+       }
+
        leaf lf4 {
                type leafref {
-                       path "../lf1";
+                       path "../mamo:lf1";
                }
        }
-       
+
        /* reference to not leaf element */
        leaf lf6 {
                type leafref {
                        path "../lflst1";
                }
        }
-       
+
        leaf lf7 {
                type leafref {
                        path "../lf4";
                }
        }
   }
-       
 
-         
+
+
+
 }
\ No newline at end of file
index cbe455b33b09beaa3b152d76edaefff716e87dbe..f4a435e3bf6b94e8e70ff46d08adf2f9fa4456e6 100644 (file)
@@ -2,7 +2,7 @@
     "leafref-module:cont" : {
         "lf4" : "/referenced-module:cont/referenced-module:lf1",
         "lf2" : "/leafref-module:cont/leafref-module:lf1",
-        "lf3" : "/leafref-module:cont/leafref-module:lf1",
-        "lf5" : "/leafref-module:cont/leafref-module:lf1"
+        "lf3" : "/leafref-module:cont/leafref-module:lf2",
+        "lf5" : "/leafref-module:cont/leafref-module:lf3"
     }
 }
\ No newline at end of file
index 01bf092d27f005605def37d43dda00f2c4450e72..1b5ce835fc0e9a44e94311df8f6c9f9d65827922 100644 (file)
@@ -1,6 +1,6 @@
-<cont xmlns="leafref:module">
-    <lf4 xmlns:ns="referenced:module">/ns:cont/ns:lf1</lf4>
-    <lf2 xmlns:ns="leafref:module">/ns:cont/ns:lf1</lf2>
-    <lf3 xmlns:ns="leafref:module">/cont/lf1</lf3>
-    <lf5 xmlns:ns="leafref:module">../lf1</lf5>
+<cont xmlnsa="leafref:module">
+    <lf4 xmlns:nsa="referenced:module">/nsa:cont/nsa:lf1</lf4>
+    <lf2 xmlns:nsa="leafref:module">/nsa:cont/nsa:lf1</lf2>
+    <lf3 xmlns:ns="leafref:module">/ns:cont/ns:lf2</lf3>
+    <lf5 xmlns:nsa="leafref:module">/nsa:cont/nsa:lf3</lf5>
 </cont>
index 8ca9f090968fa8ed25d4f69b5243f011f1f709c5..6fe770b40baebc9bdef35be75504c0c731461e87 100644 (file)
@@ -1,19 +1,61 @@
 module leafref-module {
-  namespace "leafref:module";  
+  namespace "leafref:module";
 
   prefix "lfrfmo";
-  revision 2013-11-18 {    
+  revision 2013-11-18 {
   }
 
+  identity base {}
+
     container cont {
         leaf lf1 {
             type int32;
         }
         leaf lf2 {
             type leafref {
-                path "/cont/lf1"; 
+                path "/cont/lf1";
+            }
+        }
+
+        leaf lf-ident {
+            type identityref {
+                base "lfrfmo:base";
             }
         }
+
+        leaf lf-ident-ref {
+            type leafref {
+                path "/cont/lf-ident";
+            }
+        }
+
+        leaf lf-ident-ref-relative {
+            type leafref {
+                path "../lf-ident";
+            }
+        }
+
+        leaf lf-ident-ref-relative-cnd {
+            type leafref {
+                path "/lfrfmo:cont/lfrfmo:lis[lfrfmo:id='abc']/lf-ident-ref";
+            }
+        }
+
+
+        list lis {
+            key "id";
+
+            leaf id {
+                type string;
+            }
+
+            leaf lf-ident-ref {
+                type leafref {
+                    path "/cont/lf-ident";
+                }
+            }
+        }
+
     }
-  
+
 }
\ No newline at end of file
index 06200a69b577088d98fe9252ee5252931e62672b..c3071e5610bcacbafe0863ccc6c5f34766661781 100644 (file)
@@ -1,4 +1,8 @@
 <cont>
     <lf1>121</lf1>
     <lf2>121</lf2>
+    <lf-ident xmlns:a="leafref:module">a:base</lf-ident>
+    <lf-ident-ref xmlns:a="leafref:module">a:base</lf-ident-ref>
+    <lf-ident-ref-relative xmlns:a="leafref:module">a:base</lf-ident-ref-relative>
+    <lf-ident-ref-relative-cnd xmlns:a="leafref:module">a:base</lf-ident-ref-relative-cnd>
 </cont>
\ No newline at end of file
index 9b36f9f4973581187e2bf0f45b376c72cdd8da4a..bba4b4c2b64261340a12f76e0107917003491d31 100644 (file)
@@ -169,7 +169,7 @@ class FlowCapableTopologyExporter implements FlowTopologyDiscoveryListener, Open
             public void applyOperation(final ReadWriteTransaction transaction) {
                 final Link link = toTopologyLink(notification);
                 final InstanceIdentifier<Link> path = linkPath(link);
-                transaction.put(LogicalDatastoreType.OPERATIONAL, path, link, true);
+                transaction.merge(LogicalDatastoreType.OPERATIONAL, path, link, true);
             }
 
             @Override
index 7f8d021b3bc28963cc144ed8e347d11545431600..c3357b7c6c7f2c61d331add3a14dde66aa6005a2 100644 (file)
@@ -538,7 +538,7 @@ public class FlowCapableTopologyExporterTest {
         waitForSubmit(submitLatch);
 
         ArgumentCaptor<Link> mergedNode = ArgumentCaptor.forClass(Link.class);
-        verify(mockTx).put(eq(LogicalDatastoreType.OPERATIONAL), eq(topologyIID.child(
+        verify(mockTx).merge(eq(LogicalDatastoreType.OPERATIONAL), eq(topologyIID.child(
                         Link.class, new LinkKey(new LinkId(sourceNodeConnKey.getId())))),
                 mergedNode.capture(), eq(true));
         assertEquals("Source node ID", "sourceNode",
index d544d1fb3394c6e114a1b4cb398e9786e5332a93..faaa17d5280f289ed6a004fd1f6df95165a02eda 100644 (file)
@@ -28,7 +28,7 @@ public class Activator implements BundleActivator {
     private static final Logger LOG = LoggerFactory.getLogger(Activator.class);
 
     private BundleContext context;
-    private ServiceRegistration osgiRegistration;
+    private ServiceRegistration<?> osgiRegistration;
     private ConfigRegistryLookupThread configRegistryLookup = null;
 
     @Override
index a48cbbe24106411451cc4726d6e3ca153f3166cb..f7bb281b9122b259e6e4df1a2e15b5bdca63b22f 100644 (file)
@@ -10,9 +10,9 @@ package org.opendaylight.controller.netconf.impl;
 
 import com.google.common.base.Optional;
 import io.netty.channel.Channel;
+import io.netty.channel.local.LocalAddress;
 import io.netty.util.Timer;
 import io.netty.util.concurrent.Promise;
-import java.net.InetSocketAddress;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.NetconfServerSessionPreferences;
 import org.opendaylight.controller.netconf.nettyutil.AbstractNetconfSessionNegotiator;
@@ -21,19 +21,31 @@ import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAddi
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class NetconfServerSessionNegotiator extends
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.util.AbstractMap;
+import java.util.Map;
+
+public class NetconfServerSessionNegotiator
+        extends
         AbstractNetconfSessionNegotiator<NetconfServerSessionPreferences, NetconfServerSession, NetconfServerSessionListener> {
 
-    static final Logger logger = LoggerFactory.getLogger(NetconfServerSessionNegotiator.class);
+    static final Logger logger = LoggerFactory
+            .getLogger(NetconfServerSessionNegotiator.class);
+    private static final String UNKNOWN = "unknown";
 
-    protected NetconfServerSessionNegotiator(NetconfServerSessionPreferences sessionPreferences,
-            Promise<NetconfServerSession> promise, Channel channel, Timer timer, NetconfServerSessionListener sessionListener,
+    protected NetconfServerSessionNegotiator(
+            NetconfServerSessionPreferences sessionPreferences,
+            Promise<NetconfServerSession> promise, Channel channel,
+            Timer timer, NetconfServerSessionListener sessionListener,
             long connectionTimeoutMillis) {
-        super(sessionPreferences, promise, channel, timer, sessionListener, connectionTimeoutMillis);
+        super(sessionPreferences, promise, channel, timer, sessionListener,
+                connectionTimeoutMillis);
     }
 
     @Override
-    protected void handleMessage(NetconfHelloMessage netconfMessage) throws NetconfDocumentedException {
+    protected void handleMessage(NetconfHelloMessage netconfMessage)
+            throws NetconfDocumentedException {
         NetconfServerSession session = getSessionForHelloMessage(netconfMessage);
         replaceHelloMessageInboundHandler(session);
         // Negotiation successful after all non hello messages were processed
@@ -41,21 +53,56 @@ public class NetconfServerSessionNegotiator extends
     }
 
     @Override
-    protected NetconfServerSession getSession(NetconfServerSessionListener sessionListener, Channel channel, NetconfHelloMessage message) {
-        Optional<NetconfHelloMessageAdditionalHeader> additionalHeader = message.getAdditionalHeader();
+    protected NetconfServerSession getSession(
+            NetconfServerSessionListener sessionListener, Channel channel,
+            NetconfHelloMessage message) {
+        Optional<NetconfHelloMessageAdditionalHeader> additionalHeader = message
+                .getAdditionalHeader();
 
         NetconfHelloMessageAdditionalHeader parsedHeader;
         if (additionalHeader.isPresent()) {
             parsedHeader = additionalHeader.get();
         } else {
-            InetSocketAddress inetSocketAddress = (InetSocketAddress) channel.localAddress();
-            parsedHeader = new NetconfHelloMessageAdditionalHeader("unknown", inetSocketAddress.getHostString(), Integer.toString(inetSocketAddress.getPort()),
-                    "tcp", "client");
+
+            parsedHeader = new NetconfHelloMessageAdditionalHeader(UNKNOWN,
+                    getHostName(channel.localAddress()).getValue(),
+                    getHostName(channel.localAddress()).getKey(), "tcp",
+                    "client");
+
         }
 
-        logger.debug("Additional header from hello parsed as {} from {}", parsedHeader, additionalHeader);
+        logger.debug("Additional header from hello parsed as {} from {}",
+                parsedHeader, additionalHeader);
+
+        return new NetconfServerSession(sessionListener, channel,
+                getSessionPreferences().getSessionId(), parsedHeader);
+    }
+
+    /**
+     * @param socketAddress
+     *            type of socket address LocalAddress, or
+     *            InetSocketAddress, for others returns unknown
+     * @return Map<port, host > two values - port and host of socket address
+     */
+    protected static Map.Entry<String, String> getHostName(
+            SocketAddress socketAddress) {
+
+        if (socketAddress instanceof InetSocketAddress) {
+
+            InetSocketAddress inetSocketAddress = (InetSocketAddress) socketAddress;
+
+            return new AbstractMap.SimpleImmutableEntry<>(
+                    Integer.toString(inetSocketAddress.getPort()),
+                    inetSocketAddress.getHostString());
+
+        } else if (socketAddress instanceof LocalAddress) {
+
+            return new AbstractMap.SimpleImmutableEntry<>(UNKNOWN,
+                    ((LocalAddress) socketAddress).id());
+
+        }
+        return new AbstractMap.SimpleImmutableEntry<>(UNKNOWN, UNKNOWN);
 
-        return new NetconfServerSession(sessionListener, channel, getSessionPreferences().getSessionId(), parsedHeader);
     }
 
 }
index 42a8bae4484b93a3ed4689223cbf34a9aacbd986..8b2ca86010a06aa5c1b509bd617a08de72fd684a 100644 (file)
@@ -178,10 +178,10 @@ public class SubtreeFilter {
             return false;
         }
 
-        final String unprefixedFilterContent = filter.getTextContent().substring(prefix.length());
-        final String unprefixedSrcCOntnet = src.getTextContent().substring(prefix.length());
+        final String unprefixedFilterContent = filter.getTextContent().substring(prefixToNamespaceOfFilter.getKey().length() + 1);
+        final String unprefixedSrcContnet = src.getTextContent().substring(prefixToNamespaceOfSrc.getKey().length() + 1);
         // Finally compare unprefixed content
-        return unprefixedFilterContent.equals(unprefixedSrcCOntnet);
+        return unprefixedFilterContent.equals(unprefixedSrcContnet);
     }
 
     enum MatchingResult {
diff --git a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiatorTest.java b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiatorTest.java
new file mode 100644 (file)
index 0000000..c16046c
--- /dev/null
@@ -0,0 +1,45 @@
+package org.opendaylight.controller.netconf.impl;
+
+import io.netty.channel.local.LocalAddress;
+import org.apache.sshd.common.SshdSocketAddress;
+import org.junit.Test;
+
+import java.net.InetSocketAddress;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+public class NetconfServerSessionNegotiatorTest {
+
+    @Test
+    public void testGetInetSocketAddress() throws Exception {
+
+        InetSocketAddress socketAddress = new InetSocketAddress(10);
+
+        assertNotNull(NetconfServerSessionNegotiator.getHostName(socketAddress));
+
+        assertEquals(socketAddress.getHostName(),
+                NetconfServerSessionNegotiator.getHostName(socketAddress)
+                        .getValue());
+
+        socketAddress = new InetSocketAddress("TestPortInet", 20);
+
+        assertEquals(socketAddress.getHostName(),
+                NetconfServerSessionNegotiator.getHostName(socketAddress)
+                        .getValue());
+
+        assertEquals(String.valueOf(socketAddress.getPort()),
+                NetconfServerSessionNegotiator.getHostName(socketAddress)
+                        .getKey());
+
+        LocalAddress localAddress = new LocalAddress("TestPortLocal");
+
+        assertEquals(String.valueOf(localAddress.id()),
+                NetconfServerSessionNegotiator.getHostName(localAddress)
+                        .getValue());
+
+        SshdSocketAddress embeddedAddress = new SshdSocketAddress(
+                "TestSshdName", 10);
+
+    }
+}
\ No newline at end of file
index 5d9470750e54053423b8bb871192fafedf9bf53b..51dfa4b1a8df3ed9a785c468ec38b8ddfc5136f7 100644 (file)
@@ -36,7 +36,7 @@ public class SubtreeFilterTest {
     @Parameters
     public static Collection<Object[]> data() {
         List<Object[]> result = new ArrayList<>();
-        for (int i = 0; i <= 9; i++) {
+        for (int i = 0; i <= 10; i++) {
             result.add(new Object[]{i});
         }
         return result;
index 9470e6d09c9f0c4d24d989b77188e6d79f7db6bd..fd9295a4b365fe7908b8a330cd205ae5ba2fa62c 100644 (file)
@@ -34,9 +34,9 @@ public class NetconfImplActivatorTest {
     @Mock
     private Filter filter;
     @Mock
-    private ServiceReference reference;
+    private ServiceReference<?> reference;
     @Mock
-    private ServiceRegistration registration;
+    private ServiceRegistration<?> registration;
 
     @Before
     public void setUp() throws Exception {
@@ -44,7 +44,7 @@ public class NetconfImplActivatorTest {
         doReturn(filter).when(bundle).createFilter(anyString());
         doNothing().when(bundle).addServiceListener(any(ServiceListener.class), anyString());
 
-        ServiceReference[] refs = new ServiceReference[0];
+        ServiceReference<?>[] refs = new ServiceReference[0];
         doReturn(refs).when(bundle).getServiceReferences(anyString(), anyString());
         doReturn(Arrays.asList(refs)).when(bundle).getServiceReferences(any(Class.class), anyString());
         doReturn("").when(bundle).getProperty(anyString());
index 374e8aeb9fe78977f9b7c7dd4175938cb1e23668..0d7158aa21de7fc02d69d85697f6031abbba6cfa 100644 (file)
@@ -32,7 +32,7 @@ public class NetconfOperationServiceFactoryTrackerTest {
     @Mock
     private NetconfOperationServiceFactory factory;
     @Mock
-    private ServiceReference reference;
+    private ServiceReference<NetconfOperationServiceFactory> reference;
 
     private NetconfOperationServiceFactoryTracker tracker;
 
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/10/post-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/10/post-filter.xml
new file mode 100644 (file)
index 0000000..3331cb8
--- /dev/null
@@ -0,0 +1,47 @@
+<!--
+  ~ 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
+  -->
+
+<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-10">
+    <data>
+        <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+            <module>
+                <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">prefix:sal-netconf-connector</type>
+                <name>controller-config</name>
+                <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">1830</port>
+                <connection-timeout-millis xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">20000</connection-timeout-millis>
+                <between-attempts-timeout-millis xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">2000</between-attempts-timeout-millis>
+                <sleep-factor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">1.5</sleep-factor>
+                <password xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</password>
+                <dom-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
+                    <name>dom-broker</name>
+                </dom-registry>
+                <client-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">prefix:netconf-client-dispatcher</type>
+                    <name>global-netconf-dispatcher</name>
+                </client-dispatcher>
+                <username xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</username>
+                <address xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">127.0.0.1</address>
+                <processing-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
+                    <name>global-netconf-processing-executor</name>
+                </processing-executor>
+                <tcp-only xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">false</tcp-only>
+                <binding-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-broker-osgi-registry</type>
+                    <name>binding-osgi-broker</name>
+                </binding-registry>
+                <max-connection-attempts xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">0</max-connection-attempts>
+                <event-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
+                    <name>global-event-executor</name>
+                </event-executor>
+            </module>
+        </modules>
+    </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/10/pre-filter.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/10/pre-filter.xml
new file mode 100644 (file)
index 0000000..f2620bb
--- /dev/null
@@ -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
+  -->
+
+<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-10">
+    <data>
+        <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+            <module>
+                <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">prefix:sal-netconf-connector</type>
+                <name>controller-config</name>
+                <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">1830</port>
+                <connection-timeout-millis xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">20000</connection-timeout-millis>
+                <between-attempts-timeout-millis xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">2000</between-attempts-timeout-millis>
+                <sleep-factor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">1.5</sleep-factor>
+                <password xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</password>
+                <dom-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
+                    <name>dom-broker</name>
+                </dom-registry>
+                <client-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">prefix:netconf-client-dispatcher</type>
+                    <name>global-netconf-dispatcher</name>
+                </client-dispatcher>
+                <username xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</username>
+                <address xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">127.0.0.1</address>
+                <processing-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
+                    <name>global-netconf-processing-executor</name>
+                </processing-executor>
+                <tcp-only xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">false</tcp-only>
+                <binding-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-broker-osgi-registry</type>
+                    <name>binding-osgi-broker</name>
+                </binding-registry>
+                <max-connection-attempts xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">0</max-connection-attempts>
+                <event-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
+                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
+                    <name>global-event-executor</name>
+                </event-executor>
+            </module>
+            <module>
+                <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:shutdown:impl">prefix:shutdown</type>
+                <name>shutdown</name>
+                <secret xmlns="urn:opendaylight:params:xml:ns:yang:controller:shutdown:impl"/>
+            </module>
+        </modules>
+    </data>
+</rpc-reply>
\ No newline at end of file
diff --git a/opendaylight/netconf/netconf-impl/src/test/resources/subtree/10/request.xml b/opendaylight/netconf/netconf-impl/src/test/resources/subtree/10/request.xml
new file mode 100644 (file)
index 0000000..259b123
--- /dev/null
@@ -0,0 +1,15 @@
+<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-9">
+    <get-config>
+        <source>
+            <running/>
+        </source>
+        <filter xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0" a:type="subtree">
+            <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+                <module>
+                    <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">x:sal-netconf-connector</type>
+                    <name>controller-config</name>
+                </module>
+            </modules>
+        </filter>
+    </get-config>
+</rpc>
diff --git a/pom.xml b/pom.xml
index d1e5494b44cd6409adc99da6b5daf9e6af2bbc4b..87a69e00c983bd5da9a232b7a2ace8327bfea792 100644 (file)
--- a/pom.xml
+++ b/pom.xml
     <maven>3.0</maven>
   </prerequisites>
   <modules>
-    <module>opendaylight/distribution/opendaylight</module>
-
-    <!-- third-parties uncomment them if you need snapshot version of it -->
-    <!-- <module>third-party/openflowj</module> -->
-    <!-- <module>third-party/net.sf.jung2</module> -->
-    <!-- <module>third-party/jersey-servlet</module> -->
-    <!-- <module>third-party/org.apache.catalina.filters.CorsFilter</module> -->
-
-    <module>third-party/commons/thirdparty</module>
 
     <!-- md-sal -->
     <module>opendaylight/md-sal</module>
     <tag>HEAD</tag>
     <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
   </scm>
-
-  <profiles>
-    <profile>
-      <id>integrationtests</id>
-      <activation>
-        <activeByDefault>false</activeByDefault>
-      </activation>
-      <modules>
-        <module>opendaylight/distribution/sanitytest/</module>
-      </modules>
-    </profile>
-  </profiles>
 </project>
diff --git a/third-party/commons/thirdparty/pom.xml b/third-party/commons/thirdparty/pom.xml
deleted file mode 100644 (file)
index ad3c275..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <prerequisites>
-    <maven>3.0</maven>
-  </prerequisites>
-  <groupId>org.opendaylight.controller</groupId>
-  <artifactId>commons.thirdparty</artifactId>
-  <version>1.2.0-SNAPSHOT</version>
-  <packaging>pom</packaging>
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
-    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
-    <tag>HEAD</tag>
-  </scm>
-
-  <properties>
-    <sonar.host.url>https://sonar.opendaylight.org/</sonar.host.url>
-    <nexusproxy>http://nexus.opendaylight.org/content</nexusproxy>
-    <nexus.repository.release>opendaylight.release</nexus.repository.release>
-    <nexus.repository.snapshot>opendaylight.snapshot</nexus.repository.snapshot>
-    <sitedeploy>dav:http://nexus.opendaylight.org/content/sites/site</sitedeploy>
-    <siteplugin>3.2</siteplugin>
-    <projectinfo>2.6</projectinfo>
-    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <compiler.version>2.3.2</compiler.version>
-    <surefire.version>2.13</surefire.version>
-    <releaseplugin.version>2.3.2</releaseplugin.version>
-    <enforcer.version>1.3.1</enforcer.version>
-    <bundle.plugin.version>2.3.7</bundle.plugin.version>
-  </properties>
-
-  <pluginRepositories>
-    <pluginRepository>
-      <id>central2</id>
-      <name>central2</name>
-      <url>http://repo2.maven.org/maven2</url>
-    </pluginRepository>
-  </pluginRepositories>
-
-  <profiles>
-    <profile>
-      <id>fastreassembly</id>
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-dependency-plugin</artifactId>
-            <version>2.4</version>
-            <executions>
-              <execution>
-                <id>copyfastreassembly</id>
-                <phase>install</phase>
-                <goals>
-                  <goal>copy</goal>
-                </goals>
-                <configuration>
-                  <artifactItems>
-                    <artifactItem>
-                      <groupId>${project.groupId}</groupId>
-                      <artifactId>${project.artifactId}</artifactId>
-                      <version>${project.version}</version>
-                      <destFileName>${project.groupId}.${project.artifactId}-${project.version}.jar</destFileName>
-                    </artifactItem>
-                  </artifactItems>
-                  <outputDirectory>${fastreassembly.directory}</outputDirectory>
-                </configuration>
-              </execution>
-            </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-  </profiles>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>com.googlecode.maven-java-formatter-plugin</groupId>
-        <artifactId>maven-java-formatter-plugin</artifactId>
-        <version>0.3.1</version>
-        <configuration>
-          <excludes>
-            <exclude>**/*</exclude>
-          </excludes>
-        </configuration>
-      </plugin>
-    </plugins>
-    <pluginManagement>
-      <plugins>
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-release-plugin</artifactId>
-          <version>${releaseplugin.version}</version>
-        </plugin>
-        <plugin>
-          <groupId>org.apache.felix</groupId>
-          <artifactId>maven-bundle-plugin</artifactId>
-          <version>${bundle.plugin.version}</version>
-          <extensions>true</extensions>
-        </plugin>
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-site-plugin</artifactId>
-          <version>${siteplugin}</version>
-          <configuration>
-            <reportPlugins>
-              <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-project-info-reports-plugin</artifactId>
-                <version>${projectinfo}</version>
-                <configuration>
-                  <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
-                  <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
-                </configuration>
-                <reports>
-                  <report>index</report>
-                  <report>project-team</report>
-                  <report>license</report>
-                  <report>mailing-list</report>
-                  <report>plugin-management</report>
-                  <report>cim</report>
-                  <report>issue-tracking</report>
-                  <report>scm</report>
-                  <report>summary</report>
-                </reports>
-              </plugin>
-              <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-checkstyle-plugin</artifactId>
-                <version>2.10</version>
-              </plugin>
-              <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-javadoc-plugin</artifactId>
-                <version>2.8.1</version>
-                <configuration>
-                  <doclet>org.jboss.apiviz.APIviz</doclet>
-                  <docletArtifact>
-                    <groupId>org.jboss.apiviz</groupId>
-                    <artifactId>apiviz</artifactId>
-                    <version>1.3.2.GA</version>
-                  </docletArtifact>
-                  <finalName>${project.artifactId}-${build.suffix}</finalName>
-                  <useStandardDocletOptions>true</useStandardDocletOptions>
-                  <charset>UTF-8</charset>
-                  <encoding>UTF-8</encoding>
-                  <docencoding>UTF-8</docencoding>
-                  <breakiterator>true</breakiterator>
-                  <version>true</version>
-                  <author>true</author>
-                  <keywords>true</keywords>
-                  <excludePackageNames>net.sf.jnetlib.*:cern.*:corejava</excludePackageNames>
-                </configuration>
-              </plugin>
-              <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jxr-plugin</artifactId>
-                <version>2.3</version>
-                <configuration>
-                  <aggregate>true</aggregate>
-                  <linkJavadoc>true</linkJavadoc>
-                </configuration>
-              </plugin>
-            </reportPlugins>
-          </configuration>
-        </plugin>
-      </plugins>
-    </pluginManagement>
-  </build>
-
-  <repositories>
-    <repository>
-      <id>central2</id>
-      <name>central2</name>
-      <url>http://repo2.maven.org/maven2</url>
-      <snapshots>
-          <enabled>false</enabled>
-      </snapshots>
-      <releases>
-          <updatePolicy>never</updatePolicy>
-          <enabled>true</enabled>
-      </releases>
-    </repository>
-    <repository>
-      <id>central</id>
-      <name>central</name>
-      <url>http://repo1.maven.org/maven2</url>
-      <snapshots>
-           <enabled>false</enabled>
-      </snapshots>
-      <releases>
-          <updatePolicy>never</updatePolicy>
-          <enabled>true</enabled>
-      </releases>
-    </repository>
-    <!-- Third Packages hosted in local maven because not available in
-         other places -->
-    <repository>
-      <id>thirdparty</id>
-      <name>thirdparty</name>
-      <url>${nexusproxy}/repositories/thirdparty</url>
-      <snapshots>
-          <enabled>false</enabled>
-      </snapshots>
-      <releases>
-          <updatePolicy>never</updatePolicy>
-          <enabled>true</enabled>
-       </releases>
-    </repository>
-  </repositories>
-  <distributionManagement>
-    <!-- OpenDayLight Released artifact -->
-    <repository>
-      <id>opendaylight-release</id>
-      <url>${nexusproxy}/repositories/${nexus.repository.release}/</url>
-    </repository>
-    <!-- OpenDayLight Snapshot artifact -->
-    <snapshotRepository>
-      <id>opendaylight-snapshot</id>
-      <url>${nexusproxy}/repositories/${nexus.repository.snapshot}/</url>
-    </snapshotRepository>
-    <!-- Site deployment -->
-    <site>
-      <id>website</id>
-      <url>${sitedeploy}</url>
-    </site>
-  </distributionManagement>
-</project>
diff --git a/third-party/jersey-servlet/pom.xml b/third-party/jersey-servlet/pom.xml
deleted file mode 100644 (file)
index 27d503e..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <!-- Get some common settings for the project we are using it in -->
-  <parent>
-    <groupId>org.opendaylight.controller</groupId>
-    <artifactId>commons.thirdparty</artifactId>
-    <version>1.2.0-SNAPSHOT</version>
-    <relativePath>../commons/thirdparty</relativePath>
-  </parent>
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
-    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
-    <tag>HEAD</tag>
-  </scm>
-
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.opendaylight.controller.thirdparty</groupId>
-  <artifactId>com.sun.jersey.jersey-servlet</artifactId>
-  <version>1.19.0-SNAPSHOT</version>
-  <packaging>bundle</packaging>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <version>2.3.6</version>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Embed-Dependency>*;scope=!provided;type=!pom;inline=false</Embed-Dependency>
-            <Embed-Transitive>false</Embed-Transitive>
-            <Export-Package>
-              com.sun.jersey.api.core.servlet,
-              com.sun.jersey.spi.container.servlet,
-              com.sun.jersey.spi.scanning.servlet,
-              com.sun.jersey.server.impl.container.servlet
-            </Export-Package>
-            <Import-Package>
-              com.sun.jersey.api.container,
-              com.sun.jersey.api.core,
-              com.sun.jersey.api.model,
-              com.sun.jersey.api.representation,
-              com.sun.jersey.api.uri,
-              com.sun.jersey.api.view,
-              com.sun.jersey.core.header,
-              com.sun.jersey.core.reflection,
-              com.sun.jersey.core.spi.component,
-              com.sun.jersey.core.spi.component.ioc,
-              com.sun.jersey.core.spi.scanning,
-              com.sun.jersey.core.util,
-              com.sun.jersey.server.impl,
-              com.sun.jersey.server.impl.application,
-              com.sun.jersey.server.impl.inject,
-              com.sun.jersey.server.impl.monitoring,
-              com.sun.jersey.server.probes,
-              com.sun.jersey.server.spi.component,
-              com.sun.jersey.spi,
-              com.sun.jersey.spi.container,
-              com.sun.jersey.spi.dispatch,
-              com.sun.jersey.spi.inject,
-              com.sun.jersey.spi.service,
-              com.sun.jersey.spi.template,
-              javax.naming,
-              javax.ws.rs,
-              javax.ws.rs.core,
-              javax.ws.rs.ext,
-              *;resolution:=optional
-            </Import-Package>
-          </instructions>
-          <manifestLocation>${project.basedir}/META-INF</manifestLocation>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-
-  <dependencies>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-servlet</artifactId>
-      <version>1.17</version>
-    </dependency>
-    <dependency>
-      <groupId>equinoxSDK381</groupId>
-      <artifactId>javax.servlet</artifactId>
-      <version>3.0.0.v201112011016</version>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
-</project>
diff --git a/third-party/net.sf.jung2/pom.xml b/third-party/net.sf.jung2/pom.xml
deleted file mode 100644 (file)
index 63455dc..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <!-- Get some common settings for the project we are using it in -->
-  <parent>
-    <groupId>org.opendaylight.controller</groupId>
-    <artifactId>commons.thirdparty</artifactId>
-    <version>1.2.0-SNAPSHOT</version>
-    <relativePath>../commons/thirdparty</relativePath>
-  </parent>
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
-    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
-    <tag>HEAD</tag>
-  </scm>
-
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.opendaylight.controller.thirdparty</groupId>
-  <artifactId>net.sf.jung2</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
-  <packaging>bundle</packaging>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <version>2.3.6</version>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Embed-Dependency>*;scope=compile|runtime;type=!pom;inline=false</Embed-Dependency>
-            <Embed-Transitive>false</Embed-Transitive>
-            <Export-Package>
-              org.apache.commons*,
-              edu.uci.ics.jung.algorithms.blockmodel,
-              edu.uci.ics.jung.algorithms.cluster,
-              edu.uci.ics.jung.algorithms.filters,
-              edu.uci.ics.jung.algorithms.flows,
-              edu.uci.ics.jung.algorithms.generators,
-              edu.uci.ics.jung.algorithms.generators.random,
-              edu.uci.ics.jung.algorithms.layout,
-              edu.uci.ics.jung.algorithms.layout.util,
-              edu.uci.ics.jung.algorithms.metrics,
-              edu.uci.ics.jung.algorithms.scoring,
-              edu.uci.ics.jung.algorithms.scoring.util,
-              edu.uci.ics.jung.algorithms.shortestpath,
-              edu.uci.ics.jung.algorithms.transformation,
-              edu.uci.ics.jung.algorithms.util,
-              edu.uci.ics.jung.graph;-split-package:=merge-first,
-              edu.uci.ics.jung.graph.event,
-              edu.uci.ics.jung.graph.util;-split-package:=merge-first
-            </Export-Package>
-            <Import-Package>
-              !*
-            </Import-Package>
-          </instructions>
-          <manifestLocation>${project.basedir}/META-INF</manifestLocation>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-
-  <dependencies>
-    <dependency>
-      <groupId>net.sf.jung</groupId>
-      <artifactId>jung-api</artifactId>
-      <version>2.0.1</version>
-    </dependency>
-    <dependency>
-      <groupId>net.sf.jung</groupId>
-      <artifactId>jung-graph-impl</artifactId>
-      <version>2.0.1</version>
-    </dependency>
-    <dependency>
-      <groupId>net.sourceforge.collections</groupId>
-      <artifactId>collections-generic</artifactId>
-      <version>4.01</version>
-    </dependency>
-  </dependencies>
-</project>
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/blockmodel/StructurallyEquivalent.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/blockmodel/StructurallyEquivalent.java
deleted file mode 100644 (file)
index a9d4573..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright (c) 2004, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- * Created on Jan 28, 2004
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.blockmodel;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.collections15.CollectionUtils;
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.util.Pair;
-
-/**
- * Identifies sets of structurally equivalent vertices in a graph. Vertices <i>
- * i</i> and <i>j</i> are structurally equivalent iff the set of <i>i</i>'s
- * neighbors is identical to the set of <i>j</i>'s neighbors, with the
- * exception of <i>i</i> and <i>j</i> themselves. This algorithm finds all
- * sets of equivalent vertices in O(V^2) time.
- * 
- * <p>You can extend this class to have a different definition of equivalence (by
- * overriding <code>isStructurallyEquivalent</code>), and may give it hints for
- * accelerating the process by overriding <code>canPossiblyCompare</code>. 
- * (For example, in a bipartite graph, <code>canPossiblyCompare</code> may 
- * return <code>false</code> for vertices in
- * different partitions. This function should be fast.)
- * 
- * @author Danyel Fisher
- */
-public class StructurallyEquivalent<V,E> implements Transformer<Graph<V,E>, VertexPartition<V,E>> 
-{
-       public VertexPartition<V,E> transform(Graph<V,E> g) 
-       {
-           Set<Pair<V>> vertex_pairs = getEquivalentPairs(g);
-           
-           Set<Set<V>> rv = new HashSet<Set<V>>();
-        Map<V, Set<V>> intermediate = new HashMap<V, Set<V>>();
-        for (Pair<V> p : vertex_pairs)
-        {
-            Set<V> res = intermediate.get(p.getFirst());
-            if (res == null)
-                res = intermediate.get(p.getSecond());
-            if (res == null)  // we haven't seen this one before
-                res = new HashSet<V>();
-            res.add(p.getFirst());
-            res.add(p.getSecond());
-            intermediate.put(p.getFirst(), res);
-            intermediate.put(p.getSecond(), res);
-        }
-        rv.addAll(intermediate.values());
-
-        // pick up the vertices which don't appear in intermediate; they are
-        // singletons (equivalence classes of size 1)
-        Collection<V> singletons = CollectionUtils.subtract(g.getVertices(),
-                intermediate.keySet());
-        for (V v : singletons)
-        {
-            Set<V> v_set = Collections.singleton(v);
-            intermediate.put(v, v_set);
-            rv.add(v_set);
-        }
-
-        return new VertexPartition<V, E>(g, intermediate, rv);
-       }
-
-       /**
-        * For each vertex pair v, v1 in G, checks whether v and v1 are fully
-        * equivalent: meaning that they connect to the exact same vertices. (Is
-        * this regular equivalence, or whathaveyou?)
-        * 
-        * Returns a Set of Pairs of vertices, where all the vertices in the inner
-        * Pairs are equivalent.
-        * 
-        * @param g
-        */
-       protected Set<Pair<V>> getEquivalentPairs(Graph<V,?> g) {
-
-               Set<Pair<V>> rv = new HashSet<Pair<V>>();
-               Set<V> alreadyEquivalent = new HashSet<V>();
-
-               List<V> l = new ArrayList<V>(g.getVertices());
-
-               for (V v1 : l)
-               {
-                       if (alreadyEquivalent.contains(v1))
-                               continue;
-
-                       for (Iterator<V> iterator = l.listIterator(l.indexOf(v1) + 1); iterator.hasNext();) {
-                           V v2 = iterator.next();
-
-                               if (alreadyEquivalent.contains(v2))
-                                       continue;
-
-                               if (!canPossiblyCompare(v1, v2))
-                                       continue;
-
-                               if (isStructurallyEquivalent(g, v1, v2)) {
-                                       Pair<V> p = new Pair<V>(v1, v2);
-                                       alreadyEquivalent.add(v2);
-                                       rv.add(p);
-                               }
-                       }
-               }
-               
-               return rv;
-       }
-
-       /**
-        * Checks whether a pair of vertices are structurally equivalent.
-        * Specifically, whether v1's predecessors are equal to v2's predecessors,
-        * and same for successors.
-        * 
-        * @param g the graph in which the structural equivalence comparison is to take place
-        * @param v1 the vertex to check for structural equivalence to v2
-        * @param v2 the vertex to check for structural equivalence to v1
-        */
-       protected boolean isStructurallyEquivalent(Graph<V,?> g, V v1, V v2) {
-               
-               if( g.degree(v1) != g.degree(v2)) {
-                       return false;
-               }
-
-               Set<V> n1 = new HashSet<V>(g.getPredecessors(v1));
-               n1.remove(v2);
-               n1.remove(v1);
-               Set<V> n2 = new HashSet<V>(g.getPredecessors(v2));
-               n2.remove(v1);
-               n2.remove(v2);
-
-               Set<V> o1 = new HashSet<V>(g.getSuccessors(v1));
-               Set<V> o2 = new HashSet<V>(g.getSuccessors(v2));
-               o1.remove(v1);
-               o1.remove(v2);
-               o2.remove(v1);
-               o2.remove(v2);
-
-               // this neglects self-loops and directed edges from 1 to other
-               boolean b = (n1.equals(n2) && o1.equals(o2));
-               if (!b)
-                       return b;
-               
-               // if there's a directed edge v1->v2 then there's a directed edge v2->v1
-               b &= ( g.isSuccessor(v1, v2) == g.isSuccessor(v2, v1));
-               
-               // self-loop check
-               b &= ( g.isSuccessor(v1, v1) == g.isSuccessor(v2, v2));
-
-               return b;
-
-       }
-
-       /**
-        * This is a space for optimizations. For example, for a bipartite graph,
-        * vertices from different partitions cannot possibly be compared.
-        * 
-        * @param v1
-        * @param v2
-        */
-       protected boolean canPossiblyCompare(V v1, V v2) {
-               return true;
-       }
-
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/blockmodel/VertexPartition.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/blockmodel/VertexPartition.java
deleted file mode 100644 (file)
index b5ec583..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-/*
- * Created on Feb 3, 2004
- */
-package edu.uci.ics.jung.algorithms.blockmodel;
-
-import java.util.*;
-
-import edu.uci.ics.jung.graph.Graph;
-
-
-/**
- * Maintains information about a vertex partition of a graph.
- * This can be built from a map from vertices to vertex sets 
- * or from a collection of (disjoint) vertex sets,
- * such as those created by various clustering methods.
- */
-public class VertexPartition<V,E> 
-{
-       private Map<V,Set<V>> vertex_partition_map;
-       private Collection<Set<V>> vertex_sets;
-       private Graph<V,E> graph;
-       
-       /**
-        * Creates an instance based on the specified graph and mapping from vertices
-        * to vertex sets, and generates a set of partitions based on this mapping.
-        * @param g the graph over which the vertex partition is defined
-        * @param partition_map the mapping from vertices to vertex sets (partitions)
-        */
-       public VertexPartition(Graph<V,E> g, Map<V, Set<V>> partition_map) 
-       {
-               this.vertex_partition_map = Collections.unmodifiableMap(partition_map);
-               this.graph = g;
-       }
-
-       /**
-     * Creates an instance based on the specified graph, vertex-set mapping, 
-     * and set of disjoint vertex sets.  The vertex-set mapping and vertex 
-     * partitions must be consistent; that is, the mapping must reflect the 
-     * division of vertices into partitions, and each vertex must appear in 
-     * exactly one partition.
-     * @param g the graph over which the vertex partition is defined
-     * @param partition_map the mapping from vertices to vertex sets (partitions)
-        * @param vertex_sets the set of disjoint vertex sets 
-        */
-    public VertexPartition(Graph<V,E> g, Map<V, Set<V>> partition_map, 
-               Collection<Set<V>> vertex_sets) 
-    {
-        this.vertex_partition_map = Collections.unmodifiableMap(partition_map);
-        this.vertex_sets = vertex_sets;
-        this.graph = g;
-    }
-
-    /**
-     * Creates an instance based on the specified graph and set of disjoint vertex sets, 
-     * and generates a vertex-to-partition map based on these sets.
-     * @param g the graph over which the vertex partition is defined
-     * @param vertex_sets the set of disjoint vertex sets
-     */
-    public VertexPartition(Graph<V,E> g, Collection<Set<V>> vertex_sets)
-    {
-        this.vertex_sets = vertex_sets;
-        this.graph = g;
-    }
-       
-    /**
-     * Returns the graph on which the partition is defined.
-     * @return the graph on which the partition is defined
-     */
-       public Graph<V,E> getGraph() 
-       {
-               return graph;
-       }
-
-       /**
-        * Returns a map from each vertex in the input graph to its partition.
-        * This map is generated if it does not already exist.
-        * @return a map from each vertex in the input graph to a vertex set
-        */
-       public Map<V,Set<V>> getVertexToPartitionMap() 
-       {
-               if (vertex_partition_map == null)
-               {
-               this.vertex_partition_map = new HashMap<V, Set<V>>();
-               for (Set<V> set : this.vertex_sets)
-                   for (V v : set)
-                       this.vertex_partition_map.put(v, set);
-               }
-               return vertex_partition_map;
-       }
-       
-       /**
-        * Returns a collection of vertex sets, where each vertex in the 
-        * input graph is in exactly one set.
-        * This collection is generated based on the vertex-to-partition map 
-        * if it does not already exist.
-        * @return a collection of vertex sets such that each vertex in the 
-        * instance's graph is in exactly one set
-        */
-       public Collection<Set<V>> getVertexPartitions() 
-       {
-               if (vertex_sets == null)
-               {
-                       this.vertex_sets = new HashSet<Set<V>>();
-                       this.vertex_sets.addAll(vertex_partition_map.values());
-               }
-           return vertex_sets;
-       }
-
-       /**
-        * Returns the number of partitions.
-        */
-       public int numPartitions() 
-       {
-               return vertex_sets.size();
-       }
-       
-       @Override
-       public String toString() 
-       {
-               return "Partitions: " + vertex_partition_map;
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/blockmodel/package.html b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/blockmodel/package.html
deleted file mode 100644 (file)
index d1cb06a..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-  @(#)package.html
-
- Copyright © 2003 The Regents of the University of California. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies. This software program and documentation are copyrighted by The Regents of the University of California ("The University of California").
-
-THE SOFTWARE PROGRAM AND DOCUMENTATION ARE SUPPLIED "AS IS," WITHOUT ANY ACCOMPANYING SERVICES FROM THE UNIVERSITY OF CALFORNIA. FURTHERMORE, THE UNIVERSITY OF CALIFORNIA DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED OR ERROR-FREE. THE END-USER UNDERSTANDS THAT THE PROGRAM WAS DEVELOPED FOR RESEARCH PURPOSES AND IS ADVISED NOT TO RELY EXCLUSIVELY ON THE PROGRAM FOR ANY REASON.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
--->
-</head>
-<body>
-
-Support for establishing and maintaining graph element equivalence (such as in blockmodeling).
-<P/>
-In blockmodeling, groups of vertices are clustered together by similarity 
-(as if members of a "block" appearing on the diagonal of the graph's adjacency 
-matrix).
-<p/>
-This support currently includes:
-<ul>
-<li/><code>VertexPartition</code>: A class that maintains information on a 
-division of the vertices of a graph into disjoint sets.
-<li/><code>StructurallyEquivalent</code>: An algorithm that finds sets of vertices that are 
-structurally equivalent.
-</ul> 
-
-<p/>
-</body>
-</html>
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/cluster/BicomponentClusterer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/cluster/BicomponentClusterer.java
deleted file mode 100644 (file)
index aa697c7..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.cluster;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.Stack;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.graph.UndirectedGraph;
-
-/**
- * Finds all biconnected components (bicomponents) of an undirected graph.  
- * A graph is a biconnected component if 
- * at least 2 vertices must be removed in order to disconnect the graph.  (Graphs 
- * consisting of one vertex, or of two connected vertices, are also biconnected.)  Biconnected
- * components of three or more vertices have the property that every pair of vertices in the component
- * are connected by two or more vertex-disjoint paths.
- * <p>
- * Running time: O(|V| + |E|) where |V| is the number of vertices and |E| is the number of edges
- * @see "Depth first search and linear graph algorithms by R. E. Tarjan (1972), SIAM J. Comp."
- * 
- * @author Joshua O'Madadhain
- */
-public class BicomponentClusterer<V,E> implements Transformer<UndirectedGraph<V,E>, Set<Set<V>>> 
-{
-    protected Map<V,Number> dfs_num;
-    protected Map<V,Number> high;
-    protected Map<V,V> parents;
-    protected Stack<E> stack;
-    protected int converse_depth;
-
-    /**
-     * Constructs a new bicomponent finder
-     */
-    public BicomponentClusterer() {
-    }
-
-    /**
-    * Extracts the bicomponents from the graph.
-    * @param theGraph the graph whose bicomponents are to be extracted
-    * @return the <code>ClusterSet</code> of bicomponents
-    */
-    public Set<Set<V>> transform(UndirectedGraph<V,E> theGraph) 
-    {
-       Set<Set<V>> bicomponents = new LinkedHashSet<Set<V>>();
-
-        if (theGraph.getVertices().isEmpty())
-            return bicomponents;
-
-        // initialize DFS number for each vertex to 0
-        dfs_num = new HashMap<V,Number>();
-        for (V v : theGraph.getVertices())
-        {
-               dfs_num.put(v, 0);
-        }
-
-        for (V v : theGraph.getVertices())
-        {
-            if (dfs_num.get(v).intValue() == 0) // if we haven't hit this vertex yet...
-            {
-                high = new HashMap<V,Number>();
-                stack = new Stack<E>();
-                parents = new HashMap<V,V>();
-                converse_depth = theGraph.getVertexCount();
-                // find the biconnected components for this subgraph, starting from v
-                findBiconnectedComponents(theGraph, v, bicomponents);
-                
-                // if we only visited one vertex, this method won't have
-                // ID'd it as a biconnected component, so mark it as one
-                if (theGraph.getVertexCount() - converse_depth == 1)
-                {
-                    Set<V> s = new HashSet<V>();
-                    s.add(v);
-                    bicomponents.add(s);
-                }
-            }
-        }
-        
-        return bicomponents;
-    }
-
-    /**
-     * <p>Stores, in <code>bicomponents</code>, all the biconnected
-     * components that are reachable from <code>v</code>.</p>
-     * 
-     * <p>The algorithm basically proceeds as follows: do a depth-first
-     * traversal starting from <code>v</code>, marking each vertex with
-     * a value that indicates the order in which it was encountered (dfs_num), 
-     * and with
-     * a value that indicates the highest point in the DFS tree that is known
-     * to be reachable from this vertex using non-DFS edges (high).  (Since it
-     * is measured on non-DFS edges, "high" tells you how far back in the DFS
-     * tree you can reach by two distinct paths, hence biconnectivity.) 
-     * Each time a new vertex w is encountered, push the edge just traversed
-     * on a stack, and call this method recursively.  If w.high is no greater than
-     * v.dfs_num, then the contents of the stack down to (v,w) is a 
-     * biconnected component (and v is an articulation point, that is, a 
-     * component boundary).  In either case, set v.high to max(v.high, w.high), 
-     * and continue.  If w has already been encountered but is 
-     * not v's parent, set v.high max(v.high, w.dfs_num) and continue. 
-     * 
-     * <p>(In case anyone cares, the version of this algorithm on p. 224 of 
-     * Udi Manber's "Introduction to Algorithms: A Creative Approach" seems to be
-     * wrong: the stack should be initialized outside this method, 
-     * (v,w) should only be put on the stack if w hasn't been seen already,
-     * and there's no real benefit to putting v on the stack separately: just
-     * check for (v,w) on the stack rather than v.  Had I known this, I could
-     * have saved myself a few days.  JRTOM)</p>
-     * 
-     */
-    protected void findBiconnectedComponents(UndirectedGraph<V,E> g, V v, Set<Set<V>> bicomponents)
-    {
-        int v_dfs_num = converse_depth;
-        dfs_num.put(v, v_dfs_num);
-        converse_depth--;
-        high.put(v, v_dfs_num);
-
-        for (V w : g.getNeighbors(v))
-        {
-            int w_dfs_num = dfs_num.get(w).intValue();//get(w, dfs_num);
-            E vw = g.findEdge(v,w);
-            if (w_dfs_num == 0) // w hasn't yet been visited
-            {
-                parents.put(w, v); // v is w's parent in the DFS tree
-                stack.push(vw);
-                findBiconnectedComponents(g, w, bicomponents);
-                int w_high = high.get(w).intValue();//get(w, high);
-                if (w_high <= v_dfs_num)
-                {
-                    // v disconnects w from the rest of the graph,
-                    // i.e., v is an articulation point
-                    // thus, everything between the top of the stack and
-                    // v is part of a single biconnected component
-                    Set<V> bicomponent = new HashSet<V>();
-                    E e;
-                    do
-                    {
-                        e = stack.pop();
-                        bicomponent.addAll(g.getIncidentVertices(e));
-                    }
-                    while (e != vw);
-                    bicomponents.add(bicomponent);
-                }
-                high.put(v, Math.max(w_high, high.get(v).intValue()));
-            }
-            else if (w != parents.get(v)) // (v,w) is a back or a forward edge
-               high.put(v, Math.max(w_dfs_num, high.get(v).intValue()));
-        }
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/cluster/EdgeBetweennessClusterer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/cluster/EdgeBetweennessClusterer.java
deleted file mode 100644 (file)
index 59e4605..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.cluster;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.algorithms.scoring.BetweennessCentrality;
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.util.Pair;
-
-
-/**
- * An algorithm for computing clusters (community structure) in graphs based on edge betweenness.
- * The betweenness of an edge is defined as the extent to which that edge lies along 
- * shortest paths between all pairs of nodes.
- *
- * This algorithm works by iteratively following the 2 step process:
- * <ul>
- * <li> Compute edge betweenness for all edges in current graph
- * <li> Remove edge with highest betweenness
- * </ul>
- * <p>
- * Running time is: O(kmn) where k is the number of edges to remove, m is the total number of edges, and
- * n is the total number of vertices. For very sparse graphs the running time is closer to O(kn^2) and for
- * graphs with strong community structure, the complexity is even lower.
- * <p>
- * This algorithm is a slight modification of the algorithm discussed below in that the number of edges
- * to be removed is parameterized.
- * @author Scott White
- * @author Tom Nelson (converted to jung2)
- * @see "Community structure in social and biological networks by Michelle Girvan and Mark Newman"
- */
-public class EdgeBetweennessClusterer<V,E> implements Transformer<Graph<V,E>,Set<Set<V>>> {
-    private int mNumEdgesToRemove;
-    private Map<E, Pair<V>> edges_removed;
-
-   /**
-    * Constructs a new clusterer for the specified graph.
-    * @param numEdgesToRemove the number of edges to be progressively removed from the graph
-    */
-    public EdgeBetweennessClusterer(int numEdgesToRemove) {
-        mNumEdgesToRemove = numEdgesToRemove;
-        edges_removed = new LinkedHashMap<E, Pair<V>>();
-    }
-
-    /**
-    * Finds the set of clusters which have the strongest "community structure".
-    * The more edges removed the smaller and more cohesive the clusters.
-    * @param graph the graph
-    */
-    public Set<Set<V>> transform(Graph<V,E> graph) {
-                
-        if (mNumEdgesToRemove < 0 || mNumEdgesToRemove > graph.getEdgeCount()) {
-            throw new IllegalArgumentException("Invalid number of edges passed in.");
-        }
-        
-        edges_removed.clear();
-
-        for (int k=0;k<mNumEdgesToRemove;k++) {
-            BetweennessCentrality<V,E> bc = new BetweennessCentrality<V,E>(graph);
-            E to_remove = null;
-            double score = 0;
-            for (E e : graph.getEdges())
-                if (bc.getEdgeScore(e) > score)
-                {
-                    to_remove = e;
-                    score = bc.getEdgeScore(e);
-                }
-            edges_removed.put(to_remove, graph.getEndpoints(to_remove));
-            graph.removeEdge(to_remove);
-        }
-
-        WeakComponentClusterer<V,E> wcSearch = new WeakComponentClusterer<V,E>();
-        Set<Set<V>> clusterSet = wcSearch.transform(graph);
-
-        for (Map.Entry<E, Pair<V>> entry : edges_removed.entrySet())
-        {
-            Pair<V> endpoints = entry.getValue();
-            graph.addEdge(entry.getKey(), endpoints.getFirst(), endpoints.getSecond());
-        }
-        return clusterSet;
-    }
-
-    /**
-     * Retrieves the list of all edges that were removed 
-     * (assuming extract(...) was previously called).  
-     * The edges returned
-     * are stored in order in which they were removed.
-     * 
-     * @return the edges in the original graph
-     */
-    public List<E> getEdgesRemoved() 
-    {
-        return new ArrayList<E>(edges_removed.keySet());
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/cluster/VoltageClusterer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/cluster/VoltageClusterer.java
deleted file mode 100644 (file)
index 859c063..0000000
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * Copyright (c) 2004, the JUNG Project and the Regents of the University
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- *
- * Created on Aug 12, 2004
- */
-package edu.uci.ics.jung.algorithms.cluster;
-
-import edu.uci.ics.jung.algorithms.scoring.VoltageScorer;
-import edu.uci.ics.jung.algorithms.util.DiscreteDistribution;
-import edu.uci.ics.jung.algorithms.util.KMeansClusterer;
-import edu.uci.ics.jung.algorithms.util.KMeansClusterer.NotEnoughClustersException;
-import edu.uci.ics.jung.graph.Graph;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.Set;
-
-/**
- * <p>Clusters vertices of a <code>Graph</code> based on their ranks as
- * calculated by <code>VoltageScorer</code>.  This algorithm is based on,
- * but not identical with, the method described in the paper below.
- * The primary difference is that Wu and Huberman assume a priori that the clusters
- * are of approximately the same size, and therefore use a more complex
- * method than k-means (which is used here) for determining cluster
- * membership based on co-occurrence data.</p>
- *
- * <p>The algorithm proceeds as follows:
- * <ul>
- * <li/>first, generate a set of candidate clusters as follows:
- *      <ul>
- *      <li/>pick (widely separated) vertex pair, run VoltageScorer
- *      <li/>group the vertices in two clusters according to their voltages
- *      <li/>store resulting candidate clusters
- *      </ul>
- * <li/>second, generate k-1 clusters as follows:
- *      <ul>
- *      <li/>pick a vertex v as a cluster 'seed'
- *           <br>(Wu/Huberman: most frequent vertex in candidate clusters)
- *      <li/>calculate co-occurrence over all candidate clusters of v with each other
- *           vertex
- *      <li/>separate co-occurrence counts into high/low;
- *           high vertices constitute a cluster
- *      <li/>remove v's vertices from candidate clusters; continue
- *      </ul>
- * <li/>finally, remaining unassigned vertices are assigned to the kth ("garbage")
- * cluster.
- * </ul></p>
- *
- * <p><b>NOTE</b>: Depending on how the co-occurrence data splits the data into
- * clusters, the number of clusters returned by this algorithm may be less than the
- * number of clusters requested.  The number of clusters will never be more than
- * the number requested, however.</p>
- *
- * @author Joshua O'Madadhain
- * @see "'Finding communities in linear time: a physics approach', Fang Wu and Bernardo Huberman, http://www.hpl.hp.com/research/idl/papers/linear/"
- * @see VoltageScorer
- * @see KMeansClusterer
- */
-public class VoltageClusterer<V,E>
-{
-    protected int num_candidates;
-    protected KMeansClusterer<V> kmc;
-    protected Random rand;
-    protected Graph<V,E> g;
-
-    /**
-     * Creates an instance of a VoltageCluster with the specified parameters.
-     * These are mostly parameters that are passed directly to VoltageScorer
-     * and KMeansClusterer.
-     *
-     * @param num_candidates    the number of candidate clusters to create
-     */
-    public VoltageClusterer(Graph<V,E> g, int num_candidates)
-    {
-        if (num_candidates < 1)
-            throw new IllegalArgumentException("must generate >=1 candidates");
-
-        this.num_candidates = num_candidates;
-        this.kmc = new KMeansClusterer<V>();
-        rand = new Random();
-        this.g = g;
-    }
-
-    protected void setRandomSeed(int random_seed)
-    {
-        rand = new Random(random_seed);
-    }
-
-    /**
-     * Returns a community (cluster) centered around <code>v</code>.
-     * @param v the vertex whose community we wish to discover
-     */
-    public Collection<Set<V>> getCommunity(V v)
-    {
-        return cluster_internal(v, 2);
-    }
-
-    /**
-     * Clusters the vertices of <code>g</code> into
-     * <code>num_clusters</code> clusters, based on their connectivity.
-     * @param num_clusters  the number of clusters to identify
-     */
-    public Collection<Set<V>> cluster(int num_clusters)
-    {
-        return cluster_internal(null, num_clusters);
-    }
-
-    /**
-     * Does the work of <code>getCommunity</code> and <code>cluster</code>.
-     * @param origin the vertex around which clustering is to be done
-     * @param num_clusters the (maximum) number of clusters to find
-     */
-    protected Collection<Set<V>> cluster_internal(V origin, int num_clusters)
-    {
-        // generate candidate clusters
-        // repeat the following 'samples' times:
-        // * pick (widely separated) vertex pair, run VoltageScorer
-        // * use k-means to identify 2 communities in ranked graph
-        // * store resulting candidate communities
-        ArrayList<V> v_array = new ArrayList<V>(g.getVertices());
-
-        LinkedList<Set<V>> candidates = new LinkedList<Set<V>>();
-
-        for (int j = 0; j < num_candidates; j++)
-        {
-            V source;
-            if (origin == null)
-                source = v_array.get((int)(rand.nextDouble() * v_array.size()));
-            else
-                source = origin;
-            V target = null;
-            do
-            {
-                target = v_array.get((int)(rand.nextDouble() * v_array.size()));
-            }
-            while (source == target);
-            VoltageScorer<V,E> vs = new VoltageScorer<V,E>(g, source, target);
-            vs.evaluate();
-
-            Map<V, double[]> voltage_ranks = new HashMap<V, double[]>();
-            for (V v : g.getVertices())
-                voltage_ranks.put(v, new double[] {vs.getVertexScore(v)});
-
-//            addOneCandidateCluster(candidates, voltage_ranks);
-            addTwoCandidateClusters(candidates, voltage_ranks);
-        }
-
-        // repeat the following k-1 times:
-        // * pick a vertex v as a cluster seed
-        //   (Wu/Huberman: most frequent vertex in candidates)
-        // * calculate co-occurrence (in candidate clusters)
-        //   of this vertex with all others
-        // * use k-means to separate co-occurrence counts into high/low;
-        //   high vertices are a cluster
-        // * remove v's vertices from candidate clusters
-
-        Collection<Set<V>> clusters = new LinkedList<Set<V>>();
-        Set<V> remaining = new HashSet<V>(g.getVertices());
-
-        List<V> seed_candidates = getSeedCandidates(candidates);
-        int seed_index = 0;
-
-        for (int j = 0; j < (num_clusters - 1); j++)
-        {
-            if (remaining.isEmpty())
-                break;
-
-            V seed;
-            if (seed_index == 0 && origin != null)
-                seed = origin;
-            else
-            {
-                do { seed = seed_candidates.get(seed_index++); }
-                while (!remaining.contains(seed));
-            }
-
-            Map<V, double[]> occur_counts = getObjectCounts(candidates, seed);
-            if (occur_counts.size() < 2)
-                break;
-
-            // now that we have the counts, cluster them...
-            try
-            {
-                Collection<Map<V, double[]>> high_low = kmc.cluster(occur_counts, 2);
-                // ...get the cluster with the highest-valued centroid...
-                Iterator<Map<V, double[]>> h_iter = high_low.iterator();
-                Map<V, double[]> cluster1 = h_iter.next();
-                Map<V, double[]> cluster2 = h_iter.next();
-                double[] centroid1 = DiscreteDistribution.mean(cluster1.values());
-                double[] centroid2 = DiscreteDistribution.mean(cluster2.values());
-                Set<V> new_cluster;
-                if (centroid1[0] >= centroid2[0])
-                    new_cluster = cluster1.keySet();
-                else
-                    new_cluster = cluster2.keySet();
-
-                // ...remove the elements of new_cluster from each candidate...
-                for (Set<V> cluster : candidates)
-                    cluster.removeAll(new_cluster);
-                clusters.add(new_cluster);
-                remaining.removeAll(new_cluster);
-            }
-            catch (NotEnoughClustersException nece)
-            {
-                // all remaining vertices are in the same cluster
-                break;
-            }
-        }
-
-        // identify remaining vertices (if any) as a 'garbage' cluster
-        if (!remaining.isEmpty())
-            clusters.add(remaining);
-
-        return clusters;
-    }
-
-    /**
-     * Do k-means with three intervals and pick the
-     * smaller two clusters (presumed to be on the ends); this is closer to the Wu-Huberman method.
-     * @param candidates
-     * @param voltage_ranks
-     */
-    protected void addTwoCandidateClusters(LinkedList<Set<V>> candidates,
-            Map<V, double[]> voltage_ranks)
-    {
-        try
-        {
-            List<Map<V, double[]>> clusters = new ArrayList<Map<V, double[]>>(kmc.cluster(voltage_ranks, 3));
-            boolean b01 = clusters.get(0).size() > clusters.get(1).size();
-            boolean b02 = clusters.get(0).size() > clusters.get(2).size();
-            boolean b12 = clusters.get(1).size() > clusters.get(2).size();
-            if (b01 && b02)
-            {
-                candidates.add(clusters.get(1).keySet());
-                candidates.add(clusters.get(2).keySet());
-            }
-            else if (!b01 && b12)
-            {
-                candidates.add(clusters.get(0).keySet());
-                candidates.add(clusters.get(2).keySet());
-            }
-            else if (!b02 && !b12)
-            {
-                candidates.add(clusters.get(0).keySet());
-                candidates.add(clusters.get(1).keySet());
-            }
-        }
-        catch (NotEnoughClustersException e)
-        {
-            // no valid candidates, continue
-        }
-    }
-
-    /**
-     * alternative to addTwoCandidateClusters(): cluster vertices by voltages into 2 clusters.
-     * We only consider the smaller of the two clusters returned
-     * by k-means to be a 'true' cluster candidate; the other is a garbage cluster.
-     * @param candidates
-     * @param voltage_ranks
-     */
-    protected void addOneCandidateCluster(LinkedList<Set<V>> candidates,
-            Map<V, double[]> voltage_ranks)
-    {
-        try
-        {
-            List<Map<V, double[]>> clusters;
-            clusters = new ArrayList<Map<V, double[]>>(kmc.cluster(voltage_ranks, 2));
-            if (clusters.get(0).size() < clusters.get(1).size())
-                candidates.add(clusters.get(0).keySet());
-            else
-                candidates.add(clusters.get(1).keySet());
-        }
-        catch (NotEnoughClustersException e)
-        {
-            // no valid candidates, continue
-        }
-    }
-
-    /**
-     * Returns an array of cluster seeds, ranked in decreasing order
-     * of number of appearances in the specified collection of candidate
-     * clusters.
-     * @param candidates
-     */
-    protected List<V> getSeedCandidates(Collection<Set<V>> candidates)
-    {
-        final Map<V, double[]> occur_counts = getObjectCounts(candidates, null);
-
-        ArrayList<V> occurrences = new ArrayList<V>(occur_counts.keySet());
-        Collections.sort(occurrences, new MapValueArrayComparator(occur_counts));
-
-        System.out.println("occurrences: ");
-        for (int i = 0; i < occurrences.size(); i++)
-            System.out.println(occur_counts.get(occurrences.get(i))[0]);
-
-        return occurrences;
-    }
-
-    protected Map<V, double[]> getObjectCounts(Collection<Set<V>> candidates, V seed)
-    {
-        Map<V, double[]> occur_counts = new HashMap<V, double[]>();
-        for (V v : g.getVertices())
-            occur_counts.put(v, new double[]{0});
-
-        for (Set<V> candidate : candidates)
-        {
-            if (seed == null)
-                System.out.println(candidate.size());
-            if (seed == null || candidate.contains(seed))
-            {
-                for (V element : candidate)
-                {
-                    double[] count = occur_counts.get(element);
-                    count[0]++;
-                }
-            }
-        }
-
-        if (seed == null)
-        {
-            System.out.println("occur_counts size: " + occur_counts.size());
-            for (V v : occur_counts.keySet())
-                System.out.println(occur_counts.get(v)[0]);
-        }
-
-        return occur_counts;
-    }
-
-    protected class MapValueArrayComparator implements Comparator<V>
-    {
-        private Map<V, double[]> map;
-
-        protected MapValueArrayComparator(Map<V, double[]> map)
-        {
-            this.map = map;
-        }
-
-        public int compare(V o1, V o2)
-        {
-            double[] count0 = map.get(o1);
-            double[] count1 = map.get(o2);
-            if (count0[0] < count1[0])
-                return 1;
-            else if (count0[0] > count1[0])
-                return -1;
-            return 0;
-        }
-
-    }
-
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/cluster/WeakComponentClusterer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/cluster/WeakComponentClusterer.java
deleted file mode 100644 (file)
index cb79a78..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.cluster;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.commons.collections15.Buffer;
-import org.apache.commons.collections15.Transformer;
-import org.apache.commons.collections15.buffer.UnboundedFifoBuffer;
-
-import edu.uci.ics.jung.graph.Graph;
-
-
-
-/**
- * Finds all weak components in a graph as sets of vertex sets.  A weak component is defined as
- * a maximal subgraph in which all pairs of vertices in the subgraph are reachable from one
- * another in the underlying undirected subgraph.
- * <p>This implementation identifies components as sets of vertex sets.  
- * To create the induced graphs from any or all of these vertex sets, 
- * see <code>algorithms.filters.FilterUtils</code>.
- * <p>
- * Running time: O(|V| + |E|) where |V| is the number of vertices and |E| is the number of edges.
- * @author Scott White
- */
-public class WeakComponentClusterer<V,E> implements Transformer<Graph<V,E>, Set<Set<V>>> 
-{
-       /**
-     * Extracts the weak components from a graph.
-     * @param graph the graph whose weak components are to be extracted
-     * @return the list of weak components
-     */
-    public Set<Set<V>> transform(Graph<V,E> graph) {
-
-        Set<Set<V>> clusterSet = new HashSet<Set<V>>();
-
-        HashSet<V> unvisitedVertices = new HashSet<V>(graph.getVertices());
-
-        while (!unvisitedVertices.isEmpty()) {
-               Set<V> cluster = new HashSet<V>();
-            V root = unvisitedVertices.iterator().next();
-            unvisitedVertices.remove(root);
-            cluster.add(root);
-
-            Buffer<V> queue = new UnboundedFifoBuffer<V>();
-            queue.add(root);
-
-            while (!queue.isEmpty()) {
-                V currentVertex = queue.remove();
-                Collection<V> neighbors = graph.getNeighbors(currentVertex);
-
-                for(V neighbor : neighbors) {
-                    if (unvisitedVertices.contains(neighbor)) {
-                        queue.add(neighbor);
-                        unvisitedVertices.remove(neighbor);
-                        cluster.add(neighbor);
-                    }
-                }
-            }
-            clusterSet.add(cluster);
-        }
-        return clusterSet;
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/cluster/package.html b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/cluster/package.html
deleted file mode 100644 (file)
index f8bdb22..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-  @(#)package.html
-
- Copyright © 2003 The Regents of the University of California. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies. This software program and documentation are copyrighted by The Regents of the University of California ("The University of California").
-
-THE SOFTWARE PROGRAM AND DOCUMENTATION ARE SUPPLIED "AS IS," WITHOUT ANY ACCOMPANYING SERVICES FROM THE UNIVERSITY OF CALFORNIA. FURTHERMORE, THE UNIVERSITY OF CALIFORNIA DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED OR ERROR-FREE. THE END-USER UNDERSTANDS THAT THE PROGRAM WAS DEVELOPED FOR RESEARCH PURPOSES AND IS ADVISED NOT TO RELY EXCLUSIVELY ON THE PROGRAM FOR ANY REASON.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
--->
-</head>
-<body>
-
-Mechanisms for identifying clusters in graphs.  Where these clusters define disjoint sets of vertices, 
-they may be used to define a <code>VertexPartition</code> for more convenient manipulation of the vertex/set
-relationships.
-
-Current clustering algorithms include:
-<ul>
-<li/><code>BicomponentClusterer</code>: finds all subsets of vertices for which at least
-2 vertices must be removed in order to disconnect the induced subgraphs.
-<li/><code>EdgeBetweennessClusterer</code>: identifies vertex clusters by removing the edges of the highest
-'betweenness' scores (see the importance/scoring package).
-<li/><code>VoltageClusterer</code>: Clusters vertices based on their ranks as 
-calculated by <code>VoltageRanker</code>. 
-<li/><code>WeakComponentVertexClusterer</code>: Clusters vertices based on their membership in weakly 
-connected components of a graph.
-</ul>
-
-
-</body>
-</html>
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/filters/EdgePredicateFilter.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/filters/EdgePredicateFilter.java
deleted file mode 100644 (file)
index 5e3be06..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Created on May 19, 2008
- *
- * Copyright (c) 2008, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.filters;
-
-import org.apache.commons.collections15.Predicate;
-
-import edu.uci.ics.jung.graph.Graph;
-
-/**
- * Transforms the input graph into one which contains only those edges 
- * that pass the specified <code>Predicate</code>.  The filtered graph
- * is a copy of the original graph (same type, uses the same vertex and
- * edge objects).  All vertices from the original graph
- * are copied into the new graph (even if they are not incident to any
- * edges in the new graph).
- * 
- * @author Joshua O'Madadhain
- */
-public class EdgePredicateFilter<V, E> implements Filter<V, E>
-{
-    protected Predicate<E> edge_pred;
-
-    /**
-     * Creates an instance based on the specified edge <code>Predicate</code>.
-     * @param edge_pred   the predicate that specifies which edges to add to the filtered graph
-     */
-    public EdgePredicateFilter(Predicate<E> edge_pred)
-    {
-        this.edge_pred = edge_pred;
-    }
-    
-    @SuppressWarnings("unchecked")
-    public Graph<V,E> transform(Graph<V,E> g)
-    {
-        Graph<V, E> filtered;
-        try
-        {
-            filtered = g.getClass().newInstance();
-        }
-        catch (InstantiationException e)
-        {
-            throw new RuntimeException("Unable to create copy of existing graph: ", e);
-        }
-        catch (IllegalAccessException e)
-        {
-            throw new RuntimeException("Unable to create copy of existing graph: ", e);
-        }
-
-        for (V v : g.getVertices())
-            filtered.addVertex(v);
-        
-        for (E e : g.getEdges())
-        {
-            if (edge_pred.evaluate(e))
-                filtered.addEdge(e, g.getIncidentVertices(e));
-        }
-        
-        return filtered;
-    }
-
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/filters/Filter.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/filters/Filter.java
deleted file mode 100644 (file)
index a62895c..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.filters;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.graph.Graph;
-
-
-
-/**
- * An interface for classes that return a subset of the input <code>Graph</code>
- * as a <code>Graph</code>.  The <code>Graph</code> returned may be either a
- * new graph or a view into an existing graph; the documentation for the filter
- * must specify which.
- * 
- * @author danyelf
- */
-public interface Filter<V,E> extends Transformer<Graph<V,E>, Graph<V,E>>{ }
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/filters/FilterUtils.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/filters/FilterUtils.java
deleted file mode 100644 (file)
index 4845c0f..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * Copyright (c) 2008, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- * Created on Jun 7, 2008
- * 
- */
-package edu.uci.ics.jung.algorithms.filters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import edu.uci.ics.jung.graph.Hypergraph;
-
-/**
- * Utility methods relating to filtering.
- */
-public class FilterUtils 
-{
-       /**
-        * Creates the induced subgraph from <code>graph</code> whose vertex set
-        * is equal to <code>vertices</code>.  The graph returned has 
-        * <code>vertices</code> as its vertex set, and includes all edges from
-        * <code>graph</code> which are incident only to elements of 
-        * <code>vertices</code>.
-        * 
-        * @param <V> the vertex type
-        * @param <E> the edge type
-        * @param vertices the subset of <code>graph</code>'s vertices around 
-        * which the subgraph is to be constructed
-        * @param graph the graph whose subgraph is to be constructed
-        * @return the subgraph induced by <code>vertices</code>
-        * @throws IllegalArgumentException if any vertex in 
-        * <code>vertices</code> is not in <code>graph</code>
-        */
-       @SuppressWarnings("unchecked")
-       public static <V,E,G extends Hypergraph<V,E>> G createInducedSubgraph(Collection<V> 
-               vertices, G graph)
-       {
-               G subgraph = null;
-               try 
-               {
-                       subgraph = (G)graph.getClass().newInstance();
-                       
-                       for (V v : vertices)
-                       {
-                               if (!graph.containsVertex(v))
-                                       throw new IllegalArgumentException("Vertex " + v + 
-                                               " is not an element of " + graph);
-                               subgraph.addVertex(v);
-                       }
-
-                       for (E e : graph.getEdges())
-                       {
-                               Collection<V> incident = graph.getIncidentVertices(e);
-                               if (vertices.containsAll(incident))
-                                       subgraph.addEdge(e, incident, graph.getEdgeType(e));
-                       }
-               } 
-        catch (InstantiationException e)
-        {
-            throw new RuntimeException("Unable to create copy of existing graph: ", e);
-        }
-        catch (IllegalAccessException e)
-        {
-            throw new RuntimeException("Unable to create copy of existing graph: ", e);
-        }
-               return subgraph;
-       }
-       
-       /**
-        * Creates the induced subgraphs of <code>graph</code> associated with each 
-        * element of <code>vertex_collections</code>.
-        * Note that these vertex collections need not be disjoint.
-        * @param <V> the vertex type
-        * @param <E> the edge type
-        * @param vertex_collections the collections of vertex collections to be
-        * used to induce the subgraphs
-        * @param graph the graph whose subgraphs are to be created
-        * @return the induced subgraphs of <code>graph</code> associated with each 
-        * element of <code>vertex_collections</code>
-        */
-       public static <V,E,G extends Hypergraph<V,E>> Collection<G> 
-               createAllInducedSubgraphs(Collection<? extends Collection<V>> 
-                       vertex_collections, G graph)
-       {
-               Collection<G> subgraphs = new ArrayList<G>();
-               
-               for (Collection<V> vertex_set : vertex_collections)
-                       subgraphs.add(createInducedSubgraph(vertex_set, graph));
-               
-               return subgraphs;
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/filters/KNeighborhoodFilter.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/filters/KNeighborhoodFilter.java
deleted file mode 100644 (file)
index 62bcfc2..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-/*
- * Created on Dec 26, 2001
- *
- */
-package edu.uci.ics.jung.algorithms.filters;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import edu.uci.ics.jung.algorithms.filters.Filter;
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.util.Pair;
-
-/**
- * A filter used to extract the k-neighborhood around one or more root node(s).
- * The k-neighborhood is defined as the subgraph induced by the set of 
- * vertices that are k or fewer hops (unweighted shortest-path distance)
- * away from the root node.
- * 
- * @author Danyel Fisher
- */
-public class KNeighborhoodFilter<V,E> implements Filter<V,E> {
-
-       /**
-        * The type of edge to follow for defining the neighborhood.
-        */
-       public static enum EdgeType { IN_OUT, IN, OUT }
-       private Set<V> rootNodes;
-       private int radiusK;
-       private EdgeType edgeType;
-       
-       /**
-        * Constructs a new instance of the filter.
-        * @param rootNodes the set of root nodes
-        * @param radiusK the neighborhood radius around the root set
-        * @param edgeType 0 for in/out edges, 1 for in-edges, 2  for out-edges
-        */
-       public KNeighborhoodFilter(Set<V> rootNodes, int radiusK, EdgeType edgeType) {
-               this.rootNodes = rootNodes;
-               this.radiusK = radiusK;
-               this.edgeType = edgeType;
-       }
-       
-       /**
-        * Constructs a new instance of the filter.
-        * @param rootNode the root node
-        * @param radiusK the neighborhood radius around the root set
-        * @param edgeType 0 for in/out edges, 1 for in-edges, 2  for out-edges
-        */
-       public KNeighborhoodFilter(V rootNode, int radiusK, EdgeType edgeType) {
-               this.rootNodes = new HashSet<V>();
-               this.rootNodes.add(rootNode);
-               this.radiusK = radiusK;
-               this.edgeType = edgeType;
-       }
-       
-       /**
-        * Constructs an unassembled graph containing the k-neighborhood around the root node(s).
-        */
-       @SuppressWarnings("unchecked")
-       public Graph<V,E> transform(Graph<V,E> graph) {
-               // generate a Set of Vertices we want
-               // add all to the UG
-               int currentDepth = 0;
-               List<V> currentVertices = new ArrayList<V>();
-               Set<V> visitedVertices = new HashSet<V>();
-               Set<E> visitedEdges = new HashSet<E>();
-               Set<V> acceptedVertices = new HashSet<V>();
-               //Copy, mark, and add all the root nodes to the new subgraph
-               for (V currentRoot : rootNodes) {
-
-                       visitedVertices.add(currentRoot);
-                       acceptedVertices.add(currentRoot);
-                       currentVertices.add(currentRoot);
-               }
-               ArrayList<V> newVertices = null;
-               //Use BFS to locate the neighborhood around the root nodes within distance k
-               while (currentDepth < radiusK) {
-                       newVertices = new ArrayList<V>();
-                       for (V currentVertex : currentVertices) {
-
-                               Collection<E> edges = null;
-                               switch (edgeType) {
-                                       case IN_OUT :
-                                               edges = graph.getIncidentEdges(currentVertex);
-                                               break;
-                                       case IN :
-                                               edges = graph.getInEdges(currentVertex);
-                                               break;
-                                       case OUT :
-                                               edges = graph.getOutEdges(currentVertex);
-                                               break;
-                               }
-                               for (E currentEdge : edges) {
-
-                                       V currentNeighbor =
-                                               graph.getOpposite(currentVertex, currentEdge);
-                                       if (!visitedEdges.contains(currentEdge)) {
-                                               visitedEdges.add(currentEdge);
-                                               if (!visitedVertices.contains(currentNeighbor)) {
-                                                       visitedVertices.add(currentNeighbor);
-                                                       acceptedVertices.add(currentNeighbor);
-                                                       newVertices.add(currentNeighbor);
-                                               }
-                                       }
-                               }
-                       }
-                       currentVertices = newVertices;
-                       currentDepth++;
-               }
-               Graph<V,E> ug = null;
-               try {
-                       ug = graph.getClass().newInstance();
-                       for(E edge : graph.getEdges()) {
-                               Pair<V> endpoints = graph.getEndpoints(edge);
-                               if(acceptedVertices.containsAll(endpoints)) {
-                                       ug.addEdge(edge, endpoints.getFirst(), endpoints.getSecond());
-                               }
-                       }
-               } 
-        catch (InstantiationException e)
-        {
-            throw new RuntimeException("Unable to create copy of existing graph: ", e);
-        }
-        catch (IllegalAccessException e)
-        {
-            throw new RuntimeException("Unable to create copy of existing graph: ", e);
-        }
-               return ug;
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/filters/VertexPredicateFilter.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/filters/VertexPredicateFilter.java
deleted file mode 100644 (file)
index 4543b42..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Created on May 19, 2008
- *
- * Copyright (c) 2008, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.filters;
-
-import java.util.Collection;
-
-import org.apache.commons.collections15.Predicate;
-
-import edu.uci.ics.jung.graph.Graph;
-
-/**
- * Transforms the input graph into one which contains only those vertices 
- * that pass the specified <code>Predicate</code>.  The filtered graph
- * is a copy of the original graph (same type, uses the same vertex and
- * edge objects).  Only those edges whose entire incident vertex collection
- * passes the predicate are copied into the new graph.
- * 
- * @author Joshua O'Madadhain
- */
-public class VertexPredicateFilter<V,E> implements Filter<V,E>
-{
-    protected Predicate<V> vertex_pred;
-
-    /**
-     * Creates an instance based on the specified vertex <code>Predicate</code>.
-     * @param vertex_pred   the predicate that specifies which vertices to add to the filtered graph
-     */
-    public VertexPredicateFilter(Predicate<V> vertex_pred)
-    {
-        this.vertex_pred = vertex_pred;
-    }
-    
-    @SuppressWarnings("unchecked")
-       public Graph<V,E> transform(Graph<V,E> g)
-    {
-        Graph<V, E> filtered;
-        try
-        {
-            filtered = g.getClass().newInstance();
-        }
-        catch (InstantiationException e)
-        {
-            throw new RuntimeException("Unable to create copy of existing graph: ", e);
-        }
-        catch (IllegalAccessException e)
-        {
-            throw new RuntimeException("Unable to create copy of existing graph: ", e);
-        }
-
-        for (V v : g.getVertices())
-            if (vertex_pred.evaluate(v))
-                filtered.addVertex(v);
-        
-        Collection<V> filtered_vertices = filtered.getVertices();
-        
-        for (E e : g.getEdges())
-        {
-            Collection<V> incident = g.getIncidentVertices(e);
-            if (filtered_vertices.containsAll(incident))
-                filtered.addEdge(e, incident);
-        }
-        
-        return filtered;
-    }
-
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/filters/package.html b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/filters/package.html
deleted file mode 100644 (file)
index 0f9a018..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-  @(#)package.html
-
- Copyright © 2008 The Regents of the University of California. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies. This software program and documentation are copyrighted by The Regents of the University of California ("The University of California").
-
-THE SOFTWARE PROGRAM AND DOCUMENTATION ARE SUPPLIED "AS IS," WITHOUT ANY ACCOMPANYING SERVICES FROM THE UNIVERSITY OF CALFORNIA. FURTHERMORE, THE UNIVERSITY OF CALIFORNIA DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED OR ERROR-FREE. THE END-USER UNDERSTANDS THAT THE PROGRAM WAS DEVELOPED FOR RESEARCH PURPOSES AND IS ADVISED NOT TO RELY EXCLUSIVELY ON THE PROGRAM FOR ANY REASON.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
--->
-</head>
-<body>
-
-Filtering mechanisms that produce subgraphs of an original graph. 
-Currently includes:
-<ul>
-<li/><code>Filter</code>: an interface for graph filters
-<li/><code>{Edge,Vertex}PredicateFilter</code>: graph filters that return the 
-induced subgraph according to the
-specified edge or vertex <code>Predicate</code>, respectively.
-<li/><code>KNeighborhoodFilter</code>: a filter that returns the subgraph 
-induced by vertices within (unweighted) distance k of a specified vertex.
-</ul>
-
-
-</body>
-</html>
-
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/flows/EdmondsKarpMaxFlow.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/flows/EdmondsKarpMaxFlow.java
deleted file mode 100644 (file)
index af9ee34..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.flows;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.collections15.Buffer;
-import org.apache.commons.collections15.Factory;
-import org.apache.commons.collections15.Transformer;
-import org.apache.commons.collections15.buffer.UnboundedFifoBuffer;
-
-import edu.uci.ics.jung.algorithms.util.IterativeProcess;
-import edu.uci.ics.jung.graph.DirectedGraph;
-import edu.uci.ics.jung.graph.util.EdgeType;
-
-
-/**
- * Implements the Edmonds-Karp maximum flow algorithm for solving the maximum flow problem. 
- * After the algorithm is executed,
- * the input {@code Map} is populated with a {@code Number} for each edge that indicates 
- * the flow along that edge.
- * <p>
- * An example of using this algorithm is as follows:
- * <pre>
- * EdmondsKarpMaxFlow ek = new EdmondsKarpMaxFlow(graph, source, sink, edge_capacities, edge_flows, 
- * edge_factory);
- * ek.evaluate(); // This instructs the class to compute the max flow
- * </pre>
- *
- * @see "Introduction to Algorithms by Cormen, Leiserson, Rivest, and Stein."
- * @see "Network Flows by Ahuja, Magnanti, and Orlin."
- * @see "Theoretical improvements in algorithmic efficiency for network flow problems by Edmonds and Karp, 1972."
- * @author Scott White, adapted to jung2 by Tom Nelson
- */
-public class EdmondsKarpMaxFlow<V,E> extends IterativeProcess {
-
-    private DirectedGraph<V,E> mFlowGraph;
-    private DirectedGraph<V,E> mOriginalGraph;
-    private V source;
-    private V target;
-    private int mMaxFlow;
-    private Set<V> mSourcePartitionNodes;
-    private Set<V> mSinkPartitionNodes;
-    private Set<E> mMinCutEdges;
-    
-    private Map<E,Number> residualCapacityMap = new HashMap<E,Number>();
-    private Map<V,V> parentMap = new HashMap<V,V>();
-    private Map<V,Number> parentCapacityMap = new HashMap<V,Number>();
-    private Transformer<E,Number> edgeCapacityTransformer;
-    private Map<E,Number> edgeFlowMap;
-    private Factory<E> edgeFactory;
-
-    /**
-     * Constructs a new instance of the algorithm solver for a given graph, source, and sink.
-     * Source and sink vertices must be elements of the specified graph, and must be 
-     * distinct.
-     * @param directedGraph the flow graph
-     * @param source the source vertex
-     * @param sink the sink vertex
-     * @param edgeCapacityTransformer the transformer that gets the capacity for each edge.
-     * @param edgeFlowMap the map where the solver will place the value of the flow for each edge
-     * @param edgeFactory used to create new edge instances for backEdges
-     */
-    @SuppressWarnings("unchecked")
-    public EdmondsKarpMaxFlow(DirectedGraph<V,E> directedGraph, V source, V sink, 
-               Transformer<E,Number> edgeCapacityTransformer, Map<E,Number> edgeFlowMap,
-               Factory<E> edgeFactory) {
-       
-       if(directedGraph.getVertices().contains(source) == false ||
-                       directedGraph.getVertices().contains(sink) == false) {
-            throw new IllegalArgumentException("source and sink vertices must be elements of the specified graph");
-       }
-        if (source.equals(sink)) {
-            throw new IllegalArgumentException("source and sink vertices must be distinct");
-        }
-        mOriginalGraph = directedGraph;
-
-        this.source = source;
-        this.target = sink;
-        this.edgeFlowMap = edgeFlowMap;
-        this.edgeCapacityTransformer = edgeCapacityTransformer;
-        this.edgeFactory = edgeFactory;
-        try {
-                       mFlowGraph = directedGraph.getClass().newInstance();
-                       for(E e : mOriginalGraph.getEdges()) {
-                               mFlowGraph.addEdge(e, mOriginalGraph.getSource(e), 
-                                               mOriginalGraph.getDest(e), EdgeType.DIRECTED);
-                       }
-                       for(V v : mOriginalGraph.getVertices()) {
-                               mFlowGraph.addVertex(v);
-                       }
-
-               } catch (InstantiationException e) {
-                       e.printStackTrace();
-               } catch (IllegalAccessException e) {
-                       e.printStackTrace();
-               }
-        mMaxFlow = 0;
-        mSinkPartitionNodes = new HashSet<V>();
-        mSourcePartitionNodes = new HashSet<V>();
-        mMinCutEdges = new HashSet<E>();
-    }
-
-    private void clearParentValues() {
-       parentMap.clear();
-       parentCapacityMap.clear();
-        parentCapacityMap.put(source, Integer.MAX_VALUE);
-        parentMap.put(source, source);
-    }
-
-    protected boolean hasAugmentingPath() {
-
-        mSinkPartitionNodes.clear();
-        mSourcePartitionNodes.clear();
-        mSinkPartitionNodes.addAll(mFlowGraph.getVertices());
-
-        Set<E> visitedEdgesMap = new HashSet<E>();
-        Buffer<V> queue = new UnboundedFifoBuffer<V>();
-        queue.add(source);
-
-        while (!queue.isEmpty()) {
-            V currentVertex = queue.remove();
-            mSinkPartitionNodes.remove(currentVertex);
-            mSourcePartitionNodes.add(currentVertex);
-            Number currentCapacity = parentCapacityMap.get(currentVertex);
-
-            Collection<E> neighboringEdges = mFlowGraph.getOutEdges(currentVertex);
-            
-            for (E neighboringEdge : neighboringEdges) {
-
-                V neighboringVertex = mFlowGraph.getDest(neighboringEdge);
-
-                Number residualCapacity = residualCapacityMap.get(neighboringEdge);
-                if (residualCapacity.intValue() <= 0 || visitedEdgesMap.contains(neighboringEdge))
-                    continue;
-
-                V neighborsParent = parentMap.get(neighboringVertex);
-                Number neighborCapacity = parentCapacityMap.get(neighboringVertex);
-                int newCapacity = Math.min(residualCapacity.intValue(),currentCapacity.intValue());
-
-                if ((neighborsParent == null) || newCapacity > neighborCapacity.intValue()) {
-                    parentMap.put(neighboringVertex, currentVertex);
-                    parentCapacityMap.put(neighboringVertex, new Integer(newCapacity));
-                    visitedEdgesMap.add(neighboringEdge);
-                    if (neighboringVertex != target) {
-                       queue.add(neighboringVertex);
-                    }
-                }
-            }
-        }
-
-        boolean hasAugmentingPath = false;
-        Number targetsParentCapacity = parentCapacityMap.get(target);
-        if (targetsParentCapacity != null && targetsParentCapacity.intValue() > 0) {
-            updateResidualCapacities();
-            hasAugmentingPath = true;
-        }
-        clearParentValues();
-        return hasAugmentingPath;
-    }
-
-     @Override
-    public void step() {
-        while (hasAugmentingPath()) {
-        }
-        computeMinCut();
-//        return 0;
-    }
-
-    private void computeMinCut() {
-
-        for (E e : mOriginalGraph.getEdges()) {
-
-               V source = mOriginalGraph.getSource(e);
-               V destination = mOriginalGraph.getDest(e);
-            if (mSinkPartitionNodes.contains(source) && mSinkPartitionNodes.contains(destination)) {
-                continue;
-            }
-            if (mSourcePartitionNodes.contains(source) && mSourcePartitionNodes.contains(destination)) {
-                continue;
-            }
-            if (mSinkPartitionNodes.contains(source) && mSourcePartitionNodes.contains(destination)) {
-                continue;
-            }
-            mMinCutEdges.add(e);
-        }
-    }
-
-    /**
-     * Returns the value of the maximum flow from the source to the sink.
-     */
-    public int getMaxFlow() {
-        return mMaxFlow;
-    }
-
-    /**
-     * Returns the nodes which share the same partition (as defined by the min-cut edges)
-     * as the sink node.
-     */
-    public Set<V> getNodesInSinkPartition() {
-        return mSinkPartitionNodes;
-    }
-
-    /**
-     * Returns the nodes which share the same partition (as defined by the min-cut edges)
-     * as the source node.
-     */
-    public Set<V> getNodesInSourcePartition() {
-        return mSourcePartitionNodes;
-    }
-
-    /**
-     * Returns the edges in the minimum cut.
-     */
-    public Set<E> getMinCutEdges() {
-        return mMinCutEdges;
-    }
-
-    /**
-     * Returns the graph for which the maximum flow is calculated.
-     */
-    public DirectedGraph<V,E> getFlowGraph() {
-        return mFlowGraph;
-    }
-
-    @Override
-    protected void initializeIterations() {
-        parentCapacityMap.put(source, Integer.MAX_VALUE);
-        parentMap.put(source, source);
-
-        List<E> edgeList = new ArrayList<E>(mFlowGraph.getEdges());
-
-        for (int eIdx=0;eIdx< edgeList.size();eIdx++) {
-            E edge = edgeList.get(eIdx);
-            Number capacity = edgeCapacityTransformer.transform(edge);
-
-            if (capacity == null) {
-                throw new IllegalArgumentException("Edge capacities must be provided in Transformer passed to constructor");
-            }
-            residualCapacityMap.put(edge, capacity);
-
-            V source = mFlowGraph.getSource(edge);
-            V destination = mFlowGraph.getDest(edge);
-
-            if(mFlowGraph.isPredecessor(source, destination) == false) {
-               E backEdge = edgeFactory.create();
-               mFlowGraph.addEdge(backEdge, destination, source, EdgeType.DIRECTED);
-                residualCapacityMap.put(backEdge, 0);
-            }
-        }
-    }
-    
-    @Override
-    protected void finalizeIterations() {
-
-        for (E currentEdge : mFlowGraph.getEdges()) {
-            Number capacity = edgeCapacityTransformer.transform(currentEdge);
-            
-            Number residualCapacity = residualCapacityMap.get(currentEdge);
-            if (capacity != null) {
-                Integer flowValue = new Integer(capacity.intValue()-residualCapacity.intValue());
-                this.edgeFlowMap.put(currentEdge, flowValue);
-            }
-        }
-
-        Set<E> backEdges = new HashSet<E>();
-        for (E currentEdge: mFlowGraph.getEdges()) {
-               
-            if (edgeCapacityTransformer.transform(currentEdge) == null) {
-                backEdges.add(currentEdge);
-            } else {
-                residualCapacityMap.remove(currentEdge);
-            }
-        }
-        for(E e : backEdges) {
-               mFlowGraph.removeEdge(e);
-        }
-    }
-
-    private void updateResidualCapacities() {
-
-        Number augmentingPathCapacity = parentCapacityMap.get(target);
-        mMaxFlow += augmentingPathCapacity.intValue();
-        V currentVertex = target;
-        V parentVertex = null;
-        while ((parentVertex = parentMap.get(currentVertex)) != currentVertex) {
-            E currentEdge = mFlowGraph.findEdge(parentVertex, currentVertex);
-
-            Number residualCapacity = residualCapacityMap.get(currentEdge);
-
-            residualCapacity = residualCapacity.intValue() - augmentingPathCapacity.intValue();
-            residualCapacityMap.put(currentEdge, residualCapacity);
-
-            E backEdge = mFlowGraph.findEdge(currentVertex, parentVertex);
-            residualCapacity = residualCapacityMap.get(backEdge);
-            residualCapacity = residualCapacity.intValue() + augmentingPathCapacity.intValue();
-            residualCapacityMap.put(backEdge, residualCapacity);
-            currentVertex = parentVertex;
-        }
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/flows/package.html b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/flows/package.html
deleted file mode 100644 (file)
index 1ec243d..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-  @(#)package.html
-
- Copyright © 2003 The Regents of the University of California. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies. This software program and documentation are copyrighted by The Regents of the University of California ("The University of California").
-
-THE SOFTWARE PROGRAM AND DOCUMENTATION ARE SUPPLIED "AS IS," WITHOUT ANY ACCOMPANYING SERVICES FROM THE UNIVERSITY OF CALFORNIA. FURTHERMORE, THE UNIVERSITY OF CALIFORNIA DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED OR ERROR-FREE. THE END-USER UNDERSTANDS THAT THE PROGRAM WAS DEVELOPED FOR RESEARCH PURPOSES AND IS ADVISED NOT TO RELY EXCLUSIVELY ON THE PROGRAM FOR ANY REASON.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
--->
-</head>
-<body>
-
-Methods for calculating properties relating to network flows (such as max flow/min cut).
-
-</body>
-</html>
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/EvolvingGraphGenerator.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/EvolvingGraphGenerator.java
deleted file mode 100644 (file)
index d351f9b..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.generators;
-
-
-
-/**
- * An interface for algorithms that generate graphs that evolve iteratively.
- * @author Scott White
- */
-public interface EvolvingGraphGenerator<V, E> extends GraphGenerator<V,E> {
-
-    /**
-     * Instructs the algorithm to evolve the graph N steps.
-     * @param numSteps number of steps to iterate from the current state
-     */
-    void evolveGraph(int numSteps);
-
-    /**
-     * Retrieves the total number of steps elapsed.
-     * @return number of elapsed steps
-     */
-    int numIterations();
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/GraphGenerator.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/GraphGenerator.java
deleted file mode 100644 (file)
index a329060..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.generators;
-
-import org.apache.commons.collections15.Factory;
-
-import edu.uci.ics.jung.graph.Graph;
-
-/**
- * An interface for algorithms that generate graphs.
- * @author Scott White
- */
-public interface GraphGenerator<V, E> extends Factory<Graph<V,E>>{ }
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/Lattice2DGenerator.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/Lattice2DGenerator.java
deleted file mode 100644 (file)
index e84425c..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Copyright (c) 2009, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-
-package edu.uci.ics.jung.algorithms.generators;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.collections15.Factory;
-
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.util.EdgeType;
-
-/**
- * Simple generator of an m x n lattice where each vertex
- * is incident with each of its neighbors (to the left, right, up, and down).
- * May be toroidal, in which case the vertices on the edges are connected to
- * their counterparts on the opposite edges as well.
- * 
- * <p>If the graph factory supplied has a default edge type of {@code EdgeType.DIRECTED},
- * then edges will be created in both directions between adjacent vertices.
- * 
- * @author Joshua O'Madadhain
- */
-public class Lattice2DGenerator<V,E> implements GraphGenerator<V,E>
-{
-    protected int row_count;
-    protected int col_count;
-    protected boolean is_toroidal;
-    protected boolean is_directed;
-    protected Factory<? extends Graph<V, E>> graph_factory;
-    protected Factory<V> vertex_factory;
-    protected Factory<E> edge_factory;
-    private List<V> v_array;
-
-    /**
-     * Constructs a generator of square lattices of size {@code latticeSize} 
-     * with the specified parameters.
-     * 
-     * @param graph_factory used to create the {@code Graph} for the lattice
-     * @param vertex_factory used to create the lattice vertices
-     * @param edge_factory used to create the lattice edges
-     * @param latticeSize the number of rows and columns of the lattice
-     * @param isToroidal if true, the created lattice wraps from top to bottom and left to right
-     */
-    public Lattice2DGenerator(Factory<? extends Graph<V,E>> graph_factory, Factory<V> vertex_factory, 
-            Factory<E> edge_factory, int latticeSize, boolean isToroidal)
-    {
-        this(graph_factory, vertex_factory, edge_factory, latticeSize, latticeSize, isToroidal);
-    }
-
-    /**
-     * Creates a generator of {@code row_count} x {@code col_count} lattices 
-     * with the specified parameters.
-     * 
-     * @param graph_factory used to create the {@code Graph} for the lattice
-     * @param vertex_factory used to create the lattice vertices
-     * @param edge_factory used to create the lattice edges
-     * @param row_count the number of rows in the lattice
-     * @param col_count the number of columns in the lattice
-     * @param isToroidal if true, the created lattice wraps from top to bottom and left to right
-     */
-    public Lattice2DGenerator(Factory<? extends Graph<V,E>> graph_factory, Factory<V> vertex_factory, 
-            Factory<E> edge_factory, int row_count, int col_count, boolean isToroidal)
-    {
-        if (row_count < 2 || col_count < 2)
-        {
-            throw new IllegalArgumentException("Row and column counts must each be at least 2.");
-        }
-
-        this.row_count = row_count;
-        this.col_count = col_count;
-        this.is_toroidal = isToroidal;
-        this.graph_factory = graph_factory;
-        this.vertex_factory = vertex_factory;
-        this.edge_factory = edge_factory;
-        this.is_directed = (graph_factory.create().getDefaultEdgeType() == EdgeType.DIRECTED);
-    }
-    
-    /**
-     * @see edu.uci.ics.jung.algorithms.generators.GraphGenerator#create()
-     */
-    @SuppressWarnings("unchecked")
-    public Graph<V,E> create()
-    {
-        int vertex_count = row_count * col_count;
-        Graph<V,E> graph = graph_factory.create();
-        v_array = new ArrayList<V>(vertex_count);
-        for (int i = 0; i < vertex_count; i++)
-        {
-            V v = vertex_factory.create();
-            graph.addVertex(v);
-            v_array.add(i, v);
-        }
-
-        int start = is_toroidal ? 0 : 1;
-        int end_row = is_toroidal ? row_count : row_count - 1;
-        int end_col = is_toroidal ? col_count : col_count - 1;
-        
-        // fill in edges
-        // down
-        for (int i = 0; i < end_row; i++)
-            for (int j = 0; j < col_count; j++)
-                graph.addEdge(edge_factory.create(), getVertex(i,j), getVertex(i+1, j));
-        // right
-        for (int i = 0; i < row_count; i++)
-            for (int j = 0; j < end_col; j++)
-                graph.addEdge(edge_factory.create(), getVertex(i,j), getVertex(i, j+1));
-
-        // if the graph is directed, fill in the edges going the other direction...
-        if (graph.getDefaultEdgeType() == EdgeType.DIRECTED)
-        {
-            // up
-            for (int i = start; i < row_count; i++)
-                for (int j = 0; j < col_count; j++)
-                    graph.addEdge(edge_factory.create(), getVertex(i,j), getVertex(i-1, j));
-            // left
-            for (int i = 0; i < row_count; i++)
-                for (int j = start; j < col_count; j++)
-                    graph.addEdge(edge_factory.create(), getVertex(i,j), getVertex(i, j-1));
-        }
-        
-        return graph;
-    }
-
-    /**
-     * Returns the number of edges found in a lattice of this generator's specifications.
-     * (This is useful for subclasses that may modify the generated graphs to add more edges.)
-     */
-    public int getGridEdgeCount()
-    {
-        int boundary_adjustment = (is_toroidal ? 0 : 1);
-        int vertical_edge_count = col_count * (row_count - boundary_adjustment);
-        int horizontal_edge_count = row_count * (col_count - boundary_adjustment);
-        
-        return (vertical_edge_count + horizontal_edge_count) * (is_directed ? 2 : 1);
-    }
-    
-    protected int getIndex(int i, int j)
-    {
-        return ((mod(i, row_count)) * col_count) + (mod(j, col_count));
-    }
-
-    protected int mod(int i, int modulus) 
-    {
-        int i_mod = i % modulus;
-        return i_mod >= 0 ? i_mod : i_mod + modulus;
-    }
-    
-    /**
-     * Returns the vertex at position ({@code i mod row_count, j mod col_count}).
-     */
-    protected V getVertex(int i, int j)
-    {
-        return v_array.get(getIndex(i, j));
-    }
-    
-    /**
-     * Returns the {@code i}th vertex (counting row-wise).
-     */
-    protected V getVertex(int i)
-    {
-        return v_array.get(i);
-    }
-    
-    /**
-     * Returns the row in which vertex {@code i} is found.
-     */
-    protected int getRow(int i)
-    {
-        return i / row_count;
-    }
-    
-    /**
-     * Returns the column in which vertex {@code i} is found.
-     */
-    protected int getCol(int i)
-    {
-        return i % col_count;
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/package.html b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/package.html
deleted file mode 100644 (file)
index 441922d..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-  @(#)package.html
-
- Copyright © 2003 The Regents of the University of California. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies. This software program and documentation are copyrighted by The Regents of the University of California ("The University of California").
-
-THE SOFTWARE PROGRAM AND DOCUMENTATION ARE SUPPLIED "AS IS," WITHOUT ANY ACCOMPANYING SERVICES FROM THE UNIVERSITY OF CALFORNIA. FURTHERMORE, THE UNIVERSITY OF CALIFORNIA DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED OR ERROR-FREE. THE END-USER UNDERSTANDS THAT THE PROGRAM WAS DEVELOPED FOR RESEARCH PURPOSES AND IS ADVISED NOT TO RELY EXCLUSIVELY ON THE PROGRAM FOR ANY REASON.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
--->
-</head>
-<body>
-
-Methods for generating new (often random) graphs with various properties.
-
-</body>
-</html>
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/BarabasiAlbertGenerator.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/BarabasiAlbertGenerator.java
deleted file mode 100644 (file)
index 77b419b..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.generators.random;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.Set;
-
-import org.apache.commons.collections15.Factory;
-
-import edu.uci.ics.jung.algorithms.generators.EvolvingGraphGenerator;
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.MultiGraph;
-import edu.uci.ics.jung.graph.util.EdgeType;
-import edu.uci.ics.jung.graph.util.Pair;
-
-
-/**
- * <p>Simple evolving scale-free random graph generator. At each time
- * step, a new vertex is created and is connected to existing vertices
- * according to the principle of "preferential attachment", whereby 
- * vertices with higher degree have a higher probability of being 
- * selected for attachment.</p>
- * 
- * <p>At a given timestep, the probability <code>p</code> of creating an edge
- * between an existing vertex <code>v</code> and the newly added vertex is
- * <pre>
- * p = (degree(v) + 1) / (|E| + |V|);
- * </pre>
- * 
- * <p>where <code>|E|</code> and <code>|V|</code> are, respectively, the number 
- * of edges and vertices currently in the network (counting neither the new
- * vertex nor the other edges that are being attached to it).</p>
- * 
- * <p>Note that the formula specified in the original paper
- * (cited below) was
- * <pre>
- * p = degree(v) / |E|
- * </pre>
- * </p>
- * 
- * <p>However, this would have meant that the probability of attachment for any existing
- * isolated vertex would be 0.  This version uses Lagrangian smoothing to give
- * each existing vertex a positive attachment probability.</p>
- * 
- * <p>The graph created may be either directed or undirected (controlled by a constructor
- * parameter); the default is undirected.  
- * If the graph is specified to be directed, then the edges added will be directed
- * from the newly added vertex u to the existing vertex v, with probability proportional to the 
- * indegree of v (number of edges directed towards v).  If the graph is specified to be undirected,
- * then the (undirected) edges added will connect u to v, with probability proportional to the 
- * degree of v.</p> 
- * 
- * <p>The <code>parallel</code> constructor parameter specifies whether parallel edges
- * may be created.</p>
- * 
- * @see "A.-L. Barabasi and R. Albert, Emergence of scaling in random networks, Science 286, 1999."
- * @author Scott White
- * @author Joshua O'Madadhain
- * @author Tom Nelson - adapted to jung2
- */
-public class BarabasiAlbertGenerator<V,E> implements EvolvingGraphGenerator<V,E> {
-    private Graph<V, E> mGraph = null;
-    private int mNumEdgesToAttachPerStep;
-    private int mElapsedTimeSteps;
-    private Random mRandom;
-    protected List<V> vertex_index;
-    protected int init_vertices;
-    protected Map<V,Integer> index_vertex;
-    protected Factory<Graph<V,E>> graphFactory;
-    protected Factory<V> vertexFactory;
-    protected Factory<E> edgeFactory;
-    
-    /**
-     * Constructs a new instance of the generator.
-     * @param init_vertices     number of unconnected 'seed' vertices that the graph should start with
-     * @param numEdgesToAttach the number of edges that should be attached from the
-     * new vertex to pre-existing vertices at each time step
-     * @param directed  specifies whether the graph and edges to be created should be directed or not
-     * @param parallel  specifies whether the algorithm permits parallel edges
-     * @param seed  random number seed
-     */
-    public BarabasiAlbertGenerator(Factory<Graph<V,E>> graphFactory,
-               Factory<V> vertexFactory, Factory<E> edgeFactory, 
-               int init_vertices, int numEdgesToAttach, 
-            int seed, Set<V> seedVertices)
-    {
-        assert init_vertices > 0 : "Number of initial unconnected 'seed' vertices " + 
-                    "must be positive";
-        assert numEdgesToAttach > 0 : "Number of edges to attach " +
-                    "at each time step must be positive";
-        
-        mNumEdgesToAttachPerStep = numEdgesToAttach;
-        mRandom = new Random(seed);
-        this.graphFactory = graphFactory;
-        this.vertexFactory = vertexFactory;
-        this.edgeFactory = edgeFactory;
-        this.init_vertices = init_vertices;
-        initialize(seedVertices);
-    }
-    
-
-    /**
-     * Constructs a new instance of the generator, whose output will be an undirected graph,
-     * and which will use the current time as a seed for the random number generation.
-     * @param init_vertices     number of vertices that the graph should start with
-     * @param numEdgesToAttach the number of edges that should be attached from the
-     * new vertex to pre-existing vertices at each time step
-     */
-    public BarabasiAlbertGenerator(Factory<Graph<V,E>> graphFactory, 
-               Factory<V> vertexFactory, Factory<E> edgeFactory,
-               int init_vertices, int numEdgesToAttach, Set<V> seedVertices) {
-        this(graphFactory, vertexFactory, edgeFactory, init_vertices, numEdgesToAttach, (int) System.currentTimeMillis(), seedVertices);
-    }
-    
-    private void initialize(Set<V> seedVertices) {
-       
-       mGraph = graphFactory.create();
-
-        vertex_index = new ArrayList<V>(2*init_vertices);
-        index_vertex = new HashMap<V, Integer>(2*init_vertices);
-        for (int i = 0; i < init_vertices; i++) {
-            V v = vertexFactory.create();
-            mGraph.addVertex(v);
-            vertex_index.add(v);
-            index_vertex.put(v, i);
-            seedVertices.add(v);
-        }
-            
-        mElapsedTimeSteps = 0;
-    }
-
-    private void createRandomEdge(Collection<V> preexistingNodes,
-               V newVertex, Set<Pair<V>> added_pairs) {
-        V attach_point;
-        boolean created_edge = false;
-        Pair<V> endpoints;
-        do {
-            attach_point = vertex_index.get(mRandom.nextInt(vertex_index.size()));
-            
-            endpoints = new Pair<V>(newVertex, attach_point);
-            
-            // if parallel edges are not allowed, skip attach_point if <newVertex, attach_point>
-            // already exists; note that because of the way edges are added, we only need to check
-            // the list of candidate edges for duplicates.
-            if (!(mGraph instanceof MultiGraph))
-            {
-               if (added_pairs.contains(endpoints))
-                       continue;
-               if (mGraph.getDefaultEdgeType() == EdgeType.UNDIRECTED && 
-                       added_pairs.contains(new Pair<V>(attach_point, newVertex)))
-                       continue;
-            }
-
-            double degree = mGraph.inDegree(attach_point);
-            
-            // subtract 1 from numVertices because we don't want to count newVertex
-            // (which has already been added to the graph, but not to vertex_index)
-            double attach_prob = (degree + 1) / (mGraph.getEdgeCount() + mGraph.getVertexCount() - 1);
-            if (attach_prob >= mRandom.nextDouble())
-                created_edge = true;
-        }
-        while (!created_edge);
-
-        added_pairs.add(endpoints);
-        
-        if (mGraph.getDefaultEdgeType() == EdgeType.UNDIRECTED) {
-               added_pairs.add(new Pair<V>(attach_point, newVertex));
-        }
-    }
-
-    public void evolveGraph(int numTimeSteps) {
-
-        for (int i = 0; i < numTimeSteps; i++) {
-            evolveGraph();
-            mElapsedTimeSteps++;
-        }
-    }
-
-    private void evolveGraph() {
-        Collection<V> preexistingNodes = mGraph.getVertices();
-        V newVertex = vertexFactory.create();
-
-        mGraph.addVertex(newVertex);
-
-        // generate and store the new edges; don't add them to the graph
-        // yet because we don't want to bias the degree calculations
-        // (all new edges in a timestep should be added in parallel)
-        Set<Pair<V>> added_pairs = new HashSet<Pair<V>>(mNumEdgesToAttachPerStep*3);
-        
-        for (int i = 0; i < mNumEdgesToAttachPerStep; i++) 
-               createRandomEdge(preexistingNodes, newVertex, added_pairs);
-        
-        for (Pair<V> pair : added_pairs)
-        {
-               V v1 = pair.getFirst();
-               V v2 = pair.getSecond();
-               if (mGraph.getDefaultEdgeType() != EdgeType.UNDIRECTED || 
-                               !mGraph.isNeighbor(v1, v2))
-                       mGraph.addEdge(edgeFactory.create(), pair);
-        }
-        // now that we're done attaching edges to this new vertex, 
-        // add it to the index
-        vertex_index.add(newVertex);
-        index_vertex.put(newVertex, new Integer(vertex_index.size() - 1));
-    }
-
-    public int numIterations() {
-        return mElapsedTimeSteps;
-    }
-
-    public Graph<V, E> create() {
-        return mGraph;
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/EppsteinPowerLawGenerator.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/EppsteinPowerLawGenerator.java
deleted file mode 100644 (file)
index e3bf04b..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.generators.random;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-
-import org.apache.commons.collections15.Factory;
-
-import edu.uci.ics.jung.algorithms.generators.GraphGenerator;
-import edu.uci.ics.jung.graph.Graph;
-
-/**
- * Graph generator that generates undirected graphs with power-law degree distributions.
- * @author Scott White
- * @see "A Steady State Model for Graph Power Law by David Eppstein and Joseph Wang"
- */
-public class EppsteinPowerLawGenerator<V,E> implements GraphGenerator<V,E> {
-    private int mNumVertices;
-    private int mNumEdges;
-    private int mNumIterations;
-    private double mMaxDegree;
-    private Random mRandom;
-    private Factory<Graph<V,E>> graphFactory;
-    private Factory<V> vertexFactory;
-    private Factory<E> edgeFactory;
-
-    /**
-     * Creates an instance with the specified factories and specifications.
-     * @param graphFactory the factory to use to generate the graph
-     * @param vertexFactory the factory to use to create vertices
-     * @param edgeFactory the factory to use to create edges
-     * @param numVertices the number of vertices for the generated graph
-     * @param numEdges the number of edges the generated graph will have, should be Theta(numVertices)
-     * @param r the number of iterations to use; the larger the value the better the graph's degree
-     * distribution will approximate a power-law
-     */
-    public EppsteinPowerLawGenerator(Factory<Graph<V,E>> graphFactory,
-               Factory<V> vertexFactory, Factory<E> edgeFactory, 
-               int numVertices, int numEdges, int r) {
-       this.graphFactory = graphFactory;
-       this.vertexFactory = vertexFactory;
-       this.edgeFactory = edgeFactory;
-        mNumVertices = numVertices;
-        mNumEdges = numEdges;
-        mNumIterations = r;
-        mRandom = new Random();
-    }
-
-    protected Graph<V,E> initializeGraph() {
-        Graph<V,E> graph = null;
-        graph = graphFactory.create();
-        for(int i=0; i<mNumVertices; i++) {
-               graph.addVertex(vertexFactory.create());
-        }
-        List<V> vertices = new ArrayList<V>(graph.getVertices());
-        while (graph.getEdgeCount() < mNumEdges) {
-            V u = vertices.get((int) (mRandom.nextDouble() * mNumVertices));
-            V v = vertices.get((int) (mRandom.nextDouble() * mNumVertices));
-            if (!graph.isSuccessor(v,u)) {
-               graph.addEdge(edgeFactory.create(), u, v);
-            }
-        }
-
-        double maxDegree = 0;
-        for (V v : graph.getVertices()) {
-            maxDegree = Math.max(graph.degree(v),maxDegree);
-        }
-        mMaxDegree = maxDegree; //(maxDegree+1)*(maxDegree)/2;
-
-        return graph;
-    }
-
-    /**
-     * Generates a graph whose degree distribution approximates a power-law.
-     * @return the generated graph
-     */
-    public Graph<V,E> create() {
-        Graph<V,E> graph = initializeGraph();
-
-        List<V> vertices = new ArrayList<V>(graph.getVertices());
-        for (int rIdx = 0; rIdx < mNumIterations; rIdx++) {
-
-            V v = null;
-            int degree = 0;
-            do {
-                v = vertices.get((int) (mRandom.nextDouble() * mNumVertices));
-                degree = graph.degree(v);
-
-            } while (degree == 0);
-
-            List<E> edges = new ArrayList<E>(graph.getIncidentEdges(v));
-            E randomExistingEdge = edges.get((int) (mRandom.nextDouble()*degree));
-
-            // FIXME: look at email thread on a more efficient RNG for arbitrary distributions
-            
-            V x = vertices.get((int) (mRandom.nextDouble() * mNumVertices));
-            V y = null;
-            do {
-                y = vertices.get((int) (mRandom.nextDouble() * mNumVertices));
-
-            } while (mRandom.nextDouble() > ((graph.degree(y)+1)/mMaxDegree));
-
-            if (!graph.isSuccessor(y,x) && x != y) {
-                graph.removeEdge(randomExistingEdge);
-                graph.addEdge(edgeFactory.create(), x, y);
-            }
-        }
-
-        return graph;
-    }
-
-    /**
-     * Sets the seed for the random number generator.
-     * @param seed input to the random number generator.
-     */
-    public void setSeed(long seed) {
-        mRandom.setSeed(seed);
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/ErdosRenyiGenerator.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/ErdosRenyiGenerator.java
deleted file mode 100644 (file)
index 3a33730..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.generators.random;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-
-import org.apache.commons.collections15.Factory;
-
-import edu.uci.ics.jung.algorithms.generators.GraphGenerator;
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.UndirectedGraph;
-
-/**
- * Generates a random graph using the Erdos-Renyi binomial model
- * (each pair of vertices is connected with probability p).
- * 
- *  @author William Giordano, Scott White, Joshua O'Madadhain
- */
-public class ErdosRenyiGenerator<V,E> implements GraphGenerator<V,E> {
-    private int mNumVertices;
-    private double mEdgeConnectionProbability;
-    private Random mRandom;
-    Factory<UndirectedGraph<V,E>> graphFactory;
-    Factory<V> vertexFactory;
-    Factory<E> edgeFactory;
-
-    /**
-     *
-     * @param numVertices number of vertices graph should have
-     * @param p Connection's probability between 2 vertices
-     */
-       public ErdosRenyiGenerator(Factory<UndirectedGraph<V,E>> graphFactory,
-                       Factory<V> vertexFactory, Factory<E> edgeFactory,
-                       int numVertices,double p)
-    {
-        if (numVertices <= 0) {
-            throw new IllegalArgumentException("A positive # of vertices must be specified.");
-        }
-        mNumVertices = numVertices;
-        if (p < 0 || p > 1) {
-            throw new IllegalArgumentException("p must be between 0 and 1.");
-        }
-        this.graphFactory = graphFactory;
-        this.vertexFactory = vertexFactory;
-        this.edgeFactory = edgeFactory;
-        mEdgeConnectionProbability = p;
-        mRandom = new Random();
-       }
-
-    /**
-     * Returns a graph in which each pair of vertices is connected by 
-     * an undirected edge with the probability specified by the constructor.
-     */
-       public Graph<V,E> create() {
-        UndirectedGraph<V,E> g = graphFactory.create();
-        for(int i=0; i<mNumVertices; i++) {
-               g.addVertex(vertexFactory.create());
-        }
-        List<V> list = new ArrayList<V>(g.getVertices());
-
-               for (int i = 0; i < mNumVertices-1; i++) {
-            V v_i = list.get(i);
-                       for (int j = i+1; j < mNumVertices; j++) {
-                V v_j = list.get(j);
-                               if (mRandom.nextDouble() < mEdgeConnectionProbability) {
-                                       g.addEdge(edgeFactory.create(), v_i, v_j);
-                               }
-                       }
-               }
-        return g;
-    }
-
-    /**
-     * Sets the seed of the internal random number generator to {@code seed}.
-     * Enables consistent behavior.
-     */
-    public void setSeed(long seed) {
-        mRandom.setSeed(seed);
-    }
-}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/KleinbergSmallWorldGenerator.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/KleinbergSmallWorldGenerator.java
deleted file mode 100644 (file)
index de01b69..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-
-package edu.uci.ics.jung.algorithms.generators.random;
-
-/*
-* Copyright (c) 2009, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Random;
-
-import org.apache.commons.collections15.Factory;
-
-import edu.uci.ics.jung.algorithms.generators.Lattice2DGenerator;
-import edu.uci.ics.jung.algorithms.util.WeightedChoice;
-import edu.uci.ics.jung.graph.Graph;
-
-/**
- * Graph generator that produces a random graph with small world properties. 
- * The underlying model is an mxn (optionally toroidal) lattice. Each node u 
- * has four local connections, one to each of its neighbors, and
- * in addition 1+ long range connections to some node v where v is chosen randomly according to
- * probability proportional to d^-alpha where d is the lattice distance between u and v and alpha
- * is the clustering exponent.
- * 
- * @see "Navigation in a small world J. Kleinberg, Nature 406(2000), 845."
- * @author Joshua O'Madadhain
- */
-public class KleinbergSmallWorldGenerator<V, E> extends Lattice2DGenerator<V, E> {
-    private double clustering_exponent;
-    private Random random;
-    private int num_connections = 1;
-    
-    /**
-     * Creates 
-     * @param graph_factory
-     * @param vertex_factory
-     * @param edge_factory
-     * @param latticeSize
-     * @param clusteringExponent
-     */
-    public KleinbergSmallWorldGenerator(Factory<? extends Graph<V,E>> graph_factory, Factory<V> vertex_factory, 
-            Factory<E> edge_factory, int latticeSize, double clusteringExponent) 
-    {
-        this(graph_factory, vertex_factory, edge_factory, latticeSize, latticeSize, clusteringExponent);
-    }
-
-    /**
-     * @param graph_factory
-     * @param vertex_factory
-     * @param edge_factory
-     * @param row_count
-     * @param col_count
-     * @param clusteringExponent
-     */
-    public KleinbergSmallWorldGenerator(Factory<? extends Graph<V,E>> graph_factory, Factory<V> vertex_factory, 
-            Factory<E> edge_factory, int row_count, int col_count, double clusteringExponent) 
-    {
-        super(graph_factory, vertex_factory, edge_factory, row_count, col_count, true);
-        clustering_exponent = clusteringExponent;
-        initialize();
-    }
-
-    /**
-     * @param graph_factory
-     * @param vertex_factory
-     * @param edge_factory
-     * @param row_count
-     * @param col_count
-     * @param clusteringExponent
-     * @param isToroidal
-     */
-    public KleinbergSmallWorldGenerator(Factory<? extends Graph<V,E>> graph_factory, Factory<V> vertex_factory, 
-            Factory<E> edge_factory, int row_count, int col_count, double clusteringExponent, 
-            boolean isToroidal) 
-    {
-        super(graph_factory, vertex_factory, edge_factory, row_count, col_count, isToroidal);
-        clustering_exponent = clusteringExponent;
-        initialize();
-    }
-
-    private void initialize()
-    {
-        this.random = new Random();
-    }
-    
-    /**
-     * Sets the {@code Random} instance used by this instance.  Useful for 
-     * unit testing.
-     */
-    public void setRandom(Random random)
-    {
-        this.random = random;
-    }
-    
-    /**
-     * Sets the seed of the internal random number generator.  May be used to provide repeatable
-     * experiments.
-     */
-    public void setRandomSeed(long seed) 
-    {
-        random.setSeed(seed);
-    }
-
-    /**
-     * Sets the number of new 'small-world' connections (outgoing edges) to be added to each vertex.
-     */
-    public void setConnectionCount(int num_connections)
-    {
-        if (num_connections <= 0)
-        {
-            throw new IllegalArgumentException("Number of new connections per vertex must be >= 1");
-        }
-        this.num_connections = num_connections;
-    }
-
-    /**
-     * Returns the number of new 'small-world' connections to be made to each vertex.
-     */
-    public int getConnectionCount()
-    {
-        return this.num_connections;
-    }
-    
-    /**
-     * Generates a random small world network according to the parameters given
-     * @return a random small world graph
-     */
-    @Override
-    public Graph<V,E> create() 
-    {
-        Graph<V, E> graph = super.create();
-        
-        // TODO: For toroidal graphs, we can make this more clever by pre-creating the WeightedChoice object
-        // and using the output as an offset to the current vertex location.
-        WeightedChoice<V> weighted_choice;
-        
-        // Add long range connections
-        for (int i = 0; i < graph.getVertexCount(); i++)
-        {
-            V source = getVertex(i);
-            int row = getRow(i);
-            int col = getCol(i);
-            int row_offset = row < row_count/2 ? -row_count : row_count;
-            int col_offset = col < col_count/2 ? -col_count : col_count;
-
-            Map<V, Float> vertex_weights = new HashMap<V, Float>();
-            for (int j = 0; j < row_count; j++)
-            {
-                for (int k = 0; k < col_count; k++)
-                {
-                    if (j == row && k == col)
-                        continue;
-                    int v_dist = Math.abs(j - row);
-                    int h_dist = Math.abs(k - col);
-                    if (is_toroidal)
-                    {
-                        v_dist = Math.min(v_dist, Math.abs(j - row+row_offset));
-                        h_dist = Math.min(h_dist, Math.abs(k - col+col_offset));
-                    }
-                    int distance = v_dist + h_dist;
-                    if (distance < 2)
-                        continue;
-                    else
-                        vertex_weights.put(getVertex(j,k), (float)Math.pow(distance, -clustering_exponent));
-                }
-            }
-
-            for (int j = 0; j < this.num_connections; j++) {
-                weighted_choice = new WeightedChoice<V>(vertex_weights, random);
-                V target = weighted_choice.nextItem();
-                graph.addEdge(edge_factory.create(), source, target);
-            }
-        }
-
-        return graph;
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/MixedRandomGraphGenerator.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/MixedRandomGraphGenerator.java
deleted file mode 100644 (file)
index a39a640..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University of
- * California All rights reserved.
- * 
- * This software is open-source under the BSD license; see either "license.txt"
- * or http://jung.sourceforge.net/license.txt for a description.
- */
-/*
- * Created on Jul 2, 2003
- *  
- */
-package edu.uci.ics.jung.algorithms.generators.random;
-
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.collections15.Factory;
-
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.util.EdgeType;
-
-/**
- * 
- * Generates a mixed-mode random graph based on the output of <code>BarabasiAlbertGenerator</code>.
- * Primarily intended for providing a heterogeneous sample graph for visualization testing, etc.
- *  
- */
-public class MixedRandomGraphGenerator {
-
-       /**
-        * Equivalent to <code>generateMixedRandomGraph(edge_weight, num_vertices, true)</code>.
-        */
-       public static <V,E> Graph<V, E> generateMixedRandomGraph(
-                       Factory<Graph<V,E>> graphFactory,
-                       Factory<V> vertexFactory,
-               Factory<E> edgeFactory,
-               Map<E,Number> edge_weight, 
-                       int num_vertices, Set<V> seedVertices)
-       {
-               return generateMixedRandomGraph(graphFactory, vertexFactory, edgeFactory, 
-                               edge_weight, num_vertices, true, seedVertices);
-       }
-
-    /**
-     * Returns a random mixed-mode graph.  Starts with a randomly generated 
-     * Barabasi-Albert (preferential attachment) generator 
-     * (4 initial vertices, 3 edges added at each step, and num_vertices - 4 evolution steps).
-     * Then takes the resultant graph, replaces random undirected edges with directed
-     * edges, and assigns random weights to each edge.
-     */
-    public static <V,E> Graph<V,E> generateMixedRandomGraph(
-               Factory<Graph<V,E>> graphFactory,
-               Factory<V> vertexFactory,
-               Factory<E> edgeFactory,
-               Map<E,Number> edge_weights, 
-            int num_vertices, boolean parallel, Set<V> seedVertices)
-    {
-        int seed = (int)(Math.random() * 10000);
-        BarabasiAlbertGenerator<V,E> bag = 
-            new BarabasiAlbertGenerator<V,E>(graphFactory, vertexFactory, edgeFactory,
-                       4, 3, //false, parallel, 
-                       seed, seedVertices);
-        bag.evolveGraph(num_vertices - 4);
-        Graph<V, E> ug = bag.create();
-
-        // create a SparseMultigraph version of g
-        Graph<V, E> g = graphFactory.create();
-               //new SparseMultigraph<V, E>();
-        for(V v : ug.getVertices()) {
-               g.addVertex(v);
-        }
-        
-        // randomly replace some of the edges by directed edges to 
-        // get a mixed-mode graph, add random weights
-        
-        for(E e : ug.getEdges()) {
-            V v1 = ug.getEndpoints(e).getFirst();
-            V v2 = ug.getEndpoints(e).getSecond();
-
-            E me = edgeFactory.create();
-            g.addEdge(me, v1, v2, Math.random() < .5 ? EdgeType.DIRECTED : EdgeType.UNDIRECTED);
-            edge_weights.put(me, Math.random());
-        }
-        
-        return g;
-    }
-    
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/package.html b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/generators/random/package.html
deleted file mode 100644 (file)
index 9f85614..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-  @(#)package.html
-
- Copyright © 2003 The Regents of the University of California. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies. This software program and documentation are copyrighted by The Regents of the University of California ("The University of California").
-
-THE SOFTWARE PROGRAM AND DOCUMENTATION ARE SUPPLIED "AS IS," WITHOUT ANY ACCOMPANYING SERVICES FROM THE UNIVERSITY OF CALFORNIA. FURTHERMORE, THE UNIVERSITY OF CALIFORNIA DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED OR ERROR-FREE. THE END-USER UNDERSTANDS THAT THE PROGRAM WAS DEVELOPED FOR RESEARCH PURPOSES AND IS ADVISED NOT TO RELY EXCLUSIVELY ON THE PROGRAM FOR ANY REASON.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
--->
-</head>
-<body>
-
-Methods for generating random graphs with various properties.  These include:
-<ul>
-<li/><code>BarabasiAlbertGenerator</code>: scale-free graphs using the preferential attachment heuristic.
-<li/><code>EppsteinPowerLawGenerator</code>: graphs whose degree distribution approximates a power law
-<li/><code>ErdosRenyiGenerator</code>: graphs for which edges are created with a specified probability
-<li/><code>MixedRandomGraphGenerator</code>: takes the output of <code>BarabasiAlbertGenerator</code> and
-perturbs it to generate a mixed-mode analog with both directed and undirected edges. 
-<li/>
-
-
-</body>
-</html>
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/importance/AbstractRanker.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/importance/AbstractRanker.java
deleted file mode 100644 (file)
index 6ea8bc8..0000000
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.importance;
-
-import java.text.DecimalFormat;
-import java.text.Format;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.collections15.Factory;
-import org.apache.commons.collections15.map.LazyMap;
-
-import edu.uci.ics.jung.algorithms.util.IterativeProcess;
-import edu.uci.ics.jung.graph.Graph;
-
-/**
- * Abstract class for algorithms that rank nodes or edges by some "importance" metric. Provides a common set of
- * services such as:
- * <ul>
- *  <li> storing rank scores</li>
- *  <li> getters and setters for rank scores</li>
- *  <li> computing default edge weights</li>
- *  <li> normalizing default or user-provided edge transition weights </li>
- *  <li> normalizing rank scores</li>
- *  <li> automatic cleanup of decorations</li>
- *  <li> creation of Ranking list</li>
- * <li>print rankings in sorted order by rank</li>
- * </ul>
- * <p>
- * By default, all rank scores are removed from the vertices (or edges) being ranked.
- * @author Scott White
- */
-public abstract class AbstractRanker<V,E> extends IterativeProcess {
-    private Graph<V,E> mGraph;
-    private List<Ranking<?>> mRankings;
-    private boolean mRemoveRankScoresOnFinalize;
-    private boolean mRankNodes;
-    private boolean mRankEdges;
-    private boolean mNormalizeRankings;
-    protected Map<Object,Map<V, Number>> vertexRankScores = 
-       LazyMap.decorate(
-                       new HashMap<Object,Map<V,Number>>(),
-                       new Factory<Map<V,Number>>() {
-                                       public Map<V,Number> create() {
-                                               return new HashMap<V,Number>();
-                                       }});
-    protected Map<Object,Map<E, Number>> edgeRankScores = 
-       LazyMap.decorate(
-                       new HashMap<Object,Map<E,Number>>(),
-                       new Factory<Map<E,Number>>() {
-                                       public Map<E,Number> create() {
-                                               return new HashMap<E,Number>();
-                                       }});
-    private Map<E,Number> edgeWeights = new HashMap<E,Number>();
-
-    protected void initialize(Graph<V,E> graph, boolean isNodeRanker, 
-        boolean isEdgeRanker) {
-        if (!isNodeRanker && !isEdgeRanker)
-            throw new IllegalArgumentException("Must rank edges, vertices, or both");
-        mGraph = graph;
-        mRemoveRankScoresOnFinalize = true;
-        mNormalizeRankings = true;
-        mRankNodes = isNodeRanker;
-        mRankEdges = isEdgeRanker;
-    }
-    
-    /**
-        * @return all rankScores
-        */
-       public Map<Object,Map<V, Number>> getVertexRankScores() {
-               return vertexRankScores;
-       }
-
-       public Map<Object,Map<E, Number>> getEdgeRankScores() {
-               return edgeRankScores;
-       }
-
-    /**
-        * @return the rankScores
-        */
-       public Map<V, Number> getVertexRankScores(Object key) {
-               return vertexRankScores.get(key);
-       }
-
-       public Map<E, Number> getEdgeRankScores(Object key) {
-               return edgeRankScores.get(key);
-       }
-
-       protected Collection<V> getVertices() {
-        return mGraph.getVertices();
-    }
-
-       protected int getVertexCount() {
-        return mGraph.getVertexCount();
-    }
-
-    protected Graph<V,E> getGraph() {
-        return mGraph;
-    }
-
-    @Override
-    public void reset() {
-    }
-
-    /**
-     * Returns <code>true</code> if this ranker ranks nodes, and 
-     * <code>false</code> otherwise.
-     */
-    public boolean isRankingNodes() {
-        return mRankNodes;
-    }
-
-    /**
-     * Returns <code>true</code> if this ranker ranks edges, and 
-     * <code>false</code> otherwise.
-     */
-    public boolean isRankingEdges() {
-        return mRankEdges;
-    }
-    
-    /**
-     * Instructs the ranker whether or not it should remove the rank scores from the nodes (or edges) once the ranks
-     * have been computed.
-     * @param removeRankScoresOnFinalize <code>true</code> if the rank scores are to be removed, <code>false</code> otherwise
-     */
-    public void setRemoveRankScoresOnFinalize(boolean removeRankScoresOnFinalize) {
-        this.mRemoveRankScoresOnFinalize = removeRankScoresOnFinalize;
-    }
-
-    protected void onFinalize(Object e) {}
-    
-    /**
-     * The user datum key used to store the rank score.
-     * @return the key
-     */
-    abstract public Object getRankScoreKey();
-
-
-    @Override
-    protected void finalizeIterations() {
-        List<Ranking<?>> sortedRankings = new ArrayList<Ranking<?>>();
-
-        int id = 1;
-        if (mRankNodes) {
-            for (V currentVertex : getVertices()) {
-                Ranking<V> ranking = new Ranking<V>(id,getVertexRankScore(currentVertex),currentVertex);
-                sortedRankings.add(ranking);
-                if (mRemoveRankScoresOnFinalize) {
-                       this.vertexRankScores.get(getRankScoreKey()).remove(currentVertex);
-                }
-                id++;
-                onFinalize(currentVertex);
-            }
-        }
-        if (mRankEdges) {
-            for (E currentEdge : mGraph.getEdges()) {
-
-                Ranking<E> ranking = new Ranking<E>(id,getEdgeRankScore(currentEdge),currentEdge);
-                sortedRankings.add(ranking);
-                if (mRemoveRankScoresOnFinalize) {
-                       this.edgeRankScores.get(getRankScoreKey()).remove(currentEdge);
-                }
-                id++;
-                onFinalize(currentEdge);
-            }
-        }
-
-        mRankings = sortedRankings;
-        Collections.sort(mRankings);
-    }
-
-    /**
-     * Retrieves the list of ranking instances in descending sorted order by rank score
-     * If the algorithm is ranking edges, the instances will be of type <code>EdgeRanking</code>, otherwise
-     * if the algorithm is ranking nodes the instances will be of type <code>NodeRanking</code>
-     * @return  the list of rankings
-     */
-    public List<Ranking<?>> getRankings() {
-        return mRankings;
-    }
-
-    /**
-     * Return a list of the top k rank scores.
-     * @param topKRankings the value of k to use
-     * @return list of rank scores
-     */
-    public List<Double> getRankScores(int topKRankings) {
-        List<Double> scores = new ArrayList<Double>();
-        int count=1;
-        for (Ranking<?> currentRanking : getRankings()) {
-            if (count > topKRankings) {
-                return scores;
-            }
-            scores.add(currentRanking.rankScore);
-            count++;
-        }
-
-        return scores;
-    }
-
-    /**
-     * Given an edge or node, returns the corresponding rank score. This is a default
-     * implementation of getRankScore which assumes the decorations are of type MutableDouble.
-     * This method only returns legal values if <code>setRemoveRankScoresOnFinalize(false)</code> was called
-     * prior to <code>evaluate()</code>.
-     * @return  the rank score value
-     */
-    public double getVertexRankScore(V v) {
-        Number rankScore = vertexRankScores.get(getRankScoreKey()).get(v);
-        if (rankScore != null) {
-            return rankScore.doubleValue();
-        } else {
-            throw new RuntimeException("setRemoveRankScoresOnFinalize(false) must be called before evaluate().");
-        }
-    }
-    
-    public double getVertexRankScore(V v, Object key) {
-       return vertexRankScores.get(key).get(v).doubleValue();
-    }
-
-    public double getEdgeRankScore(E e) {
-        Number rankScore = edgeRankScores.get(getRankScoreKey()).get(e);
-        if (rankScore != null) {
-            return rankScore.doubleValue();
-        } else {
-            throw new RuntimeException("setRemoveRankScoresOnFinalize(false) must be called before evaluate().");
-        }
-    }
-    
-    public double getEdgeRankScore(E e, Object key) {
-       return edgeRankScores.get(key).get(e).doubleValue();
-    }
-
-    protected void setVertexRankScore(V v, double rankValue, Object key) {
-       vertexRankScores.get(key).put(v, rankValue);
-    }
-
-    protected void setEdgeRankScore(E e, double rankValue, Object key) {
-               edgeRankScores.get(key).put(e, rankValue);
-    }
-
-    protected void setVertexRankScore(V v, double rankValue) {
-       setVertexRankScore(v,rankValue, getRankScoreKey());
-    }
-
-    protected void setEdgeRankScore(E e, double rankValue) {
-       setEdgeRankScore(e, rankValue, getRankScoreKey());
-    }
-
-    protected void removeVertexRankScore(V v, Object key) {
-       vertexRankScores.get(key).remove(v);
-    }
-
-    protected void removeEdgeRankScore(E e, Object key) {
-       edgeRankScores.get(key).remove(e);
-    }
-
-    protected void removeVertexRankScore(V v) {
-       vertexRankScores.get(getRankScoreKey()).remove(v);
-    }
-
-    protected void removeEdgeRankScore(E e) {
-       edgeRankScores.get(getRankScoreKey()).remove(e);
-    }
-
-    protected double getEdgeWeight(E e) {
-       return edgeWeights.get(e).doubleValue();
-    }
-
-    protected void setEdgeWeight(E e, double weight) {
-       edgeWeights.put(e, weight);
-    }
-    
-    public void setEdgeWeights(Map<E,Number> edgeWeights) {
-       this.edgeWeights = edgeWeights;
-    }
-
-    /**
-        * @return the edgeWeights
-        */
-       public Map<E, Number> getEdgeWeights() {
-               return edgeWeights;
-       }
-
-       protected void assignDefaultEdgeTransitionWeights() {
-
-        for (V currentVertex : getVertices()) {
-
-            Collection<E> outgoingEdges = mGraph.getOutEdges(currentVertex);
-
-            double numOutEdges = outgoingEdges.size();
-            for (E currentEdge : outgoingEdges) {
-                setEdgeWeight(currentEdge,1.0/numOutEdges);
-            }
-        }
-    }
-
-    protected void normalizeEdgeTransitionWeights() {
-
-        for (V currentVertex : getVertices()) {
-
-               Collection<E> outgoingEdges = mGraph.getOutEdges(currentVertex);
-
-            double totalEdgeWeight = 0;
-            for (E currentEdge : outgoingEdges) {
-                totalEdgeWeight += getEdgeWeight(currentEdge);
-            }
-
-            for (E currentEdge : outgoingEdges) {
-                setEdgeWeight(currentEdge,getEdgeWeight(currentEdge)/totalEdgeWeight);
-            }
-        }
-    }
-
-    protected void normalizeRankings() {
-        if (!mNormalizeRankings) {
-            return;
-        }
-        double totalWeight = 0;
-
-        for (V currentVertex : getVertices()) {
-            totalWeight += getVertexRankScore(currentVertex);
-        }
-
-        for (V currentVertex : getVertices()) {
-            setVertexRankScore(currentVertex,getVertexRankScore(currentVertex)/totalWeight);
-        }
-    }
-
-    /**
-     * Print the rankings to standard out in descending order of rank score
-     * @param verbose if <code>true</code>, include information about the actual rank order as well as
-     * the original position of the vertex before it was ranked
-     * @param printScore if <code>true</code>, include the actual value of the rank score
-     */
-    public void printRankings(boolean verbose,boolean printScore) {
-            double total = 0;
-            Format formatter = new DecimalFormat("#0.#######");
-            int rank = 1;
-
-            for (Ranking<?> currentRanking : getRankings()) {
-                double rankScore = currentRanking.rankScore;
-                if (verbose) {
-                    System.out.print("Rank " + rank + ": ");
-                    if (printScore) {
-                        System.out.print(formatter.format(rankScore));
-                    }
-                    System.out.print("\tVertex Id: " + currentRanking.originalPos);
-                        System.out.print(" (" + currentRanking.getRanked() + ")");
-                    System.out.println();
-                } else {
-                    System.out.print(rank + "\t");
-                     if (printScore) {
-                        System.out.print(formatter.format(rankScore));
-                    }
-                    System.out.println("\t" + currentRanking.originalPos);
-
-                }
-                total += rankScore;
-                rank++;
-            }
-
-            if (verbose) {
-                System.out.println("Total: " + formatter.format(total));
-            }
-    }
-
-    /**
-     * Allows the user to specify whether or not s/he wants the rankings to be normalized.
-     * In some cases, this will have no effect since the algorithm doesn't allow normalization
-     * as an option
-     * @param normalizeRankings
-     */
-    public void setNormalizeRankings(boolean normalizeRankings) {
-        mNormalizeRankings = normalizeRankings;
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/importance/BetweennessCentrality.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/importance/BetweennessCentrality.java
deleted file mode 100644 (file)
index 25906f2..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.importance;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Stack;
-
-import org.apache.commons.collections15.Buffer;
-import org.apache.commons.collections15.buffer.UnboundedFifoBuffer;
-
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.UndirectedGraph;
-
-/**
- * Computes betweenness centrality for each vertex and edge in the graph. The result is that each vertex
- * and edge has a UserData element of type MutableDouble whose key is 'centrality.BetweennessCentrality'.
- * Note: Many social network researchers like to normalize the betweenness values by dividing the values by
- * (n-1)(n-2)/2. The values given here are unnormalized.<p>
- *
- * A simple example of usage is:
- * <pre>
- * BetweennessCentrality ranker = new BetweennessCentrality(someGraph);
- * ranker.evaluate();
- * ranker.printRankings();
- * </pre>
- *
- * Running time is: O(n^2 + nm).
- * @see "Ulrik Brandes: A Faster Algorithm for Betweenness Centrality. Journal of Mathematical Sociology 25(2):163-177, 2001."
- * @author Scott White
- * @author Tom Nelson converted to jung2
- */
-
-public class BetweennessCentrality<V,E> extends AbstractRanker<V,E> {
-
-    public static final String CENTRALITY = "centrality.BetweennessCentrality";
-
-    /**
-     * Constructor which initializes the algorithm
-     * @param g the graph whose nodes are to be analyzed
-     */
-    public BetweennessCentrality(Graph<V,E> g) {
-        initialize(g, true, true);
-    }
-
-    public BetweennessCentrality(Graph<V,E> g, boolean rankNodes) {
-        initialize(g, rankNodes, true);
-    }
-
-    public BetweennessCentrality(Graph<V,E> g, boolean rankNodes, boolean rankEdges)
-    {
-        initialize(g, rankNodes, rankEdges);
-    }
-    
-       protected void computeBetweenness(Graph<V,E> graph) {
-
-       Map<V,BetweennessData> decorator = new HashMap<V,BetweennessData>();
-       Map<V,Number> bcVertexDecorator = 
-               vertexRankScores.get(getRankScoreKey());
-       bcVertexDecorator.clear();
-       Map<E,Number> bcEdgeDecorator = 
-               edgeRankScores.get(getRankScoreKey());
-       bcEdgeDecorator.clear();
-        
-        Collection<V> vertices = graph.getVertices();
-        
-        for (V s : vertices) {
-
-            initializeData(graph,decorator);
-
-            decorator.get(s).numSPs = 1;
-            decorator.get(s).distance = 0;
-
-            Stack<V> stack = new Stack<V>();
-            Buffer<V> queue = new UnboundedFifoBuffer<V>();
-            queue.add(s);
-
-            while (!queue.isEmpty()) {
-                V v = queue.remove();
-                stack.push(v);
-
-                for(V w : getGraph().getSuccessors(v)) {
-
-                    if (decorator.get(w).distance < 0) {
-                        queue.add(w);
-                        decorator.get(w).distance = decorator.get(v).distance + 1;
-                    }
-
-                    if (decorator.get(w).distance == decorator.get(v).distance + 1) {
-                        decorator.get(w).numSPs += decorator.get(v).numSPs;
-                        decorator.get(w).predecessors.add(v);
-                    }
-                }
-            }
-            
-            while (!stack.isEmpty()) {
-                V w = stack.pop();
-
-                for (V v : decorator.get(w).predecessors) {
-
-                    double partialDependency = (decorator.get(v).numSPs / decorator.get(w).numSPs);
-                    partialDependency *= (1.0 + decorator.get(w).dependency);
-                    decorator.get(v).dependency +=  partialDependency;
-                    E currentEdge = getGraph().findEdge(v, w);
-                    double edgeValue = bcEdgeDecorator.get(currentEdge).doubleValue();
-                    edgeValue += partialDependency;
-                    bcEdgeDecorator.put(currentEdge, edgeValue);
-                }
-                if (w != s) {
-                       double bcValue = bcVertexDecorator.get(w).doubleValue();
-                       bcValue += decorator.get(w).dependency;
-                       bcVertexDecorator.put(w, bcValue);
-                }
-            }
-        }
-
-        if(graph instanceof UndirectedGraph) {
-            for (V v : vertices) { 
-               double bcValue = bcVertexDecorator.get(v).doubleValue();
-               bcValue /= 2.0;
-               bcVertexDecorator.put(v, bcValue);
-            }
-            for (E e : graph.getEdges()) {
-               double bcValue = bcEdgeDecorator.get(e).doubleValue();
-               bcValue /= 2.0;
-               bcEdgeDecorator.put(e, bcValue);
-            }
-        }
-
-        for (V vertex : vertices) {
-            decorator.remove(vertex);
-        }
-    }
-
-    private void initializeData(Graph<V,E> g, Map<V,BetweennessData> decorator) {
-        for (V vertex : g.getVertices()) {
-
-               Map<V,Number> bcVertexDecorator = vertexRankScores.get(getRankScoreKey());
-               if(bcVertexDecorator.containsKey(vertex) == false) {
-                       bcVertexDecorator.put(vertex, 0.0);
-               }
-            decorator.put(vertex, new BetweennessData());
-        }
-        for (E e : g.getEdges()) {
-
-               Map<E,Number> bcEdgeDecorator = edgeRankScores.get(getRankScoreKey());
-               if(bcEdgeDecorator.containsKey(e) == false) {
-                       bcEdgeDecorator.put(e, 0.0);
-               }
-        }
-    }
-    
-    /**
-     * the user datum key used to store the rank scores
-     * @return the key
-     */
-    @Override
-    public String getRankScoreKey() {
-        return CENTRALITY;
-    }
-
-    @Override
-    public void step() {
-        computeBetweenness(getGraph());
-    }
-
-    class BetweennessData {
-        double distance;
-        double numSPs;
-        List<V> predecessors;
-        double dependency;
-
-        BetweennessData() {
-            distance = -1;
-            numSPs = 0;
-            predecessors = new ArrayList<V>();
-            dependency = 0;
-        }
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/importance/KStepMarkov.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/importance/KStepMarkov.java
deleted file mode 100644 (file)
index 9ee4030..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.importance;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import edu.uci.ics.jung.graph.DirectedGraph;
-
-
-/**
- * Algorithm variant of <code>PageRankWithPriors</code> that computes the importance of a node based upon taking fixed-length random
- * walks out from the root set and then computing the stationary probability of being at each node. Specifically, it computes
- * the relative probability that the markov chain will spend at any particular node, given that it start in the root
- * set and ends after k steps.
- * <p>
- * A simple example of usage is:
- * <pre>
- * KStepMarkov ranker = new KStepMarkov(someGraph,rootSet,6,null);
- * ranker.evaluate();
- * ranker.printRankings();
- * </pre>
- * <p>
- *
- * @author Scott White
- * @author Tom Nelson - adapter to jung2
- * @see "Algorithms for Estimating Relative Importance in Graphs by Scott White and Padhraic Smyth, 2003"
- */
-public class KStepMarkov<V,E> extends RelativeAuthorityRanker<V,E> {
-    public final static String RANK_SCORE = "jung.algorithms.importance.KStepMarkovExperimental.RankScore";
-    private final static String CURRENT_RANK = "jung.algorithms.importance.KStepMarkovExperimental.CurrentRank";
-    private int mNumSteps;
-    HashMap<V,Number> mPreviousRankingsMap;
-
-    /**
-     * Construct the algorihm instance and initializes the algorithm.
-     * @param graph the graph to be analyzed
-     * @param priors the set of root nodes
-     * @param k positive integer parameter which controls the relative tradeoff between a distribution "biased" towards
-     * R and the steady-state distribution which is independent of where the Markov-process started. Generally values
-     * between 4-8 are reasonable
-     * @param edgeWeights the weight for each edge 
-     */
-    public KStepMarkov(DirectedGraph<V,E> graph, Set<V> priors, int k, Map<E,Number> edgeWeights) {
-        super.initialize(graph,true,false);
-        mNumSteps = k;
-        setPriors(priors);
-        initializeRankings();
-        if (edgeWeights == null) {
-            assignDefaultEdgeTransitionWeights();
-        } else {
-            setEdgeWeights(edgeWeights);
-        }
-        normalizeEdgeTransitionWeights();
-    }
-
-    /**
-     * The user datum key used to store the rank scores.
-     * @return the key
-     */
-    @Override
-    public String getRankScoreKey() {
-        return RANK_SCORE;
-    }
-
-    protected void incrementRankScore(V v, double rankValue) {
-       double value = getVertexRankScore(v, RANK_SCORE);
-       value += rankValue;
-       setVertexRankScore(v, value, RANK_SCORE);
-    }
-
-    protected double getCurrentRankScore(V v) {
-       return getVertexRankScore(v, CURRENT_RANK);
-    }
-
-    protected void setCurrentRankScore(V v, double rankValue) {
-       setVertexRankScore(v, rankValue, CURRENT_RANK);
-    }
-
-    protected void initializeRankings() {
-         mPreviousRankingsMap = new HashMap<V,Number>();
-         for (V v : getVertices()) {
-            Set<V> priors = getPriors();
-            double numPriors = priors.size();
-
-            if (getPriors().contains(v)) {
-                setVertexRankScore(v, 1.0/ numPriors);
-                setCurrentRankScore(v, 1.0/ numPriors);
-                mPreviousRankingsMap.put(v,1.0/numPriors);
-            } else {
-                setVertexRankScore(v, 0);
-                setCurrentRankScore(v, 0);
-                mPreviousRankingsMap.put(v, 0);
-            }
-        }
-     }
-    @Override
-    public void step() {
-
-        for (int i=0;i<mNumSteps;i++) {
-            updateRankings();
-            for (V v : getVertices()) {
-                double currentRankScore = getCurrentRankScore(v);
-                incrementRankScore(v,currentRankScore);
-                mPreviousRankingsMap.put(v, currentRankScore);
-            }
-        }
-        normalizeRankings();
-    }
-
-    protected void updateRankings() {
-
-        for (V v : getVertices()) {
-
-            Collection<E> incomingEdges = getGraph().getInEdges(v);
-
-            double currentPageRankSum = 0;
-            for (E e : incomingEdges) {
-                double currentWeight = getEdgeWeight(e);
-                currentPageRankSum += 
-                       mPreviousRankingsMap.get(getGraph().getOpposite(v,e)).doubleValue()*currentWeight;
-            }
-            setCurrentRankScore(v,currentPageRankSum);
-        }
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/importance/Ranking.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/importance/Ranking.java
deleted file mode 100644 (file)
index b96e559..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.importance;
-
-
-/**
- * Abstract data container for ranking objects. Stores common data relevant to both node and edge rankings, namely,
- * the original position of the instance in the list and the actual ranking score.
- * @author Scott White
- */
-public class Ranking<V> implements Comparable {
-    /**
-     * The original (0-indexed) position of the instance being ranked
-     */
-    public int originalPos;
-    /**
-     * The actual rank score (normally between 0 and 1)
-     */
-    public double rankScore;
-    
-    /**
-     * what is being ranked
-     */
-    private V ranked;
-
-    /**
-     * Constructor which allows values to be set on construction
-     * @param originalPos The original (0-indexed) position of the instance being ranked
-     * @param rankScore The actual rank score (normally between 0 and 1)
-     */
-    public Ranking(int originalPos, double rankScore, V ranked) {
-        this.originalPos = originalPos;
-        this.rankScore = rankScore;
-        this.ranked = ranked;
-    }
-
-    /**
-     * Compares two ranking based on the rank score.
-     * @param o The other ranking
-     * @return -1 if the other ranking is higher, 0 if they are equal, and 1 if this ranking is higher
-     */
-    public int compareTo(Object o) {
-
-        Ranking otherRanking = (Ranking) o;
-        return Double.compare(otherRanking.rankScore,rankScore);
-    }
-
-    /**
-     * Returns the rank score as a string.
-     * @return the stringified rank score
-     */
-    @Override
-    public String toString() {
-        return String.valueOf(rankScore);
-    }
-
-       /**
-        * @return the ranked
-        */
-       public V getRanked() {
-               return ranked;
-       }
-
-       /**
-        * @param ranked the ranked to set
-        */
-       public void setRanked(V ranked) {
-               this.ranked = ranked;
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/importance/RelativeAuthorityRanker.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/importance/RelativeAuthorityRanker.java
deleted file mode 100644 (file)
index b40ba8d..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.importance;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-
-/**
- * This class provides basic infrastructure for relative authority algorithms that compute the importance of nodes
- * relative to one or more root nodes. The services provided are:
- * <ul>
- * <li>The set of root nodes (priors) is stored and maintained</li>
- * <li>Getters and setters for the prior rank score are provided</li>
- * </ul>
- * 
- * @author Scott White
- */
-public abstract class RelativeAuthorityRanker<V,E> extends AbstractRanker<V,E> {
-    private Set<V> mPriors;
-    /**
-     * The default key used for the user datum key corresponding to prior rank scores.
-     */
-
-    protected Map<V,Number> priorRankScoreMap = new HashMap<V,Number>();
-    /**
-     * Cleans up all of the prior rank scores on finalize.
-     */
-    @Override
-    protected void finalizeIterations() {
-        super.finalizeIterations();
-        priorRankScoreMap.clear();
-    }
-
-    /**
-     * Retrieves the value of the prior rank score.
-     * @param v the root node (prior)
-     * @return the prior rank score
-     */
-    protected double getPriorRankScore(V v) {
-       return priorRankScoreMap.get(v).doubleValue();
-
-    }
-
-    /**
-     * Allows the user to specify a value to set for the prior rank score
-     * @param v the root node (prior)
-     * @param value the score to set to
-     */
-    public void setPriorRankScore(V v, double value) {
-       this.priorRankScoreMap.put(v, value);
-    }
-
-    /**
-     * Retrieves the set of priors.
-     * @return the set of root nodes (priors)
-     */
-    protected Set<V> getPriors() { return mPriors; }
-
-    /**
-     * Specifies which vertices are root nodes (priors).
-     * @param priors the root nodes
-     */
-    protected void setPriors(Set<V> priors) { mPriors = priors; }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/importance/WeightedNIPaths.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/importance/WeightedNIPaths.java
deleted file mode 100644 (file)
index bd715ce..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.importance;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.collections15.Factory;
-
-import edu.uci.ics.jung.graph.DirectedGraph;
-
-
-
-/**
- * This algorithm measures the importance of nodes based upon both the number and length of disjoint paths that lead
- * to a given node from each of the nodes in the root set. Specifically the formula for measuring the importance of a
- * node is given by: I(t|R) = sum_i=1_|P(r,t)|_{alpha^|p_i|} where alpha is the path decay coefficient, p_i is path i
- * and P(r,t) is a set of maximum-sized node-disjoint paths from r to t.
- * <p>
- * This algorithm uses heuristic breadth-first search to try and find the maximum-sized set of node-disjoint paths
- * between two nodes. As such, it is not guaranteed to give exact answers.
- * <p>
- * A simple example of usage is:
- * <pre>
- * WeightedNIPaths ranker = new WeightedNIPaths(someGraph,2.0,6,rootSet);
- * ranker.evaluate();
- * ranker.printRankings();
- * </pre>
- * 
- * @author Scott White
- * @see "Algorithms for Estimating Relative Importance in Graphs by Scott White and Padhraic Smyth, 2003"
- */
-public class WeightedNIPaths<V,E> extends AbstractRanker<V,E> {
-    public final static String WEIGHTED_NIPATHS_KEY = "jung.algorithms.importance.WEIGHTED_NIPATHS_KEY";
-    private double mAlpha;
-    private int mMaxDepth;
-    private Set<V> mPriors;
-    private Map<E,Number> pathIndices = new HashMap<E,Number>();
-    private Map<Object,V> roots = new HashMap<Object,V>();
-    private Map<V,Set<Number>> pathsSeenMap = new HashMap<V,Set<Number>>();
-    private Factory<V> vertexFactory;
-    private Factory<E> edgeFactory;
-
-    /**
-     * Constructs and initializes the algorithm.
-     * @param graph the graph whose nodes are being measured for their importance
-     * @param alpha the path decay coefficient (>= 1); 2 is recommended
-     * @param maxDepth the maximal depth to search out from the root set
-     * @param priors the root set (starting vertices)
-     */
-    public WeightedNIPaths(DirectedGraph<V,E> graph, Factory<V> vertexFactory,
-               Factory<E> edgeFactory, double alpha, int maxDepth, Set<V> priors) {
-        super.initialize(graph, true,false);
-        this.vertexFactory = vertexFactory;
-        this.edgeFactory = edgeFactory;
-        mAlpha = alpha;
-        mMaxDepth = maxDepth;
-        mPriors = priors;
-        for (V v : graph.getVertices()) {
-               super.setVertexRankScore(v, 0.0);
-        }
-    }
-
-    protected void incrementRankScore(V v, double rankValue) {
-        setVertexRankScore(v, getVertexRankScore(v) + rankValue);
-    }
-
-    protected void computeWeightedPathsFromSource(V root, int depth) {
-
-        int pathIdx = 1;
-
-        for (E e : getGraph().getOutEdges(root)) {
-            this.pathIndices.put(e, pathIdx);
-            this.roots.put(e, root);
-            newVertexEncountered(pathIdx, getGraph().getEndpoints(e).getSecond(), root);
-            pathIdx++;
-        }
-
-        List<E> edges = new ArrayList<E>();
-
-        V virtualNode = vertexFactory.create();
-        getGraph().addVertex(virtualNode);
-        E virtualSinkEdge = edgeFactory.create();
-
-        getGraph().addEdge(virtualSinkEdge, virtualNode, root);
-        edges.add(virtualSinkEdge);
-
-        int currentDepth = 0;
-        while (currentDepth <= depth) {
-
-            double currentWeight = Math.pow(mAlpha, -1.0 * currentDepth);
-            for (E currentEdge : edges) { 
-                incrementRankScore(getGraph().getEndpoints(currentEdge).getSecond(),//
-                               currentWeight);
-            }
-
-            if ((currentDepth == depth) || (edges.size() == 0)) break;
-
-            List<E> newEdges = new ArrayList<E>();
-
-            for (E currentSourceEdge : edges) { //Iterator sourceEdgeIt = edges.iterator(); sourceEdgeIt.hasNext();) {
-                Number sourcePathIndex = this.pathIndices.get(currentSourceEdge);
-
-                // from the currentSourceEdge, get its opposite end
-                // then iterate over the out edges of that opposite end
-                V newDestVertex = getGraph().getEndpoints(currentSourceEdge).getSecond();
-                Collection<E> outs = getGraph().getOutEdges(newDestVertex);
-                for (E currentDestEdge : outs) {
-                       V destEdgeRoot = this.roots.get(currentDestEdge);
-                       V destEdgeDest = getGraph().getEndpoints(currentDestEdge).getSecond();
-
-                    if (currentSourceEdge == virtualSinkEdge) {
-                        newEdges.add(currentDestEdge);
-                        continue;
-                    }
-                    if (destEdgeRoot == root) {
-                        continue;
-                    }
-                    if (destEdgeDest == getGraph().getEndpoints(currentSourceEdge).getFirst()) {//currentSourceEdge.getSource()) {
-                        continue;
-                    }
-                    Set<Number> pathsSeen = this.pathsSeenMap.get(destEdgeDest);
-
-                    if (pathsSeen == null) {
-                        newVertexEncountered(sourcePathIndex.intValue(), destEdgeDest, root);
-                    } else if (roots.get(destEdgeDest) != root) {
-                        roots.put(destEdgeDest,root);
-                        pathsSeen.clear();
-                        pathsSeen.add(sourcePathIndex);
-                    } else if (!pathsSeen.contains(sourcePathIndex)) {
-                        pathsSeen.add(sourcePathIndex);
-                    } else {
-                        continue;
-                    }
-
-                    this.pathIndices.put(currentDestEdge, sourcePathIndex);
-                    this.roots.put(currentDestEdge, root);
-                    newEdges.add(currentDestEdge);
-                }
-            }
-
-            edges = newEdges;
-            currentDepth++;
-        }
-
-        getGraph().removeVertex(virtualNode);
-    }
-
-    private void newVertexEncountered(int sourcePathIndex, V dest, V root) {
-        Set<Number> pathsSeen = new HashSet<Number>();
-        pathsSeen.add(sourcePathIndex);
-        this.pathsSeenMap.put(dest, pathsSeen);
-        roots.put(dest, root);
-    }
-
-    @Override
-    public void step() {
-        for (V v : mPriors) {
-            computeWeightedPathsFromSource(v, mMaxDepth);
-        }
-
-        normalizeRankings();
-//        return 0;
-    }
-    
-    /**
-     * Given a node, returns the corresponding rank score. This implementation of <code>getRankScore</code> assumes
-     * the decoration representing the rank score is of type <code>MutableDouble</code>.
-     * @return  the rank score for this node
-     */
-    @Override
-    public String getRankScoreKey() {
-        return WEIGHTED_NIPATHS_KEY;
-    }
-
-    @Override
-    protected void onFinalize(Object udc) {
-       pathIndices.remove(udc);
-       roots.remove(udc);
-       pathsSeenMap.remove(udc);
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/AbstractLayout.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/AbstractLayout.java
deleted file mode 100644 (file)
index b59dcfa..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University of
- * California All rights reserved.
- * 
- * This software is open-source under the BSD license; see either "license.txt"
- * or http://jung.sourceforge.net/license.txt for a description.
- * 
- * Created on Jul 7, 2003
- * 
- */
-package edu.uci.ics.jung.algorithms.layout;
-
-import java.awt.Dimension;
-import java.awt.geom.Point2D;
-import java.util.ConcurrentModificationException;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.collections15.Transformer;
-import org.apache.commons.collections15.functors.ChainedTransformer;
-import org.apache.commons.collections15.functors.CloneTransformer;
-import org.apache.commons.collections15.map.LazyMap;
-
-import edu.uci.ics.jung.graph.Graph;
-
-/**
- * Abstract class for implementations of {@code Layout}.  It handles some of the
- * basic functions: storing coordinates, maintaining the dimensions, initializing
- * the locations, maintaining locked vertices.
- * 
- * @author Danyel Fisher, Scott White
- * @author Tom Nelson - converted to jung2
- * @param <V> the vertex type
- * @param <E> the edge type
- */
-abstract public class AbstractLayout<V, E> implements Layout<V,E> {
-
-    /**
-     * a set of vertices that should not move in relation to the
-     * other vertices
-     */
-       private Set<V> dontmove = new HashSet<V>();
-
-       protected Dimension size;
-       protected Graph<V, E> graph;
-       protected boolean initialized;
-    
-    protected Map<V, Point2D> locations = 
-       LazyMap.decorate(new HashMap<V, Point2D>(),
-                       new Transformer<V,Point2D>() {
-                                       public Point2D transform(V arg0) {
-                                               return new Point2D.Double();
-                                       }});
-
-
-       /**
-        * Creates an instance which does not initialize the vertex locations.
-        * 
-        * @param graph the graph for which the layout algorithm is to be created.
-        */
-       protected AbstractLayout(Graph<V, E> graph) {
-           if (graph == null) 
-           {
-               throw new IllegalArgumentException("Graph must be non-null");
-           }
-               this.graph = graph;
-       }
-       
-    @SuppressWarnings("unchecked")
-    protected AbstractLayout(Graph<V,E> graph, Transformer<V,Point2D> initializer) {
-               this.graph = graph;
-               Transformer<V, ? extends Object> chain = 
-                       ChainedTransformer.getInstance(initializer, CloneTransformer.getInstance());
-               this.locations = LazyMap.decorate(new HashMap<V,Point2D>(), (Transformer<V,Point2D>)chain);
-               initialized = true;
-       }
-       
-       protected AbstractLayout(Graph<V,E> graph, Dimension size) {
-               this.graph = graph;
-               this.size = size;
-       }
-       
-       @SuppressWarnings("unchecked")
-    protected AbstractLayout(Graph<V,E> graph, Transformer<V,Point2D> initializer, Dimension size) {
-               this.graph = graph;
-               Transformer<V, ? extends Object> chain = 
-                       ChainedTransformer.getInstance(initializer, CloneTransformer.getInstance());
-               this.locations = LazyMap.decorate(new HashMap<V,Point2D>(), (Transformer<V,Point2D>)chain);
-               this.size = size;
-       }
-    
-    public void setGraph(Graph<V,E> graph) {
-        this.graph = graph;
-        if(size != null && graph != null) {
-               initialize();
-        }
-    }
-    
-       /**
-        * When a visualization is resized, it presumably wants to fix the
-        * locations of the vertices and possibly to reinitialize its data. The
-        * current method calls <tt>initializeLocations</tt> followed by <tt>initialize_local</tt>.
-        */
-       public void setSize(Dimension size) {
-               
-               if(size != null && graph != null) {
-                       
-                       Dimension oldSize = this.size;
-                       this.size = size;
-                       initialize();
-                       
-                       if(oldSize != null) {
-                               adjustLocations(oldSize, size);
-                       }
-               }
-       }
-       
-       private void adjustLocations(Dimension oldSize, Dimension size) {
-
-               int xOffset = (size.width - oldSize.width) / 2;
-               int yOffset = (size.height - oldSize.height) / 2;
-
-               // now, move each vertex to be at the new screen center
-               while(true) {
-                   try {
-                for(V v : getGraph().getVertices()) {
-                           offsetVertex(v, xOffset, yOffset);
-                       }
-                       break;
-                   } catch(ConcurrentModificationException cme) {
-                   }
-               }
-       }
-    
-    public boolean isLocked(V v) {
-        return dontmove.contains(v);
-    }
-    
-    @SuppressWarnings("unchecked")
-    public void setInitializer(Transformer<V,Point2D> initializer) {
-       if(this.equals(initializer)) {
-               throw new IllegalArgumentException("Layout cannot be initialized with itself");
-       }
-               Transformer<V, ? extends Object> chain = 
-                       ChainedTransformer.getInstance(initializer, CloneTransformer.getInstance());
-       this.locations = LazyMap.decorate(new HashMap<V,Point2D>(), (Transformer<V, Point2D>)chain);
-       initialized = true;
-    }
-    
-       /**
-        * Returns the current size of the visualization space, accoring to the
-        * last call to resize().
-        * 
-        * @return the current size of the screen
-        */
-       public Dimension getSize() {
-               return size;
-       }
-
-       /**
-        * Returns the Coordinates object that stores the vertex' x and y location.
-        * 
-        * @param v
-        *            A Vertex that is a part of the Graph being visualized.
-        * @return A Coordinates object with x and y locations.
-        */
-       private Point2D getCoordinates(V v) {
-        return locations.get(v);
-       }
-       
-       public Point2D transform(V v) {
-               return getCoordinates(v);
-       }
-       
-       /**
-        * Returns the x coordinate of the vertex from the Coordinates object.
-        * in most cases you will be better off calling transform(v).
-        */
-       public double getX(V v) {
-        assert getCoordinates(v) != null : "Cannot getX for an unmapped vertex "+v;
-        return getCoordinates(v).getX();
-       }
-
-       /**
-        * Returns the y coordinate of the vertex from the Coordinates object.
-        * In most cases you will be better off calling transform(v).
-        */
-       public double getY(V v) {
-        assert getCoordinates(v) != null : "Cannot getY for an unmapped vertex "+v;
-        return getCoordinates(v).getY();
-       }
-       
-       /**
-        * @param v
-        * @param xOffset
-        * @param yOffset
-        */
-       protected void offsetVertex(V v, double xOffset, double yOffset) {
-               Point2D c = getCoordinates(v);
-        c.setLocation(c.getX()+xOffset, c.getY()+yOffset);
-               setLocation(v, c);
-       }
-
-       /**
-        * Accessor for the graph that represets all vertices.
-        * 
-        * @return the graph that contains all vertices.
-        */
-       public Graph<V, E> getGraph() {
-           return graph;
-       }
-       
-       /**
-        * Forcibly moves a vertex to the (x,y) location by setting its x and y
-        * locations to the inputted location. Does not add the vertex to the
-        * "dontmove" list, and (in the default implementation) does not make any
-        * adjustments to the rest of the graph.
-        */
-       public void setLocation(V picked, double x, double y) {
-               Point2D coord = getCoordinates(picked);
-               coord.setLocation(x, y);
-       }
-
-       public void setLocation(V picked, Point2D p) {
-               Point2D coord = getCoordinates(picked);
-               coord.setLocation(p);
-       }
-
-       /**
-        * Locks {@code v} in place if {@code state} is {@code true}, otherwise unlocks it.
-        */
-       public void lock(V v, boolean state) {
-               if(state == true) 
-                   dontmove.add(v);
-               else 
-                   dontmove.remove(v);
-       }
-       
-       /**
-        * Locks all vertices in place if {@code lock} is {@code true}, otherwise unlocks all vertices.
-        */
-       public void lock(boolean lock) {
-               for(V v : graph.getVertices()) {
-                       lock(v, lock);
-               }
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/AggregateLayout.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/AggregateLayout.java
deleted file mode 100644 (file)
index 3805837..0000000
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University of
- * California All rights reserved.
- * 
- * This software is open-source under the BSD license; see either "license.txt"
- * or http://jung.sourceforge.net/license.txt for a description.
- * 
- * 
- * 
- */
-package edu.uci.ics.jung.algorithms.layout;
-
-import java.awt.Dimension;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Point2D;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.algorithms.util.IterativeContext;
-import edu.uci.ics.jung.graph.Graph;
-
-/**
- * A {@code Layout} implementation that combines 
- * multiple other layouts so that they may be manipulated
- * as one layout. The relaxer thread will step each layout
- * in sequence.
- * 
- * @author Tom Nelson - tomnelson@dev.java.net
- *
- * @param <V> the vertex type
- * @param <E> the edge type
- */
-public class AggregateLayout<V, E> implements Layout<V,E>, IterativeContext {
-
-       protected Layout<V,E> delegate;
-       protected Map<Layout<V,E>,Point2D> layouts = new HashMap<Layout<V,E>,Point2D>();
-
-       /**
-        * Creates an instance backed by the specified {@code delegate}.
-        * @param delegate
-        */
-       public AggregateLayout(Layout<V, E> delegate) {
-               this.delegate = delegate;
-       }
-
-       /**
-        * @return the delegate
-        */
-       public Layout<V, E> getDelegate() {
-               return delegate;
-       }
-
-       /**
-        * @param delegate the delegate to set
-        */
-       public void setDelegate(Layout<V, E> delegate) {
-               this.delegate = delegate;
-       }
-
-       /**
-        * adds the passed layout as a sublayout, also specifying
-        * the center of where this sublayout should appear
-        * @param layout
-        * @param center
-        */
-       public void put(Layout<V,E> layout, Point2D center) {
-               layouts.put(layout,center);
-       }
-       
-       /**
-        * Returns the center of the passed layout.
-        * @param layout
-        * @return the center of the passed layout
-        */
-       public Point2D get(Layout<V,E> layout) {
-               return layouts.get(layout);
-       }
-       
-       /**
-        * Removes {@code layout} from this instance.
-        */
-       public void remove(Layout<V,E> layout) {
-               layouts.remove(layout);
-       }
-       
-       /**
-        * Removes all layouts from this instance.
-        */
-       public void removeAll() {
-               layouts.clear();
-       }
-       
-       /**
-        * Returns the graph for which this layout is defined.
-        * @return the graph for which this layout is defined
-        * @see edu.uci.ics.jung.algorithms.layout.Layout#getGraph()
-        */
-       public Graph<V, E> getGraph() {
-               return delegate.getGraph();
-       }
-
-       /**
-        * Returns the size of the underlying layout.
-        * @return the size of the underlying layout
-        * @see edu.uci.ics.jung.algorithms.layout.Layout#getSize()
-        */
-       public Dimension getSize() {
-               return delegate.getSize();
-       }
-
-       /**
-        * 
-        * @see edu.uci.ics.jung.algorithms.layout.Layout#initialize()
-        */
-       public void initialize() {
-               delegate.initialize();
-               for(Layout<V,E> layout : layouts.keySet()) {
-                       layout.initialize();
-               }
-       }
-
-       /**
-        * Override to test if the passed vertex is locked in
-        * any of the layouts.
-        * @param v
-        * @return true if v is locked in any of the layouts, and false otherwise
-        * @see edu.uci.ics.jung.algorithms.layout.Layout#isLocked(java.lang.Object)
-        */
-       public boolean isLocked(V v) {
-               boolean locked = false;
-               for(Layout<V,E> layout : layouts.keySet()) {
-                       locked |= layout.isLocked(v);
-               }
-               locked |= delegate.isLocked(v);
-               return locked;
-       }
-
-       /**
-        * override to lock or unlock this vertex in any layout with
-        * a subgraph containing it
-        * @param v
-        * @param state
-        * @see edu.uci.ics.jung.algorithms.layout.Layout#lock(java.lang.Object, boolean)
-        */
-       public void lock(V v, boolean state) {
-               for(Layout<V,E> layout : layouts.keySet()) {
-                       if(layout.getGraph().getVertices().contains(v)) {
-                               layout.lock(v, state);
-                       }
-               }
-               delegate.lock(v, state);
-       }
-
-       /**
-        * 
-        * @see edu.uci.ics.jung.algorithms.layout.Layout#reset()
-        */
-       public void reset() {
-               for(Layout<V,E> layout : layouts.keySet()) {
-                       layout.reset();
-               }
-               delegate.reset();
-       }
-
-       /**
-        * @param graph
-        * @see edu.uci.ics.jung.algorithms.layout.Layout#setGraph(edu.uci.ics.jung.graph.Graph)
-        */
-       public void setGraph(Graph<V, E> graph) {
-               delegate.setGraph(graph);
-       }
-
-       /**
-        * @param initializer
-        * @see edu.uci.ics.jung.algorithms.layout.Layout#setInitializer(org.apache.commons.collections15.Transformer)
-        */
-       public void setInitializer(Transformer<V, Point2D> initializer) {
-               delegate.setInitializer(initializer);
-       }
-
-       /**
-        * @param v
-        * @param location
-        * @see edu.uci.ics.jung.algorithms.layout.Layout#setLocation(java.lang.Object, java.awt.geom.Point2D)
-        */
-       public void setLocation(V v, Point2D location) {
-               boolean wasInSublayout = false;
-               for(Layout<V,E> layout : layouts.keySet()) {
-                       if(layout.getGraph().getVertices().contains(v)) {
-                               Point2D center = layouts.get(layout);
-                               // transform by the layout itself, but offset to the
-                               // center of the sublayout
-                               Dimension d = layout.getSize();
-
-                               AffineTransform at = 
-                                       AffineTransform.getTranslateInstance(-center.getX()+d.width/2,-center.getY()+d.height/2);
-                               Point2D localLocation = at.transform(location, null);
-                               layout.setLocation(v, localLocation);
-                               wasInSublayout = true;
-                       }
-               }
-               if(wasInSublayout == false && getGraph().getVertices().contains(v)) {
-                       delegate.setLocation(v, location);
-               }
-       }
-
-       /**
-        * @param d
-        * @see edu.uci.ics.jung.algorithms.layout.Layout#setSize(java.awt.Dimension)
-        */
-       public void setSize(Dimension d) {
-               delegate.setSize(d);
-       }
-       
-       /**
-        * Returns a map from each {@code Layout} instance to its center point.
-        */
-       public Map<Layout<V,E>,Point2D> getLayouts() {
-               return layouts;
-       }
-
-       /**
-        * Returns the location of the vertex.  The location is specified first
-        * by the sublayouts, and then by the base layout if no sublayouts operate
-        * on this vertex.
-        * @return the location of the vertex
-        * @see org.apache.commons.collections15.Transformer#transform(java.lang.Object)
-        */
-       public Point2D transform(V v) {
-               boolean wasInSublayout = false;
-               for(Layout<V,E> layout : layouts.keySet()) {
-                       if(layout.getGraph().getVertices().contains(v)) {
-                               wasInSublayout = true;
-                               Point2D center = layouts.get(layout);
-                               // transform by the layout itself, but offset to the
-                               // center of the sublayout
-                               Dimension d = layout.getSize();
-                               AffineTransform at = 
-                                       AffineTransform.getTranslateInstance(center.getX()-d.width/2,
-                                                       center.getY()-d.height/2);
-                               return at.transform(layout.transform(v),null);
-                       }
-               }
-               if(wasInSublayout == false) {
-                       return delegate.transform(v);
-               }
-               return null;
-       
-       }
-
-       /**
-        * Check all sublayouts.keySet() and the delegate layout, returning
-        * done == true iff all are done.
-        */
-       public boolean done() {
-               boolean done = true;
-               for(Layout<V,E> layout : layouts.keySet()) {
-                       if(layout instanceof IterativeContext) {
-                               done &= ((IterativeContext)layout).done();
-                       }
-               }
-               if(delegate instanceof IterativeContext) {
-                       done &= ((IterativeContext)delegate).done();
-               }
-               return done;
-       }
-
-       /**
-        * call step on any sublayout that is also an IterativeContext
-        * and is not done
-        */
-       public void step() {
-               for(Layout<V,E> layout : layouts.keySet()) {
-                       if(layout instanceof IterativeContext) {
-                               IterativeContext context = (IterativeContext)layout;
-                               if(context.done() == false) {
-                                       context.step();
-                               }
-                       }
-               }
-               if(delegate instanceof IterativeContext) {
-                       IterativeContext context = (IterativeContext)delegate;
-                       if(context.done() == false) {
-                               context.step();
-                       }
-               }
-       }
-       
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/BalloonLayout.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/BalloonLayout.java
deleted file mode 100644 (file)
index 1d9f384..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2005, the JUNG Project and the Regents of the University of
- * California All rights reserved.
- *
- * This software is open-source under the BSD license; see either "license.txt"
- * or http://jung.sourceforge.net/license.txt for a description.
- *
- * Created on Jul 9, 2005
- */
-
-package edu.uci.ics.jung.algorithms.layout;
-import java.awt.Dimension;
-import java.awt.geom.Point2D;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.collections15.Transformer;
-import org.apache.commons.collections15.map.LazyMap;
-
-import edu.uci.ics.jung.graph.Forest;
-import edu.uci.ics.jung.graph.util.TreeUtils;
-
-/**
- * A {@code Layout} implementation that assigns positions to {@code Tree} or 
- * {@code Forest} vertices using associations with nested circles ("balloons").  
- * A balloon is nested inside another balloon if the first balloon's subtree
- * is a subtree of the second balloon's subtree.
- * 
- * @author Tom Nelson 
- *  
- */
-public class BalloonLayout<V,E> extends TreeLayout<V,E> {
-
-    protected Map<V,PolarPoint> polarLocations =
-       LazyMap.decorate(new HashMap<V, PolarPoint>(),
-                       new Transformer<V,PolarPoint>() {
-                                       public PolarPoint transform(V arg0) {
-                                               return new PolarPoint();
-                                       }});
-    
-    protected Map<V,Double> radii = new HashMap<V,Double>();
-    
-    /**
-     * Creates an instance based on the input forest.
-     */
-    public BalloonLayout(Forest<V,E> g) 
-    {
-        super(g);
-    }
-    
-    protected void setRootPolars() 
-    {
-        List<V> roots = TreeUtils.getRoots(graph);
-        if(roots.size() == 1) {
-               // its a Tree
-               V root = roots.get(0);
-               setRootPolar(root);
-            setPolars(new ArrayList<V>(graph.getChildren(root)),
-                    getCenter(), getSize().width/2);
-       } else if (roots.size() > 1) {
-               // its a Forest
-               setPolars(roots, getCenter(), getSize().width/2);
-       }
-    }
-    
-    protected void setRootPolar(V root) {
-       PolarPoint pp = new PolarPoint(0,0);
-       Point2D p = getCenter();
-       polarLocations.put(root, pp);
-       locations.put(root, p);
-    }
-    
-
-    protected void setPolars(List<V> kids, Point2D parentLocation, double parentRadius) {
-
-       int childCount = kids.size();
-       if(childCount == 0) return;
-       // handle the 1-child case with 0 limit on angle.
-       double angle = Math.max(0, Math.PI / 2 * (1 - 2.0/childCount));
-       double childRadius = parentRadius*Math.cos(angle) / (1 + Math.cos(angle));
-       double radius = parentRadius - childRadius;
-
-       double rand = Math.random();
-
-       for(int i=0; i< childCount; i++) {
-               V child = kids.get(i);
-               double theta = i* 2*Math.PI/childCount + rand;
-               radii.put(child, childRadius);
-               
-               PolarPoint pp = new PolarPoint(theta, radius);
-               polarLocations.put(child, pp);
-               
-               Point2D p = PolarPoint.polarToCartesian(pp);
-               p.setLocation(p.getX()+parentLocation.getX(), p.getY()+parentLocation.getY());
-               locations.put(child, p);
-               setPolars(new ArrayList<V>(graph.getChildren(child)), p, childRadius);
-       }
-    }
-
-    @Override
-    public void setSize(Dimension size) {
-       this.size = size;
-       setRootPolars();
-    }
-
-       /**
-        * Returns the coordinates of {@code v}'s parent, or the
-        * center of this layout's area if it's a root.
-        */
-       public Point2D getCenter(V v) {
-               V parent = graph.getParent(v);
-               if(parent == null) {
-                       return getCenter();
-               }
-               return locations.get(parent);
-       }
-
-       @Override
-    public void setLocation(V v, Point2D location) {
-               Point2D c = getCenter(v);
-               Point2D pv = new Point2D.Double(location.getX()-c.getX(),location.getY()-c.getY());
-               PolarPoint newLocation = PolarPoint.cartesianToPolar(pv);
-               polarLocations.get(v).setLocation(newLocation);
-               
-               Point2D center = getCenter(v);
-               pv.setLocation(pv.getX()+center.getX(), pv.getY()+center.getY());
-               locations.put(v, pv);
-       }
-
-       @Override
-    public Point2D transform(V v) {
-               return locations.get(v);
-       }
-
-       /**
-        * @return the radii
-        */
-       public Map<V, Double> getRadii() {
-               return radii;
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/CircleLayout.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/CircleLayout.java
deleted file mode 100644 (file)
index 8cafb77..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-/*
- * Created on Dec 4, 2003
- */
-package edu.uci.ics.jung.algorithms.layout;
-
-import java.awt.Dimension;
-import java.awt.geom.Point2D;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.collections15.Factory;
-import org.apache.commons.collections15.map.LazyMap;
-
-import edu.uci.ics.jung.graph.Graph;
-
-
-
-/**
- * A {@code Layout} implementation that positions vertices equally spaced on a regular circle.
- *
- * @author Masanori Harada
- */
-public class CircleLayout<V, E> extends AbstractLayout<V,E> {
-
-       private double radius;
-       private List<V> vertex_ordered_list;
-       
-       Map<V, CircleVertexData> circleVertexDataMap =
-                       LazyMap.decorate(new HashMap<V,CircleVertexData>(), 
-                       new Factory<CircleVertexData>() {
-                               public CircleVertexData create() {
-                                       return new CircleVertexData();
-                               }});    
-
-       /**
-        * Creates an instance for the specified graph.
-        */
-       public CircleLayout(Graph<V,E> g) {
-               super(g);
-       }
-
-       /**
-        * Returns the radius of the circle.
-        */
-       public double getRadius() {
-               return radius;
-       }
-
-       /**
-        * Sets the radius of the circle.  Must be called before
-        * {@code initialize()} is called.
-        */
-       public void setRadius(double radius) {
-               this.radius = radius;
-       }
-
-       /**
-        * Sets the order of the vertices in the layout according to the ordering
-        * specified by {@code comparator}.
-        */
-       public void setVertexOrder(Comparator<V> comparator)
-       {
-           if (vertex_ordered_list == null)
-               vertex_ordered_list = new ArrayList<V>(getGraph().getVertices());
-           Collections.sort(vertex_ordered_list, comparator);
-       }
-
-    /**
-     * Sets the order of the vertices in the layout according to the ordering
-     * of {@code vertex_list}.
-     */
-       public void setVertexOrder(List<V> vertex_list)
-       {
-           if (!vertex_list.containsAll(getGraph().getVertices())) 
-               throw new IllegalArgumentException("Supplied list must include " +
-                               "all vertices of the graph");
-           this.vertex_ordered_list = vertex_list;
-       }
-       
-       public void reset() {
-               initialize();
-       }
-
-       public void initialize() 
-       {
-               Dimension d = getSize();
-               
-               if (d != null) 
-               {
-                   if (vertex_ordered_list == null) 
-                       setVertexOrder(new ArrayList<V>(getGraph().getVertices()));
-
-                       double height = d.getHeight();
-                       double width = d.getWidth();
-
-                       if (radius <= 0) {
-                               radius = 0.45 * (height < width ? height : width);
-                       }
-
-                       int i = 0;
-                       for (V v : vertex_ordered_list)
-                       {
-                               Point2D coord = transform(v);
-
-                               double angle = (2 * Math.PI * i) / vertex_ordered_list.size();
-
-                               coord.setLocation(Math.cos(angle) * radius + width / 2,
-                                               Math.sin(angle) * radius + height / 2);
-
-                               CircleVertexData data = getCircleData(v);
-                               data.setAngle(angle);
-                               i++;
-                       }
-               }
-       }
-
-       protected CircleVertexData getCircleData(V v) {
-               return circleVertexDataMap.get(v);
-       }
-
-       protected static class CircleVertexData {
-               private double angle;
-
-               protected double getAngle() {
-                       return angle;
-               }
-
-               protected void setAngle(double angle) {
-                       this.angle = angle;
-               }
-
-               @Override
-               public String toString() {
-                       return "CircleVertexData: angle=" + angle;
-               }
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/DAGLayout.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/DAGLayout.java
deleted file mode 100644 (file)
index 97d3ee6..0000000
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- *
- * Created on Dec 4, 2003
- */
-package edu.uci.ics.jung.algorithms.layout;
-
-import java.awt.Dimension;
-import java.awt.geom.Point2D;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.util.Pair;
-
-/**
- * An implementation of {@code Layout} suitable for tree-like directed
- * acyclic graphs. Parts of it will probably not terminate if the graph is
- * cyclic! The layout will result in directed edges pointing generally upwards.
- * Any vertices with no successors are considered to be level 0, and tend
- * towards the top of the layout. Any vertex has a level one greater than the
- * maximum level of all its successors.
- *
- *
- * @author John Yesberg
- */
-public class DAGLayout<V, E> extends SpringLayout<V,E> {
-
-    /**
-     * Each vertex has a minimumLevel. Any vertex with no successors has
-     * minimumLevel of zero. The minimumLevel of any vertex must be strictly
-     * greater than the minimumLevel of its parents. (Vertex A is a parent of
-     * Vertex B iff there is an edge from B to A.) Typically, a vertex will
-     * have a minimumLevel which is one greater than the minimumLevel of its
-     * parent's. However, if the vertex has two parents, its minimumLevel will
-     * be one greater than the maximum of the parents'. We need to calculate
-     * the minimumLevel for each vertex. When we layout the graph, vertices
-     * cannot be drawn any higher than the minimumLevel. The graphHeight of a
-     * graph is the greatest minimumLevel that is used. We will modify the
-     * SpringLayout calculations so that nodes cannot move above their assigned
-     * minimumLevel.
-     */
-       private Map<V,Number> minLevels = new HashMap<V,Number>();
-       // Simpler than the "pair" technique.
-       static int graphHeight;
-       static int numRoots;
-       final double SPACEFACTOR = 1.3;
-       // How much space do we allow for additional floating at the bottom.
-       final double LEVELATTRACTIONRATE = 0.8;
-
-       /**
-        * A bunch of parameters to help work out when to stop quivering.
-        *
-        * If the MeanSquareVel(ocity) ever gets below the MSV_THRESHOLD, then we
-        * will start a final cool-down phase of COOL_DOWN_INCREMENT increments. If
-        * the MeanSquareVel ever exceeds the threshold, we will exit the cool down
-        * phase, and continue looking for another opportunity.
-        */
-       final double MSV_THRESHOLD = 10.0;
-       double meanSquareVel;
-       boolean stoppingIncrements = false;
-       int incrementsLeft;
-       final int COOL_DOWN_INCREMENTS = 200;
-
-       /**
-        * Creates an instance for the specified graph.
-        */
-       public DAGLayout(Graph<V,E> g) {
-               super(g);
-       }
-
-       /**
-        * setRoot calculates the level of each vertex in the graph. Level 0 is
-        * allocated to any vertex with no successors. Level n+1 is allocated to
-        * any vertex whose successors' maximum level is n.
-        */
-       public void setRoot(Graph<V,E> g) {
-               numRoots = 0;
-               for(V v : g.getVertices()) {
-                       Collection<V> successors = getGraph().getSuccessors(v);
-                       if (successors.size() == 0) {
-                               setRoot(v);
-                               numRoots++;
-                       }
-               }
-       }
-
-       /**
-        * Set vertex v to be level 0.
-        */
-       public void setRoot(V v) {
-               minLevels.put(v, new Integer(0));
-               // set all the levels.
-               propagateMinimumLevel(v);
-       }
-
-       /**
-        * A recursive method for allocating the level for each vertex. Ensures
-        * that all predecessors of v have a level which is at least one greater
-        * than the level of v.
-        *
-        * @param v
-        */
-       public void propagateMinimumLevel(V v) {
-               int level = minLevels.get(v).intValue();
-               for(V child : getGraph().getPredecessors(v)) {
-                       int oldLevel, newLevel;
-                       Number o = minLevels.get(child);
-                       if (o != null)
-                               oldLevel = o.intValue();
-                       else
-                               oldLevel = 0;
-                       newLevel = Math.max(oldLevel, level + 1);
-                       minLevels.put(child, new Integer(newLevel));
-
-                       if (newLevel > graphHeight)
-                               graphHeight = newLevel;
-                       propagateMinimumLevel(child);
-               }
-       }
-
-       /**
-        * Sets random locations for a vertex within the dimensions of the space.
-        * This overrides the method in AbstractLayout
-        *
-        * @param coord
-        * @param d
-        */
-       private void initializeLocation(
-               V v,
-               Point2D coord,
-               Dimension d) {
-
-               int level = minLevels.get(v).intValue();
-               int minY = (int) (level * d.getHeight() / (graphHeight * SPACEFACTOR));
-               double x = Math.random() * d.getWidth();
-               double y = Math.random() * (d.getHeight() - minY) + minY;
-               coord.setLocation(x,y);
-       }
-
-       @Override
-       public void setSize(Dimension size) {
-               super.setSize(size);
-               for(V v : getGraph().getVertices()) {
-                       initializeLocation(v,transform(v),getSize());
-               }
-       }
-
-       /**
-        * Had to override this one as well, to ensure that setRoot() is called.
-        */
-       @Override
-       public void initialize() {
-               super.initialize();
-               setRoot(getGraph());
-       }
-
-       /**
-        * Override the moveNodes() method from SpringLayout. The only change we
-        * need to make is to make sure that nodes don't float higher than the minY
-        * coordinate, as calculated by their minimumLevel.
-        */
-       @Override
-       protected void moveNodes() {
-               // Dimension d = currentSize;
-               double oldMSV = meanSquareVel;
-               meanSquareVel = 0;
-
-               synchronized (getSize()) {
-
-                       for(V v : getGraph().getVertices()) {
-                               if (isLocked(v))
-                                       continue;
-                               SpringLayout.SpringVertexData vd = springVertexData.get(v);
-                               Point2D xyd = transform(v);
-
-                               int width = getSize().width;
-                               int height = getSize().height;
-
-                               // (JY addition: three lines are new)
-                               int level =
-                                       minLevels.get(v).intValue();
-                               int minY = (int) (level * height / (graphHeight * SPACEFACTOR));
-                               int maxY =
-                                       level == 0
-                                               ? (int) (height / (graphHeight * SPACEFACTOR * 2))
-                                               : height;
-
-                               // JY added 2* - double the sideways repulsion.
-                               vd.dx += 2 * vd.repulsiondx + vd.edgedx;
-                               vd.dy += vd.repulsiondy + vd.edgedy;
-
-                               // JY Addition: Attract the vertex towards it's minimumLevel
-                               // height.
-                               double delta = xyd.getY() - minY;
-                               vd.dy -= delta * LEVELATTRACTIONRATE;
-                               if (level == 0)
-                                       vd.dy -= delta * LEVELATTRACTIONRATE;
-                               // twice as much at the top.
-
-                               // JY addition:
-                               meanSquareVel += (vd.dx * vd.dx + vd.dy * vd.dy);
-
-                               // keeps nodes from moving any faster than 5 per time unit
-                               xyd.setLocation(xyd.getX()+Math.max(-5, Math.min(5, vd.dx)) , xyd.getY()+Math.max(-5, Math.min(5, vd.dy)) );
-
-                               if (xyd.getX() < 0) {
-                                       xyd.setLocation(0, xyd.getY());
-                               } else if (xyd.getX() > width) {
-                                       xyd.setLocation(width, xyd.getY());
-                               }
-
-                               // (JY addition: These two lines replaced 0 with minY)
-                               if (xyd.getY() < minY) {
-                                       xyd.setLocation(xyd.getX(), minY);
-                                       // (JY addition: replace height with maxY)
-                               } else if (xyd.getY() > maxY) {
-                                       xyd.setLocation(xyd.getX(), maxY);
-                               }
-
-                               // (JY addition: if there's only one root, anchor it in the
-                               // middle-top of the screen)
-                               if (numRoots == 1 && level == 0) {
-                                       xyd.setLocation(width/2, xyd.getY());
-                               }
-                       }
-               }
-               //System.out.println("MeanSquareAccel="+meanSquareVel);
-               if (!stoppingIncrements
-                       && Math.abs(meanSquareVel - oldMSV) < MSV_THRESHOLD) {
-                       stoppingIncrements = true;
-                       incrementsLeft = COOL_DOWN_INCREMENTS;
-               } else if (
-                       stoppingIncrements
-                               && Math.abs(meanSquareVel - oldMSV) <= MSV_THRESHOLD) {
-                       incrementsLeft--;
-                       if (incrementsLeft <= 0)
-                               incrementsLeft = 0;
-               }
-       }
-
-       /**
-        * Override incrementsAreDone so that we can eventually stop.
-        */
-       @Override
-       public boolean done() {
-               if (stoppingIncrements && incrementsLeft == 0)
-                       return true;
-               else
-                       return false;
-       }
-
-       /**
-        * Override forceMove so that if someone moves a node, we can re-layout
-        * everything.
-        */
-       @Override
-       public void setLocation(V picked, double x, double y) {
-               Point2D coord = transform(picked);
-               coord.setLocation(x,y);
-               stoppingIncrements = false;
-       }
-
-       /**
-        * Override forceMove so that if someone moves a node, we can re-layout
-        * everything.
-        */
-       @Override
-       public void setLocation(V picked, Point2D p) {
-               Point2D coord = transform(picked);
-               coord.setLocation(p);
-               stoppingIncrements = false;
-       }
-
-       /**
-        * Overridden relaxEdges. This one reduces the effect of edges between
-        * greatly different levels.
-        *
-        */
-       @Override
-       protected void relaxEdges() {
-               for(E e : getGraph().getEdges()) {
-                   Pair<V> endpoints = getGraph().getEndpoints(e);
-                       V v1 = endpoints.getFirst();
-                       V v2 = endpoints.getSecond();
-
-                       Point2D p1 = transform(v1);
-                       Point2D p2 = transform(v2);
-                       double vx = p1.getX() - p2.getX();
-                       double vy = p1.getY() - p2.getY();
-                       double len = Math.sqrt(vx * vx + vy * vy);
-
-                       // JY addition.
-                       int level1 =
-                               minLevels.get(v1).intValue();
-                       int level2 =
-                               minLevels.get(v2).intValue();
-
-                       // desiredLen *= Math.pow( 1.1, (v1.degree() + v2.degree()) );
-//          double desiredLen = getLength(e);
-                       double desiredLen = lengthFunction.transform(e);
-
-                       // round from zero, if needed [zero would be Bad.].
-                       len = (len == 0) ? .0001 : len;
-
-                       // force factor: optimal length minus actual length,
-                       // is made smaller as the current actual length gets larger.
-                       // why?
-
-                       // System.out.println("Desired : " + getLength( e ));
-                       double f = force_multiplier * (desiredLen - len) / len;
-
-                       f = f * Math.pow(stretch / 100.0,
-                                       (getGraph().degree(v1) + getGraph().degree(v2) -2));
-
-                       // JY addition. If this is an edge which stretches a long way,
-                       // don't be so concerned about it.
-                       if (level1 != level2)
-                               f = f / Math.pow(Math.abs(level2 - level1), 1.5);
-
-                       // f= Math.min( 0, f );
-
-                       // the actual movement distance 'dx' is the force multiplied by the
-                       // distance to go.
-                       double dx = f * vx;
-                       double dy = f * vy;
-                       SpringVertexData v1D, v2D;
-                       v1D = springVertexData.get(v1);
-                       v2D = springVertexData.get(v2);
-
-//                     SpringEdgeData<E> sed = getSpringEdgeData(e);
-//                     sed.f = f;
-
-                       v1D.edgedx += dx;
-                       v1D.edgedy += dy;
-                       v2D.edgedx += -dx;
-                       v2D.edgedy += -dy;
-               }
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/FRLayout.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/FRLayout.java
deleted file mode 100644 (file)
index c8a2a24..0000000
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University of
- * California All rights reserved.
- *
- * This software is open-source under the BSD license; see either "license.txt"
- * or http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.layout;
-
-import edu.uci.ics.jung.algorithms.layout.util.RandomLocationTransformer;
-import edu.uci.ics.jung.algorithms.util.IterativeContext;
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.util.Pair;
-
-import org.apache.commons.collections15.Factory;
-import org.apache.commons.collections15.map.LazyMap;
-
-import java.awt.Dimension;
-import java.awt.geom.Point2D;
-import java.util.ConcurrentModificationException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Implements the Fruchterman-Reingold force-directed algorithm for node layout.
- * 
- * <p>Behavior is determined by the following settable parameters:
- * <ul>
- * <li/>attraction multiplier: how much edges try to keep their vertices together
- * <li/>repulsion multiplier: how much vertices try to push each other apart
- * <li/>maximum iterations: how many iterations this algorithm will use before stopping
- * </ul>
- * Each of the first two defaults to 0.75; the maximum number of iterations defaults to 700.
- *
- * @see "Fruchterman and Reingold, 'Graph Drawing by Force-directed Placement'"
- * @see "http://i11www.ilkd.uni-karlsruhe.de/teaching/SS_04/visualisierung/papers/fruchterman91graph.pdf"
- * @author Scott White, Yan-Biao Boey, Danyel Fisher
- */
-public class FRLayout<V, E> extends AbstractLayout<V, E> implements IterativeContext {
-
-    private double forceConstant;
-
-    private double temperature;
-
-    private int currentIteration;
-
-    private int mMaxIterations = 700;
-
-    private Map<V, FRVertexData> frVertexData =
-       LazyMap.decorate(new HashMap<V,FRVertexData>(), new Factory<FRVertexData>() {
-               public FRVertexData create() {
-                       return new FRVertexData();
-               }});
-
-    private double attraction_multiplier = 0.75;
-
-    private double attraction_constant;
-
-    private double repulsion_multiplier = 0.75;
-
-    private double repulsion_constant;
-
-    private double max_dimension;
-
-    /**
-     * Creates an instance for the specified graph.
-     */
-    public FRLayout(Graph<V, E> g) {
-        super(g);
-    }
-
-    /**
-     * Creates an instance of size {@code d} for the specified graph.
-     */
-    public FRLayout(Graph<V, E> g, Dimension d) {
-        super(g, new RandomLocationTransformer<V>(d), d);
-        initialize();
-        max_dimension = Math.max(d.height, d.width);
-    }
-
-       @Override
-       public void setSize(Dimension size) {
-               if(initialized == false) {
-                       setInitializer(new RandomLocationTransformer<V>(size));
-               }
-               super.setSize(size);
-        max_dimension = Math.max(size.height, size.width);
-       }
-
-       /**
-        * Sets the attraction multiplier.
-        */
-       public void setAttractionMultiplier(double attraction) {
-        this.attraction_multiplier = attraction;
-    }
-
-       /**
-        * Sets the repulsion multiplier.
-        */
-    public void setRepulsionMultiplier(double repulsion) {
-        this.repulsion_multiplier = repulsion;
-    }
-
-       public void reset() {
-               doInit();
-       }
-
-    public void initialize() {
-       doInit();
-    }
-
-    private void doInit() {
-       Graph<V,E> graph = getGraph();
-       Dimension d = getSize();
-       if(graph != null && d != null) {
-               currentIteration = 0;
-               temperature = d.getWidth() / 10;
-
-               forceConstant =
-                       Math
-                       .sqrt(d.getHeight()
-                                       * d.getWidth()
-                                       / graph.getVertexCount());
-
-               attraction_constant = attraction_multiplier * forceConstant;
-               repulsion_constant = repulsion_multiplier * forceConstant;
-       }
-    }
-
-    private double EPSILON = 0.000001D;
-
-    /**
-     * Moves the iteration forward one notch, calculation attraction and
-     * repulsion between vertices and edges and cooling the temperature.
-     */
-    public synchronized void step() {
-        currentIteration++;
-
-        /**
-         * Calculate repulsion
-         */
-        while(true) {
-
-            try {
-                for(V v1 : getGraph().getVertices()) {
-                    calcRepulsion(v1);
-                }
-                break;
-            } catch(ConcurrentModificationException cme) {}
-        }
-
-        /**
-         * Calculate attraction
-         */
-        while(true) {
-            try {
-                for(E e : getGraph().getEdges()) {
-
-                    calcAttraction(e);
-                }
-                break;
-            } catch(ConcurrentModificationException cme) {}
-        }
-
-
-        while(true) {
-            try {
-                for(V v : getGraph().getVertices()) {
-                    if (isLocked(v)) continue;
-                    calcPositions(v);
-                }
-                break;
-            } catch(ConcurrentModificationException cme) {}
-        }
-        cool();
-    }
-
-    protected synchronized void calcPositions(V v) {
-        FRVertexData fvd = getFRData(v);
-        if(fvd == null) return;
-        Point2D xyd = transform(v);
-        double deltaLength = Math.max(EPSILON, fvd.norm());
-
-        double newXDisp = fvd.getX() / deltaLength
-                * Math.min(deltaLength, temperature);
-
-        if (Double.isNaN(newXDisp)) {
-               throw new IllegalArgumentException(
-                "Unexpected mathematical result in FRLayout:calcPositions [xdisp]"); }
-
-        double newYDisp = fvd.getY() / deltaLength
-                * Math.min(deltaLength, temperature);
-        xyd.setLocation(xyd.getX()+newXDisp, xyd.getY()+newYDisp);
-
-        double borderWidth = getSize().getWidth() / 50.0;
-        double newXPos = xyd.getX();
-        if (newXPos < borderWidth) {
-            newXPos = borderWidth + Math.random() * borderWidth * 2.0;
-        } else if (newXPos > (getSize().getWidth() - borderWidth)) {
-            newXPos = getSize().getWidth() - borderWidth - Math.random()
-                    * borderWidth * 2.0;
-        }
-
-        double newYPos = xyd.getY();
-        if (newYPos < borderWidth) {
-            newYPos = borderWidth + Math.random() * borderWidth * 2.0;
-        } else if (newYPos > (getSize().getHeight() - borderWidth)) {
-            newYPos = getSize().getHeight() - borderWidth
-                    - Math.random() * borderWidth * 2.0;
-        }
-
-        xyd.setLocation(newXPos, newYPos);
-    }
-
-    protected void calcAttraction(E e) {
-       Pair<V> endpoints = getGraph().getEndpoints(e);
-        V v1 = endpoints.getFirst();
-        V v2 = endpoints.getSecond();
-        boolean v1_locked = isLocked(v1);
-        boolean v2_locked = isLocked(v2);
-
-        if(v1_locked && v2_locked) {
-               // both locked, do nothing
-               return;
-        }
-        Point2D p1 = transform(v1);
-        Point2D p2 = transform(v2);
-        if(p1 == null || p2 == null) return;
-        double xDelta = p1.getX() - p2.getX();
-        double yDelta = p1.getY() - p2.getY();
-
-        double deltaLength = Math.max(EPSILON, Math.sqrt((xDelta * xDelta)
-                + (yDelta * yDelta)));
-
-        double force = (deltaLength * deltaLength) / attraction_constant;
-
-        if (Double.isNaN(force)) { throw new IllegalArgumentException(
-                "Unexpected mathematical result in FRLayout:calcPositions [force]"); }
-
-        double dx = (xDelta / deltaLength) * force;
-        double dy = (yDelta / deltaLength) * force;
-        if(v1_locked == false) {
-               FRVertexData fvd1 = getFRData(v1);
-               fvd1.offset(-dx, -dy);
-        }
-        if(v2_locked == false) {
-               FRVertexData fvd2 = getFRData(v2);
-               fvd2.offset(dx, dy);
-        }
-    }
-
-    protected void calcRepulsion(V v1) {
-        FRVertexData fvd1 = getFRData(v1);
-        if(fvd1 == null)
-            return;
-        fvd1.setLocation(0, 0);
-
-        try {
-            for(V v2 : getGraph().getVertices()) {
-
-//                if (isLocked(v2)) continue;
-                if (v1 != v2) {
-                    Point2D p1 = transform(v1);
-                    Point2D p2 = transform(v2);
-                    if(p1 == null || p2 == null) continue;
-                    double xDelta = p1.getX() - p2.getX();
-                    double yDelta = p1.getY() - p2.getY();
-
-                    double deltaLength = Math.max(EPSILON, Math
-                            .sqrt((xDelta * xDelta) + (yDelta * yDelta)));
-
-                    double force = (repulsion_constant * repulsion_constant) / deltaLength;
-
-                    if (Double.isNaN(force)) { throw new RuntimeException(
-                    "Unexpected mathematical result in FRLayout:calcPositions [repulsion]"); }
-
-                    fvd1.offset((xDelta / deltaLength) * force,
-                            (yDelta / deltaLength) * force);
-                }
-            }
-        } catch(ConcurrentModificationException cme) {
-            calcRepulsion(v1);
-        }
-    }
-
-    private void cool() {
-        temperature *= (1.0 - currentIteration / (double) mMaxIterations);
-    }
-
-    /**
-     * Sets the maximum number of iterations.
-     */
-    public void setMaxIterations(int maxIterations) {
-        mMaxIterations = maxIterations;
-    }
-
-    protected FRVertexData getFRData(V v) {
-        return frVertexData.get(v);
-    }
-
-    /**
-     * This one is an incremental visualization.
-     */
-    public boolean isIncremental() {
-        return true;
-    }
-
-    /**
-     * Returns true once the current iteration has passed the maximum count,
-     * <tt>MAX_ITERATIONS</tt>.
-     */
-    public boolean done() {
-        if (currentIteration > mMaxIterations || temperature < 1.0/max_dimension)
-        {
-            return true;
-        }
-        return false;
-    }
-
-    protected static class FRVertexData extends Point2D.Double
-    {
-        protected void offset(double x, double y)
-        {
-            this.x += x;
-            this.y += y;
-        }
-
-        protected double norm()
-        {
-            return Math.sqrt(x*x + y*y);
-        }
-     }
-}
\ No newline at end of file
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/FRLayout2.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/FRLayout2.java
deleted file mode 100644 (file)
index 0f5b05e..0000000
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University of
- * California All rights reserved.
- * 
- * This software is open-source under the BSD license; see either "license.txt"
- * or http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.layout;
-
-import java.awt.Dimension;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import java.util.ConcurrentModificationException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.commons.collections15.Factory;
-import org.apache.commons.collections15.map.LazyMap;
-
-import edu.uci.ics.jung.algorithms.layout.util.RandomLocationTransformer;
-import edu.uci.ics.jung.algorithms.util.IterativeContext;
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.util.Pair;
-
-/**
- * Implements the Fruchterman-Reingold force-directed algorithm for node layout.
- * This is an experimental attempt at optimizing {@code FRLayout}; if it is successful
- * it will be folded back into {@code FRLayout} (and this class will disappear).
- * 
- * <p>Behavior is determined by the following settable parameters:
- * <ul>
- * <li/>attraction multiplier: how much edges try to keep their vertices together
- * <li/>repulsion multiplier: how much vertices try to push each other apart
- * <li/>maximum iterations: how many iterations this algorithm will use before stopping
- * </ul>
- * Each of the first two defaults to 0.75; the maximum number of iterations defaults to 700.
-
- * 
- * @see "Fruchterman and Reingold, 'Graph Drawing by Force-directed Placement'"
- * @see http://i11www.ilkd.uni-karlsruhe.de/teaching/SS_04/visualisierung/papers/fruchterman91graph.pdf
- * 
- * @author Tom Nelson
- * @author Scott White, Yan-Biao Boey, Danyel Fisher
- */
-public class FRLayout2<V, E> extends AbstractLayout<V, E> implements IterativeContext {
-
-    private double forceConstant;
-
-    private double temperature;
-
-    private int currentIteration;
-
-    private int maxIterations = 700;
-    
-    private Map<V, Point2D> frVertexData = 
-       LazyMap.decorate(new HashMap<V,Point2D>(), new Factory<Point2D>() {
-               public Point2D create() {
-                       return new Point2D.Double();
-               }});
-
-    private double attraction_multiplier = 0.75;
-    
-    private double attraction_constant;
-    
-    private double repulsion_multiplier = 0.75;
-    
-    private double repulsion_constant;
-    
-    private double max_dimension;
-    
-    private Rectangle2D innerBounds = new Rectangle2D.Double();
-    
-    private boolean checked = false;
-    
-    /**
-     * Creates an instance for the specified graph.
-     */
-    public FRLayout2(Graph<V, E> g) {
-        super(g);
-    }
-    
-    /**
-     * Creates an instance of size {@code d} for the specified graph.
-     */
-    public FRLayout2(Graph<V, E> g, Dimension d) {
-        super(g, new RandomLocationTransformer<V>(d), d);
-        max_dimension = Math.max(d.height, d.width);
-        initialize();
-    }
-    
-       @Override
-       public void setSize(Dimension size) {
-               if(initialized == false) 
-                       setInitializer(new RandomLocationTransformer<V>(size));
-               super.setSize(size);
-               double t = size.width/50.0;
-               innerBounds.setFrameFromDiagonal(t,t,size.width-t,size.height-t);
-        max_dimension = Math.max(size.height, size.width);
-       }
-
-    /**
-     * Sets the attraction multiplier.
-     */
-       public void setAttractionMultiplier(double attraction) {
-        this.attraction_multiplier = attraction;
-    }
-    
-    /**
-     * Sets the repulsion multiplier.
-     */
-    public void setRepulsionMultiplier(double repulsion) {
-        this.repulsion_multiplier = repulsion;
-    }
-    
-       public void reset() {
-               doInit();
-       }
-    
-    public void initialize() {
-       doInit();
-    }
-
-    private void doInit() {
-       Graph<V,E> graph = getGraph();
-       Dimension d = getSize();
-       if(graph != null && d != null) {
-               currentIteration = 0;
-               temperature = d.getWidth() / 10;
-
-               forceConstant = 
-                       Math
-                       .sqrt(d.getHeight()
-                                       * d.getWidth()
-                                       / graph.getVertexCount());
-
-               attraction_constant = attraction_multiplier * forceConstant;
-               repulsion_constant = repulsion_multiplier * forceConstant;
-       }
-    }
-
-    private double EPSILON = 0.000001D;
-
-    /**
-     * Moves the iteration forward one notch, calculation attraction and
-     * repulsion between vertices and edges and cooling the temperature.
-     */
-    public synchronized void step() {
-        currentIteration++;
-
-        /**
-         * Calculate repulsion
-         */
-        while(true) {
-            
-            try {
-                for(V v1 : getGraph().getVertices()) {
-                    calcRepulsion(v1);
-                }
-                break;
-            } catch(ConcurrentModificationException cme) {}
-        }
-
-        /**
-         * Calculate attraction
-         */
-        while(true) {
-            try {
-                for(E e : getGraph().getEdges()) {
-                    calcAttraction(e);
-                }
-                break;
-            } catch(ConcurrentModificationException cme) {}
-        }
-
-
-        while(true) {
-            try {    
-                for(V v : getGraph().getVertices()) {
-                    if (isLocked(v)) continue;
-                    calcPositions(v);
-                }
-                break;
-            } catch(ConcurrentModificationException cme) {}
-        }
-        cool();
-    }
-
-    protected synchronized void calcPositions(V v) {
-        Point2D fvd = this.frVertexData.get(v);
-        if(fvd == null) return;
-        Point2D xyd = transform(v);
-        double deltaLength = Math.max(EPSILON, 
-                       Math.sqrt(fvd.getX()*fvd.getX()+fvd.getY()*fvd.getY()));
-
-        double newXDisp = fvd.getX() / deltaLength
-                * Math.min(deltaLength, temperature);
-
-        assert Double.isNaN(newXDisp) == false : "Unexpected mathematical result in FRLayout:calcPositions [xdisp]";
-
-        double newYDisp = fvd.getY() / deltaLength
-                * Math.min(deltaLength, temperature);
-        double newX = xyd.getX()+Math.max(-5, Math.min(5,newXDisp));
-        double newY = xyd.getY()+Math.max(-5, Math.min(5,newYDisp));
-        
-        newX = Math.max(innerBounds.getMinX(), Math.min(newX, innerBounds.getMaxX()));
-        newY = Math.max(innerBounds.getMinY(), Math.min(newY, innerBounds.getMaxY()));
-        
-        xyd.setLocation(newX, newY);
-
-    }
-
-    protected void calcAttraction(E e) {
-       Pair<V> endpoints = getGraph().getEndpoints(e);
-        V v1 = endpoints.getFirst();
-        V v2 = endpoints.getSecond();
-        boolean v1_locked = isLocked(v1);
-        boolean v2_locked = isLocked(v2);
-        
-        if(v1_locked && v2_locked) {
-               // both locked, do nothing
-               return;
-        }
-        Point2D p1 = transform(v1);
-        Point2D p2 = transform(v2);
-        if(p1 == null || p2 == null) return;
-        double xDelta = p1.getX() - p2.getX();
-        double yDelta = p1.getY() - p2.getY();
-
-        double deltaLength = Math.max(EPSILON, p1.distance(p2));
-
-        double force = deltaLength  / attraction_constant;
-
-        assert Double.isNaN(force) == false : "Unexpected mathematical result in FRLayout:calcPositions [force]";
-
-        double dx = xDelta * force;
-        double dy = yDelta * force;
-        Point2D fvd1 = frVertexData.get(v1);
-        Point2D fvd2 = frVertexData.get(v2);
-        if(v2_locked) {
-               // double the offset for v1, as v2 will not be moving in
-               // the opposite direction
-               fvd1.setLocation(fvd1.getX()-2*dx, fvd1.getY()-2*dy);
-        } else {
-        fvd1.setLocation(fvd1.getX()-dx, fvd1.getY()-dy);
-        }
-        if(v1_locked) {
-               // double the offset for v2, as v1 will not be moving in
-               // the opposite direction
-               fvd2.setLocation(fvd2.getX()+2*dx, fvd2.getY()+2*dy);
-        } else {
-        fvd2.setLocation(fvd2.getX()+dx, fvd2.getY()+dy);
-    }
-    }
-
-    protected void calcRepulsion(V v1) {
-        Point2D fvd1 = frVertexData.get(v1);
-        if(fvd1 == null) return;
-        fvd1.setLocation(0, 0);
-        boolean v1_locked = isLocked(v1);
-
-        try {
-            for(V v2 : getGraph().getVertices()) {
-
-                boolean v2_locked = isLocked(v2);
-               if (v1_locked && v2_locked) continue;
-                if (v1 != v2) {
-                    Point2D p1 = transform(v1);
-                    Point2D p2 = transform(v2);
-                    if(p1 == null || p2 == null) continue;
-                    double xDelta = p1.getX() - p2.getX();
-                    double yDelta = p1.getY() - p2.getY();
-                    
-                    double deltaLength = Math.max(EPSILON, p1.distanceSq(p2));
-                    
-                    double force = (repulsion_constant * repulsion_constant);// / deltaLength;
-                    
-                    double forceOverDeltaLength = force / deltaLength;
-                    
-                    assert Double.isNaN(force) == false : "Unexpected mathematical result in FRLayout:calcPositions [repulsion]";
-                    
-                    if(v2_locked) {
-                       // double the offset for v1, as v2 will not be moving in
-                       // the opposite direction
-                       fvd1.setLocation(fvd1.getX()+2 * xDelta * forceOverDeltaLength,
-                               fvd1.getY()+ 2 * yDelta * forceOverDeltaLength);
-                    } else {
-                       fvd1.setLocation(fvd1.getX()+xDelta * forceOverDeltaLength,
-                                       fvd1.getY()+yDelta * forceOverDeltaLength);
-                }
-            }
-            }
-        } catch(ConcurrentModificationException cme) {
-            calcRepulsion(v1);
-        }
-    }
-
-    private void cool() {
-        temperature *= (1.0 - currentIteration / (double) maxIterations);
-    }
-
-    /**
-     * Sets the maximum number of iterations.
-     */
-    public void setMaxIterations(int maxIterations) {
-        this.maxIterations = maxIterations;
-    }
-
-    /**
-     * This one is an incremental visualization.
-     */
-    public boolean isIncremental() {
-        return true;
-    }
-
-    /**
-     * Returns true once the current iteration has passed the maximum count,
-     * <tt>MAX_ITERATIONS</tt>.
-     */
-    public boolean done() {
-        if (currentIteration > maxIterations || temperature < 1.0/max_dimension) { 
-            if (!checked)
-            {
-//                System.out.println("current iteration: " + currentIteration);
-//                System.out.println("temperature: " + temperature);
-                checked = true;
-            }
-            return true; 
-        } 
-        return false;
-    }
-}
\ No newline at end of file
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/GraphElementAccessor.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/GraphElementAccessor.java
deleted file mode 100644 (file)
index 4cf1c51..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2005, the JUNG Project and the Regents of the University of
- * California All rights reserved.
- * 
- * This software is open-source under the BSD license; see either "license.txt"
- * or http://jung.sourceforge.net/license.txt for a description.
- * 
- *
- * Created on Apr 12, 2005
- */
-package edu.uci.ics.jung.algorithms.layout;
-
-import java.awt.Shape;
-import java.util.Collection;
-
-/**
- * Interface for coordinate-based selection of graph components.
- * @author Tom Nelson
- * @author Joshua O'Madadhain
- */
-public interface GraphElementAccessor<V, E>
-{
-    /**
-     * Returns a vertex which is associated with the 
-     * location <code>(x,y)</code>.  This is typically determined
-     * with respect to the vertex's location as specified
-     * by a <code>Layout</code>.
-     */
-    V getVertex(Layout<V,E> layout, double x, double y);
-    
-    /**
-     * Returns the vertices contained within {@code rectangle} relative
-     * to {@code layout}.
-     */
-    Collection<V> getVertices(Layout<V,E> layout, Shape rectangle);
-
-    /**
-     * Returns an edge which is associated with the 
-     * location <code>(x,y)</code>.  This is typically determined
-     * with respect to the edge's location as specified
-     * by a {@code Layout}.
-     */
-    E getEdge(Layout<V,E> layout, double x, double y);
-
-}
\ No newline at end of file
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/ISOMLayout.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/ISOMLayout.java
deleted file mode 100644 (file)
index bea8eda..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.layout;
-
-import edu.uci.ics.jung.algorithms.layout.util.RandomLocationTransformer;
-import edu.uci.ics.jung.algorithms.util.IterativeContext;
-import edu.uci.ics.jung.graph.Graph;
-
-import org.apache.commons.collections15.Factory;
-import org.apache.commons.collections15.map.LazyMap;
-
-import java.awt.geom.Point2D;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.ConcurrentModificationException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Implements a self-organizing map layout algorithm, based on Meyer's
- * self-organizing graph methods.
- *
- * @author Yan Biao Boey
- */
-public class ISOMLayout<V, E> extends AbstractLayout<V,E> implements IterativeContext {
-
-       Map<V, ISOMVertexData> isomVertexData =
-               LazyMap.decorate(new HashMap<V, ISOMVertexData>(),
-                               new Factory<ISOMVertexData>() {
-                                       public ISOMVertexData create() {
-                                               return new ISOMVertexData();
-                                       }});
-
-       private int maxEpoch;
-       private int epoch;
-
-       private int radiusConstantTime;
-       private int radius;
-       private int minRadius;
-
-       private double adaption;
-       private double initialAdaption;
-       private double minAdaption;
-
-    protected GraphElementAccessor<V,E> elementAccessor =
-       new RadiusGraphElementAccessor<V,E>();
-
-       private double coolingFactor;
-
-       private List<V> queue = new ArrayList<V>();
-       private String status = null;
-
-       /**
-        * Returns the current number of epochs and execution status, as a string.
-        */
-       public String getStatus() {
-               return status;
-       }
-
-       /**
-        * Creates an <code>ISOMLayout</code> instance for the specified graph <code>g</code>.
-        * @param g
-        */
-       public ISOMLayout(Graph<V,E> g) {
-               super(g);
-       }
-
-       public void initialize() {
-
-               setInitializer(new RandomLocationTransformer<V>(getSize()));
-               maxEpoch = 2000;
-               epoch = 1;
-
-               radiusConstantTime = 100;
-               radius = 5;
-               minRadius = 1;
-
-               initialAdaption = 90.0D / 100.0D;
-               adaption = initialAdaption;
-               minAdaption = 0;
-
-               //factor = 0; //Will be set later on
-               coolingFactor = 2;
-
-               //temperature = 0.03;
-               //initialJumpRadius = 100;
-               //jumpRadius = initialJumpRadius;
-
-               //delay = 100;
-       }
-
-
-       /**
-       * Advances the current positions of the graph elements.
-       */
-       public void step() {
-               status = "epoch: " + epoch + "; ";
-               if (epoch < maxEpoch) {
-                       adjust();
-                       updateParameters();
-                       status += " status: running";
-
-               } else {
-                       status += "adaption: " + adaption + "; ";
-                       status += "status: done";
-//                     done = true;
-               }
-       }
-
-       private synchronized void adjust() {
-               //Generate random position in graph space
-               Point2D tempXYD = new Point2D.Double();
-
-               // creates a new XY data location
-        tempXYD.setLocation(10 + Math.random() * getSize().getWidth(),
-                10 + Math.random() * getSize().getHeight());
-
-               //Get closest vertex to random position
-               V winner = elementAccessor.getVertex(this, tempXYD.getX(), tempXYD.getY());
-
-               while(true) {
-                   try {
-                       for(V v : getGraph().getVertices()) {
-                           ISOMVertexData ivd = getISOMVertexData(v);
-                           ivd.distance = 0;
-                           ivd.visited = false;
-                       }
-                       break;
-                   } catch(ConcurrentModificationException cme) {}
-        }
-               adjustVertex(winner, tempXYD);
-       }
-
-       private synchronized void updateParameters() {
-               epoch++;
-               double factor = Math.exp(-1 * coolingFactor * (1.0 * epoch / maxEpoch));
-               adaption = Math.max(minAdaption, factor * initialAdaption);
-               //jumpRadius = (int) factor * jumpRadius;
-               //temperature = factor * temperature;
-               if ((radius > minRadius) && (epoch % radiusConstantTime == 0)) {
-                       radius--;
-               }
-       }
-
-       private synchronized void adjustVertex(V v, Point2D tempXYD) {
-               queue.clear();
-               ISOMVertexData ivd = getISOMVertexData(v);
-               ivd.distance = 0;
-               ivd.visited = true;
-               queue.add(v);
-               V current;
-
-               while (!queue.isEmpty()) {
-                       current = queue.remove(0);
-                       ISOMVertexData currData = getISOMVertexData(current);
-                       Point2D currXYData = transform(current);
-
-                       double dx = tempXYD.getX() - currXYData.getX();
-                       double dy = tempXYD.getY() - currXYData.getY();
-                       double factor = adaption / Math.pow(2, currData.distance);
-
-                       currXYData.setLocation(currXYData.getX()+(factor*dx), currXYData.getY()+(factor*dy));
-
-                       if (currData.distance < radius) {
-                           Collection<V> s = getGraph().getNeighbors(current);
-                           while(true) {
-                               try {
-                                       for(V child : s) {
-                                       ISOMVertexData childData = getISOMVertexData(child);
-                                       if (childData != null && !childData.visited) {
-                                           childData.visited = true;
-                                           childData.distance = currData.distance + 1;
-                                           queue.add(child);
-                                       }
-                                   }
-                                   break;
-                               } catch(ConcurrentModificationException cme) {}
-                           }
-                       }
-               }
-       }
-
-       protected ISOMVertexData getISOMVertexData(V v) {
-               return isomVertexData.get(v);
-       }
-
-       /**
-        * This one is an incremental visualization.
-        * @return <code>true</code> is the layout algorithm is incremental, <code>false</code> otherwise
-        */
-       public boolean isIncremental() {
-               return true;
-       }
-
-       /**
-        * Returns <code>true</code> if the vertex positions are no longer being
-        * updated.  Currently <code>ISOMLayout</code> stops updating vertex
-        * positions after a certain number of iterations have taken place.
-        * @return <code>true</code> if the vertex position updates have stopped,
-        * <code>false</code> otherwise
-        */
-       public boolean done() {
-               return epoch >= maxEpoch;
-       }
-
-       protected static class ISOMVertexData {
-               int distance;
-               boolean visited;
-
-               protected ISOMVertexData() {
-                   distance = 0;
-                   visited = false;
-               }
-       }
-
-       /**
-        * Resets the layout iteration count to 0, which allows the layout algorithm to
-        * continue updating vertex positions.
-        */
-       public void reset() {
-               epoch = 0;
-       }
-}
\ No newline at end of file
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/KKLayout.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/KKLayout.java
deleted file mode 100644 (file)
index a1b9f40..0000000
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.layout;
-/*
- * This source is under the same license with JUNG.
- * http://jung.sourceforge.net/license.txt for a description.
- */
-
-import java.awt.Dimension;
-import java.awt.geom.Point2D;
-import java.util.ConcurrentModificationException;
-
-import edu.uci.ics.jung.algorithms.layout.util.RandomLocationTransformer;
-import edu.uci.ics.jung.algorithms.shortestpath.Distance;
-import edu.uci.ics.jung.algorithms.shortestpath.DistanceStatistics;
-import edu.uci.ics.jung.algorithms.shortestpath.UnweightedShortestPath;
-import edu.uci.ics.jung.algorithms.util.IterativeContext;
-import edu.uci.ics.jung.graph.Graph;
-
-/**
- * Implements the Kamada-Kawai algorithm for node layout.
- * Does not respect filter calls, and sometimes crashes when the view changes to it.
- *
- * @see "Tomihisa Kamada and Satoru Kawai: An algorithm for drawing general indirect graphs. Information Processing Letters 31(1):7-15, 1989" 
- * @see "Tomihisa Kamada: On visualization of abstract objects and relations. Ph.D. dissertation, Dept. of Information Science, Univ. of Tokyo, Dec. 1988."
- *
- * @author Masanori Harada
- */
-public class KKLayout<V,E> extends AbstractLayout<V,E> implements IterativeContext {
-
-       private double EPSILON = 0.1d;
-
-       private int currentIteration;
-    private int maxIterations = 2000;
-       private String status = "KKLayout";
-
-       private double L;                       // the ideal length of an edge
-       private double K = 1;           // arbitrary const number
-       private double[][] dm;     // distance matrix
-
-       private boolean adjustForGravity = true;
-       private boolean exchangeVertices = true;
-
-       private V[] vertices;
-       private Point2D[] xydata;
-
-    /**
-     * Retrieves graph distances between vertices of the visible graph
-     */
-    protected Distance<V> distance;
-
-    /**
-     * The diameter of the visible graph. In other words, the maximum over all pairs
-     * of vertices of the length of the shortest path between a and bf the visible graph.
-     */
-       protected double diameter;
-
-    /**
-     * A multiplicative factor which partly specifies the "preferred" length of an edge (L).
-     */
-    private double length_factor = 0.9;
-
-    /**
-     * A multiplicative factor which specifies the fraction of the graph's diameter to be 
-     * used as the inter-vertex distance between disconnected vertices.
-     */
-    private double disconnected_multiplier = 0.5;
-    
-       /**
-        * Creates an instance for the specified graph.
-        */
-       public KKLayout(Graph<V,E> g) 
-    {
-        this(g, new UnweightedShortestPath<V,E>(g));
-       }
-
-       /**
-        * Creates an instance for the specified graph and distance metric.
-        */
-    public KKLayout(Graph<V,E> g, Distance<V> distance){
-        super(g);
-        this.distance = distance;
-    }
-
-    /**
-     * Sets a multiplicative factor which 
-     * partly specifies the "preferred" length of an edge (L).
-     */
-    public void setLengthFactor(double length_factor){
-        this.length_factor = length_factor;
-    }
-    
-    /**
-     * Sets a multiplicative factor that specifies the fraction of the graph's diameter to be 
-     * used as the inter-vertex distance between disconnected vertices.
-     */
-    public void setDisconnectedDistanceMultiplier(double disconnected_multiplier){
-        this.disconnected_multiplier = disconnected_multiplier;
-    }
-    
-    /**
-     * Returns a string with information about the current status of the algorithm.
-     */
-       public String getStatus() {
-               return status + this.getSize();
-       }
-
-       /**
-        * Sets the maximum number of iterations.
-        */
-    public void setMaxIterations(int maxIterations) {
-        this.maxIterations = maxIterations;
-    }
-
-       /**
-        * This one is an incremental visualization.
-        */
-       public boolean isIncremental() {
-               return true;
-       }
-
-       /**
-        * Returns true once the current iteration has passed the maximum count.
-        */
-       public boolean done() {
-               if (currentIteration > maxIterations) {
-                       return true;
-               }
-               return false;
-       }
-
-       @SuppressWarnings("unchecked")
-    public void initialize() {
-       currentIteration = 0;
-
-       if(graph != null && size != null) {
-
-               double height = size.getHeight();
-               double width = size.getWidth();
-
-               int n = graph.getVertexCount();
-               dm = new double[n][n];
-               vertices = (V[])graph.getVertices().toArray();
-               xydata = new Point2D[n];
-
-               // assign IDs to all visible vertices
-               while(true) {
-                       try {
-                               int index = 0;
-                               for(V v : graph.getVertices()) {
-                                       Point2D xyd = transform(v);
-                                       vertices[index] = v;
-                                       xydata[index] = xyd;
-                                       index++;
-                               }
-                               break;
-                       } catch(ConcurrentModificationException cme) {}
-               }
-
-               diameter = DistanceStatistics.<V,E>diameter(graph, distance, true);
-
-               double L0 = Math.min(height, width);
-               L = (L0 / diameter) * length_factor;  // length_factor used to be hardcoded to 0.9
-               //L = 0.75 * Math.sqrt(height * width / n);
-
-               for (int i = 0; i < n - 1; i++) {
-                       for (int j = i + 1; j < n; j++) {
-                               Number d_ij = distance.getDistance(vertices[i], vertices[j]);
-                               Number d_ji = distance.getDistance(vertices[j], vertices[i]);
-                               double dist = diameter * disconnected_multiplier;
-                               if (d_ij != null)
-                                       dist = Math.min(d_ij.doubleValue(), dist);
-                               if (d_ji != null)
-                                       dist = Math.min(d_ji.doubleValue(), dist);
-                               dm[i][j] = dm[j][i] = dist;
-                       }
-               }
-       }
-       }
-
-       public void step() {
-               try {
-                       currentIteration++;
-                       double energy = calcEnergy();
-                       status = "Kamada-Kawai V=" + getGraph().getVertexCount()
-                       + "(" + getGraph().getVertexCount() + ")"
-                       + " IT: " + currentIteration
-                       + " E=" + energy
-                       ;
-
-                       int n = getGraph().getVertexCount();
-                       if (n == 0)
-                               return;
-
-                       double maxDeltaM = 0;
-                       int pm = -1;            // the node having max deltaM
-                       for (int i = 0; i < n; i++) {
-                               if (isLocked(vertices[i]))
-                                       continue;
-                               double deltam = calcDeltaM(i);
-
-                               if (maxDeltaM < deltam) {
-                                       maxDeltaM = deltam;
-                                       pm = i;
-                               }
-                       }
-                       if (pm == -1)
-                               return;
-
-                       for (int i = 0; i < 100; i++) {
-                               double[] dxy = calcDeltaXY(pm);
-                               xydata[pm].setLocation(xydata[pm].getX()+dxy[0], xydata[pm].getY()+dxy[1]);
-
-                               double deltam = calcDeltaM(pm);
-                               if (deltam < EPSILON)
-                                       break;
-                       }
-
-                       if (adjustForGravity)
-                               adjustForGravity();
-
-                       if (exchangeVertices && maxDeltaM < EPSILON) {
-                               energy = calcEnergy();
-                               for (int i = 0; i < n - 1; i++) {
-                                       if (isLocked(vertices[i]))
-                                               continue;
-                                       for (int j = i + 1; j < n; j++) {
-                                               if (isLocked(vertices[j]))
-                                                       continue;
-                                               double xenergy = calcEnergyIfExchanged(i, j);
-                                               if (energy > xenergy) {
-                                                       double sx = xydata[i].getX();
-                                                       double sy = xydata[i].getY();
-                                                       xydata[i].setLocation(xydata[j]);
-                                                       xydata[j].setLocation(sx, sy);
-                                                       return;
-                                               }
-                                       }
-                               }
-                       }
-               }
-               finally {
-//                     fireStateChanged();
-               }
-       }
-
-       /**
-        * Shift all vertices so that the center of gravity is located at
-        * the center of the screen.
-        */
-       public void adjustForGravity() {
-               Dimension d = getSize();
-               double height = d.getHeight();
-               double width = d.getWidth();
-               double gx = 0;
-               double gy = 0;
-               for (int i = 0; i < xydata.length; i++) {
-                       gx += xydata[i].getX();
-                       gy += xydata[i].getY();
-               }
-               gx /= xydata.length;
-               gy /= xydata.length;
-               double diffx = width / 2 - gx;
-               double diffy = height / 2 - gy;
-               for (int i = 0; i < xydata.length; i++) {
-            xydata[i].setLocation(xydata[i].getX()+diffx, xydata[i].getY()+diffy);
-               }
-       }
-
-    /* (non-Javadoc)
-        * @see edu.uci.ics.jung.visualization.layout.AbstractLayout#setSize(java.awt.Dimension)
-        */
-       @Override
-       public void setSize(Dimension size) {
-               if(initialized == false)
-                       setInitializer(new RandomLocationTransformer<V>(size));
-               super.setSize(size);
-       }
-
-       /**
-        * Enable or disable gravity point adjusting.
-        */
-       public void setAdjustForGravity(boolean on) {
-               adjustForGravity = on;
-       }
-
-       /**
-        * Returns true if gravity point adjusting is enabled.
-        */
-       public boolean getAdjustForGravity() {
-               return adjustForGravity;
-       }
-
-       /**
-        * Enable or disable the local minimum escape technique by
-        * exchanging vertices.
-        */
-       public void setExchangeVertices(boolean on) {
-               exchangeVertices = on;
-       }
-
-       /**
-        * Returns true if the local minimum escape technique by
-        * exchanging vertices is enabled.
-        */
-       public boolean getExchangeVertices() {
-               return exchangeVertices;
-       }
-
-       /**
-        * Determines a step to new position of the vertex m.
-        */
-       private double[] calcDeltaXY(int m) {
-               double dE_dxm = 0;
-               double dE_dym = 0;
-               double d2E_d2xm = 0;
-               double d2E_dxmdym = 0;
-               double d2E_dymdxm = 0;
-               double d2E_d2ym = 0;
-
-               for (int i = 0; i < vertices.length; i++) {
-                       if (i != m) {
-                
-                double dist = dm[m][i];
-                               double l_mi = L * dist;
-                               double k_mi = K / (dist * dist);
-                               double dx = xydata[m].getX() - xydata[i].getX();
-                               double dy = xydata[m].getY() - xydata[i].getY();
-                               double d = Math.sqrt(dx * dx + dy * dy);
-                               double ddd = d * d * d;
-
-                               dE_dxm += k_mi * (1 - l_mi / d) * dx;
-                               dE_dym += k_mi * (1 - l_mi / d) * dy;
-                               d2E_d2xm += k_mi * (1 - l_mi * dy * dy / ddd);
-                               d2E_dxmdym += k_mi * l_mi * dx * dy / ddd;
-                               d2E_d2ym += k_mi * (1 - l_mi * dx * dx / ddd);
-                       }
-               }
-               // d2E_dymdxm equals to d2E_dxmdym.
-               d2E_dymdxm = d2E_dxmdym;
-
-               double denomi = d2E_d2xm * d2E_d2ym - d2E_dxmdym * d2E_dymdxm;
-               double deltaX = (d2E_dxmdym * dE_dym - d2E_d2ym * dE_dxm) / denomi;
-               double deltaY = (d2E_dymdxm * dE_dxm - d2E_d2xm * dE_dym) / denomi;
-               return new double[]{deltaX, deltaY};
-       }
-
-       /**
-        * Calculates the gradient of energy function at the vertex m.
-        */
-       private double calcDeltaM(int m) {
-               double dEdxm = 0;
-               double dEdym = 0;
-               for (int i = 0; i < vertices.length; i++) {
-                       if (i != m) {
-                double dist = dm[m][i];
-                               double l_mi = L * dist;
-                               double k_mi = K / (dist * dist);
-
-                               double dx = xydata[m].getX() - xydata[i].getX();
-                               double dy = xydata[m].getY() - xydata[i].getY();
-                               double d = Math.sqrt(dx * dx + dy * dy);
-
-                               double common = k_mi * (1 - l_mi / d);
-                               dEdxm += common * dx;
-                               dEdym += common * dy;
-                       }
-               }
-               return Math.sqrt(dEdxm * dEdxm + dEdym * dEdym);
-       }
-
-       /**
-        * Calculates the energy function E.
-        */
-       private double calcEnergy() {
-               double energy = 0;
-               for (int i = 0; i < vertices.length - 1; i++) {
-                       for (int j = i + 1; j < vertices.length; j++) {
-                double dist = dm[i][j];
-                               double l_ij = L * dist;
-                               double k_ij = K / (dist * dist);
-                               double dx = xydata[i].getX() - xydata[j].getX();
-                               double dy = xydata[i].getY() - xydata[j].getY();
-                               double d = Math.sqrt(dx * dx + dy * dy);
-
-
-                               energy += k_ij / 2 * (dx * dx + dy * dy + l_ij * l_ij -
-                                                                         2 * l_ij * d);
-                       }
-               }
-               return energy;
-       }
-
-       /**
-        * Calculates the energy function E as if positions of the
-        * specified vertices are exchanged.
-        */
-       private double calcEnergyIfExchanged(int p, int q) {
-               if (p >= q)
-                       throw new RuntimeException("p should be < q");
-               double energy = 0;              // < 0
-               for (int i = 0; i < vertices.length - 1; i++) {
-                       for (int j = i + 1; j < vertices.length; j++) {
-                               int ii = i;
-                               int jj = j;
-                               if (i == p) ii = q;
-                               if (j == q) jj = p;
-
-                double dist = dm[i][j];
-                               double l_ij = L * dist;
-                               double k_ij = K / (dist * dist);
-                               double dx = xydata[ii].getX() - xydata[jj].getX();
-                               double dy = xydata[ii].getY() - xydata[jj].getY();
-                               double d = Math.sqrt(dx * dx + dy * dy);
-                               
-                               energy += k_ij / 2 * (dx * dx + dy * dy + l_ij * l_ij -
-                                                                         2 * l_ij * d);
-                       }
-               }
-               return energy;
-       }
-
-       public void reset() {
-               currentIteration = 0;
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/Layout.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/Layout.java
deleted file mode 100644 (file)
index 5162ac5..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.layout;
-
-import java.awt.Dimension;
-import java.awt.geom.Point2D;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.graph.Graph;
-
-/**
- * A generalized interface is a mechanism for returning (x,y) coordinates 
- * from vertices. In general, most of these methods are used to both control and
- * get information from the layout algorithm.
- * <p>
- * @author danyelf
- * @author tom nelson
- */
-public interface Layout<V, E> extends Transformer<V,Point2D> {
-    
-       /**
-        * Initializes fields in the node that may not have
-        * been set during the constructor. Must be called before
-        * the iterations begin.
-        */
-       void initialize();
-       
-       /**
-        * provides initial locations for all vertices.
-        * @param initializer
-        */
-       void setInitializer(Transformer<V,Point2D> initializer);
-    
-       /**
-        * setter for graph
-        * @param graph
-        */
-    void setGraph(Graph<V,E> graph);
-
-       /**
-        * Returns the full graph (the one that was passed in at 
-        * construction time) that this Layout refers to.
-        * 
-        */
-       Graph<V,E> getGraph();
-       
-       /**
-        * 
-        *
-        */
-       void reset();
-       
-       /**
-        * @param d
-        */
-       void setSize(Dimension d);
-       
-       /**
-        * Returns the current size of the visualization's space.
-        */
-       Dimension getSize();
-
-
-       /**
-        * Sets a flag which fixes this vertex in place.
-     * 
-        * @param v     vertex
-        */
-       void lock(V v, boolean state);
-
-    /**
-     * Returns <code>true</code> if the position of vertex <code>v</code>
-     * is locked.
-     */
-    boolean isLocked(V v);
-
-    /**
-     * set the location of a vertex
-     * @param v
-     * @param location
-     */
-       void setLocation(V v, Point2D location);
-
-
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/LayoutDecorator.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/LayoutDecorator.java
deleted file mode 100644 (file)
index b1f2595..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright (c) 2005, the JUNG Project and the Regents of the University of
- * California All rights reserved.
- *
- * This software is open-source under the BSD license; see either "license.txt"
- * or http://jung.sourceforge.net/license.txt for a description.
- *
- * Created on Aug 23, 2005
- */
-
-package edu.uci.ics.jung.algorithms.layout;
-
-import java.awt.Dimension;
-import java.awt.geom.Point2D;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.algorithms.util.IterativeContext;
-import edu.uci.ics.jung.graph.Graph;
-
-/**
- * a pure decorator for the Layout interface. Intended to be overridden
- * to provide specific behavior decoration
- * 
- * @author Tom Nelson 
- *
- */
-public abstract class LayoutDecorator<V, E> implements Layout<V, E>, IterativeContext {
-    
-    protected Layout<V, E> delegate;
-    
-    /**
-     * Creates an instance backed by the specified delegate layout.
-     */
-    public LayoutDecorator(Layout<V, E> delegate) {
-        this.delegate = delegate;
-    }
-
-    /**
-     * Returns the backing (delegate) layout.
-     */
-    public Layout<V,E> getDelegate() {
-        return delegate;
-    }
-
-    /**
-     * Sets the backing (delegate) layout.
-     */
-    public void setDelegate(Layout<V,E> delegate) {
-        this.delegate = delegate;
-    }
-
-    /**
-     * @see edu.uci.ics.jung.algorithms.util.IterativeContext#done()
-     */
-    public void step() {
-       if(delegate instanceof IterativeContext) {
-               ((IterativeContext)delegate).step();
-       }
-    }
-
-    /**
-        * 
-        * @see edu.uci.ics.jung.algorithms.layout.Layout#initialize()
-        */
-       public void initialize() {
-               delegate.initialize();
-       }
-
-       /**
-        * @param initializer
-        * @see edu.uci.ics.jung.algorithms.layout.Layout#setInitializer(org.apache.commons.collections15.Transformer)
-        */
-       public void setInitializer(Transformer<V, Point2D> initializer) {
-               delegate.setInitializer(initializer);
-       }
-
-       /**
-        * @param v
-        * @param location
-        * @see edu.uci.ics.jung.algorithms.layout.Layout#setLocation(java.lang.Object, java.awt.geom.Point2D)
-        */
-       public void setLocation(V v, Point2D location) {
-               delegate.setLocation(v, location);
-       }
-
-    /**
-     * @see edu.uci.ics.jung.algorithms.layout.Layout#getSize()
-     */
-    public Dimension getSize() {
-        return delegate.getSize();
-    }
-
-    /**
-     * @see edu.uci.ics.jung.algorithms.layout.Layout#getGraph()
-     */
-    public Graph<V, E> getGraph() {
-        return delegate.getGraph();
-    }
-
-    /**
-     * @see edu.uci.ics.jung.algorithms.layout.Layout#transform(Object)
-     */
-    public Point2D transform(V v) {
-        return delegate.transform(v);
-    }
-
-    /**
-     * @see edu.uci.ics.jung.algorithms.util.IterativeContext#done()
-     */
-    public boolean done() {
-       if(delegate instanceof IterativeContext) {
-               return ((IterativeContext)delegate).done();
-       }
-       return true;
-    }
-
-    /**
-     * @see edu.uci.ics.jung.algorithms.layout.Layout#lock(Object, boolean)
-     */
-    public void lock(V v, boolean state) {
-        delegate.lock(v, state);
-    }
-
-    /**
-     * @see edu.uci.ics.jung.algorithms.layout.Layout#isLocked(Object)
-     */
-    public boolean isLocked(V v) {
-        return delegate.isLocked(v);
-    }
-    
-    /**
-     * @see edu.uci.ics.jung.algorithms.layout.Layout#setSize(Dimension)
-     */
-    public void setSize(Dimension d) {
-        delegate.setSize(d);
-    }
-
-    /**
-     * @see edu.uci.ics.jung.algorithms.layout.Layout#reset()
-     */
-    public void reset() {
-       delegate.reset();
-    }
-    
-    public void setGraph(Graph<V, E> graph) {
-        delegate.setGraph(graph);
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/PolarPoint.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/PolarPoint.java
deleted file mode 100644 (file)
index aa3dc7b..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.layout;
-
-import java.awt.geom.Point2D;
-
-/**
- * Represents a point in polar coordinates: distance and angle from the origin.
- * Includes conversions between polar and Cartesian
- * coordinates (Point2D).
- * 
- * @author Tom Nelson - tomnelson@dev.java.net
- */
-public class PolarPoint 
-{
-       double theta;
-       double radius;
-       
-       /**
-        * Creates a new instance with radius and angle each 0.
-        */
-       public PolarPoint() {
-               this(0,0);
-       }
-
-       /**
-        * Creates a new instance with radius {@code radius} and angle {@code theta}.
-        */
-       public PolarPoint(double theta, double radius) {
-               this.theta = theta;
-               this.radius = radius;
-       }
-       
-       /**
-        * Returns the angle for this point.
-        */
-       public double getTheta() { return theta; }
-
-       /**
-        * Returns the radius for this point.
-        */
-       public double getRadius() { return radius; }
-       
-       /**
-        * Sets the angle for this point to {@code theta}.
-        */
-       public void setTheta(double theta) { this.theta = theta; }
-       
-       /**
-        * Sets the radius for this point to {@code theta}.
-        */
-       public void setRadius(double radius) { this.radius = radius; }
-
-       /**
-        * Returns the result of converting <code>polar</code> to Cartesian coordinates.
-        */
-       public static Point2D polarToCartesian(PolarPoint polar) {
-               return polarToCartesian(polar.getTheta(), polar.getRadius());
-       }
-
-       /**
-        * Returns the result of converting <code>(theta, radius)</code> to Cartesian coordinates.
-        */
-       public static Point2D polarToCartesian(double theta, double radius) {
-               return new Point2D.Double(radius*Math.cos(theta), radius*Math.sin(theta));
-       }
-
-       /**
-        * Returns the result of converting <code>point</code> to polar coordinates.
-        */
-       public static PolarPoint cartesianToPolar(Point2D point) {
-               return cartesianToPolar(point.getX(), point.getY());
-       }
-
-       /**
-        * Returns the result of converting <code>(x, y)</code> to polar coordinates.
-        */
-       public static PolarPoint cartesianToPolar(double x, double y) {
-               double theta = Math.atan2(y,x);
-               double radius = Math.sqrt(x*x+y*y);
-               return new PolarPoint(theta, radius);
-       }
-       
-       @Override
-       public String toString() {
-           return "PolarPoint[" + radius + "," + theta +"]";
-       }
-       
-       /**
-        * Sets the angle and radius of this point to those of {@code p}.
-        */
-       public void setLocation(PolarPoint p) {
-               this.theta = p.getTheta();
-               this.radius = p.getRadius();
-       }
-}
\ No newline at end of file
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/RadialTreeLayout.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/RadialTreeLayout.java
deleted file mode 100644 (file)
index 457bd96..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (c) 2005, the JUNG Project and the Regents of the University of
- * California All rights reserved.
- *
- * This software is open-source under the BSD license; see either "license.txt"
- * or http://jung.sourceforge.net/license.txt for a description.
- *
- * Created on Jul 9, 2005
- */
-
-package edu.uci.ics.jung.algorithms.layout;
-import java.awt.Dimension;
-import java.awt.geom.Point2D;
-import java.util.HashMap;
-import java.util.Map;
-
-import edu.uci.ics.jung.graph.Forest;
-
-/**
- * A radial layout for Tree or Forest graphs.
- * 
- * @author Tom Nelson 
- *  
- */
-public class RadialTreeLayout<V,E> extends TreeLayout<V,E> {
-
-    protected Map<V,PolarPoint> polarLocations;
-
-    /**
-     * Creates an instance for the specified graph with default X and Y distances.
-     */
-    public RadialTreeLayout(Forest<V,E> g) {
-       this(g, DEFAULT_DISTX, DEFAULT_DISTY);
-    }
-
-    /**
-     * Creates an instance for the specified graph and X distance with
-     * default Y distance.
-     */
-    public RadialTreeLayout(Forest<V,E> g, int distx) {
-        this(g, distx, DEFAULT_DISTY);
-    }
-
-    /**
-     * Creates an instance for the specified graph, X distance, and Y distance.
-     */
-    public RadialTreeLayout(Forest<V,E> g, int distx, int disty) {
-       super(g, distx, disty);
-    }
-    
-       @Override
-    protected void buildTree() {
-           super.buildTree();
-           this.polarLocations = new HashMap<V, PolarPoint>();
-        setRadialLocations();
-    }
-
-    @Override
-    public void setSize(Dimension size) {
-       this.size = size;
-        buildTree();
-    }
-
-    @Override
-    protected void setCurrentPositionFor(V vertex) {
-       locations.get(vertex).setLocation(m_currentPoint);
-    }
-
-       @Override
-    public void setLocation(V v, Point2D location)
-    {
-        Point2D c = getCenter();
-        Point2D pv = new Point2D.Double(location.getX() - c.getX(), 
-                location.getY() - c.getY());
-        PolarPoint newLocation = PolarPoint.cartesianToPolar(pv);
-        PolarPoint currentLocation = polarLocations.get(v);
-        if (currentLocation == null)
-               polarLocations.put(v, newLocation);
-        else
-               currentLocation.setLocation(newLocation);
-     }
-       
-       /**
-        * Returns the map from vertices to their locations in polar coordinates.
-        */
-       public Map<V,PolarPoint> getPolarLocations() {
-               return polarLocations;
-       }
-
-       @Override
-    public Point2D transform(V v) {
-               PolarPoint pp = polarLocations.get(v);
-               double centerX = getSize().getWidth()/2;
-               double centerY = getSize().getHeight()/2;
-               Point2D cartesian = PolarPoint.polarToCartesian(pp);
-               cartesian.setLocation(cartesian.getX()+centerX,cartesian.getY()+centerY);
-               return cartesian;
-       }
-       
-       private Point2D getMaxXY() {
-               double maxx = 0;
-               double maxy = 0;
-               for(Point2D p : locations.values()) {
-                       maxx = Math.max(maxx, p.getX());
-                       maxy = Math.max(maxy, p.getY());
-               }
-               return new Point2D.Double(maxx,maxy);
-       }
-       
-       private void setRadialLocations() {
-               Point2D max = getMaxXY();
-               double maxx = max.getX();
-               double maxy = max.getY();
-               maxx = Math.max(maxx, size.width);
-               double theta = 2*Math.PI/maxx;
-
-               double deltaRadius = size.width/2/maxy;
-               for(Map.Entry<V, Point2D> entry : locations.entrySet()) {
-                       V v = entry.getKey();
-                       Point2D p = entry.getValue();
-                       PolarPoint polarPoint = new PolarPoint(p.getX()*theta, (p.getY() - this.distY)*deltaRadius);
-                       polarLocations.put(v, polarPoint);
-               }
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/RadiusGraphElementAccessor.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/RadiusGraphElementAccessor.java
deleted file mode 100644 (file)
index 5f12c3c..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (c) 2005, the JUNG Project and the Regents of the University of
- * California All rights reserved.
- * 
- * This software is open-source under the BSD license; see either "license.txt"
- * or http://jung.sourceforge.net/license.txt for a description.
- * 
- *
- * Created on Apr 12, 2005
- */
-package edu.uci.ics.jung.algorithms.layout;
-
-import java.awt.Shape;
-import java.awt.geom.Point2D;
-import java.util.Collection;
-import java.util.ConcurrentModificationException;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import edu.uci.ics.jung.graph.Graph;
-
-
-/**
- * Simple implementation of PickSupport that returns the vertex or edge
- * that is closest to the specified location.  This implementation
- * provides the same picking options that were available in
- * previous versions of AbstractLayout.
- * 
- * <p>No element will be returned that is farther away than the specified 
- * maximum distance.
- * 
- * @author Tom Nelson
- * @author Joshua O'Madadhain
- */
-public class RadiusGraphElementAccessor<V, E> implements GraphElementAccessor<V, E> {
-    
-    protected double maxDistance;
-    
-    /**
-     * Creates an instance with an effectively infinite default maximum distance.
-     */
-    public RadiusGraphElementAccessor() {
-        this(Math.sqrt(Double.MAX_VALUE - 1000));
-    }
-    
-    /**
-     * Creates an instance with the specified default maximum distance.
-     */
-    public RadiusGraphElementAccessor(double maxDistance) {
-        this.maxDistance = maxDistance;
-    }
-    
-       /**
-        * Gets the vertex nearest to the location of the (x,y) location selected,
-        * within a distance of <tt>maxDistance</tt>. Iterates through all
-        * visible vertices and checks their distance from the click. Override this
-        * method to provde a more efficient implementation.
-        */
-       public V getVertex(Layout<V,E> layout, double x, double y) {
-           return getVertex(layout, x, y, this.maxDistance);
-       }
-
-       /**
-        * Gets the vertex nearest to the location of the (x,y) location selected,
-        * within a distance of <tt>maxDistance</tt>. Iterates through all
-        * visible vertices and checks their distance from the click. Override this
-        * method to provde a more efficient implementation.
-        * @param x
-        * @param y
-        * @param maxDistance temporarily overrides member maxDistance
-        */
-       public V getVertex(Layout<V,E> layout, double x, double y, double maxDistance) {
-               double minDistance = maxDistance * maxDistance;
-        V closest = null;
-               while(true) {
-                   try {
-                for(V v : layout.getGraph().getVertices()) {
-
-                           Point2D p = layout.transform(v);
-                           double dx = p.getX() - x;
-                           double dy = p.getY() - y;
-                           double dist = dx * dx + dy * dy;
-                           if (dist < minDistance) {
-                               minDistance = dist;
-                               closest = v;
-                           }
-                       }
-                       break;
-                   } catch(ConcurrentModificationException cme) {}
-               }
-               return closest;
-       }
-       
-       public Collection<V> getVertices(Layout<V,E> layout, Shape rectangle) {
-               Set<V> pickedVertices = new HashSet<V>();
-               while(true) {
-                   try {
-                for(V v : layout.getGraph().getVertices()) {
-
-                           Point2D p = layout.transform(v);
-                           if(rectangle.contains(p)) {
-                               pickedVertices.add(v);
-                           }
-                       }
-                       break;
-                   } catch(ConcurrentModificationException cme) {}
-               }
-               return pickedVertices;
-       }
-       
-       /**
-        * Gets the edge nearest to the location of the (x,y) location selected.
-        * Calls the longer form of the call.
-        */
-       public E getEdge(Layout<V,E> layout, double x, double y) {
-           return getEdge(layout, x, y, this.maxDistance);
-       }
-
-       /**
-        * Gets the edge nearest to the location of the (x,y) location selected,
-        * within a distance of <tt>maxDistance</tt>, Iterates through all
-        * visible edges and checks their distance from the click. Override this
-        * method to provide a more efficient implementation.
-        * 
-        * @param x
-        * @param y
-        * @param maxDistance temporarily overrides member maxDistance
-        * @return Edge closest to the click.
-        */
-       public E getEdge(Layout<V,E> layout, double x, double y, double maxDistance) {
-               double minDistance = maxDistance * maxDistance;
-               E closest = null;
-               while(true) {
-                   try {
-                for(E e : layout.getGraph().getEdges()) {
-
-                           // Could replace all this set stuff with getFrom_internal() etc.
-                    Graph<V, E> graph = layout.getGraph();
-                           Collection<V> vertices = graph.getIncidentVertices(e);
-                           Iterator<V> vertexIterator = vertices.iterator();
-                           V v1 = vertexIterator.next();
-                           V v2 = vertexIterator.next();
-                           // Get coords
-                           Point2D p1 = layout.transform(v1);
-                           Point2D p2 = layout.transform(v2);
-                           double x1 = p1.getX();
-                           double y1 = p1.getY();
-                           double x2 = p2.getX();
-                           double y2 = p2.getY();
-                           // Calculate location on line closest to (x,y)
-                           // First, check that v1 and v2 are not coincident.
-                           if (x1 == x2 && y1 == y2)
-                               continue;
-                           double b =
-                               ((y - y1) * (y2 - y1) + (x - x1) * (x2 - x1))
-                               / ((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
-                           //
-                           double distance2; // square of the distance
-                           if (b <= 0)
-                               distance2 = (x - x1) * (x - x1) + (y - y1) * (y - y1);
-                           else if (b >= 1)
-                               distance2 = (x - x2) * (x - x2) + (y - y2) * (y - y2);
-                           else {
-                               double x3 = x1 + b * (x2 - x1);
-                               double y3 = y1 + b * (y2 - y1);
-                               distance2 = (x - x3) * (x - x3) + (y - y3) * (y - y3);
-                           }
-                           
-                           if (distance2 < minDistance) {
-                               minDistance = distance2;
-                               closest = e;
-                           }
-                       }
-                       break;
-                   } catch(ConcurrentModificationException cme) {}
-               }
-               return closest;
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/SpringLayout.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/SpringLayout.java
deleted file mode 100644 (file)
index d21c2a1..0000000
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University of
- * California All rights reserved.
- *
- * This software is open-source under the BSD license; see either "license.txt"
- * or http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.layout;
-
-import edu.uci.ics.jung.algorithms.layout.util.RandomLocationTransformer;
-import edu.uci.ics.jung.algorithms.util.IterativeContext;
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.util.Pair;
-
-import org.apache.commons.collections15.Factory;
-import org.apache.commons.collections15.Transformer;
-import org.apache.commons.collections15.functors.ConstantTransformer;
-import org.apache.commons.collections15.map.LazyMap;
-
-import java.awt.Dimension;
-import java.awt.event.ComponentAdapter;
-import java.awt.event.ComponentEvent;
-import java.awt.geom.Point2D;
-import java.util.ConcurrentModificationException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * The SpringLayout package represents a visualization of a set of nodes. The
- * SpringLayout, which is initialized with a Graph, assigns X/Y locations to
- * each node. When called <code>relax()</code>, the SpringLayout moves the
- * visualization forward one step.
- *
- * @author Danyel Fisher
- * @author Joshua O'Madadhain
- */
-public class SpringLayout<V, E> extends AbstractLayout<V,E> implements IterativeContext {
-
-    protected double stretch = 0.70;
-    protected Transformer<E, Integer> lengthFunction;
-    protected int repulsion_range_sq = 100 * 100;
-    protected double force_multiplier = 1.0 / 3.0;
-
-    protected Map<V, SpringVertexData> springVertexData =
-       LazyMap.decorate(new HashMap<V, SpringVertexData>(),
-                       new Factory<SpringVertexData>() {
-                                       public SpringVertexData create() {
-                                               return new SpringVertexData();
-                                       }});
-
-    /**
-     * Constructor for a SpringLayout for a raw graph with associated
-     * dimension--the input knows how big the graph is. Defaults to the unit
-     * length function.
-     */
-    @SuppressWarnings("unchecked")
-    public SpringLayout(Graph<V,E> g) {
-        this(g, new ConstantTransformer(30));
-    }
-
-    /**
-     * Constructor for a SpringLayout for a raw graph with associated component.
-     *
-     * @param g the {@code Graph} to lay out
-     * @param length_function provides a length for each edge
-     */
-    public SpringLayout(Graph<V,E> g, Transformer<E, Integer> length_function)
-    {
-        super(g);
-        this.lengthFunction = length_function;
-    }
-
-    /**
-     * Returns the current value for the stretch parameter.
-     * @see #setStretch(double)
-     */
-    public double getStretch() {
-        return stretch;
-    }
-
-    /**
-     * Sets the dimensions of the available space for layout to {@code size}.
-     */
-       @Override
-       public void setSize(Dimension size) {
-               if(initialized == false)
-                       setInitializer(new RandomLocationTransformer<V>(size));
-               super.setSize(size);
-       }
-
-    /**
-     * <p>Sets the stretch parameter for this instance.  This value
-     * specifies how much the degrees of an edge's incident vertices
-     * should influence how easily the endpoints of that edge
-     * can move (that is, that edge's tendency to change its length).</p>
-     *
-     * <p>The default value is 0.70.  Positive values less than 1 cause
-     * high-degree vertices to move less than low-degree vertices, and
-     * values > 1 cause high-degree vertices to move more than
-     * low-degree vertices.  Negative values will have unpredictable
-     * and inconsistent results.</p>
-     * @param stretch
-     */
-    public void setStretch(double stretch) {
-        this.stretch = stretch;
-    }
-
-    /**
-     * Returns the current value for the node repulsion range.
-     * @see #setRepulsionRange(int)
-     */
-    public int getRepulsionRange() {
-        return (int)(Math.sqrt(repulsion_range_sq));
-    }
-
-    /**
-     * Sets the node repulsion range (in drawing area units) for this instance.
-     * Outside this range, nodes do not repel each other.  The default value
-     * is 100.  Negative values are treated as their positive equivalents.
-     * @param range
-     */
-    public void setRepulsionRange(int range) {
-        this.repulsion_range_sq = range * range;
-    }
-
-    /**
-     * Returns the current value for the edge length force multiplier.
-     * @see #setForceMultiplier(double)
-     */
-    public double getForceMultiplier() {
-        return force_multiplier;
-    }
-
-    /**
-     * Sets the force multiplier for this instance.  This value is used to
-     * specify how strongly an edge "wants" to be its default length
-     * (higher values indicate a greater attraction for the default length),
-     * which affects how much its endpoints move at each timestep.
-     * The default value is 1/3.  A value of 0 turns off any attempt by the
-     * layout to cause edges to conform to the default length.  Negative
-     * values cause long edges to get longer and short edges to get shorter; use
-     * at your own risk.
-     */
-    public void setForceMultiplier(double force) {
-        this.force_multiplier = force;
-    }
-
-    public void initialize() {
-    }
-
-    /**
-     * Relaxation step. Moves all nodes a smidge.
-     */
-    public void step() {
-       try {
-               for(V v : getGraph().getVertices()) {
-                       SpringVertexData svd = springVertexData.get(v);
-                       if (svd == null) {
-                               continue;
-                       }
-                       svd.dx /= 4;
-                       svd.dy /= 4;
-                       svd.edgedx = svd.edgedy = 0;
-                       svd.repulsiondx = svd.repulsiondy = 0;
-               }
-       } catch(ConcurrentModificationException cme) {
-               step();
-       }
-
-       relaxEdges();
-       calculateRepulsion();
-       moveNodes();
-    }
-
-    protected void relaxEdges() {
-       try {
-               for(E e : getGraph().getEdges()) {
-                   Pair<V> endpoints = getGraph().getEndpoints(e);
-                       V v1 = endpoints.getFirst();
-                       V v2 = endpoints.getSecond();
-
-                       Point2D p1 = transform(v1);
-                       Point2D p2 = transform(v2);
-                       if(p1 == null || p2 == null) continue;
-                       double vx = p1.getX() - p2.getX();
-                       double vy = p1.getY() - p2.getY();
-                       double len = Math.sqrt(vx * vx + vy * vy);
-
-                       double desiredLen = lengthFunction.transform(e);
-
-                       // round from zero, if needed [zero would be Bad.].
-                       len = (len == 0) ? .0001 : len;
-
-                       double f = force_multiplier * (desiredLen - len) / len;
-
-                       f = f * Math.pow(stretch, (getGraph().degree(v1) + getGraph().degree(v2) - 2));
-
-                       // the actual movement distance 'dx' is the force multiplied by the
-                       // distance to go.
-                       double dx = f * vx;
-                       double dy = f * vy;
-                       SpringVertexData v1D, v2D;
-                       v1D = springVertexData.get(v1);
-                       v2D = springVertexData.get(v2);
-
-                       v1D.edgedx += dx;
-                       v1D.edgedy += dy;
-                       v2D.edgedx += -dx;
-                       v2D.edgedy += -dy;
-               }
-       } catch(ConcurrentModificationException cme) {
-               relaxEdges();
-       }
-    }
-
-    protected void calculateRepulsion() {
-        try {
-        for (V v : getGraph().getVertices()) {
-            if (isLocked(v)) continue;
-
-            SpringVertexData svd = springVertexData.get(v);
-            if(svd == null) continue;
-            double dx = 0, dy = 0;
-
-            for (V v2 : getGraph().getVertices()) {
-                if (v == v2) continue;
-                Point2D p = transform(v);
-                Point2D p2 = transform(v2);
-                if(p == null || p2 == null) continue;
-                double vx = p.getX() - p2.getX();
-                double vy = p.getY() - p2.getY();
-                double distanceSq = p.distanceSq(p2);
-                if (distanceSq == 0) {
-                    dx += Math.random();
-                    dy += Math.random();
-                } else if (distanceSq < repulsion_range_sq) {
-                    double factor = 1;
-                    dx += factor * vx / distanceSq;
-                    dy += factor * vy / distanceSq;
-                }
-            }
-            double dlen = dx * dx + dy * dy;
-            if (dlen > 0) {
-                dlen = Math.sqrt(dlen) / 2;
-                svd.repulsiondx += dx / dlen;
-                svd.repulsiondy += dy / dlen;
-            }
-        }
-        } catch(ConcurrentModificationException cme) {
-            calculateRepulsion();
-        }
-    }
-
-    protected void moveNodes()
-    {
-        synchronized (getSize()) {
-            try {
-                for (V v : getGraph().getVertices()) {
-                    if (isLocked(v)) continue;
-                    SpringVertexData vd = springVertexData.get(v);
-                    if(vd == null) continue;
-                    Point2D xyd = transform(v);
-
-                    vd.dx += vd.repulsiondx + vd.edgedx;
-                    vd.dy += vd.repulsiondy + vd.edgedy;
-
-                    // keeps nodes from moving any faster than 5 per time unit
-                    xyd.setLocation(xyd.getX()+Math.max(-5, Math.min(5, vd.dx)),
-                               xyd.getY()+Math.max(-5, Math.min(5, vd.dy)));
-
-                    Dimension d = getSize();
-                    int width = d.width;
-                    int height = d.height;
-
-                    if (xyd.getX() < 0) {
-                        xyd.setLocation(0, xyd.getY());
-                    } else if (xyd.getX() > width) {
-                        xyd.setLocation(width, xyd.getY());
-                    }
-                    if (xyd.getY() < 0) {
-                        xyd.setLocation(xyd.getX(), 0);
-                    } else if (xyd.getY() > height) {
-                        xyd.setLocation(xyd.getX(), height);
-                    }
-
-                }
-            } catch(ConcurrentModificationException cme) {
-                moveNodes();
-            }
-        }
-    }
-
-    protected static class SpringVertexData {
-        protected double edgedx;
-        protected double edgedy;
-        protected double repulsiondx;
-        protected double repulsiondy;
-
-        /** movement speed, x */
-        protected double dx;
-
-        /** movement speed, y */
-        protected double dy;
-    }
-
-
-    /**
-     * Used for changing the size of the layout in response to a component's size.
-     */
-    public class SpringDimensionChecker extends ComponentAdapter {
-        @Override
-        public void componentResized(ComponentEvent e) {
-            setSize(e.getComponent().getSize());
-        }
-    }
-
-    /**
-     * This one is an incremental visualization
-     */
-    public boolean isIncremental() {
-        return true;
-    }
-
-    /**
-     * For now, we pretend it never finishes.
-     */
-    public boolean done() {
-        return false;
-    }
-
-    /**
-     * No effect.
-     */
-       public void reset() {
-       }
-}
\ No newline at end of file
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/SpringLayout2.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/SpringLayout2.java
deleted file mode 100644 (file)
index e62a30c..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University of
- * California All rights reserved.
- * 
- * This software is open-source under the BSD license; see either "license.txt"
- * or http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.layout;
-
-import java.awt.Dimension;
-import java.awt.geom.Point2D;
-import java.util.ConcurrentModificationException;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.graph.Graph;
-
-/**
- * The SpringLayout package represents a visualization of a set of nodes. The
- * SpringLayout, which is initialized with a Graph, assigns X/Y locations to
- * each node. When called <code>relax()</code>, the SpringLayout moves the
- * visualization forward one step.
- * 
- * 
- * 
- * @author Danyel Fisher
- * @author Joshua O'Madadhain
- */
-public class SpringLayout2<V, E> extends SpringLayout<V,E> 
-{
-    protected int currentIteration;
-    protected int averageCounter;
-    protected int loopCountMax = 4;
-    protected boolean done;
-    
-    protected Point2D averageDelta = new Point2D.Double();
-    
-    /**
-     * Constructor for a SpringLayout for a raw graph with associated
-     * dimension--the input knows how big the graph is. Defaults to the unit
-     * length function.
-     */
-    @SuppressWarnings("unchecked")
-    public SpringLayout2(Graph<V,E> g) {
-        super(g);
-    }
-
-    /**
-     * Constructor for a SpringLayout for a raw graph with associated component.
-     *
-     * @param g the {@code Graph} to lay out
-     * @param length_function provides a length for each edge
-     */
-    public SpringLayout2(Graph<V,E> g, Transformer<E, Integer> length_function)
-    {
-        super(g, length_function);
-    }
-
-    /**
-     * Relaxation step. Moves all nodes a smidge.
-     */
-    @Override
-    public void step() {
-        super.step();
-       currentIteration++;
-       testAverageDeltas();
-    }
-    
-    private void testAverageDeltas() {
-       double dx = this.averageDelta.getX();
-       double dy = this.averageDelta.getY();
-       if(Math.abs(dx) < .001 && Math.abs(dy) < .001) {
-               done = true;
-               System.err.println("done, dx="+dx+", dy="+dy);
-       }
-        if(currentIteration > loopCountMax) {
-               this.averageDelta.setLocation(0,0);
-               averageCounter = 0;
-               currentIteration = 0;
-        }
-    }
-
-    @Override
-    protected void moveNodes() {
-        synchronized (getSize()) {
-            try {
-                for (V v : getGraph().getVertices()) {
-                    if (isLocked(v)) continue;
-                    SpringVertexData vd = springVertexData.get(v);
-                    if(vd == null) continue;
-                    Point2D xyd = transform(v);
-                    
-                    vd.dx += vd.repulsiondx + vd.edgedx;
-                    vd.dy += vd.repulsiondy + vd.edgedy;
-                    
-//                    int currentCount = currentIteration % this.loopCountMax;
-//                    System.err.println(averageCounter+" --- vd.dx="+vd.dx+", vd.dy="+vd.dy);
-//                    System.err.println("averageDelta was "+averageDelta);
-
-                    averageDelta.setLocation(
-                               ((averageDelta.getX() * averageCounter) + vd.dx) / (averageCounter+1),
-                               ((averageDelta.getY() * averageCounter) + vd.dy) / (averageCounter+1)
-                               );
-//                    System.err.println("averageDelta now "+averageDelta);
-//                    System.err.println();
-                    averageCounter++;
-                    
-                    // keeps nodes from moving any faster than 5 per time unit
-                    xyd.setLocation(xyd.getX()+Math.max(-5, Math.min(5, vd.dx)),
-                               xyd.getY()+Math.max(-5, Math.min(5, vd.dy)));
-                    
-                    Dimension d = getSize();
-                    int width = d.width;
-                    int height = d.height;
-                    
-                    if (xyd.getX() < 0) {
-                        xyd.setLocation(0, xyd.getY());//                     setX(0);
-                    } else if (xyd.getX() > width) {
-                        xyd.setLocation(width, xyd.getY());             //setX(width);
-                    }
-                    if (xyd.getY() < 0) {
-                        xyd.setLocation(xyd.getX(),0);//setY(0);
-                    } else if (xyd.getY() > height) {
-                        xyd.setLocation(xyd.getX(), height);      //setY(height);
-                    }
-                    
-                }
-            } catch(ConcurrentModificationException cme) {
-                moveNodes();
-            }
-        }
-    }
-
-    @Override
-    public boolean done() {
-        return done;
-    }
-
-}
\ No newline at end of file
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/StaticLayout.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/StaticLayout.java
deleted file mode 100644 (file)
index 31b3255..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Created on Jul 21, 2005
- *
- * Copyright (c) 2005, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.layout;
-
-import java.awt.Dimension;
-import java.awt.geom.Point2D;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.graph.Graph;
-
-/**
- * StaticLayout places the vertices in the locations specified by its Transformer<V,Point2D>
- * initializer. Vertex locations can be placed in a Map<V,Point2D> and then supplied to
- * this layout as follows:
- * <code>
-            Transformer<V,Point2D> vertexLocations =
-               TransformerUtils.mapTransformer(map);
- * </code>
- * @author Tom Nelson - tomnelson@dev.java.net
- *
- * @param <V>
- * @param <E>
- */
-public class StaticLayout<V, E> extends AbstractLayout<V,E> {
-       
-    /**
-     * Creates an instance for the specified graph, locations, and size.
-     */
-    public StaticLayout(Graph<V,E> graph, Transformer<V,Point2D> initializer, Dimension size) {
-        super(graph, initializer, size);
-    }
-    
-    /**
-     * Creates an instance for the specified graph and locations, with default size.
-     */
-    public StaticLayout(Graph<V,E> graph, Transformer<V,Point2D> initializer) {
-        super(graph, initializer);
-    }
-    
-    /**
-     * Creates an instance for the specified graph and default size; vertex locations
-     * are randomly assigned.
-     */
-    public StaticLayout(Graph<V,E> graph) {
-       super(graph);
-    }
-    
-    /**
-     * Creates an instance for the specified graph and size.
-     */
-    public StaticLayout(Graph<V,E> graph, Dimension size) {
-       super(graph, size);
-    }
-    
-    public void initialize() {}
-
-       public void reset() {}
-
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/TreeLayout.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/TreeLayout.java
deleted file mode 100644 (file)
index 4bebd3a..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Copyright (c) 2005, the JUNG Project and the Regents of the University of
- * California All rights reserved.
- *
- * This software is open-source under the BSD license; see either "license.txt"
- * or http://jung.sourceforge.net/license.txt for a description.
- *
- * Created on Jul 9, 2005
- */
-
-package edu.uci.ics.jung.algorithms.layout;
-import java.awt.Dimension;
-import java.awt.Point;
-import java.awt.geom.Point2D;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.collections15.Transformer;
-import org.apache.commons.collections15.map.LazyMap;
-
-import edu.uci.ics.jung.graph.Forest;
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.util.TreeUtils;
-
-/**
- * @author Karlheinz Toni
- * @author Tom Nelson - converted to jung2
- *  
- */
-
-public class TreeLayout<V,E> implements Layout<V,E> {
-
-       protected Dimension size = new Dimension(600,600);
-       protected Forest<V,E> graph;
-       protected Map<V,Integer> basePositions = new HashMap<V,Integer>();
-
-    protected Map<V, Point2D> locations = 
-       LazyMap.decorate(new HashMap<V, Point2D>(),
-                       new Transformer<V,Point2D>() {
-                                       public Point2D transform(V arg0) {
-                                               return new Point2D.Double();
-                                       }});
-    
-    protected transient Set<V> alreadyDone = new HashSet<V>();
-
-    /**
-     * The default horizontal vertex spacing.  Initialized to 50.
-     */
-    public static int DEFAULT_DISTX = 50;
-    
-    /**
-     * The default vertical vertex spacing.  Initialized to 50.
-     */
-    public static int DEFAULT_DISTY = 50;
-    
-    /**
-     * The horizontal vertex spacing.  Defaults to {@code DEFAULT_XDIST}.
-     */
-    protected int distX = 50;
-    
-    /**
-     * The vertical vertex spacing.  Defaults to {@code DEFAULT_YDIST}.
-     */
-    protected int distY = 50;
-    
-    protected transient Point m_currentPoint = new Point();
-
-    /**
-     * Creates an instance for the specified graph with default X and Y distances.
-     */
-    public TreeLayout(Forest<V,E> g) {
-       this(g, DEFAULT_DISTX, DEFAULT_DISTY);
-    }
-
-    /**
-     * Creates an instance for the specified graph and X distance with
-     * default Y distance.
-     */
-    public TreeLayout(Forest<V,E> g, int distx) {
-        this(g, distx, DEFAULT_DISTY);
-    }
-
-    /**
-     * Creates an instance for the specified graph, X distance, and Y distance.
-     */
-    public TreeLayout(Forest<V,E> g, int distx, int disty) {
-        if (g == null)
-            throw new IllegalArgumentException("Graph must be non-null");
-        if (distx < 1 || disty < 1)
-            throw new IllegalArgumentException("X and Y distances must each be positive");
-       this.graph = g;
-        this.distX = distx;
-        this.distY = disty;
-        buildTree();
-    }
-    
-       protected void buildTree() {
-        this.m_currentPoint = new Point(0, 20);
-        Collection<V> roots = TreeUtils.getRoots(graph);
-        if (roots.size() > 0 && graph != null) {
-                       calculateDimensionX(roots);
-                       for(V v : roots) {
-                       calculateDimensionX(v);
-                       m_currentPoint.x += this.basePositions.get(v)/2 + this.distX;
-                       buildTree(v, this.m_currentPoint.x);
-               }
-        }
-        int width = 0;
-        for(V v : roots) {
-               width += basePositions.get(v);
-        }
-    }
-
-    protected void buildTree(V v, int x) {
-
-        if (!alreadyDone.contains(v)) {
-            alreadyDone.add(v);
-
-            //go one level further down
-            this.m_currentPoint.y += this.distY;
-            this.m_currentPoint.x = x;
-
-            this.setCurrentPositionFor(v);
-
-            int sizeXofCurrent = basePositions.get(v);
-
-            int lastX = x - sizeXofCurrent / 2;
-
-            int sizeXofChild;
-            int startXofChild;
-
-            for (V element : graph.getSuccessors(v)) {
-                sizeXofChild = this.basePositions.get(element);
-                startXofChild = lastX + sizeXofChild / 2;
-                buildTree(element, startXofChild);
-                lastX = lastX + sizeXofChild + distX;
-            }
-            this.m_currentPoint.y -= this.distY;
-        }
-    }
-    
-    private int calculateDimensionX(V v) {
-
-        int size = 0;
-        int childrenNum = graph.getSuccessors(v).size();
-
-        if (childrenNum != 0) {
-            for (V element : graph.getSuccessors(v)) {
-                size += calculateDimensionX(element) + distX;
-            }
-        }
-        size = Math.max(0, size - distX);
-        basePositions.put(v, size);
-
-        return size;
-    }
-
-    private int calculateDimensionX(Collection<V> roots) {
-
-       int size = 0;
-       for(V v : roots) {
-               int childrenNum = graph.getSuccessors(v).size();
-
-               if (childrenNum != 0) {
-                       for (V element : graph.getSuccessors(v)) {
-                               size += calculateDimensionX(element) + distX;
-                       }
-               }
-               size = Math.max(0, size - distX);
-               basePositions.put(v, size);
-       }
-
-       return size;
-    }
-    
-    /**
-     * This method is not supported by this class.  The size of the layout
-     * is determined by the topology of the tree, and by the horizontal 
-     * and vertical spacing (optionally set by the constructor).
-     */
-    public void setSize(Dimension size) {
-        throw new UnsupportedOperationException("Size of TreeLayout is set" +
-                " by vertex spacing in constructor");
-    }
-
-    protected void setCurrentPositionFor(V vertex) {
-       int x = m_currentPoint.x;
-       int y = m_currentPoint.y;
-       if(x < 0) size.width -= x;
-       
-       if(x > size.width-distX) 
-               size.width = x + distX;
-       
-       if(y < 0) size.height -= y;
-       if(y > size.height-distY) 
-               size.height = y + distY;
-       locations.get(vertex).setLocation(m_currentPoint);
-
-    }
-
-       public Graph<V,E> getGraph() {
-               return graph;
-       }
-
-       public Dimension getSize() {
-               return size;
-       }
-
-       public void initialize() {
-
-       }
-
-       public boolean isLocked(V v) {
-               return false;
-       }
-
-       public void lock(V v, boolean state) {
-       }
-
-       public void reset() {
-       }
-
-       public void setGraph(Graph<V,E> graph) {
-               if(graph instanceof Forest) {
-                       this.graph = (Forest<V,E>)graph;
-                       buildTree();
-               } else {
-                       throw new IllegalArgumentException("graph must be a Forest");
-               }
-       }
-
-       public void setInitializer(Transformer<V, Point2D> initializer) {
-       }
-       
-    /**
-     * Returns the center of this layout's area.
-     */
-       public Point2D getCenter() {
-               return new Point2D.Double(size.getWidth()/2,size.getHeight()/2);
-       }
-
-       public void setLocation(V v, Point2D location) {
-               locations.get(v).setLocation(location);
-       }
-       
-       public Point2D transform(V v) {
-               return locations.get(v);
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/package.html b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/package.html
deleted file mode 100644 (file)
index a5ed0d0..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-  @(#)package.html
-
- Copyright © 2003 The Regents of the University of California. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies. This software program and documentation are copyrighted by The Regents of the University of California ("The University of California").
-
-THE SOFTWARE PROGRAM AND DOCUMENTATION ARE SUPPLIED "AS IS," WITHOUT ANY ACCOMPANYING SERVICES FROM THE UNIVERSITY OF CALFORNIA. FURTHERMORE, THE UNIVERSITY OF CALIFORNIA DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED OR ERROR-FREE. THE END-USER UNDERSTANDS THAT THE PROGRAM WAS DEVELOPED FOR RESEARCH PURPOSES AND IS ADVISED NOT TO RELY EXCLUSIVELY ON THE PROGRAM FOR ANY REASON.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
--->
-</head>
-<body>
-
-Algorithms for assigning 2D coordinates (typically used for graph visualizations) 
-to vertices.
-Current layout algorithms include:
-<ul>
-<li/><code>Layout, AbstractLayout</code>: interface and abstract class defining the Layout contract and handling
-some common implementation details
-<li/><code>AggregateLayout</code>: allows multiple layouts to be combined and manipulated as one layout
-<li/><code>BalloonLayout</code>: places vertices on nested circles (trees/forests only)
-<li/><code>CircleLayout</code>: places vertices on a circle
-<li/><code>DAGLayout</code>: places vertices in a hierarchy (directed acyclic graphs only)
-<li/><code>FRLayout</code>: Fruchterman-Reingold algorithm (force-directed)
-<li/><code>ISOMLayout</code>: self-organizing map layout
-<li/><code>KKLayout</code>: Kamada-Kawai algorithm (tries to maintain specified distances)
-<li/><code>RadialTreeLayout</code>: places vertices on concentric circles (trees only)
-<li/><code>SpringLayout</code>: simple force-directed layout
-<li/><code>StaticLayout</code>: places vertices at user-specified locations
-<li/><code>TreeLayout</code>: simple tree/forest layout
-</ul>
-
-Rendering and other aspects of visualization are handled in the <code>visualization</code> package.
-
-</body>
-</html>
-
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/util/RandomLocationTransformer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/util/RandomLocationTransformer.java
deleted file mode 100644 (file)
index 34428b1..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Created on Jul 19, 2005
- *
- * Copyright (c) 2005, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.layout.util;
-
-import java.awt.Dimension;
-import java.awt.geom.Point2D;
-import java.util.Date;
-import java.util.Random;
-
-import org.apache.commons.collections15.Transformer;
-
-/**
- * Transforms the input type into a random location within
- * the bounds of the Dimension property.
- * This is used as the backing Transformer for the LazyMap
- * for many Layouts,
- * and provides a random location for unmapped vertices
- * the first time they are accessed.
- * 
- * @author Tom Nelson
- *
- * @param <V>
- */
-public class RandomLocationTransformer<V> implements Transformer<V,Point2D> {
-
-       Dimension d;
-       Random random;
-    
-    /**
-     * Creates an instance with the specified size which uses the current time 
-     * as the random seed.
-     */
-    public RandomLocationTransformer(Dimension d) {
-       this(d, new Date().getTime());
-    }
-    
-    /**
-     * Creates an instance with the specified dimension and random seed.
-     * @param d
-     * @param seed
-     */
-    public RandomLocationTransformer(final Dimension d, long seed) {
-       this.d = d;
-       this.random = new Random(seed);
-    }
-    
-    public Point2D transform(V v) {
-        return new Point2D.Double(random.nextDouble() * d.width, random.nextDouble() * d.height);
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/util/Relaxer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/util/Relaxer.java
deleted file mode 100644 (file)
index a31113f..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-package edu.uci.ics.jung.algorithms.layout.util;
-
-/**
- * Interface for operating the relax iterations on a layout.
- * 
- * @author Tom Nelson - tomnelson@dev.java.net
- *
- */
-public interface Relaxer {
-       
-       /**
-        * Execute a loop of steps in a new Thread,
-        * firing an event after each step.
-        */
-       void relax();
-       
-       /**
-        * Execute a loop of steps in the calling
-        * thread, firing no events.
-        */
-       void prerelax();
-       
-       /**
-        * Make the relaxer thread wait.
-        */
-       void pause();
-       
-       /**
-        * Make the relaxer thread resume.
-        *
-        */
-       void resume();
-       
-       /**
-        * Set flags to stop the relaxer thread.
-        */
-       void stop();
-
-       /**
-        * Sets the sleep time.
-        */
-       void setSleepTime(long i);
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/util/VisRunner.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/util/VisRunner.java
deleted file mode 100644 (file)
index 14f6dfc..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2005, the JUNG Project and the Regents of the University of
- * California All rights reserved.
- *
- * This software is open-source under the BSD license; see either "license.txt"
- * or http://jung.sourceforge.net/license.txt for a description.
- *
- * 
- */
-package edu.uci.ics.jung.algorithms.layout.util;
-
-import edu.uci.ics.jung.algorithms.util.IterativeContext;
-
-/**
- * 
- * Implementation of a relaxer thread for layouts.
- * Extracted from the {@code VisualizationModel} in previous
- * versions of JUNG.
- * 
- * @author Tom Nelson - tomnelson@dev.java.net
- *
- */
-public class VisRunner implements Relaxer, Runnable {
-       
-       protected boolean running;
-       protected IterativeContext process;
-       protected boolean stop;
-       protected boolean manualSuspend;
-       protected Thread thread;
-       
-       /**
-        * how long the relaxer thread pauses between iteration loops.
-        */
-       protected long sleepTime = 100L;
-
-       
-       /**
-        * Creates an instance for the specified process.
-        */
-       public VisRunner(IterativeContext process) {
-               this.process = process;
-       }
-
-       /**
-        * @return the relaxerThreadSleepTime
-        */
-       public long getSleepTime() {
-               return sleepTime;
-       }
-
-       /**
-        * @param sleepTime the sleep time to set for this thread
-        */
-       public void setSleepTime(long sleepTime) {
-               this.sleepTime = sleepTime;
-       }
-       
-       public void prerelax() {
-               manualSuspend = true;
-               long timeNow = System.currentTimeMillis();
-               while (System.currentTimeMillis() - timeNow < 500 && !process.done()) {
-                       process.step();
-               }
-               manualSuspend = false;
-       }
-
-       public void pause() {
-               manualSuspend = true;
-       }
-
-       public void relax() {
-               // in case its running
-               stop();
-               stop = false;
-               thread = new Thread(this);
-               thread.setPriority(Thread.MIN_PRIORITY);
-               thread.start();
-       }
-       
-       /**
-        * Used for synchronization.
-        */
-       public Object pauseObject = new String("PAUSE OBJECT");
-
-       public void resume() {
-               manualSuspend = false;
-               if(running == false) {
-                       prerelax();
-                       relax();
-               } else {
-                       synchronized(pauseObject) {
-                               pauseObject.notifyAll();
-                       }
-               }
-       }
-
-       public synchronized void stop() {
-               if(thread != null) {
-                       manualSuspend = false;
-                       stop = true;
-                       // interrupt the relaxer, in case it is paused or sleeping
-                       // this should ensure that visRunnerIsRunning gets set to false
-                       try { thread.interrupt(); }
-                       catch(Exception ex) {
-                               // the applet security manager may have prevented this.
-                               // just sleep for a second to let the thread stop on its own
-                               try { Thread.sleep(1000); }
-                               catch(InterruptedException ie) {} // ignore
-                       }
-                       synchronized (pauseObject) {
-                               pauseObject.notifyAll();
-                       }
-               }
-       }
-
-       public void run() {
-           running = true;
-           try {
-               while (!process.done() && !stop) {
-                   synchronized (pauseObject) {
-                       while (manualSuspend && !stop) {
-                           try {
-                               pauseObject.wait();
-                           } catch (InterruptedException e) {
-                               // ignore
-                           }
-                       }
-                   }
-                   process.step();
-                   
-                   if (stop)
-                       return;
-                   
-                   try {
-                       Thread.sleep(sleepTime);
-                   } catch (InterruptedException ie) {
-                       // ignore
-                   }
-               }
-
-           } finally {
-               running = false;
-           }
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/util/package.html b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/layout/util/package.html
deleted file mode 100644 (file)
index 356f7d5..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-  @(#)package.html
-
- Copyright © 2003 The Regents of the University of California. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies. This software program and documentation are copyrighted by The Regents of the University of California ("The University of California").
-
-THE SOFTWARE PROGRAM AND DOCUMENTATION ARE SUPPLIED "AS IS," WITHOUT ANY ACCOMPANYING SERVICES FROM THE UNIVERSITY OF CALFORNIA. FURTHERMORE, THE UNIVERSITY OF CALIFORNIA DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED OR ERROR-FREE. THE END-USER UNDERSTANDS THAT THE PROGRAM WAS DEVELOPED FOR RESEARCH PURPOSES AND IS ADVISED NOT TO RELY EXCLUSIVELY ON THE PROGRAM FOR ANY REASON.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
--->
-</head>
-<body>
-
-Utility classes for updating layout positions.
-
-</body>
-</html>
-
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/matrix/MatrixElementOperations.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/matrix/MatrixElementOperations.java
deleted file mode 100644 (file)
index 1124bdf..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.matrix;
-
-import java.util.Map;
-
-
-/**
- * An interface for specifying the behavior of graph/matrix operations
- * for a particular element type.
- * <P>
- * Graph/matrix multiplication requires the definition of two operations: 
- * <p>
- * <ol>
- * <li>
- * Calculating an aggregate property of paths of length 2 between two
- * vertices v1 and v2 (analogous to element multiplication in matrix
- * arithmetic); this is handled by computePathData().
- * </li>
- * <li>
- * Aggregating the properties of all such paths, and assigning the result to
- * a new edge in the output graph (analogous to element addition in matrix
- * arithmetic); this is handled by mergePaths().
- * </li>
- * </ol>
- * <p>
- * Together, computePathData() and mergePaths() specify how the equivalent of
- * the vector inner (dot) product is to function.
- * <p>
- * For instance, to implement the equivalent of standard matrix multiplication
- * on two graphs, computePathData() should return the products of the 
- * weights of a two-edge path, and mergePaths() should add
- * the output of computePathData() to an existing edge (or possibly create such
- * an edge if none exists).
- * 
- * @author Joshua O'Madadhain
- */
-public interface MatrixElementOperations<E>
-{
-    /**
-     * If either e or pathData is null, the effect of mergePaths() is
-     * implementation-dependent.
-     * 
-     * @param e                (possibly) existing edge in the output graph which
-     *                                         represents a path in the input graph(s)
-     * 
-     * @param pathData data (which represents another path with the same source
-     * and destination as e in the input graphs) which is to be merged into e
-     */
-    public void mergePaths(E e, Object pathData); 
-    
-    /**
-     * If either e1 or e2 is null, the Object reference returned should be null.
-     * 
-     * @param e1 first edge from 2-edge path in input graph(s)
-     * @param e2 second edge from 2-edge path in input graph(s)
-     * @return aggregation of data from the edges of the 2-edge path
-     * (from source of e1 to destination of e2) comprised of (e1, e2)
-     */
-    public Number computePathData(E e1, E e2);
-    
-    /**
-     * Returns a map from edges to values.
-     */
-    public Map<E,Number> getEdgeData();
-}
\ No newline at end of file
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/matrix/RealMatrixElementOperations.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/matrix/RealMatrixElementOperations.java
deleted file mode 100644 (file)
index ada1406..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.matrix;
-
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Implements the basic matrix operations on double-precision values.  Assumes
- * that the edges have a MutableDouble value.
- * 
- * @author Joshua O'Madadhain
- */
-public class RealMatrixElementOperations<E> implements MatrixElementOperations<E>
-{
-    private Map<E,Number> edgeData = new HashMap<E,Number>();
-
-    /**
-     * Creates an instance using the specified edge values.
-     */
-    public RealMatrixElementOperations(Map<E,Number> edgeData)
-    {
-        this.edgeData = edgeData;
-    }
-
-       /**
-        * @see MatrixElementOperations#mergePaths(Object, Object)
-        */
-       public void mergePaths(E e, Object pathData) 
-    {
-
-        Number pd = (Number)pathData;
-        Number ed = edgeData.get(e);
-        if (ed == null) {
-               edgeData.put(e, pd);
-
-        } else {
-               edgeData.put(e, ed.doubleValue()+pd.doubleValue());
-
-        }
-
-       }
-
-       /**
-        * @see MatrixElementOperations#computePathData(Object, Object)
-        */
-       public Number computePathData(E e1, E e2) 
-    {
-        double d1 = edgeData.get(e1).doubleValue();
-        double d2 = edgeData.get(e2).doubleValue();
-        return d1*d2;
-       }
-
-       /**
-        * @return the edgeData
-        */
-       public Map<E, Number> getEdgeData() {
-               return edgeData;
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/matrix/package.html b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/matrix/package.html
deleted file mode 100644 (file)
index 6025a41..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-  @(#)package.html
-
- Copyright © 2003 The Regents of the University of California. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies. This software program and documentation are copyrighted by The Regents of the University of California ("The University of California").
-
-THE SOFTWARE PROGRAM AND DOCUMENTATION ARE SUPPLIED "AS IS," WITHOUT ANY ACCOMPANYING SERVICES FROM THE UNIVERSITY OF CALFORNIA. FURTHERMORE, THE UNIVERSITY OF CALIFORNIA DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED OR ERROR-FREE. THE END-USER UNDERSTANDS THAT THE PROGRAM WAS DEVELOPED FOR RESEARCH PURPOSES AND IS ADVISED NOT TO RELY EXCLUSIVELY ON THE PROGRAM FOR ANY REASON.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
--->
-</head>
-<body>
-
-Mechanisms for dealing with graphs as matrices.  These include conversion to and
-from Colt matrices, and some matrix algorithms.
-</body>
-</html>
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/metrics/Metrics.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/metrics/Metrics.java
deleted file mode 100644 (file)
index 1dfcf12..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * Copyright (c) 2008, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- * Created on Jun 7, 2008
- * 
- */
-package edu.uci.ics.jung.algorithms.metrics;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-import edu.uci.ics.jung.graph.Graph;
-
-/**
- * A class consisting of static methods for calculating graph metrics.
- */
-public class Metrics 
-{
-    /**
-     * Returns a <code>Map</code> of vertices to their clustering coefficients.
-     * The clustering coefficient cc(v) of a vertex v is defined as follows:
-     * <ul>
-     * <li/><code>degree(v) == {0,1}</code>: 0
-     * <li/><code>degree(v) == n, n &gt;= 2</code>: given S, the set of neighbors
-     * of <code>v</code>: cc(v) = (the sum over all w in S of the number of 
-     * other elements of w that are neighbors of w) / ((|S| * (|S| - 1) / 2).
-     * Less formally, the fraction of <code>v</code>'s neighbors that are also
-     * neighbors of each other. 
-     * <p><b>Note</b>: This algorithm treats its argument as an undirected graph;
-     * edge direction is ignored. 
-     * @param graph the graph whose clustering coefficients are to be calculated
-     * @see "The structure and function of complex networks, M.E.J. Newman, aps.arxiv.org/abs/cond-mat/0303516"
-     */
-    public static <V,E> Map<V, Double> clusteringCoefficients(Graph<V,E> graph)
-    {
-        Map<V,Double> coefficients = new HashMap<V,Double>();
-        
-        for (V v : graph.getVertices())
-        {
-            int n = graph.getNeighborCount(v);
-            if (n < 2)
-                coefficients.put(v, new Double(0));
-            else
-            {
-                // how many of v's neighbors are connected to each other?
-                ArrayList<V> neighbors = new ArrayList<V>(graph.getNeighbors(v));
-                double edge_count = 0;
-                for (int i = 0; i < n; i++)
-                {
-                    V w = neighbors.get(i);
-                    for (int j = i+1; j < n; j++ )
-                    {
-                        V x = neighbors.get(j);
-                        edge_count += graph.isNeighbor(w, x) ? 1 : 0;
-                    }
-                }
-                double possible_edges = (n * (n - 1))/2.0;
-                coefficients.put(v, new Double(edge_count / possible_edges));
-            }
-        }
-        
-        return coefficients;
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/metrics/StructuralHoles.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/metrics/StructuralHoles.java
deleted file mode 100644 (file)
index aec84b9..0000000
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * Created on Sep 19, 2005
- *
- * Copyright (c) 2005, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.metrics;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.graph.Graph;
-
-/**
- * Calculates some of the measures from Burt's text "Structural Holes: 
- * The Social Structure of Competition".
- * 
- * <p><b>Notes</b>: 
- * <ul>
- * <li/>Each of these measures assumes that each edge has an associated 
- * non-null weight whose value is accessed through the specified 
- * <code>Transformer</code> instance.
- * <li/>Nonexistent edges are treated as edges with weight 0 for purposes 
- * of edge weight calculations.
- * </ul>
- *  
- * <p>Based on code donated by Jasper Voskuilen and 
- * Diederik van Liere of the Department of Information and Decision Sciences
- * at Erasmus University.</p>
- * 
- * @author Joshua O'Madadhain
- * @author Jasper Voskuilen
- * @see "Ronald Burt, Structural Holes: The Social Structure of Competition"
- * @author Tom Nelson - converted to jung2
- */
-public class StructuralHoles<V,E> {
-       
-    protected Transformer<E, ? extends Number> edge_weight;
-    protected Graph<V,E> g;
-    
-    /**
-     * Creates a <code>StructuralHoles</code> instance based on the 
-     * edge weights specified by <code>nev</code>.
-     */
-    public StructuralHoles(Graph<V,E> graph, Transformer<E, ? extends Number> nev) 
-    {
-        this.g = graph;
-        this.edge_weight = nev;
-    }
-
-    /**
-     * Burt's measure of the effective size of a vertex's network.  Essentially, the
-     * number of neighbors minus the average degree of those in <code>v</code>'s neighbor set,
-     * not counting ties to <code>v</code>.  Formally: 
-     * <pre>
-     * effectiveSize(v) = v.degree() - (sum_{u in N(v)} sum_{w in N(u), w !=u,v} p(v,w)*m(u,w))
-     * </pre>
-     * where 
-     * <ul>
-     * <li/><code>N(a) = a.getNeighbors()</code>
-     * <li/><code>p(v,w) =</code> normalized mutual edge weight of v and w
-     * <li/><code>m(u,w)</code> = maximum-scaled mutual edge weight of u and w
-     * </ul>
-     * @see #normalizedMutualEdgeWeight(Object, Object)
-     * @see #maxScaledMutualEdgeWeight(Object, Object) 
-     */
-    public double effectiveSize(V v)
-    {
-        double result = g.degree(v);
-        for(V u : g.getNeighbors(v)) {
-
-            for(V w : g.getNeighbors(u)) {
-
-                if (w != v && w != u)
-                    result -= normalizedMutualEdgeWeight(v,w) * 
-                              maxScaledMutualEdgeWeight(u,w);
-            }
-        }
-        return result;
-    }
-    
-    /**
-     * Returns the effective size of <code>v</code> divided by the number of 
-     * alters in <code>v</code>'s network.  (In other words, 
-     * <code>effectiveSize(v) / v.degree()</code>.)
-     * If <code>v.degree() == 0</code>, returns 0.
-     */
-    public double efficiency(V v) {
-        double degree = g.degree(v);
-        
-        if (degree == 0)
-            return 0;
-        else
-            return effectiveSize(v) / degree;
-    }
-
-    /**
-     * Burt's constraint measure (equation 2.4, page 55 of Burt, 1992). Essentially a
-     * measure of the extent to which <code>v</code> is invested in people who are invested in
-     * other of <code>v</code>'s alters (neighbors).  The "constraint" is characterized
-     * by a lack of primary holes around each neighbor.  Formally:
-     * <pre>
-     * constraint(v) = sum_{w in MP(v), w != v} localConstraint(v,w)
-     * </pre>
-     * where MP(v) is the subset of v's neighbors that are both predecessors and successors of v. 
-     * @see #localConstraint(Object, Object)
-     */
-    public double constraint(V v) {
-        double result = 0;
-        for(V w : g.getSuccessors(v)) {
-
-            if (v != w && g.isPredecessor(v,w))
-            {
-                result += localConstraint(v, w);
-            }
-        }
-
-        return result;
-    }
-
-    
-    /**
-     * Calculates the hierarchy value for a given vertex.  Returns <code>NaN</code> when
-     * <code>v</code>'s degree is 0, and 1 when <code>v</code>'s degree is 1.
-     * Formally:
-     * <pre>
-     * hierarchy(v) = (sum_{v in N(v), w != v} s(v,w) * log(s(v,w))}) / (v.degree() * Math.log(v.degree()) 
-     * </pre>
-     * where
-     * <ul>
-     * <li/><code>N(v) = v.getNeighbors()</code> 
-     * <li/><code>s(v,w) = localConstraint(v,w) / (aggregateConstraint(v) / v.degree())</code>
-     * </ul>
-     * @see #localConstraint(Object, Object)
-     * @see #aggregateConstraint(Object)
-     */
-    public double hierarchy(V v)
-    {
-        double v_degree = g.degree(v);
-        
-        if (v_degree == 0)
-            return Double.NaN;
-        if (v_degree == 1)
-            return 1;
-        
-        double v_constraint = aggregateConstraint(v);
-
-        double numerator = 0;
-        for (V w : g.getNeighbors(v)) {
-        
-            if (v != w)
-            {
-                double sl_constraint = localConstraint(v, w) / (v_constraint / v_degree);
-                numerator += sl_constraint * Math.log(sl_constraint);
-            }
-        }
-
-        return numerator / (v_degree * Math.log(v_degree));
-    }
-
-    /**
-     * Returns the local constraint on <code>v</code> from a lack of primary holes 
-     * around its neighbor <code>v2</code>.
-     * Based on Burt's equation 2.4.  Formally:
-     * <pre>
-     * localConstraint(v1, v2) = ( p(v1,v2) + ( sum_{w in N(v)} p(v1,w) * p(w, v2) ) )^2
-     * </pre>
-     * where 
-     * <ul>
-     * <li/><code>N(v) = v.getNeighbors()</code>
-     * <li/><code>p(v,w) =</code> normalized mutual edge weight of v and w
-     * </ul>
-     * @see #normalizedMutualEdgeWeight(Object, Object)
-     */
-    public double localConstraint(V v1, V v2) 
-    {
-        double nmew_vw = normalizedMutualEdgeWeight(v1, v2);
-        double inner_result = 0;
-        for (V w : g.getNeighbors(v1)) {
-
-            inner_result += normalizedMutualEdgeWeight(v1,w) * 
-                normalizedMutualEdgeWeight(w,v2);
-        }
-        return (nmew_vw + inner_result) * (nmew_vw + inner_result);
-    }
-    
-    /**
-     * The aggregate constraint on <code>v</code>.  Based on Burt's equation 2.7.  
-     * Formally:
-     * <pre>
-     * aggregateConstraint(v) = sum_{w in N(v)} localConstraint(v,w) * O(w)
-     * </pre>
-     * where
-     * <ul>
-     * <li/><code>N(v) = v.getNeighbors()</code>
-     * <li/><code>O(w) = organizationalMeasure(w)</code>
-     * </ul>
-     */
-    public double aggregateConstraint(V v)
-    {
-        double result = 0;
-        for (V w : g.getNeighbors(v)) {
-
-            result += localConstraint(v, w) * organizationalMeasure(g, w);
-        }
-        return result;
-    }
-    
-    /**
-     * A measure of the organization of individuals within the subgraph 
-     * centered on <code>v</code>.  Burt's text suggests that this is 
-     * in some sense a measure of how "replaceable" <code>v</code> is by 
-     * some other element of this subgraph.  Should be a number in the
-     * closed interval [0,1].
-     * 
-     * <p>This implementation returns 1.  Users may wish to override this
-     * method in order to define their own behavior.</p>
-     */
-    protected double organizationalMeasure(Graph<V,E> g, V v) {
-        return 1.0;
-    }
-    
-   
-    /**
-     * Returns the proportion of <code>v1</code>'s network time and energy invested
-     * in the relationship with <code>v2</code>.  Formally:
-     * <pre>
-     * normalizedMutualEdgeWeight(a,b) = mutual_weight(a,b) / (sum_c mutual_weight(a,c))
-     * </pre>
-     * Returns 0 if either numerator or denominator = 0, or if <code>v1 == v2</code>.
-     * @see #mutualWeight(Object, Object)
-     */
-    protected double normalizedMutualEdgeWeight(V v1, V v2)
-    {
-        if (v1 == v2)
-            return 0;
-        
-        double numerator = mutualWeight(v1, v2);
-        
-        if (numerator == 0)
-            return 0;
-        
-        double denominator = 0;
-        for (V v : g.getNeighbors(v1)) {
-            denominator += mutualWeight(v1, v);
-        }
-        if (denominator == 0)
-            return 0;
-        
-        return numerator / denominator;
-    }
-    
-    /**
-     * Returns the weight of the edge from <code>v1</code> to <code>v2</code>
-     * plus the weight of the edge from <code>v2</code> to <code>v1</code>;
-     * if either edge does not exist, it is treated as an edge with weight 0. 
-     * Undirected edges are treated as two antiparallel directed edges (that
-     * is, if there is one undirected edge with weight <i>w</i> connecting 
-     * <code>v1</code> to <code>v2</code>, the value returned is 2<i>w</i>).
-     * Ignores parallel edges; if there are any such, one is chosen at random.
-     * Throws <code>NullPointerException</code> if either edge is 
-     * present but not assigned a weight by the constructor-specified
-     * <code>NumberEdgeValue</code>.
-     */
-    protected double mutualWeight(V v1, V v2)
-    {
-        E e12 = g.findEdge(v1,v2);
-        E e21 = g.findEdge(v2,v1);
-        double w12 = (e12 != null ? edge_weight.transform(e12).doubleValue() : 0);
-        double w21 = (e21 != null ? edge_weight.transform(e21).doubleValue() : 0);
-        
-        return w12 + w21;
-    }
-    
-    /**
-     * The marginal strength of v1's relation with contact vertex2.
-     * Formally:
-     * <pre>
-     * normalized_mutual_weight = mutual_weight(a,b) / (max_c mutual_weight(a,c))
-     * </pre>
-     * Returns 0 if either numerator or denominator is 0, or if <code>v1 == v2</code>.
-     * @see #mutualWeight(Object, Object)
-     */
-    protected double maxScaledMutualEdgeWeight(V v1, V v2)
-    {
-        if (v1 == v2)
-            return 0;
-
-        double numerator = mutualWeight(v1, v2);
-
-        if (numerator == 0)
-            return 0;
-        
-        double denominator = 0;
-        for (V w : g.getNeighbors(v1)) {
-
-            if (v2 != w)
-                denominator = Math.max(numerator, mutualWeight(v1, w));
-        }
-        
-        if (denominator == 0)
-            return 0;
-        
-        return numerator / denominator;
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/metrics/TriadicCensus.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/metrics/TriadicCensus.java
deleted file mode 100644 (file)
index 634eb3b..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.metrics;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.commons.collections15.CollectionUtils;
-
-import edu.uci.ics.jung.graph.DirectedGraph;
-import edu.uci.ics.jung.graph.Graph;
-
-
-/**
- * TriadicCensus is a standard social network tool that counts, for each of the 
- * different possible configurations of three vertices, the number of times
- * that that configuration occurs in the given graph.
- * This may then be compared to the set of expected counts for this particular
- * graph or to an expected sample. This is often used in p* modeling.
- * <p>
- * To use this class, 
- * <pre>
- * long[] triad_counts = TriadicCensus(dg);
- * </pre>
- * where <code>dg</code> is a <code>DirectedGraph</code>.
- * ith element of the array (for i in [1,16]) is the number of 
- * occurrences of the corresponding triad type.
- * (The 0th element is not meaningful; this array is effectively 1-based.)
- * To get the name of the ith triad (e.g. "003"), 
- * look at the global constant array c.TRIAD_NAMES[i]
- * <p>
- * Triads are named as 
- * (number of pairs that are mutually tied)
- * (number of pairs that are one-way tied)
- * (number of non-tied pairs)
- * in the triple. Since there are be only three pairs, there is a finite
- * set of these possible triads.
- * <p>
- * In fact, there are exactly 16, conventionally sorted by the number of 
- * realized edges in the triad:
- * <table>
- * <tr><th>Number</th> <th>Configuration</th> <th>Notes</th></tr>
- * <tr><td>1</td><td>003</td><td>The empty triad</td></tr>
- * <tr><td>2</td><td>012</td><td></td></tr>
- * <tr><td>3</td><td>102</td><td></td></tr>
- * <tr><td>4</td><td>021D</td><td>"Down": the directed edges point away</td></tr>
- * <tr><td>5</td><td>021U</td><td>"Up": the directed edges meet</td></tr>
- * <tr><td>6</td><td>021C</td><td>"Circle": one in, one out</td></tr>
- * <tr><td>7</td><td>111D</td><td>"Down": 021D but one edge is mutual</td></tr>
- * <tr><td>8</td><td>111U</td><td>"Up": 021U but one edge is mutual</td></tr>
- * <tr><td>9</td><td>030T</td><td>"Transitive": two point to the same vertex</td></tr>
- * <tr><td>10</td><td>030C</td><td>"Circle": A->B->C->A</td></tr>
- * <tr><td>11</td><td>201</td><td></td></tr>
- * <tr><td>12</td><td>120D</td><td>"Down": 021D but the third edge is mutual</td></tr>
- * <tr><td>13</td><td>120U</td><td>"Up": 021U but the third edge is mutual</td></tr>
- * <tr><td>14</td><td>120C</td><td>"Circle": 021C but the third edge is mutual</td></tr>
- * <tr><td>15</td><td>210</td><td></td></tr>
- * <tr><td>16</td><td>300</td><td>The complete</td></tr>
- * </table>
- * <p>
- * This implementation takes O( m ), m is the number of edges in the graph. 
- * <br>
- * It is based on 
- * <a href="http://vlado.fmf.uni-lj.si/pub/networks/doc/triads/triads.pdf">
- * A subquadratic triad census algorithm for large sparse networks 
- * with small maximum degree</a>
- * Vladimir Batagelj and Andrej Mrvar, University of Ljubljana
- * Published in Social Networks.
- * @author Danyel Fisher
- * @author Tom Nelson - converted to jung2
- *
- */
-public class TriadicCensus {
-
-       // NOTE THAT THIS RETURNS STANDARD 1-16 COUNT!
-
-       // and their types
-       public static final String[] TRIAD_NAMES = { "N/A", "003", "012", "102", "021D",
-                       "021U", "021C", "111D", "111U", "030T", "030C", "201", "120D",
-                       "120U", "120C", "210", "300" };
-
-       public static final int MAX_TRIADS = TRIAD_NAMES.length;
-
-       /**
-     * Returns an array whose ith element (for i in [1,16]) is the number of 
-     * occurrences of the corresponding triad type in <code>g</code>.
-     * (The 0th element is not meaningful; this array is effectively 1-based.)
-        * 
-        * @param g
-        */
-    public static <V,E> long[] getCounts(DirectedGraph<V,E> g) {
-        long[] count = new long[MAX_TRIADS];
-
-        List<V> id = new ArrayList<V>(g.getVertices());
-
-               // apply algorithm to each edge, one at at time
-               for (int i_v = 0; i_v < g.getVertexCount(); i_v++) {
-                       V v = id.get(i_v);
-                       for(V u : g.getNeighbors(v)) {
-                               int triType = -1;
-                               if (id.indexOf(u) <= i_v)
-                                       continue;
-                               Set<V> neighbors = new HashSet<V>(CollectionUtils.union(g.getNeighbors(u), g.getNeighbors(v)));
-                               neighbors.remove(u);
-                               neighbors.remove(v);
-                               if (g.isSuccessor(v,u) && g.isSuccessor(u,v)) {
-                                       triType = 3;
-                               } else {
-                                       triType = 2;
-                               }
-                               count[triType] += g.getVertexCount() - neighbors.size() - 2;
-                               for (V w : neighbors) {
-                                       if (shouldCount(g, id, u, v, w)) {
-                                               count [ triType ( triCode(g, u, v, w) ) ] ++;
-                                       }
-                               }
-                       }
-               }
-               int sum = 0;
-               for (int i = 2; i <= 16; i++) {
-                       sum += count[i];
-               }
-               int n = g.getVertexCount();
-               count[1] = n * (n-1) * (n-2) / 6 - sum;
-               return count;           
-       }
-
-       /**
-        * This is the core of the technique in the paper. Returns an int from 0 to
-        * 65 based on: WU -> 32 UW -> 16 WV -> 8 VW -> 4 UV -> 2 VU -> 1
-        * 
-        */
-       public static <V,E> int triCode(Graph<V,E> g, V u, V v, V w) {
-               int i = 0;
-               i += link(g, v, u ) ? 1 : 0;
-               i += link(g, u, v ) ? 2 : 0;
-               i += link(g, v, w ) ? 4 : 0;
-               i += link(g, w, v ) ? 8 : 0;
-               i += link(g, u, w ) ? 16 : 0;
-               i += link(g, w, u ) ? 32 : 0;
-               return i;
-       }
-
-       protected static <V,E> boolean link(Graph<V,E> g, V a, V b) {
-               return g.isPredecessor(b, a);
-       }
-       
-       
-       /**
-        * Simply returns the triCode. 
-        * @param triCode
-        * @return the string code associated with the numeric type
-        */
-       public static int triType( int triCode ) {
-               return codeToType[ triCode ];
-       }
-
-       /**
-        * For debugging purposes, this is copied straight out of the paper which
-        * means that they refer to triad types 1-16.
-        */
-       protected static final int[] codeToType = { 1, 2, 2, 3, 2, 4, 6, 8, 2, 6, 5, 7, 3, 8,
-                       7, 11, 2, 6, 4, 8, 5, 9, 9, 13, 6, 10, 9, 14, 7, 14, 12, 15, 2, 5,
-                       6, 7, 6, 9, 10, 14, 4, 9, 9, 12, 8, 13, 14, 15, 3, 7, 8, 11, 7, 12,
-                       14, 15, 8, 14, 13, 15, 11, 15, 15, 16 };
-
-       /**
-        * Make sure we have a canonical ordering: Returns true if u < w, or v < w <
-        * u and v doesn't link to w
-        * 
-        * @param id
-        * @param u
-        * @param v
-        * @param w
-        * @return true if u < w, or if v < w < u and v doesn't link to w; false otherwise
-        */
-       protected static <V,E> boolean shouldCount(Graph<V,E> g, List<V> id, V u, V v, V w) {
-               int i_u = id.indexOf(u);
-               int i_w = id.indexOf(w);
-               if (i_u < i_w)
-                       return true;
-               int i_v = id.indexOf(v);
-               if ((i_v < i_w) && (i_w < i_u) && (!g.isNeighbor(w,v)))
-                       return true;
-               return false;
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/metrics/package.html b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/metrics/package.html
deleted file mode 100644 (file)
index ce5144b..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-  @(#)package.html
-
- Copyright © 2003 The Regents of the University of California. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies. This software program and documentation are copyrighted by The Regents of the University of California ("The University of California").
-
-THE SOFTWARE PROGRAM AND DOCUMENTATION ARE SUPPLIED "AS IS," WITHOUT ANY ACCOMPANYING SERVICES FROM THE UNIVERSITY OF CALFORNIA. FURTHERMORE, THE UNIVERSITY OF CALIFORNIA DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED OR ERROR-FREE. THE END-USER UNDERSTANDS THAT THE PROGRAM WAS DEVELOPED FOR RESEARCH PURPOSES AND IS ADVISED NOT TO RELY EXCLUSIVELY ON THE PROGRAM FOR ANY REASON.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
--->
-</head>
-<body>
-
-Specialized measures for graph properties.  These currently include:
-
-<ul>
-<li/><code>StructuralHoles</code>: calculates some of Burt's 'structural holes' 
-measures (e.g. efficiency, hierarchy, constraint). 
-<li/><code>TriadicCensus</code>: returns counts for each triad type found in a 
-graph.
-</ul>
-
-</body>
-</html>
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/package.html b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/package.html
deleted file mode 100644 (file)
index f9d2e25..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-  @(#)package.html
-
- Copyright © 2003 The Regents of the University of California. All Rights Reserved. 
- Permission to use, copy, modify, and distribute this software and its documentation 
- for educational, research and non-profit purposes, without fee, and without a written 
- agreement is hereby granted, provided that the above copyright notice, this paragraph 
- and the following two paragraphs appear in all copies. This software program and 
- documentation are copyrighted by The Regents of the University of California 
- ("The University of California").
-
-THE SOFTWARE PROGRAM AND DOCUMENTATION ARE SUPPLIED "AS IS," WITHOUT ANY ACCOMPANYING 
-SERVICES FROM THE UNIVERSITY OF CALFORNIA. FURTHERMORE, THE UNIVERSITY OF CALIFORNIA 
-DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED OR 
-ERROR-FREE. THE END-USER UNDERSTANDS THAT THE PROGRAM WAS DEVELOPED FOR RESEARCH 
-PURPOSES AND IS ADVISED NOT TO RELY EXCLUSIVELY ON THE PROGRAM FOR ANY REASON.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, 
-INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, 
-ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE 
-UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 
-THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
-PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, 
-AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, 
-SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
--->
-</head>
-<body>
-
-<p>Algorithms for graphs and networks.</p>
-
-<p>These algorithms are divided into categories as follows:
-<ul>
-<li/><b>blockmodel</b>: dividing graph elements (typically vertices) into 
-equivalence classes, 
-generally by topological properties (e.g. structural equivalence)
-<li/><b>cluster</b>: identifying coherent (not necessarily disjoint) groups of elements
-(e.g. weakly connected components, edge betweenness clustering)
-<li/><b>filters</b>: removing parts of a graph according to specified criteria
-<li/><b>flows</b>: calculating properties relating to network flows 
-(e.g. max flow/min cut)
-<li/><b>generators</b>: creating graphs with certain properties
-<li/><b>importance (<i>deprecated</i>)</b>: assigning values to vertices/edges 
-based on topological properties
-<li/><b>layout</b>: arrangement of graph elements, generally for visualization
-<li/><b>metrics</b>: calculating structural properties (triad census, structural 
-holes)
-<li/><b>scoring</b>: assigning values (denoting significance, influence, 
-centrality, etc.) to vertices/edges based on topological properties,
-e.g. PageRank, HITS, betweenness centrality (replaces "importance", above)
-<li/><b>shortestpath</b>: calculation of shortest paths between vertices
-<li/><b>util</b>: low-level utility classes used in a variety of algorithms
-</ul>
-
-</body>
-</html>
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/AbstractIterativeScorer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/AbstractIterativeScorer.java
deleted file mode 100644 (file)
index 70d677b..0000000
+++ /dev/null
@@ -1,368 +0,0 @@
-/*
- * Created on Jul 6, 2007
- *
- * Copyright (c) 2007, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.algorithms.scoring.util.DelegateToEdgeTransformer;
-import edu.uci.ics.jung.algorithms.scoring.util.VEPair;
-import edu.uci.ics.jung.algorithms.util.IterativeContext;
-import edu.uci.ics.jung.graph.Hypergraph;
-
-/**
- * An abstract class for algorithms that assign scores to vertices based on iterative methods.
- * Generally, any (concrete) subclass will function by creating an instance, and then either calling
- * <code>evaluate</code> (if the user wants to iterate until the algorithms is 'done') or 
- * repeatedly call <code>step</code> (if the user wants to observe the values at each step).
- */
-public abstract class AbstractIterativeScorer<V,E,T> implements IterativeContext, VertexScorer<V,T>
-{
-    /**
-     * Maximum number of iterations to use before terminating.  Defaults to 100.
-     */
-    protected int max_iterations;
-    
-    /**
-     * Minimum change from one step to the next; if all changes are <= tolerance, 
-     * no further updates will occur.
-     * Defaults to 0.001.
-     */
-    protected double tolerance;
-    
-    /**
-     * The graph on which the calculations are to be made.
-     */
-    protected Hypergraph<V,E> graph;
-    
-    /**
-     * The total number of iterations used so far.
-     */
-    protected int total_iterations;
-    
-    /**
-     * The edge weights used by this algorithm.
-     */
-    protected Transformer<VEPair<V,E>, ? extends Number> edge_weights;
-    
-    /**
-     * Indicates whether the output and current values are in a 'swapped' state.
-     * Intended for internal use only.
-     */
-    protected boolean output_reversed;
-    
-    /**
-     * The map in which the output values are stored.
-     */
-    private Map<V, T> output;
-    
-    /**
-     * The map in which the current values are stored.
-     */
-    private Map<V, T> current_values;
-    
-    /**
-     * A flag representing whether this instance tolerates disconnected graphs.
-     * Instances that do not accept disconnected graphs may have unexpected behavior
-     * on disconnected graphs; they are not guaranteed to do an explicit check.
-     * Defaults to true.
-     */
-    private boolean accept_disconnected_graph;
-
-
-    protected boolean hyperedges_are_self_loops = false;
-
-    /**
-     * Sets the output value for this vertex.
-     * @param v the vertex whose output value is to be set
-     * @param value the value to set
-     */
-    protected void setOutputValue(V v, T value)
-    {
-        output.put(v, value);
-    }
-    
-    /**
-     * Gets the output value for this vertex.
-     * @param v the vertex whose output value is to be retrieved
-     * @return the output value for this vertex
-     */
-    protected T getOutputValue(V v)
-    {
-        return output.get(v);
-    }
-    
-    /**
-     * Gets the current value for this vertex
-     * @param v the vertex whose current value is to be retrieved
-     * @return the current value for this vertex
-     */
-    protected T getCurrentValue(V v)
-    {
-        return current_values.get(v);
-    }
-    
-    /**
-     * Sets the current value for this vertex.
-     * @param v the vertex whose current value is to be set
-     * @param value the current value to set
-     */
-    protected void setCurrentValue(V v, T value)
-    {
-        current_values.put(v, value);
-    }
-    
-    /**
-     * The largest change seen so far among all vertex scores.
-     */
-    protected double max_delta;
-    
-    /**
-     * Creates an instance for the specified graph and edge weights.
-     * @param g the graph for which the instance is to be created
-     * @param edge_weights the edge weights for this instance
-     */
-    public AbstractIterativeScorer(Hypergraph<V,E> g, Transformer<E, ? extends Number> edge_weights)
-    {
-        this.graph = g;
-        this.max_iterations = 100;
-        this.tolerance = 0.001;
-        this.accept_disconnected_graph = true;
-        setEdgeWeights(edge_weights);
-    }
-    
-    /**
-     * Creates an instance for the specified graph <code>g</code>.
-     * NOTE: This constructor does not set the internal 
-     * <code>edge_weights</code> variable.  If this variable is used by 
-     * the subclass which invoked this constructor, it must be initialized
-     * by that subclass.
-     * @param g the graph for which the instance is to be created
-     */
-    public AbstractIterativeScorer(Hypergraph<V,E> g)
-    {
-       this.graph = g;
-        this.max_iterations = 100;
-        this.tolerance = 0.001;
-        this.accept_disconnected_graph = true;
-    }
-    
-    /**
-     * Initializes the internal state for this instance.
-     */
-    protected void initialize()
-    {
-        this.total_iterations = 0;
-        this.max_delta = Double.MIN_VALUE;
-        this.output_reversed = true;
-        this.current_values = new HashMap<V, T>();
-        this.output = new HashMap<V, T>();
-    }
-    
-    /**
-     * Steps through this scoring algorithm until a termination condition is reached.
-     */
-    public void evaluate()
-    {
-        do
-            step();
-        while (!done());
-    }
-    
-    /**
-     * Returns true if the total number of iterations is greater than or equal to 
-     * <code>max_iterations</code>
-     * or if the maximum value change observed is less than <code>tolerance</code>.
-     */
-    public boolean done()
-    {
-        return total_iterations >= max_iterations || max_delta < tolerance;
-    }
-
-    /**
-     * Performs one step of this algorithm; updates the state (value) for each vertex.
-     */
-    public void step()
-    {
-        swapOutputForCurrent();
-        
-        for (V v : graph.getVertices())
-        {
-            double diff = update(v);
-            updateMaxDelta(v, diff);
-        }
-        total_iterations++;
-        afterStep();
-    }
-
-    /**
-     * 
-     */
-    protected void swapOutputForCurrent()
-    {
-        Map<V, T> tmp = output;
-        output = current_values;
-        current_values = tmp;
-        output_reversed = !output_reversed;
-    }
-
-    /**
-     * Updates the value for <code>v</code>.
-     * This is the key 
-     * @param v the vertex whose value is to be updated
-     * @return
-     */
-    protected abstract double update(V v);
-
-    protected void updateMaxDelta(V v, double diff)
-    {
-        max_delta = Math.max(max_delta, diff);
-    }
-    
-    protected void afterStep() {}
-    
-    public T getVertexScore(V v)
-    {
-        if (!graph.containsVertex(v))
-            throw new IllegalArgumentException("Vertex " + v + " not an element of this graph");
-        
-        return output.get(v);
-    }
-
-    /**
-     * Returns the maximum number of iterations that this instance will use.
-     * @return the maximum number of iterations that <code>evaluate</code> will use
-     * prior to terminating
-     */
-    public int getMaxIterations()
-    {
-        return max_iterations;
-    }
-
-    /**
-     * Returns the number of iterations that this instance has used so far.
-     * @return the number of iterations that this instance has used so far
-     */
-    public int getIterations()
-    {
-       return total_iterations;
-    }
-    
-    /**
-     * Sets the maximum number of times that <code>evaluate</code> will call <code>step</code>.
-     * @param max_iterations the maximum 
-     */
-    public void setMaxIterations(int max_iterations)
-    {
-        this.max_iterations = max_iterations;
-    }
-
-    /**
-     * Gets the size of the largest change (difference between the current and previous values)
-     * for any vertex that can be tolerated.  Once all changes are less than this value, 
-     * <code>evaluate</code> will terminate.
-     * @return the size of the largest change that evaluate() will permit
-     */
-    public double getTolerance()
-    {
-        return tolerance;
-    }
-
-    /**
-     * Sets the size of the largest change (difference between the current and previous values)
-     * for any vertex that can be tolerated.
-     * @param tolerance the size of the largest change that evaluate() will permit
-     */
-    public void setTolerance(double tolerance)
-    {
-        this.tolerance = tolerance;
-    }
-    
-    /**
-     * Returns the Transformer that this instance uses to associate edge weights with each edge.
-     * @return the Transformer that associates an edge weight with each edge
-     */
-    public Transformer<VEPair<V,E>, ? extends Number> getEdgeWeights()
-    {
-        return edge_weights;
-    }
-
-    /**
-     * Sets the Transformer that this instance uses to associate edge weights with each edge
-     * @param edge_weights the Transformer to use to associate an edge weight with each edge
-     * @see edu.uci.ics.jung.algorithms.scoring.util.UniformDegreeWeight
-     */
-    public void setEdgeWeights(Transformer<E, ? extends Number> edge_weights)
-    {
-        this.edge_weights = new DelegateToEdgeTransformer<V,E>(edge_weights);
-    }
-    
-    /**
-     * Gets the edge weight for <code>e</code> in the context of its (incident) vertex <code>v</code>.
-     * @param v the vertex incident to e as a context in which the edge weight is to be calculated
-     * @param e the edge whose weight is to be returned
-     * @return the edge weight for <code>e</code> in the context of its (incident) vertex <code>v</code>
-     */
-    protected Number getEdgeWeight(V v, E e)
-    {
-        return edge_weights.transform(new VEPair<V,E>(v,e));
-    }
-    
-    /**
-     * Collects the 'potential' from v (its current value) if it has no outgoing edges; this
-     * can then be redistributed among the other vertices as a means of normalization.
-     * @param v
-     */
-    protected void collectDisappearingPotential(V v) {}
-
-    /**
-     * Specifies whether this instance should accept vertices with no outgoing edges.
-     * @param accept true if this instance should accept vertices with no outgoing edges, false otherwise
-     */
-    public void acceptDisconnectedGraph(boolean accept)
-    {
-        this.accept_disconnected_graph = accept;
-    }
-    
-    /**
-     * Returns true if this instance accepts vertices with no outgoing edges, and false otherwise.
-     * @return true if this instance accepts vertices with no outgoing edges, otherwise false
-     */
-    public boolean isDisconnectedGraphOK()
-    {
-        return this.accept_disconnected_graph;
-    }
-    
-    /**
-     * Specifies whether hyperedges are to be treated as self-loops.  If they
-     * are, then potential will flow along a hyperedge a vertex to itself, 
-     * just as it does to all other vertices incident to that hyperedge. 
-     * @param arg if {@code true}, hyperedges are treated as self-loops
-     */
-    public void setHyperedgesAreSelfLoops(boolean arg) 
-    {
-       this.hyperedges_are_self_loops = arg;
-    }
-
-    /**
-     * Returns the effective number of vertices incident to this edge.  If
-     * the graph is a binary relation or if hyperedges are treated as self-loops,
-     * the value returned is {@code graph.getIncidentCount(e)}; otherwise it is
-     * {@code graph.getIncidentCount(e) - 1}.
-     */
-    protected int getAdjustedIncidentCount(E e) 
-    {
-        return graph.getIncidentCount(e) - (hyperedges_are_self_loops ? 0 : 1);
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/AbstractIterativeScorerWithPriors.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/AbstractIterativeScorerWithPriors.java
deleted file mode 100644 (file)
index 6883e26..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Created on Jul 14, 2007
- *
- * Copyright (c) 2007, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.graph.Hypergraph;
-
-/**
- * An abstract class for iterative random-walk-based vertex scoring algorithms 
- * that have a 
- * fixed probability, for each vertex, of 'jumping' to that vertex at each
- * step in the algorithm (rather than following a link out of that vertex).
- *
- * @param <V> the vertex type
- * @param <E> the edge type
- * @param <S> the score type
- */
-public abstract class AbstractIterativeScorerWithPriors<V,E,S> extends
-        AbstractIterativeScorer<V,E,S> implements VertexScorer<V,S>
-{
-    /**
-     * The prior probability of each vertex being visited on a given 
-     * 'jump' (non-link-following) step.
-     */
-    protected Transformer<V,? extends S> vertex_priors;
-
-    /**
-     * The probability of making a 'jump' at each step.
-     */
-    protected double alpha;
-
-    /**
-     * Creates an instance for the specified graph, edge weights, vertex
-     * priors, and jump probability.
-     * @param g the graph whose vertices are to be assigned scores
-     * @param edge_weights the edge weights to use in the score assignment
-     * @param vertex_priors the prior probabilities of each vertex being 'jumped' to
-     * @param alpha the probability of making a 'jump' at each step
-     */
-    public AbstractIterativeScorerWithPriors(Hypergraph<V,E> g,
-            Transformer<E,? extends Number> edge_weights, 
-            Transformer<V,? extends S> vertex_priors, double alpha)
-    {
-        super(g, edge_weights);
-        this.vertex_priors = vertex_priors;
-        this.alpha = alpha;
-        initialize();
-    }
-
-    /**
-     * Creates an instance for the specified graph, vertex priors, and jump
-     * probability, with edge weights specified by the subclass.
-     * @param g the graph whose vertices are to be assigned scores
-     * @param vertex_priors the prior probabilities of each vertex being 'jumped' to
-     * @param alpha the probability of making a 'jump' at each step
-     */
-    public AbstractIterativeScorerWithPriors(Hypergraph<V,E> g, 
-               Transformer<V,? extends S> vertex_priors, double alpha)
-    {
-        super(g);
-        this.vertex_priors = vertex_priors;
-        this.alpha = alpha;
-        initialize();
-    }
-
-    /**
-     * Initializes the state of this instance.
-     */
-    @Override
-    public void initialize()
-    {
-        super.initialize();
-        // initialize output values to priors
-        // (output and current are swapped before each step(), so current will
-        // have priors when update()s start happening)
-        for (V v : graph.getVertices())
-            setOutputValue(v, getVertexPrior(v));
-    }
-    
-    /**
-     * Returns the prior probability for <code>v</code>.
-     * @param v the vertex whose prior probability is being queried
-     * @return the prior probability for <code>v</code>
-     */
-    protected S getVertexPrior(V v)
-    {
-        return vertex_priors.transform(v);
-    }
-
-    /**
-     * Returns a Transformer which maps each vertex to its prior probability.
-     * @return a Transformer which maps each vertex to its prior probability
-     */
-    public Transformer<V, ? extends S> getVertexPriors()
-    {
-        return vertex_priors;
-    }
-
-    /**
-     * Returns the probability of making a 'jump' (non-link-following step).
-     * @return the probability of making a 'jump' (non-link-following step)
-     */
-    public double getAlpha()
-    {
-        return alpha;
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/BarycenterScorer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/BarycenterScorer.java
deleted file mode 100644 (file)
index 1c9c178..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Created on Jul 12, 2007
- *
- * Copyright (c) 2007, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.algorithms.shortestpath.Distance;
-import edu.uci.ics.jung.graph.Hypergraph;
-
-/**
- * Assigns scores to each vertex according to the sum of its distances to all other vertices.
- */
-public class BarycenterScorer<V,E> extends DistanceCentralityScorer<V, E>
-{
-    /**
-     * Creates an instance with the specified graph and distance metric.
-     * @param graph the input graph
-     * @param distance the distance metric to use
-     */
-    public BarycenterScorer(Hypergraph<V,E> graph, Distance<V> distance)
-    {
-        super(graph, distance, false);
-    }
-    
-    /**
-     * Creates an instance with the specified graph and edge weights.
-     * Will generate a <code>Distance</code> metric internally based on the edge weights. 
-     * @param graph the input graph
-     * @param edge_weights the edge weights to use to calculate vertex/vertex distances
-     */
-    public BarycenterScorer(Hypergraph<V,E> graph, Transformer<E, ? extends Number> edge_weights)
-    {
-        super(graph, edge_weights, false);
-    }
-
-    /**
-     * Creates an instance with the specified graph.
-     * Will generate a <code>Distance</code> metric internally assuming that the
-     * graph is unweighted. 
-     * @param graph the input graph
-     */
-    public BarycenterScorer(Hypergraph<V,E> graph)
-    {
-        super(graph, false);
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/BetweennessCentrality.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/BetweennessCentrality.java
deleted file mode 100644 (file)
index 5cfeb16..0000000
+++ /dev/null
@@ -1,351 +0,0 @@
-/**
- * Copyright (c) 2008, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- * Created on Sep 16, 2008
- * 
- */
-package edu.uci.ics.jung.algorithms.scoring;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Queue;
-import java.util.Stack;
-
-import org.apache.commons.collections15.Transformer;
-import org.apache.commons.collections15.functors.ConstantTransformer;
-
-import edu.uci.ics.jung.algorithms.util.MapBinaryHeap;
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.UndirectedGraph;
-
-/**
- * Computes betweenness centrality for each vertex and edge in the graph.
- * 
- * @see "Ulrik Brandes: A Faster Algorithm for Betweenness Centrality. Journal of Mathematical Sociology 25(2):163-177, 2001."
- */
-public class BetweennessCentrality<V, E> 
-       implements VertexScorer<V, Double>, EdgeScorer<E, Double> 
-{
-       protected Graph<V,E> graph;
-       protected Map<V, Double> vertex_scores;
-       protected Map<E, Double> edge_scores;
-       protected Map<V, BetweennessData> vertex_data;
-               
-       /**
-        * Calculates betweenness scores based on the all-pairs unweighted shortest paths
-        * in the graph.
-        * @param graph the graph for which the scores are to be calculated
-        */
-       @SuppressWarnings("unchecked")
-       public BetweennessCentrality(Graph<V, E> graph) 
-       {
-               initialize(graph);
-               computeBetweenness(new LinkedList<V>(), new ConstantTransformer(1));
-       }
-
-       /**
-        * Calculates betweenness scores based on the all-pairs weighted shortest paths in the
-        * graph.
-        * 
-        * <p>NOTE: This version of the algorithm may not work correctly on all graphs; we're still
-        * working out the bugs.  Use at your own risk.
-        * @param graph the graph for which the scores are to be calculated
-        * @param edge_weights the edge weights to be used in the path length calculations
-        */
-       public BetweennessCentrality(Graph<V, E> graph, 
-                       Transformer<E, ? extends Number> edge_weights) 
-       {
-               // reject negative-weight edges up front
-               for (E e : graph.getEdges())
-               {
-                       double e_weight = edge_weights.transform(e).doubleValue();
-               if (e_weight < 0)
-                       throw new IllegalArgumentException(String.format(
-                                       "Weight for edge '%s' is < 0: %d", e, e_weight)); 
-               }
-                       
-               initialize(graph);
-               computeBetweenness(new MapBinaryHeap<V>(new BetweennessComparator()), 
-                       edge_weights);
-       }
-
-       protected void initialize(Graph<V,E> graph)
-       {
-               this.graph = graph;
-               this.vertex_scores = new HashMap<V, Double>();
-               this.edge_scores = new HashMap<E, Double>();
-               this.vertex_data = new HashMap<V, BetweennessData>();
-               
-               for (V v : graph.getVertices())
-                       this.vertex_scores.put(v, 0.0);
-               
-               for (E e : graph.getEdges())
-                       this.edge_scores.put(e, 0.0);
-       }
-       
-       protected void computeBetweenness(Queue<V> queue, 
-                       Transformer<E, ? extends Number> edge_weights)
-       {
-               for (V v : graph.getVertices())
-               {
-                       // initialize the betweenness data for this new vertex
-                       for (V s : graph.getVertices()) 
-                               this.vertex_data.put(s, new BetweennessData());
-
-//                     if (v.equals(new Integer(0)))
-//                             System.out.println("pause");
-                       
-            vertex_data.get(v).numSPs = 1;
-            vertex_data.get(v).distance = 0;
-
-            Stack<V> stack = new Stack<V>();
-//            Buffer<V> queue = new UnboundedFifoBuffer<V>();
-//            queue.add(v);
-            queue.offer(v);
-
-            while (!queue.isEmpty()) 
-            {
-//                V w = queue.remove();
-               V w = queue.poll();
-                stack.push(w);
-               BetweennessData w_data = vertex_data.get(w);
-                
-                for (E e : graph.getOutEdges(w))
-                {
-                       // TODO (jrtom): change this to getOtherVertices(w, e)
-                       V x = graph.getOpposite(w, e);
-                       if (x.equals(w))
-                               continue;
-                       double wx_weight = edge_weights.transform(e).doubleValue();
-                       
-                       
-//                for(V x : graph.getSuccessors(w)) 
-//                {
-//                     if (x.equals(w))
-//                             continue;
-                       
-                       // FIXME: the other problem is that I need to 
-                       // keep putting the neighbors of things we've just 
-                       // discovered in the queue, if they're undiscovered or
-                       // at greater distance.
-                       
-                       // FIXME: this is the problem, right here, I think: 
-                       // need to update position in queue if distance changes
-                       // (which can only happen with weighted edges).
-                       // for each outgoing edge e from w, get other end x
-                       // if x not already visited (dist x < 0)
-                       //   set x's distance to w's dist + edge weight
-                       //   add x to queue; pri in queue is x's dist
-                       // if w's dist + edge weight < x's dist 
-                       //   update x's dist
-                       //   update x in queue (MapBinaryHeap)
-                       //   clear x's incoming edge list
-                       // if w's dist + edge weight = x's dist
-                       //   add e to x's incoming edge list
-                       
-                       BetweennessData x_data = vertex_data.get(x);
-                       double x_potential_dist = w_data.distance + wx_weight;
-                       
-                    if (x_data.distance < 0) 
-                    {
-//                        queue.add(x);
-//                        vertex_data.get(x).distance = vertex_data.get(w).distance + 1;
-                       x_data.distance = x_potential_dist;
-                       queue.offer(x);
-                    }
-                    
-                    // note:
-                    // (1) this can only happen with weighted edges
-                    // (2) x's SP count and incoming edges are updated below 
-                    if (x_data.distance > x_potential_dist)
-                    {
-                       x_data.distance = x_potential_dist;
-                       // invalidate previously identified incoming edges
-                       // (we have a new shortest path distance to x)
-                       x_data.incomingEdges.clear(); 
-                        // update x's position in queue
-                       ((MapBinaryHeap<V>)queue).update(x);
-                    }
-//                  if (vertex_data.get(x).distance == vertex_data.get(w).distance + 1) 
-                    // 
-//                    if (x_data.distance == x_potential_dist) 
-//                    {
-//                        x_data.numSPs += w_data.numSPs;
-////                        vertex_data.get(x).predecessors.add(w);
-//                        x_data.incomingEdges.add(e);
-//                    }
-                }
-                for (E e: graph.getOutEdges(w))
-                {
-                       V x = graph.getOpposite(w, e);
-                       if (x.equals(w))
-                               continue;
-                       double e_weight = edge_weights.transform(e).doubleValue();
-                       BetweennessData x_data = vertex_data.get(x);
-                       double x_potential_dist = w_data.distance + e_weight;
-                    if (x_data.distance == x_potential_dist) 
-                    {
-                        x_data.numSPs += w_data.numSPs;
-//                        vertex_data.get(x).predecessors.add(w);
-                        x_data.incomingEdges.add(e);
-                    }
-                }
-            }
-               while (!stack.isEmpty()) 
-               {
-                   V x = stack.pop();
-
-//                 for (V w : vertex_data.get(x).predecessors) 
-                   for (E e : vertex_data.get(x).incomingEdges)
-                   {
-                       V w = graph.getOpposite(x, e);
-                       double partialDependency = 
-                               vertex_data.get(w).numSPs / vertex_data.get(x).numSPs *
-                               (1.0 + vertex_data.get(x).dependency);
-                       vertex_data.get(w).dependency +=  partialDependency;
-//                     E w_x = graph.findEdge(w, x);
-//                     double w_x_score = edge_scores.get(w_x).doubleValue();
-//                     w_x_score += partialDependency;
-//                     edge_scores.put(w_x, w_x_score);
-                       double e_score = edge_scores.get(e).doubleValue();
-                       edge_scores.put(e, e_score + partialDependency);
-                   }
-                   if (!x.equals(v)) 
-                   {
-                       double x_score = vertex_scores.get(x).doubleValue();
-                       x_score += vertex_data.get(x).dependency;
-                       vertex_scores.put(x, x_score);
-                   }
-               }
-        }
-
-        if(graph instanceof UndirectedGraph) 
-        {
-               for (V v : graph.getVertices()) { 
-                       double v_score = vertex_scores.get(v).doubleValue();
-                       v_score /= 2.0;
-                       vertex_scores.put(v, v_score);
-               }
-               for (E e : graph.getEdges()) {
-                       double e_score = edge_scores.get(e).doubleValue();
-                       e_score /= 2.0;
-                       edge_scores.put(e, e_score);
-               }
-        }
-
-        vertex_data.clear();
-       }
-
-//     protected void computeWeightedBetweenness(Transformer<E, ? extends Number> edge_weights)
-//     {
-//             for (V v : graph.getVertices())
-//             {
-//                     // initialize the betweenness data for this new vertex
-//                     for (V s : graph.getVertices()) 
-//                             this.vertex_data.put(s, new BetweennessData());
-//            vertex_data.get(v).numSPs = 1;
-//            vertex_data.get(v).distance = 0;
-//
-//            Stack<V> stack = new Stack<V>();
-////            Buffer<V> queue = new UnboundedFifoBuffer<V>();
-//            SortedSet<V> pqueue = new TreeSet<V>(new BetweennessComparator());
-////          queue.add(v);
-//            pqueue.add(v);
-//
-////            while (!queue.isEmpty()) 
-//            while (!pqueue.isEmpty()) 
-//            {
-////              V w = queue.remove();
-//             V w = pqueue.first();
-//             pqueue.remove(w);
-//                stack.push(w);
-//
-////                for(V x : graph.getSuccessors(w)) 
-//                for (E e : graph.getOutEdges(w))
-//                {
-//                     // TODO (jrtom): change this to getOtherVertices(w, e)
-//                     V x = graph.getOpposite(w, e);
-//                     if (x.equals(w))
-//                             continue;
-//                     double e_weight = edge_weights.transform(e).doubleValue();
-//                     
-//                    if (vertex_data.get(x).distance < 0) 
-//                    {
-////                        queue.add(x);
-//                     pqueue.add(v);
-////                        vertex_data.get(x).distance = vertex_data.get(w).distance + 1;
-//                        vertex_data.get(x).distance = 
-//                             vertex_data.get(w).distance + e_weight;
-//                    }
-//
-////                    if (vertex_data.get(x).distance == vertex_data.get(w).distance + 1) 
-//                    if (vertex_data.get(x).distance == 
-//                     vertex_data.get(w).distance + e_weight)
-//                    {
-//                        vertex_data.get(x).numSPs += vertex_data.get(w).numSPs;
-//                        vertex_data.get(x).predecessors.add(w);
-//                    }
-//                }
-//            }
-//            updateScores(v, stack);
-//        }
-//
-//        if(graph instanceof UndirectedGraph) 
-//            adjustUndirectedScores();
-//
-//        vertex_data.clear();
-//     }
-       
-       public Double getVertexScore(V v) 
-       {
-               return vertex_scores.get(v);
-       }
-
-       public Double getEdgeScore(E e) 
-       {
-               return edge_scores.get(e);
-       }
-
-    private class BetweennessData 
-    {
-        double distance;
-        double numSPs;
-//        List<V> predecessors;
-        List<E> incomingEdges;
-        double dependency;
-
-        BetweennessData() 
-        {
-            distance = -1;
-            numSPs = 0;
-//            predecessors = new ArrayList<V>();
-            incomingEdges = new ArrayList<E>();
-            dependency = 0;
-        }
-        
-        @Override
-        public String toString()
-        {
-               return "[d:" + distance + ", sp:" + numSPs + 
-                       ", p:" + incomingEdges + ", d:" + dependency + "]\n";
-//                     ", p:" + predecessors + ", d:" + dependency + "]\n";
-        }
-    }
-    
-    private class BetweennessComparator implements Comparator<V>
-    {
-               public int compare(V v1, V v2) 
-               {
-                       return vertex_data.get(v1).distance > vertex_data.get(v2).distance ? 1 : -1;
-               }
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/ClosenessCentrality.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/ClosenessCentrality.java
deleted file mode 100644 (file)
index d64f01e..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Created on Jul 12, 2007
- *
- * Copyright (c) 2007, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.algorithms.shortestpath.Distance;
-import edu.uci.ics.jung.graph.Hypergraph;
-
-/**
- * Assigns scores to each vertex based on the mean distance to each other vertex.
- * 
- * @author Joshua O'Madadhain
- */
-public class ClosenessCentrality<V,E> extends DistanceCentralityScorer<V,E>
-{
-
-    /**
-     * Creates an instance using the specified vertex/vertex distance metric.
-     * @param graph the input
-     * @param distance the vertex/vertex distance metric.
-     */
-    public ClosenessCentrality(Hypergraph<V,E> graph, Distance<V> distance)
-    {
-        super(graph, distance, true);
-    }
-
-    /**
-     * Creates an instance which measures distance using the specified edge weights.
-     * @param graph the input graph
-     * @param edge_weights the edge weights to be used to determine vertex/vertex distances
-     */
-    public ClosenessCentrality(Hypergraph<V,E> graph, Transformer<E, ? extends Number> edge_weights)
-    {
-        super(graph, edge_weights, true);
-    }
-
-    /**
-     * Creates an instance which measures distance on the graph without edge weights.
-     * @param graph
-     */
-    public ClosenessCentrality(Hypergraph<V,E> graph)
-    {
-        super(graph, true);
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/DegreeScorer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/DegreeScorer.java
deleted file mode 100644 (file)
index 2ec3148..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Created on Jul 6, 2007
- *
- * Copyright (c) 2007, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring;
-
-import edu.uci.ics.jung.graph.Hypergraph;
-
-/**
- * Assigns a score to each vertex equal to its degree.
- *
- * @param <V> the vertex type
- */
-public class DegreeScorer<V> implements VertexScorer<V,Integer>
-{
-       /**
-        * The graph for which scores are to be generated.
-        */
-    protected Hypergraph<V,?> graph;
-    
-    /**
-     * Creates an instance for the specified graph.
-     * @param graph the input graph
-     */
-    public DegreeScorer(Hypergraph<V,?> graph)
-    {
-        this.graph = graph;
-    }
-    
-    /**
-     * Returns the degree of the vertex.
-     * @return the degree of the vertex
-     */
-    public Integer getVertexScore(V v) 
-    {
-        return graph.degree(v); 
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/DistanceCentralityScorer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/DistanceCentralityScorer.java
deleted file mode 100644 (file)
index 16dd862..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * Created on Jul 10, 2007
- *
- * Copyright (c) 2007, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.algorithms.shortestpath.DijkstraDistance;
-import edu.uci.ics.jung.algorithms.shortestpath.Distance;
-import edu.uci.ics.jung.algorithms.shortestpath.UnweightedShortestPath;
-import edu.uci.ics.jung.graph.Hypergraph;
-
-/**
- * Assigns scores to vertices based on their distances to each other vertex 
- * in the graph.
- * 
- * This class optionally normalizes its results based on the value of its
- * 'averaging' constructor parameter.  If it is <code>true</code>, 
- * then the value returned for vertex v is 1 / (_average_ distance from v to all other vertices); 
- * this is sometimes called <i>closeness centrality</i>.
- * If it is <code>false</code>, then the value returned is 1 / (_total_ distance from
- * v to all other vertices); this is sometimes referred to as <i>barycenter centrality</i>.
- * (If the average/total distance is 0, the value returned is {@code Double.POSITIVE_INFINITY}.)
- * 
- * @see BarycenterScorer
- * @see ClosenessCentrality
- */
-public class DistanceCentralityScorer<V,E> implements VertexScorer<V, Double>
-{
-    /**
-     * The graph on which the vertex scores are to be calculated.
-     */
-    protected Hypergraph<V, E> graph;
-    
-    /**
-     * The metric to use for specifying the distance between pairs of vertices.
-     */
-    protected Distance<V> distance;
-    
-    /**
-     * The cache for the output results.  Null encodes "not yet calculated",
-     * < 0 encodes "no such distance exists".
-     */
-    protected Map<V, Double> output;
-    
-    /**
-     * Specifies whether the values returned are the sum of the v-distances
-     * or the mean v-distance.
-     */
-    protected boolean averaging;
-    
-    /**
-     * Specifies whether, for a vertex <code>v</code> with missing (null) distances, 
-     * <code>v</code>'s score should ignore the missing values or be set to 'null'.
-     * Defaults to 'true'.
-     */
-    protected boolean ignore_missing;
-
-    /**
-     * Specifies whether the values returned should ignore self-distances 
-     * (distances from <code>v</code> to itself).
-     * Defaults to 'true'.
-     */
-    protected boolean ignore_self_distances;
-    
-    /**
-     * Creates an instance with the specified graph, distance metric, and 
-     * averaging behavior.
-     * 
-     * @param graph     The graph on which the vertex scores are to be calculated.
-     * @param distance  The metric to use for specifying the distance between 
-     * pairs of vertices.
-     * @param averaging Specifies whether the values returned is the sum of all 
-     * v-distances or the mean v-distance.
-     * @param ignore_missing   Specifies whether scores for missing distances 
-     * are to ignore missing distances or be set to null.
-     * @param ignore_self_distances    Specifies whether distances from a vertex
-     * to itself should be included in its score.
-     */
-    public DistanceCentralityScorer(Hypergraph<V,E> graph, Distance<V> distance, 
-               boolean averaging, boolean ignore_missing, 
-               boolean ignore_self_distances)
-    {
-        this.graph = graph;
-        this.distance = distance;
-        this.averaging = averaging;
-        this.ignore_missing = ignore_missing;
-        this.ignore_self_distances = ignore_self_distances;
-        this.output = new HashMap<V, Double>();
-    }
-
-    /**
-     * Equivalent to <code>this(graph, distance, averaging, true, true)</code>.
-     * 
-     * @param graph     The graph on which the vertex scores are to be calculated.
-     * @param distance  The metric to use for specifying the distance between 
-     * pairs of vertices.
-     * @param averaging Specifies whether the values returned is the sum of all 
-     * v-distances or the mean v-distance.
-     */
-    public DistanceCentralityScorer(Hypergraph<V,E> graph, Distance<V> distance, 
-               boolean averaging)
-    {
-       this(graph, distance, averaging, true, true);
-    }
-    
-    /**
-     * Creates an instance with the specified graph and averaging behavior
-     * whose vertex distances are calculated based on the specified edge
-     * weights.  
-     * 
-     * @param graph         The graph on which the vertex scores are to be 
-     * calculated.
-     * @param edge_weights  The edge weights to use for specifying the distance 
-     * between pairs of vertices.
-     * @param averaging     Specifies whether the values returned is the sum of 
-     * all v-distances or the mean v-distance.
-     * @param ignore_missing   Specifies whether scores for missing distances 
-     * are to ignore missing distances or be set to null.
-     * @param ignore_self_distances    Specifies whether distances from a vertex
-     * to itself should be included in its score.
-     */
-    public DistanceCentralityScorer(Hypergraph<V,E> graph, 
-            Transformer<E, ? extends Number> edge_weights, boolean averaging,
-            boolean ignore_missing, boolean ignore_self_distances)
-    {
-        this(graph, new DijkstraDistance<V,E>(graph, edge_weights), averaging,
-               ignore_missing, ignore_self_distances);
-    }
-    
-    /**
-     * Equivalent to <code>this(graph, edge_weights, averaging, true, true)</code>.
-     * @param graph         The graph on which the vertex scores are to be 
-     * calculated.
-     * @param edge_weights  The edge weights to use for specifying the distance 
-     * between pairs of vertices.
-     * @param averaging     Specifies whether the values returned is the sum of 
-     * all v-distances or the mean v-distance.
-     */
-    public DistanceCentralityScorer(Hypergraph<V,E> graph, 
-            Transformer<E, ? extends Number> edge_weights, boolean averaging)
-    {
-        this(graph, new DijkstraDistance<V,E>(graph, edge_weights), averaging,
-               true, true);
-    }
-    
-    /**
-     * Creates an instance with the specified graph and averaging behavior
-     * whose vertex distances are calculated on the unweighted graph.  
-     * 
-     * @param graph         The graph on which the vertex scores are to be 
-     * calculated.
-     * @param averaging     Specifies whether the values returned is the sum of 
-     * all v-distances or the mean v-distance.
-     * @param ignore_missing   Specifies whether scores for missing distances 
-     * are to ignore missing distances or be set to null.
-     * @param ignore_self_distances    Specifies whether distances from a vertex
-     * to itself should be included in its score.
-     */
-    public DistanceCentralityScorer(Hypergraph<V,E> graph, boolean averaging,
-            boolean ignore_missing, boolean ignore_self_distances)
-    {
-        this(graph, new UnweightedShortestPath<V,E>(graph), averaging, 
-               ignore_missing, ignore_self_distances);
-    }
-
-    /**
-     * Equivalent to <code>this(graph, averaging, true, true)</code>.
-     * @param graph         The graph on which the vertex scores are to be 
-     * calculated.
-     * @param averaging     Specifies whether the values returned is the sum of 
-     * all v-distances or the mean v-distance.
-     */
-    public DistanceCentralityScorer(Hypergraph<V,E> graph, boolean averaging)
-    {
-        this(graph, new UnweightedShortestPath<V,E>(graph), averaging, true, true);
-    }
-
-       /**
-        * Calculates the score for the specified vertex.  Returns {@code null} if 
-        * there are missing distances and such are not ignored by this instance.
-        */
-       public Double getVertexScore(V v) 
-       {
-           Double value = output.get(v);
-           if (value != null)
-           {
-               if (value < 0)
-                   return null;
-               return value;
-           }
-           
-           Map<V, Number> v_distances = new HashMap<V, Number>(distance.getDistanceMap(v));
-           if (ignore_self_distances)
-               v_distances.remove(v);
-           
-               // if we don't ignore missing distances and there aren't enough
-               // distances, output null (shortcut)
-               if (!ignore_missing)
-               {
-                       int num_dests = graph.getVertexCount() - 
-                           (ignore_self_distances ? 1 : 0);
-                       if (v_distances.size() != num_dests) 
-                       {
-                               output.put(v, -1.0);
-                               return null;
-                       }
-               }               
-               
-               Double sum = 0.0;
-               for (V w : graph.getVertices())
-               {
-                       if (w.equals(v) && ignore_self_distances)
-                               continue;
-                       Number w_distance = v_distances.get(w);
-                       if (w_distance == null)
-                               if (ignore_missing)
-                                       continue;
-                               else
-                               {
-                                       output.put(v, -1.0);
-                                       return null;
-                               }
-                       else
-                               sum += w_distance.doubleValue();
-               }
-               value = sum;
-               if (averaging)
-                   value /= v_distances.size();
-               
-               double score = value == 0 ? 
-                       Double.POSITIVE_INFINITY : 
-                       1.0 / value;
-           output.put(v, score);
-                  
-               return score;
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/EdgeScorer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/EdgeScorer.java
deleted file mode 100644 (file)
index 7e64874..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Created on Jul 6, 2007
- *
- * Copyright (c) 2007, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring;
-
-
-/**
- * An interface for algorithms that assign scores to edges.
- *
- * @param <E> the edge type
- * @param <S> the score type
- */
-public interface EdgeScorer<E, S>
-{
-    /**
-     * Returns the algorithm's score for this edge.
-     * @return the algorithm's score for this edge
-     */
-    public S getEdgeScore(E e);
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/EigenvectorCentrality.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/EigenvectorCentrality.java
deleted file mode 100644 (file)
index 87d7f3a..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Created on Jul 12, 2007
- *
- * Copyright (c) 2007, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.graph.Hypergraph;
-
-/**
- * Calculates eigenvector centrality for each vertex in the graph.
- * The 'eigenvector centrality' for a vertex is defined as the fraction of
- * time that a random walk(er) will spend at that vertex over an infinite
- * time horizon.
- * Assumes that the graph is strongly connected.
- */
-public class EigenvectorCentrality<V,E> extends PageRank<V,E>
-{
-    /**
-     * Creates an instance with the specified graph and edge weights.
-     * The outgoing edge weights for each edge must sum to 1.
-     * (See <code>UniformDegreeWeight</code> for one way to handle this for
-     * undirected graphs.)
-     * @param graph the graph for which the centrality is to be calculated
-     * @param edge_weights the edge weights 
-     */
-    public EigenvectorCentrality(Hypergraph<V,E> graph, 
-               Transformer<E, ? extends Number> edge_weights)
-    {
-        super(graph, edge_weights, 0);
-        acceptDisconnectedGraph(false);
-    }
-
-    /**
-     * Creates an instance with the specified graph and default edge weights.
-     * (Default edge weights: <code>UniformDegreeWeight</code>.)
-     * @param graph the graph for which the centrality is to be calculated.
-     */
-    public EigenvectorCentrality(Hypergraph<V,E> graph)
-    {
-        super(graph, 0);
-        acceptDisconnectedGraph(false);
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/HITS.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/HITS.java
deleted file mode 100644 (file)
index b1b4f42..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Created on Jul 15, 2007
- *
- * Copyright (c) 2007, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring;
-
-import edu.uci.ics.jung.algorithms.scoring.util.ScoringUtils;
-import edu.uci.ics.jung.graph.Graph;
-
-import org.apache.commons.collections15.Transformer;
-
-/**
- * Assigns hub and authority scores to each vertex depending on the topology of
- * the network.  The essential idea is that a vertex is a hub to the extent 
- * that it links to authoritative vertices, and is an authority to the extent
- * that it links to 'hub' vertices.
- * 
- * <p>The classic HITS algorithm essentially proceeds as follows:
- * <pre>
- * assign equal initial hub and authority values to each vertex
- * repeat
- *   for each vertex w:
- *     w.hub = sum over successors x of x.authority
- *     w.authority = sum over predecessors v of v.hub
- *   normalize hub and authority scores so that the sum of the squares of each = 1
- * until scores converge
- * </pre>
- * 
- * HITS is somewhat different from random walk/eigenvector-based algorithms 
- * such as PageRank in that: 
- * <ul>
- * <li/>there are two mutually recursive scores being calculated, rather than 
- * a single value
- * <li/>the edge weights are effectively all 1, i.e., they can't be interpreted
- * as transition probabilities.  This means that the more inlinks and outlinks
- * that a vertex has, the better, since adding an inlink (or outlink) does
- * not dilute the influence of the other inlinks (or outlinks) as in 
- * random walk-based algorithms.
- * <li/>the scores cannot be interpreted as posterior probabilities (due to the different
- * normalization)
- * </ul>
- * 
- * This implementation has the classic behavior by default.  However, it has
- * been generalized somewhat so that it can act in a more "PageRank-like" fashion:
- * <ul>
- * <li/>this implementation has an optional 'random jump probability' parameter analogous
- * to the 'alpha' parameter used by PageRank.  Varying this value between 0 and 1
- * allows the user to vary between the classic HITS behavior and one in which the
- * scores are smoothed to a uniform distribution.
- * The default value for this parameter is 0 (no random jumps possible).
- * <li/>the edge weights can be set to anything the user likes, and in 
- * particular they can be set up (e.g. using <code>UniformDegreeWeight</code>)
- * so that the weights of the relevant edges incident to a vertex sum to 1.
- * <li/>The vertex score normalization has been factored into its own method
- * so that it can be overridden by a subclass.  Thus, for example, 
- * since the vertices' values are set to sum to 1 initially, if the weights of the
- * relevant edges incident to a vertex sum to 1, then the vertices' values
- * will continue to sum to 1 if the "sum-of-squares" normalization code
- * is overridden to a no-op.  (Other normalization methods may also be employed.)
- * </ul>
- * 
- * @param <V> the vertex type
- * @param <E> the edge type
- * 
- * @see "'Authoritative sources in a hyperlinked environment' by Jon Kleinberg, 1997"
- */
-public class HITS<V,E> extends HITSWithPriors<V,E>
-{
-
-    /**
-     * Creates an instance for the specified graph, edge weights, and alpha
-     * (random jump probability) parameter.
-     * @param g the input graph
-     * @param edge_weights the weights to use for each edge
-     * @param alpha the probability of a hub giving some authority to all vertices,
-     * and of an authority increasing the score of all hubs (not just those connected
-     * via links)
-     */
-    public HITS(Graph<V,E> g, Transformer<E, Double> edge_weights, double alpha)
-    {
-        super(g, edge_weights, ScoringUtils.getHITSUniformRootPrior(g.getVertices()), alpha);
-    }
-
-    /**
-     * Creates an instance for the specified graph and alpha (random jump probability)
-     * parameter.  The edge weights are all set to 1.
-     * @param g the input graph
-     * @param alpha the probability of a hub giving some authority to all vertices,
-     * and of an authority increasing the score of all hubs (not just those connected
-     * via links)
-     */
-    public HITS(Graph<V,E> g, double alpha)
-    {
-        super(g, ScoringUtils.getHITSUniformRootPrior(g.getVertices()), alpha);
-    }
-
-    /**
-     * Creates an instance for the specified graph.  The edge weights are all set to 1
-     * and alpha is set to 0.
-     * @param g the input graph
-     */
-    public HITS(Graph<V,E> g)
-    {
-        this(g, 0.0);
-    }
-    
-
-    /**
-     * Maintains hub and authority score information for a vertex.
-     */
-    public static class Scores
-    {
-       /**
-        * The hub score for a vertex.
-        */
-       public double hub;
-       
-       /**
-        * The authority score for a vertex.
-        */
-       public double authority;
-       
-       /**
-        * Creates an instance with the specified hub and authority score.
-        */
-       public Scores(double hub, double authority)
-       {
-               this.hub = hub;
-               this.authority = authority;
-       }
-       
-       @Override
-        public String toString()
-       {
-               return String.format("[h:%.4f,a:%.4f]", this.hub, this.authority);
-       }
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/HITSWithPriors.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/HITSWithPriors.java
deleted file mode 100644 (file)
index 51ba719..0000000
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Created on Jul 14, 2007
- *
- * Copyright (c) 2007, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring;
-
-import org.apache.commons.collections15.Transformer;
-import org.apache.commons.collections15.functors.ConstantTransformer;
-
-import edu.uci.ics.jung.graph.Hypergraph;
-
-/**
- * A generalization of HITS that permits non-uniformly-distributed random jumps.
- * The 'vertex_priors' (that is, prior probabilities for each vertex) may be
- * thought of as the fraction of the total 'potential' (hub or authority score)
- * that is assigned to that vertex out of the portion that is assigned according
- * to random jumps.
- * 
- * @see "Algorithms for Estimating Relative Importance in Graphs by Scott White and Padhraic Smyth, 2003"
- */
-public class HITSWithPriors<V, E> 
-       extends AbstractIterativeScorerWithPriors<V,E,HITS.Scores>
-{
-    /**
-     * The sum of the potential, at each step, associated with vertices with no outedges (authority)
-     * or no inedges (hub).
-     */
-    protected HITS.Scores disappearing_potential;
-
-    /**
-     * Creates an instance for the specified graph, edge weights, vertex prior probabilities,
-     * and random jump probability (alpha).
-     * @param g the input graph
-     * @param edge_weights the edge weights 
-     * @param vertex_priors the prior probability for each vertex
-     * @param alpha the probability of a random jump at each step
-     */
-    public HITSWithPriors(Hypergraph<V,E> g,
-            Transformer<E, ? extends Number> edge_weights,
-            Transformer<V, HITS.Scores> vertex_priors, double alpha)
-    {
-        super(g, edge_weights, vertex_priors, alpha);
-        disappearing_potential = new HITS.Scores(0,0);
-    }
-
-    /**
-     * Creates an instance for the specified graph, vertex priors, and random
-     * jump probability (alpha).  The edge weights default to 1.0.
-     * @param g the input graph
-     * @param vertex_priors the prior probability for each vertex
-     * @param alpha the probability of a random jump at each step
-     */
-    @SuppressWarnings("unchecked")
-    public HITSWithPriors(Hypergraph<V,E> g, 
-          Transformer<V, HITS.Scores> vertex_priors, double alpha)
-    {
-       super(g, new ConstantTransformer(1.0), vertex_priors, alpha);
-        disappearing_potential = new HITS.Scores(0,0);
-    }
-
-    /**
-     * Updates the value for this vertex.
-     */
-    @Override
-    protected double update(V v)
-    {
-        collectDisappearingPotential(v);
-        
-        double v_auth = 0;
-        for (E e : graph.getInEdges(v))
-        {
-               int incident_count = getAdjustedIncidentCount(e);
-               for (V w : graph.getIncidentVertices(e)) 
-               {
-                       if (!w.equals(v) || hyperedges_are_self_loops) 
-                               v_auth += (getCurrentValue(w).hub * 
-                                               getEdgeWeight(w,e).doubleValue() / incident_count);
-               }
-//            V w = graph.getOpposite(v, e);
-//            auth += (getCurrentValue(w).hub * getEdgeWeight(w, e).doubleValue());
-        }
-        
-        double v_hub = 0;
-        for (E e : graph.getOutEdges(v))
-        {
-               int incident_count = getAdjustedIncidentCount(e);
-               for (V w : graph.getIncidentVertices(e)) 
-               {
-                       if (!w.equals(v) || hyperedges_are_self_loops) 
-                               v_hub += (getCurrentValue(w).authority * 
-                                               getEdgeWeight(w,e).doubleValue() / incident_count);
-               }
-//            V x = graph.getOpposite(v,e);
-//            hub += (getCurrentValue(x).authority * getEdgeWeight(x, e).doubleValue()); 
-        }
-        
-        // modify total_input according to alpha
-        if (alpha > 0) 
-        {
-               v_auth = v_auth * (1 - alpha) + getVertexPrior(v).authority * alpha;
-               v_hub = v_hub * (1 - alpha) + getVertexPrior(v).hub * alpha;
-        }
-        setOutputValue(v, new HITS.Scores(v_hub, v_auth));
-
-        return Math.max(Math.abs(getCurrentValue(v).hub - v_hub), 
-                        Math.abs(getCurrentValue(v).authority - v_auth));
-    }
-
-    /**
-     * Code which is executed after each step.  In this case, deals with the
-     * 'disappearing potential', normalizes the scores, and then calls
-     * <code>super.afterStep()</code>.
-     * @see #collectDisappearingPotential(Object)
-     */
-    @Override
-    protected void afterStep()
-    {
-        if (disappearing_potential.hub > 0 || disappearing_potential.authority > 0)
-        {
-            for (V v : graph.getVertices())
-            {
-                double new_hub = getOutputValue(v).hub + 
-                    (1 - alpha) * (disappearing_potential.hub * getVertexPrior(v).hub);
-                double new_auth = getOutputValue(v).authority + 
-                    (1 - alpha) * (disappearing_potential.authority * getVertexPrior(v).authority);
-                setOutputValue(v, new HITS.Scores(new_hub, new_auth));
-            }
-            disappearing_potential.hub = 0;
-            disappearing_potential.authority = 0;
-        }
-        
-       normalizeScores();
-       
-        super.afterStep();
-    }
-
-       /**
-        * Normalizes scores so that sum of their squares = 1.
-        * This method may be overridden so as to yield different 
-        * normalizations.
-        */
-       protected void normalizeScores() {
-       double hub_ssum = 0;
-       double auth_ssum = 0;
-       for (V v : graph.getVertices())
-       {
-               double hub_val = getOutputValue(v).hub;
-               double auth_val = getOutputValue(v).authority;
-               hub_ssum += (hub_val * hub_val);
-               auth_ssum += (auth_val * auth_val);
-       }
-
-       hub_ssum = Math.sqrt(hub_ssum);
-       auth_ssum = Math.sqrt(auth_ssum);
-       
-       for (V v : graph.getVertices())
-       {
-               HITS.Scores values = getOutputValue(v);
-               setOutputValue(v, new HITS.Scores(
-                               values.hub / hub_ssum,
-                               values.authority / auth_ssum));
-       }
-       }
-    
-       /**
-        * Collects the "disappearing potential" associated with vertices that have either 
-        * no incoming edges, no outgoing edges, or both.  Vertices that have no incoming edges
-        * do not directly contribute to the hub scores of other vertices; similarly, vertices
-        * that have no outgoing edges do not directly contribute to the authority scores of
-        * other vertices.  These values are collected at each step and then distributed across all vertices
-        * as a part of the normalization process.  (This process is not required for, and does
-        * not affect, the 'sum-of-squares'-style normalization.) 
-        */
-    @Override
-    protected void collectDisappearingPotential(V v)
-    {
-        if (graph.outDegree(v) == 0)
-        {
-            if (isDisconnectedGraphOK())
-                disappearing_potential.hub += getCurrentValue(v).authority;
-            else
-                throw new IllegalArgumentException("Outdegree of " + v + " must be > 0");
-        }
-        if (graph.inDegree(v) == 0)
-        {
-            if (isDisconnectedGraphOK())
-                disappearing_potential.authority += getCurrentValue(v).hub;
-            else
-                throw new IllegalArgumentException("Indegree of " + v + " must be > 0");
-        }
-    }
-
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/KStepMarkov.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/KStepMarkov.java
deleted file mode 100644 (file)
index e640b1b..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/**
- * Copyright (c) 2008, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- * Created on Aug 22, 2008
- * 
- */
-package edu.uci.ics.jung.algorithms.scoring;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.algorithms.scoring.util.ScoringUtils;
-import edu.uci.ics.jung.graph.Hypergraph;
-
-/**
- * A special case of {@code PageRankWithPriors} in which the final scores
- * represent a probability distribution over position assuming a random (Markovian)
- * walk of exactly k steps, based on the initial distribution specified by the priors.
- * 
- * <p><b>NOTE</b>: The version of {@code KStepMarkov} in {@code algorithms.importance}
- * (and in JUNG 1.x) is believed to be incorrect: rather than returning 
- * a score which represents a probability distribution over position assuming
- * a k-step random walk, it returns a score which represents the sum over all steps
- * of the probability for each step.  If you want that behavior, set the 
- * 'cumulative' flag as follows <i>before calling {@code evaluate()}</i>:
- * <pre>
- *     KStepMarkov ksm = new KStepMarkov(...);
- *     ksm.setCumulative(true);
- *     ksm.evaluate();
- * </pre>
- * 
- * By default, the 'cumulative' flag is set to false.
- * 
- * NOTE: THIS CLASS IS NOT YET COMPLETE.  USE AT YOUR OWN RISK.  (The original behavior
- * is captured by the version still available in {@code algorithms.importance}.)
- * 
- * @see "Algorithms for Estimating Relative Importance in Graphs by Scott White and Padhraic Smyth, 2003"
- * @see PageRank
- * @see PageRankWithPriors
- */
-public class KStepMarkov<V,E> extends PageRankWithPriors<V,E> 
-{
-       private boolean cumulative;
-       
-       /**
-        * Creates an instance based on the specified graph, edge weights, vertex
-        * priors (initial scores), and number of steps to take.
-        * @param graph the input graph
-        * @param edge_weights the edge weights (transition probabilities)
-        * @param vertex_priors the initial probability distribution (score assignment)
-        * @param steps the number of times that {@code step()} will be called by {@code evaluate}
-        */
-       public KStepMarkov(Hypergraph<V,E> graph, Transformer<E, ? extends Number> edge_weights, 
-                                          Transformer<V, Double> vertex_priors, int steps)
-       {
-               super(graph, edge_weights, vertex_priors, 0);
-               initialize(steps);
-       }
-       
-       /**
-        * Creates an instance based on the specified graph, vertex
-        * priors (initial scores), and number of steps to take.  The edge
-        * weights (transition probabilities) are set to default values (a uniform
-        * distribution over all outgoing edges).
-        * @param graph the input graph
-        * @param vertex_priors the initial probability distribution (score assignment)
-        * @param steps the number of times that {@code step()} will be called by {@code evaluate}
-        */
-       public KStepMarkov(Hypergraph<V,E> graph, Transformer<V, Double> vertex_priors, int steps)
-       {
-               super(graph, vertex_priors, 0);
-               initialize(steps);
-       }
-       
-       /**
-        * Creates an instance based on the specified graph and number of steps to 
-        * take.  The edge weights (transition probabilities) and vertex initial scores
-        * (prior probabilities) are set to default values (a uniform
-        * distribution over all outgoing edges, and a uniform distribution over
-        * all vertices, respectively).
-        * @param graph the input graph
-        * @param steps the number of times that {@code step()} will be called by {@code evaluate}
-        */
-       public KStepMarkov(Hypergraph<V,E> graph, int steps)
-       {
-               super(graph, ScoringUtils.getUniformRootPrior(graph.getVertices()), 0);
-               initialize(steps);
-       }
-       
-       private void initialize(int steps)
-       {
-               this.acceptDisconnectedGraph(false);
-               
-               if (steps <= 0)
-                       throw new IllegalArgumentException("Number of steps must be > 0");
-               
-               this.max_iterations = steps;
-               this.tolerance = -1.0;
-               
-               this.cumulative = false;
-       }
-
-       /**
-        * Specifies whether this instance should assign a score to each vertex
-        * based on the 
-        * @param cumulative
-        */
-       public void setCumulative(boolean cumulative)
-       {
-               this.cumulative = cumulative;
-       }
-       
-    /**
-     * Updates the value for this vertex.  Called by <code>step()</code>.
-     */
-    @Override
-    public double update(V v)
-    {
-       if (!cumulative)
-               return super.update(v);
-       
-        collectDisappearingPotential(v);
-        
-        double v_input = 0;
-        for (E e : graph.getInEdges(v))
-        {
-               // For graphs, the code below is equivalent to 
-//          V w = graph.getOpposite(v, e);
-//          total_input += (getCurrentValue(w) * getEdgeWeight(w,e).doubleValue());
-               // For hypergraphs, this divides the potential coming from w 
-               // by the number of vertices in the connecting edge e.
-               int incident_count = getAdjustedIncidentCount(e);
-               for (V w : graph.getIncidentVertices(e)) 
-               {
-                       if (!w.equals(v) || hyperedges_are_self_loops) 
-                               v_input += (getCurrentValue(w) * 
-                                               getEdgeWeight(w,e).doubleValue() / incident_count);
-               }
-        }
-        
-        // modify total_input according to alpha
-        double new_value = alpha > 0 ? 
-                       v_input * (1 - alpha) + getVertexPrior(v) * alpha :
-                       v_input;
-        setOutputValue(v, new_value + getCurrentValue(v));
-
-        // FIXME: DO WE NEED TO CHANGE HOW DISAPPEARING IS COUNTED?  NORMALIZE?
-        
-        return Math.abs(getCurrentValue(v) - new_value);
-    }
-
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/PageRank.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/PageRank.java
deleted file mode 100644 (file)
index ca7266d..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Created on Jul 12, 2007
- *
- * Copyright (c) 2007, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.algorithms.scoring.util.ScoringUtils;
-import edu.uci.ics.jung.graph.Hypergraph;
-
-/**
- * Assigns scores to each vertex according to the PageRank algorithm.  
- * 
- * <p>PageRank is an eigenvector-based algorithm.  The score for a given vertex may be thought of
- * as the fraction of time spent 'visiting' that vertex (measured over all time) 
- * in a random walk over the vertices (following outgoing edges from each vertex).  
- * PageRank modifies this random walk by adding to the model a probability (specified as 'alpha' 
- * in the constructor) of jumping to any vertex.  If alpha is 0, this is equivalent to the
- * eigenvector centrality algorithm; if alpha is 1, all vertices will receive the same score
- * (1/|V|).  Thus, alpha acts as a sort of score smoothing parameter.
- * 
- * <p>The original algorithm assumed that, for a given vertex, the probability of following any 
- * outgoing edge was the same; this is the default if edge weights are not specified.  
- * This implementation generalizes the original by permitting 
- * the user to specify edge weights; in order to maintain the original semantics, however,
- * the weights on the outgoing edges for a given vertex must represent transition probabilities; 
- * that is, they must sum to 1.
- * 
- * <p>If a vertex has no outgoing edges, then the probability of taking a random jump from that
- * vertex is (by default) effectively 1.  If the user wishes to instead throw an exception when this happens,
- * call <code>acceptDisconnectedGraph(false)</code> on this instance.
- * 
- * <p>Typical values for alpha (according to the original paper) are in the range [0.1, 0.2]
- * but may be any value between 0 and 1 inclusive.
- * 
- * @see "The Anatomy of a Large-Scale Hypertextual Web Search Engine by L. Page and S. Brin, 1999"
- */
-public class PageRank<V,E> extends PageRankWithPriors<V,E>
-{
-
-    /**
-     * Creates an instance for the specified graph, edge weights, and random jump probability.
-     * @param graph the input graph
-     * @param edge_weight the edge weights (transition probabilities)
-     * @param alpha the probability of taking a random jump to an arbitrary vertex
-     */
-    public PageRank(Hypergraph<V,E> graph, Transformer<E, ? extends Number> edge_weight, double alpha)
-    {
-        super(graph, edge_weight, ScoringUtils.getUniformRootPrior(graph.getVertices()), alpha);
-    }
-
-    /**
-     * Creates an instance for the specified graph and random jump probability; the probability
-     * of following any outgoing edge from a given vertex is the same.
-     * @param graph the input graph
-     * @param alpha the probability of taking a random jump to an arbitrary vertex
-     */
-    public PageRank(Hypergraph<V,E> graph, double alpha)
-    {
-        super(graph, ScoringUtils.getUniformRootPrior(graph.getVertices()), alpha);
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/PageRankWithPriors.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/PageRankWithPriors.java
deleted file mode 100644 (file)
index 717d5ea..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Created on Jul 6, 2007
- *
- * Copyright (c) 2007, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.algorithms.scoring.util.UniformDegreeWeight;
-import edu.uci.ics.jung.graph.Hypergraph;
-
-/**
- * A generalization of PageRank that permits non-uniformly-distributed random jumps.
- * The 'vertex_priors' (that is, prior probabilities for each vertex) may be
- * thought of as the fraction of the total 'potential' that is assigned to that 
- * vertex at each step out of the portion that is assigned according
- * to random jumps (this portion is specified by 'alpha').
- * 
- * @see "Algorithms for Estimating Relative Importance in Graphs by Scott White and Padhraic Smyth, 2003"
- * @see PageRank
- */
-public class PageRankWithPriors<V, E> 
-       extends AbstractIterativeScorerWithPriors<V,E,Double>
-{
-    /**
-     * Maintains the amount of potential associated with vertices with no out-edges.
-     */
-    protected double disappearing_potential = 0.0;
-    
-    /**
-     * Creates an instance with the specified graph, edge weights, vertex priors, and 
-     * 'random jump' probability (alpha).
-     * @param graph the input graph
-     * @param edge_weights the edge weights, denoting transition probabilities from source to destination
-     * @param vertex_priors the prior probabilities for each vertex
-     * @param alpha the probability of executing a 'random jump' at each step
-     */
-    public PageRankWithPriors(Hypergraph<V,E> graph, 
-               Transformer<E, ? extends Number> edge_weights, 
-            Transformer<V, Double> vertex_priors, double alpha)
-    {
-        super(graph, edge_weights, vertex_priors, alpha);
-    }
-    
-    /**
-     * Creates an instance with the specified graph, vertex priors, and 
-     * 'random jump' probability (alpha).  The outgoing edge weights for each
-     * vertex will be equal and sum to 1.
-     * @param graph the input graph
-     * @param vertex_priors the prior probabilities for each vertex
-     * @param alpha the probability of executing a 'random jump' at each step
-     */
-    public PageRankWithPriors(Hypergraph<V,E> graph, 
-               Transformer<V, Double> vertex_priors, double alpha)
-    {
-        super(graph, vertex_priors, alpha);
-        this.edge_weights = new UniformDegreeWeight<V,E>(graph);
-    }
-    
-    /**
-     * Updates the value for this vertex.  Called by <code>step()</code>.
-     */
-    @Override
-    public double update(V v)
-    {
-        collectDisappearingPotential(v);
-        
-        double v_input = 0;
-        for (E e : graph.getInEdges(v))
-        {
-               // For graphs, the code below is equivalent to 
-//          V w = graph.getOpposite(v, e);
-//          total_input += (getCurrentValue(w) * getEdgeWeight(w,e).doubleValue());
-               // For hypergraphs, this divides the potential coming from w 
-               // by the number of vertices in the connecting edge e.
-               int incident_count = getAdjustedIncidentCount(e);
-               for (V w : graph.getIncidentVertices(e)) 
-               {
-                       if (!w.equals(v) || hyperedges_are_self_loops) 
-                               v_input += (getCurrentValue(w) * 
-                                               getEdgeWeight(w,e).doubleValue() / incident_count);
-               }
-        }
-        
-        // modify total_input according to alpha
-        double new_value = alpha > 0 ? 
-                       v_input * (1 - alpha) + getVertexPrior(v) * alpha :
-                       v_input;
-        setOutputValue(v, new_value);
-        
-        return Math.abs(getCurrentValue(v) - new_value);
-    }
-
-    /**
-     * Cleans up after each step.  In this case that involves allocating the disappearing
-     * potential (thus maintaining normalization of the scores) according to the vertex 
-     * probability priors, and then calling 
-     * <code>super.afterStep</code>.
-     */
-    @Override
-    protected void afterStep()
-    {
-        // distribute disappearing potential according to priors
-        if (disappearing_potential > 0)
-        {
-            for (V v : graph.getVertices())
-            {
-                setOutputValue(v, getOutputValue(v) + 
-                        (1 - alpha) * (disappearing_potential * getVertexPrior(v)));
-            }
-            disappearing_potential = 0;
-        }
-        
-        super.afterStep();
-    }
-    
-    /**
-     * Collects the "disappearing potential" associated with vertices that have 
-     * no outgoing edges.  Vertices that have no outgoing edges do not directly 
-     * contribute to the scores of other vertices.  These values are collected 
-     * at each step and then distributed across all vertices
-     * as a part of the normalization process.
-    */
-    @Override
-    protected void collectDisappearingPotential(V v)
-    {
-        if (graph.outDegree(v) == 0)
-        {
-            if (isDisconnectedGraphOK())
-                disappearing_potential += getCurrentValue(v);
-            else
-                throw new IllegalArgumentException("Outdegree of " + v + " must be > 0");
-        }
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/VertexScorer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/VertexScorer.java
deleted file mode 100644 (file)
index 610de6b..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Created on Jul 6, 2007
- *
- * Copyright (c) 2007, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring;
-
-
-/**
- * An interface for algorithms that assign scores to vertices.
- *
- * @param <V> the vertex type
- * @param <S> the score type
- */
-public interface VertexScorer<V, S>
-{
-    /**
-     * Returns the algorithm's score for this vertex.
-     * @return the algorithm's score for this vertex
-     */
-    public S getVertexScore(V v);
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/VoltageScorer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/VoltageScorer.java
deleted file mode 100644 (file)
index f05b911..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * Created on Jul 15, 2007
- *
- * Copyright (c) 2007, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.algorithms.scoring.util.UniformDegreeWeight;
-import edu.uci.ics.jung.graph.Hypergraph;
-
-/**
- * Assigns scores to vertices according to their 'voltage' in an approximate 
- * solution to the Kirchoff equations.  This is accomplished by tying "source"
- * vertices to specified positive voltages, "sink" vertices to 0 V, and 
- * iteratively updating the voltage of each other vertex to the (weighted) 
- * average of the voltages of its neighbors.
- * 
- * <p>The resultant voltages will all be in the range <code>[0, max]</code>
- * where <code>max</code> is the largest voltage of any source vertex (in the
- * absence of negative source voltages; see below).
- * 
- * <p>A few notes about this algorithm's interpretation of the graph data: 
- * <ul>
- * <li/>Higher edge weights are interpreted as indicative of greater 
- * influence/effect than lower edge weights.  
- * <li/>Negative edge weights (and negative "source" voltages) invalidate
- * the interpretation of the resultant values as voltages.  However, this 
- * algorithm will not reject graphs with negative edge weights or source voltages.
- * <li/>Parallel edges are equivalent to a single edge whose weight is the 
- * sum of the weights on the parallel edges.
- * <li/>Current flows along undirected edges in both directions, 
- * but only flows along directed edges in the direction of the edge.
- * </ul>
- * </p> 
- */
-public class VoltageScorer<V, E> extends AbstractIterativeScorer<V, E, Double>
-        implements VertexScorer<V, Double>
-{
-    protected Map<V, ? extends Number> source_voltages;
-    protected Collection<V> sinks;
-    
-    /**
-     * Creates an instance with the specified graph, edge weights, source voltages,
-     * and sinks.
-     * @param g the input graph
-     * @param edge_weights the edge weights, representing conductivity
-     * @param source_voltages the (fixed) voltage for each source
-     * @param sinks the vertices whose voltages are tied to 0
-     */
-    public VoltageScorer(Hypergraph<V, E> g, Transformer<E, ? extends Number> edge_weights, 
-            Map<V, ? extends Number> source_voltages, Collection<V> sinks)
-    {
-        super(g, edge_weights);
-        this.source_voltages = source_voltages;
-        this.sinks = sinks;
-        initialize();
-    }
-
-    /**
-     * Creates an instance with the specified graph, edge weights, source vertices
-     * (each of whose 'voltages' are tied to 1), and sinks.
-     * @param g the input graph
-     * @param edge_weights the edge weights, representing conductivity
-     * @param sources the vertices whose voltages are tied to 1
-     * @param sinks the vertices whose voltages are tied to 0
-     */
-    public VoltageScorer(Hypergraph<V, E> g, Transformer<E, ? extends Number> edge_weights, 
-            Collection<V> sources, Collection<V> sinks)
-    {
-        super(g, edge_weights);
-        
-        Map<V, Double> unit_voltages = new HashMap<V, Double>();
-        for(V v : sources) 
-            unit_voltages.put(v, new Double(1.0));
-        this.source_voltages = unit_voltages;
-        this.sinks = sinks;
-        initialize();
-    }
-
-    /**
-     * Creates an instance with the specified graph, source vertices
-     * (each of whose 'voltages' are tied to 1), and sinks.
-     * The outgoing edges for each vertex are assigned 
-     * weights that sum to 1.
-     * @param g the input graph
-     * @param sources the vertices whose voltages are tied to 1
-     * @param sinks the vertices whose voltages are tied to 0
-     */
-    public VoltageScorer(Hypergraph<V, E> g, Collection<V> sources, Collection<V> sinks)
-    {
-        super(g);
-        
-        Map<V, Double> unit_voltages = new HashMap<V, Double>();
-        for(V v : sources) 
-            unit_voltages.put(v, new Double(1.0));
-        this.source_voltages = unit_voltages;
-        this.sinks = sinks;
-        initialize();
-    }
-    
-    /**
-     * Creates an instance with the specified graph, source voltages,
-     * and sinks.  The outgoing edges for each vertex are assigned 
-     * weights that sum to 1.
-     * @param g the input graph
-     * @param source_voltages the (fixed) voltage for each source
-     * @param sinks the vertices whose voltages are tied to 0
-     */
-    public VoltageScorer(Hypergraph<V, E> g, Map<V, ? extends Number> source_voltages, 
-               Collection<V> sinks)
-    {
-        super(g);
-        this.source_voltages = source_voltages;
-        this.sinks = sinks;
-        this.edge_weights = new UniformDegreeWeight<V,E>(g);
-        initialize();
-    }
-    
-    /**
-     * Creates an instance with the specified graph, edge weights, source, and
-     * sink.  The source vertex voltage is tied to 1.
-     * @param g the input graph
-     * @param edge_weights the edge weights, representing conductivity
-     * @param source the vertex whose voltage is tied to 1
-     * @param sink the vertex whose voltage is tied to 0
-     */
-    public VoltageScorer(Hypergraph<V,E> g, Transformer<E, ? extends Number> edge_weights, 
-               V source, V sink)
-    {
-        this(g, edge_weights, Collections.singletonMap(source, 1.0), Collections.singletonList(sink));
-        initialize();
-    }
-
-    /**
-     * Creates an instance with the specified graph, edge weights, source, and
-     * sink.  The source vertex voltage is tied to 1.
-     * The outgoing edges for each vertex are assigned 
-     * weights that sum to 1.
-     * @param g the input graph
-     * @param source the vertex whose voltage is tied to 1
-     * @param sink the vertex whose voltage is tied to 0
-     */
-    public VoltageScorer(Hypergraph<V,E> g, V source, V sink)
-    {
-        this(g, Collections.singletonMap(source, 1.0), Collections.singletonList(sink));
-        initialize();
-    }
-
-    
-    /**
-     * Initializes the state of this instance.
-     */
-    @Override
-    public void initialize()
-    {
-        super.initialize();
-        
-        // sanity check
-        if (source_voltages.isEmpty() || sinks.isEmpty())
-            throw new IllegalArgumentException("Both sources and sinks (grounds) must be defined");
-        
-        if (source_voltages.size() + sinks.size() > graph.getVertexCount())
-            throw new IllegalArgumentException("Source/sink sets overlap, or contain vertices not in graph");
-        
-        for (Map.Entry<V, ? extends Number> entry : source_voltages.entrySet())
-        {
-            V v = entry.getKey();
-            if (sinks.contains(v))
-                throw new IllegalArgumentException("Vertex " + v + " is incorrectly specified as both source and sink");
-            double value = entry.getValue().doubleValue();
-            if (value <= 0)
-                throw new IllegalArgumentException("Source vertex " + v + " has negative voltage");
-        }
-        
-        // set up initial voltages
-        for (V v : graph.getVertices())
-        {
-            if (source_voltages.containsKey(v))
-                setOutputValue(v, source_voltages.get(v).doubleValue());
-            else
-                setOutputValue(v, 0.0);
-        }
-    }
-    
-    /**
-     * @see edu.uci.ics.jung.algorithms.scoring.AbstractIterativeScorer#update(Object)
-     */
-    @Override
-    public double update(V v)
-    {
-        // if it's a voltage source or sink, we're done
-        Number source_volts = source_voltages.get(v);
-        if (source_volts != null) 
-        {
-            setOutputValue(v, source_volts.doubleValue());
-            return 0.0;
-        }
-        if (sinks.contains(v))
-        {
-            setOutputValue(v, 0.0);
-            return 0.0;
-        }
-        
-        Collection<E> edges = graph.getInEdges(v);
-        double voltage_sum = 0;
-        double weight_sum = 0;
-        for (E e: edges)
-        {
-               int incident_count = getAdjustedIncidentCount(e);
-               for (V w : graph.getIncidentVertices(e)) 
-               {
-                       if (!w.equals(v) || hyperedges_are_self_loops) 
-                       {
-                               double weight = getEdgeWeight(w,e).doubleValue() / incident_count;
-                               voltage_sum += getCurrentValue(w).doubleValue() * weight;
-                               weight_sum += weight;
-                       }
-               }
-//            V w = graph.getOpposite(v, e);
-//            double weight = getEdgeWeight(w,e).doubleValue();
-//            voltage_sum += getCurrentValue(w).doubleValue() * weight;
-//            weight_sum += weight;
-        }
-
-        // if either is 0, new value is 0
-        if (voltage_sum == 0 || weight_sum == 0)
-        {
-            setOutputValue(v, 0.0);
-            return getCurrentValue(v).doubleValue();
-        }
-        
-        setOutputValue(v, voltage_sum / weight_sum);
-        return Math.abs(getCurrentValue(v).doubleValue() - voltage_sum / weight_sum);
-    }
-
-}
-
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/package.html b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/package.html
deleted file mode 100644 (file)
index a1f8196..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-  @(#)package.html
-
- Copyright © 2003 The Regents of the University of California. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies. This software program and documentation are copyrighted by The Regents of the University of California ("The University of California").
-
-THE SOFTWARE PROGRAM AND DOCUMENTATION ARE SUPPLIED "AS IS," WITHOUT ANY ACCOMPANYING SERVICES FROM THE UNIVERSITY OF CALFORNIA. FURTHERMORE, THE UNIVERSITY OF CALIFORNIA DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED OR ERROR-FREE. THE END-USER UNDERSTANDS THAT THE PROGRAM WAS DEVELOPED FOR RESEARCH PURPOSES AND IS ADVISED NOT TO RELY EXCLUSIVELY ON THE PROGRAM FOR ANY REASON.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
--->
-</head>
-<body>
-
-Mechanisms for assigning values (denoting significance, influence, centrality, etc.)
-to graph elements based on topological properties.  These include:
-
-<ul>
-<li/><code>BarycenterScorer</code>: assigns a score to each vertex according to 
-the sum of the distances to all other vertices
-<li/><code>ClosenessCentrality</code>: assigns a score to each vertex based on 
-the mean distance to each other vertex
-<li/><code>DegreeScorer</code>: assigns a score to each vertex based on its degree
-<li/><code>EigenvectorCentrality</code>: assigns vertex scores based on 
-long-term probabilities of random walks passing through the vertex at time t
-<li/><code>PageRank</code>: like <code>EigenvectorCentrality</code>, but with 
-a constant probability of the
-random walk restarting at a uniform-randomly chosen vertex
-<li/><code>PageRankWithPriors</code>: like <code>PageRank</code>, but with a 
-constant probability of the random
-walk restarting at a vertex drawn from an arbitrary distribution
-<li/><code>HITS</code>: assigns hubs-and-authorities scores to vertices based on 
-complementary random walk processes
-<li/><code>HITSWithPriors</code>: analogous to <code>HITS</code> 
-(see <code>PageRankWithPriors</code>)
-<li/><code>VoltageScorer</code>: assigns scores to vertices based on simulated 
-current flow along edges
-</ul>
-
-</body>
-</html>
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/DelegateToEdgeTransformer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/DelegateToEdgeTransformer.java
deleted file mode 100644 (file)
index f836a9b..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Created on Jul 11, 2008
- *
- * Copyright (c) 2008, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring.util;
-
-import org.apache.commons.collections15.Transformer;
-
-/**
- * A <code>Transformer<VEPair,Number></code> that delegates its operation to a
- * <code>Transformer<E,Number></code>.  Mainly useful for technical reasons inside 
- * AbstractIterativeScorer; in essence it allows the edge weight instance 
- * variable to be of type <code>VEPair,W</code> even if the edge weight 
- * <code>Transformer</code> only operates on edges.
- */
-public class DelegateToEdgeTransformer<V,E> implements
-        Transformer<VEPair<V,E>,Number>
-{
-       /**
-        * The transformer to which this instance delegates its function.
-        */
-    protected Transformer<E,? extends Number> delegate;
-    
-    /**
-     * Creates an instance with the specified delegate transformer.
-     * @param delegate the Transformer to which this instance will delegate
-     */
-    public DelegateToEdgeTransformer(Transformer<E,? extends Number> delegate)
-    {
-        this.delegate = delegate;
-    }
-    
-    /**
-     * @see Transformer#transform(Object)
-     */
-    public Number transform(VEPair<V,E> arg0)
-    {
-        return delegate.transform(arg0.getE());
-    }
-
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/ScoringUtils.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/ScoringUtils.java
deleted file mode 100644 (file)
index 793944b..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Created on Jul 12, 2007
- *
- * Copyright (c) 2007, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring.util;
-
-import java.util.Collection;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.algorithms.scoring.HITS;
-
-/**
- * Methods for assigning values (to be interpreted as prior probabilities) to vertices in the context
- * of random-walk-based scoring algorithms.
- */
-public class ScoringUtils
-{
-    /**
-     * Assigns a probability of 1/<code>roots.size()</code> to each of the elements of <code>roots</code>.
-     * @param <V> the vertex type
-     * @param roots the vertices to be assigned nonzero prior probabilities
-     * @return
-     */
-    public static <V> Transformer<V, Double> getUniformRootPrior(Collection<V> roots)
-    {
-        final Collection<V> inner_roots = roots;
-        Transformer<V, Double> distribution = new Transformer<V, Double>()
-        {
-            public Double transform(V input)
-            {
-                if (inner_roots.contains(input))
-                    return new Double(1.0 / inner_roots.size());
-                else
-                    return 0.0;
-            }
-        };
-        
-        return distribution;
-    }
-    
-    /**
-     * Returns a Transformer that hub and authority values of 1/<code>roots.size()</code> to each 
-     * element of <code>roots</code>.
-     * @param <V> the vertex type
-     * @param roots the vertices to be assigned nonzero scores
-     * @return a Transformer that assigns uniform prior hub/authority probabilities to each root
-     */
-    public static <V> Transformer<V, HITS.Scores> getHITSUniformRootPrior(Collection<V> roots)
-    {
-        final Collection<V> inner_roots = roots;
-        Transformer<V, HITS.Scores> distribution = 
-               new Transformer<V, HITS.Scores>()
-        {
-            public HITS.Scores transform(V input)
-            {
-                if (inner_roots.contains(input))
-                    return new HITS.Scores(1.0 / inner_roots.size(), 1.0 / inner_roots.size());
-                else
-                    return new HITS.Scores(0.0, 0.0);
-            }
-        };
-        return distribution;
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/UniformDegreeWeight.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/UniformDegreeWeight.java
deleted file mode 100644 (file)
index f22bfcc..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Copyright (c) 2008, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- * Created on Jul 14, 2008
- * 
- */
-package edu.uci.ics.jung.algorithms.scoring.util;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.graph.Hypergraph;
-import edu.uci.ics.jung.graph.util.EdgeType;
-
-/**
- * An edge weight function that assigns weights as uniform
- * transition probabilities.
- * For undirected edges, returns 1/degree(v) (where 'v' is the
- * vertex in the VEPair.
- * For directed edges, returns 1/outdegree(source(e)) (where 'e'
- * is the edge in the VEPair).
- * Throws an <code>IllegalArgumentException</code> if the input 
- * edge is neither EdgeType.UNDIRECTED nor EdgeType.DIRECTED.
- *
- */
-public class UniformDegreeWeight<V, E> implements
-               Transformer<VEPair<V, E>, Double> 
-{
-    private Hypergraph<V, E> graph;
-    
-    /**
-     * Creates an instance for the specified graph.
-     */
-    public UniformDegreeWeight(Hypergraph<V, E> graph)
-    {
-        this.graph = graph;
-    }
-
-       /**
-        * @see org.apache.commons.collections15.Transformer#transform(java.lang.Object)
-        */
-       public Double transform(VEPair<V, E> ve_pair) 
-       {
-               E e = ve_pair.getE();
-               V v = ve_pair.getV();
-               EdgeType edge_type = graph.getEdgeType(e);
-               if (edge_type == EdgeType.UNDIRECTED)
-                       return 1.0 / graph.degree(v);
-               if (edge_type == EdgeType.DIRECTED)
-                       return 1.0 / graph.outDegree(graph.getSource(e));
-               throw new IllegalArgumentException("can't handle edge type: " + edge_type);
-       }
-
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/UniformInOut.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/UniformInOut.java
deleted file mode 100644 (file)
index 7853f00..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Created on Jul 11, 2008
- *
- * Copyright (c) 2008, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring.util;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.util.EdgeType;
-
-/**
- * Assigns weights to directed edges (the edge of the vertex/edge pair) depending on 
- * whether the vertex is the edge's source or its destination.
- * If the vertex v is the edge's source, assigns 1/outdegree(v).
- * Otherwise, assigns 1/indegree(w).
- * Throws <code>IllegalArgumentException</code> if the edge is not directed.
- */
-public class UniformInOut<V,E> implements Transformer<VEPair<V,E>, Double>
-{
-       /**
-        * The graph for which the edge weights are defined.
-        */
-    protected Graph<V,E> graph;
-    
-    /**
-     * Creates an instance for the specified graph.
-     * @param graph the graph for which the edge weights will be defined
-     */
-    public UniformInOut(Graph<V,E> graph)
-    {
-        this.graph = graph;
-    }
-    
-    /**
-     * @see org.apache.commons.collections15.Transformer#transform(Object)
-     * @throws IllegalArgumentException
-     */
-    public Double transform(VEPair<V,E> ve_pair)
-    {
-       V v = ve_pair.getV();
-       E e = ve_pair.getE();
-       if (graph.getEdgeType(e) != EdgeType.DIRECTED)
-               throw new IllegalArgumentException("This transformer only" +
-                               " operates on directed edges");
-       return 1.0 / (graph.isSource(v, e) ? 
-                       graph.outDegree(v) : 
-                       graph.inDegree(v));
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/VEPair.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/VEPair.java
deleted file mode 100644 (file)
index ad90293..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Created on Jul 8, 2007
- *
- * Copyright (c) 2007, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring.util;
-
-/**
- * Convenience class for associating a vertex and an edge.  Used, for example,
- * in contexts in which it is necessary to know the origin for an edge traversal
- * (that is, the direction in which an (undirected) edge is being traversed).
- *
- * @param <V> the vertex type
- * @param <E> the edge type
- */
-public class VEPair<V, E>
-{
-    private V v;
-    private E e;
-    
-    /**
-     * Creates an instance with the specified vertex and edge
-     * @param v the vertex to add
-     * @param e the edge to add
-     */
-    public VEPair(V v, E e)
-    {
-        if (v == null || e == null)
-            throw new IllegalArgumentException("elements must be non-null");
-        
-        this.v = v;
-        this.e = e;
-    }
-    
-    /**
-     * Returns the vertex of this pair.
-     */
-    public V getV()
-    {
-        return v;
-    }
-    
-    /**
-     * Returns the edge of this pair.
-     */
-    public E getE()
-    {
-        return e;
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/VertexScoreTransformer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/VertexScoreTransformer.java
deleted file mode 100644 (file)
index 851c08e..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Created on Jul 18, 2008
- *
- * Copyright (c) 2008, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.scoring.util;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.algorithms.scoring.VertexScorer;
-
-/**
- * A Transformer convenience wrapper around VertexScorer.
- */
-public class VertexScoreTransformer<V, S> implements Transformer<V, S>
-{
-    /**
-     * The VertexScorer instance that provides the values returned by <code>transform</code>.
-     */
-    protected VertexScorer<V,S> vs;
-
-    /**
-     * Creates an instance based on the specified VertexScorer.
-     */
-    public VertexScoreTransformer(VertexScorer<V,S> vs)
-    {
-        this.vs = vs;
-    }
-
-    /**
-     * Returns the score for this vertex.
-     */
-    public S transform(V v)
-    {
-        return vs.getVertexScore(v);
-    }
-
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/package.html b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/scoring/util/package.html
deleted file mode 100644 (file)
index 3bf18f3..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-  @(#)package.html
-
- Copyright © 2003 The Regents of the University of California. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies. This software program and documentation are copyrighted by The Regents of the University of California ("The University of California").
-
-THE SOFTWARE PROGRAM AND DOCUMENTATION ARE SUPPLIED "AS IS," WITHOUT ANY ACCOMPANYING SERVICES FROM THE UNIVERSITY OF CALFORNIA. FURTHERMORE, THE UNIVERSITY OF CALIFORNIA DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED OR ERROR-FREE. THE END-USER UNDERSTANDS THAT THE PROGRAM WAS DEVELOPED FOR RESEARCH PURPOSES AND IS ADVISED NOT TO RELY EXCLUSIVELY ON THE PROGRAM FOR ANY REASON.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
--->
-</head>
-<body>
-
-Utility functions for assigning scores to graph elements.  These include:
-<ul>
-<li/><code>EdgeWeight</code>: interface for classes that associate numeric values 
-with edges
-<li/><code>ScoringUtils</code>: methods for calculating transition probabilities
-for random-walk-based algorithms.
-<li/><code>UniformOut</code>: an edge weight function that assigns weights as uniform
-transition probabilities to all outgoing edges of a vertex.
-<li/><code>UniformIncident</code>: an edge weight function that assigns
-weights as uniform transition probabilities to all incident edges of a
-vertex (useful for undirected graphs). 
-<li/><code>VEPair</code>: analogous to <code>Pair</code> but specifically 
-containing an associated vertex and edge.
-<li/><code>VertexEdgeWeight</code>: a subtype of <code>EdgeWeight</code> that 
-assigns edge weights with respect to a specified 'source' vertex. 
-</ul>
-
-</body>
-</html>
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/BFSDistanceLabeler.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/BFSDistanceLabeler.java
deleted file mode 100644 (file)
index 38d3b00..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.shortestpath;
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import edu.uci.ics.jung.graph.Hypergraph;
-
-/**
- * Labels each node in the graph according to the BFS distance from the start node(s). If nodes are unreachable, then
- * they are assigned a distance of -1.
- * All nodes traversed at step k are marked as predecessors of their successors traversed at step k+1.
- * <p>
- * Running time is: O(m)
- * @author Scott White
- */
-public class BFSDistanceLabeler<V, E> {
-
-    private Map<V, Number> distanceDecorator = new HashMap<V,Number>();
-    private List<V> mCurrentList;
-    private Set<V> mUnvisitedVertices;
-    private List<V> mVerticesInOrderVisited;
-    private Map<V,HashSet<V>> mPredecessorMap;
-
-       /**
-        * Creates a new BFS labeler for the specified graph and root set
-        * The distances are stored in the corresponding Vertex objects and are of type MutableInteger
-        */
-       public BFSDistanceLabeler() {
-               mPredecessorMap = new HashMap<V,HashSet<V>>();
-       }
-
-    /**
-     * Returns the list of vertices visited in order of traversal
-     * @return the list of vertices
-     */
-    public List<V> getVerticesInOrderVisited() {
-        return mVerticesInOrderVisited;
-    }
-
-    /**
-     * Returns the set of all vertices that were not visited
-     * @return the list of unvisited vertices
-     */
-    public Set<V> getUnvisitedVertices() {
-        return mUnvisitedVertices;
-    }
-
-    /**
-     * Given a vertex, returns the shortest distance from any node in the root set to v
-     * @param v the vertex whose distance is to be retrieved
-     * @return the shortest distance from any node in the root set to v
-     */
-    public int getDistance(Hypergraph<V,E> g, V v) {
-        if (!g.getVertices().contains(v)) {
-            throw new IllegalArgumentException("Vertex is not contained in the graph.");
-        }
-
-        return distanceDecorator.get(v).intValue();
-    }
-
-    /**
-     * Returns set of predecessors of the given vertex
-     * @param v the vertex whose predecessors are to be retrieved
-     * @return the set of predecessors
-     */
-    public Set<V> getPredecessors(V v) {
-        return mPredecessorMap.get(v);
-    }
-
-    protected void initialize(Hypergraph<V,E> g, Set<V> rootSet) {
-        mVerticesInOrderVisited = new ArrayList<V>();
-        mUnvisitedVertices = new HashSet<V>();
-        for(V currentVertex : g.getVertices()) {
-            mUnvisitedVertices.add(currentVertex);
-            mPredecessorMap.put(currentVertex,new HashSet<V>());
-        }
-
-        mCurrentList = new ArrayList<V>();
-        for(V v : rootSet) {
-            distanceDecorator.put(v, new Integer(0));
-            mCurrentList.add(v);
-            mUnvisitedVertices.remove(v);
-            mVerticesInOrderVisited.add(v);
-        }
-    }
-
-    private void addPredecessor(V predecessor,V sucessor) {
-        HashSet<V> predecessors = mPredecessorMap.get(sucessor);
-        predecessors.add(predecessor);
-    }
-
-    /**
-     * Computes the distances of all the node from the starting root nodes. If there is more than one root node
-     * the minimum distance from each root node is used as the designated distance to a given node. Also keeps track
-     * of the predecessors of each node traversed as well as the order of nodes traversed.
-     * @param graph the graph to label
-     * @param rootSet the set of starting vertices to traverse from
-     */
-    public void labelDistances(Hypergraph<V,E> graph, Set<V> rootSet) {
-
-        initialize(graph,rootSet);
-
-        int distance = 1;
-        while (true) {
-            List<V> newList = new ArrayList<V>();
-            for(V currentVertex : mCurrentList) {
-               if(graph.containsVertex(currentVertex)) {
-                       for(V next : graph.getSuccessors(currentVertex)) {
-                               visitNewVertex(currentVertex,next, distance, newList);
-                       }
-               }
-            }
-            if (newList.size() == 0) break;
-            mCurrentList = newList;
-            distance++;
-        }
-
-        for(V v : mUnvisitedVertices) {
-            distanceDecorator.put(v,new Integer(-1));
-        }
-    }
-
-    /**
-     * Computes the distances of all the node from the specified root node. Also keeps track
-     * of the predecessors of each node traversed as well as the order of nodes traversed.
-     *  @param graph the graph to label
-     * @param root the single starting vertex to traverse from
-     */
-    public void labelDistances(Hypergraph<V,E> graph, V root) {
-        labelDistances(graph, Collections.singleton(root));
-    }
-
-    private void visitNewVertex(V predecessor, V neighbor, int distance, List<V> newList) {
-        if (mUnvisitedVertices.contains(neighbor)) {
-            distanceDecorator.put(neighbor, new Integer(distance));
-            newList.add(neighbor);
-            mVerticesInOrderVisited.add(neighbor);
-            mUnvisitedVertices.remove(neighbor);
-        }
-        int predecessorDistance = distanceDecorator.get(predecessor).intValue();
-        int successorDistance = distanceDecorator.get(neighbor).intValue();
-        if (predecessorDistance < successorDistance) {
-            addPredecessor(predecessor,neighbor);
-        }
-    }
-
-    /**
-     * Returns a map from vertices to minimum distances from the original source(s).
-     * Must be called after {@code labelDistances} in order to contain valid data.
-     */
-    public Map<V, Number> getDistanceDecorator() {
-        return distanceDecorator;
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/DijkstraDistance.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/DijkstraDistance.java
deleted file mode 100644 (file)
index 3e99e16..0000000
+++ /dev/null
@@ -1,582 +0,0 @@
-/*
- * Created on Jul 9, 2005
- *
- * Copyright (c) 2005, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.shortestpath;
-
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.collections15.Transformer;
-import org.apache.commons.collections15.functors.ConstantTransformer;
-
-import edu.uci.ics.jung.algorithms.util.BasicMapEntry;
-import edu.uci.ics.jung.algorithms.util.MapBinaryHeap;
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.Hypergraph;
-
-/**
- * <p>Calculates distances in a specified graph, using  
- * Dijkstra's single-source-shortest-path algorithm.  All edge weights
- * in the graph must be nonnegative; if any edge with negative weight is 
- * found in the course of calculating distances, an 
- * <code>IllegalArgumentException</code> will be thrown.
- * (Note: this exception will only be thrown when such an edge would be
- * used to update a given tentative distance;
- * the algorithm does not check for negative-weight edges "up front".)
- * 
- * <p>Distances and partial results are optionally cached (by this instance)
- * for later reference.  Thus, if the 10 closest vertices to a specified source 
- * vertex are known, calculating the 20 closest vertices does not require 
- * starting Dijkstra's algorithm over from scratch.</p>
- * 
- * <p>Distances are stored as double-precision values.  
- * If a vertex is not reachable from the specified source vertex, no 
- * distance is stored.  <b>This is new behavior with version 1.4</b>;
- * the previous behavior was to store a value of 
- * <code>Double.POSITIVE_INFINITY</code>.  This change gives the algorithm
- * an approximate complexity of O(kD log k), where k is either the number of
- * requested targets or the number of reachable vertices (whichever is smaller),
- * and D is the average degree of a vertex.</p>
- * 
- * <p> The elements in the maps returned by <code>getDistanceMap</code> 
- * are ordered (that is, returned 
- * by the iterator) by nondecreasing distance from <code>source</code>.</p>
- * 
- * <p>Users are cautioned that distances calculated should be assumed to
- * be invalidated by changes to the graph, and should invoke <code>reset()</code>
- * when appropriate so that the distances can be recalculated.</p>
- * 
- * @author Joshua O'Madadhain
- * @author Tom Nelson converted to jung2
- */
-public class DijkstraDistance<V,E> implements Distance<V>
-{
-    protected Hypergraph<V,E> g;
-    protected Transformer<E,? extends Number> nev;
-    protected Map<V,SourceData> sourceMap;   // a map of source vertices to an instance of SourceData
-    protected boolean cached;
-    protected double max_distance;
-    protected int max_targets;
-    
-    /**
-     * <p>Creates an instance of <code>DijkstraShortestPath</code> for 
-     * the specified graph and the specified method of extracting weights 
-     * from edges, which caches results locally if and only if 
-     * <code>cached</code> is <code>true</code>.
-     * 
-     * @param g     the graph on which distances will be calculated
-     * @param nev   the class responsible for returning weights for edges
-     * @param cached    specifies whether the results are to be cached
-     */
-    public DijkstraDistance(Hypergraph<V,E> g, Transformer<E,? extends Number> nev, boolean cached) {
-        this.g = g;
-        this.nev = nev;
-        this.sourceMap = new HashMap<V,SourceData>();
-        this.cached = cached;
-        this.max_distance = Double.POSITIVE_INFINITY;
-        this.max_targets = Integer.MAX_VALUE;
-    }
-    
-    /**
-     * <p>Creates an instance of <code>DijkstraShortestPath</code> for 
-     * the specified graph and the specified method of extracting weights 
-     * from edges, which caches results locally.
-     * 
-     * @param g     the graph on which distances will be calculated
-     * @param nev   the class responsible for returning weights for edges
-     */
-    public DijkstraDistance(Hypergraph<V,E> g, Transformer<E,? extends Number> nev) {
-        this(g, nev, true);
-    }
-    
-    /**
-     * <p>Creates an instance of <code>DijkstraShortestPath</code> for 
-     * the specified unweighted graph (that is, all weights 1) which
-     * caches results locally.
-     * 
-     * @param g     the graph on which distances will be calculated
-     */ 
-    @SuppressWarnings("unchecked")
-    public DijkstraDistance(Hypergraph<V,E> g) {
-        this(g, new ConstantTransformer(1), true);
-    }
-
-    /**
-     * <p>Creates an instance of <code>DijkstraShortestPath</code> for 
-     * the specified unweighted graph (that is, all weights 1) which
-     * caches results locally.
-     * 
-     * @param g     the graph on which distances will be calculated
-     * @param cached    specifies whether the results are to be cached
-     */ 
-    @SuppressWarnings("unchecked")
-    public DijkstraDistance(Hypergraph<V,E> g, boolean cached) {
-        this(g, new ConstantTransformer(1), cached);
-    }
-
-    /**
-     * Implements Dijkstra's single-source shortest-path algorithm for
-     * weighted graphs.  Uses a <code>MapBinaryHeap</code> as the priority queue, 
-     * which gives this algorithm a time complexity of O(m lg n) (m = # of edges, n = 
-     * # of vertices).
-     * This algorithm will terminate when any of the following have occurred (in order
-     * of priority):
-     * <ul>
-     * <li> the distance to the specified target (if any) has been found
-     * <li> no more vertices are reachable 
-     * <li> the specified # of distances have been found, or the maximum distance 
-     * desired has been exceeded
-     * <li> all distances have been found
-     * </ul>
-     * 
-     * @param source    the vertex from which distances are to be measured
-     * @param numDests  the number of distances to measure
-     * @param targets   the set of vertices to which distances are to be measured
-     * @param regular   boolean is true if we want regular SP dijkstra. False for MT.
-     */
-    private LinkedHashMap<V,Number> singleSourceShortestPath(V source, Collection<V> targets, int numDests, boolean regular)
-    {
-        SourceData sd = getSourceData(source);
-
-        Set<V> to_get = new HashSet<V>();
-        if (targets != null) {
-            to_get.addAll(targets);
-            Set<V> existing_dists = sd.distances.keySet();
-            for(V o : targets) {
-                if (existing_dists.contains(o))
-                    to_get.remove(o);
-            }
-        }
-        
-        // if we've exceeded the max distance or max # of distances we're willing to calculate, or
-        // if we already have all the distances we need, 
-        // terminate
-        if (sd.reached_max ||
-            (targets != null && to_get.isEmpty()) ||
-            (sd.distances.size() >= numDests))
-        {
-            return sd.distances;
-        }
-        
-        while (!sd.unknownVertices.isEmpty() && (sd.distances.size() < numDests || !to_get.isEmpty()))
-        {
-            Map.Entry<V,Number> p = sd.getNextVertex();
-            V v = p.getKey();
-            double v_dist = p.getValue().doubleValue();
-            to_get.remove(v);
-            if (v_dist > this.max_distance) 
-            {
-                // we're done; put this vertex back in so that we're not including
-                // a distance beyond what we specified
-                sd.restoreVertex(v, v_dist);
-                sd.reached_max = true;
-                break;
-            }
-            sd.dist_reached = v_dist;
-
-            if (sd.distances.size() >= this.max_targets)
-            {
-                sd.reached_max = true;
-                break;
-            }
-            
-            for (E e : getEdgesToCheck(v) )
-            {
-                for (V w : g.getIncidentVertices(e))
-                {
-                    if (!sd.distances.containsKey(w))
-                    {
-                        double edge_weight = nev.transform(e).doubleValue();
-                        if (edge_weight < 0)
-                            throw new IllegalArgumentException("Edges weights must be non-negative");
-                        double new_dist;
-                        if (regular == true) {
-                          new_dist = v_dist + edge_weight;
-                        } else {
-                          if (v_dist <= edge_weight) {
-                            new_dist = edge_weight;
-                          } else {
-                            new_dist = v_dist;
-                          }
-                        }
-                        if (!sd.estimatedDistances.containsKey(w))
-                        {
-                            sd.createRecord(w, e, new_dist);
-                        }
-                        else
-                        {
-                            double w_dist = ((Double)sd.estimatedDistances.get(w)).doubleValue();
-                            if (new_dist < w_dist) // update tentative distance & path for w
-                                sd.update(w, e, new_dist);
-                        }
-                    }
-                }
-            }
-        }
-        return sd.distances;
-    }
-    
-    /**
-     * Implements Dijkstra's single-source shortest-path algorithm for
-     * weighted graphs.  Uses a <code>MapBinaryHeap</code> as the priority queue, 
-     * which gives this algorithm a time complexity of O(m lg n) (m = # of edges, n = 
-     * # of vertices).
-     * This algorithm will terminate when any of the following have occurred (in order
-     * of priority):
-     * <ul>
-     * <li> the distance to the specified target (if any) has been found
-     * <li> no more vertices are reachable 
-     * <li> the specified # of distances have been found, or the maximum distance 
-     * desired has been exceeded
-     * <li> all distances have been found
-     * </ul>
-     * 
-     * @param source    the vertex from which distances are to be measured
-     * @param numDests  the number of distances to measure
-     * @param targets   the set of vertices to which distances are to be measured
-     */
-    protected LinkedHashMap<V,Number> singleSourceShortestPath(V source, Collection<V> targets, int numDests)
-    {
-        return singleSourceShortestPath(source, targets, numDests, true);
-    }
-
-    /**
-     * Implements Dijkstra's single-source shortest-path algorithm for
-     * weighted graphs.  Uses a <code>MapBinaryHeap</code> as the priority queue, 
-     * which gives this algorithm a time complexity of O(m lg n) (m = # of edges, n = 
-     * # of vertices).
-     * This algorithm will terminate when any of the following have occurred (in order
-     * of priority):
-     * <ul>
-     * <li> the distance to the specified target (if any) has been found
-     * <li> no more vertices are reachable 
-     * <li> the specified # of distances have been found, or the maximum distance 
-     * desired has been exceeded
-     * <li> all distances have been found
-     * </ul>
-     * 
-     * @param source    the vertex from which distances are to be measured
-     * @param numDests  the number of distances to measure
-     * @param targets   the set of vertices to which distances are to be measured
-     */
-    protected LinkedHashMap<V,Number> singleSourceMaxThroughputPath(V source, Collection<V> targets, int numDests)
-    {
-        return singleSourceShortestPath(source, targets, numDests, false);
-    }
-
-    protected SourceData getSourceData(V source)
-    {
-        SourceData sd = sourceMap.get(source);
-        if (sd == null)
-            sd = new SourceData(source);
-        return sd;
-    }
-    
-    /**
-     * Returns the set of edges incident to <code>v</code> that should be tested.
-     * By default, this is the set of outgoing edges for instances of <code>Graph</code>,
-     * the set of incident edges for instances of <code>Hypergraph</code>,
-     * and is otherwise undefined.
-     */
-    protected Collection<E> getEdgesToCheck(V v)
-    {
-        if (g instanceof Graph)
-            return ((Graph<V,E>)g).getOutEdges(v);
-        else
-            return g.getIncidentEdges(v);
-
-    }
-
-    
-    /**
-     * Returns the length of a shortest path from the source to the target vertex,
-     * or null if the target is not reachable from the source.
-     * If either vertex is not in the graph for which this instance
-     * was created, throws <code>IllegalArgumentException</code>.
-     * 
-     * @see #getDistanceMap(Object)
-     * @see #getDistanceMap(Object,int)
-     */
-    public Number getDistance(V source, V target)
-    {
-        if (g.containsVertex(target) == false)
-            throw new IllegalArgumentException("Specified target vertex " + 
-                    target + " is not part of graph " + g);
-        if (g.containsVertex(source) == false)
-            throw new IllegalArgumentException("Specified source vertex " + 
-                    source + " is not part of graph " + g);
-        
-        Set<V> targets = new HashSet<V>();
-        targets.add(target);
-        Map<V,Number> distanceMap = getDistanceMap(source, targets);
-        return distanceMap.get(target);
-    }
-    
-
-    /**
-     * Returns a {@code Map} from each element {@code t} of {@code targets} to the 
-     * shortest-path distance from {@code source} to {@code t}. 
-     */
-    public Map<V,Number> getDistanceMap(V source, Collection<V> targets)
-    {
-       if (g.containsVertex(source) == false)
-            throw new IllegalArgumentException("Specified source vertex " + 
-                    source + " is not part of graph " + g);
-       if (targets.size() > max_targets)
-            throw new IllegalArgumentException("size of target set exceeds maximum " +
-                    "number of targets allowed: " + this.max_targets);
-        
-        Map<V,Number> distanceMap = 
-               singleSourceShortestPath(source, targets, 
-                               Math.min(g.getVertexCount(), max_targets));
-        if (!cached)
-            reset(source);
-        
-        return distanceMap;
-    }
-    
-    /**
-     * <p>Returns a <code>LinkedHashMap</code> which maps each vertex 
-     * in the graph (including the <code>source</code> vertex) 
-     * to its distance from the <code>source</code> vertex.
-     * The map's iterator will return the elements in order of 
-     * increasing distance from <code>source</code>.</p>
-     * 
-     * <p>The size of the map returned will be the number of 
-     * vertices reachable from <code>source</code>.</p>
-     * 
-     * @see #getDistanceMap(Object,int)
-     * @see #getDistance(Object,Object)
-     * @param source    the vertex from which distances are measured
-     */
-    public Map<V,Number> getDistanceMap(V source)
-    {
-        return getDistanceMap(source, Math.min(g.getVertexCount(), max_targets));
-    }
-    
-
-
-    /**
-     * <p>Returns a <code>LinkedHashMap</code> which maps each of the closest 
-     * <code>numDist</code> vertices to the <code>source</code> vertex 
-     * in the graph (including the <code>source</code> vertex) 
-     * to its distance from the <code>source</code> vertex.  Throws 
-     * an <code>IllegalArgumentException</code> if <code>source</code>
-     * is not in this instance's graph, or if <code>numDests</code> is 
-     * either less than 1 or greater than the number of vertices in the 
-     * graph.</p>
-     * 
-     * <p>The size of the map returned will be the smaller of 
-     * <code>numDests</code> and the number of vertices reachable from
-     * <code>source</code>. 
-     * 
-     * @see #getDistanceMap(Object)
-     * @see #getDistance(Object,Object)
-     * @param source    the vertex from which distances are measured
-     * @param numDests  the number of vertices for which to measure distances
-     */
-    public LinkedHashMap<V,Number> getDistanceMap(V source, int numDests)
-    {
-
-       if(g.getVertices().contains(source) == false) {
-            throw new IllegalArgumentException("Specified source vertex " + 
-                    source + " is not part of graph " + g);
-               
-       }
-        if (numDests < 1 || numDests > g.getVertexCount())
-            throw new IllegalArgumentException("numDests must be >= 1 " + 
-                "and <= g.numVertices()");
-
-        if (numDests > max_targets)
-            throw new IllegalArgumentException("numDests must be <= the maximum " +
-                    "number of targets allowed: " + this.max_targets);
-            
-        LinkedHashMap<V,Number> distanceMap = 
-               singleSourceShortestPath(source, null, numDests);
-                
-        if (!cached)
-            reset(source);
-        
-        return distanceMap;        
-    }
-    
-    /**
-     * Allows the user to specify the maximum distance that this instance will calculate.
-     * Any vertices past this distance will effectively be unreachable from the source, in
-     * the sense that the algorithm will not calculate the distance to any vertices which
-     * are farther away than this distance.  A negative value for <code>max_dist</code> 
-     * will ensure that no further distances are calculated.
-     * 
-     * <p>This can be useful for limiting the amount of time and space used by this algorithm
-     * if the graph is very large.</p>
-     * 
-     * <p>Note: if this instance has already calculated distances greater than <code>max_dist</code>,
-     * and the results are cached, those results will still be valid and available; this limit
-     * applies only to subsequent distance calculations.</p>
-     * @see #setMaxTargets(int)
-     */
-    public void setMaxDistance(double max_dist)
-    {
-        this.max_distance = max_dist;
-        for (V v : sourceMap.keySet())
-        {
-            SourceData sd = sourceMap.get(v);
-            sd.reached_max = (this.max_distance <= sd.dist_reached) || (sd.distances.size() >= max_targets);
-        }
-    }
-       
-    /**
-     * Allows the user to specify the maximum number of target vertices per source vertex 
-     * for which this instance will calculate distances.  Once this threshold is reached, 
-     * any further vertices will effectively be unreachable from the source, in
-     * the sense that the algorithm will not calculate the distance to any more vertices.  
-     * A negative value for <code>max_targets</code> will ensure that no further distances are calculated.
-     * 
-     * <p>This can be useful for limiting the amount of time and space used by this algorithm
-     * if the graph is very large.</p>
-     * 
-     * <p>Note: if this instance has already calculated distances to a greater number of 
-     * targets than <code>max_targets</code>, and the results are cached, those results 
-     * will still be valid and available; this limit applies only to subsequent distance 
-     * calculations.</p>
-     * @see #setMaxDistance(double)
-     */
-    public void setMaxTargets(int max_targets)
-    {
-        this.max_targets = max_targets;
-        for (V v : sourceMap.keySet())
-        {
-            SourceData sd = sourceMap.get(v);
-            sd.reached_max = (this.max_distance <= sd.dist_reached) || (sd.distances.size() >= max_targets);
-        }
-    }
-    
-    /**
-     * Clears all stored distances for this instance.  
-     * Should be called whenever the graph is modified (edge weights 
-     * changed or edges added/removed).  If the user knows that
-     * some currently calculated distances are unaffected by a
-     * change, <code>reset(V)</code> may be appropriate instead.
-     * 
-     * @see #reset(Object)
-     */
-    public void reset()
-    {
-        sourceMap = new HashMap<V,SourceData>();
-    }
-        
-    /**
-     * Specifies whether or not this instance of <code>DijkstraShortestPath</code>
-     * should cache its results (final and partial) for future reference.
-     * 
-     * @param enable    <code>true</code> if the results are to be cached, and
-     *                  <code>false</code> otherwise
-     */
-    public void enableCaching(boolean enable)
-    {
-        this.cached = enable;
-    }
-    
-    /**
-     * Clears all stored distances for the specified source vertex 
-     * <code>source</code>.  Should be called whenever the stored distances
-     * from this vertex are invalidated by changes to the graph.
-     * 
-     * @see #reset()
-     */
-    public void reset(V source)
-    {
-        sourceMap.put(source, null);
-    }
-
-    /**
-     * Compares according to distances, so that the BinaryHeap knows how to 
-     * order the tree.  
-     */
-    protected static class VertexComparator<V> implements Comparator<V>
-    {
-        private Map<V,Number> distances;
-        
-        protected VertexComparator(Map<V,Number> distances)
-        {
-            this.distances = distances;
-        }
-
-        public int compare(V o1, V o2)
-        {
-            return ((Double) distances.get(o1)).compareTo((Double) distances.get(o2));
-        }
-    }
-    
-    /**
-     * For a given source vertex, holds the estimated and final distances, 
-     * tentative and final assignments of incoming edges on the shortest path from
-     * the source vertex, and a priority queue (ordered by estimated distance)
-     * of the vertices for which distances are unknown.
-     * 
-     * @author Joshua O'Madadhain
-     */
-    protected class SourceData
-    {
-        protected LinkedHashMap<V,Number> distances;
-        protected Map<V,Number> estimatedDistances;
-        protected MapBinaryHeap<V> unknownVertices;
-        protected boolean reached_max = false;
-        protected double dist_reached = 0;
-
-        protected SourceData(V source)
-        {
-            distances = new LinkedHashMap<V,Number>();
-            estimatedDistances = new HashMap<V,Number>();
-            unknownVertices = new MapBinaryHeap<V>(new VertexComparator<V>(estimatedDistances));
-            
-            sourceMap.put(source, this);
-            
-            // initialize priority queue
-            estimatedDistances.put(source, new Double(0)); // distance from source to itself is 0
-            unknownVertices.add(source);
-            reached_max = false;
-            dist_reached = 0;
-        }
-        
-        protected Map.Entry<V,Number> getNextVertex()
-        {
-            V v = unknownVertices.remove();
-            Double dist = (Double)estimatedDistances.remove(v);
-            distances.put(v, dist);
-            return new BasicMapEntry<V,Number>(v, dist);
-        }
-        
-        protected void update(V dest, E tentative_edge, double new_dist)
-        {
-            estimatedDistances.put(dest, new_dist);
-            unknownVertices.update(dest);
-        }
-        
-        protected void createRecord(V w, E e, double new_dist)
-        {
-            estimatedDistances.put(w, new_dist);
-            unknownVertices.add(w);
-        }
-        
-        protected void restoreVertex(V v, double dist) 
-        {
-            estimatedDistances.put(v, dist);
-            unknownVertices.add(v);
-            distances.remove(v);
-        }
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/DijkstraShortestPath.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/DijkstraShortestPath.java
deleted file mode 100644 (file)
index 05c008d..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.shortestpath;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.graph.Graph;
-
-/**
- * <p>Calculates distances and shortest paths using Dijkstra's   
- * single-source-shortest-path algorithm.  This is a lightweight
- * extension of <code>DijkstraDistance</code> that also stores
- * path information, so that the shortest paths can be reconstructed.</p>
- * 
- * <p> The elements in the maps returned by 
- * <code>getIncomingEdgeMap</code> are ordered (that is, returned 
- * by the iterator) by nondecreasing distance from <code>source</code>.</p>
- * 
- * @author Joshua O'Madadhain
- * @author Tom Nelson converted to jung2
- * @see DijkstraDistance
- */
-public class DijkstraShortestPath<V,E> extends DijkstraDistance<V,E> implements ShortestPath<V,E>
-{
-    /**
-     * <p>Creates an instance of <code>DijkstraShortestPath</code> for 
-     * the specified graph and the specified method of extracting weights 
-     * from edges, which caches results locally if and only if 
-     * <code>cached</code> is <code>true</code>.
-     * 
-     * @param g     the graph on which distances will be calculated
-     * @param nev   the class responsible for returning weights for edges
-     * @param cached    specifies whether the results are to be cached
-     */
-    public DijkstraShortestPath(Graph<V,E> g, Transformer<E, ? extends Number> nev, boolean cached)
-    {
-        super(g, nev, cached);
-    }
-    
-    /**
-     * <p>Creates an instance of <code>DijkstraShortestPath</code> for 
-     * the specified graph and the specified method of extracting weights 
-     * from edges, which caches results locally.
-     * 
-     * @param g     the graph on which distances will be calculated
-     * @param nev   the class responsible for returning weights for edges
-     */
-    public DijkstraShortestPath(Graph<V,E> g, Transformer<E, ? extends Number> nev)
-    {
-        super(g, nev);
-    }
-    
-    /**
-     * <p>Creates an instance of <code>DijkstraShortestPath</code> for 
-     * the specified unweighted graph (that is, all weights 1) which
-     * caches results locally.
-     * 
-     * @param g     the graph on which distances will be calculated
-     */ 
-    public DijkstraShortestPath(Graph<V,E> g)
-    {
-        super(g);
-    }
-
-    /**
-     * <p>Creates an instance of <code>DijkstraShortestPath</code> for 
-     * the specified unweighted graph (that is, all weights 1) which
-     * caches results locally.
-     * 
-     * @param g     the graph on which distances will be calculated
-     * @param cached    specifies whether the results are to be cached
-     */ 
-    public DijkstraShortestPath(Graph<V,E> g, boolean cached)
-    {
-        super(g, cached);
-    }
-    
-    @Override
-    protected SourceData getSourceData(V source)
-    {
-        SourceData sd = sourceMap.get(source);
-        if (sd == null)
-            sd = new SourcePathData(source);
-        return sd;
-    }
-    
-    /**
-     * <p>Returns the last edge on a shortest path from <code>source</code>
-     * to <code>target</code>, or null if <code>target</code> is not 
-     * reachable from <code>source</code>.</p>
-     * 
-     * <p>If either vertex is not in the graph for which this instance
-     * was created, throws <code>IllegalArgumentException</code>.</p>
-     */
-       public E getIncomingEdge(V source, V target)
-       {
-        if (!g.containsVertex(source))
-            throw new IllegalArgumentException("Specified source vertex " + 
-                    source + " is not part of graph " + g);
-        
-        if (!g.containsVertex(target))
-            throw new IllegalArgumentException("Specified target vertex " + 
-                    target + " is not part of graph " + g);
-
-        Set<V> targets = new HashSet<V>();
-        targets.add(target);
-        singleSourceShortestPath(source, targets, g.getVertexCount());
-        Map<V,E> incomingEdgeMap = 
-            ((SourcePathData)sourceMap.get(source)).incomingEdges;
-        E incomingEdge = incomingEdgeMap.get(target);
-        
-        if (!cached)
-            reset(source);
-        
-        return incomingEdge;
-       }
-
-    /**
-     * <p>Returns a <code>LinkedHashMap</code> which maps each vertex 
-     * in the graph (including the <code>source</code> vertex) 
-     * to the last edge on the shortest path from the 
-     * <code>source</code> vertex.
-     * The map's iterator will return the elements in order of 
-     * increasing distance from <code>source</code>.</p>
-     * 
-     * @see DijkstraDistance#getDistanceMap(Object,int)
-     * @see DijkstraDistance#getDistance(Object,Object)
-     * @param source    the vertex from which distances are measured
-     */
-    public Map<V,E> getIncomingEdgeMap(V source)
-       {
-               return getIncomingEdgeMap(source, g.getVertexCount());
-       }
-
-    /**
-     * Returns a <code>List</code> of the edges on the shortest path from 
-     * <code>source</code> to <code>target</code>, in order of their
-     * occurrence on this path.  
-     * If either vertex is not in the graph for which this instance
-     * was created, throws <code>IllegalArgumentException</code>.
-     */
-       private List<E> getPath(V source, V target, boolean spath)
-       {
-               if(!g.containsVertex(source)) 
-            throw new IllegalArgumentException("Specified source vertex " + 
-                    source + " is not part of graph " + g);
-        
-               if(!g.containsVertex(target)) 
-            throw new IllegalArgumentException("Specified target vertex " + 
-                    target + " is not part of graph " + g);
-        
-        LinkedList<E> path = new LinkedList<E>();
-
-        // collect path data; must use internal method rather than
-        // calling getIncomingEdge() because getIncomingEdge() may
-        // wipe out results if results are not cached
-        Set<V> targets = new HashSet<V>();
-        targets.add(target);
-        if (spath == true) {
-          singleSourceShortestPath(source, targets, g.getVertexCount());
-        } else {
-          singleSourceMaxThroughputPath(source, targets, g.getVertexCount());
-        }
-        Map<V,E> incomingEdges = 
-            ((SourcePathData)sourceMap.get(source)).incomingEdges;
-        
-        if (incomingEdges.isEmpty() || incomingEdges.get(target) == null)
-            return path;
-        V current = target;
-        while (!current.equals(source))
-        {
-            E incoming = incomingEdges.get(current);
-            path.addFirst(incoming);
-            current = ((Graph<V,E>)g).getOpposite(current, incoming);
-        }
-               return path;
-       }
-
-    /**
-     * Returns a <code>List</code> of the edges on the shortest path from 
-     * <code>source</code> to <code>target</code>, in order of their
-     * occurrence on this path.  
-     * If either vertex is not in the graph for which this instance
-     * was created, throws <code>IllegalArgumentException</code>.
-     */
-       public List<E> getPath(V source, V target)
-       {
-
-               return getPath(source,target, true);
-       }
-
-    /**
-     * Returns a <code>List</code> of the edges on the Max Througput Shortest
-     * path from  <code>source</code> to <code>target</code>, in order of their
-     * their occurrence on this path.
-     * Important - Transformer fn should return the appropriate edge weight
-     * for this API to return the Path Correctly.
-     * If either vertex is not in the graph for which this instance
-     * was created, throws <code>IllegalArgumentException</code>.
-     */
-       public List<E> getMaxThroughputPath(V source, V target)
-       {
-
-               return getPath(source,target, false);
-       }
-
-    
-    /**
-     * <p>Returns a <code>LinkedHashMap</code> which maps each of the closest 
-     * <code>numDist</code> vertices to the <code>source</code> vertex 
-     * in the graph (including the <code>source</code> vertex) 
-     * to the incoming edge along the path from that vertex.  Throws 
-     * an <code>IllegalArgumentException</code> if <code>source</code>
-     * is not in this instance's graph, or if <code>numDests</code> is 
-     * either less than 1 or greater than the number of vertices in the 
-     * graph.
-     * 
-     * @see #getIncomingEdgeMap(Object)
-     * @see #getPath(Object,Object)
-     * @param source    the vertex from which distances are measured
-     * @param numDests  the number of vertices for which to measure distances
-     */
-       public LinkedHashMap<V,E> getIncomingEdgeMap(V source, int numDests)
-       {
-        if (g.getVertices().contains(source) == false)
-            throw new IllegalArgumentException("Specified source vertex " + 
-                    source + " is not part of graph " + g);
-
-        if (numDests < 1 || numDests > g.getVertexCount())
-            throw new IllegalArgumentException("numDests must be >= 1 " + 
-            "and <= g.numVertices()");
-
-        singleSourceShortestPath(source, null, numDests);
-        
-        LinkedHashMap<V,E> incomingEdgeMap = 
-            ((SourcePathData)sourceMap.get(source)).incomingEdges;
-        
-        if (!cached)
-            reset(source);
-        
-        return incomingEdgeMap;        
-       }
-     
-    
-    /**
-     * For a given source vertex, holds the estimated and final distances, 
-     * tentative and final assignments of incoming edges on the shortest path from
-     * the source vertex, and a priority queue (ordered by estimaed distance)
-     * of the vertices for which distances are unknown.
-     * 
-     * @author Joshua O'Madadhain
-     */
-    protected class SourcePathData extends SourceData
-    {
-        protected Map<V,E> tentativeIncomingEdges;
-               protected LinkedHashMap<V,E> incomingEdges;
-
-               protected SourcePathData(V source)
-               {
-            super(source);
-            incomingEdges = new LinkedHashMap<V,E>();
-            tentativeIncomingEdges = new HashMap<V,E>();
-               }
-        
-        @Override
-        public void update(V dest, E tentative_edge, double new_dist)
-        {
-            super.update(dest, tentative_edge, new_dist);
-            tentativeIncomingEdges.put(dest, tentative_edge);
-        }
-        
-        @Override
-        public Map.Entry<V,Number> getNextVertex()
-        {
-            Map.Entry<V,Number> p = super.getNextVertex();
-            V v = p.getKey();
-            E incoming = tentativeIncomingEdges.remove(v);
-            incomingEdges.put(v, incoming);
-            return p;
-        }
-        
-        @Override
-        public void restoreVertex(V v, double dist)
-        {
-            super.restoreVertex(v, dist);
-            E incoming = incomingEdges.get(v);
-            tentativeIncomingEdges.put(v, incoming);
-        }
-        
-        @Override
-        public void createRecord(V w, E e, double new_dist)
-        {
-            super.createRecord(w, e, new_dist);
-            tentativeIncomingEdges.put(w, e);
-        }
-       
-    }
-
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/Distance.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/Distance.java
deleted file mode 100644 (file)
index 85820d1..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Created on Apr 2, 2004
- *
- * Copyright (c) 2004, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.shortestpath;
-
-import java.util.Map;
-
-
-/**
- * An interface for classes which calculate the distance between
- * one vertex and another.
- * 
- * @author Joshua O'Madadhain
- */
-public interface Distance<V>
-{
-    /**
-     * Returns the distance from the <code>source</code> vertex 
-     * to the <code>target</code> vertex.  If <code>target</code> 
-     * is not reachable from <code>source</code>, returns null.
-     */ 
-     Number getDistance(V source, V target);
-
-    /**
-     * <p>Returns a <code>Map</code> which maps each vertex 
-     * in the graph (including the <code>source</code> vertex) 
-     * to its distance (represented as a Number) 
-     * from <code>source</code>.  If any vertex 
-     * is not reachable from <code>source</code>, no 
-     * distance is stored for that vertex.
-     */
-     Map<V,Number> getDistanceMap(V source);
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/DistanceStatistics.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/DistanceStatistics.java
deleted file mode 100644 (file)
index f0f20a3..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.shortestpath;
-import java.util.Collection;
-
-import org.apache.commons.collections15.Transformer;
-
-import edu.uci.ics.jung.algorithms.scoring.ClosenessCentrality;
-import edu.uci.ics.jung.algorithms.scoring.util.VertexScoreTransformer;
-import edu.uci.ics.jung.graph.Hypergraph;
-
-/**
- * Statistics relating to vertex-vertex distances in a graph.
- * 
- * <p>Formerly known as <code>GraphStatistics</code> in JUNG 1.x.</p>
- * 
- * @author Scott White
- * @author Joshua O'Madadhain
- */
-public class DistanceStatistics 
-{
-    /**
-     * For each vertex <code>v</code> in <code>graph</code>, 
-     * calculates the average shortest path length from <code>v</code> 
-     * to all other vertices in <code>graph</code> using the metric 
-     * specified by <code>d</code>, and returns the results in a
-     * <code>Map</code> from vertices to <code>Double</code> values.
-     * If there exists an ordered pair <code>&lt;u,v&gt;</code>
-     * for which <code>d.getDistance(u,v)</code> returns <code>null</code>,
-     * then the average distance value for <code>u</code> will be stored
-     * as <code>Double.POSITIVE_INFINITY</code>).
-     * 
-     * <p>Does not include self-distances (path lengths from <code>v</code>
-     * to <code>v</code>).
-     * 
-     * <p>To calculate the average distances, ignoring edge weights if any:
-     * <pre>
-     * Map distances = DistanceStatistics.averageDistances(g, new UnweightedShortestPath(g));
-     * </pre>
-     * To calculate the average distances respecting edge weights:
-     * <pre>
-     * DijkstraShortestPath dsp = new DijkstraShortestPath(g, nev);
-     * Map distances = DistanceStatistics.averageDistances(g, dsp);
-     * </pre>
-     * where <code>nev</code> is an instance of <code>Transformer</code> that
-     * is used to fetch the weight for each edge.
-     * 
-     * @see edu.uci.ics.jung.algorithms.shortestpath.UnweightedShortestPath
-     * @see edu.uci.ics.jung.algorithms.shortestpath.DijkstraDistance
-     */
-    public static <V,E> Transformer<V,Double> averageDistances(Hypergraph<V,E> graph, Distance<V> d)
-    {
-       final ClosenessCentrality<V,E> cc = new ClosenessCentrality<V,E>(graph, d);
-       return new VertexScoreTransformer<V, Double>(cc);
-    }
-    
-    /**
-     * For each vertex <code>v</code> in <code>g</code>, 
-     * calculates the average shortest path length from <code>v</code> 
-     * to all other vertices in <code>g</code>, ignoring edge weights.
-     * @see #diameter(Hypergraph)
-     * @see edu.uci.ics.jung.algorithms.scoring.ClosenessCentrality
-     */
-    public static <V,E> Transformer<V, Double> averageDistances(Hypergraph<V,E> g)
-    {
-       final ClosenessCentrality<V,E> cc = new ClosenessCentrality<V,E>(g, 
-                       new UnweightedShortestPath<V,E>(g));
-        return new VertexScoreTransformer<V, Double>(cc);
-    }
-    
-    /**
-     * Returns the diameter of <code>g</code> using the metric 
-     * specified by <code>d</code>.  The diameter is defined to be
-     * the maximum, over all pairs of vertices <code>u,v</code>,
-     * of the length of the shortest path from <code>u</code> to 
-     * <code>v</code>.  If the graph is disconnected (that is, not 
-     * all pairs of vertices are reachable from one another), the
-     * value returned will depend on <code>use_max</code>:  
-     * if <code>use_max == true</code>, the value returned
-     * will be the the maximum shortest path length over all pairs of <b>connected</b> 
-     * vertices; otherwise it will be <code>Double.POSITIVE_INFINITY</code>.
-     */
-    public static <V, E> double diameter(Hypergraph<V,E> g, Distance<V> d, boolean use_max)
-    {
-        double diameter = 0;
-        Collection<V> vertices = g.getVertices();
-        for(V v : vertices) {
-            for(V w : vertices) {
-
-                if (v.equals(w) == false) // don't include self-distances
-                {
-                    Number dist = d.getDistance(v, w);
-                    if (dist == null)
-                    {
-                        if (!use_max)
-                            return Double.POSITIVE_INFINITY;
-                    }
-                    else
-                        diameter = Math.max(diameter, dist.doubleValue());
-                }
-            }
-        }
-        return diameter;
-    }
-    
-    /**
-     * Returns the diameter of <code>g</code> using the metric 
-     * specified by <code>d</code>.  The diameter is defined to be
-     * the maximum, over all pairs of vertices <code>u,v</code>,
-     * of the length of the shortest path from <code>u</code> to 
-     * <code>v</code>, or <code>Double.POSITIVE_INFINITY</code>
-     * if any of these distances do not exist.
-     * @see #diameter(Hypergraph, Distance, boolean)
-     */
-    public static <V, E> double diameter(Hypergraph<V,E> g, Distance<V> d)
-    {
-        return diameter(g, d, false);
-    }
-    
-    /**
-     * Returns the diameter of <code>g</code>, ignoring edge weights.
-     * @see #diameter(Hypergraph, Distance, boolean)
-     */
-    public static <V, E> double diameter(Hypergraph<V,E> g)
-    {
-        return diameter(g, new UnweightedShortestPath<V,E>(g));
-    }
-    
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/MinimumSpanningForest.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/MinimumSpanningForest.java
deleted file mode 100644 (file)
index 18cb0fe..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-package edu.uci.ics.jung.algorithms.shortestpath;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.collections15.Factory;
-import org.apache.commons.collections15.functors.ConstantTransformer;
-import org.apache.commons.collections15.map.LazyMap;
-
-import edu.uci.ics.jung.graph.Forest;
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.util.EdgeType;
-import edu.uci.ics.jung.graph.util.Pair;
-
-/**
- * For the input Graph, creates a MinimumSpanningTree
- * using a variation of Prim's algorithm.
- * 
- * @author Tom Nelson - tomnelson@dev.java.net
- *
- * @param <V>
- * @param <E>
- */
-public class MinimumSpanningForest<V,E> {
-       
-       protected Graph<V,E> graph;
-       protected Forest<V,E> forest;
-       protected Map<E,Double> weights;
-       
-       /**
-        * Creates a Forest from the supplied Graph and supplied Factory, which
-        * is used to create a new, empty Forest. If non-null, the supplied root
-        * will be used as the root of the tree/forest. If the supplied root is
-        * null, or not present in the Graph, then an arbitrary Graph vertex
-        * will be selected as the root.
-        * If the Minimum Spanning Tree does not include all vertices of the
-        * Graph, then a leftover vertex is selected as a root, and another
-        * tree is created.
-        * @param graph the input graph
-        * @param factory the factory to use to create the new forest
-        * @param root the vertex of the graph to be used as the root of the forest 
-        * @param weights edge weights
-        */
-       public MinimumSpanningForest(Graph<V, E> graph, Factory<Forest<V,E>> factory, 
-                       V root, Map<E, Double> weights) {
-               this(graph, factory.create(), root, weights);
-       }
-       
-       /**
-        * Creates a minimum spanning forest from the supplied graph, populating the
-        * supplied Forest, which must be empty. 
-        * If the supplied root is null, or not present in the Graph,
-        * then an arbitrary Graph vertex will be selected as the root.
-        * If the Minimum Spanning Tree does not include all vertices of the
-        * Graph, then a leftover vertex is selected as a root, and another
-        * tree is created
-        * @param graph the Graph to find MST in
-        * @param forest the Forest to populate. Must be empty
-        * @param root first Tree root, may be null
-        * @param weights edge weights, may be null
-        */
-       public MinimumSpanningForest(Graph<V, E> graph, Forest<V,E> forest, 
-                       V root, Map<E, Double> weights) {
-               
-               if(forest.getVertexCount() != 0) {
-                       throw new IllegalArgumentException("Supplied Forest must be empty");
-               }
-               this.graph = graph;
-               this.forest = forest;
-               if(weights != null) {
-                       this.weights = weights;
-               }
-               Set<E> unfinishedEdges = new HashSet<E>(graph.getEdges());
-               if(graph.getVertices().contains(root)) {
-                       this.forest.addVertex(root);
-               }
-               updateForest(forest.getVertices(), unfinishedEdges);
-       }
-       
-    /**
-     * Creates a minimum spanning forest from the supplied graph, populating the
-     * supplied Forest, which must be empty. 
-     * If the supplied root is null, or not present in the Graph,
-     * then an arbitrary Graph vertex will be selected as the root.
-     * If the Minimum Spanning Tree does not include all vertices of the
-     * Graph, then a leftover vertex is selected as a root, and another
-     * tree is created
-     * @param graph the Graph to find MST in
-     * @param forest the Forest to populate. Must be empty
-     * @param root first Tree root, may be null
-     */
-    @SuppressWarnings("unchecked")
-    public MinimumSpanningForest(Graph<V, E> graph, Forest<V,E> forest, 
-            V root) {
-        
-        if(forest.getVertexCount() != 0) {
-            throw new IllegalArgumentException("Supplied Forest must be empty");
-        }
-        this.graph = graph;
-        this.forest = forest;
-        this.weights = LazyMap.decorate(new HashMap<E,Double>(),
-                new ConstantTransformer(1.0));
-        Set<E> unfinishedEdges = new HashSet<E>(graph.getEdges());
-        if(graph.getVertices().contains(root)) {
-            this.forest.addVertex(root);
-        }
-        updateForest(forest.getVertices(), unfinishedEdges);
-    }
-       
-       /**
-        * Returns the generated forest.
-        */
-       public Forest<V,E> getForest() {
-               return forest;
-       }
-       
-       protected void updateForest(Collection<V> tv, Collection<E> unfinishedEdges) {
-               double minCost = Double.MAX_VALUE;
-               E nextEdge = null;
-               V nextVertex = null;
-               V currentVertex = null;
-               for(E e : unfinishedEdges) {
-                       
-                       if(forest.getEdges().contains(e)) continue;
-                       // find the lowest cost edge, get its opposite endpoint,
-                       // and then update forest from its Successors
-                       Pair<V> endpoints = graph.getEndpoints(e);
-                       V first = endpoints.getFirst();
-                       V second = endpoints.getSecond();
-                       if(tv.contains(first) == true && tv.contains(second) == false) {
-                               if(weights.get(e) < minCost) {
-                                       minCost = weights.get(e);
-                                       nextEdge = e;
-                                       currentVertex = first;
-                                       nextVertex = second;
-                               }
-                       }
-                       if(graph.getEdgeType(e) == EdgeType.UNDIRECTED &&
-                                       tv.contains(second) == true && tv.contains(first) == false) {
-                               if(weights.get(e) < minCost) {
-                                       minCost = weights.get(e);
-                                       nextEdge = e;
-                                       currentVertex = second;
-                                       nextVertex = first;
-                               }
-                       }
-               }
-               
-               if(nextVertex != null && nextEdge != null) {
-                       unfinishedEdges.remove(nextEdge);
-                       forest.addEdge(nextEdge, currentVertex, nextVertex);
-                       updateForest(forest.getVertices(), unfinishedEdges);
-               }
-               Collection<V> leftovers = new HashSet<V>(graph.getVertices());
-               leftovers.removeAll(forest.getVertices());
-               if(leftovers.size() > 0) {
-                       V anotherRoot = leftovers.iterator().next();
-                       forest.addVertex(anotherRoot);
-                       updateForest(forest.getVertices(), unfinishedEdges);
-               }
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/MinimumSpanningForest2.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/MinimumSpanningForest2.java
deleted file mode 100644 (file)
index 13e800c..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-package edu.uci.ics.jung.algorithms.shortestpath;
-
-import java.util.Collection;
-import java.util.Set;
-
-import org.apache.commons.collections15.Factory;
-import org.apache.commons.collections15.Transformer;
-import org.apache.commons.collections15.functors.ConstantTransformer;
-
-import edu.uci.ics.jung.algorithms.cluster.WeakComponentClusterer;
-import edu.uci.ics.jung.algorithms.filters.FilterUtils;
-import edu.uci.ics.jung.graph.Forest;
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.Tree;
-import edu.uci.ics.jung.graph.util.TreeUtils;
-
-/**
- * For the input Graph, creates a MinimumSpanningTree
- * using a variation of Prim's algorithm.
- * 
- * @author Tom Nelson - tomnelson@dev.java.net
- *
- * @param <V>
- * @param <E>
- */
-@SuppressWarnings("unchecked")
-public class MinimumSpanningForest2<V,E> {
-       
-       protected Graph<V,E> graph;
-       protected Forest<V,E> forest;
-       protected Transformer<E,Double> weights = 
-               (Transformer<E,Double>)new ConstantTransformer<Double>(1.0);
-       
-       /**
-        * create a Forest from the supplied Graph and supplied Factory, which
-        * is used to create a new, empty Forest. If non-null, the supplied root
-        * will be used as the root of the tree/forest. If the supplied root is
-        * null, or not present in the Graph, then an arbitary Graph vertex
-        * will be selected as the root.
-        * If the Minimum Spanning Tree does not include all vertices of the
-        * Graph, then a leftover vertex is selected as a root, and another
-        * tree is created
-        * @param graph
-        * @param factory
-        * @param weights
-        */
-       public MinimumSpanningForest2(Graph<V, E> graph, 
-                       Factory<Forest<V,E>> factory, 
-                       Factory<? extends Graph<V,E>> treeFactory,
-                       Transformer<E, Double> weights) {
-               this(graph, factory.create(), 
-                               treeFactory, 
-                               weights);
-       }
-       
-       /**
-        * create a forest from the supplied graph, populating the
-        * supplied Forest, which must be empty. 
-        * If the supplied root is null, or not present in the Graph,
-        * then an arbitary Graph vertex will be selected as the root.
-        * If the Minimum Spanning Tree does not include all vertices of the
-        * Graph, then a leftover vertex is selected as a root, and another
-        * tree is created
-        * @param graph the Graph to find MST in
-        * @param forest the Forest to populate. Must be empty
-        * @param weights edge weights, may be null
-        */
-       public MinimumSpanningForest2(Graph<V, E> graph, 
-                       Forest<V,E> forest, 
-                       Factory<? extends Graph<V,E>> treeFactory,
-                       Transformer<E, Double> weights) {
-               
-               if(forest.getVertexCount() != 0) {
-                       throw new IllegalArgumentException("Supplied Forest must be empty");
-               }
-               this.graph = graph;
-               this.forest = forest;
-               if(weights != null) {
-                       this.weights = weights;
-               }
-               
-               WeakComponentClusterer<V,E> wcc =
-                       new WeakComponentClusterer<V,E>();
-               Set<Set<V>> component_vertices = wcc.transform(graph);
-               Collection<Graph<V,E>> components = 
-                       FilterUtils.createAllInducedSubgraphs(component_vertices, graph);
-               
-               for(Graph<V,E> component : components) {
-                       PrimMinimumSpanningTree<V,E> mst = 
-                               new PrimMinimumSpanningTree<V,E>(treeFactory, this.weights);
-                       Graph<V,E> subTree = mst.transform(component);
-                       if(subTree instanceof Tree) {
-                               TreeUtils.addSubTree(forest, (Tree<V,E>)subTree, null, null);
-                       }
-               }
-       }
-       
-       /**
-        * Returns the generated forest.
-        */
-       public Forest<V,E> getForest() {
-               return forest;
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/PrimMinimumSpanningTree.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/PrimMinimumSpanningTree.java
deleted file mode 100644 (file)
index b029dda..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-package edu.uci.ics.jung.algorithms.shortestpath;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.commons.collections15.Factory;
-import org.apache.commons.collections15.Transformer;
-import org.apache.commons.collections15.functors.ConstantTransformer;
-
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.util.Pair;
-
-/**
- * For the input Graph, creates a MinimumSpanningTree
- * using a variation of Prim's algorithm.
- * 
- * @author Tom Nelson - tomnelson@dev.java.net
- *
- * @param <V> the vertex type
- * @param <E> the edge type
- */
-@SuppressWarnings("unchecked")
-public class PrimMinimumSpanningTree<V,E> implements Transformer<Graph<V,E>,Graph<V,E>> {
-       
-       protected Factory<? extends Graph<V,E>> treeFactory;
-       protected Transformer<E,Double> weights; 
-       
-       /**
-        * Creates an instance which generates a minimum spanning tree assuming constant edge weights.
-        */
-       public PrimMinimumSpanningTree(Factory<? extends Graph<V,E>> factory) {
-               this(factory, new ConstantTransformer(1.0));
-       }
-
-    /**
-     * Creates an instance which generates a minimum spanning tree using the input edge weights.
-     */
-       public PrimMinimumSpanningTree(Factory<? extends Graph<V,E>> factory, 
-                       Transformer<E, Double> weights) {
-               this.treeFactory = factory;
-               if(weights != null) {
-                       this.weights = weights;
-               }
-       }
-       
-       /**
-        * @param graph the Graph to find MST in
-        */
-    public Graph<V,E> transform(Graph<V,E> graph) {
-               Set<E> unfinishedEdges = new HashSet<E>(graph.getEdges());
-               Graph<V,E> tree = treeFactory.create();
-               V root = findRoot(graph);
-               if(graph.getVertices().contains(root)) {
-                       tree.addVertex(root);
-               } else if(graph.getVertexCount() > 0) {
-                       // pick an arbitrary vertex to make root
-                       tree.addVertex(graph.getVertices().iterator().next());
-               }
-               updateTree(tree, graph, unfinishedEdges);
-               
-               return tree;
-       }
-    
-    protected V findRoot(Graph<V,E> graph) {
-       for(V v : graph.getVertices()) {
-               if(graph.getInEdges(v).size() == 0) {
-                       return v;
-               }
-       }
-       // if there is no obvious root, pick any vertex
-       if(graph.getVertexCount() > 0) {
-               return graph.getVertices().iterator().next();
-       }
-       // this graph has no vertices
-       return null;
-    }
-       
-       protected void updateTree(Graph<V,E> tree, Graph<V,E> graph, Collection<E> unfinishedEdges) {
-               Collection<V> tv = tree.getVertices();
-               double minCost = Double.MAX_VALUE;
-               E nextEdge = null;
-               V nextVertex = null;
-               V currentVertex = null;
-               for(E e : unfinishedEdges) {
-                       
-                       if(tree.getEdges().contains(e)) continue;
-                       // find the lowest cost edge, get its opposite endpoint,
-                       // and then update forest from its Successors
-                       Pair<V> endpoints = graph.getEndpoints(e);
-                       V first = endpoints.getFirst();
-                       V second = endpoints.getSecond();
-                       if((tv.contains(first) == true && tv.contains(second) == false)) {
-                               if(weights.transform(e) < minCost) {
-                                       minCost = weights.transform(e);
-                                       nextEdge = e;
-                                       currentVertex = first;
-                                       nextVertex = second;
-                               }
-                       } else if((tv.contains(second) == true && tv.contains(first) == false)) {
-                               if(weights.transform(e) < minCost) {
-                                       minCost = weights.transform(e);
-                                       nextEdge = e;
-                                       currentVertex = second;
-                                       nextVertex = first;
-                               }
-                       }
-               }
-               
-               if(nextVertex != null && nextEdge != null) {
-                       unfinishedEdges.remove(nextEdge);
-                       tree.addEdge(nextEdge, currentVertex, nextVertex);
-                       updateTree(tree, graph, unfinishedEdges);
-               }
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/ShortestPath.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/ShortestPath.java
deleted file mode 100644 (file)
index a922cdd..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-* 
-* Created on Feb 12, 2004
-*/
-package edu.uci.ics.jung.algorithms.shortestpath;
-
-import java.util.Map;
-
-
-/**
- * An interface for algorithms that calculate shortest paths.
- */
-public interface ShortestPath<V, E>
-{
-    /**
-     * <p>Returns a <code>Map</code> which maps each vertex 
-     * in the graph (including the <code>source</code> vertex) 
-     * to the last edge on the shortest path from the 
-     * <code>source</code> vertex.
-     */ 
-     Map<V,E> getIncomingEdgeMap(V source);
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/ShortestPathUtils.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/ShortestPathUtils.java
deleted file mode 100644 (file)
index d3e59eb..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Created on Jul 10, 2005
- *
- * Copyright (c) 2005, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.shortestpath;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.util.Pair;
-
-/**
- * Utilities relating to the shortest paths in a graph.
- */
-public class ShortestPathUtils
-{
-    /**
-     * Returns a <code>List</code> of the edges on the shortest path from 
-     * <code>source</code> to <code>target</code>, in order of their
-     * occurrence on this path.  
-     */
-    public static <V, E> List<E> getPath(Graph<V,E> graph, ShortestPath<V,E> sp, V source, V target)
-    {
-        LinkedList<E> path = new LinkedList<E>();
-        
-        Map<V,E> incomingEdges = sp.getIncomingEdgeMap(source);
-        
-        if (incomingEdges.isEmpty() || incomingEdges.get(target) == null)
-            return path;
-        V current = target;
-        while (!current.equals(source))
-        {
-            E incoming = incomingEdges.get(current);
-            path.addFirst(incoming);
-            Pair<V> endpoints = graph.getEndpoints(incoming);
-            if(endpoints.getFirst().equals(current)) { 
-               current = endpoints.getSecond();
-            } else {
-               current = endpoints.getFirst();
-            }
-                       //incoming.getOpposite(current);
-        }
-        return path;
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/UnweightedShortestPath.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/UnweightedShortestPath.java
deleted file mode 100644 (file)
index 1d3390c..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.shortestpath;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import edu.uci.ics.jung.graph.Hypergraph;
-
-/**
- * Computes the shortest path distances for graphs whose edges are not weighted (using BFS).
- * 
- * @author Scott White
- */
-public class UnweightedShortestPath<V, E> 
-    implements ShortestPath<V,E>, Distance<V>
-{
-       private Map<V,Map<V,Number>> mDistanceMap;
-       private Map<V,Map<V,E>> mIncomingEdgeMap;
-       private Hypergraph<V,E> mGraph;
-    private Map<V, Number> distances = new HashMap<V,Number>();
-
-       /**
-        * Constructs and initializes algorithm
-        * @param g the graph
-        */
-       public UnweightedShortestPath(Hypergraph<V,E> g)
-       {
-               mDistanceMap = new HashMap<V,Map<V,Number>>();
-               mIncomingEdgeMap = new HashMap<V,Map<V,E>>();
-               mGraph = g;
-       }
-
-    /**
-     * @see edu.uci.ics.jung.algorithms.shortestpath.Distance#getDistance(Object, Object)
-     */
-       public Number getDistance(V source, V target)
-       {
-               Map<V, Number> sourceSPMap = getDistanceMap(source);
-               return sourceSPMap.get(target);
-       }
-
-    /**
-     * @see edu.uci.ics.jung.algorithms.shortestpath.Distance#getDistanceMap(Object)
-     */
-       public Map<V,Number> getDistanceMap(V source)
-       {
-               Map<V,Number> sourceSPMap = mDistanceMap.get(source);
-               if (sourceSPMap == null)
-               {
-                       computeShortestPathsFromSource(source);
-                       sourceSPMap = mDistanceMap.get(source);
-               }
-               return sourceSPMap;
-       }
-
-       /**
-        * @see edu.uci.ics.jung.algorithms.shortestpath.ShortestPath#getIncomingEdgeMap(Object)
-        */
-       public Map<V,E> getIncomingEdgeMap(V source)
-       {
-               Map<V,E> sourceIEMap = mIncomingEdgeMap.get(source);
-               if (sourceIEMap == null)
-               {
-                       computeShortestPathsFromSource(source);
-                       sourceIEMap = mIncomingEdgeMap.get(source);
-               }
-               return sourceIEMap;
-       }
-
-
-       /**
-        * Computes the shortest path distances from a given node to all other nodes.
-        * @param source the source node
-        */
-       private void computeShortestPathsFromSource(V source)
-       {
-               BFSDistanceLabeler<V,E> labeler = new BFSDistanceLabeler<V,E>();
-               labeler.labelDistances(mGraph, source);
-        distances = labeler.getDistanceDecorator();
-               Map<V,Number> currentSourceSPMap = new HashMap<V,Number>();
-               Map<V,E> currentSourceEdgeMap = new HashMap<V,E>();
-
-        for(V vertex : mGraph.getVertices()) {
-            
-                       Number distanceVal = distances.get(vertex);
-            // BFSDistanceLabeler uses -1 to indicate unreachable vertices;
-            // don't bother to store unreachable vertices
-            if (distanceVal != null && distanceVal.intValue() >= 0) 
-            {
-                currentSourceSPMap.put(vertex, distanceVal);
-                int minDistance = distanceVal.intValue();
-                for(E incomingEdge : mGraph.getInEdges(vertex)) 
-                {
-                       for (V neighbor : mGraph.getIncidentVertices(incomingEdge))
-                       {
-                               if (neighbor.equals(vertex))
-                                       continue;
-//                         V neighbor = mGraph.getOpposite(vertex, incomingEdge);
-       
-                           Number predDistanceVal = distances.get(neighbor);
-       
-                           int pred_distance = predDistanceVal.intValue();
-                           if (pred_distance < minDistance && pred_distance >= 0)
-                           {
-                               minDistance = predDistanceVal.intValue();
-                               currentSourceEdgeMap.put(vertex, incomingEdge);
-                           }
-                       }
-                }
-            }
-               }
-               mDistanceMap.put(source, currentSourceSPMap);
-               mIncomingEdgeMap.put(source, currentSourceEdgeMap);
-       }
-    
-    /**
-     * Clears all stored distances for this instance.  
-     * Should be called whenever the graph is modified (edge weights 
-     * changed or edges added/removed).  If the user knows that
-     * some currently calculated distances are unaffected by a
-     * change, <code>reset(V)</code> may be appropriate instead.
-     * 
-     * @see #reset(Object)
-     */
-    public void reset()
-    {
-        mDistanceMap.clear();
-        mIncomingEdgeMap.clear();
-    }
-    
-    /**
-     * Clears all stored distances for the specified source vertex 
-     * <code>source</code>.  Should be called whenever the stored distances
-     * from this vertex are invalidated by changes to the graph.
-     * 
-     * @see #reset()
-     */
-    public void reset(V v)
-    {
-        mDistanceMap.remove(v);
-        mIncomingEdgeMap.remove(v);
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/package.html b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/shortestpath/package.html
deleted file mode 100644 (file)
index 01f27b5..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-  @(#)package.html
-
- Copyright © 2003 The Regents of the University of California. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies. This software program and documentation are copyrighted by The Regents of the University of California ("The University of California").
-
-THE SOFTWARE PROGRAM AND DOCUMENTATION ARE SUPPLIED "AS IS," WITHOUT ANY ACCOMPANYING SERVICES FROM THE UNIVERSITY OF CALFORNIA. FURTHERMORE, THE UNIVERSITY OF CALIFORNIA DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED OR ERROR-FREE. THE END-USER UNDERSTANDS THAT THE PROGRAM WAS DEVELOPED FOR RESEARCH PURPOSES AND IS ADVISED NOT TO RELY EXCLUSIVELY ON THE PROGRAM FOR ANY REASON.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
--->
-</head>
-<body>
-
-Provides interfaces and classes for calculating (geodesic) distances and shortest paths.  Currently includes:
-<ul>
-<li/><code>DijkstraDistance</code>: finds the distances from a specified source vertex to other vertices in a 
-weighted graph with no negative cycles
-<li/><code>DijkstraShortestPath</code>: extends <code>DijkstraDistance</code>, also finds shortest paths
-<li/><code>Distance</code>: an interface for defining vertex-vertex distances
-<li/><code>PrimMinimumSpanningTree</code>: identifies the spanning tree for a graph of least total edge weight
-<li/><code>ShortestPath</code>: an interface for shortest-path algorithms
-<li/><code>ShortestPathUtils</code>: utility functions for manipulating shortest paths
-<li/><code>UnweightedShortestPath</code>: finds the distances from a specified source vertex to other vertices in an
-unweighted graph
-</ul>
-
-</body>
-</html>
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/transformation/DirectionTransformer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/transformation/DirectionTransformer.java
deleted file mode 100644 (file)
index 8fa33b8..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-/*
- * Created on Apr 21, 2004
- */
-package edu.uci.ics.jung.algorithms.transformation;
-
-import org.apache.commons.collections15.Factory;
-
-import edu.uci.ics.jung.graph.DirectedGraph;
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.UndirectedGraph;
-import edu.uci.ics.jung.graph.util.EdgeType;
-import edu.uci.ics.jung.graph.util.Pair;
-
-/**
- * <p>Functions for transforming graphs into directed or undirected graphs.</p>
- * 
- * 
- * @author Danyel Fisher
- * @author Joshua O'Madadhain
- */
-public class DirectionTransformer 
-{
-
-    /**
-     * Transforms <code>graph</code> (which may be of any directionality)
-     * into an undirected graph. (This may be useful for
-     * visualization tasks).
-     * Specifically:
-     * <ul>
-     * <li/>Vertices are copied from <code>graph</code>.
-     * <li/>Directed edges are 'converted' into a single new undirected edge in the new graph.
-     * <li/>Each undirected edge (if any) in <code>graph</code> is 'recreated' with a new undirected edge in the new
-     * graph if <code>create_new</code> is true, or copied from <code>graph</code> otherwise.
-     * </ul>
-     * 
-     * @param graph     the graph to be transformed
-     * @param create_new specifies whether existing undirected edges are to be copied or recreated
-     * @param graph_factory used to create the new graph object
-     * @param edge_factory used to create new edges
-     * @return          the transformed <code>Graph</code>
-     */
-    public static <V,E> UndirectedGraph<V,E> toUndirected(Graph<V,E> graph, 
-               Factory<UndirectedGraph<V,E>> graph_factory,
-            Factory<E> edge_factory, boolean create_new)
-    {
-        UndirectedGraph<V,E> out = graph_factory.create();
-        
-        for (V v : graph.getVertices())
-            out.addVertex(v);
-        
-        for (E e : graph.getEdges())
-        {
-            Pair<V> endpoints = graph.getEndpoints(e);
-            V v1 = endpoints.getFirst();
-            V v2 = endpoints.getSecond();
-            E to_add;
-            if (graph.getEdgeType(e) == EdgeType.DIRECTED || create_new)
-                to_add = edge_factory.create();
-            else
-                to_add = e;
-            out.addEdge(to_add, v1, v2, EdgeType.UNDIRECTED);
-        }
-        return out;
-    }
-    
-    /**
-     * Transforms <code>graph</code> (which may be of any directionality)
-     * into a directed graph.  
-     * Specifically:
-     * <ul>
-     * <li/>Vertices are copied from <code>graph</code>.
-     * <li/>Undirected edges are 'converted' into two new antiparallel directed edges in the new graph.
-     * <li/>Each directed edge (if any) in <code>graph</code> is 'recreated' with a new edge in the new
-     * graph if <code>create_new</code> is true, or copied from <code>graph</code> otherwise.
-     * </ul>
-     * 
-     * @param graph     the graph to be transformed
-     * @param create_new specifies whether existing directed edges are to be copied or recreated
-     * @param graph_factory used to create the new graph object
-     * @param edge_factory used to create new edges
-     * @return          the transformed <code>Graph</code>
-     */
-    public static <V,E> Graph<V,E> toDirected(Graph<V,E> graph, Factory<DirectedGraph<V,E>> graph_factory,
-            Factory<E> edge_factory, boolean create_new)
-    {
-        DirectedGraph<V,E> out = graph_factory.create();
-        
-        for (V v : graph.getVertices())
-            out.addVertex(v);
-        
-        for (E e : graph.getEdges())
-        {
-            Pair<V> endpoints = graph.getEndpoints(e);
-            if (graph.getEdgeType(e) == EdgeType.UNDIRECTED)
-            {
-                V v1 = endpoints.getFirst();
-                V v2 = endpoints.getSecond();
-                out.addEdge(edge_factory.create(), v1, v2, EdgeType.DIRECTED);
-                out.addEdge(edge_factory.create(), v2, v1, EdgeType.DIRECTED);
-            }
-            else // if the edge is directed, just add it 
-            {
-                V source = graph.getSource(e);
-                V dest = graph.getDest(e);
-                E to_add = create_new ? edge_factory.create() : e;
-                out.addEdge(to_add, source, dest, EdgeType.DIRECTED);
-            }
-                
-        }
-        return out;
-    }
-}
\ No newline at end of file
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/transformation/FoldingTransformer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/transformation/FoldingTransformer.java
deleted file mode 100644 (file)
index 2193319..0000000
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-/*
- * Created on Apr 21, 2004
- */
-package edu.uci.ics.jung.algorithms.transformation;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.apache.commons.collections15.Factory;
-import org.apache.commons.collections15.Predicate;
-
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.Hypergraph;
-import edu.uci.ics.jung.graph.KPartiteGraph;
-
-/**
- * Methods for creating a "folded" graph based on a k-partite graph or a
- * hypergraph.  
- * 
- * <p>A "folded" graph is derived from a k-partite graph by identifying
- * a partition of vertices which will become the vertices of the new graph, copying
- * these vertices into the new graph, and then connecting those vertices whose
- * original analogues were connected indirectly through elements
- * of other partitions.</p>
- * 
- * <p>A "folded" graph is derived from a hypergraph by creating vertices based on
- * either the vertices or the hyperedges of the original graph, and connecting 
- * vertices in the new graph if their corresponding vertices/hyperedges share a 
- * connection with a common hyperedge/vertex.</p>   
- * 
- * @author Danyel Fisher
- * @author Joshua O'Madadhain
- */
-public class FoldingTransformer<V,E>
-{
-    
-    /**
-     * Converts <code>g</code> into a unipartite graph whose vertex set is the
-     * vertices of <code>g</code>'s partition <code>p</code>.  For vertices
-     * <code>a</code> and <code>b</code> in this partition, the resultant
-     * graph will include the edge <code>(a,b)</code> if the original graph
-     * contains edges <code>(a,c)</code> and <code>(c,b)</code> for at least
-     * one vertex <code>c</code>.
-     * 
-     * <p>The vertices of the new graph are the same as the vertices of the
-     * appropriate partition in the old graph; the edges in the new graph are
-     * created by the input edge <code>Factory</code>.</p>
-     * 
-     * <p>If there is more than 1 such vertex <code>c</code> for a given pair
-     * <code>(a,b)</code>, the type of the output graph will determine whether
-     * it will contain parallel edges or not.</p>
-     * 
-     * <p>This function will not create self-loops.</p>
-     * 
-     * @param <V> vertex type
-     * @param <E> input edge type
-     * @param g input k-partite graph
-     * @param p predicate specifying vertex partition
-     * @param graph_factory factory used to create the output graph 
-     * @param edge_factory factory used to create the edges in the new graph
-     * @return a copy of the input graph folded with respect to the input partition
-     */
-    public static <V,E> Graph<V,E> foldKPartiteGraph(KPartiteGraph<V,E> g, Predicate<V> p, 
-            Factory<Graph<V,E>> graph_factory, Factory<E> edge_factory)
-    {
-        Graph<V,E> newGraph = graph_factory.create();
-
-        // get vertices for the specified partition
-        Collection<V> vertices = g.getVertices(p);
-        for (V v : vertices)
-        {
-            newGraph.addVertex(v);
-            for (V s : g.getSuccessors(v))
-            {
-                for (V t : g.getSuccessors(s))
-                {
-                    if (!vertices.contains(t) || t.equals(v)) 
-                        continue;
-                    newGraph.addVertex(t);
-                    newGraph.addEdge(edge_factory.create(), v, t);
-                }
-            }
-        }
-        return newGraph;
-    }
-
-    /**
-     * Converts <code>g</code> into a unipartite graph whose vertices are the
-     * vertices of <code>g</code>'s partition <code>p</code>, and whose edges
-     * consist of collections of the intermediate vertices from other partitions.  
-     * For vertices
-     * <code>a</code> and <code>b</code> in this partition, the resultant
-     * graph will include the edge <code>(a,b)</code> if the original graph
-     * contains edges <code>(a,c)</code> and <code>(c,b)</code> for at least
-     * one vertex <code>c</code>.
-     * 
-     * <p>The vertices of the new graph are the same as the vertices of the
-     * appropriate partition in the old graph; the edges in the new graph are
-     * collections of the intermediate vertices <code>c</code>.</p>
-     * 
-     * <p>This function will not create self-loops.</p>
-     * 
-     * @param <V> vertex type
-     * @param <E> input edge type
-     * @param g input k-partite graph
-     * @param p predicate specifying vertex partition
-     * @param graph_factory factory used to create the output graph 
-     * @return the result of folding g into unipartite graph whose vertices
-     * are those of the <code>p</code> partition of g
-     */
-    public static <V,E> Graph<V, Collection<V>> foldKPartiteGraph(KPartiteGraph<V,E> g, Predicate<V> p, 
-            Factory<Graph<V, Collection<V>>> graph_factory)
-    {
-        Graph<V, Collection<V>> newGraph = graph_factory.create();
-
-        // get vertices for the specified partition, copy into new graph
-        Collection<V> vertices = g.getVertices(p);
-
-        for (V v : vertices)
-        {
-            newGraph.addVertex(v);
-            for (V s : g.getSuccessors(v))
-            {
-                for (V t : g.getSuccessors(s))
-                {
-                    if (!vertices.contains(t) || t.equals(v)) 
-                        continue;
-                    newGraph.addVertex(t);
-                    Collection<V> v_coll = newGraph.findEdge(v, t);
-                    if (v_coll == null)
-                    {
-                        v_coll = new ArrayList<V>();
-                        newGraph.addEdge(v_coll, v, t);
-                    }
-                    v_coll.add(s);
-                }
-            }
-        }
-        return newGraph;
-    }
-    
-    /**
-     * Creates a <code>Graph</code> which is an edge-folded version of <code>h</code>, where
-     * hyperedges are replaced by k-cliques in the output graph.
-     * 
-     * <p>The vertices of the new graph are the same objects as the vertices of 
-     * <code>h</code>, and <code>a</code> 
-     * is connected to <code>b</code> in the new graph if the corresponding vertices
-     * in <code>h</code> are connected by a hyperedge.  Thus, each hyperedge with 
-     * <i>k</i> vertices in <code>h</code> induces a <i>k</i>-clique in the new graph.</p>
-     * 
-     * <p>The edges of the new graph consist of collections of each hyperedge that connected
-     * the corresponding vertex pair in the original graph.</p>
-     * 
-     * @param <V> vertex type
-     * @param <E> input edge type
-     * @param h hypergraph to be folded
-     * @param graph_factory factory used to generate the output graph
-     * @return a copy of the input graph where hyperedges are replaced by cliques
-     */
-    public static <V,E> Graph<V, Collection<E>> foldHypergraphEdges(Hypergraph<V,E> h, 
-            Factory<Graph<V, Collection<E>>> graph_factory)
-    {
-        Graph<V, Collection<E>> target = graph_factory.create();
-
-        for (V v : h.getVertices())
-            target.addVertex(v);
-        
-        for (E e : h.getEdges())
-        {
-            ArrayList<V> incident = new ArrayList<V>(h.getIncidentVertices(e));
-            populateTarget(target, e, incident);
-        }
-        return target;
-    }
-
-
-    /**
-     * Creates a <code>Graph</code> which is an edge-folded version of <code>h</code>, where
-     * hyperedges are replaced by k-cliques in the output graph.
-     * 
-     * <p>The vertices of the new graph are the same objects as the vertices of 
-     * <code>h</code>, and <code>a</code> 
-     * is connected to <code>b</code> in the new graph if the corresponding vertices
-     * in <code>h</code> are connected by a hyperedge.  Thus, each hyperedge with 
-     * <i>k</i> vertices in <code>h</code> induces a <i>k</i>-clique in the new graph.</p>
-     * 
-     * <p>The edges of the new graph are generated by the specified edge factory.</p>
-     * 
-     * @param <V> vertex type
-     * @param <E> input edge type
-     * @param h hypergraph to be folded
-     * @param graph_factory factory used to generate the output graph
-     * @param edge_factory factory used to create the new edges 
-     * @return a copy of the input graph where hyperedges are replaced by cliques
-     */
-    public static <V,E> Graph<V,E> foldHypergraphEdges(Hypergraph<V,E> h, 
-            Factory<Graph<V,E>> graph_factory, Factory<E> edge_factory)
-    {
-        Graph<V,E> target = graph_factory.create();
-
-        for (V v : h.getVertices())
-            target.addVertex(v);
-        
-        for (E e : h.getEdges())
-        {
-            ArrayList<V> incident = new ArrayList<V>(h.getIncidentVertices(e));
-            for (int i = 0; i < incident.size(); i++)
-                for (int j = i+1; j < incident.size(); j++)
-                    target.addEdge(edge_factory.create(), incident.get(i), incident.get(j));
-        }
-        return target;
-    }
-
-    /**
-     * Creates a <code>Graph</code> which is a vertex-folded version of <code>h</code>, whose
-     * vertices are the input's hyperedges and whose edges are induced by adjacent hyperedges
-     * in the input.
-     * 
-     * <p>The vertices of the new graph are the same objects as the hyperedges of 
-     * <code>h</code>, and <code>a</code> 
-     * is connected to <code>b</code> in the new graph if the corresponding edges
-     * in <code>h</code> have a vertex in common.  Thus, each vertex incident to  
-     * <i>k</i> edges in <code>h</code> induces a <i>k</i>-clique in the new graph.</p>
-     * 
-     * <p>The edges of the new graph are created by the specified factory.</p>
-     * 
-     * @param <V> vertex type
-     * @param <E> input edge type
-     * @param <F> output edge type
-     * @param h hypergraph to be folded
-     * @param graph_factory factory used to generate the output graph
-     * @param edge_factory factory used to generate the output edges
-     * @return a transformation of the input graph whose vertices correspond to the input's hyperedges 
-     * and edges are induced by hyperedges sharing vertices in the input
-     */
-    public static <V,E,F> Graph<E,F> foldHypergraphVertices(Hypergraph<V,E> h, 
-            Factory<Graph<E,F>> graph_factory, Factory<F> edge_factory)
-    {
-        Graph<E,F> target = graph_factory.create();
-        
-        for (E e : h.getEdges())
-            target.addVertex(e);
-        
-        for (V v : h.getVertices())
-        {
-            ArrayList<E> incident = new ArrayList<E>(h.getIncidentEdges(v));
-            for (int i = 0; i < incident.size(); i++)
-                for (int j = i+1; j < incident.size(); j++)
-                    target.addEdge(edge_factory.create(), incident.get(i), incident.get(j));
-        }
-        
-        return target;
-    }
-
-    /**
-     * Creates a <code>Graph</code> which is a vertex-folded version of <code>h</code>, whose
-     * vertices are the input's hyperedges and whose edges are induced by adjacent hyperedges
-     * in the input.
-     * 
-     * <p>The vertices of the new graph are the same objects as the hyperedges of 
-     * <code>h</code>, and <code>a</code> 
-     * is connected to <code>b</code> in the new graph if the corresponding edges
-     * in <code>h</code> have a vertex in common.  Thus, each vertex incident to  
-     * <i>k</i> edges in <code>h</code> induces a <i>k</i>-clique in the new graph.</p>
-     * 
-     * <p>The edges of the new graph consist of collections of each vertex incident to 
-     * the corresponding hyperedge pair in the original graph.</p>
-     * 
-     * @param h hypergraph to be folded
-     * @param graph_factory factory used to generate the output graph
-     * @return a transformation of the input graph whose vertices correspond to the input's hyperedges 
-     * and edges are induced by hyperedges sharing vertices in the input
-     */
-    public Graph<E,Collection<V>> foldHypergraphVertices(Hypergraph<V,E> h, 
-            Factory<Graph<E,Collection<V>>> graph_factory)
-    {
-        Graph<E,Collection<V>> target = graph_factory.create();
-
-        for (E e : h.getEdges())
-            target.addVertex(e);
-        
-        for (V v : h.getVertices())
-        {
-            ArrayList<E> incident = new ArrayList<E>(h.getIncidentEdges(v));
-            populateTarget(target, v, incident);
-        }
-        return target;
-    }
-    
-    /**
-     * @param target
-     * @param e
-     * @param incident
-     */
-    private static <S,T> void populateTarget(Graph<S, Collection<T>> target, T e,
-            ArrayList<S> incident)
-    {
-        for (int i = 0; i < incident.size(); i++)
-        {
-            S v1 = incident.get(i);
-            for (int j = i+1; j < incident.size(); j++)
-            {
-                S v2 = incident.get(j);
-                Collection<T> e_coll = target.findEdge(v1, v2);
-                if (e_coll == null)
-                {
-                    e_coll = new ArrayList<T>();
-                    target.addEdge(e_coll, v1, v2);
-                }
-                e_coll.add(e);
-            }
-        }
-    }
-
-}
\ No newline at end of file
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/transformation/VertexPartitionCollapser.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/transformation/VertexPartitionCollapser.java
deleted file mode 100644 (file)
index e44d05d..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.transformation;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.collections15.Factory;
-import org.apache.commons.collections15.Transformer;
-import org.apache.commons.collections15.functors.MapTransformer;
-
-import edu.uci.ics.jung.algorithms.blockmodel.VertexPartition;
-import edu.uci.ics.jung.graph.Graph;
-
-/**
- * This class transforms a graph with a known vertex partitioning into a graph whose 
- * vertices correspond to the input graph's partitions.  Two vertices in the output graph
- * are connected if and only if there exists at least one edge between vertices in the 
- * corresponding partitions of the input graph.  If the output graph permits parallel edges,
- * there will be an edge connecting two vertices in the new graph for each such 
- * edge connecting constituent vertices in the input graph.
- * 
- * <p>Concept based on Danyel Fisher's <code>GraphCollapser</code> in JUNG 1.x.
- * 
- */
-public class VertexPartitionCollapser<V,E,CV,CE> 
-{
-    protected Factory<Graph<CV,CE>> graph_factory;
-    protected Factory<CV> vertex_factory;
-    protected Factory<CE> edge_factory;
-    protected Map<Set<V>, CV> set_collapsedv;
-    
-    /**
-     * Creates an instance with the specified graph and element factories.
-     * @param vertex_factory used to construct the vertices of the new graph
-     * @param edge_factory used to construct the edges of the new graph
-     * @param graph_factory used to construct the new graph
-     */
-    public VertexPartitionCollapser(Factory<Graph<CV,CE>> graph_factory, 
-            Factory<CV> vertex_factory, Factory<CE> edge_factory)
-    {
-        this.graph_factory = graph_factory;
-        this.vertex_factory = vertex_factory;
-        this.edge_factory = edge_factory;
-        this.set_collapsedv = new HashMap<Set<V>, CV>();
-    }
-
-    /**
-     * Creates a new graph whose vertices correspond to the partitions of the supplied graph.
-     * @param partitioning
-     * @return a new graph whose vertices correspond to the partitions of the supplied graph
-     */
-    public Graph<CV,CE> collapseVertexPartitions(VertexPartition<V,E> partitioning)
-    {
-        Graph<V,E> original = partitioning.getGraph();
-        Graph<CV, CE> collapsed = graph_factory.create();
-        
-        // create vertices in new graph corresponding to equivalence sets in the original graph
-        for (Set<V> set : partitioning.getVertexPartitions())
-        {
-            CV cv = vertex_factory.create();
-            collapsed.addVertex(vertex_factory.create());
-            set_collapsedv.put(set, cv);
-        }
-
-        // create edges in new graph corresponding to edges in original graph
-        for (E e : original.getEdges())
-        {
-            Collection<V> incident = original.getIncidentVertices(e);
-            Collection<CV> collapsed_vertices = new HashSet<CV>();
-            Map<V, Set<V>> vertex_partitions = partitioning.getVertexToPartitionMap();
-            // collect the collapsed vertices corresponding to the original incident vertices
-            for (V v : incident)
-                collapsed_vertices.add(set_collapsedv.get(vertex_partitions.get(v))); 
-            // if there's only one collapsed vertex, continue (no edges to create)
-            if (collapsed_vertices.size() > 1)
-            {
-                CE ce = edge_factory.create();
-                collapsed.addEdge(ce, collapsed_vertices);
-            }
-        }
-        return collapsed;
-    }
-    
-    /**
-     * Returns a transformer from vertex sets in the original graph to collapsed vertices
-     * in the transformed graph.
-     */
-    public Transformer<Set<V>, CV> getSetToCollapsedVertexTransformer()
-    {
-        return MapTransformer.getInstance(set_collapsedv);
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/transformation/package.html b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/transformation/package.html
deleted file mode 100644 (file)
index 6680095..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-  @(#)package.html
-
- Copyright © 2003 The Regents of the University of California. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies. This software program and documentation are copyrighted by The Regents of the University of California ("The University of California").
-
-THE SOFTWARE PROGRAM AND DOCUMENTATION ARE SUPPLIED "AS IS," WITHOUT ANY ACCOMPANYING SERVICES FROM THE UNIVERSITY OF CALFORNIA. FURTHERMORE, THE UNIVERSITY OF CALIFORNIA DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED OR ERROR-FREE. THE END-USER UNDERSTANDS THAT THE PROGRAM WAS DEVELOPED FOR RESEARCH PURPOSES AND IS ADVISED NOT TO RELY EXCLUSIVELY ON THE PROGRAM FOR ANY REASON.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
--->
-</head>
-<body>
-
-Mechanisms for graph transformation.  These currently include:
-<ul>
-<li/><code>DirectionTransformer</code>: generates graphs where input undirected 
-edges have been converted to directed edges, or vice versa
-<li/><code>FoldingTransformer</code>: transforms k-partite graphs or hypergraphs 
-into unipartite graphs
-<li/><code>VertexPartitionCollapser</code>: transforms a graph, given a 
-partition of its vertices into disjoint sets, into a graph in which each 
-of these disjoint sets has been 'collapsed' into a single new vertex.
-</ul>
-
-</body>
-</html>
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/BasicMapEntry.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/BasicMapEntry.java
deleted file mode 100644 (file)
index a82aea6..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-package edu.uci.ics.jung.algorithms.util;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * An simple minimal implementation of <code>Map.Entry</code>.
- *
- * @param <K> the key type
- * @param <V> the value type
- */
-public class BasicMapEntry<K,V> implements Map.Entry<K,V> {
-    final K key;
-    V value;
-    
-    /**
-     * Create new entry.
-     */
-    public BasicMapEntry(K k, V v) {
-        value = v;
-        key = k;
-    }
-
-    public K getKey() {
-        return key;
-    }
-
-    public V getValue() {
-        return value;
-    }
-
-    public V setValue(V newValue) {
-    V oldValue = value;
-        value = newValue;
-        return oldValue;
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public boolean equals(Object o) {
-        if (!(o instanceof Map.Entry))
-            return false;
-        Map.Entry e = (Map.Entry)o;
-        Object k1 = getKey();
-        Object k2 = e.getKey();
-        if (k1 == k2 || (k1 != null && k1.equals(k2))) {
-            Object v1 = getValue();
-            Object v2 = e.getValue();
-            if (v1 == v2 || (v1 != null && v1.equals(v2))) 
-                return true;
-        }
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        return (key==null ? 0 : key.hashCode()) ^
-               (value==null   ? 0 : value.hashCode());
-    }
-
-    @Override
-    public String toString() {
-        return getKey() + "=" + getValue();
-    }
-
-    /**
-     * This method is invoked whenever the value in an entry is
-     * overwritten by an invocation of put(k,v) for a key k that's already
-     * in the HashMap.
-     */
-    void recordAccess(HashMap<K,V> m) {
-    }
-
-    /**
-     * This method is invoked whenever the entry is
-     * removed from the table.
-     */
-    void recordRemoval(HashMap<K,V> m) {
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/ConstantMap.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/ConstantMap.java
deleted file mode 100644 (file)
index 53054d7..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-
-package edu.uci.ics.jung.algorithms.util;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * An implementation of <code>Map</code> that returns the constructor-supplied
- * value for any input.
- *
- * @param <K> the key type
- * @param <V> the value type
- */
-public class ConstantMap<K,V> implements Map<K,V> {
-
-       private Map<K,V> delegate;
-       
-       /**
-        * Creates an instance whose {@code get} method always returns {@code value}.
-        */
-       public ConstantMap(V value) {
-               delegate = Collections.<K,V>unmodifiableMap(Collections.<K,V>singletonMap(null, value));
-       }
-
-       public V get(Object key) {
-               return delegate.get(null);
-       }
-       
-       public void clear() {
-               delegate.clear();
-       }
-       
-       public boolean containsKey(Object key) {
-               return true;
-       }
-       
-       public boolean containsValue(Object value) {
-               return delegate.containsValue(value);
-       }
-       
-       public Set<Entry<K, V>> entrySet() {
-               return delegate.entrySet();
-       }
-       
-       @Override
-       public boolean equals(Object o) {
-               return delegate.equals(o);
-       }
-       
-       @Override
-       public int hashCode() {
-               return delegate.hashCode();
-       }
-       
-       public boolean isEmpty() {
-               return delegate.isEmpty();
-       }
-       
-       public Set<K> keySet() {
-               return delegate.keySet();
-       }
-       
-       public V put(K key, V value) {
-               return delegate.put(key, value);
-       }
-       
-       public void putAll(Map<? extends K, ? extends V> t) {
-               delegate.putAll(t);
-       }
-       
-       public V remove(Object key) {
-               return delegate.remove(key);
-       }
-       
-       public int size() {
-               return delegate.size();
-       }
-       
-       public Collection<V> values() {
-               return delegate.values();
-       }
-}
\ No newline at end of file
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/DiscreteDistribution.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/DiscreteDistribution.java
deleted file mode 100644 (file)
index 84eadc0..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- * 
- * Created on Feb 18, 2004
- */
-package edu.uci.ics.jung.algorithms.util;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * A utility class for calculating properties of discrete distributions.
- * Generally, these distributions are represented as arrays of 
- * <code>double</code> values, which are assumed to be normalized
- * such that the entries in a single array sum to 1.  
- * 
- * @author Joshua O'Madadhain
- */
-public class DiscreteDistribution
-{
-
-    /**
-     * Returns the Kullback-Leibler divergence between the 
-     * two specified distributions, which must have the same
-     * number of elements.  This is defined as 
-     * the sum over all <code>i</code> of 
-     * <code>dist[i] * Math.log(dist[i] / reference[i])</code>.
-     * Note that this value is not symmetric; see 
-     * <code>symmetricKL</code> for a symmetric variant. 
-     * @see #symmetricKL(double[], double[])
-     */
-    public static double KullbackLeibler(double[] dist, double[] reference)
-    {
-        double distance = 0;
-
-        checkLengths(dist, reference);
-
-        for (int i = 0; i < dist.length; i++)
-        {
-            if (dist[i] > 0 && reference[i] > 0)
-                distance += dist[i] * Math.log(dist[i] / reference[i]);
-        }
-        return distance;
-    }
-
-    /**
-     * Returns <code>KullbackLeibler(dist, reference) + KullbackLeibler(reference, dist)</code>.
-     * @see #KullbackLeibler(double[], double[])
-     */
-    public static double symmetricKL(double[] dist, double[] reference)
-    {
-        return KullbackLeibler(dist, reference)
-                + KullbackLeibler(reference, dist);
-    }
-
-    /**
-     * Returns the squared difference between the 
-     * two specified distributions, which must have the same
-     * number of elements.  This is defined as 
-     * the sum over all <code>i</code> of the square of 
-     * <code>(dist[i] - reference[i])</code>.
-     */
-    public static double squaredError(double[] dist, double[] reference)
-    {
-        double error = 0;
-
-        checkLengths(dist, reference);
-
-        for (int i = 0; i < dist.length; i++)
-        {
-            double difference = dist[i] - reference[i];
-            error += difference * difference;
-        }
-        return error;
-    }
-
-    /**
-     * Returns the cosine distance between the two 
-     * specified distributions, which must have the same number
-     * of elements.  The distributions are treated as vectors
-     * in <code>dist.length</code>-dimensional space.
-     * Given the following definitions
-     * <ul>
-     * <li/><code>v</code> = the sum over all <code>i</code> of <code>dist[i] * dist[i]</code>
-     * <li/><code>w</code> = the sum over all <code>i</code> of <code>reference[i] * reference[i]</code>
-     * <li/><code>vw</code> = the sum over all <code>i</code> of <code>dist[i] * reference[i]</code>
-     * </ul>
-     * the value returned is defined as <code>vw / (Math.sqrt(v) * Math.sqrt(w))</code>.
-     */
-    public static double cosine(double[] dist, double[] reference)
-    {
-        double v_prod = 0; // dot product x*x
-        double w_prod = 0; // dot product y*y
-        double vw_prod = 0; // dot product x*y
-
-        checkLengths(dist, reference);
-
-        for (int i = 0; i < dist.length; i++)
-        {
-            vw_prod += dist[i] * reference[i];
-            v_prod += dist[i] * dist[i];
-            w_prod += reference[i] * reference[i];
-        }
-        // cosine distance between v and w
-        return vw_prod / (Math.sqrt(v_prod) * Math.sqrt(w_prod));
-    }
-
-    /**
-     * Returns the entropy of this distribution.
-     * High entropy indicates that the distribution is 
-     * close to uniform; low entropy indicates that the
-     * distribution is close to a Dirac delta (i.e., if
-     * the probability mass is concentrated at a single
-     * point, this method returns 0).  Entropy is defined as 
-     * the sum over all <code>i</code> of 
-     * <code>-(dist[i] * Math.log(dist[i]))</code>
-     */
-    public static double entropy(double[] dist)
-    {
-        double total = 0;
-
-        for (int i = 0; i < dist.length; i++)
-        {
-            if (dist[i] > 0)
-                total += dist[i] * Math.log(dist[i]);
-        }
-        return -total;
-    }
-
-    /**
-     * Throws an <code>IllegalArgumentException</code> if the two arrays are not of the same length.
-     */
-    protected static void checkLengths(double[] dist, double[] reference)
-    {
-        if (dist.length != reference.length)
-            throw new IllegalArgumentException("Arrays must be of the same length");
-    }
-
-    /**
-     * Normalizes, with Lagrangian smoothing, the specified <code>double</code>
-     * array, so that the values sum to 1 (i.e., can be treated as probabilities).
-     * The effect of the Lagrangian smoothing is to ensure that all entries 
-     * are nonzero; effectively, a value of <code>alpha</code> is added to each
-     * entry in the original array prior to normalization.
-     * @param counts
-     * @param alpha
-     */
-    public static void normalize(double[] counts, double alpha)
-    {
-        double total_count = 0;
-
-        for (int i = 0; i < counts.length; i++)
-            total_count += counts[i];
-
-        for (int i = 0; i < counts.length; i++)
-            counts[i] = (counts[i] + alpha)
-                    / (total_count + counts.length * alpha);
-    }
-
-    /**
-     * Returns the mean of the specified <code>Collection</code> of
-     * distributions, which are assumed to be normalized arrays of 
-     * <code>double</code> values.
-     * @see #mean(double[][])
-     */
-    public static double[] mean(Collection<double[]> distributions)
-    {
-        if (distributions.isEmpty())
-            throw new IllegalArgumentException("Distribution collection must be non-empty");
-        Iterator<double[]> iter = distributions.iterator();
-        double[] first = iter.next();
-        double[][] d_array = new double[distributions.size()][first.length];
-        d_array[0] = first;
-        for (int i = 1; i < d_array.length; i++)
-            d_array[i] = iter.next();
-        
-        return mean(d_array);
-    }
-    
-    /**
-     * Returns the mean of the specified array of distributions,
-     * represented as normalized arrays of <code>double</code> values.
-     * Will throw an "index out of bounds" exception if the 
-     * distribution arrays are not all of the same length.
-     */
-    public static double[] mean(double[][] distributions)
-    {
-        double[] d_mean = new double[distributions[0].length];
-        for (int j = 0; j < d_mean.length; j++)
-            d_mean[j] = 0;
-            
-        for (int i = 0; i < distributions.length; i++)
-            for (int j = 0; j < d_mean.length; j++)
-                d_mean[j] += distributions[i][j] / distributions.length;
-        
-        return d_mean;
-    }
-    
-}
\ No newline at end of file
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/Indexer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/Indexer.java
deleted file mode 100644 (file)
index b8a215e..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.util;
-
-import java.util.Collection;
-
-import org.apache.commons.collections15.BidiMap;
-import org.apache.commons.collections15.bidimap.DualHashBidiMap;
-
-/**
- * A class providing static methods useful for improving the
- * performance of graph algorithms.
- * 
- * @author Tom Nelson
- *
- */
-public class Indexer {
-       
-       /**
-        * Returns a <code>BidiMap</code> mapping each element of the collection to its
-        * index as encountered while iterating over the collection. The purpose
-        * of the index operation is to supply an O(1) replacement operation for the
-        * O(n) <code>indexOf(element)</code> method of a <code>List</code>
-        * @param <T>
-        * @param collection
-        * @return a bidirectional map from collection elements to 0-based indices
-        */
-       public static <T> BidiMap<T,Integer> create(Collection<T> collection) {
-           return create(collection, 0);
-       }
-       /**
-        * Returns a <code>BidiMap</code> mapping each element of the collection to its
-        * index as encountered while iterating over the collection. The purpose
-        * of the index operation is to supply an O(1) replacement operation for the
-        * O(n) <code>indexOf(element)</code> method of a <code>List</code>
-        * @param <T>
-        * @param collection
-        * @param start start index
-        * @return a bidirectional map from collection elements to start-based indices
-        */
-       public static <T> BidiMap<T,Integer> create(Collection<T> collection, int start) {
-               BidiMap<T,Integer> map = new DualHashBidiMap<T,Integer>();
-               int i=start;
-               for(T t : collection) {
-                       map.put(t,i++);
-               }
-               return map;
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/IterativeContext.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/IterativeContext.java
deleted file mode 100644 (file)
index 92bd45d..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.util;
-
-
-/**
- * An interface for algorithms that proceed iteratively.
- *
- */
-public interface IterativeContext 
-{
-       /**
-        * Advances one step.
-        */
-       void step();
-
-       /**
-        * Returns true if this iterative process is finished, and false otherwise.
-        */
-       boolean done();
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/IterativeProcess.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/IterativeProcess.java
deleted file mode 100644 (file)
index fbe07f4..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
-* Copyright (c) 2003, the JUNG Project and the Regents of the University 
-* of California
-* All rights reserved.
-*
-* This software is open-source under the BSD license; see either
-* "license.txt" or
-* http://jung.sourceforge.net/license.txt for a description.
-*/
-package edu.uci.ics.jung.algorithms.util;
-
-
-
-/**
- * Provides basic infrastructure for iterative algorithms. Services provided include:
- * <ul>
- * <li> storage of current and max iteration count </li>
- * <li> framework for initialization, iterative evaluation, and finalization </li>
- * <li> test for convergence </li>
- * <li> etc. </li>
- * </ul>
- * <p>
- * Algorithms that subclass this class are typically used in the following way: <br>
- * <pre>
- * FooAlgorithm foo = new FooAlgorithm(...)
- * foo.setMaximumIterations(100); //set up conditions
- * ...
- * foo.evaluate(); //key method which initiates iterative process
- * foo.getSomeResult();
- * </pre>
- * 
- * @author Scott White (originally written by Didier Besset)
- */
-public abstract class IterativeProcess implements IterativeContext {
-    /**
-     * Number of iterations performed.
-     */
-    private int iterations;
-    /**
-     * Maximum allowed number of iterations.
-     */
-    private int maximumIterations = 50;
-    /**
-     * Desired precision.
-     */
-    private double desiredPrecision = Double.MIN_VALUE;
-    /**
-     * Achieved precision.
-     */
-    private double precision;
-
-
-    /**
-     * Generic constructor.
-     */
-    public IterativeProcess() {
-    }
-
-    /**
-     * Performs the iterative process.
-     * Note: this method does not return anything because Java does not
-     * allow mixing double, int, or objects
-     */
-    public void evaluate() {
-        iterations = 0;
-        initializeIterations();
-        while (iterations++ < maximumIterations) {
-               step();
-            precision = getPrecision();
-            if (hasConverged())
-                break;
-        }
-        finalizeIterations();
-    }
-
-    /**
-     * Evaluate the result of the current iteration.
-     */
-    abstract public void step();
-
-    /**
-     * Perform eventual clean-up operations
-     * (must be implement by subclass when needed).
-     */
-    protected void finalizeIterations() {
-    }
-
-    /**
-     * Returns the desired precision.
-     */
-    public double getDesiredPrecision() {
-        return desiredPrecision;
-    }
-
-    /**
-     * Returns the number of iterations performed.
-     */
-    public int getIterations() {
-        return iterations;
-    }
-
-    /**
-     * Returns the maximum allowed number of iterations.
-     */
-    public int getMaximumIterations() {
-        return maximumIterations;
-    }
-
-    /**
-     * Returns the attained precision.
-     */
-    public double getPrecision() {
-        return precision;
-    }
-
-    /**
-        * @param precision the precision to set
-        */
-       public void setPrecision(double precision) {
-               this.precision = precision;
-       }
-
-       /**
-     *
-     * Check to see if the result has been attained.
-     * @return boolean
-     */
-    public boolean hasConverged() {
-        return precision < desiredPrecision;
-    }
-    
-    public boolean done() {
-       return hasConverged();
-    }
-
-    /**
-     * Initializes internal parameters to start the iterative process.
-     */
-    protected void initializeIterations() {
-    }
-
-    /**
-     * 
-     */
-    public void reset() {
-    }
-
-    /**
-     * @return double
-     * @param epsilon double
-     * @param x double
-     */
-    public double relativePrecision(double epsilon, double x) {
-        return x > desiredPrecision ? epsilon / x: epsilon;
-    }
-
-    /**
-     * Defines the desired precision.
-     */
-    public void setDesiredPrecision(double prec) throws IllegalArgumentException {
-        if (prec <= 0)
-            throw new IllegalArgumentException("Non-positive precision: " + prec);
-        desiredPrecision = prec;
-    }
-
-    /**
-     * Defines the maximum allowed number of iterations.
-     */
-    public void setMaximumIterations(int maxIter) throws IllegalArgumentException {
-        if (maxIter < 1)
-            throw new IllegalArgumentException("Non-positive maximum iteration: " + maxIter);
-        maximumIterations = maxIter;
-    }
-}
\ No newline at end of file
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/KMeansClusterer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/KMeansClusterer.java
deleted file mode 100644 (file)
index dce550f..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-/*
- * Created on Aug 9, 2004
- *
- */
-package edu.uci.ics.jung.algorithms.util;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Random;
-import java.util.Set;
-
-
-
-/**
- * Groups items into a specified number of clusters, based on their proximity in
- * d-dimensional space, using the k-means algorithm. Calls to
- * <code>cluster</code> will terminate when either of the two following
- * conditions is true:
- * <ul>
- * <li/>the number of iterations is &gt; <code>max_iterations</code> 
- * <li/>none of the centroids has moved as much as <code>convergence_threshold</code>
- * since the previous iteration
- * </ul>
- * 
- * @author Joshua O'Madadhain
- */
-public class KMeansClusterer<T>
-{
-    protected int max_iterations;
-    protected double convergence_threshold;
-    protected Random rand;
-
-    /**
-     * Creates an instance whose termination conditions are set according
-     * to the parameters.  
-     */
-    public KMeansClusterer(int max_iterations, double convergence_threshold)
-    {
-        this.max_iterations = max_iterations;
-        this.convergence_threshold = convergence_threshold;
-        this.rand = new Random();
-    }
-
-    /**
-     * Creates an instance with max iterations of 100 and convergence threshold
-     * of 0.001.
-     */
-    public KMeansClusterer()
-    {
-        this(100, 0.001);
-    }
-
-    /**
-     * Returns the maximum number of iterations.
-     */
-    public int getMaxIterations()
-    {
-        return max_iterations;
-    }
-
-    /**
-     * Sets the maximum number of iterations.
-     */
-    public void setMaxIterations(int max_iterations)
-    {
-        if (max_iterations < 0)
-            throw new IllegalArgumentException("max iterations must be >= 0");
-
-        this.max_iterations = max_iterations;
-    }
-
-    /**
-     * Returns the convergence threshold.
-     */
-    public double getConvergenceThreshold()
-    {
-        return convergence_threshold;
-    }
-
-    /**
-     * Sets the convergence threshold.
-     * @param convergence_threshold
-     */
-    public void setConvergenceThreshold(double convergence_threshold)
-    {
-        if (convergence_threshold <= 0)
-            throw new IllegalArgumentException("convergence threshold " +
-                "must be > 0");
-
-        this.convergence_threshold = convergence_threshold;
-    }
-
-    /**
-     * Returns a <code>Collection</code> of clusters, where each cluster is
-     * represented as a <code>Map</code> of <code>Objects</code> to locations
-     * in d-dimensional space.
-     * @param object_locations  a map of the Objects to cluster, to
-     * <code>double</code> arrays that specify their locations in d-dimensional space.
-     * @param num_clusters  the number of clusters to create
-     * @throws NotEnoughClustersException
-     */
-    @SuppressWarnings("unchecked")
-    public Collection<Map<T, double[]>> cluster(Map<T, double[]> object_locations, int num_clusters)
-    {
-        if (object_locations == null || object_locations.isEmpty())
-            throw new IllegalArgumentException("'objects' must be non-empty");
-
-        if (num_clusters < 2 || num_clusters > object_locations.size())
-            throw new IllegalArgumentException("number of clusters " +
-                "must be >= 2 and <= number of objects (" +
-                object_locations.size() + ")");
-
-
-        Set<double[]> centroids = new HashSet<double[]>();
-
-        Object[] obj_array = object_locations.keySet().toArray();
-        Set<T> tried = new HashSet<T>();
-
-        // create the specified number of clusters
-        while (centroids.size() < num_clusters && tried.size() < object_locations.size())
-        {
-            T o = (T)obj_array[(int)(rand.nextDouble() * obj_array.length)];
-            tried.add(o);
-            double[] mean_value = object_locations.get(o);
-            boolean duplicate = false;
-            for (double[] cur : centroids)
-            {
-                if (Arrays.equals(mean_value, cur))
-                    duplicate = true;
-            }
-            if (!duplicate)
-                centroids.add(mean_value);
-        }
-
-        if (tried.size() >= object_locations.size())
-            throw new NotEnoughClustersException();
-
-        // put items in their initial clusters
-        Map<double[], Map<T, double[]>> clusterMap = assignToClusters(object_locations, centroids);
-
-        // keep reconstituting clusters until either
-        // (a) membership is stable, or
-        // (b) number of iterations passes max_iterations, or
-        // (c) max movement of any centroid is <= convergence_threshold
-        int iterations = 0;
-        double max_movement = Double.POSITIVE_INFINITY;
-        while (iterations++ < max_iterations && max_movement > convergence_threshold)
-        {
-            max_movement = 0;
-            Set<double[]> new_centroids = new HashSet<double[]>();
-            // calculate new mean for each cluster
-            for (Map.Entry<double[], Map<T, double[]>> entry : clusterMap.entrySet())
-            {
-                double[] centroid = entry.getKey();
-                Map<T, double[]> elements = entry.getValue();
-                ArrayList<double[]> locations = new ArrayList<double[]>(elements.values());
-
-                double[] mean = DiscreteDistribution.mean(locations);
-                max_movement = Math.max(max_movement,
-                    Math.sqrt(DiscreteDistribution.squaredError(centroid, mean)));
-                new_centroids.add(mean);
-            }
-
-            // TODO: check membership of clusters: have they changed?
-
-            // regenerate cluster membership based on means
-            clusterMap = assignToClusters(object_locations, new_centroids);
-        }
-        return clusterMap.values();
-    }
-
-    /**
-     * Assigns each object to the cluster whose centroid is closest to the
-     * object.
-     * @param object_locations  a map of objects to locations
-     * @param centroids         the centroids of the clusters to be formed
-     * @return a map of objects to assigned clusters
-     */
-    protected Map<double[], Map<T, double[]>> assignToClusters(Map<T, double[]> object_locations, Set<double[]> centroids)
-    {
-        Map<double[], Map<T, double[]>> clusterMap = new HashMap<double[], Map<T, double[]>>();
-        for (double[] centroid : centroids)
-            clusterMap.put(centroid, new HashMap<T, double[]>());
-
-        for (Map.Entry<T, double[]> object_location : object_locations.entrySet())
-        {
-            T object = object_location.getKey();
-            double[] location = object_location.getValue();
-
-            // find the cluster with the closest centroid
-            Iterator<double[]> c_iter = centroids.iterator();
-            double[] closest = c_iter.next();
-            double distance = DiscreteDistribution.squaredError(location, closest);
-
-            while (c_iter.hasNext())
-            {
-                double[] centroid = c_iter.next();
-                double dist_cur = DiscreteDistribution.squaredError(location, centroid);
-                if (dist_cur < distance)
-                {
-                    distance = dist_cur;
-                    closest = centroid;
-                }
-            }
-            clusterMap.get(closest).put(object, location);
-        }
-
-        return clusterMap;
-    }
-
-    /**
-     * Sets the seed used by the internal random number generator.
-     * Enables consistent outputs.
-     */
-    public void setSeed(int random_seed)
-    {
-        this.rand = new Random(random_seed);
-    }
-
-    /**
-     * An exception that indicates that the specified data points cannot be
-     * clustered into the number of clusters requested by the user.
-     * This will happen if and only if there are fewer distinct points than
-     * requested clusters.  (If there are fewer total data points than
-     * requested clusters, <code>IllegalArgumentException</code> will be thrown.)
-     *
-     * @author Joshua O'Madadhain
-     */
-    @SuppressWarnings("serial")
-    public static class NotEnoughClustersException extends RuntimeException
-    {
-        @Override
-        public String getMessage()
-        {
-            return "Not enough distinct points in the input data set to form " +
-                    "the requested number of clusters";
-        }
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/MapBinaryHeap.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/MapBinaryHeap.java
deleted file mode 100644 (file)
index bd00a82..0000000
+++ /dev/null
@@ -1,389 +0,0 @@
-/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-/*
- * 
- * Created on Oct 29, 2003
- */
-package edu.uci.ics.jung.algorithms.util;
-
-import java.util.AbstractCollection;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Queue;
-import java.util.Vector;
-
-import org.apache.commons.collections15.IteratorUtils;
-
-/**
- * An array-based binary heap implementation of a priority queue, 
- * which also provides
- * efficient <code>update()</code> and <code>contains</code> operations.
- * It contains extra infrastructure (a hash table) to keep track of the 
- * position of each element in the array; thus, if the key value of an element
- * changes, it may be "resubmitted" to the heap via <code>update</code>
- * so that the heap can reposition it efficiently, as necessary.  
- * 
- * @author Joshua O'Madadhain
- */
-public class MapBinaryHeap<T>
-    extends AbstractCollection<T> 
-    implements Queue<T>
-{
-       private Vector<T> heap = new Vector<T>();            // holds the heap as an implicit binary tree
-    private Map<T,Integer> object_indices = new HashMap<T,Integer>(); // maps each object in the heap to its index in the heap
-    private Comparator<T> comp;
-    private final static int TOP = 0;   // the index of the top of the heap
-
-    /**
-     * Creates a <code>MapBinaryHeap</code> whose heap ordering
-     * is based on the ordering of the elements specified by <code>c</code>.
-     */
-    public MapBinaryHeap(Comparator<T> comp)
-    {
-        initialize(comp);
-    }
-    
-    /**
-     * Creates a <code>MapBinaryHeap</code> whose heap ordering
-     * will be based on the <i>natural ordering</i> of the elements,
-     * which must be <code>Comparable</code>.
-     */
-    public MapBinaryHeap()
-    {
-        initialize(new ComparableComparator());
-    }
-
-    /**
-     * Creates a <code>MapBinaryHeap</code> based on the specified
-     * collection whose heap ordering
-     * will be based on the <i>natural ordering</i> of the elements,
-     * which must be <code>Comparable</code>.
-     */
-    public MapBinaryHeap(Collection<T> c)
-    {
-       this();
-        addAll(c);
-    }
-    
-    /**
-     * Creates a <code>MapBinaryHeap</code> based on the specified collection 
-     * whose heap ordering
-     * is based on the ordering of the elements specified by <code>c</code>.
-     */
-    public MapBinaryHeap(Collection<T> c, Comparator<T> comp)
-    {
-        this(comp);
-        addAll(c);
-    }
-    
-    private void initialize(Comparator<T> comp)
-    {
-        this.comp = comp;
-        clear();
-    }
-    
-       /**
-        * @see Collection#clear()
-        */
-       @Override
-       public void clear()
-       {
-        object_indices.clear();
-        heap.clear();
-       }
-
-       /**
-        * Inserts <code>o</code> into this collection.
-        */
-       @Override
-       public boolean add(T o)
-       {
-        int i = heap.size();  // index 1 past the end of the heap
-        heap.setSize(i+1);
-        percolateUp(i, o);
-        return true;
-       }
-
-       /**
-        * Returns <code>true</code> if this collection contains no elements, and
-     * <code>false</code> otherwise.
-        */
-       @Override
-       public boolean isEmpty()
-       {
-        return heap.isEmpty();
-       }
-
-       /**
-        * Returns the element at the top of the heap; does not
-     * alter the heap.
-        */
-       public T peek()
-       {
-               if (heap.size() > 0)
-                       return heap.elementAt(TOP);
-               else
-                       return null;
-       }
-
-       /**
-        * Removes the element at the top of this heap, and returns it.
-        * @deprecated Use {@link MapBinaryHeap#poll()} 
-        * or {@link MapBinaryHeap#remove()} instead.
-        */
-       @Deprecated
-    public T pop() throws NoSuchElementException
-       {
-               return this.remove();
-       }
-
-    /**
-     * Returns the size of this heap.
-     */
-    @Override
-    public int size() 
-    {
-        return heap.size();
-    }
-       
-    /**
-     * Informs the heap that this object's internal key value has been
-     * updated, and that its place in the heap may need to be shifted
-     * (up or down).
-     * @param o
-     */
-    public void update(T o)
-    {
-        // Since we don't know whether the key value increased or 
-        // decreased, we just percolate up followed by percolating down;
-        // one of the two will have no effect.
-        
-        int cur = object_indices.get(o).intValue(); // current index
-        int new_idx = percolateUp(cur, o);
-        percolateDown(new_idx);
-    }
-
-    /**
-     * @see Collection#contains(java.lang.Object)
-     */
-    @Override
-    public boolean contains(Object o)
-    {
-        return object_indices.containsKey(o);
-    }
-    
-    /**
-     * Moves the element at position <code>cur</code> closer to 
-     * the bottom of the heap, or returns if no further motion is
-     * necessary.  Calls itself recursively if further motion is 
-     * possible.
-     */
-    private void percolateDown(int cur)
-    {
-        int left = lChild(cur);
-        int right = rChild(cur);
-        int smallest;
-
-        if ((left < heap.size()) && 
-                       (comp.compare(heap.elementAt(left), heap.elementAt(cur)) < 0)) {
-                       smallest = left;
-               } else {
-                       smallest = cur;
-               }
-
-        if ((right < heap.size()) && 
-                       (comp.compare(heap.elementAt(right), heap.elementAt(smallest)) < 0)) {
-                       smallest = right;
-               }
-
-        if (cur != smallest)
-        {
-            swap(cur, smallest);
-            percolateDown(smallest);
-        }
-    }
-
-    /**
-     * Moves the element <code>o</code> at position <code>cur</code> 
-     * as high as it can go in the heap.  Returns the new position of the 
-     * element in the heap.
-     */
-    private int percolateUp(int cur, T o)
-    {
-        int i = cur;
-        
-        while ((i > TOP) && (comp.compare(heap.elementAt(parent(i)), o) > 0))
-        {
-            T parentElt = heap.elementAt(parent(i));
-            heap.setElementAt(parentElt, i);
-            object_indices.put(parentElt, new Integer(i));  // reset index to i (new location)
-            i = parent(i);
-        }
-        
-        // place object in heap at appropriate place
-        object_indices.put(o, new Integer(i));
-        heap.setElementAt(o, i);
-
-        return i;
-    }
-    
-    /**
-     * Returns the index of the left child of the element at 
-     * index <code>i</code> of the heap.
-     * @param i
-     * @return the index of the left child of the element at 
-     * index <code>i</code> of the heap
-     */
-    private int lChild(int i)
-    {
-       return (i<<1) + 1;
-    }
-    
-    /**
-     * Returns the index of the right child of the element at 
-     * index <code>i</code> of the heap.
-     * @param i
-     * @return the index of the right child of the element at 
-     * index <code>i</code> of the heap
-     */
-    private int rChild(int i)
-    {
-       return (i<<1) + 2;
-    }
-    
-    /**
-     * Returns the index of the parent of the element at 
-     * index <code>i</code> of the heap.
-     * @param i
-     * @return the index of the parent of the element at index i of the heap
-     */
-    private int parent(int i)
-    {
-       return (i-1)>>1;
-    }
-    
-    /**
-     * Swaps the positions of the elements at indices <code>i</code>
-     * and <code>j</code> of the heap.
-     * @param i
-     * @param j
-     */
-    private void swap(int i, int j)
-    {
-        T iElt = heap.elementAt(i);
-        T jElt = heap.elementAt(j);
-
-        heap.setElementAt(jElt, i);
-        object_indices.put(jElt, new Integer(i));
-
-        heap.setElementAt(iElt, j);
-        object_indices.put(iElt, new Integer(j));
-    }
-    
-    /**
-     * Comparator used if none is specified in the constructor.
-     * @author Joshua O'Madadhain
-     */
-    private class ComparableComparator implements Comparator<T>
-    {
-        /**
-         * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
-         */
-        @SuppressWarnings("unchecked")
-        public int compare(T arg0, T arg1)
-        {
-            if (!(arg0 instanceof Comparable) || !(arg1 instanceof Comparable))
-                throw new IllegalArgumentException("Arguments must be Comparable");
-            
-            return ((Comparable<T>)arg0).compareTo(arg1);
-        }
-    }
-
-    /**
-     * Returns an <code>Iterator</code> that does not support modification
-     * of the heap.
-     */
-    @Override
-    public Iterator<T> iterator()
-    {
-        return IteratorUtils.<T>unmodifiableIterator(heap.iterator());
-    }
-
-    /**
-     * This data structure does not support the removal of arbitrary elements.
-     */
-    @Override
-    public boolean remove(Object o)
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * This data structure does not support the removal of arbitrary elements.
-     */
-    @Override
-    public boolean removeAll(Collection<?> c)
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * This data structure does not support the removal of arbitrary elements.
-     */
-    @Override
-    public boolean retainAll(Collection<?> c)
-    {
-        throw new UnsupportedOperationException();
-    }
-
-       public T element() throws NoSuchElementException 
-       {
-               T top = this.peek();
-               if (top == null) 
-                       throw new NoSuchElementException();
-               return top;
-       }
-
-       public boolean offer(T o) 
-       {
-               return add(o);
-       }
-
-       public T poll() 
-       {
-        T top = this.peek();
-        if (top != null)
-        {
-               T bottom_elt = heap.lastElement();
-               heap.setElementAt(bottom_elt, TOP);
-               object_indices.put(bottom_elt, new Integer(TOP));
-               
-               heap.setSize(heap.size() - 1);  // remove the last element
-               if (heap.size() > 1)
-                       percolateDown(TOP);
-       
-               object_indices.remove(top);
-        }
-        return top;
-       }
-
-       public T remove() 
-       {
-               T top = this.poll();
-               if (top == null)
-                       throw new NoSuchElementException();
-               return top;
-       }
-
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/MapSettableTransformer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/MapSettableTransformer.java
deleted file mode 100644 (file)
index 1aa7d50..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Created on Aug 5, 2007
- *
- * Copyright (c) 2007, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.util;
-
-import java.util.Map;
-
-
-/**
- * A <code>SettableTransformer</code> that operates on an underlying <code>Map</code> instance.
- * Similar to <code>MapTransformer</code>.
- * 
- * @author Joshua O'Madadhain
- */
-public class MapSettableTransformer<I, O> implements SettableTransformer<I, O>
-{
-    protected Map<I,O> map;
-    
-    /**
-     * Creates an instance based on <code>m</code>.
-     */
-    public MapSettableTransformer(Map<I,O> m)
-    {
-        this.map = m;
-    }
-
-    public O transform(I input)
-    {
-        return map.get(input);
-    }
-
-    public void set(I input, O output)
-    {
-        map.put(input, output);
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/SelfLoopEdgePredicate.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/SelfLoopEdgePredicate.java
deleted file mode 100644 (file)
index a92c3b8..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package edu.uci.ics.jung.algorithms.util;
-
-import org.apache.commons.collections15.Predicate;
-
-import edu.uci.ics.jung.graph.Graph;
-import edu.uci.ics.jung.graph.util.Context;
-import edu.uci.ics.jung.graph.util.Pair;
-
-/**
- * A <code>Predicate</code> that returns <code>true</code> if the input edge's 
- * endpoints in the input graph are identical.  (Thus, an edge which connects
- * its sole incident vertex to itself).
- *
- * @param <V>
- * @param <E>
- */
-public class SelfLoopEdgePredicate<V,E> implements Predicate<Context<Graph<V,E>,E>> {
-
-    public boolean evaluate(Context<Graph<V,E>,E> context) {
-        Pair<V> endpoints = context.graph.getEndpoints(context.element);
-        return endpoints.getFirst().equals(endpoints.getSecond());
-    }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/SettableTransformer.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/SettableTransformer.java
deleted file mode 100644 (file)
index 5e5168a..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Created on Aug 5, 2007
- *
- * Copyright (c) 2007, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- */
-package edu.uci.ics.jung.algorithms.util;
-
-import org.apache.commons.collections15.Transformer;
-
-/**
- * An interface for classes that can set the value to be returned (from <code>transform()</code>)
- * when invoked on a given input.
- * 
- * @author Joshua O'Madadhain
- */
-public interface SettableTransformer<I, O> extends Transformer<I, O>
-{
-    /**
-     * Sets the value (<code>output</code>) to be returned by a call to 
-     * <code>transform(input)</code>).
-     * @param input
-     * @param output
-     */
-    public void set(I input, O output);
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/WeightedChoice.java b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/WeightedChoice.java
deleted file mode 100644 (file)
index d9590b2..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/**
- * Copyright (c) 2009, the JUNG Project and the Regents of the University 
- * of California
- * All rights reserved.
- *
- * This software is open-source under the BSD license; see either
- * "license.txt" or
- * http://jung.sourceforge.net/license.txt for a description.
- * Created on Jan 8, 2009
- * 
- */
-package edu.uci.ics.jung.algorithms.util;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Queue;
-import java.util.Random;
-
-/**
- * Selects items according to their probability in an arbitrary probability 
- * distribution.  The distribution is specified by a {@code Map} from
- * items (of type {@code T}) to weights of type {@code Number}, supplied
- * to the constructor; these weights are normalized internally to act as 
- * probabilities.
- * 
- * <p>This implementation selects items in O(1) time, and requires O(n) space.
- * 
- * @author Joshua O'Madadhain
- */
-public class WeightedChoice<T> 
-{
-       private List<ItemPair> item_pairs;
-       private Random random;
-       
-       /**
-        * The default minimum value that is treated as a valid probability 
-        * (as opposed to rounding error from floating-point operations). 
-        */
-       public static final double DEFAULT_THRESHOLD = 0.00000000001;
-
-       /**
-        * Equivalent to {@code this(item_weights, new Random(), DEFAULT_THRESHOLD)}.
-        * @param item_weights
-        */
-       public WeightedChoice(Map<T, ? extends Number> item_weights)
-       {
-               this(item_weights, new Random(), DEFAULT_THRESHOLD);
-       }
-
-       /**
-        * Equivalent to {@code this(item_weights, new Random(), threshold)}.
-        */
-       public WeightedChoice(Map<T, ? extends Number> item_weights, double threshold)
-       {
-               this(item_weights, new Random(), threshold);
-       }
-       
-       /**
-        * Equivalent to {@code this(item_weights, random, DEFAULT_THRESHOLD)}.
-        */
-       public WeightedChoice(Map<T, ? extends Number> item_weights, Random random)
-       {
-               this(item_weights, random, DEFAULT_THRESHOLD);
-       }
-       
-       /**
-        * Creates an instance with the specified mapping from items to weights,
-        * random number generator, and threshold value.
-        * 
-        * <p>The mapping defines the weight for each item to be selected; this 
-        * will be proportional to the probability of its selection.
-        * <p>The random number generator specifies the mechanism which will be
-        * used to provide uniform integer and double values.
-        * <p>The threshold indicates default minimum value that is treated as a valid 
-        * probability (as opposed to rounding error from floating-point operations). 
-        */
-       public WeightedChoice(Map<T, ? extends Number> item_weights, Random random,
-                       double threshold) 
-       {
-               if (item_weights.isEmpty())
-                       throw new IllegalArgumentException("Item weights must be non-empty");
-               
-               int item_count = item_weights.size();
-               item_pairs = new ArrayList<ItemPair>(item_count);
-               
-               double sum = 0;
-               for (Map.Entry<T, ? extends Number> entry : item_weights.entrySet())
-               {
-                       double value = entry.getValue().doubleValue();
-                       if (value <= 0)
-                               throw new IllegalArgumentException("Weights must be > 0");
-                       sum += value;
-               }
-        double bucket_weight = 1.0 / item_weights.size();
-               
-               Queue<ItemPair> light_weights = new LinkedList<ItemPair>();
-               Queue<ItemPair> heavy_weights = new LinkedList<ItemPair>();
-               for (Map.Entry<T, ? extends Number> entry : item_weights.entrySet())
-               {
-                       double value = entry.getValue().doubleValue() / sum;
-                       enqueueItem(entry.getKey(), value, bucket_weight, light_weights, heavy_weights);
-               }
-               
-               // repeat until both queues empty
-               while (!heavy_weights.isEmpty() || !light_weights.isEmpty())
-               {
-                       ItemPair heavy_item = heavy_weights.poll();
-                       ItemPair light_item = light_weights.poll();
-                       double light_weight = 0;
-                       T light = null;
-                       T heavy = null;
-                       if (light_item != null)
-                       {
-                               light_weight = light_item.weight;
-                               light = light_item.light;
-                       }
-                       if (heavy_item != null)
-                       {
-                               heavy = heavy_item.heavy;
-                               // put the 'left over' weight from the heavy item--what wasn't
-                               // needed to make up the difference between the light weight and
-                               // 1/n--back in the appropriate queue
-                               double new_weight = heavy_item.weight - (bucket_weight - light_weight);
-                               if (new_weight > threshold)
-                                       enqueueItem(heavy, new_weight, bucket_weight, light_weights, heavy_weights);
-                       }
-                       light_weight *= item_count;
-                       
-                       item_pairs.add(new ItemPair(light, heavy, light_weight));
-               }
-               
-               this.random = random;
-       }
-
-       /**
-        * Adds key/value to the appropriate queue.  Keys with values less than
-        * the threshold get added to {@code light_weights}, all others get added
-        * to {@code heavy_weights}.
-        */
-       private void enqueueItem(T key, double value, double threshold, 
-                       Queue<ItemPair> light_weights, Queue<ItemPair> heavy_weights)
-       {
-               if (value < threshold) 
-                       light_weights.offer(new ItemPair(key, null, value));
-               else
-                       heavy_weights.offer(new ItemPair(null, key, value));
-       }
-       
-       /**
-        * Sets the seed used by the internal random number generator.
-        */
-       public void setRandomSeed(long seed)
-       {
-               this.random.setSeed(seed);
-       }
-       
-       /**
-        * Retrieves an item with probability proportional to its weight in the
-        * {@code Map} provided in the input.
-        */
-       public T nextItem()
-       {
-               ItemPair item_pair = item_pairs.get(random.nextInt(item_pairs.size()));
-               if (random.nextDouble() < item_pair.weight)
-                       return item_pair.light;
-               return item_pair.heavy;
-       }
-       
-       /**
-        * Manages light object/heavy object/light conditional probability tuples.
-        */
-       private class ItemPair 
-       {
-               T light;
-               T heavy;
-               double weight;
-               
-               private ItemPair(T light, T heavy, double weight)
-               {
-                       this.light = light;
-                       this.heavy = heavy;
-                       this.weight = weight;
-               }
-               
-               @Override
-        public String toString()
-               {
-                       return String.format("[L:%s, H:%s, %.3f]", light, heavy, weight);
-               }
-       }
-}
diff --git a/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/package.html b/third-party/net.sf.jung2/src/main/java/edu/uci/ics/jung/algorithms/util/package.html
deleted file mode 100644 (file)
index 58c5f59..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-  @(#)package.html
-
- Copyright © 2003 The Regents of the University of California. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies. This software program and documentation are copyrighted by The Regents of the University of California ("The University of California").
-
-THE SOFTWARE PROGRAM AND DOCUMENTATION ARE SUPPLIED "AS IS," WITHOUT ANY ACCOMPANYING SERVICES FROM THE UNIVERSITY OF CALFORNIA. FURTHERMORE, THE UNIVERSITY OF CALIFORNIA DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED OR ERROR-FREE. THE END-USER UNDERSTANDS THAT THE PROGRAM WAS DEVELOPED FOR RESEARCH PURPOSES AND IS ADVISED NOT TO RELY EXCLUSIVELY ON THE PROGRAM FOR ANY REASON.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
--->
-</head>
-<body>
-
-Provides general algorithmic utilities.  These include:
-<ul>
-<li/><code>DiscreteDistribution</code>: calculates statistical measures on 
-discrete probability distributions represented as <code>double</code> arrays
-<li/><code>KMeansClusterer</code>: uses the k-means algorithm to cluster 
-points in d-dimensional space into k clusters 
-<li/><code>MapBinaryHeap</code>: a binary heap implementation that permits
-efficient element access and update operations
-<li/><code>RandomLocationTransformer</code>: a class that randomly assigns
-2D coordinates to items (default initializer for iterative Layouts)
-<li/><code>SettableTransformer</code>: an extension of <code>Transformer</code>
-that allows mutation of the transformation
-</ul>
-
-</body>
-</html>
diff --git a/third-party/openflowj/LICENSE b/third-party/openflowj/LICENSE
deleted file mode 100644 (file)
index ee6da46..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior
-University
-
-We are making the OpenFlow specification and associated documentation
-(Software) available for public use and benefit with the expectation that
-others will use, modify and enhance the Software and contribute those
-enhancements back to the community. However, since we would like to make the
-Software available for broadest use, with as few restrictions as possible
-permission is hereby granted, free of charge, to any person obtaining a copy of
-this Software to deal in the Software under the copyrights without restriction,
-including without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to permit
-persons to whom the Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
-The name and trademarks of copyright holder(s) may NOT be used in advertising
-or publicity pertaining to the Software or any derivatives without specific,
-written prior permission.
diff --git a/third-party/openflowj/Makefile b/third-party/openflowj/Makefile
deleted file mode 100644 (file)
index b803071..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-# Because I am old and crotchety and my fingers can't stop from running 
-#      `make` commands
-all:
-       ant
-
-run:
-       ant run
-
-doc: 
-       ant javadoc
-
-tests:
-       ant tests
-
-count: 
-       @find . -name \*.java | xargs wc -l | sort -n
-
-clean:
-       ant clean
diff --git a/third-party/openflowj/README b/third-party/openflowj/README
deleted file mode 100644 (file)
index 6fffebe..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-OpenFlow Java - v1.0.0 
-
-A Java implementation of low-level OpenFlow packet marshalling/unmarshalling
-and IO operations. Implements v1.0 of the OpenFlow specification at
-http://www.openflow.org.
-
-    - David Erickson (daviderickson@cs.stanford.edu)
-    - Rob Sherwood (rob.sherwood@stanford.edu)
-
-Building requires Maven 2.x+ (http://maven.apache.org/).
-
-To build:
-    mvn package
-
-To build javadocs:
-    mvn javadoc:javadoc
diff --git a/third-party/openflowj/eclipse_codestyle.xml b/third-party/openflowj/eclipse_codestyle.xml
deleted file mode 100644 (file)
index 6b661c6..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<profiles version="11">
-<profile kind="CodeFormatterProfile" name="OpenFlowJ" version="11">
-<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
-<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="80"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
-<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
-<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
-<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
-<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
-<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
-<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
-</profile>
-</profiles>
diff --git a/third-party/openflowj/lib/commons-cli-1.2.jar b/third-party/openflowj/lib/commons-cli-1.2.jar
deleted file mode 100644 (file)
index ce4b9ff..0000000
Binary files a/third-party/openflowj/lib/commons-cli-1.2.jar and /dev/null differ
diff --git a/third-party/openflowj/lib/junit-4.8.1.jar b/third-party/openflowj/lib/junit-4.8.1.jar
deleted file mode 100644 (file)
index 524cd65..0000000
Binary files a/third-party/openflowj/lib/junit-4.8.1.jar and /dev/null differ
diff --git a/third-party/openflowj/pom.xml b/third-party/openflowj/pom.xml
deleted file mode 100644 (file)
index 9e04a70..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.opendaylight.controller.thirdparty</groupId>
-  <artifactId>org.openflow.openflowj</artifactId>
-  <version>1.1.0-SNAPSHOT</version>
-  <name>OpenFlow Java</name>
-  <description>A Java implemention of the OpenFlow v1.0 protocol</description>
-
-  <!-- Get some common settings for the project we are using it in -->
-  <parent>
-    <groupId>org.opendaylight.controller</groupId>
-    <artifactId>commons.thirdparty</artifactId>
-    <version>1.2.0-SNAPSHOT</version>
-    <relativePath>../commons/thirdparty</relativePath>
-  </parent>
-  
-  <developers>
-    <developer>
-      <name>David Erickson</name>
-      <email>daviderickson@cs.stanford.edu</email>
-    </developer>
-    <developer>
-      <name>Rob Sherwood</name>
-      <email>rob.sherwood@stanford.edu</email>
-    </developer>
-  </developers>
-  <packaging>bundle</packaging>
-  <url>http://www.openflow.org</url>
-  <licenses>
-    <license>
-      <name>The OpenFlow License</name>
-      <url>http://www.openflowswitch.org/wp/legal/</url>
-      <distribution>repo</distribution>
-    </license>
-  </licenses>
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
-    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
-    <tag>HEAD</tag>
-  </scm>
-  <properties>
-    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-  </properties>
-  <!-- For GPG release signing, use mvn release:perform -->
-  <profiles>
-    <profile>
-      <id>release-sign-artifacts</id>
-      <activation>
-        <!-- don't activate it -->
-        <!-- <property> -->
-        <!--   <name>performRelease</name> -->
-        <!--   <value>true</value> -->
-        <!-- </property> -->
-      </activation>
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-gpg-plugin</artifactId>
-            <version>1.1</version>
-            <executions>
-              <execution>
-                <id>sign-artifacts</id>
-                <phase>verify</phase>
-                <goals>
-                  <goal>sign</goal>
-                </goals>
-              </execution>
-            </executions>
-            <configuration>
-              <mavenExecutorId>forked-path</mavenExecutorId>
-            </configuration>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-  </profiles>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <version>2.3.6</version>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>
-              org.openflow.example;version="1.0.1";
-              uses:="org.openflow.example.cli,
-              org.openflow.protocol,
-              org.openflow.io,
-              org.openflow.protocol.factory",
-              org.openflow.io;version="1.0.1";
-              uses:="org.openflow.protocol,
-              org.openflow.protocol.factory",
-              org.openflow.protocol;version="1.0.1";
-              uses:="org.openflow.protocol.statistics,
-              org.openflow.protocol,
-              org.openflow.protocol.factory",
-              org.openflow.protocol.action;version="1.0.1";
-              uses:="org.openflow.protocol",
-              org.openflow.protocol.factory;version="1.0.1";
-              uses:="org.openflow.protocol.statistics,
-              org.openflow.protocol,
-              org.openflow.protocol.action,
-              org.openflow.protocol.queue",
-              org.openflow.protocol.queue;version="1.0.2";
-              uses:="org.openflow.protocol,
-              org.openflow.protocol.factory",
-              org.openflow.protocol.statistics;version="1.0.1";
-              uses:="org.openflow.protocol,
-              org.openflow.protocol.factory",
-              org.openflow.util;version="1.0.1"
-            </Export-Package>
-          </instructions>
-          <manifestLocation>${project.basedir}/META-INF</manifestLocation>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <version>2.5.1</version>
-        <configuration>
-          <source>1.7</source>
-          <target>1.7</target>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.8.1</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-</project>
diff --git a/third-party/openflowj/src/main/java/org/openflow/example/SelectListener.java b/third-party/openflowj/src/main/java/org/openflow/example/SelectListener.java
deleted file mode 100644 (file)
index 16fa109..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- *
- */
-package org.openflow.example;
-
-import java.io.IOException;
-import java.nio.channels.SelectionKey;
-
-/**
- * @author Rob Sherwood (rob.sherwood@stanford.edu)
- *
- */
-public interface SelectListener {
-    /**
-     * Tell the select listener that an event took place on the passed object
-     * @param key the key used on the select
-     * @param arg some parameter passed by the caller when registering
-     * @throws IOException
-     */
-    void handleEvent(SelectionKey key, Object arg) throws IOException;
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/example/SelectLoop.java b/third-party/openflowj/src/main/java/org/openflow/example/SelectLoop.java
deleted file mode 100644 (file)
index b7927d8..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-package org.openflow.example;
-
-import java.io.IOException;
-import java.nio.channels.CancelledKeyException;
-import java.nio.channels.ClosedChannelException;
-import java.nio.channels.SelectableChannel;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.Selector;
-import java.nio.channels.spi.SelectorProvider;
-import java.util.Iterator;
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-/***
- * Dirt simple SelectLoop for simple java controller
- */
-
-
-public class SelectLoop {
-    protected SelectListener callback;
-    protected boolean dontStop;
-    protected Object registrationLock;
-    protected int registrationRequests = 0;
-    protected Queue<Object[]> registrationQueue;
-    protected Selector selector;
-    protected long timeout;
-
-    public SelectLoop(SelectListener cb) throws IOException {
-        callback = cb;
-        dontStop = true;
-        selector = SelectorProvider.provider().openSelector();
-        registrationLock = new Object();
-        registrationQueue = new ConcurrentLinkedQueue<Object[]>();
-        timeout = 0;
-    }
-
-    /**
-     * Initializes this SelectLoop
-     * @param cb the callback to call when select returns
-     * @param timeout the timeout value in milliseconds that select will be
-     *        called with
-     * @throws IOException
-     */
-    public SelectLoop(SelectListener cb, long timeout) throws IOException {
-        callback = cb;
-        dontStop = true;
-        selector = SelectorProvider.provider().openSelector();
-        registrationLock = new Object();
-        registrationQueue = new ConcurrentLinkedQueue<Object[]>();
-        this.timeout = timeout;
-    }
-
-    public void register(SelectableChannel ch, int ops, Object arg)
-            throws ClosedChannelException {
-        registrationQueue.add(new Object[] {ch, ops, arg});
-    }
-
-    /**
-     * Registers the supplied SelectableChannel with this SelectLoop. Note this
-     * method blocks until registration proceeds.  It is advised that
-     * SelectLoop is intialized with a timeout value when using this method.
-     * @param ch the channel
-     * @param ops interest ops
-     * @param arg argument that will be returned with the SelectListener
-     * @return
-     * @throws ClosedChannelException
-     */
-    public synchronized SelectionKey registerBlocking(SelectableChannel ch, int ops, Object arg)
-            throws ClosedChannelException {
-        synchronized (registrationLock) {
-            registrationRequests++;
-        }
-        selector.wakeup();
-        SelectionKey key = ch.register(selector, ops, arg);
-        synchronized (registrationLock) {
-            registrationRequests--;
-            registrationLock.notifyAll();
-        }
-        return key;
-    }
-
-    /****
-     * Main top-level IO loop this dispatches all IO events and timer events
-     * together I believe this is fairly efficient
-     */
-    public void doLoop() throws IOException {
-        int nEvents;
-        processRegistrationQueue();
-
-        while (dontStop) {
-            nEvents = selector.select(timeout);
-            if (nEvents > 0) {
-                for (Iterator<SelectionKey> i = selector.selectedKeys()
-                        .iterator(); i.hasNext();) {
-                    SelectionKey sk = i.next();
-                    i.remove();
-
-                    if (!sk.isValid())
-                        continue;
-
-                    Object arg = sk.attachment();
-                    callback.handleEvent(sk, arg);
-                }
-            }
-
-            if (this.registrationQueue.size() > 0)
-                processRegistrationQueue();
-
-            if (registrationRequests > 0) {
-                synchronized (registrationLock) {
-                    while (registrationRequests > 0) {
-                        try {
-                            registrationLock.wait();
-                        } catch (InterruptedException e) {
-                            e.printStackTrace();
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    protected void processRegistrationQueue() {
-        // add any elements in queue
-        for (Iterator<Object[]> it = registrationQueue.iterator(); it.hasNext();) {
-            Object[] args = it.next();
-            SelectableChannel ch = (SelectableChannel) args[0];
-            try {
-                ch.register(selector, (Integer) args[1], args[2]);
-            } catch (CancelledKeyException cke) {
-               continue;
-            } catch (ClosedChannelException e) {
-            }
-            it.remove();
-        }
-    }
-
-    /**
-     * Force this select loop to return immediately and re-enter select, useful
-     * for example if a new item has been added to the select loop while it
-     * was already blocked.
-     */
-    public void wakeup() {
-       if (selector != null) {
-           selector.wakeup();
-       }
-    }
-
-    /**
-     * Shuts down this select loop, may return before it has fully shutdown
-     */
-    public void shutdown() {
-        this.dontStop = false;
-        wakeup();
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/example/SimpleController.java b/third-party/openflowj/src/main/java/org/openflow/example/SimpleController.java
deleted file mode 100644 (file)
index e18e2f5..0000000
+++ /dev/null
@@ -1,321 +0,0 @@
-/**
- *
- */
-package org.openflow.example;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.ServerSocketChannel;
-import java.nio.channels.SocketChannel;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import org.openflow.example.cli.Options;
-import org.openflow.example.cli.ParseException;
-import org.openflow.example.cli.SimpleCLI;
-import org.openflow.io.OFMessageAsyncStream;
-import org.openflow.protocol.OFEchoReply;
-import org.openflow.protocol.OFFlowMod;
-import org.openflow.protocol.OFMatch;
-import org.openflow.protocol.OFMessage;
-import org.openflow.protocol.OFPacketIn;
-import org.openflow.protocol.OFPacketOut;
-import org.openflow.protocol.OFPort;
-import org.openflow.protocol.OFType;
-import org.openflow.protocol.action.OFAction;
-import org.openflow.protocol.action.OFActionOutput;
-import org.openflow.protocol.factory.BasicFactory;
-import org.openflow.util.LRULinkedHashMap;
-import org.openflow.util.U16;
-
-/**
- * @author Rob Sherwood (rob.sherwood@stanford.edu), David Erickson (daviderickson@cs.stanford.edu)
- *
- */
-public class SimpleController implements SelectListener {
-    protected ExecutorService es;
-    protected BasicFactory factory;
-    protected SelectLoop listenSelectLoop;
-    protected ServerSocketChannel listenSock;
-    protected List<SelectLoop> switchSelectLoops;
-    protected Map<SocketChannel,OFSwitch> switchSockets;
-    protected Integer threadCount;
-    protected int port;
-
-    protected class OFSwitch {
-        protected SocketChannel sock;
-        protected OFMessageAsyncStream stream;
-        protected Map<Integer, Short> macTable =
-            new LRULinkedHashMap<Integer, Short>(64001, 64000);
-
-        public OFSwitch(SocketChannel sock, OFMessageAsyncStream stream) {
-            this.sock = sock;
-            this.stream = stream;
-        }
-
-        public void handlePacketIn(OFPacketIn pi) {
-            // Build the Match
-            OFMatch match = new OFMatch();
-            match.loadFromPacket(pi.getPacketData(), pi.getInPort());
-            byte[] dlDst = match.getDataLayerDestination();
-            Integer dlDstKey = Arrays.hashCode(dlDst);
-            byte[] dlSrc = match.getDataLayerSource();
-            Integer dlSrcKey = Arrays.hashCode(dlSrc);
-            int bufferId = pi.getBufferId();
-
-            // if the src is not multicast, learn it
-            if ((dlSrc[0] & 0x1) == 0) {
-                if (!macTable.containsKey(dlSrcKey) ||
-                        !macTable.get(dlSrcKey).equals(pi.getInPort())) {
-                    macTable.put(dlSrcKey, pi.getInPort());
-                }
-            }
-
-            Short outPort = null;
-            // if the destination is not multicast, look it up
-            if ((dlDst[0] & 0x1) == 0) {
-                outPort = macTable.get(dlDstKey);
-            }
-
-            // push a flow mod if we know where the packet should be going
-            if (outPort != null) {
-                OFFlowMod fm = (OFFlowMod) factory.getMessage(OFType.FLOW_MOD);
-                fm.setBufferId(bufferId);
-                fm.setCommand((short) 0);
-                fm.setCookie(0);
-                fm.setFlags((short) 0);
-                fm.setHardTimeout((short) 0);
-                fm.setIdleTimeout((short) 5);
-                match.setInputPort(pi.getInPort());
-                match.setWildcards(0);
-                fm.setMatch(match);
-                fm.setOutPort((short) OFPort.OFPP_NONE.getValue());
-                fm.setPriority((short) 0);
-                OFActionOutput action = new OFActionOutput();
-                action.setMaxLength((short) 0);
-                action.setPort(outPort);
-                List<OFAction> actions = new ArrayList<OFAction>();
-                actions.add(action);
-                fm.setActions(actions);
-                fm.setLength(U16.t(OFFlowMod.MINIMUM_LENGTH+OFActionOutput.MINIMUM_LENGTH));
-                try {
-                    stream.write(fm);
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-
-            // Send a packet out
-            if (outPort == null || pi.getBufferId() == 0xffffffff) {
-                OFPacketOut po = new OFPacketOut();
-                po.setBufferId(bufferId);
-                po.setInPort(pi.getInPort());
-
-                // set actions
-                OFActionOutput action = new OFActionOutput();
-                action.setMaxLength((short) 0);
-                action.setPort((short) ((outPort == null) ? OFPort.OFPP_FLOOD
-                        .getValue() : outPort));
-                List<OFAction> actions = new ArrayList<OFAction>();
-                actions.add(action);
-                po.setActions(actions);
-                po.setActionsLength((short) OFActionOutput.MINIMUM_LENGTH);
-
-                // set data if needed
-                if (bufferId == 0xffffffff) {
-                    byte[] packetData = pi.getPacketData();
-                    po.setLength(U16.t(OFPacketOut.MINIMUM_LENGTH
-                            + po.getActionsLength() + packetData.length));
-                    po.setPacketData(packetData);
-                } else {
-                    po.setLength(U16.t(OFPacketOut.MINIMUM_LENGTH
-                            + po.getActionsLength()));
-                }
-                try {
-                    stream.write(po);
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-
-        public String toString() {
-            InetAddress remote = sock.socket().getInetAddress();
-            return remote.getHostAddress() + ":" + sock.socket().getPort();
-        }
-
-        public OFMessageAsyncStream getStream() {
-            return stream;
-        }
-    }
-
-    public SimpleController(int port) throws IOException{
-        listenSock = ServerSocketChannel.open();
-        listenSock.configureBlocking(false);
-        listenSock.socket().bind(new java.net.InetSocketAddress(port));
-        listenSock.socket().setReuseAddress(true);
-        this.port = port;
-        switchSelectLoops = new ArrayList<SelectLoop>();
-        switchSockets = new ConcurrentHashMap<SocketChannel,OFSwitch>();
-        threadCount = 1;
-        listenSelectLoop = new SelectLoop(this);
-        // register this connection for accepting
-        listenSelectLoop.register(listenSock, SelectionKey.OP_ACCEPT, listenSock);
-
-        this.factory = new BasicFactory();
-    }
-
-    @Override
-    public void handleEvent(SelectionKey key, Object arg) throws IOException {
-        if (arg instanceof ServerSocketChannel)
-            handleListenEvent(key, (ServerSocketChannel)arg);
-        else
-            handleSwitchEvent(key, (SocketChannel) arg);
-    }
-
-    protected void handleListenEvent(SelectionKey key, ServerSocketChannel ssc)
-            throws IOException {
-        SocketChannel sock = listenSock.accept();
-        OFMessageAsyncStream stream = new OFMessageAsyncStream(sock, factory);
-        switchSockets.put(sock, new OFSwitch(sock, stream));
-        System.err
-                .println("Got new connection from " + switchSockets.get(sock));
-        List<OFMessage> l = new ArrayList<OFMessage>();
-        l.add(factory.getMessage(OFType.HELLO));
-        l.add(factory.getMessage(OFType.FEATURES_REQUEST));
-        stream.write(l);
-
-        int ops = SelectionKey.OP_READ;
-        if (stream.needsFlush())
-            ops |= SelectionKey.OP_WRITE;
-
-        // hash this switch into a thread
-        SelectLoop sl = switchSelectLoops.get(sock.hashCode()
-                % switchSelectLoops.size());
-        sl.register(sock, ops, sock);
-        // force select to return and re-enter using the new set of keys
-        sl.wakeup();
-    }
-
-    protected void handleSwitchEvent(SelectionKey key, SocketChannel sock) {
-        OFSwitch sw = switchSockets.get(sock);
-        OFMessageAsyncStream stream = sw.getStream();
-        try {
-            if (key.isReadable()) {
-                List<OFMessage> msgs = stream.read();
-                if (msgs == null) {
-                    key.cancel();
-                    switchSockets.remove(sock);
-                    return;
-                }
-
-                for (OFMessage m : msgs) {
-                    switch (m.getType()) {
-                        case PACKET_IN:
-                            sw.handlePacketIn((OFPacketIn) m);
-                            break;
-                        case HELLO:
-                            System.err.println("GOT HELLO from " + sw);
-                            break;
-                        case ECHO_REQUEST:
-                            OFEchoReply reply = (OFEchoReply) stream
-                                .getMessageFactory().getMessage(
-                                        OFType.ECHO_REPLY);
-                            reply.setXid(m.getXid());
-                            stream.write(reply);
-                            break;
-                        default:
-                            System.err.println("Unhandled OF message: "
-                                    + m.getType() + " from "
-                                    + sock.socket().getInetAddress());
-                    }
-                }
-            }
-            if (key.isWritable()) {
-                stream.flush();
-            }
-
-            /**
-             * Only register for interest in R OR W, not both, causes stream
-             * deadlock after some period of time
-             */
-            if (stream.needsFlush())
-                key.interestOps(SelectionKey.OP_WRITE);
-            else
-                key.interestOps(SelectionKey.OP_READ);
-        } catch (IOException e) {
-            // if we have an exception, disconnect the switch
-            key.cancel();
-            switchSockets.remove(sock);
-        }
-    }
-
-    public void run() throws IOException{
-        System.err.println("Starting " + this.getClass().getCanonicalName() + 
-                " on port " + this.port + " with " + this.threadCount + " threads");
-        // Static number of threads equal to processor cores
-        es = Executors.newFixedThreadPool(threadCount);
-
-        // Launch one select loop per threadCount and start running
-        for (int i = 0; i < threadCount; ++i) {
-            final SelectLoop sl = new SelectLoop(this);
-            switchSelectLoops.add(sl);
-            es.execute(new Runnable() {
-                @Override
-                public void run() {
-                    try {
-                        sl.doLoop();
-                    } catch (IOException e) {
-                        e.printStackTrace();
-                    }
-                }}
-            );
-        }
-
-        // Start the listen loop
-        listenSelectLoop.doLoop();
-    }
-
-    public static void main(String [] args) throws IOException {
-        SimpleCLI cmd = parseArgs(args);
-        int port = Integer.valueOf(cmd.getOptionValue("p"));
-        SimpleController sc = new SimpleController(port);
-        sc.threadCount = Integer.valueOf(cmd.getOptionValue("t"));
-        sc.run();
-    }
-
-    public static SimpleCLI parseArgs(String[] args) {
-        Options options = new Options();
-        options.addOption("h", "help", "print help");
-        // unused?
-        // options.addOption("n", true, "the number of packets to send");
-        options.addOption("p", "port", 6633, "the port to listen on");
-        options.addOption("t", "threads", 1, "the number of threads to run");
-        try {
-            SimpleCLI cmd = SimpleCLI.parse(options, args);
-            if (cmd.hasOption("h")) {
-                printUsage(options);
-                System.exit(0);
-            }
-            return cmd;
-        } catch (ParseException e) {
-            System.err.println(e);
-            printUsage(options);
-        }
-
-        System.exit(-1);
-        return null;
-    }
-
-    public static void printUsage(Options options) {
-        SimpleCLI.printHelp("Usage: "
-                + SimpleController.class.getCanonicalName() + " [options]",
-                options);
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/example/cli/Option.java b/third-party/openflowj/src/main/java/org/openflow/example/cli/Option.java
deleted file mode 100644 (file)
index acf8446..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.openflow.example.cli;
-
-public class Option {
-    String shortOpt;
-    String longOpt;
-    Object defaultVal;
-    String val; // current value of this option, string form
-    boolean specified; // was this option found in the cmdline?
-    String comment;
-
-    /**
-     * Option information storrage
-     * 
-     * @param shortOpt
-     *            Short name for the option, e.g., "-p"
-     * @param longOpt
-     *            Long name for option, e.g., "--port"
-     * @param defaultVal
-     *            default value: "6633" or null if no default value
-     * @param comment
-     *            String to print to explain this option, e.g., a help message
-     */
-    public Option(String shortOpt, String longOpt, Object defaultVal,
-            String comment) {
-        super();
-        this.shortOpt = shortOpt;
-        this.longOpt = longOpt;
-        this.defaultVal = defaultVal;
-        this.comment = comment;
-        this.specified = false;
-    }
-
-    public Option(String shortOpt, String longOpt, String comment) {
-        this(shortOpt, longOpt, null, comment);
-    }
-
-    public boolean needsArg() {
-        return this.defaultVal != null;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/example/cli/Options.java b/third-party/openflowj/src/main/java/org/openflow/example/cli/Options.java
deleted file mode 100644 (file)
index 7f55b50..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.openflow.example.cli;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Very basic CLI options listing
- * 
- * @author Rob Sherwood (rob.sherwood@stanford.edu)
- * 
- */
-
-public class Options {
-    Map<String, Option> shortOptionsMap;
-    Map<String, Option> longOptionsMap;
-
-    public Options() {
-        this.shortOptionsMap = new HashMap<String, Option>();
-        this.longOptionsMap = new HashMap<String, Option>();
-    }
-
-    public static Options make(Option opts[]) {
-        Options options = new Options();
-        for (int i = 0; i < opts.length; i++)
-            options.addOption(opts[i]);
-        return options;
-    }
-
-    private void addOption(Option option) {
-        if (option.shortOpt != null)
-            this.shortOptionsMap.put(option.shortOpt, option);
-        if (option.longOpt != null)
-            this.longOptionsMap.put(option.longOpt, option);
-    }
-
-    protected void addOption(String shortName, String longName, Object o,
-            String comment) {
-        Option option = new Option(shortName, longName, o, comment);
-        addOption(option);
-    }
-
-    public void addOption(String shortName, String longName, boolean b,
-            String comment) {
-        this.addOption(shortName, longName, Boolean.valueOf(b), comment);
-    }
-
-    public void addOption(String shortName, String longName, int i,
-            String comment) {
-        this.addOption(shortName, longName, Integer.valueOf(i), comment);
-    }
-
-    public Option getOption(String shortName) {
-        return this.shortOptionsMap.get(shortName);
-    }
-
-    public Option getOptionByLongName(String longName) {
-        return this.longOptionsMap.get(longName);
-    }
-
-    public Collection<Option> getOptions() {
-        return this.shortOptionsMap.values();
-    }
-
-    public void addOption(String shortName, String longName, String comment) {
-        this.addOption(shortName, longName, null, comment);
-    }
-
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/example/cli/ParseException.java b/third-party/openflowj/src/main/java/org/openflow/example/cli/ParseException.java
deleted file mode 100644 (file)
index a99e11d..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.openflow.example.cli;
-
-public class ParseException extends Exception {
-
-    public ParseException(String msg) {
-        super(msg);
-    }
-
-    /**
-     *
-     */
-    private static final long serialVersionUID = 1L;
-
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/example/cli/SimpleCLI.java b/third-party/openflowj/src/main/java/org/openflow/example/cli/SimpleCLI.java
deleted file mode 100644 (file)
index 8f37024..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-package org.openflow.example.cli;
-
-import java.io.PrintStream;
-
-/**
- * Very basic command line interface
- * 
- * (really should be something in java.* for this; only implementing this to
- * remove external dependencies)
- * 
- * Modeled after org.apache.common.cli .
- * 
- * @author Rob Sherwood (rob.sherwood@stanford.edu)
- * 
- */
-
-public class SimpleCLI {
-
-    private static final String NAME_WIDTH = "-15";
-    private static final String VALUE_WIDTH = "-20";
-    private static final String FORMAT_STRING = "%1$" + NAME_WIDTH + "s%2$"
-            + VALUE_WIDTH + "s%3$s\n";
-    Options options;
-
-    int optind;
-
-    /**
-     * Need to use SimpleCLI.parse() instead
-     * 
-     * @param options
-     */
-
-    private SimpleCLI(Options options) {
-        this.options = options;
-    }
-
-    /**
-     * @return the index of the last parsed option
-     * 
-     *         Useful for finding options that don't start with "-" or "--"
-     */
-    public int getOptind() {
-        return optind;
-    }
-
-    /**
-     * @param optind
-     *            the optind to set
-     */
-    public void setOptind(int optind) {
-        this.optind = optind;
-    }
-
-    public boolean hasOption(String shortName) {
-        Option option = this.options.getOption(shortName);
-        if (option == null)
-            return false;
-        return option.specified;
-    }
-
-    public String getOptionValue(String shortName) {
-        Option option = this.options.getOption(shortName);
-        if (option == null)
-            return null;
-        if (!option.specified)
-            return option.defaultVal.toString();
-        else
-            return option.val;
-    }
-
-    public static SimpleCLI parse(Options options, String[] args)
-            throws ParseException {
-        SimpleCLI simpleCLI = new SimpleCLI(options);
-        int i;
-        for (i = 0; i < args.length; i++) {
-            if (!args[i].startsWith("-"))
-                break; // not a short or long option
-            String optName = args[i].replaceFirst("^-*", ""); // remove leading
-            // "--"
-            Option option;
-            if (args[i].startsWith("--"))
-                option = options.getOptionByLongName(optName);
-            else
-                option = options.getOption(optName);
-            if (option == null)
-                throw new ParseException("unknown option: " + optName);
-            option.specified = true;
-            if (option.needsArg()) {
-                if ((i + 1) >= args.length)
-                    throw new ParseException("option " + optName
-                            + " requires an argument:: " + option.comment);
-                option.val = args[i + 1];
-                i++; // skip next element; we've parsed it
-            }
-        }
-        simpleCLI.setOptind(i);
-        return simpleCLI;
-    }
-
-    public static void printHelp(String canonicalName, Options options) {
-        printHelp(canonicalName, options, System.err);
-    }
-
-    private static void printHelp(String helpString, Options options,
-            PrintStream err) {
-        err.println(helpString);
-        err.format(FORMAT_STRING, "\toption", "type [default]", "usage");
-        for (Option option : options.getOptions()) {
-            String msg = "\t";
-            if (option.shortOpt != null)
-                msg += "-" + option.shortOpt;
-            if (option.longOpt != null) {
-                if (!msg.equals("\t"))
-                    msg += "|";
-                msg += "--" + option.longOpt;
-            }
-            String val = "";
-            if (option.defaultVal != null)
-                val += option.defaultVal.getClass().getSimpleName() + " ["
-                        + option.defaultVal.toString() + "]";
-            String comment;
-            if (option.comment != null)
-                comment = option.comment;
-            else
-                comment = "";
-
-            err.format(FORMAT_STRING, msg, val, comment);
-        }
-        err.println(""); // print blank line at the end, to look pretty
-    }
-
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/io/OFMessageAsyncStream.java b/third-party/openflowj/src/main/java/org/openflow/io/OFMessageAsyncStream.java
deleted file mode 100644 (file)
index c499b99..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- *
- */
-package org.openflow.io;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.channels.SocketChannel;
-import java.util.List;
-
-import org.openflow.protocol.OFMessage;
-import org.openflow.protocol.factory.OFMessageFactory;
-
-/**
- * Asynchronous OpenFlow message marshalling and unmarshalling stream wrapped
- * around an NIO SocketChannel
- * 
- * @author Rob Sherwood (rob.sherwood@stanford.edu)
- * @author David Erickson (daviderickson@cs.stanford.edu)
- * 
- */
-public class OFMessageAsyncStream implements OFMessageInStream,
-        OFMessageOutStream {
-    static public int defaultBufferSize = 1048576; // 1MB
-
-    protected ByteBuffer inBuf, outBuf;
-    protected OFMessageFactory messageFactory;
-    protected SocketChannel sock;
-    protected int partialReadCount = 0;
-
-    public OFMessageAsyncStream(SocketChannel sock,
-            OFMessageFactory messageFactory) throws IOException {
-        inBuf = ByteBuffer
-                .allocateDirect(OFMessageAsyncStream.defaultBufferSize);
-        outBuf = ByteBuffer
-                .allocateDirect(OFMessageAsyncStream.defaultBufferSize);
-        this.sock = sock;
-        this.messageFactory = messageFactory;
-        this.sock.configureBlocking(false);
-    }
-
-    @Override
-    public List<OFMessage> read() throws IOException {
-        return this.read(0);
-    }
-
-    @Override
-    public List<OFMessage> read(int limit) throws IOException {
-        List<OFMessage> l;
-        int read = sock.read(inBuf);
-        if (read == -1)
-            return null;
-        inBuf.flip();
-        l = messageFactory.parseMessages(inBuf, limit);
-        if (inBuf.hasRemaining())
-            inBuf.compact();
-        else
-            inBuf.clear();
-        return l;
-    }
-
-    protected void appendMessageToOutBuf(OFMessage m) throws IOException {
-        int msglen = m.getLengthU();
-        if (outBuf.remaining() < msglen) {
-            throw new IOException(
-                    "Message length exceeds buffer capacity: " + msglen);
-        }
-        m.writeTo(outBuf);
-    }
-
-    /**
-     * Buffers a single outgoing openflow message
-     */
-    @Override
-    public void write(OFMessage m) throws IOException {
-        appendMessageToOutBuf(m);
-    }
-
-    /**
-     * Buffers a list of OpenFlow messages
-     */
-    @Override
-    public void write(List<OFMessage> l) throws IOException {
-        for (OFMessage m : l) {
-            appendMessageToOutBuf(m);
-        }
-    }
-
-    /**
-     * Flush buffered outgoing data. Keep flushing until needsFlush() returns
-     * false. Each flush() corresponds to a SocketChannel.write(), so this is
-     * designed for one flush() per select() event
-     */
-    public void flush() throws IOException {
-        outBuf.flip(); // swap pointers; lim = pos; pos = 0;
-        sock.write(outBuf); // write data starting at pos up to lim
-        outBuf.compact();
-    }
-
-    /**
-     * Is there outgoing buffered data that needs to be flush()'d?
-     */
-    public boolean needsFlush() {
-        return outBuf.position() > 0;
-    }
-
-    /**
-     * @return the messageFactory
-     */
-    public OFMessageFactory getMessageFactory() {
-        return messageFactory;
-    }
-
-    /**
-     * @param messageFactory
-     *            the messageFactory to set
-     */
-    public void setMessageFactory(OFMessageFactory messageFactory) {
-        this.messageFactory = messageFactory;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/io/OFMessageInStream.java b/third-party/openflowj/src/main/java/org/openflow/io/OFMessageInStream.java
deleted file mode 100644 (file)
index 39ec30d..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- *
- */
-package org.openflow.io;
-
-import java.util.List;
-
-import org.openflow.protocol.OFMessage;
-import org.openflow.protocol.factory.OFMessageFactory;
-
-/**
- * Interface for reading OFMessages from a buffered stream
- * 
- * @author Rob Sherwood (rob.sherwood@stanford.edu)
- * 
- */
-public interface OFMessageInStream {
-    /**
-     * Read OF messages from the stream
-     * 
-     * @return a list of OF Messages, empty if no complete messages are
-     *         available, null if the stream has closed
-     */
-    public List<OFMessage> read() throws java.io.IOException;
-
-    /**
-     * Read OF messages from the stream
-     * 
-     * @param limit
-     *            The maximum number of messages to read: 0 means all that are
-     *            buffered
-     * @return a list of OF Messages, empty if no complete messages are
-     *         available, null if the stream has closed
-     * 
-     */
-    public List<OFMessage> read(int limit) throws java.io.IOException;
-
-    /**
-     * Sets the OFMessageFactory used to create messages on this stream
-     * 
-     * @param factory
-     */
-    public void setMessageFactory(OFMessageFactory factory);
-
-    /**
-     * Returns the OFMessageFactory used to create messages on this stream
-     * 
-     * @return
-     */
-    public OFMessageFactory getMessageFactory();
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/io/OFMessageOutStream.java b/third-party/openflowj/src/main/java/org/openflow/io/OFMessageOutStream.java
deleted file mode 100644 (file)
index 56416ce..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- *
- */
-package org.openflow.io;
-
-import java.util.List;
-import org.openflow.protocol.OFMessage;
-
-/**
- * Interface for writing OFMessages to a buffered stream
- *
- * @author Rob Sherwood (rob.sherwood@stanford.edu)
- *
- */
-public interface OFMessageOutStream {
-    /**
-     * Write an OpenFlow message to the stream
-     * @param m An OF Message
-     */
-    public void write(OFMessage m) throws java.io.IOException;
-
-    /**
-     * Write an OpenFlow message to the stream.
-     *  Messages are sent in one large write() for efficiency
-     * @param l A list of OF Messages
-     */
-    public void write(List<OFMessage> l) throws java.io.IOException;
-
-    /**
-     * Pushes buffered data out the Stream; this is NOT guranteed to flush all
-     * data, multiple flush() calls may be required, until needFlush() returns
-     * false.
-     */
-    public void flush() throws java.io.IOException;
-
-    /**
-     * Is there buffered data that needs to be flushed?
-     * @return true if there is buffered data and flush() should be called
-     */
-    public boolean needsFlush();
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/Instantiable.java b/third-party/openflowj/src/main/java/org/openflow/protocol/Instantiable.java
deleted file mode 100644 (file)
index 38a3af0..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.openflow.protocol;
-
-/**
- *
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public interface Instantiable<E> {
-
-    /**
-     * Create a new instance of a given subclass.
-     * @return the new instance.
-     */
-    public E instantiate();
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFBarrierReply.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFBarrierReply.java
deleted file mode 100644 (file)
index 5a06efb..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.openflow.protocol;
-
-import org.openflow.util.U16;
-
-/**
- * Represents an OFPT_BARRIER_REPLY message
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFBarrierReply extends OFMessage {
-    public OFBarrierReply() {
-        super();
-        this.type = OFType.BARRIER_REPLY;
-        this.length = U16.t(OFMessage.MINIMUM_LENGTH);
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFBarrierRequest.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFBarrierRequest.java
deleted file mode 100644 (file)
index 3f6a8f5..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.openflow.protocol;
-
-import org.openflow.util.U16;
-
-/**
- * Represents an OFPT_BARRIER_REQUEST message
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFBarrierRequest extends OFMessage {
-    public OFBarrierRequest() {
-        super();
-        this.type = OFType.BARRIER_REQUEST;
-        this.length = U16.t(OFMessage.MINIMUM_LENGTH);
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFEchoReply.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFEchoReply.java
deleted file mode 100644 (file)
index 1f26104..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.openflow.protocol;
-
-import org.openflow.util.U16;
-
-/**
- * Represents an ofp_echo_reply message
- * 
- * @author Rob Sherwood (rob.sherwood@stanford.edu)
- */
-
-public class OFEchoReply extends OFEchoRequest {
-    public static int MINIMUM_LENGTH = 8;
-
-    public OFEchoReply() {
-        super();
-        this.type = OFType.ECHO_REPLY;
-        this.length = U16.t(MINIMUM_LENGTH);
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFEchoRequest.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFEchoRequest.java
deleted file mode 100644 (file)
index a88850e..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-
-import org.openflow.util.U16;
-
-/**
- * Represents an ofp_echo_request message
- * 
- * @author Rob Sherwood (rob.sherwood@stanford.edu)
- */
-
-public class OFEchoRequest extends OFMessage {
-    public static int MINIMUM_LENGTH = 8;
-    byte[] payload;
-
-    public OFEchoRequest() {
-        super();
-        this.type = OFType.ECHO_REQUEST;
-        this.length = U16.t(MINIMUM_LENGTH);
-    }
-
-    @Override
-    public void readFrom(ByteBuffer bb) {
-        super.readFrom(bb);
-        int datalen = this.getLengthU() - MINIMUM_LENGTH;
-        if (datalen > 0) {
-            this.payload = new byte[datalen];
-            bb.get(payload);
-        }
-    }
-
-    /**
-     * @return the payload
-     */
-    public byte[] getPayload() {
-        return payload;
-    }
-
-    /**
-     * @param payload
-     *            the payload to set
-     */
-    public void setPayload(byte[] payload) {
-        this.payload = payload;
-    }
-
-    @Override
-    public void writeTo(ByteBuffer bb) {
-        super.writeTo(bb);
-        if (payload != null)
-            bb.put(payload);
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFError.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFError.java
deleted file mode 100644 (file)
index 361a03b..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import java.util.List;
-
-import org.openflow.protocol.factory.OFMessageFactory;
-import org.openflow.protocol.factory.OFMessageFactoryAware;
-import org.openflow.util.U16;
-
-/**
- * Represents an ofp_error_msg
- * 
- * @author David Erickson (daviderickson@cs.stanford.edu)
- * @author Rob Sherwood (rob.sherwood@stanford.edu)
- */
-public class OFError extends OFMessage implements OFMessageFactoryAware {
-    public static int MINIMUM_LENGTH = 12;
-
-    public enum OFErrorType {
-        OFPET_HELLO_FAILED, OFPET_BAD_REQUEST, OFPET_BAD_ACTION, OFPET_FLOW_MOD_FAILED, OFPET_PORT_MOD_FAILED, OFPET_QUEUE_OP_FAILED
-    }
-
-    public enum OFHelloFailedCode {
-        OFPHFC_INCOMPATIBLE, OFPHFC_EPERM
-    }
-
-    public enum OFBadRequestCode {
-        OFPBRC_BAD_VERSION, OFPBRC_BAD_TYPE, OFPBRC_BAD_STAT, OFPBRC_BAD_VENDOR, OFPBRC_BAD_SUBTYPE, OFPBRC_EPERM, OFPBRC_BAD_LEN, OFPBRC_BUFFER_EMPTY, OFPBRC_BUFFER_UNKNOWN
-    }
-
-    public enum OFBadActionCode {
-        OFPBAC_BAD_TYPE, OFPBAC_BAD_LEN, OFPBAC_BAD_VENDOR, OFPBAC_BAD_VENDOR_TYPE, OFPBAC_BAD_OUT_PORT, OFPBAC_BAD_ARGUMENT, OFPBAC_EPERM, OFPBAC_TOO_MANY, OFPBAC_BAD_QUEUE
-    }
-
-    public enum OFFlowModFailedCode {
-        OFPFMFC_ALL_TABLES_FULL, OFPFMFC_OVERLAP, OFPFMFC_EPERM, OFPFMFC_BAD_EMERG_TIMEOUT, OFPFMFC_BAD_COMMAND, OFPFMFC_UNSUPPORTED
-    }
-
-    public enum OFPortModFailedCode {
-        OFPPMFC_BAD_PORT, OFPPMFC_BAD_HW_ADDR
-    }
-
-    public enum OFQueueOpFailedCode {
-        OFPQOFC_BAD_PORT, OFPQOFC_BAD_QUEUE, OFPQOFC_EPERM
-    }
-
-    protected short errorType;
-    protected short errorCode;
-    protected OFMessageFactory factory;
-    protected byte[] error;
-    protected boolean errorIsAscii;
-
-    public OFError() {
-        super();
-        this.type = OFType.ERROR;
-        this.length = U16.t(MINIMUM_LENGTH);
-    }
-
-    /**
-     * @return the errorType
-     */
-    public short getErrorType() {
-        return errorType;
-    }
-
-    /**
-     * @param errorType
-     *            the errorType to set
-     */
-    public void setErrorType(short errorType) {
-        this.errorType = errorType;
-    }
-
-    public void setErrorType(OFErrorType type) {
-        this.errorType = (short) type.ordinal();
-    }
-
-    /**
-     * @return the errorCode
-     */
-    public short getErrorCode() {
-        return errorCode;
-    }
-
-    /**
-     * @param errorCode
-     *            the errorCode to set
-     */
-    public void setErrorCode(OFHelloFailedCode code) {
-        this.errorCode = (short) code.ordinal();
-    }
-
-    public void setErrorCode(short errorCode) {
-        this.errorCode = errorCode;
-    }
-
-    public void setErrorCode(OFBadRequestCode code) {
-        this.errorCode = (short) code.ordinal();
-    }
-
-    public void setErrorCode(OFBadActionCode code) {
-        this.errorCode = (short) code.ordinal();
-    }
-
-    public void setErrorCode(OFFlowModFailedCode code) {
-        this.errorCode = (short) code.ordinal();
-    }
-
-    public void setErrorCode(OFPortModFailedCode code) {
-        this.errorCode = (short) code.ordinal();
-    }
-
-    public void setErrorCode(OFQueueOpFailedCode code) {
-        this.errorCode = (short) code.ordinal();
-    }
-
-    public OFMessage getOffendingMsg() {
-        // should only have one message embedded; if more than one, just
-        // grab first
-        if (this.error == null)
-            return null;
-        ByteBuffer errorMsg = ByteBuffer.wrap(this.error);
-        if (factory == null)
-            throw new RuntimeException("MessageFactory not set");
-        List<OFMessage> messages = this.factory.parseMessages(errorMsg,
-                error.length);
-        // OVS apparently sends partial messages in errors
-        // need to be careful of that AND can't use data.limit() as
-        // a packet boundary because there could be more data queued
-        if (messages.size() > 0) {
-            return messages.get(0);
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Write this offending message into the payload of the Error message
-     * 
-     * @param offendingMsg
-     */
-
-    public void setOffendingMsg(OFMessage offendingMsg) {
-        if (offendingMsg == null) {
-            super.setLengthU(MINIMUM_LENGTH);
-        } else {
-            this.error = new byte[offendingMsg.getLengthU()];
-            ByteBuffer data = ByteBuffer.wrap(this.error);
-            offendingMsg.writeTo(data);
-            super.setLengthU(MINIMUM_LENGTH + offendingMsg.getLengthU());
-        }
-    }
-
-    public OFMessageFactory getFactory() {
-        return factory;
-    }
-
-    @Override
-    public void setMessageFactory(OFMessageFactory factory) {
-        this.factory = factory;
-    }
-
-    /**
-     * @return the error
-     */
-    public byte[] getError() {
-        return error;
-    }
-
-    /**
-     * @param error
-     *            the error to set
-     */
-    public void setError(byte[] error) {
-        this.error = error;
-    }
-
-    /**
-     * @return the errorIsAscii
-     */
-    public boolean isErrorIsAscii() {
-        return errorIsAscii;
-    }
-
-    /**
-     * @param errorIsAscii
-     *            the errorIsAscii to set
-     */
-    public void setErrorIsAscii(boolean errorIsAscii) {
-        this.errorIsAscii = errorIsAscii;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.errorType = data.getShort();
-        this.errorCode = data.getShort();
-        int dataLength = this.getLengthU() - MINIMUM_LENGTH;
-        if (dataLength > 0) {
-            this.error = new byte[dataLength];
-            data.get(this.error);
-            if (this.errorType == OFErrorType.OFPET_HELLO_FAILED.ordinal())
-                this.errorIsAscii = true;
-        }
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.putShort(errorType);
-        data.putShort(errorCode);
-        if (error != null)
-            data.put(error);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see java.lang.Object#hashCode()
-     */
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + Arrays.hashCode(error);
-        result = prime * result + errorCode;
-        result = prime * result + (errorIsAscii ? 1231 : 1237);
-        result = prime * result + errorType;
-        return result;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        OFError other = (OFError) obj;
-        if (!Arrays.equals(error, other.error))
-            return false;
-        if (errorCode != other.errorCode)
-            return false;
-        if (errorIsAscii != other.errorIsAscii)
-            return false;
-        if (errorType != other.errorType)
-            return false;
-        return true;
-    }
-
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFFeaturesReply.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFFeaturesReply.java
deleted file mode 100644 (file)
index 8447d88..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-package org.openflow.protocol;
-
-import java.io.Serializable;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.openflow.util.U16;
-
-
-/**
- * Represents a features reply message
- * @author David Erickson (daviderickson@cs.stanford.edu)
- *
- */
-public class OFFeaturesReply extends OFMessage implements Serializable {
-    public static int MINIMUM_LENGTH = 32;
-
-    /**
-     * Corresponds to bits on the capabilities field
-     */
-    public enum OFCapabilities {
-        OFPC_FLOW_STATS     (1 << 0),
-        OFPC_TABLE_STATS    (1 << 1),
-        OFPC_PORT_STATS     (1 << 2),
-        OFPC_STP            (1 << 3),
-        OFPC_RESERVED       (1 << 4),
-        OFPC_IP_REASM       (1 << 5),
-        OFPC_QUEUE_STATS    (1 << 6),
-        OFPC_ARP_MATCH_IP   (1 << 7);
-
-        protected int value;
-
-        private OFCapabilities(int value) {
-            this.value = value;
-        }
-
-        /**
-         * @return the value
-         */
-        public int getValue() {
-            return value;
-        }
-    }
-
-    protected long datapathId;
-    protected int buffers;
-    protected byte tables;
-    protected int capabilities;
-    protected int actions;
-    protected List<OFPhysicalPort> ports;
-
-    public OFFeaturesReply() {
-        super();
-        this.type = OFType.FEATURES_REPLY;
-        this.length = U16.t(MINIMUM_LENGTH);
-    }
-
-    /**
-     * @return the datapathId
-     */
-    public long getDatapathId() {
-        return datapathId;
-    }
-
-    /**
-     * @param datapathId the datapathId to set
-     */
-    public void setDatapathId(long datapathId) {
-        this.datapathId = datapathId;
-    }
-
-    /**
-     * @return the buffers
-     */
-    public int getBuffers() {
-        return buffers;
-    }
-
-    /**
-     * @param buffers the buffers to set
-     */
-    public void setBuffers(int buffers) {
-        this.buffers = buffers;
-    }
-
-    /**
-     * @return the tables
-     */
-    public byte getTables() {
-        return tables;
-    }
-
-    /**
-     * @param tables the tables to set
-     */
-    public void setTables(byte tables) {
-        this.tables = tables;
-    }
-
-    /**
-     * @return the capabilities
-     */
-    public int getCapabilities() {
-        return capabilities;
-    }
-
-    /**
-     * @param capabilities the capabilities to set
-     */
-    public void setCapabilities(int capabilities) {
-        this.capabilities = capabilities;
-    }
-
-    /**
-     * @return the actions
-     */
-    public int getActions() {
-        return actions;
-    }
-
-    /**
-     * @param actions the actions to set
-     */
-    public void setActions(int actions) {
-        this.actions = actions;
-    }
-
-    /**
-     * @return the ports
-     */
-    public List<OFPhysicalPort> getPorts() {
-        return ports;
-    }
-
-    /**
-     * @param ports the ports to set
-     */
-    public void setPorts(List<OFPhysicalPort> ports) {
-        this.ports = ports;
-        if (ports == null) {
-            this.setLengthU(MINIMUM_LENGTH);
-        } else {
-            this.setLengthU(MINIMUM_LENGTH + ports.size()
-                    * OFPhysicalPort.MINIMUM_LENGTH);
-        }
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.datapathId = data.getLong();
-        this.buffers = data.getInt();
-        this.tables = data.get();
-        data.position(data.position() + 3); // pad
-        this.capabilities = data.getInt();
-        this.actions = data.getInt();
-        if (this.ports == null) {
-            this.ports = new ArrayList<OFPhysicalPort>();
-        } else {
-            this.ports.clear();
-        }
-        int portCount = (super.getLengthU() - 32)
-                / OFPhysicalPort.MINIMUM_LENGTH;
-        OFPhysicalPort port;
-        for (int i = 0; i < portCount; ++i) {
-            port = new OFPhysicalPort();
-            port.readFrom(data);
-            this.ports.add(port);
-        }
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.putLong(this.datapathId);
-        data.putInt(this.buffers);
-        data.put(this.tables);
-        data.putShort((short) 0); // pad
-        data.put((byte) 0); // pad
-        data.putInt(this.capabilities);
-        data.putInt(this.actions);
-        if (this.ports != null)
-            for (OFPhysicalPort port : this.ports) {
-                port.writeTo(data);
-            }
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 139;
-        int result = super.hashCode();
-        result = prime * result + actions;
-        result = prime * result + buffers;
-        result = prime * result + capabilities;
-        result = prime * result + (int) (datapathId ^ (datapathId >>> 32));
-        result = prime * result + ((ports == null) ? 0 : ports.hashCode());
-        result = prime * result + tables;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof OFFeaturesReply)) {
-            return false;
-        }
-        OFFeaturesReply other = (OFFeaturesReply) obj;
-        if (actions != other.actions) {
-            return false;
-        }
-        if (buffers != other.buffers) {
-            return false;
-        }
-        if (capabilities != other.capabilities) {
-            return false;
-        }
-        if (datapathId != other.datapathId) {
-            return false;
-        }
-        if (ports == null) {
-            if (other.ports != null) {
-                return false;
-            }
-        } else if (!ports.equals(other.ports)) {
-            return false;
-        }
-        if (tables != other.tables) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFFeaturesRequest.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFFeaturesRequest.java
deleted file mode 100644 (file)
index 8c9001a..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.openflow.protocol;
-
-import org.openflow.util.U16;
-
-
-/**
- * Represents a features request message
- * @author David Erickson (daviderickson@cs.stanford.edu)
- *
- */
-public class OFFeaturesRequest extends OFMessage {
-    public static int MINIMUM_LENGTH = 8;
-
-    public OFFeaturesRequest() {
-        super();
-        this.type = OFType.FEATURES_REQUEST;
-        this.length = U16.t(MINIMUM_LENGTH);
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFFlowMod.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFFlowMod.java
deleted file mode 100644 (file)
index 92eac4e..0000000
+++ /dev/null
@@ -1,371 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.openflow.protocol.action.OFAction;
-import org.openflow.protocol.factory.OFActionFactory;
-import org.openflow.protocol.factory.OFActionFactoryAware;
-import org.openflow.util.U16;
-
-/**
- * Represents an ofp_flow_mod message
- * @author David Erickson (daviderickson@cs.stanford.edu)
- *
- */
-public class OFFlowMod extends OFMessage implements OFActionFactoryAware, Cloneable {
-    public static int MINIMUM_LENGTH = 72;
-
-    public static final short OFPFC_ADD = 0;                /* New flow. */
-    public static final short OFPFC_MODIFY = 1;             /* Modify all matching flows. */
-    public static final short OFPFC_MODIFY_STRICT = 2;      /* Modify entry strictly matching wildcards */
-    public static final short OFPFC_DELETE=3;               /* Delete all matching flows. */
-    public static final short OFPFC_DELETE_STRICT =4;       /* Strictly match wildcards and priority. */
-
-    protected OFActionFactory actionFactory;
-    protected OFMatch match;
-    protected long cookie;
-    protected short command;
-    protected short idleTimeout;
-    protected short hardTimeout;
-    protected short priority;
-    protected int bufferId;
-    protected short outPort;
-    protected short flags;
-    protected List<OFAction> actions;
-
-    public OFFlowMod() {
-        super();
-        this.type = OFType.FLOW_MOD;
-        this.length = U16.t(MINIMUM_LENGTH);
-    }
-
-    /**
-     * Get buffer_id
-     * @return
-     */
-    public int getBufferId() {
-        return this.bufferId;
-    }
-
-    /**
-     * Set buffer_id
-     * @param bufferId
-     */
-    public OFFlowMod setBufferId(int bufferId) {
-        this.bufferId = bufferId;
-        return this;
-    }
-
-    /**
-     * Get cookie
-     * @return
-     */
-    public long getCookie() {
-        return this.cookie;
-    }
-
-    /**
-     * Set cookie
-     * @param cookie
-     */
-    public OFFlowMod setCookie(long cookie) {
-        this.cookie = cookie;
-        return this;
-    }
-
-    /**
-     * Get command
-     * @return
-     */
-    public short getCommand() {
-        return this.command;
-    }
-
-    /**
-     * Set command
-     * @param command
-     */
-    public OFFlowMod setCommand(short command) {
-        this.command = command;
-        return this;
-    }
-
-    /**
-     * Get flags
-     * @return
-     */
-    public short getFlags() {
-        return this.flags;
-    }
-
-    /**
-     * Set flags
-     * @param flags
-     */
-    public OFFlowMod setFlags(short flags) {
-        this.flags = flags;
-        return this;
-    }
-
-    /**
-     * Get hard_timeout
-     * @return
-     */
-    public short getHardTimeout() {
-        return this.hardTimeout;
-    }
-
-    /**
-     * Set hard_timeout
-     * @param hardTimeout
-     */
-    public OFFlowMod setHardTimeout(short hardTimeout) {
-        this.hardTimeout = hardTimeout;
-        return this;
-    }
-
-    /**
-     * Get idle_timeout
-     * @return
-     */
-    public short getIdleTimeout() {
-        return this.idleTimeout;
-    }
-
-    /**
-     * Set idle_timeout
-     * @param idleTimeout
-     */
-    public OFFlowMod setIdleTimeout(short idleTimeout) {
-        this.idleTimeout = idleTimeout;
-        return this;
-    }
-
-    /**
-     * Gets a copy of the OFMatch object for this FlowMod, changes to this
-     * object do not modify the FlowMod
-     * @return
-     */
-    public OFMatch getMatch() {
-        return this.match;
-    }
-
-    /**
-     * Set match
-     * @param match
-     */
-    public OFFlowMod setMatch(OFMatch match) {
-        this.match = match;
-        return this;
-    }
-
-    /**
-     * Get out_port
-     * @return
-     */
-    public short getOutPort() {
-        return this.outPort;
-    }
-
-    /**
-     * Set out_port
-     * @param outPort
-     */
-    public OFFlowMod setOutPort(short outPort) {
-        this.outPort = outPort;
-        return this;
-    }
-
-    /**
-     * Set out_port
-     * @param port
-     */
-    public OFFlowMod setOutPort(OFPort port) {
-        this.outPort = port.getValue();
-        return this;
-    }
-
-    /**
-     * Get priority
-     * @return
-     */
-    public short getPriority() {
-        return this.priority;
-    }
-
-    /**
-     * Set priority
-     * @param priority
-     */
-    public OFFlowMod setPriority(short priority) {
-        this.priority = priority;
-        return this;
-    }
-
-    /**
-     * Returns read-only copies of the actions contained in this Flow Mod
-     * @return a list of ordered OFAction objects
-     */
-    public List<OFAction> getActions() {
-        return this.actions;
-    }
-
-    /**
-     * Sets the list of actions this Flow Mod contains
-     * @param actions a list of ordered OFAction objects
-     */
-    public OFFlowMod setActions(List<OFAction> actions) {
-        this.actions = actions;
-        return this;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        if (this.match == null)
-            this.match = new OFMatch();
-        this.match.readFrom(data);
-        this.cookie = data.getLong();
-        this.command = data.getShort();
-        this.idleTimeout = data.getShort();
-        this.hardTimeout = data.getShort();
-        this.priority = data.getShort();
-        this.bufferId = data.getInt();
-        this.outPort = data.getShort();
-        this.flags = data.getShort();
-        if (this.actionFactory == null)
-            throw new RuntimeException("OFActionFactory not set");
-        this.actions = this.actionFactory.parseActions(data, getLengthU() -
-                MINIMUM_LENGTH);
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        this.match.writeTo(data);
-        data.putLong(cookie);
-        data.putShort(command);
-        data.putShort(idleTimeout);
-        data.putShort(hardTimeout);
-        data.putShort(priority);
-        data.putInt(bufferId);
-        data.putShort(outPort);
-        data.putShort(flags);
-        if (actions != null) {
-            for (OFAction action : actions) {
-                action.writeTo(data);
-            }
-        }
-    }
-
-    @Override
-    public void setActionFactory(OFActionFactory actionFactory) {
-        this.actionFactory = actionFactory;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 227;
-        int result = super.hashCode();
-        result = prime * result + ((actions == null) ? 0 : actions.hashCode());
-        result = prime * result + bufferId;
-        result = prime * result + command;
-        result = prime * result + (int) (cookie ^ (cookie >>> 32));
-        result = prime * result + flags;
-        result = prime * result + hardTimeout;
-        result = prime * result + idleTimeout;
-        result = prime * result + ((match == null) ? 0 : match.hashCode());
-        result = prime * result + outPort;
-        result = prime * result + priority;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof OFFlowMod)) {
-            return false;
-        }
-        OFFlowMod other = (OFFlowMod) obj;
-        if (actions == null) {
-            if (other.actions != null) {
-                return false;
-            }
-        } else if (!actions.equals(other.actions)) {
-            return false;
-        }
-        if (bufferId != other.bufferId) {
-            return false;
-        }
-        if (command != other.command) {
-            return false;
-        }
-        if (cookie != other.cookie) {
-            return false;
-        }
-        if (flags != other.flags) {
-            return false;
-        }
-        if (hardTimeout != other.hardTimeout) {
-            return false;
-        }
-        if (idleTimeout != other.idleTimeout) {
-            return false;
-        }
-        if (match == null) {
-            if (other.match != null) {
-                return false;
-            }
-        } else if (!match.equals(other.match)) {
-            return false;
-        }
-        if (outPort != other.outPort) {
-            return false;
-        }
-        if (priority != other.priority) {
-            return false;
-        }
-        return true;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#clone()
-     */
-    @Override
-    public OFFlowMod clone() {
-        try {
-            OFMatch neoMatch = match.clone();
-            OFFlowMod flowMod = (OFFlowMod) super.clone();
-            flowMod.setMatch(neoMatch);
-            List<OFAction> neoActions = new LinkedList<OFAction>();
-            for(OFAction action: this.actions)
-                neoActions.add((OFAction) action.clone());
-            flowMod.setActions(neoActions);
-            return flowMod;
-        } catch (CloneNotSupportedException e) {
-            // Won't happen
-            throw new RuntimeException(e);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#toString()
-     */
-    @Override
-    public String toString() {
-        return "OFFlowMod [actionFactory=" + actionFactory + ", actions="
-                + actions + ", bufferId=" + bufferId + ", command=" + command
-                + ", cookie=" + cookie + ", flags=" + flags + ", hardTimeout="
-                + hardTimeout + ", idleTimeout=" + idleTimeout + ", match="
-                + match + ", outPort=" + outPort + ", priority=" + priority
-                + ", length=" + length + ", type=" + type + ", version="
-                + version + ", xid=" + xid + "]";
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFFlowRemoved.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFFlowRemoved.java
deleted file mode 100644 (file)
index 56c32f1..0000000
+++ /dev/null
@@ -1,273 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-
-import org.openflow.util.U16;
-
-/**
- * Represents an ofp_flow_removed message
- * @author David Erickson (daviderickson@cs.stanford.edu)
- *
- */
-public class OFFlowRemoved extends OFMessage {
-    public static int MINIMUM_LENGTH = 88;
-
-    public enum OFFlowRemovedReason {
-        OFPRR_IDLE_TIMEOUT,
-        OFPRR_HARD_TIMEOUT,
-        OFPRR_DELETE
-    }
-
-    protected OFMatch match;
-    protected long cookie;
-    protected short priority;
-    protected OFFlowRemovedReason reason;
-    protected int durationSeconds;
-    protected int durationNanoseconds;
-    protected short idleTimeout;
-    protected long packetCount;
-    protected long byteCount;
-    
-    public OFFlowRemoved() {
-        super();
-        this.type = OFType.FLOW_REMOVED;
-        this.length = U16.t(MINIMUM_LENGTH);
-    }
-
-    /**
-     * Get cookie
-     * @return
-     */
-    public long getCookie() {
-        return this.cookie;
-    }
-
-    /**
-     * Set cookie
-     * @param cookie
-     */
-    public void setCookie(long cookie) {
-        this.cookie = cookie;
-    }
-
-    /**
-     * Get idle_timeout
-     * @return
-     */
-    public short getIdleTimeout() {
-        return this.idleTimeout;
-    }
-
-    /**
-     * Set idle_timeout
-     * @param idleTimeout
-     */
-    public void setIdleTimeout(short idleTimeout) {
-        this.idleTimeout = idleTimeout;
-    }
-
-    /**
-     * Gets a copy of the OFMatch object for this FlowMod, changes to this
-     * object do not modify the FlowMod
-     * @return
-     */
-    public OFMatch getMatch() {
-        return this.match;
-    }
-
-    /**
-     * Set match
-     * @param match
-     */
-    public void setMatch(OFMatch match) {
-        this.match = match;
-    }
-
-    /**
-     * Get priority
-     * @return
-     */
-    public short getPriority() {
-        return this.priority;
-    }
-
-    /**
-     * Set priority
-     * @param priority
-     */
-    public void setPriority(short priority) {
-        this.priority = priority;
-    }
-
-    /**
-     * @return the reason
-     */
-    public OFFlowRemovedReason getReason() {
-        return reason;
-    }
-
-    /**
-     * @param reason the reason to set
-     */
-    public void setReason(OFFlowRemovedReason reason) {
-        this.reason = reason;
-    }
-
-    /**
-     * @return the durationSeconds
-     */
-    public int getDurationSeconds() {
-        return durationSeconds;
-    }
-
-    /**
-     * @param durationSeconds the durationSeconds to set
-     */
-    public void setDurationSeconds(int durationSeconds) {
-        this.durationSeconds = durationSeconds;
-    }
-
-    /**
-     * @return the durationNanoseconds
-     */
-    public int getDurationNanoseconds() {
-        return durationNanoseconds;
-    }
-
-    /**
-     * @param durationNanoseconds the durationNanoseconds to set
-     */
-    public void setDurationNanoseconds(int durationNanoseconds) {
-        this.durationNanoseconds = durationNanoseconds;
-    }
-
-    /**
-     * @return the packetCount
-     */
-    public long getPacketCount() {
-        return packetCount;
-    }
-
-    /**
-     * @param packetCount the packetCount to set
-     */
-    public void setPacketCount(long packetCount) {
-        this.packetCount = packetCount;
-    }
-
-    /**
-     * @return the byteCount
-     */
-    public long getByteCount() {
-        return byteCount;
-    }
-
-    /**
-     * @param byteCount the byteCount to set
-     */
-    public void setByteCount(long byteCount) {
-        this.byteCount = byteCount;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        if (this.match == null)
-            this.match = new OFMatch();
-        this.match.readFrom(data);
-        this.cookie = data.getLong();
-        this.priority = data.getShort();
-        this.reason = OFFlowRemovedReason.values()[(0xff & data.get())];
-        data.get(); // pad
-        this.durationSeconds = data.getInt();
-        this.durationNanoseconds = data.getInt();
-        this.idleTimeout = data.getShort();
-        data.get(); // pad
-        data.get(); // pad
-        this.packetCount = data.getLong();
-        this.byteCount = data.getLong();
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        this.match.writeTo(data);
-        data.putLong(cookie);
-        data.putShort(priority);
-        data.put((byte) this.reason.ordinal());
-        data.put((byte) 0);
-        data.putInt(this.durationSeconds);
-        data.putInt(this.durationNanoseconds);
-        data.putShort(idleTimeout);
-        data.put((byte) 0); // pad
-        data.put((byte) 0); // pad
-        data.putLong(this.packetCount);
-        data.putLong(this.byteCount);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 271;
-        int result = super.hashCode();
-        result = prime * result + (int) (byteCount ^ (byteCount >>> 32));
-        result = prime * result + (int) (cookie ^ (cookie >>> 32));
-        result = prime * result + durationNanoseconds;
-        result = prime * result + durationSeconds;
-        result = prime * result + idleTimeout;
-        result = prime * result + ((match == null) ? 0 : match.hashCode());
-        result = prime * result + (int) (packetCount ^ (packetCount >>> 32));
-        result = prime * result + priority;
-        result = prime * result + ((reason == null) ? 0 : reason.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof OFFlowRemoved)) {
-            return false;
-        }
-        OFFlowRemoved other = (OFFlowRemoved) obj;
-        if (byteCount != other.byteCount) {
-            return false;
-        }
-        if (cookie != other.cookie) {
-            return false;
-        }
-        if (durationNanoseconds != other.durationNanoseconds) {
-            return false;
-        }
-        if (durationSeconds != other.durationSeconds) {
-            return false;
-        }
-        if (idleTimeout != other.idleTimeout) {
-            return false;
-        }
-        if (match == null) {
-            if (other.match != null) {
-                return false;
-            }
-        } else if (!match.equals(other.match)) {
-            return false;
-        }
-        if (packetCount != other.packetCount) {
-            return false;
-        }
-        if (priority != other.priority) {
-            return false;
-        }
-        if (reason == null) {
-            if (other.reason != null) {
-                return false;
-            }
-        } else if (!reason.equals(other.reason)) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFGetConfigReply.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFGetConfigReply.java
deleted file mode 100644 (file)
index 7348afd..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.openflow.protocol;
-
-/**
- * Represents an OFPT_GET_CONFIG_REPLY type message
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFGetConfigReply extends OFSwitchConfig {
-    public OFGetConfigReply() {
-        super();
-        this.type = OFType.GET_CONFIG_REPLY;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFGetConfigRequest.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFGetConfigRequest.java
deleted file mode 100644 (file)
index 111ce03..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.openflow.protocol;
-
-import org.openflow.util.U16;
-
-/**
- * Represents an OFPT_GET_CONFIG_REQUEST type message
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFGetConfigRequest extends OFMessage {
-    public OFGetConfigRequest() {
-        super();
-        this.type = OFType.GET_CONFIG_REQUEST;
-        this.length = U16.t(OFMessage.MINIMUM_LENGTH);
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFHello.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFHello.java
deleted file mode 100644 (file)
index 47340e5..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.openflow.protocol;
-
-import org.openflow.util.U16;
-
-
-/**
- * Represents an ofp_hello message
- *
- * @author David Erickson (daviderickson@cs.stanford.edu) - Feb 8, 2010
- */
-public class OFHello extends OFMessage {
-    public static int MINIMUM_LENGTH = 8;
-
-    /**
-     * Construct a ofp_hello message
-     */
-    public OFHello() {
-        super();
-        this.type = OFType.HELLO;
-        this.length = U16.t(MINIMUM_LENGTH);
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFMatch.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFMatch.java
deleted file mode 100644 (file)
index c93290e..0000000
+++ /dev/null
@@ -1,1047 +0,0 @@
-package org.openflow.protocol;
-
-import java.io.Serializable;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-
-import org.openflow.util.HexString;
-import org.openflow.util.U16;
-import org.openflow.util.U8;
-
-/**
- * Represents an ofp_match structure
- * 
- * @author David Erickson (daviderickson@cs.stanford.edu)
- * @author Rob Sherwood (rob.sherwood@stanford.edu)
- * 
- */
-public class OFMatch implements Cloneable, Serializable {
-    /**
-     * 
-     */
-    private static final long serialVersionUID = 1L;
-    public static int MINIMUM_LENGTH = 40;
-    final public static int OFPFW_ALL = ((1 << 22) - 1);
-
-    final public static int OFPFW_IN_PORT = 1 << 0; /* Switch input port. */
-    final public static int OFPFW_DL_VLAN = 1 << 1; /* VLAN id. */
-    final public static int OFPFW_DL_SRC = 1 << 2; /* Ethernet source address. */
-    final public static int OFPFW_DL_DST = 1 << 3; /*
-                                                    * Ethernet destination
-                                                    * address.
-                                                    */
-    final public static int OFPFW_DL_TYPE = 1 << 4; /* Ethernet frame type. */
-    final public static int OFPFW_NW_PROTO = 1 << 5; /* IP protocol. */
-    final public static int OFPFW_TP_SRC = 1 << 6; /* TCP/UDP source port. */
-    final public static int OFPFW_TP_DST = 1 << 7; /* TCP/UDP destination port. */
-
-    /*
-     * IP source address wildcard bit count. 0 is exact match, 1 ignores the
-     * LSB, 2 ignores the 2 least-significant bits, ..., 32 and higher wildcard
-     * the entire field. This is the *opposite* of the usual convention where
-     * e.g. /24 indicates that 8 bits (not 24 bits) are wildcarded.
-     */
-    final public static int OFPFW_NW_SRC_SHIFT = 8;
-    final public static int OFPFW_NW_SRC_BITS = 6;
-    final public static int OFPFW_NW_SRC_MASK = ((1 << OFPFW_NW_SRC_BITS) - 1) << OFPFW_NW_SRC_SHIFT;
-    final public static int OFPFW_NW_SRC_ALL = 32 << OFPFW_NW_SRC_SHIFT;
-
-    /* IP destination address wildcard bit count. Same format as source. */
-    final public static int OFPFW_NW_DST_SHIFT = 14;
-    final public static int OFPFW_NW_DST_BITS = 6;
-    final public static int OFPFW_NW_DST_MASK = ((1 << OFPFW_NW_DST_BITS) - 1) << OFPFW_NW_DST_SHIFT;
-    final public static int OFPFW_NW_DST_ALL = 32 << OFPFW_NW_DST_SHIFT;
-
-    final public static int OFPFW_DL_VLAN_PCP = 1 << 20; /* VLAN priority. */
-    final public static int OFPFW_NW_TOS = 1 << 21; /*
-                                                     * IP ToS (DSCP field, 6
-                                                     * bits).
-                                                     */
-
-    /* List of Strings for marshalling and unmarshalling to human readable forms */
-    final public static String STR_IN_PORT = "in_port";
-    final public static String STR_DL_DST = "dl_dst";
-    final public static String STR_DL_SRC = "dl_src";
-    final public static String STR_DL_TYPE = "dl_type";
-    final public static String STR_DL_VLAN = "dl_vlan";
-    final public static String STR_DL_VLAN_PCP = "dl_vpcp";
-    final public static String STR_NW_DST = "nw_dst";
-    final public static String STR_NW_SRC = "nw_src";
-    final public static String STR_NW_PROTO = "nw_proto";
-    final public static String STR_NW_TOS = "nw_tos";
-    final public static String STR_TP_DST = "tp_dst";
-    final public static String STR_TP_SRC = "tp_src";
-
-    protected int wildcards;
-    protected short inputPort;
-    protected byte[] dataLayerSource;
-    protected byte[] dataLayerDestination;
-    protected short dataLayerVirtualLan;
-    protected byte dataLayerVirtualLanPriorityCodePoint;
-    protected short dataLayerType;
-    protected byte networkTypeOfService;
-    protected byte networkProtocol;
-    protected int networkSource;
-    protected int networkDestination;
-    protected short transportSource;
-    protected short transportDestination;
-
-    /**
-     * By default, create a OFMatch that matches everything
-     * 
-     * (mostly because it's the least amount of work to make a valid OFMatch)
-     */
-    public OFMatch() {
-        this.wildcards = OFPFW_ALL;
-        this.dataLayerDestination = new byte[6];
-        this.dataLayerSource = new byte[6];
-    }
-
-    /**
-     * Get dl_dst
-     * 
-     * @return an arrays of bytes
-     */
-    public byte[] getDataLayerDestination() {
-        return this.dataLayerDestination;
-    }
-
-    /**
-     * Set dl_dst
-     * 
-     * @param dataLayerDestination
-     */
-    public OFMatch setDataLayerDestination(byte[] dataLayerDestination) {
-        this.dataLayerDestination = dataLayerDestination;
-        return this;
-    }
-
-    /**
-     * Set dl_dst, but first translate to byte[] using HexString
-     * 
-     * @param mac
-     *            A colon separated string of 6 pairs of octets, e..g.,
-     *            "00:17:42:EF:CD:8D"
-     */
-    public OFMatch setDataLayerDestination(String mac) {
-        byte bytes[] = HexString.fromHexString(mac);
-        if (bytes.length != 6)
-            throw new IllegalArgumentException(
-                    "expected string with 6 octets, got '" + mac + "'");
-        this.dataLayerDestination = bytes;
-        return this;
-    }
-
-    /**
-     * Get dl_src
-     * 
-     * @return an array of bytes
-     */
-    public byte[] getDataLayerSource() {
-        return this.dataLayerSource;
-    }
-
-    /**
-     * Set dl_src
-     * 
-     * @param dataLayerSource
-     */
-    public OFMatch setDataLayerSource(byte[] dataLayerSource) {
-        this.dataLayerSource = dataLayerSource;
-        return this;
-    }
-
-    /**
-     * Set dl_src, but first translate to byte[] using HexString
-     * 
-     * @param mac
-     *            A colon separated string of 6 pairs of octets, e..g.,
-     *            "00:17:42:EF:CD:8D"
-     */
-    public OFMatch setDataLayerSource(String mac) {
-        byte bytes[] = HexString.fromHexString(mac);
-        if (bytes.length != 6)
-            throw new IllegalArgumentException(
-                    "expected string with 6 octets, got '" + mac + "'");
-        this.dataLayerSource = bytes;
-        return this;
-    }
-
-    /**
-     * Get dl_type
-     * 
-     * @return ether_type
-     */
-    public short getDataLayerType() {
-        return this.dataLayerType;
-    }
-
-    /**
-     * Set dl_type
-     * 
-     * @param dataLayerType
-     */
-    public OFMatch setDataLayerType(short dataLayerType) {
-        this.dataLayerType = dataLayerType;
-        return this;
-    }
-
-    /**
-     * Get dl_vlan
-     * 
-     * @return vlan tag; VLAN_NONE == no tag
-     */
-    public short getDataLayerVirtualLan() {
-        return this.dataLayerVirtualLan;
-    }
-
-    /**
-     * Set dl_vlan
-     * 
-     * @param dataLayerVirtualLan
-     */
-    public OFMatch setDataLayerVirtualLan(short dataLayerVirtualLan) {
-        this.dataLayerVirtualLan = dataLayerVirtualLan;
-        return this;
-    }
-
-    /**
-     * Get dl_vlan_pcp
-     * 
-     * @return
-     */
-    public byte getDataLayerVirtualLanPriorityCodePoint() {
-        return this.dataLayerVirtualLanPriorityCodePoint;
-    }
-
-    /**
-     * Set dl_vlan_pcp
-     * 
-     * @param pcp
-     */
-    public OFMatch setDataLayerVirtualLanPriorityCodePoint(byte pcp) {
-        this.dataLayerVirtualLanPriorityCodePoint = pcp;
-        return this;
-    }
-
-    /**
-     * Get in_port
-     * 
-     * @return
-     */
-    public short getInputPort() {
-        return this.inputPort;
-    }
-
-    /**
-     * Set in_port
-     * 
-     * @param inputPort
-     */
-    public OFMatch setInputPort(short inputPort) {
-        this.inputPort = inputPort;
-        return this;
-    }
-
-    /**
-     * Get nw_dst
-     * 
-     * @return
-     */
-    public int getNetworkDestination() {
-        return this.networkDestination;
-    }
-
-    /**
-     * Set nw_dst
-     * 
-     * @param networkDestination
-     */
-    public OFMatch setNetworkDestination(int networkDestination) {
-        this.networkDestination = networkDestination;
-        return this;
-    }
-
-    /**
-     * Parse this match's wildcard fields and return the number of significant
-     * bits in the IP destination field.
-     * 
-     * NOTE: this returns the number of bits that are fixed, i.e., like CIDR,
-     * not the number of bits that are free like OpenFlow encodes.
-     * 
-     * @return a number between 0 (matches all IPs) and 63 ( 32>= implies exact
-     *         match)
-     */
-    public int getNetworkDestinationMaskLen() {
-        return Math
-                .max(32 - ((wildcards & OFPFW_NW_DST_MASK) >> OFPFW_NW_DST_SHIFT),
-                        0);
-    }
-
-    /**
-     * Parse this match's wildcard fields and return the number of significant
-     * bits in the IP destination field.
-     * 
-     * NOTE: this returns the number of bits that are fixed, i.e., like CIDR,
-     * not the number of bits that are free like OpenFlow encodes.
-     * 
-     * @return a number between 0 (matches all IPs) and 32 (exact match)
-     */
-    public int getNetworkSourceMaskLen() {
-        return Math
-                .max(32 - ((wildcards & OFPFW_NW_SRC_MASK) >> OFPFW_NW_SRC_SHIFT),
-                        0);
-    }
-
-    /**
-     * Get nw_proto
-     * 
-     * @return
-     */
-    public byte getNetworkProtocol() {
-        return this.networkProtocol;
-    }
-
-    /**
-     * Set nw_proto
-     * 
-     * @param networkProtocol
-     */
-    public OFMatch setNetworkProtocol(byte networkProtocol) {
-        this.networkProtocol = networkProtocol;
-        return this;
-    }
-
-    /**
-     * Get nw_src
-     * 
-     * @return
-     */
-    public int getNetworkSource() {
-        return this.networkSource;
-    }
-
-    /**
-     * Set nw_src
-     * 
-     * @param networkSource
-     */
-    public OFMatch setNetworkSource(int networkSource) {
-        this.networkSource = networkSource;
-        return this;
-    }
-
-    /**
-     * Get nw_tos
-     * 
-     * @return
-     */
-    public byte getNetworkTypeOfService() {
-        return this.networkTypeOfService;
-    }
-
-    /**
-     * Set nw_tos
-     * 
-     * @param networkTypeOfService
-     */
-    public OFMatch setNetworkTypeOfService(byte networkTypeOfService) {
-        this.networkTypeOfService = networkTypeOfService;
-        return this;
-    }
-
-    /**
-     * Get tp_dst
-     * 
-     * @return
-     */
-    public short getTransportDestination() {
-        return this.transportDestination;
-    }
-
-    /**
-     * Set tp_dst
-     * 
-     * @param transportDestination
-     */
-    public OFMatch setTransportDestination(short transportDestination) {
-        this.transportDestination = transportDestination;
-        return this;
-    }
-
-    /**
-     * Get tp_src
-     * 
-     * @return
-     */
-    public short getTransportSource() {
-        return this.transportSource;
-    }
-
-    /**
-     * Set tp_src
-     * 
-     * @param transportSource
-     */
-    public OFMatch setTransportSource(short transportSource) {
-        this.transportSource = transportSource;
-        return this;
-    }
-
-    /**
-     * Get wildcards
-     * 
-     * @return
-     */
-    public int getWildcards() {
-        return this.wildcards;
-    }
-
-    /**
-     * Set wildcards
-     * 
-     * @param wildcards
-     */
-    public OFMatch setWildcards(int wildcards) {
-        this.wildcards = wildcards;
-        return this;
-    }
-
-    /**
-     * Initializes this OFMatch structure with the corresponding data from the
-     * specified packet.
-     * 
-     * Must specify the input port, to ensure that this.in_port is set
-     * correctly.
-     * 
-     * Specify OFPort.NONE or OFPort.ANY if input port not applicable or
-     * available
-     * 
-     * @param packetData
-     *            The packet's data
-     * @param inputPort
-     *            the port the packet arrived on
-     */
-    public OFMatch loadFromPacket(byte[] packetData, short inputPort) {
-        short scratch;
-        int transportOffset = 34;
-        ByteBuffer packetDataBB = ByteBuffer.wrap(packetData);
-        int limit = packetDataBB.limit();
-
-        this.wildcards = 0; // all fields have explicit entries
-
-        this.inputPort = inputPort;
-
-        if (inputPort == OFPort.OFPP_ALL.getValue())
-            this.wildcards |= OFPFW_IN_PORT;
-
-        assert (limit >= 14);
-        // dl dst
-        this.dataLayerDestination = new byte[6];
-        packetDataBB.get(this.dataLayerDestination);
-        // dl src
-        this.dataLayerSource = new byte[6];
-        packetDataBB.get(this.dataLayerSource);
-        // dl type
-        this.dataLayerType = packetDataBB.getShort();
-
-        if (getDataLayerType() != (short) 0x8100) { // need cast to avoid signed
-            // bug
-            setDataLayerVirtualLan((short) 0xffff);
-            setDataLayerVirtualLanPriorityCodePoint((byte) 0);
-        } else {
-            // has vlan tag
-            scratch = packetDataBB.getShort();
-            setDataLayerVirtualLan((short) (0xfff & scratch));
-            setDataLayerVirtualLanPriorityCodePoint((byte) ((0xe000 & scratch) >> 13));
-            this.dataLayerType = packetDataBB.getShort();
-        }
-
-        switch (getDataLayerType()) {
-        case 0x0800:
-            // ipv4
-            // check packet length
-            scratch = packetDataBB.get();
-            scratch = (short) (0xf & scratch);
-            transportOffset = (packetDataBB.position() - 1) + (scratch * 4);
-            // nw tos (dscp)
-            scratch = packetDataBB.get();
-            setNetworkTypeOfService((byte) ((0xfc & scratch) >> 2));
-            // nw protocol
-            packetDataBB.position(packetDataBB.position() + 7);
-            this.networkProtocol = packetDataBB.get();
-            // nw src
-            packetDataBB.position(packetDataBB.position() + 2);
-            this.networkSource = packetDataBB.getInt();
-            // nw dst
-            this.networkDestination = packetDataBB.getInt();
-            packetDataBB.position(transportOffset);
-            break;
-        case 0x0806:
-            // arp
-            int arpPos = packetDataBB.position();
-            // opcode
-            scratch = packetDataBB.getShort(arpPos + 6);
-            setNetworkProtocol((byte) (0xff & scratch));
-
-            scratch = packetDataBB.getShort(arpPos + 2);
-            // if ipv4 and addr len is 4
-            if (scratch == 0x800 && packetDataBB.get(arpPos + 5) == 4) {
-                // nw src
-                this.networkSource = packetDataBB.getInt(arpPos + 14);
-                // nw dst
-                this.networkDestination = packetDataBB.getInt(arpPos + 24);
-            } else {
-                setNetworkSource(0);
-                setNetworkDestination(0);
-            }
-            break;
-        default:
-            setNetworkTypeOfService((byte) 0);
-            setNetworkProtocol((byte) 0);
-            setNetworkSource(0);
-            setNetworkDestination(0);
-            break;
-        }
-
-        switch (getNetworkProtocol()) {
-        case 0x01:
-            // icmp
-            // type
-            this.transportSource = U8.f(packetDataBB.get());
-            // code
-            this.transportDestination = U8.f(packetDataBB.get());
-            break;
-        case 0x06:
-            // tcp
-            // tcp src
-            this.transportSource = packetDataBB.getShort();
-            // tcp dest
-            this.transportDestination = packetDataBB.getShort();
-            break;
-        case 0x11:
-            // udp
-            // udp src
-            this.transportSource = packetDataBB.getShort();
-            // udp dest
-            this.transportDestination = packetDataBB.getShort();
-            break;
-        default:
-            setTransportDestination((short) 0);
-            setTransportSource((short) 0);
-            break;
-        }
-        return this;
-    }
-
-    /**
-     * Read this message off the wire from the specified ByteBuffer
-     * 
-     * @param data
-     */
-    public void readFrom(ByteBuffer data) {
-        this.wildcards = data.getInt();
-        this.inputPort = data.getShort();
-        this.dataLayerSource = new byte[6];
-        data.get(this.dataLayerSource);
-        this.dataLayerDestination = new byte[6];
-        data.get(this.dataLayerDestination);
-        this.dataLayerVirtualLan = data.getShort();
-        this.dataLayerVirtualLanPriorityCodePoint = data.get();
-        data.get(); // pad
-        this.dataLayerType = data.getShort();
-        this.networkTypeOfService = data.get();
-        this.networkProtocol = data.get();
-        data.get(); // pad
-        data.get(); // pad
-        this.networkSource = data.getInt();
-        this.networkDestination = data.getInt();
-        this.transportSource = data.getShort();
-        this.transportDestination = data.getShort();
-    }
-
-    /**
-     * Write this message's binary format to the specified ByteBuffer
-     * 
-     * @param data
-     */
-    public void writeTo(ByteBuffer data) {
-        data.putInt(wildcards);
-        data.putShort(inputPort);
-        data.put(this.dataLayerSource);
-        data.put(this.dataLayerDestination);
-        data.putShort(dataLayerVirtualLan);
-        data.put(dataLayerVirtualLanPriorityCodePoint);
-        data.put((byte) 0x0); // pad
-        data.putShort(dataLayerType);
-        data.put(networkTypeOfService);
-        data.put(networkProtocol);
-        data.put((byte) 0x0); // pad
-        data.put((byte) 0x0); // pad
-        data.putInt(networkSource);
-        data.putInt(networkDestination);
-        data.putShort(transportSource);
-        data.putShort(transportDestination);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 131;
-        int result = 1;
-        result = prime * result + Arrays.hashCode(dataLayerDestination);
-        result = prime * result + Arrays.hashCode(dataLayerSource);
-        result = prime * result + dataLayerType;
-        result = prime * result + dataLayerVirtualLan;
-        result = prime * result + dataLayerVirtualLanPriorityCodePoint;
-        result = prime * result + inputPort;
-        result = prime * result + networkDestination;
-        result = prime * result + networkProtocol;
-        result = prime * result + networkSource;
-        result = prime * result + networkTypeOfService;
-        result = prime * result + transportDestination;
-        result = prime * result + transportSource;
-        result = prime * result + wildcards;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof OFMatch)) {
-            return false;
-        }
-        OFMatch other = (OFMatch) obj;
-        if (!Arrays.equals(dataLayerDestination, other.dataLayerDestination)) {
-            return false;
-        }
-        if (!Arrays.equals(dataLayerSource, other.dataLayerSource)) {
-            return false;
-        }
-        if (dataLayerType != other.dataLayerType) {
-            return false;
-        }
-        if (dataLayerVirtualLan != other.dataLayerVirtualLan) {
-            return false;
-        }
-        if (dataLayerVirtualLanPriorityCodePoint != other.dataLayerVirtualLanPriorityCodePoint) {
-            return false;
-        }
-        if (inputPort != other.inputPort) {
-            return false;
-        }
-        if (networkDestination != other.networkDestination) {
-            return false;
-        }
-        if (networkProtocol != other.networkProtocol) {
-            return false;
-        }
-        if (networkSource != other.networkSource) {
-            return false;
-        }
-        if (networkTypeOfService != other.networkTypeOfService) {
-            return false;
-        }
-        if (transportDestination != other.transportDestination) {
-            return false;
-        }
-        if (transportSource != other.transportSource) {
-            return false;
-        }
-        if ((wildcards & OFMatch.OFPFW_ALL) != (other.wildcards & OFPFW_ALL)) { // only
-            // consider
-            // allocated
-            // part
-            // of
-            // wildcards
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * Implement clonable interface
-     */
-    @Override
-    public OFMatch clone() {
-        try {
-            OFMatch ret = (OFMatch) super.clone();
-            ret.dataLayerDestination = this.dataLayerDestination.clone();
-            ret.dataLayerSource = this.dataLayerSource.clone();
-            return ret;
-        } catch (CloneNotSupportedException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     * Output a dpctl-styled string, i.e., only list the elements that are not
-     * wildcarded
-     * 
-     * A match-everything OFMatch outputs "OFMatch[]"
-     * 
-     * @return 
-     *         "OFMatch[dl_src:00:20:01:11:22:33,nw_src:192.168.0.0/24,tp_dst:80]"
-     */
-    @Override
-    public String toString() {
-        String str = "";
-
-        // l1
-        if ((wildcards & OFPFW_IN_PORT) == 0)
-            str += "," + STR_IN_PORT + "=" + U16.f(this.inputPort);
-
-        // l2
-        if ((wildcards & OFPFW_DL_DST) == 0)
-            str += "," + STR_DL_DST + "="
-                    + HexString.toHexString(this.dataLayerDestination);
-        if ((wildcards & OFPFW_DL_SRC) == 0)
-            str += "," + STR_DL_SRC + "="
-                    + HexString.toHexString(this.dataLayerSource);
-        if ((wildcards & OFPFW_DL_TYPE) == 0)
-            str += "," + STR_DL_TYPE + "=0x"
-                    + Integer.toHexString(U16.f(this.dataLayerType));
-        if ((wildcards & OFPFW_DL_VLAN) == 0)
-            str += "," + STR_DL_VLAN + "=0x"
-                    + Integer.toHexString(U16.f(this.dataLayerVirtualLan));
-        if ((wildcards & OFPFW_DL_VLAN_PCP) == 0)
-            str += ","
-                    + STR_DL_VLAN_PCP
-                    + "="
-                    + Integer.toHexString(U8
-                            .f(this.dataLayerVirtualLanPriorityCodePoint));
-
-        // l3
-        if (getNetworkDestinationMaskLen() > 0)
-            str += ","
-                    + STR_NW_DST
-                    + "="
-                    + cidrToString(networkDestination,
-                            getNetworkDestinationMaskLen());
-        if (getNetworkSourceMaskLen() > 0)
-            str += "," + STR_NW_SRC + "="
-                    + cidrToString(networkSource, getNetworkSourceMaskLen());
-        if ((wildcards & OFPFW_NW_PROTO) == 0)
-            str += "," + STR_NW_PROTO + "=" + this.networkProtocol;
-        if ((wildcards & OFPFW_NW_TOS) == 0)
-            str += "," + STR_NW_TOS + "=" + this.networkTypeOfService;
-
-        // l4
-        if ((wildcards & OFPFW_TP_DST) == 0)
-            str += "," + STR_TP_DST + "=" + this.transportDestination;
-        if ((wildcards & OFPFW_TP_SRC) == 0)
-            str += "," + STR_TP_SRC + "=" + this.transportSource;
-        if ((str.length() > 0) && (str.charAt(0) == ','))
-            str = str.substring(1); // trim the leading ","
-        // done
-        return "OFMatch[" + str + "]";
-    }
-
-    private String cidrToString(int ip, int prefix) {
-        String str;
-        if (prefix >= 32) {
-            str = ipToString(ip);
-        } else {
-            // use the negation of mask to fake endian magic
-            int mask = ~((1 << (32 - prefix)) - 1);
-            str = ipToString(ip & mask) + "/" + prefix;
-        }
-
-        return str;
-    }
-
-    /**
-     * Set this OFMatch's parameters based on a comma-separated key=value pair
-     * dpctl-style string, e.g., from the output of OFMatch.toString() <br>
-     * <p>
-     * Supported keys/values include <br>
-     * <p>
-     * <TABLE border=1>
-     * <TR>
-     * <TD>KEY(s)
-     * <TD>VALUE
-     * </TR>
-     * <TR>
-     * <TD>"in_port","input_port"
-     * <TD>integer
-     * </TR>
-     * <TR>
-     * <TD>"dl_src","eth_src", "dl_dst","eth_dst"
-     * <TD>hex-string
-     * </TR>
-     * <TR>
-     * <TD>"dl_type", "dl_vlan", "dl_vlan_pcp"
-     * <TD>integer
-     * </TR>
-     * <TR>
-     * <TD>"nw_src", "nw_dst", "ip_src", "ip_dst"
-     * <TD>CIDR-style netmask
-     * </TR>
-     * <TR>
-     * <TD>"tp_src","tp_dst"
-     * <TD>integer (max 64k)
-     * </TR>
-     * </TABLE>
-     * <p>
-     * The CIDR-style netmasks assume 32 netmask if none given, so:
-     * "128.8.128.118/32" is the same as "128.8.128.118"
-     * 
-     * @param match
-     *            a key=value comma separated string, e.g.
-     *            "in_port=5,ip_dst=192.168.0.0/16,tp_src=80"
-     * @throws IllegalArgumentException
-     *             on unexpected key or value
-     */
-
-    public void fromString(String match) throws IllegalArgumentException {
-        if (match.equals("") || match.equalsIgnoreCase("any")
-                || match.equalsIgnoreCase("all") || match.equals("[]"))
-            match = "OFMatch[]";
-        String[] tokens = match.split("[\\[,\\]]");
-        String[] values;
-        int initArg = 0;
-        if (tokens[0].equals("OFMatch"))
-            initArg = 1;
-        this.wildcards = OFPFW_ALL;
-        int i;
-        for (i = initArg; i < tokens.length; i++) {
-            values = tokens[i].split("=");
-            if (values.length != 2)
-                throw new IllegalArgumentException("Token " + tokens[i]
-                        + " does not have form 'key=value' parsing " + match);
-            values[0] = values[0].toLowerCase(); // try to make this case insens
-            if (values[0].equals(STR_IN_PORT) || values[0].equals("input_port")) {
-                this.inputPort = U16.t(Integer.valueOf(values[1]));
-                this.wildcards &= ~OFPFW_IN_PORT;
-            } else if (values[0].equals(STR_DL_DST)
-                    || values[0].equals("eth_dst")) {
-                this.dataLayerDestination = HexString.fromHexString(values[1]);
-                this.wildcards &= ~OFPFW_DL_DST;
-            } else if (values[0].equals(STR_DL_SRC)
-                    || values[0].equals("eth_src")) {
-                this.dataLayerSource = HexString.fromHexString(values[1]);
-                this.wildcards &= ~OFPFW_DL_SRC;
-            } else if (values[0].equals(STR_DL_TYPE)
-                    || values[0].equals("eth_type")) {
-                if (values[1].startsWith("0x"))
-                    this.dataLayerType = U16.t(Integer.valueOf(
-                            values[1].replaceFirst("0x", ""), 16));
-                else
-                    this.dataLayerType = U16.t(Integer.valueOf(values[1]));
-                this.wildcards &= ~OFPFW_DL_TYPE;
-            } else if (values[0].equals(STR_DL_VLAN)) {
-                this.dataLayerVirtualLan = U16.t(Integer.valueOf(values[1]));
-                this.wildcards &= ~OFPFW_DL_VLAN;
-            } else if (values[0].equals(STR_DL_VLAN_PCP)) {
-                this.dataLayerVirtualLanPriorityCodePoint = U8.t(Short
-                        .valueOf(values[1]));
-                this.wildcards &= ~OFPFW_DL_VLAN_PCP;
-            } else if (values[0].equals(STR_NW_DST)
-                    || values[0].equals("ip_dst"))
-                setFromCIDR(values[1], STR_NW_DST);
-            else if (values[0].equals(STR_NW_SRC) || values[0].equals("ip_src"))
-                setFromCIDR(values[1], STR_NW_SRC);
-            else if (values[0].equals(STR_NW_PROTO)) {
-                this.networkProtocol = U8.t(Short.valueOf(values[1]));
-                this.wildcards &= ~OFPFW_NW_PROTO;
-            } else if (values[0].equals(STR_NW_TOS)) {
-                this.networkTypeOfService = U8.t(Short.valueOf(values[1]));
-                this.wildcards &= ~OFPFW_NW_TOS;
-            } else if (values[0].equals(STR_TP_DST)) {
-                this.transportDestination = U16.t(Integer.valueOf(values[1]));
-                this.wildcards &= ~OFPFW_TP_DST;
-            } else if (values[0].equals(STR_TP_SRC)) {
-                this.transportSource = U16.t(Integer.valueOf(values[1]));
-                this.wildcards &= ~OFPFW_TP_SRC;
-            } else
-                throw new IllegalArgumentException("unknown token " + tokens[i]
-                        + " parsing " + match);
-        }
-    }
-
-    /**
-     * Set the networkSource or networkDestionation address and their wildcards
-     * from the CIDR string
-     * 
-     * @param cidr
-     *            "192.168.0.0/16" or "172.16.1.5"
-     * @param which
-     *            one of STR_NW_DST or STR_NW_SRC
-     * @throws IllegalArgumentException
-     */
-    private void setFromCIDR(String cidr, String which)
-            throws IllegalArgumentException {
-        String values[] = cidr.split("/");
-        String[] ip_str = values[0].split("\\.");
-        int ip = 0;
-        ip += Integer.valueOf(ip_str[0]) << 24;
-        ip += Integer.valueOf(ip_str[1]) << 16;
-        ip += Integer.valueOf(ip_str[2]) << 8;
-        ip += Integer.valueOf(ip_str[3]);
-        int prefix = 32; // all bits are fixed, by default
-
-        if (values.length >= 2)
-            prefix = Integer.valueOf(values[1]);
-        int mask = 32 - prefix;
-        if (which.equals(STR_NW_DST)) {
-            this.networkDestination = ip;
-            this.wildcards = (wildcards & ~OFPFW_NW_DST_MASK)
-                    | (mask << OFPFW_NW_DST_SHIFT);
-        } else if (which.equals(STR_NW_SRC)) {
-            this.networkSource = ip;
-            this.wildcards = (wildcards & ~OFPFW_NW_SRC_MASK)
-                    | (mask << OFPFW_NW_SRC_SHIFT);
-        }
-    }
-
-    protected static String ipToString(int ip) {
-        return Integer.toString(U8.f((byte) ((ip & 0xff000000) >> 24))) + "."
-                + Integer.toString((ip & 0x00ff0000) >> 16) + "."
-                + Integer.toString((ip & 0x0000ff00) >> 8) + "."
-                + Integer.toString(ip & 0x000000ff);
-    }
-
-    /**
-     * Reverses a match such that source and destination values plus
-     * corresponding masks are swapped. An input port must be explicitly
-     * passed in as the match does not contain an output port.
-     *
-     * @param inputPort new input port to use in match
-     * @param wildcardInputPort should the input port be wildcarded
-     *
-     * @return Reversed copy of match
-     */
-    public OFMatch reverse(short inputPort, boolean wildcardInputPort) {
-        OFMatch ret = this.clone();
-
-        // Set the input port
-        if (wildcardInputPort) {
-            ret.inputPort = 0;
-            ret.wildcards |= OFPFW_IN_PORT;
-        } else {
-            ret.inputPort = inputPort;
-            ret.wildcards &= ~OFPFW_IN_PORT;
-        }
-
-        // Switch the source/dest fields
-        ret.dataLayerDestination = this.dataLayerSource.clone();
-        ret.dataLayerSource = this.dataLayerDestination.clone();
-
-        ret.networkDestination = this.networkSource;
-        ret.networkSource = this.networkDestination;
-
-        ret.transportDestination = this.transportSource;
-        ret.transportSource = this.transportDestination;
-
-        // Switch the wildcards on source/dest fields
-        ret.wildcards &= ~(OFPFW_DL_DST | OFPFW_DL_SRC |
-                OFPFW_NW_DST_MASK | OFPFW_NW_SRC_MASK |
-                OFPFW_TP_DST | OFPFW_TP_SRC);
-        ret.wildcards |= ((this.wildcards & OFPFW_DL_DST) != 0 ) ? OFPFW_DL_SRC : 0;
-        ret.wildcards |= ((this.wildcards & OFPFW_DL_SRC) != 0 ) ? OFPFW_DL_DST : 0;
-        ret.wildcards |= (((this.wildcards & OFPFW_NW_DST_MASK) >> OFPFW_NW_DST_SHIFT) << OFPFW_NW_SRC_SHIFT);
-        ret.wildcards |= (((this.wildcards & OFPFW_NW_SRC_MASK) >> OFPFW_NW_SRC_SHIFT) << OFPFW_NW_DST_SHIFT);
-        ret.wildcards |= ((this.wildcards & OFPFW_TP_DST) != 0 ) ? OFPFW_TP_SRC : 0;
-        ret.wildcards |= ((this.wildcards & OFPFW_TP_SRC) != 0 ) ? OFPFW_TP_DST : 0;
-
-        return ret;
-    }
-
-    /**
-     * Check whether this match subsumes another match.
-     *
-     * This match subsumes another match if each field in this
-     * object either:
-     * <ol>
-     *   <li> exactly matches the corresponding field in the other match
-     *   <li> the field is wildcarded in this object
-     * </ol>
-     * Note: The network source and destination wildcards must have fewer
-     * or the same number of bits wildcarded in this object as the other.
-     *
-     * @param match match used for comparison when checking subsumes
-     * @return boolean indicating whether this match subsumes another match
-     */
-    public boolean subsumes(OFMatch match) {
-        // L1
-        if ((wildcards & OFPFW_IN_PORT) == 0) {
-            if (inputPort != match.inputPort) {
-                return false;
-            }
-        }
-
-        // L2
-        if ((wildcards & OFPFW_DL_DST) == 0) {
-            if (!Arrays.equals(dataLayerDestination, match.dataLayerDestination)) {
-                return false;
-            }
-        }
-        if ((wildcards & OFPFW_DL_SRC) == 0) {
-            if (!Arrays.equals(dataLayerSource, match.dataLayerSource)) {
-                return false;
-            }
-        }
-        if ((wildcards & OFPFW_DL_TYPE) == 0) {
-            if (dataLayerType != match.dataLayerType) {
-                return false;
-            }
-        }
-        if ((wildcards & OFPFW_DL_VLAN) == 0) {
-            if (dataLayerVirtualLan!= match.dataLayerVirtualLan) {
-                return false;
-            }
-        }
-        if ((wildcards & OFPFW_DL_VLAN_PCP) == 0) {
-            if (dataLayerVirtualLanPriorityCodePoint != match.dataLayerVirtualLanPriorityCodePoint) {
-                return false;
-            }
-        }
-
-        // L3
-        int maskLen = getNetworkDestinationMaskLen();
-        if (maskLen > match.getNetworkDestinationMaskLen()) {
-            return false;
-        }
-        int mask = (maskLen == 0) ? 0 : (0xffffffff << (32 - maskLen));
-        if ((networkDestination & mask) != (match.networkDestination & mask)) {
-            return false;
-        }
-        maskLen = getNetworkSourceMaskLen();
-        if (maskLen > match.getNetworkSourceMaskLen()) {
-            return false;
-        }
-        mask = (maskLen == 0) ? 0 : (0xffffffff << (32 - maskLen));
-        if ((networkSource & mask) != (match.networkSource & mask)) {
-            return false;
-        }
-        if ((wildcards & OFPFW_NW_PROTO) == 0) {
-            if (networkProtocol != match.networkProtocol) {
-                return false;
-            }
-        }
-        if ((wildcards & OFPFW_NW_TOS) == 0) {
-            if (networkTypeOfService != match.networkTypeOfService) {
-                return false;
-            }
-        }
-
-        // L4
-        if ((wildcards & OFPFW_TP_DST) == 0) {
-            if (transportDestination != match.transportDestination) {
-                return false;
-            }
-        }
-        if ((wildcards & OFPFW_TP_SRC) == 0) {
-            if (transportSource != match.transportSource) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFMatchBeanInfo.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFMatchBeanInfo.java
deleted file mode 100644 (file)
index 9f7a40e..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-package org.openflow.protocol;
-
-import java.beans.IntrospectionException;
-import java.beans.PropertyDescriptor;
-import java.beans.SimpleBeanInfo;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * Extra info for how to treat OFMatch as a JavaBean
- * 
- * For some (inane!) reason, using chained setters in OFMatch breaks a lot of the JavaBean defaults.
- * 
- * We don't really use OFMatch as a java bean, but there are a lot of nice XML utils that work for
- * free if OFMatch follows the java bean paradigm.
- * 
- * @author Rob Sherwood (rob.sherwood@stanford.edu)
- *
- */
-
-public class OFMatchBeanInfo extends SimpleBeanInfo {
-
-    @Override
-    public PropertyDescriptor[] getPropertyDescriptors() {
-        List<PropertyDescriptor> descs = new LinkedList<PropertyDescriptor>();
-        Field[] fields = OFMatch.class.getDeclaredFields();
-        String name;
-        for (int i=0; i< fields.length; i++) {
-            int mod = fields[i].getModifiers();
-            if(Modifier.isFinal(mod) ||     // don't expose static or final fields 
-                    Modifier.isStatic(mod))
-                continue;
-            
-            name = fields[i].getName();
-            Class<?> type = fields[i].getType();
-            
-            try {
-                descs.add(new PropertyDescriptor(name, 
-                        name2getter(OFMatch.class, name), 
-                        name2setter(OFMatch.class, name, type)));
-            } catch (IntrospectionException e) {
-                e.printStackTrace();
-                throw new RuntimeException(e);
-            }
-        }
-        
-        return descs.toArray(new PropertyDescriptor[0]);
-    }
-
-
-    private Method name2setter(Class<OFMatch> c, String name, Class<?> type) {
-        String mName = "set" + toLeadingCaps(name);
-        Method m = null;
-        try {
-            m = c.getMethod(mName, new Class[]{ type});
-        } catch (SecurityException e) {
-            
-            e.printStackTrace();
-            throw new RuntimeException(e);
-        } catch (NoSuchMethodException e) {
-            e.printStackTrace();
-            throw new RuntimeException(e);
-        }
-        return m;
-    }
-
-    private Method name2getter(Class<OFMatch> c, String name) {
-        String mName= "get" + toLeadingCaps(name);
-        Method m = null;
-        try {
-            m = c.getMethod(mName, new Class[]{});
-        } catch (SecurityException e) {
-            e.printStackTrace();
-            throw new RuntimeException(e);
-        } catch (NoSuchMethodException e) {
-            e.printStackTrace();
-            throw new RuntimeException(e);
-        }
-        return m;
-    }
-    
-    private String toLeadingCaps(String s) {
-        char[] array = s.toCharArray();
-        array[0] = Character.toUpperCase(array[0]);
-        return String.valueOf(array, 0, array.length);
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFMessage.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFMessage.java
deleted file mode 100644 (file)
index 5b40a6e..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-package org.openflow.protocol;
-
-import java.io.Serializable;
-import java.nio.ByteBuffer;
-
-import org.openflow.util.U16;
-import org.openflow.util.U32;
-import org.openflow.util.U8;
-
-/**
- * The base class for all OpenFlow protocol messages. This class contains the
- * equivalent of the ofp_header which is present in all OpenFlow messages.
- *
- * @author David Erickson (daviderickson@cs.stanford.edu) - Feb 3, 2010
- * @author Rob Sherwood (rob.sherwood@stanford.edu) - Feb 3, 2010
- */
-public class OFMessage implements Serializable{
-    public static byte OFP_VERSION = 0x01;
-    public static int MINIMUM_LENGTH = 8;
-
-    protected byte version;
-    protected OFType type;
-    protected short length;
-    protected int xid;
-
-    public OFMessage() {
-        this.version = OFP_VERSION;
-    }
-
-    /**
-     * Get the length of this message
-     *
-     * @return
-     */
-    public short getLength() {
-        return length;
-    }
-
-    /**
-     * Get the length of this message, unsigned
-     *
-     * @return
-     */
-    public int getLengthU() {
-        return U16.f(length);
-    }
-
-    /**
-     * Set the length of this message
-     *
-     * @param length
-     */
-    public OFMessage setLength(short length) {
-        this.length = length;
-        return this;
-    }
-
-    /**
-     * Set the length of this message, unsigned
-     *
-     * @param length
-     */
-    public OFMessage setLengthU(int length) {
-        this.length = U16.t(length);
-        return this;
-    }
-
-    /**
-     * Get the type of this message
-     *
-     * @return
-     */
-    public OFType getType() {
-        return type;
-    }
-
-    /**
-     * Set the type of this message
-     *
-     * @param type
-     */
-    public void setType(OFType type) {
-        this.type = type;
-    }
-
-    /**
-     * Get the OpenFlow version of this message
-     *
-     * @return
-     */
-    public byte getVersion() {
-        return version;
-    }
-
-    /**
-     * Set the OpenFlow version of this message
-     *
-     * @param version
-     */
-    public void setVersion(byte version) {
-        this.version = version;
-    }
-
-    /**
-     * Get the transaction id of this message
-     *
-     * @return
-     */
-    public int getXid() {
-        return xid;
-    }
-
-    /**
-     * Set the transaction id of this message
-     *
-     * @param xid
-     */
-    public void setXid(int xid) {
-        this.xid = xid;
-    }
-
-    /**
-     * Read this message off the wire from the specified ByteBuffer
-     * @param data
-     */
-    public void readFrom(ByteBuffer data) {
-        this.version = data.get();
-        this.type = OFType.valueOf(data.get());
-        this.length = data.getShort();
-        this.xid = data.getInt();
-    }
-
-    /**
-     * Write this message's binary format to the specified ByteBuffer
-     * @param data
-     */
-    public void writeTo(ByteBuffer data) {
-        data.put(version);
-        data.put(type.getTypeValue());
-        data.putShort(length);
-        data.putInt(xid);
-    }
-
-    /**
-     * Returns a summary of the message
-     * @return "ofmsg=v=$version;t=$type:l=$len:xid=$xid"
-     */
-    public String toString() {
-        return "ofmsg" +
-            ":v=" + U8.f(this.getVersion()) +
-            ";t=" + this.getType() +
-            ";l=" + this.getLengthU() +
-            ";x=" + U32.f(this.getXid());
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 97;
-        int result = 1;
-        result = prime * result + length;
-        result = prime * result + ((type == null) ? 0 : type.hashCode());
-        result = prime * result + version;
-        result = prime * result + xid;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof OFMessage)) {
-            return false;
-        }
-        OFMessage other = (OFMessage) obj;
-        if (length != other.length) {
-            return false;
-        }
-        if (type == null) {
-            if (other.type != null) {
-                return false;
-            }
-        } else if (!type.equals(other.type)) {
-            return false;
-        }
-        if (version != other.version) {
-            return false;
-        }
-        if (xid != other.xid) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFPacketIn.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFPacketIn.java
deleted file mode 100644 (file)
index 927b7bf..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-
-import org.openflow.util.U16;
-import org.openflow.util.U8;
-
-/**
- * Represents an ofp_packet_in
- *
- * @author David Erickson (daviderickson@cs.stanford.edu) - Feb 8, 2010
- */
-public class OFPacketIn extends OFMessage {
-    public static int MINIMUM_LENGTH = 18;
-
-    public enum OFPacketInReason {
-        NO_MATCH, ACTION
-    }
-
-    protected int bufferId;
-    protected short totalLength;
-    protected short inPort;
-    protected OFPacketInReason reason;
-    protected byte[] packetData;
-
-    public OFPacketIn() {
-        super();
-        this.type = OFType.PACKET_IN;
-        this.length = U16.t(MINIMUM_LENGTH);
-    }
-
-    /**
-     * Get buffer_id
-     * @return
-     */
-    public int getBufferId() {
-        return this.bufferId;
-    }
-
-    /**
-     * Set buffer_id
-     * @param bufferId
-     */
-    public OFPacketIn setBufferId(int bufferId) {
-        this.bufferId = bufferId;
-        return this;
-    }
-
-    /**
-     * Returns the packet data
-     * @return
-     */
-    public byte[] getPacketData() {
-        return this.packetData;
-    }
-
-    /**
-     * Sets the packet data, and updates the length of this message
-     * @param packetData
-     */
-    public OFPacketIn setPacketData(byte[] packetData) {
-        this.packetData = packetData;
-        this.length = U16.t(OFPacketIn.MINIMUM_LENGTH + packetData.length);
-        return this;
-    }
-
-    /**
-     * Get in_port
-     * @return
-     */
-    public short getInPort() {
-        return this.inPort;
-    }
-
-    /**
-     * Set in_port
-     * @param inPort
-     */
-    public OFPacketIn setInPort(short inPort) {
-        this.inPort = inPort;
-        return this;
-    }
-
-    /**
-     * Get reason
-     * @return
-     */
-    public OFPacketInReason getReason() {
-        return this.reason;
-    }
-
-    /**
-     * Set reason
-     * @param reason
-     */
-    public OFPacketIn setReason(OFPacketInReason reason) {
-        this.reason = reason;
-        return this;
-    }
-
-    /**
-     * Get total_len
-     * @return
-     */
-    public short getTotalLength() {
-        return this.totalLength;
-    }
-
-    /**
-     * Set total_len
-     * @param totalLength
-     */
-    public OFPacketIn setTotalLength(short totalLength) {
-        this.totalLength = totalLength;
-        return this;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.bufferId = data.getInt();
-        this.totalLength = data.getShort();
-        this.inPort = data.getShort();
-        this.reason = OFPacketInReason.values()[U8.f(data.get())];
-        data.get(); // pad
-        this.packetData = new byte[getLengthU() - MINIMUM_LENGTH];
-        data.get(this.packetData);
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.putInt(bufferId);
-        data.putShort(totalLength);
-        data.putShort(inPort);
-        data.put((byte) reason.ordinal());
-        data.put((byte) 0x0); // pad
-        data.put(this.packetData);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 283;
-        int result = super.hashCode();
-        result = prime * result + bufferId;
-        result = prime * result + inPort;
-        result = prime * result + Arrays.hashCode(packetData);
-        result = prime * result + ((reason == null) ? 0 : reason.hashCode());
-        result = prime * result + totalLength;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof OFPacketIn)) {
-            return false;
-        }
-        OFPacketIn other = (OFPacketIn) obj;
-        if (bufferId != other.bufferId) {
-            return false;
-        }
-        if (inPort != other.inPort) {
-            return false;
-        }
-        if (!Arrays.equals(packetData, other.packetData)) {
-            return false;
-        }
-        if (reason == null) {
-            if (other.reason != null) {
-                return false;
-            }
-        } else if (!reason.equals(other.reason)) {
-            return false;
-        }
-        if (totalLength != other.totalLength) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFPacketOut.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFPacketOut.java
deleted file mode 100644 (file)
index 7eded8d..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import java.util.List;
-
-import org.openflow.protocol.action.OFAction;
-import org.openflow.protocol.factory.OFActionFactory;
-import org.openflow.protocol.factory.OFActionFactoryAware;
-import org.openflow.util.U16;
-
-/**
- * Represents an ofp_packet_out message
- *
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 12, 2010
- */
-public class OFPacketOut extends OFMessage implements OFActionFactoryAware {
-    public static int MINIMUM_LENGTH = 16;
-    public static int BUFFER_ID_NONE = 0xffffffff;
-
-    protected OFActionFactory actionFactory;
-    protected int bufferId;
-    protected short inPort;
-    protected short actionsLength;
-    protected List<OFAction> actions;
-    protected byte[] packetData;
-
-    public OFPacketOut() {
-        super();
-        this.type = OFType.PACKET_OUT;
-        this.length = U16.t(MINIMUM_LENGTH);
-    }
-
-    /**
-     * Get buffer_id
-     * @return
-     */
-    public int getBufferId() {
-        return this.bufferId;
-    }
-
-    /**
-     * Set buffer_id
-     * @param bufferId
-     */
-    public OFPacketOut setBufferId(int bufferId) {
-        this.bufferId = bufferId;
-        return this;
-    }
-
-    /**
-     * Returns the packet data
-     * @return
-     */
-    public byte[] getPacketData() {
-        return this.packetData;
-    }
-
-    /**
-     * Sets the packet data
-     * @param packetData
-     */
-    public OFPacketOut setPacketData(byte[] packetData) {
-        this.packetData = packetData;
-        return this;
-    }
-
-    /**
-     * Get in_port
-     * @return
-     */
-    public short getInPort() {
-        return this.inPort;
-    }
-
-    /**
-     * Set in_port
-     * @param inPort
-     */
-    public OFPacketOut setInPort(short inPort) {
-        this.inPort = inPort;
-        return this;
-    }
-
-    /**
-     * Set in_port. Convenience method using OFPort enum.
-     * @param inPort
-     */
-    public OFPacketOut setInPort(OFPort inPort) {
-        this.inPort = inPort.getValue();
-        return this;
-    }
-
-    /**
-     * Get actions_len
-     * @return
-     */
-    public short getActionsLength() {
-        return this.actionsLength;
-    }
-
-    /**
-     * Get actions_len, unsigned
-     * @return
-     */
-    public int getActionsLengthU() {
-        return U16.f(this.actionsLength);
-    }
-
-    /**
-     * Set actions_len
-     * @param actionsLength
-     */
-    public OFPacketOut setActionsLength(short actionsLength) {
-        this.actionsLength = actionsLength;
-        return this;
-    }
-
-    /**
-     * Returns the actions contained in this message
-     * @return a list of ordered OFAction objects
-     */
-    public List<OFAction> getActions() {
-        return this.actions;
-    }
-
-    /**
-     * Sets the list of actions on this message
-     * @param actions a list of ordered OFAction objects
-     */
-    public OFPacketOut setActions(List<OFAction> actions) {
-        this.actions = actions;
-        return this;
-    }
-
-    @Override
-    public void setActionFactory(OFActionFactory actionFactory) {
-        this.actionFactory = actionFactory;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.bufferId = data.getInt();
-        this.inPort = data.getShort();
-        this.actionsLength = data.getShort();
-        if ( this.actionFactory == null)
-            throw new RuntimeException("ActionFactory not set");
-        this.actions = this.actionFactory.parseActions(data, getActionsLengthU());
-        this.packetData = new byte[getLengthU() - MINIMUM_LENGTH - getActionsLengthU()];
-        data.get(this.packetData);
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.putInt(bufferId);
-        data.putShort(inPort);
-        data.putShort(actionsLength);
-        for (OFAction action : actions) {
-            action.writeTo(data);
-        }
-        if (this.packetData != null)
-            data.put(this.packetData);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 293;
-        int result = super.hashCode();
-        result = prime * result + ((actions == null) ? 0 : actions.hashCode());
-        result = prime * result + actionsLength;
-        result = prime * result + bufferId;
-        result = prime * result + inPort;
-        result = prime * result + Arrays.hashCode(packetData);
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof OFPacketOut)) {
-            return false;
-        }
-        OFPacketOut other = (OFPacketOut) obj;
-        if (actions == null) {
-            if (other.actions != null) {
-                return false;
-            }
-        } else if (!actions.equals(other.actions)) {
-            return false;
-        }
-        if (actionsLength != other.actionsLength) {
-            return false;
-        }
-        if (bufferId != other.bufferId) {
-            return false;
-        }
-        if (inPort != other.inPort) {
-            return false;
-        }
-        if (!Arrays.equals(packetData, other.packetData)) {
-            return false;
-        }
-        return true;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#toString()
-     */
-    @Override
-    public String toString() {
-        return "OFPacketOut [actionFactory=" + actionFactory + ", actions="
-                + actions + ", actionsLength=" + actionsLength + ", bufferId=0x"
-                + Integer.toHexString(bufferId) + ", inPort=" + inPort + ", packetData="
-                + Arrays.toString(packetData) + "]";
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFPhysicalPort.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFPhysicalPort.java
deleted file mode 100644 (file)
index b3dfd34..0000000
+++ /dev/null
@@ -1,365 +0,0 @@
-package org.openflow.protocol;
-
-import java.io.Serializable;
-import java.io.UnsupportedEncodingException;
-import java.nio.ByteBuffer;
-import java.nio.charset.Charset;
-import java.util.Arrays;
-import java.util.HashMap;
-
-
-
-/**
- * Represents ofp_phy_port
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 25, 2010
- */
-public class OFPhysicalPort implements Cloneable, Serializable {
-    public static int MINIMUM_LENGTH = 48;
-    public static int OFP_ETH_ALEN = 6;
-
-    public enum OFPortConfig {
-        OFPPC_PORT_DOWN    (1 << 0),
-        OFPPC_NO_STP       (1 << 1),
-        OFPPC_NO_RECV      (1 << 2),
-        OFPPC_NO_RECV_STP  (1 << 3),
-        OFPPC_NO_FLOOD     (1 << 4),
-        OFPPC_NO_FWD       (1 << 5),
-        OFPPC_NO_PACKET_IN (1 << 6);
-
-        protected int value;
-
-        private OFPortConfig(int value) {
-            this.value = value;
-        }
-
-        /**
-         * @return the value
-         */
-        public int getValue() {
-            return value;
-        }
-    }
-
-    public enum OFPortState {
-        OFPPS_LINK_DOWN   (1 << 0),
-        OFPPS_STP_LISTEN  (0 << 8),
-        OFPPS_STP_LEARN   (1 << 8),
-        OFPPS_STP_FORWARD (2 << 8),
-        OFPPS_STP_BLOCK   (3 << 8),
-        OFPPS_STP_MASK    (3 << 8);
-
-        protected int value;
-
-        private OFPortState(int value) {
-            this.value = value;
-        }
-
-        /**
-         * @return the value
-         */
-        public int getValue() {
-            return value;
-        }
-    }
-
-    public enum OFPortFeatures {
-        OFPPF_10MB_HD    (1 << 0),
-        OFPPF_10MB_FD    (1 << 1),
-        OFPPF_100MB_HD   (1 << 2),
-        OFPPF_100MB_FD   (1 << 3),
-        OFPPF_1GB_HD     (1 << 4),
-        OFPPF_1GB_FD     (1 << 5),
-        OFPPF_10GB_FD    (1 << 6),
-        OFPPF_COPPER     (1 << 7),
-        OFPPF_FIBER      (1 << 8),
-        OFPPF_AUTONEG    (1 << 9),
-        OFPPF_PAUSE      (1 << 10),
-        OFPPF_PAUSE_ASYM (1 << 11);
-
-        protected int value;
-
-        private OFPortFeatures(int value) {
-            this.value = value;
-        }
-
-        /**
-         * @return the value
-         */
-        public int getValue() {
-            return value;
-        }
-    }
-
-    protected short portNumber;
-    protected byte[] hardwareAddress;
-    protected String name;
-    protected int config;
-    protected int state;
-    protected int currentFeatures;
-    protected int advertisedFeatures;
-    protected int supportedFeatures;
-    protected int peerFeatures;
-
-    /**
-     * @return the portNumber
-     */
-    public short getPortNumber() {
-        return portNumber;
-    }
-
-    /**
-     * @param portNumber the portNumber to set
-     */
-    public void setPortNumber(short portNumber) {
-        this.portNumber = portNumber;
-    }
-
-    /**
-     * @return the hardwareAddress
-     */
-    public byte[] getHardwareAddress() {
-        return hardwareAddress;
-    }
-
-    /**
-     * @param hardwareAddress the hardwareAddress to set
-     */
-    public void setHardwareAddress(byte[] hardwareAddress) {
-        if (hardwareAddress.length != OFP_ETH_ALEN)
-            throw new RuntimeException("Hardware address must have length "
-                    + OFP_ETH_ALEN);
-        this.hardwareAddress = hardwareAddress;
-    }
-
-    /**
-     * @return the name
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * @param name the name to set
-     */
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    /**
-     * @return the config
-     */
-    public int getConfig() {
-        return config;
-    }
-
-    /**
-     * @param config the config to set
-     */
-    public void setConfig(int config) {
-        this.config = config;
-    }
-
-    /**
-     * @return the state
-     */
-    public int getState() {
-        return state;
-    }
-
-    /**
-     * @param state the state to set
-     */
-    public void setState(int state) {
-        this.state = state;
-    }
-
-    /**
-     * @return the currentFeatures
-     */
-    public int getCurrentFeatures() {
-        return currentFeatures;
-    }
-
-    /**
-     * @param currentFeatures the currentFeatures to set
-     */
-    public void setCurrentFeatures(int currentFeatures) {
-        this.currentFeatures = currentFeatures;
-    }
-
-    /**
-     * @return the advertisedFeatures
-     */
-    public int getAdvertisedFeatures() {
-        return advertisedFeatures;
-    }
-
-    /**
-     * @param advertisedFeatures the advertisedFeatures to set
-     */
-    public void setAdvertisedFeatures(int advertisedFeatures) {
-        this.advertisedFeatures = advertisedFeatures;
-    }
-
-    /**
-     * @return the supportedFeatures
-     */
-    public int getSupportedFeatures() {
-        return supportedFeatures;
-    }
-
-    /**
-     * @param supportedFeatures the supportedFeatures to set
-     */
-    public void setSupportedFeatures(int supportedFeatures) {
-        this.supportedFeatures = supportedFeatures;
-    }
-
-    /**
-     * @return the peerFeatures
-     */
-    public int getPeerFeatures() {
-        return peerFeatures;
-    }
-
-    /**
-     * @param peerFeatures the peerFeatures to set
-     */
-    public void setPeerFeatures(int peerFeatures) {
-        this.peerFeatures = peerFeatures;
-    }
-
-    /**
-     * Read this message off the wire from the specified ByteBuffer
-     * @param data
-     */
-    public void readFrom(ByteBuffer data) {
-        this.portNumber = data.getShort();
-        if (this.hardwareAddress == null)
-            this.hardwareAddress = new byte[OFP_ETH_ALEN];
-        data.get(this.hardwareAddress);
-        byte[] name = new byte[16];
-        data.get(name);
-        // find the first index of 0
-        int index = 0;
-        for (byte b : name) {
-            if (0 == b)
-                break;
-            ++index;
-        }
-        this.name = new String(Arrays.copyOf(name, index),
-                Charset.forName("ascii"));
-        this.config = data.getInt();
-        this.state = data.getInt();
-        this.currentFeatures = data.getInt();
-        this.advertisedFeatures = data.getInt();
-        this.supportedFeatures = data.getInt();
-        this.peerFeatures = data.getInt();
-    }
-
-    /**
-     * Write this message's binary format to the specified ByteBuffer
-     * @param data
-     */
-    public void writeTo(ByteBuffer data) {
-        data.putShort(this.portNumber);
-        data.put(hardwareAddress);
-        try {
-            byte[] name = this.name.getBytes("ASCII");
-            if (name.length < 16) {
-                data.put(name);
-                for (int i = name.length; i < 16; ++i) {
-                    data.put((byte) 0);
-                }
-            } else {
-                data.put(name, 0, 15);
-                data.put((byte) 0);
-            }
-        } catch (UnsupportedEncodingException e) {
-            throw new RuntimeException(e);
-        }
-        data.putInt(this.config);
-        data.putInt(this.state);
-        data.putInt(this.currentFeatures);
-        data.putInt(this.advertisedFeatures);
-        data.putInt(this.supportedFeatures);
-        data.putInt(this.peerFeatures);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 307;
-        int result = 1;
-        result = prime * result + advertisedFeatures;
-        result = prime * result + config;
-        result = prime * result + currentFeatures;
-        result = prime * result + Arrays.hashCode(hardwareAddress);
-        result = prime * result + ((name == null) ? 0 : name.hashCode());
-        result = prime * result + peerFeatures;
-        result = prime * result + portNumber;
-        result = prime * result + state;
-        result = prime * result + supportedFeatures;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof OFPhysicalPort)) {
-            return false;
-        }
-        OFPhysicalPort other = (OFPhysicalPort) obj;
-        if (advertisedFeatures != other.advertisedFeatures) {
-            return false;
-        }
-        if (config != other.config) {
-            return false;
-        }
-        if (currentFeatures != other.currentFeatures) {
-            return false;
-        }
-        if (!Arrays.equals(hardwareAddress, other.hardwareAddress)) {
-            return false;
-        }
-        if (name == null) {
-            if (other.name != null) {
-                return false;
-            }
-        } else if (!name.equals(other.name)) {
-            return false;
-        }
-        if (peerFeatures != other.peerFeatures) {
-            return false;
-        }
-        if (portNumber != other.portNumber) {
-            return false;
-        }
-        if (state != other.state) {
-            return false;
-        }
-        if (supportedFeatures != other.supportedFeatures) {
-            return false;
-        }
-        return true;
-    }
-    
-    public OFPhysicalPort cloneOFPhysicalPort() {
-        OFPhysicalPort p;
-        try
-        {
-            p = (OFPhysicalPort) this.clone();
-            
-        }
-        catch (CloneNotSupportedException e)
-        {
-            throw new AssertionError();
-        }
-        return p;
-    }
-    
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFPort.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFPort.java
deleted file mode 100644 (file)
index fd07f24..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.openflow.protocol;
-
-public enum OFPort {
-    OFPP_MAX                ((short)0xff00),
-    OFPP_IN_PORT            ((short)0xfff8),
-    OFPP_TABLE              ((short)0xfff9),
-    OFPP_NORMAL             ((short)0xfffa),
-    OFPP_FLOOD              ((short)0xfffb),
-    OFPP_ALL                ((short)0xfffc),
-    OFPP_CONTROLLER         ((short)0xfffd),
-    OFPP_LOCAL              ((short)0xfffe),
-    OFPP_NONE               ((short)0xffff);
-
-    protected short value;
-
-    private OFPort(short value) {
-        this.value = value;
-    }
-
-    /**
-     * @return the value
-     */
-    public short getValue() {
-        return value;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFPortMod.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFPortMod.java
deleted file mode 100644 (file)
index 82b5de6..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-
-import org.openflow.util.U16;
-
-/**
- * Represents an ofp_port_mod message
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFPortMod extends OFMessage {
-    public static int MINIMUM_LENGTH = 32;
-
-    protected short portNumber;
-    protected byte[] hardwareAddress;
-    protected int config;
-    protected int mask;
-    protected int advertise;
-
-    public OFPortMod() {
-        super();
-        this.type = OFType.PORT_MOD;
-        this.length = U16.t(MINIMUM_LENGTH);
-    }
-
-    /**
-     * @return the portNumber
-     */
-    public short getPortNumber() {
-        return portNumber;
-    }
-
-    /**
-     * @param portNumber the portNumber to set
-     */
-    public void setPortNumber(short portNumber) {
-        this.portNumber = portNumber;
-    }
-
-    /**
-     * @return the hardwareAddress
-     */
-    public byte[] getHardwareAddress() {
-        return hardwareAddress;
-    }
-
-    /**
-     * @param hardwareAddress the hardwareAddress to set
-     */
-    public void setHardwareAddress(byte[] hardwareAddress) {
-        if (hardwareAddress.length != OFPhysicalPort.OFP_ETH_ALEN)
-            throw new RuntimeException("Hardware address must have length "
-                    + OFPhysicalPort.OFP_ETH_ALEN);
-        this.hardwareAddress = hardwareAddress;
-    }
-
-    /**
-     * @return the config
-     */
-    public int getConfig() {
-        return config;
-    }
-
-    /**
-     * @param config the config to set
-     */
-    public void setConfig(int config) {
-        this.config = config;
-    }
-
-    /**
-     * @return the mask
-     */
-    public int getMask() {
-        return mask;
-    }
-
-    /**
-     * @param mask the mask to set
-     */
-    public void setMask(int mask) {
-        this.mask = mask;
-    }
-
-    /**
-     * @return the advertise
-     */
-    public int getAdvertise() {
-        return advertise;
-    }
-
-    /**
-     * @param advertise the advertise to set
-     */
-    public void setAdvertise(int advertise) {
-        this.advertise = advertise;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.portNumber = data.getShort();
-        if (this.hardwareAddress == null)
-            this.hardwareAddress = new byte[OFPhysicalPort.OFP_ETH_ALEN];
-        data.get(this.hardwareAddress);
-        this.config = data.getInt();
-        this.mask = data.getInt();
-        this.advertise = data.getInt();
-        data.getInt(); // pad
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.putShort(this.portNumber);
-        data.put(this.hardwareAddress);
-        data.putInt(this.config);
-        data.putInt(this.mask);
-        data.putInt(this.advertise);
-        data.putInt(0); // pad
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 311;
-        int result = super.hashCode();
-        result = prime * result + advertise;
-        result = prime * result + config;
-        result = prime * result + Arrays.hashCode(hardwareAddress);
-        result = prime * result + mask;
-        result = prime * result + portNumber;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof OFPortMod)) {
-            return false;
-        }
-        OFPortMod other = (OFPortMod) obj;
-        if (advertise != other.advertise) {
-            return false;
-        }
-        if (config != other.config) {
-            return false;
-        }
-        if (!Arrays.equals(hardwareAddress, other.hardwareAddress)) {
-            return false;
-        }
-        if (mask != other.mask) {
-            return false;
-        }
-        if (portNumber != other.portNumber) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFPortStatus.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFPortStatus.java
deleted file mode 100644 (file)
index d70d6cb..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-
-import org.openflow.util.U16;
-
-/**
- * Represents an ofp_port_status message
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFPortStatus extends OFMessage {
-    public static int MINIMUM_LENGTH = 64;
-
-    public enum OFPortReason {
-        OFPPR_ADD,
-        OFPPR_DELETE,
-        OFPPR_MODIFY
-    }
-
-    protected byte reason;
-    protected OFPhysicalPort desc;
-
-    /**
-     * @return the reason
-     */
-    public byte getReason() {
-        return reason;
-    }
-
-    /**
-     * @param reason the reason to set
-     */
-    public void setReason(byte reason) {
-        this.reason = reason;
-    }
-
-    /**
-     * @return the desc
-     */
-    public OFPhysicalPort getDesc() {
-        return desc;
-    }
-
-    /**
-     * @param desc the desc to set
-     */
-    public void setDesc(OFPhysicalPort desc) {
-        this.desc = desc;
-    }
-
-    public OFPortStatus() {
-        super();
-        this.type = OFType.PORT_STATUS;
-        this.length = U16.t(MINIMUM_LENGTH);
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.reason = data.get();
-        data.position(data.position() + 7); // skip 7 bytes of padding
-        if (this.desc == null)
-            this.desc = new OFPhysicalPort();
-        this.desc.readFrom(data);
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.put(this.reason);
-        for (int i = 0; i < 7; ++i)
-            data.put((byte) 0);
-        this.desc.writeTo(data);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 313;
-        int result = super.hashCode();
-        result = prime * result + ((desc == null) ? 0 : desc.hashCode());
-        result = prime * result + reason;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof OFPortStatus)) {
-            return false;
-        }
-        OFPortStatus other = (OFPortStatus) obj;
-        if (desc == null) {
-            if (other.desc != null) {
-                return false;
-            }
-        } else if (!desc.equals(other.desc)) {
-            return false;
-        }
-        if (reason != other.reason) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFQueueConfigReply.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFQueueConfigReply.java
deleted file mode 100644 (file)
index 2dc52fb..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.openflow.util.U16;
-import org.openflow.protocol.factory.OFQueuePropertyFactory;
-import org.openflow.protocol.factory.OFQueuePropertyFactoryAware;
-import org.openflow.protocol.queue.OFPacketQueue;
-
-/**
- *
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFQueueConfigReply extends OFMessage implements Cloneable, OFQueuePropertyFactoryAware {
-    public static int MINIMUM_LENGTH = 16;
-
-    protected OFQueuePropertyFactory queuePropertyFactory;
-
-    protected short port;
-    protected List<OFPacketQueue> queues;
-
-    /**
-     * 
-     */
-    public OFQueueConfigReply() {
-        super();
-        this.type = OFType.QUEUE_CONFIG_REPLY;
-        this.length = U16.t(MINIMUM_LENGTH);
-    }
-
-    /**
-     * @return the port
-     */
-    public short getPort() {
-        return port;
-    }
-
-    /**
-     * @param port the port to set
-     */
-    public OFQueueConfigReply setPort(short port) {
-        this.port = port;
-        return this;
-    }
-
-    /**
-     * @return the queues
-     */
-    public List<OFPacketQueue> getQueues() {
-        return queues;
-    }
-
-    /**
-     * @param queues the queues to set
-     */
-    public void setQueues(List<OFPacketQueue> queues) {
-        this.queues = queues;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.port = data.getShort();
-        data.getShort(); // pad
-        data.getInt(); // pad
-        int remaining = this.getLengthU() - MINIMUM_LENGTH;
-        if (data.remaining() < remaining)
-            remaining = data.remaining();
-        this.queues = new ArrayList<OFPacketQueue>();
-        while (remaining >= OFPacketQueue.MINIMUM_LENGTH) {
-            OFPacketQueue queue = new OFPacketQueue();
-            queue.setQueuePropertyFactory(this.queuePropertyFactory);
-            queue.readFrom(data);
-            remaining -= U16.f(queue.getLength());
-            this.queues.add(queue);
-        }
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.putShort(this.port);
-        data.putShort((short) 0); // pad
-        data.putInt(0); // pad
-        if (this.queues != null) {
-            for (OFPacketQueue queue : this.queues) {
-                queue.writeTo(data);
-            }
-        }
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 4549;
-        int result = super.hashCode();
-        result = prime * result + port;
-        result = prime * result + ((queues == null) ? 0 : queues.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (!(obj instanceof OFQueueConfigReply))
-            return false;
-        OFQueueConfigReply other = (OFQueueConfigReply) obj;
-        if (port != other.port)
-            return false;
-        if (queues == null) {
-            if (other.queues != null)
-                return false;
-        } else if (!queues.equals(other.queues))
-            return false;
-        return true;
-    }
-
-    @Override
-    public void setQueuePropertyFactory(
-            OFQueuePropertyFactory queuePropertyFactory) {
-        this.queuePropertyFactory = queuePropertyFactory;
-    }
-
-    @Override
-    public OFQueueConfigReply clone() {
-        try {
-            OFQueueConfigReply clone = (OFQueueConfigReply) super.clone();
-            if (this.queues != null) {
-                List<OFPacketQueue> queues = new ArrayList<OFPacketQueue>();
-                for (OFPacketQueue queue : this.queues) {
-                    queues.add(queue.clone());
-                }
-                clone.setQueues(queues);
-            }
-            return clone;
-        } catch (CloneNotSupportedException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    @Override
-    public String toString() {
-        return "OFQueueConfigReply [port=" + U16.f(port) + ", queues=" + queues
-                + ", xid=" + xid + "]";
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFQueueConfigRequest.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFQueueConfigRequest.java
deleted file mode 100644 (file)
index dcd8f2e..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-
-import org.openflow.util.U16;
-
-/**
- *
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFQueueConfigRequest extends OFMessage implements Cloneable {
-    public static int MINIMUM_LENGTH = 12;
-
-    protected short port;
-
-    /**
-     * 
-     */
-    public OFQueueConfigRequest() {
-        super();
-        this.type = OFType.QUEUE_CONFIG_REQUEST;
-        this.length = U16.t(MINIMUM_LENGTH);
-    }
-
-    /**
-     * @return the port
-     */
-    public short getPort() {
-        return port;
-    }
-
-    /**
-     * @param port the port to set
-     */
-    public void setPort(short port) {
-        this.port = port;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.port = data.getShort();
-        data.get(); // pad
-        data.get(); // pad
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.putShort(this.port);
-        data.putShort((short) 0); // pad
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 7211;
-        int result = super.hashCode();
-        result = prime * result + port;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (!(obj instanceof OFQueueConfigRequest))
-            return false;
-        OFQueueConfigRequest other = (OFQueueConfigRequest) obj;
-        if (port != other.port)
-            return false;
-        return true;
-    }
-
-    @Override
-    public OFQueueConfigRequest clone() {
-        try {
-            return (OFQueueConfigRequest) super.clone();
-        } catch (CloneNotSupportedException e) {
-            throw new RuntimeException(e);
-        }
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFSetConfig.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFSetConfig.java
deleted file mode 100644 (file)
index 0a6709d..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.openflow.protocol;
-
-/**
- * Represents an OFPT_SET_CONFIG type message
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFSetConfig extends OFSwitchConfig {
-    public OFSetConfig() {
-        super();
-        this.type = OFType.SET_CONFIG;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFStatisticsMessageBase.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFStatisticsMessageBase.java
deleted file mode 100644 (file)
index 0014bcf..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-import java.util.List;
-
-import org.openflow.protocol.factory.OFStatisticsFactory;
-import org.openflow.protocol.factory.OFStatisticsFactoryAware;
-import org.openflow.protocol.statistics.OFStatistics;
-import org.openflow.protocol.statistics.OFStatisticsType;
-
-
-/**
- * Base class for statistics requests/replies
- *
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 27, 2010
- */
-public abstract class OFStatisticsMessageBase extends OFMessage implements
-        OFStatisticsFactoryAware {
-    public static int MINIMUM_LENGTH = 12;
-
-    protected OFStatisticsFactory statisticsFactory;
-    protected OFStatisticsType statisticType;
-    protected short flags;
-    protected List<OFStatistics> statistics;
-
-    /**
-     * @return the statisticType
-     */
-    public OFStatisticsType getStatisticType() {
-        return statisticType;
-    }
-
-    /**
-     * @param statisticType the statisticType to set
-     */
-    public void setStatisticType(OFStatisticsType statisticType) {
-        this.statisticType = statisticType;
-    }
-
-    /**
-     * @return the flags
-     */
-    public short getFlags() {
-        return flags;
-    }
-
-    /**
-     * @param flags the flags to set
-     */
-    public void setFlags(short flags) {
-        this.flags = flags;
-    }
-
-    /**
-     * @return the statistics
-     */
-    public List<OFStatistics> getStatistics() {
-        return statistics;
-    }
-
-    /**
-     * @param statistics the statistics to set
-     */
-    public void setStatistics(List<OFStatistics> statistics) {
-        this.statistics = statistics;
-    }
-
-    @Override
-    public void setStatisticsFactory(OFStatisticsFactory statisticsFactory) {
-        this.statisticsFactory = statisticsFactory;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.statisticType = OFStatisticsType.valueOf(data.getShort(), this
-                .getType());
-        this.flags = data.getShort();
-        if (this.statisticsFactory == null)
-            throw new RuntimeException("OFStatisticsFactory not set");
-        this.statistics = statisticsFactory.parseStatistics(this.getType(),
-                this.statisticType, data, super.getLengthU() - MINIMUM_LENGTH);
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.putShort(this.statisticType.getTypeValue());
-        data.putShort(this.flags);
-        if (this.statistics != null) {
-            for (OFStatistics statistic : this.statistics) {
-                statistic.writeTo(data);
-            }
-        }
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 317;
-        int result = super.hashCode();
-        result = prime * result + flags;
-        result = prime * result
-                + ((statisticType == null) ? 0 : statisticType.hashCode());
-        result = prime * result
-                + ((statistics == null) ? 0 : statistics.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof OFStatisticsMessageBase)) {
-            return false;
-        }
-        OFStatisticsMessageBase other = (OFStatisticsMessageBase) obj;
-        if (flags != other.flags) {
-            return false;
-        }
-        if (statisticType == null) {
-            if (other.statisticType != null) {
-                return false;
-            }
-        } else if (!statisticType.equals(other.statisticType)) {
-            return false;
-        }
-        if (statistics == null) {
-            if (other.statistics != null) {
-                return false;
-            }
-        } else if (!statistics.equals(other.statistics)) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFStatisticsReply.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFStatisticsReply.java
deleted file mode 100644 (file)
index e5f705c..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.openflow.protocol;
-
-import org.openflow.util.U16;
-
-/**
- * Represents an ofp_stats_reply message
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFStatisticsReply extends OFStatisticsMessageBase {
-    public enum OFStatisticsReplyFlags {
-        REPLY_MORE      (1 << 0);
-
-        protected short type;
-
-        OFStatisticsReplyFlags(int type) {
-            this.type = (short) type;
-        }
-
-        public short getTypeValue() {
-            return type;
-        }
-    }
-
-    public OFStatisticsReply() {
-        super();
-        this.type = OFType.STATS_REPLY;
-        this.length = U16.t(OFStatisticsMessageBase.MINIMUM_LENGTH);
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFStatisticsRequest.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFStatisticsRequest.java
deleted file mode 100644 (file)
index 94a28ad..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.openflow.protocol;
-
-import org.openflow.util.U16;
-
-/**
- * Represents an ofp_stats_request message
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFStatisticsRequest extends OFStatisticsMessageBase {
-    public OFStatisticsRequest() {
-        super();
-        this.type = OFType.STATS_REQUEST;
-        this.length = U16.t(OFStatisticsMessageBase.MINIMUM_LENGTH);
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFSwitchConfig.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFSwitchConfig.java
deleted file mode 100644 (file)
index 16e66d6..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-
-/**
- * Base class representing ofp_switch_config based messages
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public abstract class OFSwitchConfig extends OFMessage {
-    public static int MINIMUM_LENGTH = 12;
-
-    public enum OFConfigFlags {
-        OFPC_FRAG_NORMAL,
-        OFPC_FRAG_DROP,
-        OFPC_FRAG_REASM,
-        OFPC_FRAG_MASK
-    }
-
-    protected short flags;
-    protected short missSendLength;
-
-    public OFSwitchConfig() {
-        super();
-        super.setLengthU(MINIMUM_LENGTH);
-    }
-
-    /**
-     * @return the flags
-     */
-    public short getFlags() {
-        return flags;
-    }
-
-    /**
-     * @param flags the flags to set
-     */
-    public OFSwitchConfig setFlags(short flags) {
-        this.flags = flags;
-        return this;
-    }
-
-    /**
-     * @return the missSendLength
-     */
-    public short getMissSendLength() {
-        return missSendLength;
-    }
-
-    /**
-     * @param missSendLength the missSendLength to set
-     */
-    public OFSwitchConfig setMissSendLength(short missSendLength) {
-        this.missSendLength = missSendLength;
-        return this;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.flags = data.getShort();
-        this.missSendLength = data.getShort();
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.putShort(this.flags);
-        data.putShort(this.missSendLength);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 331;
-        int result = super.hashCode();
-        result = prime * result + flags;
-        result = prime * result + missSendLength;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof OFSwitchConfig)) {
-            return false;
-        }
-        OFSwitchConfig other = (OFSwitchConfig) obj;
-        if (flags != other.flags) {
-            return false;
-        }
-        if (missSendLength != other.missSendLength) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFType.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFType.java
deleted file mode 100644 (file)
index 603f4cc..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-package org.openflow.protocol;
-
-import java.lang.reflect.Constructor;
-
-/**
- * List of OpenFlow types and mappings to wire protocol value and derived
- * classes
- *
- * @author Rob Sherwood (rob.sherwood@stanford.edu)
- * @author David Erickson (daviderickson@cs.stanford.edu)
- *
- */
-public enum OFType {
-    HELLO               (0, OFHello.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFHello();
-                            }}),
-    ERROR               (1, OFError.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFError();
-                            }}),
-    ECHO_REQUEST        (2, OFEchoRequest.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFEchoRequest();
-                            }}),
-    ECHO_REPLY          (3, OFEchoReply.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFEchoReply();
-                            }}),
-    VENDOR              (4, OFVendor.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFVendor();
-                            }}),
-    FEATURES_REQUEST    (5, OFFeaturesRequest.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFFeaturesRequest();
-                            }}),
-    FEATURES_REPLY      (6, OFFeaturesReply.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFFeaturesReply();
-                            }}),
-    GET_CONFIG_REQUEST  (7, OFGetConfigRequest.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFGetConfigRequest();
-                            }}),
-    GET_CONFIG_REPLY    (8, OFGetConfigReply.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFGetConfigReply();
-                            }}),
-    SET_CONFIG          (9, OFSetConfig.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFSetConfig();
-                            }}),
-    PACKET_IN           (10, OFPacketIn.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFPacketIn();
-                            }}),
-    FLOW_REMOVED        (11, OFFlowRemoved.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFFlowRemoved();
-                            }}),
-    PORT_STATUS         (12, OFPortStatus.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFPortStatus();
-                            }}),
-    PACKET_OUT          (13, OFPacketOut.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFPacketOut();
-                            }}),
-    FLOW_MOD            (14, OFFlowMod.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFFlowMod();
-                            }}),
-    PORT_MOD            (15, OFPortMod.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFPortMod();
-                            }}),
-    STATS_REQUEST       (16, OFStatisticsRequest.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFStatisticsRequest();
-                            }}),
-    STATS_REPLY         (17, OFStatisticsReply.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFStatisticsReply();
-                            }}),
-    BARRIER_REQUEST     (18, OFBarrierRequest.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFBarrierRequest();
-                            }}),
-    BARRIER_REPLY       (19, OFBarrierReply.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFBarrierReply();
-                            }}),
-    QUEUE_CONFIG_REQUEST    (20, OFMessage.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFQueueConfigRequest();
-                            }}),
-    QUEUE_CONFIG_REPLY  (21, OFMessage.class, new Instantiable<OFMessage>() {
-                            @Override
-                            public OFMessage instantiate() {
-                                return new OFQueueConfigReply();
-                            }});
-
-    static OFType[] mapping;
-
-    protected Class<? extends OFMessage> clazz;
-    protected Constructor<? extends OFMessage> constructor;
-    protected Instantiable<OFMessage> instantiable;
-    protected byte type;
-
-    /**
-     * Store some information about the OpenFlow type, including wire protocol
-     * type number, length, and derived class
-     *
-     * @param type Wire protocol number associated with this OFType
-     * @param requestClass The Java class corresponding to this type of OpenFlow
-     *              message
-     * @param instantiator An Instantiator<OFMessage> implementation that creates an
-     *          instance of the specified OFMessage
-     */
-    OFType(int type, Class<? extends OFMessage> clazz, Instantiable<OFMessage> instantiator) {
-        this.type = (byte) type;
-        this.clazz = clazz;
-        this.instantiable = instantiator;
-        try {
-            this.constructor = clazz.getConstructor(new Class[]{});
-        } catch (Exception e) {
-            throw new RuntimeException(
-                    "Failure getting constructor for class: " + clazz, e);
-        }
-        OFType.addMapping(this.type, this);
-    }
-
-    /**
-     * Adds a mapping from type value to OFType enum
-     *
-     * @param i OpenFlow wire protocol type
-     * @param t type
-     */
-    public static void addMapping(byte i, OFType t) {
-        if (mapping == null)
-            mapping = new OFType[32];
-        OFType.mapping[i] = t;
-    }
-
-    /**
-     * Remove a mapping from type value to OFType enum
-     *
-     * @param i OpenFlow wire protocol type
-     */
-    public static void removeMapping(byte i) {
-        OFType.mapping[i] = null;
-    }
-
-    /**
-     * Given a wire protocol OpenFlow type number, return the OFType associated
-     * with it
-     *
-     * @param i wire protocol number
-     * @return OFType enum type
-     */
-
-    public static OFType valueOf(Byte i) {
-        return OFType.mapping[i];
-    }
-
-    /**
-     * @return Returns the wire protocol value corresponding to this OFType
-     */
-    public byte getTypeValue() {
-        return this.type;
-    }
-
-    /**
-     * @return return the OFMessage subclass corresponding to this OFType
-     */
-    public Class<? extends OFMessage> toClass() {
-        return clazz;
-    }
-
-    /**
-     * Returns the no-argument Constructor of the implementation class for
-     * this OFType
-     * @return the constructor
-     */
-    public Constructor<? extends OFMessage> getConstructor() {
-        return constructor;
-    }
-
-    /**
-     * Returns a new instance of the OFMessage represented by this OFType
-     * @return the new object
-     */
-    public OFMessage newInstance() {
-        return instantiable.instantiate();
-    }
-
-    /**
-     * @return the instantiable
-     */
-    public Instantiable<OFMessage> getInstantiable() {
-        return instantiable;
-    }
-
-    /**
-     * @param instantiable the instantiable to set
-     */
-    public void setInstantiable(Instantiable<OFMessage> instantiable) {
-        this.instantiable = instantiable;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFVendor.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFVendor.java
deleted file mode 100644 (file)
index f372650..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-
-import org.openflow.util.U16;
-
-/**
- * Represents ofp_vendor_header
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFVendor extends OFMessage {
-    public static int MINIMUM_LENGTH = 12;
-
-    protected int vendor;
-    protected byte[] data;
-
-    public OFVendor() {
-        super();
-        this.type = OFType.VENDOR;
-        this.length = U16.t(MINIMUM_LENGTH);
-    }
-
-    /**
-     * @return the vendor
-     */
-    public int getVendor() {
-        return vendor;
-    }
-
-    /**
-     * @param vendor the vendor to set
-     */
-    public void setVendor(int vendor) {
-        this.vendor = vendor;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.vendor = data.getInt();
-        if (this.length > MINIMUM_LENGTH) {
-            this.data = new byte[this.length - MINIMUM_LENGTH];
-            data.get(this.data);
-        }
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.putInt(this.vendor);
-        if (this.data != null)
-            data.put(this.data);
-    }
-
-    /**
-     * @return the data
-     */
-    public byte[] getData() {
-        return data;
-    }
-
-    /**
-     * @param data the data to set
-     */
-    public void setData(byte[] data) {
-        this.data = data;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#hashCode()
-     */
-    @Override
-    public int hashCode() {
-        final int prime = 337;
-        int result = super.hashCode();
-        result = prime * result + Arrays.hashCode(data);
-        result = prime * result + vendor;
-        return result;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        OFVendor other = (OFVendor) obj;
-        if (!Arrays.equals(data, other.data))
-            return false;
-        if (vendor != other.vendor)
-            return false;
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/ActionVendorOutputNextHop.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/ActionVendorOutputNextHop.java
deleted file mode 100644 (file)
index f26ca51..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-package org.openflow.protocol.action;
-
-       import java.net.Inet4Address;
-       import java.net.InetAddress;
-       import java.net.UnknownHostException;
-import java.nio.ByteBuffer;
-
-import org.openflow.util.HexString;
-
-
-       public class ActionVendorOutputNextHop extends OFActionVendor {
-               private static final long serialVersionUID = 1L;
-               private static int VENDOR_CISCO = 0xC;
-               private enum ONHLength {
-                       ONH_LEN_MIN(16),
-                       ONH_LEN_P2P(16),
-                       ONH_LEN_IPV4(24),
-                       ONH_LEN_MAC(32),
-                       ONH_LEN_IPV6(40);
-               private int value;
-               private ONHLength(int value) {
-                       this.value = value;
-               }
-               public int getValue() {
-                       return this.value;
-               }
-               }       
-               private enum ONHActionType {
-                       ONH_ACTION_NONE(0),
-                       ONH_ACTION_OUTPUT_NH(1),
-                       ONH_ACTION_NETFLOW(2);
-               private int value;
-               private ONHActionType(int value) {
-                       this.value = value;
-               }
-               public int getValue() {
-                       return this.value;
-               }
-               }
-               private enum ONHAddressType {
-               ONH_ADDRTYPE_NONE(0),
-               ONH_ADDRTYPE_P2P(1),
-               ONH_ADDRTYPE_IPV4(2),
-               ONH_ADDRTYPE_IPV6(3),
-               ONH_ADDRTYPE_MAC48(4);
-               private int value;
-               private ONHAddressType(int value) {
-                       this.value = value;
-               }
-               public int getValue() {
-                       return this.value;
-               }
-           }
-           private enum ONHXAddressType {
-               ONH_XADDRTYPE_NONE(0),
-               ONH_XADDRTYPE_PORT(1),
-               ONH_XADDRTYPE_VPNID(2);
-               private int value;
-               private ONHXAddressType(int value) {
-                       this.value = value;
-               }
-               public int getValue() {
-                       return this.value;
-               }
-          }
-               protected InetAddress address; 
-                       
-               public ActionVendorOutputNextHop() {
-               super();
-               super.setLength((short)ONHLength.ONH_LEN_MIN.getValue());
-                       super.setVendor(VENDOR_CISCO);
-                       this.address = null;
-               }
-               
-               public void setNextHop(InetAddress address) {
-                       short actionLen;
-                       if (address instanceof Inet4Address) {
-                actionLen = (short)ONHLength.ONH_LEN_IPV4.getValue();
-            } else {
-                actionLen = (short)ONHLength.ONH_LEN_IPV6.getValue();
-            }
-            super.setLength(actionLen);
-                       this.address = address;
-               }
-               public InetAddress getNextHop() {
-                       return this.address;
-               }
-           @Override
-           public void readFrom(ByteBuffer data) {
-               /*
-                * For now, only contains the next hop address
-                */
-               //super.readFrom(data); don't need this
-               
-               if (data.remaining() < super.getLength()-8) {
-                       /*
-                        * malformed element, skip over 
-                        */
-                       data.position(data.remaining());
-                       return;
-               }
-               if ((super.getLength() !=  (short)ONHLength.ONH_LEN_IPV4.getValue()) &&
-                       (super.getLength() !=  (short)ONHLength.ONH_LEN_IPV6.getValue())) {
-                       /*
-                        * mal-formed element, skip over 
-                        */
-                       data.position(super.getLength());
-                       return;
-               }
-               data.getShort();  // skip the ONH_ACTION_OUTPUT_NH
-               data.getShort(); // skip address and xtraaddress types
-               data.getInt();     // skip the extra address (8 bytes)
-               data.getInt();
-               byte[] a;
-               if (super.getLength() == (short)ONHLength.ONH_LEN_IPV4.getValue()) {
-                       a = new byte[4];
-                       data.get(a);
-               } else {
-                       a = new byte[16];
-                       data.get(a);
-                       data.getInt(); //4 bytes pad
-               }
-               try {
-                       this.address = InetAddress.getByAddress(a);
-               } catch (UnknownHostException e) {
-                       e.printStackTrace();
-               }
-           }
-
-           @Override
-           public void writeTo(ByteBuffer data) {
-               byte atype = (byte)(ONHAddressType.ONH_ADDRTYPE_NONE.getValue());
-               byte xatype = (byte)(ONHXAddressType.ONH_XADDRTYPE_NONE.getValue());
-               if (address instanceof Inet4Address) 
-                       atype =  (byte)(ONHAddressType.ONH_ADDRTYPE_IPV4.getValue());
-               else
-                       atype = (byte)(ONHAddressType.ONH_ADDRTYPE_IPV6.getValue());
-               super.writeTo(data); // this writes the standard  8byte ofp_action_vendor_header
-               data.putShort((short)(ONHActionType.ONH_ACTION_OUTPUT_NH.getValue()));
-               data.put(atype);
-               data.put(xatype);
-               /*
-                * write the xtra address. For now it is all 0
-                */
-               data.putInt(0); // 8-byte pad
-               data.putInt(0);
-               /* 
-                * write the address only when address type is not P2P
-                */
-               if (atype == (byte)(ONHAddressType.ONH_ADDRTYPE_IPV4.getValue())) {
-                       data.put(address.getAddress()); // no need to pad
-                       //avnh.put(address.getAddress()); 
-               } else if (atype == (byte)(ONHAddressType.ONH_ADDRTYPE_IPV6.getValue())) {
-                       data.put(address.getAddress());
-                       //avnh.put(address.getAddress());
-                       data.putInt(0); // 4-byte pad
-                       //avnh.putInt(0);
-               }
-               ActionVendorOutputNextHop a = new ActionVendorOutputNextHop();
-               a.setLength((short)24);
-           }
-
-           @Override
-           public int hashCode() {
-               final int prime = 347;
-               int result = super.hashCode();
-               result = prime * result + address.hashCode();
-               return result;
-           }
-
-           @Override
-           public boolean equals(Object obj) {
-               if (this == obj) {
-                   return true;
-               }
-               if (!super.equals(obj)) {
-                   return false;
-               }
-               if (!(obj instanceof ActionVendorOutputNextHop)) {
-                   return false;
-               }
-               ActionVendorOutputNextHop other = (ActionVendorOutputNextHop) obj;
-               if (!other.address.equals(this.address))
-                       return false;
-               return true;
-           }
-
-               public String toString() {
-                       return ("OutputNextHop: " + address.getHostAddress());
-               }
-
-       }
-
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFAction.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFAction.java
deleted file mode 100644 (file)
index d5a4eac..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.openflow.protocol.action;
-
-import java.io.Serializable;
-import java.nio.ByteBuffer;
-
-import org.openflow.util.U16;
-
-/**
- * The base class for all OpenFlow Actions.
- *
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-public class OFAction implements Cloneable, Serializable{
-    /**
-     * Note the true minimum length for this header is 8 including a pad to 64
-     * bit alignment, however as this base class is used for demuxing an
-     * incoming Action, it is only necessary to read the first 4 bytes.  All
-     * Actions extending this class are responsible for reading/writing the
-     * first 8 bytes, including the pad if necessary.
-     */
-    public static int MINIMUM_LENGTH = 4;
-    public static int OFFSET_LENGTH = 2;
-    public static int OFFSET_TYPE = 0;
-
-    protected OFActionType type;
-    protected short length;
-
-    /**
-     * Get the length of this message
-     *
-     * @return
-     */
-    public short getLength() {
-        return length;
-    }
-
-    /**
-     * Get the length of this message, unsigned
-     *
-     * @return
-     */
-    public int getLengthU() {
-        return U16.f(length);
-    }
-
-    /**
-     * Set the length of this message
-     *
-     * @param length
-     */
-    public OFAction setLength(short length) {
-        this.length = length;
-        return this;
-    }
-
-    /**
-     * Get the type of this message
-     *
-     * @return OFActionType enum
-     */
-    public OFActionType getType() {
-        return this.type;
-    }
-
-    /**
-     * Set the type of this message
-     *
-     * @param type
-     */
-    public void setType(OFActionType type) {
-        this.type = type;
-    }
-
-    /**
-     * Returns a summary of the message
-     * @return "ofmsg=v=$version;t=$type:l=$len:xid=$xid"
-     */
-    public String toString() {
-        return "ofaction" +
-            ";t=" + this.getType() +
-            ";l=" + this.getLength();
-    }
-    
-    /**
-     * Given the output from toString(), 
-     * create a new OFAction
-     * @param val
-     * @return
-     */
-    public static OFAction fromString(String val) {
-        String tokens[] = val.split(";");
-        if (!tokens[0].equals("ofaction"))
-            throw new IllegalArgumentException("expected 'ofaction' but got '" + 
-                    tokens[0] + "'");
-        String type_tokens[] = tokens[1].split("="); 
-        String len_tokens[] = tokens[2].split("=");
-        OFAction action = new OFAction();
-        action.setLength(Short.valueOf(len_tokens[1]));
-        action.setType(OFActionType.valueOf(type_tokens[1]));
-        return action;
-    }
-
-    public void readFrom(ByteBuffer data) {
-        this.type = OFActionType.valueOf(data.getShort());
-        this.length = data.getShort();
-        // Note missing PAD, see MINIMUM_LENGTH comment for details
-    }
-
-    public void writeTo(ByteBuffer data) {
-        data.putShort(type.getTypeValue());
-        data.putShort(length);
-        // Note missing PAD, see MINIMUM_LENGTH comment for details
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 347;
-        int result = 1;
-        result = prime * result + length;
-        result = prime * result + ((type == null) ? 0 : type.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof OFAction)) {
-            return false;
-        }
-        OFAction other = (OFAction) obj;
-        if (length != other.length) {
-            return false;
-        }
-        if (type == null) {
-            if (other.type != null) {
-                return false;
-            }
-        } else if (!type.equals(other.type)) {
-            return false;
-        }
-        return true;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#clone()
-     */
-    @Override
-    public OFAction clone() throws CloneNotSupportedException {
-        return (OFAction) super.clone();
-    }
-    
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionDataLayer.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionDataLayer.java
deleted file mode 100644 (file)
index f637b21..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-package org.openflow.protocol.action;
-
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-
-import org.openflow.protocol.OFPhysicalPort;
-
-/**
- * Represents an ofp_action_dl_addr
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-public abstract class OFActionDataLayer extends OFAction {
-    public static int MINIMUM_LENGTH = 16;
-
-    protected byte[] dataLayerAddress;
-
-    /**
-     * @return the dataLayerAddress
-     */
-    public byte[] getDataLayerAddress() {
-        return dataLayerAddress;
-    }
-
-    /**
-     * @param dataLayerAddress the dataLayerAddress to set
-     */
-    public void setDataLayerAddress(byte[] dataLayerAddress) {
-        this.dataLayerAddress = dataLayerAddress;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        if (this.dataLayerAddress == null)
-            this.dataLayerAddress = new byte[OFPhysicalPort.OFP_ETH_ALEN];
-        data.get(this.dataLayerAddress);
-        data.getInt();
-        data.getShort();
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.put(this.dataLayerAddress, 0, OFPhysicalPort.OFP_ETH_ALEN);
-        data.putInt(0);
-        data.putShort((short) 0);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 347;
-        int result = super.hashCode();
-        result = prime * result + Arrays.hashCode(dataLayerAddress);
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof OFActionDataLayer)) {
-            return false;
-        }
-        OFActionDataLayer other = (OFActionDataLayer) obj;
-        if (!Arrays.equals(dataLayerAddress, other.dataLayerAddress)) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionDataLayerDestination.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionDataLayerDestination.java
deleted file mode 100644 (file)
index 75014f4..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.openflow.protocol.action;
-
-/**
- *
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFActionDataLayerDestination extends OFActionDataLayer {
-    public OFActionDataLayerDestination() {
-        super();
-        super.setType(OFActionType.SET_DL_DST);
-        super.setLength((short) OFActionDataLayer.MINIMUM_LENGTH);
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionDataLayerSource.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionDataLayerSource.java
deleted file mode 100644 (file)
index f0e2fa9..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.openflow.protocol.action;
-
-/**
- *
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFActionDataLayerSource extends OFActionDataLayer {
-    public OFActionDataLayerSource() {
-        super();
-        super.setType(OFActionType.SET_DL_SRC);
-        super.setLength((short) OFActionDataLayer.MINIMUM_LENGTH);
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionEnqueue.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionEnqueue.java
deleted file mode 100644 (file)
index 1791bc5..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/**
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-package org.openflow.protocol.action;
-
-import java.nio.ByteBuffer;
-
-/**
- * Represents an ofp_action_enqueue
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-public class OFActionEnqueue extends OFAction {
-    public static int MINIMUM_LENGTH = 16;
-
-    protected short port;
-    protected int queueId;
-
-    public OFActionEnqueue() {
-        super.setType(OFActionType.OPAQUE_ENQUEUE);
-        super.setLength((short) MINIMUM_LENGTH);
-    }
-
-    /**
-     * Get the output port
-     * @return
-     */
-    public short getPort() {
-        return this.port;
-    }
-
-    /**
-     * Set the output port
-     * @param port
-     */
-    public void setPort(short port) {
-        this.port = port;
-    }
-
-    /**
-     * @return the queueId
-     */
-    public int getQueueId() {
-        return queueId;
-    }
-
-    /**
-     * @param queueId the queueId to set
-     */
-    public void setQueueId(int queueId) {
-        this.queueId = queueId;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.port = data.getShort();
-        data.getShort();
-        data.getInt();
-        this.queueId = data.getInt();
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.putShort(this.port);
-        data.putShort((short) 0);
-        data.putInt(0);
-        data.putInt(this.queueId);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 349;
-        int result = super.hashCode();
-        result = prime * result + port;
-        result = prime * result + queueId;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof OFActionEnqueue)) {
-            return false;
-        }
-        OFActionEnqueue other = (OFActionEnqueue) obj;
-        if (port != other.port) {
-            return false;
-        }
-        if (queueId != other.queueId) {
-            return false;
-        }
-        return true;
-    }
-}
\ No newline at end of file
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionNetworkLayerAddress.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionNetworkLayerAddress.java
deleted file mode 100644 (file)
index 5567684..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-package org.openflow.protocol.action;
-
-import java.nio.ByteBuffer;
-
-/**
- * Represents an ofp_action_nw_addr
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-public abstract class OFActionNetworkLayerAddress extends OFAction {
-    public static int MINIMUM_LENGTH = 8;
-
-    protected int networkAddress;
-
-    /**
-     * @return the networkAddress
-     */
-    public int getNetworkAddress() {
-        return networkAddress;
-    }
-
-    /**
-     * @param networkAddress the networkAddress to set
-     */
-    public void setNetworkAddress(int networkAddress) {
-        this.networkAddress = networkAddress;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.networkAddress = data.getInt();
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.putInt(this.networkAddress);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 353;
-        int result = super.hashCode();
-        result = prime * result + networkAddress;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof OFActionNetworkLayerAddress)) {
-            return false;
-        }
-        OFActionNetworkLayerAddress other = (OFActionNetworkLayerAddress) obj;
-        if (networkAddress != other.networkAddress) {
-            return false;
-        }
-        return true;
-    }
-}
\ No newline at end of file
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionNetworkLayerDestination.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionNetworkLayerDestination.java
deleted file mode 100644 (file)
index 579570f..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.openflow.protocol.action;
-
-/**
- *
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFActionNetworkLayerDestination extends OFActionNetworkLayerAddress {
-    public OFActionNetworkLayerDestination() {
-        super();
-        super.setType(OFActionType.SET_NW_DST);
-        super.setLength((short) OFActionNetworkLayerAddress.MINIMUM_LENGTH);
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionNetworkLayerSource.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionNetworkLayerSource.java
deleted file mode 100644 (file)
index 45e74a8..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.openflow.protocol.action;
-
-/**
- *
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFActionNetworkLayerSource extends OFActionNetworkLayerAddress {
-    public OFActionNetworkLayerSource() {
-        super();
-        super.setType(OFActionType.SET_NW_SRC);
-        super.setLength((short) OFActionNetworkLayerAddress.MINIMUM_LENGTH);
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionNetworkTypeOfService.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionNetworkTypeOfService.java
deleted file mode 100644 (file)
index d3075f8..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-package org.openflow.protocol.action;
-
-import java.nio.ByteBuffer;
-
-/**
- * Represents an ofp_action_enqueue
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-public class OFActionNetworkTypeOfService extends OFAction {
-    public static int MINIMUM_LENGTH = 8;
-
-    protected byte networkTypeOfService;
-
-    public OFActionNetworkTypeOfService() {
-        super.setType(OFActionType.SET_NW_TOS);
-        super.setLength((short) MINIMUM_LENGTH);
-    }
-
-    /**
-     * @return the networkTypeOfService
-     */
-    public byte getNetworkTypeOfService() {
-        return networkTypeOfService;
-    }
-
-    /**
-     * @param networkTypeOfService the networkTypeOfService to set
-     */
-    public void setNetworkTypeOfService(byte networkTypeOfService) {
-        this.networkTypeOfService = networkTypeOfService;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.networkTypeOfService = data.get();
-        data.getShort();
-        data.get();
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.put(this.networkTypeOfService);
-        data.putShort((short) 0);
-        data.put((byte) 0);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 359;
-        int result = super.hashCode();
-        result = prime * result + networkTypeOfService;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof OFActionNetworkTypeOfService)) {
-            return false;
-        }
-        OFActionNetworkTypeOfService other = (OFActionNetworkTypeOfService) obj;
-        if (networkTypeOfService != other.networkTypeOfService) {
-            return false;
-        }
-        return true;
-    }
-}
\ No newline at end of file
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionOutput.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionOutput.java
deleted file mode 100644 (file)
index 95208cd..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/**
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-package org.openflow.protocol.action;
-
-import java.nio.ByteBuffer;
-
-import org.openflow.util.U16;
-
-/**
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- * @author Rob Sherwood (rob.sherwood@stanford.edu)
- */
-public class OFActionOutput extends OFAction implements Cloneable {
-    public static int MINIMUM_LENGTH = 8;
-
-    protected short port;
-    protected short maxLength;
-
-    public OFActionOutput() {
-        super.setType(OFActionType.OUTPUT);
-        super.setLength((short) MINIMUM_LENGTH);
-    }
-
-    public OFActionOutput(short port, short maxLength) {
-        super();
-        super.setType(OFActionType.OUTPUT);
-        super.setLength((short) MINIMUM_LENGTH);
-        this.port = port;
-        this.maxLength = maxLength;
-    }
-
-    /**
-     * Get the output port
-     * @return
-     */
-    public short getPort() {
-        return this.port;
-    }
-
-    /**
-     * Set the output port
-     * @param port
-     */
-    public OFActionOutput setPort(short port) {
-        this.port = port;
-        return this;
-    }
-
-    /**
-     * Get the max length to send to the controller
-     * @return
-     */
-    public short getMaxLength() {
-        return this.maxLength;
-    }
-
-    /**
-     * Set the max length to send to the controller
-     * @param maxLength
-     */
-    public OFActionOutput setMaxLength(short maxLength) {
-        this.maxLength = maxLength;
-        return this;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.port = data.getShort();
-        this.maxLength = data.getShort();
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.putShort(port);
-        data.putShort(maxLength);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 367;
-        int result = super.hashCode();
-        result = prime * result + maxLength;
-        result = prime * result + port;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof OFActionOutput)) {
-            return false;
-        }
-        OFActionOutput other = (OFActionOutput) obj;
-        if (maxLength != other.maxLength) {
-            return false;
-        }
-        if (port != other.port) {
-            return false;
-        }
-        return true;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#toString()
-     */
-    @Override
-    public String toString() {
-        return "OFActionOutput [maxLength=" + maxLength + ", port=" + U16.f(port)
-                + ", length=" + length + ", type=" + type + "]";
-    }
-}
\ No newline at end of file
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionStripVirtualLan.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionStripVirtualLan.java
deleted file mode 100644 (file)
index eca3681..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-package org.openflow.protocol.action;
-
-import java.nio.ByteBuffer;
-
-
-/**
- * Represents an ofp_action_strip_vlan
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-public class OFActionStripVirtualLan extends OFAction {
-    public static int MINIMUM_LENGTH = 8;
-
-    public OFActionStripVirtualLan() {
-        super();
-        super.setType(OFActionType.STRIP_VLAN);
-        super.setLength((short) MINIMUM_LENGTH);
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        // PAD
-        data.getInt();
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        // PAD
-        data.putInt(0);
-    }
-}
\ No newline at end of file
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionTransportLayer.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionTransportLayer.java
deleted file mode 100644 (file)
index 85c5e9f..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-package org.openflow.protocol.action;
-
-import java.nio.ByteBuffer;
-
-/**
- * Represents an ofp_action_tp_port
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-public abstract class OFActionTransportLayer extends OFAction {
-    public static int MINIMUM_LENGTH = 8;
-
-    protected short transportPort;
-
-    /**
-     * @return the transportPort
-     */
-    public short getTransportPort() {
-        return transportPort;
-    }
-
-    /**
-     * @param transportPort the transportPort to set
-     */
-    public void setTransportPort(short transportPort) {
-        this.transportPort = transportPort;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.transportPort = data.getShort();
-        data.getShort();
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.putShort(this.transportPort);
-        data.putShort((short) 0);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 373;
-        int result = super.hashCode();
-        result = prime * result + transportPort;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof OFActionTransportLayer)) {
-            return false;
-        }
-        OFActionTransportLayer other = (OFActionTransportLayer) obj;
-        if (transportPort != other.transportPort) {
-            return false;
-        }
-        return true;
-    }
-}
\ No newline at end of file
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionTransportLayerDestination.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionTransportLayerDestination.java
deleted file mode 100644 (file)
index 8e91e59..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.openflow.protocol.action;
-
-/**
- *
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFActionTransportLayerDestination extends OFActionTransportLayer {
-    public OFActionTransportLayerDestination() {
-        super();
-        super.setType(OFActionType.SET_TP_DST);
-        super.setLength((short) OFActionTransportLayer.MINIMUM_LENGTH);
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionTransportLayerSource.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionTransportLayerSource.java
deleted file mode 100644 (file)
index 555d4d1..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.openflow.protocol.action;
-
-/**
- *
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFActionTransportLayerSource extends OFActionTransportLayer {
-    public OFActionTransportLayerSource() {
-        super();
-        super.setType(OFActionType.SET_TP_SRC);
-        super.setLength((short) OFActionTransportLayer.MINIMUM_LENGTH);
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionType.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionType.java
deleted file mode 100644 (file)
index 211752e..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-/**
- *
- */
-package org.openflow.protocol.action;
-
-import java.io.Serializable;
-import java.lang.reflect.Constructor;
-
-import org.openflow.protocol.Instantiable;
-
-/**
- * List of OpenFlow Action types and mappings to wire protocol value and
- * derived classes
- *
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public enum OFActionType implements Serializable{
-    OUTPUT              (0, OFActionOutput.class, new Instantiable<OFAction>() {
-                            @Override
-                            public OFAction instantiate() {
-                                return new OFActionOutput();
-                            }}),
-    SET_VLAN_VID        (1, OFActionVirtualLanIdentifier.class, new Instantiable<OFAction>() {
-                            @Override
-                            public OFAction instantiate() {
-                                return new OFActionVirtualLanIdentifier();
-                            }}),
-    SET_VLAN_PCP        (2, OFActionVirtualLanPriorityCodePoint.class, new Instantiable<OFAction>() {
-                            @Override
-                            public OFAction instantiate() {
-                                return new OFActionVirtualLanPriorityCodePoint();
-                            }}),
-    STRIP_VLAN          (3, OFActionStripVirtualLan.class, new Instantiable<OFAction>() {
-                            @Override
-                            public OFAction instantiate() {
-                                return new OFActionStripVirtualLan();
-                            }}),
-    SET_DL_SRC          (4, OFActionDataLayerSource.class, new Instantiable<OFAction>() {
-                            @Override
-                            public OFAction instantiate() {
-                                return new OFActionDataLayerSource();
-                            }}),
-    SET_DL_DST          (5, OFActionDataLayerDestination.class, new Instantiable<OFAction>() {
-                            @Override
-                            public OFAction instantiate() {
-                                return new OFActionDataLayerDestination();
-                            }}),
-    SET_NW_SRC          (6, OFActionNetworkLayerSource.class, new Instantiable<OFAction>() {
-                            @Override
-                            public OFAction instantiate() {
-                                return new OFActionNetworkLayerSource();
-                            }}),
-    SET_NW_DST          (7, OFActionNetworkLayerDestination.class, new Instantiable<OFAction>() {
-                            @Override
-                            public OFAction instantiate() {
-                                return new OFActionNetworkLayerDestination();
-                            }}),
-    SET_NW_TOS          (8, OFActionNetworkTypeOfService.class, new Instantiable<OFAction>() {
-                            @Override
-                            public OFAction instantiate() {
-                                return new OFActionNetworkTypeOfService();
-                            }}),
-    SET_TP_SRC          (9, OFActionTransportLayerSource.class, new Instantiable<OFAction>() {
-                            @Override
-                            public OFAction instantiate() {
-                                return new OFActionTransportLayerSource();
-                            }}),
-    SET_TP_DST          (10, OFActionTransportLayerDestination.class, new Instantiable<OFAction>() {
-                            @Override
-                            public OFAction instantiate() {
-                                return new OFActionTransportLayerDestination();
-                            }}),
-    OPAQUE_ENQUEUE      (11, OFActionEnqueue.class, new Instantiable<OFAction>() {
-                            @Override
-                            public OFAction instantiate() {
-                                return new OFActionEnqueue();
-                            }}),
-    VENDOR              (0xffff, OFActionVendor.class, new Instantiable<OFAction>() {
-                            @Override
-                            public OFAction instantiate() {
-                                return new OFActionVendor();
-                            }});
-
-    protected static OFActionType[] mapping;
-
-    protected Class<? extends OFAction> clazz;
-    protected Constructor<? extends OFAction> constructor;
-    protected Instantiable<OFAction> instantiable;
-    protected int minLen;
-    protected short type;
-
-    /**
-     * Store some information about the OpenFlow Action type, including wire
-     * protocol type number, length, and derrived class
-     *
-     * @param type Wire protocol number associated with this OFType
-     * @param clazz The Java class corresponding to this type of OpenFlow Action
-     * @param instantiable the instantiable for the OFAction this type represents
-     */
-    OFActionType(int type, Class<? extends OFAction> clazz, Instantiable<OFAction> instantiable) {
-        this.type = (short) type;
-        this.clazz = clazz;
-        this.instantiable = instantiable;
-        try {
-            this.constructor = clazz.getConstructor(new Class[]{});
-        } catch (Exception e) {
-            throw new RuntimeException(
-                    "Failure getting constructor for class: " + clazz, e);
-        }
-        OFActionType.addMapping(this.type, this);
-    }
-
-    /**
-     * Adds a mapping from type value to OFActionType enum
-     *
-     * @param i OpenFlow wire protocol Action type value
-     * @param t type
-     */
-    static public void addMapping(short i, OFActionType t) {
-        if (mapping == null)
-            mapping = new OFActionType[16];
-        // bring higher mappings down to the edge of our array
-        if (i < 0)
-            i = (short) (16 + i);
-        OFActionType.mapping[i] = t;
-    }
-
-    /**
-     * Given a wire protocol OpenFlow type number, return the OFType associated
-     * with it
-     *
-     * @param i wire protocol number
-     * @return OFType enum type
-     */
-
-    static public OFActionType valueOf(short i) {
-        if (i < 0)
-            i = (short) (16+i);
-        return OFActionType.mapping[i];
-    }
-
-    /**
-     * @return Returns the wire protocol value corresponding to this
-     *         OFActionType
-     */
-    public short getTypeValue() {
-        return this.type;
-    }
-
-    /**
-     * @return return the OFAction subclass corresponding to this OFActionType
-     */
-    public Class<? extends OFAction> toClass() {
-        return clazz;
-    }
-
-    /**
-     * Returns the no-argument Constructor of the implementation class for
-     * this OFActionType
-     * @return the constructor
-     */
-    public Constructor<? extends OFAction> getConstructor() {
-        return constructor;
-    }
-
-    /**
-     * Returns a new instance of the OFAction represented by this OFActionType
-     * @return the new object
-     */
-    public OFAction newInstance() {
-        return instantiable.instantiate();
-    }
-
-    /**
-     * @return the instantiable
-     */
-    public Instantiable<OFAction> getInstantiable() {
-        return instantiable;
-    }
-
-    /**
-     * @param instantiable the instantiable to set
-     */
-    public void setInstantiable(Instantiable<OFAction> instantiable) {
-        this.instantiable = instantiable;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionVendor.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionVendor.java
deleted file mode 100644 (file)
index 430c895..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.openflow.protocol.action;
-
-import java.nio.ByteBuffer;
-
-/**
- *
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFActionVendor extends OFAction {
-    public static int MINIMUM_LENGTH = 8;
-    
-    protected int vendor;
-
-       public enum ActionVendorID {
-               AVI_CISCO(0xC);
-       private int value;
-       private ActionVendorID(int value) {
-               this.value = value;
-       }
-       public int getValue() {
-               return this.value;
-       }
-       }       
-
-    public OFActionVendor() {
-        super();
-        super.setType(OFActionType.VENDOR);
-        super.setLength((short) MINIMUM_LENGTH);
-    }
-
-    /**
-     * @return the vendor
-     */
-    public int getVendor() {
-        return vendor;
-    }
-
-    /**
-     * @param vendor the vendor to set
-     */
-    public void setVendor(int vendor) {
-        this.vendor = vendor;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.vendor = data.getInt();
-        if (this.vendor == ActionVendorID.AVI_CISCO.getValue()) {
-               ActionVendorOutputNextHop nh = new ActionVendorOutputNextHop();
-               nh.readFrom(data);
-        }
-               
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.putInt(this.vendor);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 379;
-        int result = super.hashCode();
-        result = prime * result + vendor;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof OFActionVendor)) {
-            return false;
-        }
-        OFActionVendor other = (OFActionVendor) obj;
-        if (vendor != other.vendor) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionVirtualLanIdentifier.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionVirtualLanIdentifier.java
deleted file mode 100644 (file)
index f112fad..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-package org.openflow.protocol.action;
-
-import java.nio.ByteBuffer;
-
-/**
- * Represents an ofp_action_vlan_vid
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-public class OFActionVirtualLanIdentifier extends OFAction {
-    public static int MINIMUM_LENGTH = 8;
-
-    protected short virtualLanIdentifier;
-
-    public OFActionVirtualLanIdentifier() {
-        super.setType(OFActionType.SET_VLAN_VID);
-        super.setLength((short) MINIMUM_LENGTH);
-    }
-
-    /**
-     * @return the virtualLanIdentifier
-     */
-    public short getVirtualLanIdentifier() {
-        return virtualLanIdentifier;
-    }
-
-    /**
-     * @param virtualLanIdentifier the virtualLanIdentifier to set
-     */
-    public void setVirtualLanIdentifier(short virtualLanIdentifier) {
-        this.virtualLanIdentifier = virtualLanIdentifier;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.virtualLanIdentifier = data.getShort();
-        data.getShort();
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.putShort(this.virtualLanIdentifier);
-        data.putShort((short) 0);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 383;
-        int result = super.hashCode();
-        result = prime * result + virtualLanIdentifier;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof OFActionVirtualLanIdentifier)) {
-            return false;
-        }
-        OFActionVirtualLanIdentifier other = (OFActionVirtualLanIdentifier) obj;
-        if (virtualLanIdentifier != other.virtualLanIdentifier) {
-            return false;
-        }
-        return true;
-    }
-}
\ No newline at end of file
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionVirtualLanPriorityCodePoint.java b/third-party/openflowj/src/main/java/org/openflow/protocol/action/OFActionVirtualLanPriorityCodePoint.java
deleted file mode 100644 (file)
index 11b7d43..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-package org.openflow.protocol.action;
-
-import java.nio.ByteBuffer;
-
-/**
- * Represents an ofp_action_vlan_pcp
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-public class OFActionVirtualLanPriorityCodePoint extends OFAction {
-    public static int MINIMUM_LENGTH = 8;
-
-    protected byte virtualLanPriorityCodePoint;
-
-    public OFActionVirtualLanPriorityCodePoint() {
-        super.setType(OFActionType.SET_VLAN_PCP);
-        super.setLength((short) MINIMUM_LENGTH);
-    }
-
-    /**
-     * @return the virtualLanPriorityCodePoint
-     */
-    public byte getVirtualLanPriorityCodePoint() {
-        return virtualLanPriorityCodePoint;
-    }
-
-    /**
-     * @param virtualLanPriorityCodePoint the virtualLanPriorityCodePoint to set
-     */
-    public void setVirtualLanPriorityCodePoint(byte virtualLanPriorityCodePoint) {
-        this.virtualLanPriorityCodePoint = virtualLanPriorityCodePoint;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.virtualLanPriorityCodePoint = data.get();
-        data.getShort(); // pad
-        data.get(); // pad
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.put(this.virtualLanPriorityCodePoint);
-        data.putShort((short) 0);
-        data.put((byte) 0);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 389;
-        int result = super.hashCode();
-        result = prime * result + virtualLanPriorityCodePoint;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof OFActionVirtualLanPriorityCodePoint)) {
-            return false;
-        }
-        OFActionVirtualLanPriorityCodePoint other = (OFActionVirtualLanPriorityCodePoint) obj;
-        if (virtualLanPriorityCodePoint != other.virtualLanPriorityCodePoint) {
-            return false;
-        }
-        return true;
-    }
-}
\ No newline at end of file
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/factory/BasicFactory.java b/third-party/openflowj/src/main/java/org/openflow/protocol/factory/BasicFactory.java
deleted file mode 100644 (file)
index cd7c8de..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-package org.openflow.protocol.factory;
-
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.openflow.protocol.OFMessage;
-import org.openflow.protocol.OFType;
-import org.openflow.protocol.action.OFAction;
-import org.openflow.protocol.action.OFActionType;
-import org.openflow.protocol.queue.OFQueueProperty;
-import org.openflow.protocol.queue.OFQueuePropertyType;
-import org.openflow.protocol.statistics.OFStatistics;
-import org.openflow.protocol.statistics.OFStatisticsType;
-import org.openflow.protocol.statistics.OFVendorStatistics;
-
-
-/**
- * A basic OpenFlow factory that supports naive creation of both Messages and
- * Actions.
- *
- * @author David Erickson (daviderickson@cs.stanford.edu)
- * @author Rob Sherwood (rob.sherwood@stanford.edu)
- *
- */
-public class BasicFactory implements OFMessageFactory, OFActionFactory,
-        OFQueuePropertyFactory, OFStatisticsFactory {
-    @Override
-    public OFMessage getMessage(OFType t) {
-        return t.newInstance();
-    }
-
-    @Override
-    public List<OFMessage> parseMessages(ByteBuffer data) {
-        return parseMessages(data, 0);
-    }
-
-    @Override
-    public List<OFMessage> parseMessages(ByteBuffer data, int limit) {
-        List<OFMessage> results = new ArrayList<OFMessage>();
-        OFMessage demux = new OFMessage();
-        OFMessage ofm;
-
-        while (limit == 0 || results.size() <= limit) {
-            if (data.remaining() < OFMessage.MINIMUM_LENGTH)
-                return results;
-
-            data.mark();
-            demux.readFrom(data);
-            data.reset();
-
-            if (demux.getLengthU() > data.remaining())
-                return results;
-
-            ofm = getMessage(demux.getType());
-            if (ofm instanceof OFActionFactoryAware) {
-                ((OFActionFactoryAware)ofm).setActionFactory(this);
-            }
-            if (ofm instanceof OFMessageFactoryAware) {
-                ((OFMessageFactoryAware)ofm).setMessageFactory(this);
-            }
-            if (ofm instanceof OFQueuePropertyFactoryAware) {
-                ((OFQueuePropertyFactoryAware)ofm).setQueuePropertyFactory(this);
-            }
-            if (ofm instanceof OFStatisticsFactoryAware) {
-                ((OFStatisticsFactoryAware)ofm).setStatisticsFactory(this);
-            }
-            ofm.readFrom(data);
-            if (OFMessage.class.equals(ofm.getClass())) {
-                // advance the position for un-implemented messages
-                data.position(data.position()+(ofm.getLengthU() -
-                        OFMessage.MINIMUM_LENGTH));
-            }
-            results.add(ofm);
-        }
-
-        return results;
-    }
-
-    @Override
-    public OFAction getAction(OFActionType t) {
-        return t.newInstance();
-    }
-
-    @Override
-    public List<OFAction> parseActions(ByteBuffer data, int length) {
-        return parseActions(data, length, 0);
-    }
-
-    @Override
-    public List<OFAction> parseActions(ByteBuffer data, int length, int limit) {
-        List<OFAction> results = new ArrayList<OFAction>();
-        OFAction demux = new OFAction();
-        OFAction ofa;
-        int end = data.position() + length;
-
-        while (limit == 0 || results.size() <= limit) {
-            if (data.remaining() < OFAction.MINIMUM_LENGTH ||
-                    (data.position() + OFAction.MINIMUM_LENGTH) > end)
-                return results;
-
-            data.mark();
-            demux.readFrom(data);
-            data.reset();
-
-            if (demux.getLengthU() > data.remaining() ||
-                    (data.position() + demux.getLengthU()) > end)
-                return results;
-
-            ofa = getAction(demux.getType());
-            ofa.readFrom(data);
-            if (OFAction.class.equals(ofa.getClass())) {
-                // advance the position for un-implemented messages
-                data.position(data.position()+(ofa.getLengthU() -
-                        OFAction.MINIMUM_LENGTH));
-            }
-            results.add(ofa);
-        }
-
-        return results;
-    }
-
-    @Override
-    public OFActionFactory getActionFactory() {
-        return this;
-    }
-
-    @Override
-    public OFStatistics getStatistics(OFType t, OFStatisticsType st) {
-        return st.newInstance(t);
-    }
-
-    @Override
-    public List<OFStatistics> parseStatistics(OFType t, OFStatisticsType st,
-            ByteBuffer data, int length) {
-        return parseStatistics(t, st, data, length, 0);
-    }
-
-    /**
-     * @param t
-     *            OFMessage type: should be one of stats_request or stats_reply
-     * @param st
-     *            statistics type of this message, e.g., DESC, TABLE
-     * @param data
-     *            buffer to read from
-     * @param length
-     *            length of statistics
-     * @param limit
-     *            number of statistics to grab; 0 == all
-     * 
-     * @return list of statistics
-     */
-
-    @Override
-    public List<OFStatistics> parseStatistics(OFType t, OFStatisticsType st,
-            ByteBuffer data, int length, int limit) {
-        List<OFStatistics> results = new ArrayList<OFStatistics>();
-        OFStatistics statistics = getStatistics(t, st);
-
-        int start = data.position();
-        int count = 0;
-
-        while (limit == 0 || results.size() <= limit) {
-            // TODO Create a separate MUX/DEMUX path for vendor stats
-            if (statistics instanceof OFVendorStatistics)
-                ((OFVendorStatistics)statistics).setLength(length);
-
-            /**
-             * can't use data.remaining() here, b/c there could be other data
-             * buffered past this message
-             */
-            if ((length - count) >= statistics.getLength()) {
-                if (statistics instanceof OFActionFactoryAware)
-                    ((OFActionFactoryAware)statistics).setActionFactory(this);
-                statistics.readFrom(data);
-                results.add(statistics);
-                count += statistics.getLength();
-                statistics = getStatistics(t, st);
-            } else {
-                if (count < length) {
-                    /**
-                     * Nasty case: partial/incomplete statistic found even
-                     * though we have a full message. Found when NOX sent
-                     * agg_stats request with wrong agg statistics length (52
-                     * instead of 56)
-                     * 
-                     * just throw the rest away, or we will break framing
-                     */
-                    data.position(start + length);
-                }
-                return results;
-            }
-        }
-        return results; // empty; no statistics at all
-    }
-
-    @Override
-    public OFQueueProperty getQueueProperty(OFQueuePropertyType t) {
-        return t.newInstance();
-    }
-
-    @Override
-    public List<OFQueueProperty> parseQueueProperties(ByteBuffer data,
-            int length) {
-        return parseQueueProperties(data, length, 0);
-    }
-
-    @Override
-    public List<OFQueueProperty> parseQueueProperties(ByteBuffer data,
-            int length, int limit) {
-        List<OFQueueProperty> results = new ArrayList<OFQueueProperty>();
-        OFQueueProperty demux = new OFQueueProperty();
-        OFQueueProperty ofqp;
-        int end = data.position() + length;
-
-        while (limit == 0 || results.size() <= limit) {
-            if (data.remaining() < OFQueueProperty.MINIMUM_LENGTH ||
-                    (data.position() + OFQueueProperty.MINIMUM_LENGTH) > end)
-                return results;
-
-            data.mark();
-            demux.readFrom(data);
-            data.reset();
-
-            if (demux.getLengthU() > data.remaining() ||
-                    (data.position() + demux.getLengthU()) > end)
-                return results;
-
-            ofqp = getQueueProperty(demux.getType());
-            ofqp.readFrom(data);
-            if (OFQueueProperty.class.equals(ofqp.getClass())) {
-                // advance the position for un-implemented messages
-                data.position(data.position()+(ofqp.getLengthU() -
-                        OFQueueProperty.MINIMUM_LENGTH));
-            }
-            results.add(ofqp);
-        }
-
-        return results;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFActionFactory.java b/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFActionFactory.java
deleted file mode 100644 (file)
index 5d0949b..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.openflow.protocol.factory;
-
-import java.nio.ByteBuffer;
-import java.util.List;
-
-import org.openflow.protocol.action.OFAction;
-import org.openflow.protocol.action.OFActionType;
-
-
-/**
- * The interface to factories used for retrieving OFAction instances. All
- * methods are expected to be thread-safe.
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public interface OFActionFactory {
-    /**
-     * Retrieves an OFAction instance corresponding to the specified
-     * OFActionType
-     * @param t the type of the OFAction to be retrieved
-     * @return an OFAction instance
-     */
-    public OFAction getAction(OFActionType t);
-
-    /**
-     * Attempts to parse and return all OFActions contained in the given
-     * ByteBuffer, beginning at the ByteBuffer's position, and ending at
-     * position+length.
-     * @param data the ByteBuffer to parse for OpenFlow actions
-     * @param length the number of Bytes to examine for OpenFlow actions
-     * @return a list of OFAction instances
-     */
-    public List<OFAction> parseActions(ByteBuffer data, int length);
-
-    /**
-     * Attempts to parse and return all OFActions contained in the given
-     * ByteBuffer, beginning at the ByteBuffer's position, and ending at
-     * position+length.
-     * @param data the ByteBuffer to parse for OpenFlow actions
-     * @param length the number of Bytes to examine for OpenFlow actions
-     * @param limit the maximum number of messages to return, 0 means no limit
-     * @return a list of OFAction instances
-     */
-    public List<OFAction> parseActions(ByteBuffer data, int length, int limit);
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFActionFactoryAware.java b/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFActionFactoryAware.java
deleted file mode 100644 (file)
index 7bf34b0..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.openflow.protocol.factory;
-
-/**
- * Objects implementing this interface are expected to be instantiated with an
- * instance of an OFActionFactory
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public interface OFActionFactoryAware {
-    /**
-     * Sets the OFActionFactory
-     * @param actionFactory
-     */
-    public void setActionFactory(OFActionFactory actionFactory);
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFMessageFactory.java b/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFMessageFactory.java
deleted file mode 100644 (file)
index 56ced52..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.openflow.protocol.factory;
-
-import java.nio.ByteBuffer;
-import java.util.List;
-
-import org.openflow.protocol.OFMessage;
-import org.openflow.protocol.OFType;
-
-
-/**
- * The interface to factories used for retrieving OFMessage instances. All
- * methods are expected to be thread-safe.
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public interface OFMessageFactory {
-    /**
-     * Retrieves an OFMessage instance corresponding to the specified OFType
-     * @param t the type of the OFMessage to be retrieved
-     * @return an OFMessage instance
-     */
-    public OFMessage getMessage(OFType t);
-
-    /**
-     * Attempts to parse and return all OFMessages contained in the given
-     * ByteBuffer, beginning at the ByteBuffer's position, and ending at the
-     * ByteBuffer's limit.
-     * @param data the ByteBuffer to parse for an OpenFlow message
-     * @return a list of OFMessage instances
-     */
-    public List<OFMessage> parseMessages(ByteBuffer data);
-
-    /**
-     * Attempts to parse and return all OFMessages contained in the given
-     * ByteBuffer, beginning at the ByteBuffer's position, and ending at the
-     * ByteBuffer's limit.
-     * @param data the ByteBuffer to parse for an OpenFlow message
-     * @param limit the maximum number of messages to return, 0 means no limit
-     * @return a list of OFMessage instances
-     */
-    public List<OFMessage> parseMessages(ByteBuffer data, int limit);
-
-    /**
-     * Retrieves an OFActionFactory
-     * @return an OFActionFactory
-     */
-    public OFActionFactory getActionFactory();
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFMessageFactoryAware.java b/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFMessageFactoryAware.java
deleted file mode 100644 (file)
index 28b56d3..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- * 
- */
-package org.openflow.protocol.factory;
-
-/**
- * @author Rob Sherwood (rob.sherwood@stanford.edu)
- *
- */
-public interface OFMessageFactoryAware {
-
-       /**
-        * Sets the message factory for this object
-        * 
-        * @param factory
-        */
-       void setMessageFactory(OFMessageFactory factory);
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFQueuePropertyFactory.java b/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFQueuePropertyFactory.java
deleted file mode 100644 (file)
index 69569a9..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.openflow.protocol.factory;
-
-import java.nio.ByteBuffer;
-import java.util.List;
-
-import org.openflow.protocol.queue.OFQueueProperty;
-import org.openflow.protocol.queue.OFQueuePropertyType;
-
-
-/**
- * The interface to factories used for retrieving OFQueueProperty instances. All
- * methods are expected to be thread-safe.
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public interface OFQueuePropertyFactory {
-    /**
-     * Retrieves an OFQueueProperty instance corresponding to the specified
-     * OFQueuePropertyType
-     * @param t the type of the OFQueueProperty to be retrieved
-     * @return an OFQueueProperty instance
-     */
-    public OFQueueProperty getQueueProperty(OFQueuePropertyType t);
-
-    /**
-     * Attempts to parse and return all OFQueueProperties contained in the given
-     * ByteBuffer, beginning at the ByteBuffer's position, and ending at
-     * position+length.
-     * @param data the ByteBuffer to parse for OpenFlow OFQueueProperties
-     * @param length the number of Bytes to examine for OpenFlow OFQueueProperties
-     * @return a list of OFQueueProperty instances
-     */
-    public List<OFQueueProperty> parseQueueProperties(ByteBuffer data, int length);
-
-    /**
-     * Attempts to parse and return all OFQueueProperties contained in the given
-     * ByteBuffer, beginning at the ByteBuffer's position, and ending at
-     * position+length.
-     * @param data the ByteBuffer to parse for OpenFlow OFQueueProperties
-     * @param length the number of Bytes to examine for OpenFlow OFQueueProperties
-     * @param limit the maximum number of OFQueueProperties to return, 0 means no limit
-     * @return a list of OFQueueProperty instances
-     */
-    public List<OFQueueProperty> parseQueueProperties(ByteBuffer data, int length, int limit);
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFQueuePropertyFactoryAware.java b/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFQueuePropertyFactoryAware.java
deleted file mode 100644 (file)
index 9f1b61f..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.openflow.protocol.factory;
-
-/**
- * Objects implementing this interface are expected to be instantiated with an
- * instance of an OFQueuePropertyFactory
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public interface OFQueuePropertyFactoryAware {
-    /**
-     * Sets the OFQueuePropertyFactory
-     * @param queuePropertyFactory
-     */
-    public void setQueuePropertyFactory(OFQueuePropertyFactory queuePropertyFactory);
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFStatisticsFactory.java b/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFStatisticsFactory.java
deleted file mode 100644 (file)
index d11fa54..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.openflow.protocol.factory;
-
-import java.nio.ByteBuffer;
-import java.util.List;
-
-import org.openflow.protocol.OFType;
-import org.openflow.protocol.statistics.OFStatistics;
-import org.openflow.protocol.statistics.OFStatisticsType;
-
-
-/**
- * The interface to factories used for retrieving OFStatistics instances. All
- * methods are expected to be thread-safe.
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public interface OFStatisticsFactory {
-    /**
-     * Retrieves an OFStatistics instance corresponding to the specified
-     * OFStatisticsType
-     * @param t the type of the containing OFMessage, only accepts statistics
-     *           request or reply
-     * @param st the type of the OFStatistics to be retrieved
-     * @return an OFStatistics instance
-     */
-    public OFStatistics getStatistics(OFType t, OFStatisticsType st);
-
-    /**
-     * Attempts to parse and return all OFStatistics contained in the given
-     * ByteBuffer, beginning at the ByteBuffer's position, and ending at
-     * position+length.
-     * @param t the type of the containing OFMessage, only accepts statistics
-     *           request or reply
-     * @param st the type of the OFStatistics to be retrieved
-     * @param data the ByteBuffer to parse for OpenFlow Statistics
-     * @param length the number of Bytes to examine for OpenFlow Statistics
-     * @return a list of OFStatistics instances
-     */
-    public List<OFStatistics> parseStatistics(OFType t,
-            OFStatisticsType st, ByteBuffer data, int length);
-
-    /**
-     * Attempts to parse and return all OFStatistics contained in the given
-     * ByteBuffer, beginning at the ByteBuffer's position, and ending at
-     * position+length.
-     * @param t the type of the containing OFMessage, only accepts statistics
-     *           request or reply
-     * @param st the type of the OFStatistics to be retrieved
-     * @param data the ByteBuffer to parse for OpenFlow Statistics
-     * @param length the number of Bytes to examine for OpenFlow Statistics
-     * @param limit the maximum number of messages to return, 0 means no limit
-     * @return a list of OFStatistics instances
-     */
-    public List<OFStatistics> parseStatistics(OFType t,
-            OFStatisticsType st, ByteBuffer data, int length, int limit);
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFStatisticsFactoryAware.java b/third-party/openflowj/src/main/java/org/openflow/protocol/factory/OFStatisticsFactoryAware.java
deleted file mode 100644 (file)
index 17ab5f7..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.openflow.protocol.factory;
-
-/**
- * Objects implementing this interface are expected to be instantiated with an
- * instance of an OFStatisticsFactory
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public interface OFStatisticsFactoryAware {
-    /**
-     * Sets the OFStatisticsFactory
-     * @param statisticsFactory
-     */
-    public void setStatisticsFactory(OFStatisticsFactory statisticsFactory);
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/queue/OFPacketQueue.java b/third-party/openflowj/src/main/java/org/openflow/protocol/queue/OFPacketQueue.java
deleted file mode 100644 (file)
index eb90ed5..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-package org.openflow.protocol.queue;
-
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.openflow.protocol.factory.OFQueuePropertyFactory;
-import org.openflow.protocol.factory.OFQueuePropertyFactoryAware;
-import org.openflow.util.U16;
-
-/**
- * Corresponds to the struct ofp_packet_queue OpenFlow structure
- *
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFPacketQueue implements Cloneable, OFQueuePropertyFactoryAware {
-    public static int MINIMUM_LENGTH = 8;
-
-    protected OFQueuePropertyFactory queuePropertyFactory;
-
-    protected int queueId;
-    protected short length;
-    protected List<OFQueueProperty> properties;
-
-    /**
-     * @return the queueId
-     */
-    public int getQueueId() {
-        return queueId;
-    }
-
-    /**
-     * @param queueId the queueId to set
-     */
-    public OFPacketQueue setQueueId(int queueId) {
-        this.queueId = queueId;
-        return this;
-    }
-
-    /**
-     * @return the length
-     */
-    public short getLength() {
-        return length;
-    }
-
-    /**
-     * @param length the length to set
-     */
-    public void setLength(short length) {
-        this.length = length;
-    }
-
-    /**
-     * @return the properties
-     */
-    public List<OFQueueProperty> getProperties() {
-        return properties;
-    }
-
-    /**
-     * @param properties the properties to set
-     */
-    public OFPacketQueue setProperties(List<OFQueueProperty> properties) {
-        this.properties = properties;
-        return this;
-    }
-
-    public void readFrom(ByteBuffer data) {
-        this.queueId = data.getInt();
-        this.length = data.getShort();
-        data.getShort(); // pad
-        if (this.queuePropertyFactory == null)
-            throw new RuntimeException("OFQueuePropertyFactory not set");
-        this.properties = queuePropertyFactory.parseQueueProperties(data,
-                U16.f(this.length) - MINIMUM_LENGTH);
-    }
-
-    public void writeTo(ByteBuffer data) {
-        data.putInt(this.queueId);
-        data.putShort(this.length);
-        data.putShort((short) 0); // pad
-        if (this.properties != null) {
-            for (OFQueueProperty queueProperty : this.properties) {
-                queueProperty.writeTo(data);
-            }
-        }
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 6367;
-        int result = 1;
-        result = prime * result + length;
-        result = prime * result
-                + ((properties == null) ? 0 : properties.hashCode());
-        result = prime * result + queueId;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (!(obj instanceof OFPacketQueue))
-            return false;
-        OFPacketQueue other = (OFPacketQueue) obj;
-        if (length != other.length)
-            return false;
-        if (properties == null) {
-            if (other.properties != null)
-                return false;
-        } else if (!properties.equals(other.properties))
-            return false;
-        if (queueId != other.queueId)
-            return false;
-        return true;
-    }
-
-    @Override
-    public OFPacketQueue clone() {
-        try {
-            OFPacketQueue clone = (OFPacketQueue) super.clone();
-            if (this.properties != null) {
-                List<OFQueueProperty> queueProps = new ArrayList<OFQueueProperty>();
-                for (OFQueueProperty prop : this.properties) {
-                    queueProps.add(prop.clone());
-                }
-                clone.setProperties(queueProps);
-            }
-            return clone;
-        } catch (CloneNotSupportedException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    @Override
-    public void setQueuePropertyFactory(
-            OFQueuePropertyFactory queuePropertyFactory) {
-        this.queuePropertyFactory = queuePropertyFactory;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#toString()
-     */
-    @Override
-    public String toString() {
-        return "OFPacketQueue [queueId=" + queueId + ", properties="
-                + properties + "]";
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/queue/OFQueueProperty.java b/third-party/openflowj/src/main/java/org/openflow/protocol/queue/OFQueueProperty.java
deleted file mode 100644 (file)
index d9e8785..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-package org.openflow.protocol.queue;
-
-import java.nio.ByteBuffer;
-
-import org.openflow.util.U16;
-
-/**
- * Corresponds to the struct ofp_queue_prop_header OpenFlow structure
- *
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFQueueProperty implements Cloneable {
-    public static int MINIMUM_LENGTH = 8;
-
-    protected OFQueuePropertyType type;
-    protected short length;
-
-    /**
-     * @return the type
-     */
-    public OFQueuePropertyType getType() {
-        return type;
-    }
-
-    /**
-     * @param type the type to set
-     */
-    public void setType(OFQueuePropertyType type) {
-        this.type = type;
-    }
-
-    /**
-     * @return the length
-     */
-    public short getLength() {
-        return length;
-    }
-
-    /**
-     * Returns the unsigned length
-     *
-     * @return the length
-     */
-    public int getLengthU() {
-        return U16.f(length);
-    }
-
-    /**
-     * @param length the length to set
-     */
-    public void setLength(short length) {
-        this.length = length;
-    }
-
-    public void readFrom(ByteBuffer data) {
-        this.type = OFQueuePropertyType.valueOf(data.getShort());
-        this.length = data.getShort();
-        data.getInt(); // pad
-    }
-
-    public void writeTo(ByteBuffer data) {
-        data.putShort(this.type.getTypeValue());
-        data.putShort(this.length);
-        data.putInt(0); // pad
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 2777;
-        int result = 1;
-        result = prime * result + length;
-        result = prime * result + ((type == null) ? 0 : type.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (!(obj instanceof OFQueueProperty))
-            return false;
-        OFQueueProperty other = (OFQueueProperty) obj;
-        if (length != other.length)
-            return false;
-        if (type != other.type)
-            return false;
-        return true;
-    }
-
-    @Override
-    protected OFQueueProperty clone() {
-        try {
-            return (OFQueueProperty) super.clone();
-        } catch (CloneNotSupportedException e) {
-            throw new RuntimeException(e);
-        }
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/queue/OFQueuePropertyMinRate.java b/third-party/openflowj/src/main/java/org/openflow/protocol/queue/OFQueuePropertyMinRate.java
deleted file mode 100644 (file)
index dd8e2a9..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.openflow.protocol.queue;
-
-import java.nio.ByteBuffer;
-
-import org.openflow.util.U16;
-
-/**
- * Corresponds to the struct struct ofp_queue_prop_min_rate OpenFlow structure
- *
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFQueuePropertyMinRate extends OFQueueProperty {
-    public static int MINIMUM_LENGTH = 16;
-
-    protected short rate;
-
-    /**
-     * 
-     */
-    public OFQueuePropertyMinRate() {
-        super();
-        this.type = OFQueuePropertyType.MIN_RATE;
-        this.length = U16.t(MINIMUM_LENGTH);
-    }
-
-    /**
-     * @return the rate
-     */
-    public short getRate() {
-        return rate;
-    }
-
-    /**
-     * @param rate the rate to set
-     */
-    public OFQueuePropertyMinRate setRate(short rate) {
-        this.rate = rate;
-        return this;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        super.readFrom(data);
-        this.rate = data.getShort();
-        data.getInt(); // pad
-        data.getShort(); // pad
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        super.writeTo(data);
-        data.putShort(this.rate);
-        data.putInt(0); // pad
-        data.putShort((short) 0); // pad
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 3259;
-        int result = super.hashCode();
-        result = prime * result + rate;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (!(obj instanceof OFQueuePropertyMinRate))
-            return false;
-        OFQueuePropertyMinRate other = (OFQueuePropertyMinRate) obj;
-        if (rate != other.rate)
-            return false;
-        return true;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#toString()
-     */
-    @Override
-    public String toString() {
-        return "OFQueuePropertyMinRate [type=" + type + ", rate=" + U16.f(rate) + "]";
-    }
-
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/queue/OFQueuePropertyType.java b/third-party/openflowj/src/main/java/org/openflow/protocol/queue/OFQueuePropertyType.java
deleted file mode 100644 (file)
index 3174033..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/**
- *
- */
-package org.openflow.protocol.queue;
-
-import java.lang.reflect.Constructor;
-
-import org.openflow.protocol.Instantiable;
-
-/**
- * List of OpenFlow Queue Property types and mappings to wire protocol value and
- * derived classes
- *
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFQueuePropertyType {
-    public static OFQueuePropertyType NONE = new OFQueuePropertyType(0, "NONE",
-            OFQueueProperty.class, new Instantiable<OFQueueProperty>() {
-                @Override
-                public OFQueueProperty instantiate() {
-                    return new OFQueueProperty();
-                }
-            });
-
-    public static OFQueuePropertyType MIN_RATE = new OFQueuePropertyType(1, "MIN_RATE",
-            OFQueuePropertyMinRate.class, new Instantiable<OFQueueProperty>() {
-                @Override
-                public OFQueueProperty instantiate() {
-                    return new OFQueuePropertyMinRate();
-                }
-            });
-
-    protected static OFQueuePropertyType[] mapping;
-
-    protected Class<? extends OFQueueProperty> clazz;
-    protected Constructor<? extends OFQueueProperty> constructor;
-    protected Instantiable<OFQueueProperty> instantiable;
-    protected int minLen;
-    protected String name;
-    protected short type;
-
-    /**
-     * Store some information about the OpenFlow Queue Property type, including wire
-     * protocol type number, length, and derived class
-     *
-     * @param type Wire protocol number associated with this OFQueuePropertyType
-     * @param name The name of this type
-     * @param clazz The Java class corresponding to this type of OpenFlow Queue Property
-     * @param instantiable the instantiable for the OFQueueProperty this type represents
-     */
-    OFQueuePropertyType(int type, String name, Class<? extends OFQueueProperty> clazz, Instantiable<OFQueueProperty> instantiable) {
-        this.type = (short) type;
-        this.name = name;
-        this.clazz = clazz;
-        this.instantiable = instantiable;
-        try {
-            this.constructor = clazz.getConstructor(new Class[]{});
-        } catch (Exception e) {
-            throw new RuntimeException(
-                    "Failure getting constructor for class: " + clazz, e);
-        }
-        OFQueuePropertyType.addMapping(this.type, this);
-    }
-
-    /**
-     * Adds a mapping from type value to OFQueuePropertyType enum
-     *
-     * @param i OpenFlow wire protocol Action type value
-     * @param t type
-     */
-    static public void addMapping(short i, OFQueuePropertyType t) {
-        if (mapping == null)
-            mapping = new OFQueuePropertyType[16];
-        OFQueuePropertyType.mapping[i] = t;
-    }
-
-    /**
-     * Given a wire protocol OpenFlow type number, return the OFType associated
-     * with it
-     *
-     * @param i wire protocol number
-     * @return OFType enum type
-     */
-
-    static public OFQueuePropertyType valueOf(short i) {
-        return OFQueuePropertyType.mapping[i];
-    }
-
-    /**
-     * @return Returns the wire protocol value corresponding to this
-     *         OFQueuePropertyType
-     */
-    public short getTypeValue() {
-        return this.type;
-    }
-
-    /**
-     * @return return the OFQueueProperty subclass corresponding to this OFQueuePropertyType
-     */
-    public Class<? extends OFQueueProperty> toClass() {
-        return clazz;
-    }
-
-    /**
-     * Returns the no-argument Constructor of the implementation class for
-     * this OFQueuePropertyType
-     * @return the constructor
-     */
-    public Constructor<? extends OFQueueProperty> getConstructor() {
-        return constructor;
-    }
-
-    /**
-     * Returns a new instance of the OFQueueProperty represented by this OFQueuePropertyType
-     * @return the new object
-     */
-    public OFQueueProperty newInstance() {
-        return instantiable.instantiate();
-    }
-
-    /**
-     * @return the instantiable
-     */
-    public Instantiable<OFQueueProperty> getInstantiable() {
-        return instantiable;
-    }
-
-    /**
-     * @param instantiable the instantiable to set
-     */
-    public void setInstantiable(Instantiable<OFQueueProperty> instantiable) {
-        this.instantiable = instantiable;
-    }
-
-    public String getName() {
-        return this.name;
-    }
-
-    @Override
-    public String toString() {
-        return this.name;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFAggregateStatisticsReply.java b/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFAggregateStatisticsReply.java
deleted file mode 100644 (file)
index 50ecf9d..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-package org.openflow.protocol.statistics;
-
-import java.nio.ByteBuffer;
-
-/**
- * Represents an ofp_aggregate_stats_reply structure
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFAggregateStatisticsReply implements OFStatistics {
-    protected long packetCount;
-    protected long byteCount;
-    protected int flowCount;
-
-    /**
-     * @return the packetCount
-     */
-    public long getPacketCount() {
-        return packetCount;
-    }
-
-    /**
-     * @param packetCount the packetCount to set
-     */
-    public void setPacketCount(long packetCount) {
-        this.packetCount = packetCount;
-    }
-
-    /**
-     * @return the byteCount
-     */
-    public long getByteCount() {
-        return byteCount;
-    }
-
-    /**
-     * @param byteCount the byteCount to set
-     */
-    public void setByteCount(long byteCount) {
-        this.byteCount = byteCount;
-    }
-
-    /**
-     * @return the flowCount
-     */
-    public int getFlowCount() {
-        return flowCount;
-    }
-
-    /**
-     * @param flowCount the flowCount to set
-     */
-    public void setFlowCount(int flowCount) {
-        this.flowCount = flowCount;
-    }
-
-    @Override
-    public int getLength() {
-        return 24;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        this.packetCount = data.getLong();
-        this.byteCount = data.getLong();
-        this.flowCount = data.getInt();
-        data.getInt(); // pad
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        data.putLong(this.packetCount);
-        data.putLong(this.byteCount);
-        data.putInt(this.flowCount);
-        data.putInt(0); // pad
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 397;
-        int result = 1;
-        result = prime * result + (int) (byteCount ^ (byteCount >>> 32));
-        result = prime * result + flowCount;
-        result = prime * result + (int) (packetCount ^ (packetCount >>> 32));
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof OFAggregateStatisticsReply)) {
-            return false;
-        }
-        OFAggregateStatisticsReply other = (OFAggregateStatisticsReply) obj;
-        if (byteCount != other.byteCount) {
-            return false;
-        }
-        if (flowCount != other.flowCount) {
-            return false;
-        }
-        if (packetCount != other.packetCount) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFAggregateStatisticsRequest.java b/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFAggregateStatisticsRequest.java
deleted file mode 100644 (file)
index 4b23254..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-package org.openflow.protocol.statistics;
-
-import java.nio.ByteBuffer;
-
-import org.openflow.protocol.OFMatch;
-
-/**
- * Represents an ofp_aggregate_stats_request structure
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFAggregateStatisticsRequest implements OFStatistics {
-    protected OFMatch match;
-    protected byte tableId;
-    protected short outPort;
-
-    /**
-     * @return the match
-     */
-    public OFMatch getMatch() {
-        return match;
-    }
-
-    /**
-     * @param match the match to set
-     */
-    public void setMatch(OFMatch match) {
-        this.match = match;
-    }
-
-    /**
-     * @return the tableId
-     */
-    public byte getTableId() {
-        return tableId;
-    }
-
-    /**
-     * @param tableId the tableId to set
-     */
-    public void setTableId(byte tableId) {
-        this.tableId = tableId;
-    }
-
-    /**
-     * @return the outPort
-     */
-    public short getOutPort() {
-        return outPort;
-    }
-
-    /**
-     * @param outPort the outPort to set
-     */
-    public void setOutPort(short outPort) {
-        this.outPort = outPort;
-    }
-
-    @Override
-    public int getLength() {
-        return 44;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        if (this.match == null)
-            this.match = new OFMatch();
-        this.match.readFrom(data);
-        this.tableId = data.get();
-        data.get(); // pad
-        this.outPort = data.getShort();
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        this.match.writeTo(data);
-        data.put(this.tableId);
-        data.put((byte) 0);
-        data.putShort(this.outPort);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 401;
-        int result = 1;
-        result = prime * result + ((match == null) ? 0 : match.hashCode());
-        result = prime * result + outPort;
-        result = prime * result + tableId;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof OFAggregateStatisticsRequest)) {
-            return false;
-        }
-        OFAggregateStatisticsRequest other = (OFAggregateStatisticsRequest) obj;
-        if (match == null) {
-            if (other.match != null) {
-                return false;
-            }
-        } else if (!match.equals(other.match)) {
-            return false;
-        }
-        if (outPort != other.outPort) {
-            return false;
-        }
-        if (tableId != other.tableId) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFDescriptionStatistics.java b/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFDescriptionStatistics.java
deleted file mode 100644 (file)
index 7e52c75..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-package org.openflow.protocol.statistics;
-
-import java.io.Serializable;
-import java.nio.ByteBuffer;
-
-import org.openflow.util.StringByteSerializer;
-
-/**
- * Represents an ofp_desc_stats structure
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFDescriptionStatistics implements OFStatistics, Serializable {
-    public static int DESCRIPTION_STRING_LENGTH = 256;
-    public static int SERIAL_NUMBER_LENGTH = 32;
-
-    protected String manufacturerDescription;
-    protected String hardwareDescription;
-    protected String softwareDescription;
-    protected String serialNumber;
-    protected String datapathDescription;
-
-    /**
-     * @return the manufacturerDescription
-     */
-    public String getManufacturerDescription() {
-        return manufacturerDescription;
-    }
-
-    /**
-     * @param manufacturerDescription the manufacturerDescription to set
-     */
-    public void setManufacturerDescription(String manufacturerDescription) {
-        this.manufacturerDescription = manufacturerDescription;
-    }
-
-    /**
-     * @return the hardwareDescription
-     */
-    public String getHardwareDescription() {
-        return hardwareDescription;
-    }
-
-    /**
-     * @param hardwareDescription the hardwareDescription to set
-     */
-    public void setHardwareDescription(String hardwareDescription) {
-        this.hardwareDescription = hardwareDescription;
-    }
-
-    /**
-     * @return the softwareDescription
-     */
-    public String getSoftwareDescription() {
-        return softwareDescription;
-    }
-
-    /**
-     * @param softwareDescription the softwareDescription to set
-     */
-    public void setSoftwareDescription(String softwareDescription) {
-        this.softwareDescription = softwareDescription;
-    }
-
-    /**
-     * @return the serialNumber
-     */
-    public String getSerialNumber() {
-       if (serialNumber.equals("None"))
-               return "";
-        return serialNumber;
-    }
-
-    /**
-     * @param serialNumber the serialNumber to set
-     */
-    public void setSerialNumber(String serialNumber) {
-        this.serialNumber = serialNumber;
-    }
-
-    /**
-     * @return the datapathDescription
-     */
-    public String getDatapathDescription() {
-        return datapathDescription;
-    }
-
-    /**
-     * @param datapathDescription the datapathDescription to set
-     */
-    public void setDatapathDescription(String datapathDescription) {
-        this.datapathDescription = datapathDescription;
-    }
-
-    @Override
-    public int getLength() {
-        return 1056;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        this.manufacturerDescription = StringByteSerializer.readFrom(data,
-                DESCRIPTION_STRING_LENGTH);
-        this.hardwareDescription = StringByteSerializer.readFrom(data,
-                DESCRIPTION_STRING_LENGTH);
-        this.softwareDescription = StringByteSerializer.readFrom(data,
-                DESCRIPTION_STRING_LENGTH);
-        this.serialNumber = StringByteSerializer.readFrom(data,
-                SERIAL_NUMBER_LENGTH);
-        this.datapathDescription = StringByteSerializer.readFrom(data,
-                DESCRIPTION_STRING_LENGTH);
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        StringByteSerializer.writeTo(data, DESCRIPTION_STRING_LENGTH,
-                this.manufacturerDescription);
-        StringByteSerializer.writeTo(data, DESCRIPTION_STRING_LENGTH,
-                this.hardwareDescription);
-        StringByteSerializer.writeTo(data, DESCRIPTION_STRING_LENGTH,
-                this.softwareDescription);
-        StringByteSerializer.writeTo(data, SERIAL_NUMBER_LENGTH,
-                this.serialNumber);
-        StringByteSerializer.writeTo(data, DESCRIPTION_STRING_LENGTH,
-                this.datapathDescription);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 409;
-        int result = 1;
-        result = prime
-                * result
-                + ((datapathDescription == null) ? 0 : datapathDescription
-                        .hashCode());
-        result = prime
-                * result
-                + ((hardwareDescription == null) ? 0 : hardwareDescription
-                        .hashCode());
-        result = prime
-                * result
-                + ((manufacturerDescription == null) ? 0
-                        : manufacturerDescription.hashCode());
-        result = prime * result
-                + ((serialNumber == null) ? 0 : serialNumber.hashCode());
-        result = prime
-                * result
-                + ((softwareDescription == null) ? 0 : softwareDescription
-                        .hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof OFDescriptionStatistics)) {
-            return false;
-        }
-        OFDescriptionStatistics other = (OFDescriptionStatistics) obj;
-        if (datapathDescription == null) {
-            if (other.datapathDescription != null) {
-                return false;
-            }
-        } else if (!datapathDescription.equals(other.datapathDescription)) {
-            return false;
-        }
-        if (hardwareDescription == null) {
-            if (other.hardwareDescription != null) {
-                return false;
-            }
-        } else if (!hardwareDescription.equals(other.hardwareDescription)) {
-            return false;
-        }
-        if (manufacturerDescription == null) {
-            if (other.manufacturerDescription != null) {
-                return false;
-            }
-        } else if (!manufacturerDescription
-                .equals(other.manufacturerDescription)) {
-            return false;
-        }
-        if (serialNumber == null) {
-            if (other.serialNumber != null) {
-                return false;
-            }
-        } else if (!serialNumber.equals(other.serialNumber)) {
-            return false;
-        }
-        if (softwareDescription == null) {
-            if (other.softwareDescription != null) {
-                return false;
-            }
-        } else if (!softwareDescription.equals(other.softwareDescription)) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFFlowStatisticsReply.java b/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFFlowStatisticsReply.java
deleted file mode 100644 (file)
index ed6f4e6..0000000
+++ /dev/null
@@ -1,324 +0,0 @@
-package org.openflow.protocol.statistics;
-
-import java.io.Serializable;
-import java.nio.ByteBuffer;
-import java.util.List;
-
-import org.openflow.protocol.OFMatch;
-import org.openflow.protocol.action.OFAction;
-import org.openflow.protocol.factory.OFActionFactory;
-import org.openflow.protocol.factory.OFActionFactoryAware;
-import org.openflow.util.U16;
-
-/**
- * Represents an ofp_flow_stats structure
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFFlowStatisticsReply implements OFStatistics, OFActionFactoryAware, Serializable {
-    public static int MINIMUM_LENGTH = 88;
-
-    protected transient OFActionFactory actionFactory;
-    protected short length = (short) MINIMUM_LENGTH;
-    protected byte tableId;
-    protected OFMatch match;
-    protected int durationSeconds;
-    protected int durationNanoseconds;
-    protected short priority;
-    protected short idleTimeout;
-    protected short hardTimeout;
-    protected long cookie;
-    protected long packetCount;
-    protected long byteCount;
-    protected List<OFAction> actions;
-
-    /**
-     * @return the tableId
-     */
-    public byte getTableId() {
-        return tableId;
-    }
-
-    /**
-     * @param tableId the tableId to set
-     */
-    public void setTableId(byte tableId) {
-        this.tableId = tableId;
-    }
-
-    /**
-     * @return the match
-     */
-    public OFMatch getMatch() {
-        return match;
-    }
-
-    /**
-     * @param match the match to set
-     */
-    public void setMatch(OFMatch match) {
-        this.match = match;
-    }
-
-    /**
-     * @return the durationSeconds
-     */
-    public int getDurationSeconds() {
-        return durationSeconds;
-    }
-
-    /**
-     * @param durationSeconds the durationSeconds to set
-     */
-    public void setDurationSeconds(int durationSeconds) {
-        this.durationSeconds = durationSeconds;
-    }
-
-    /**
-     * @return the durationNanoseconds
-     */
-    public int getDurationNanoseconds() {
-        return durationNanoseconds;
-    }
-
-    /**
-     * @param durationNanoseconds the durationNanoseconds to set
-     */
-    public void setDurationNanoseconds(int durationNanoseconds) {
-        this.durationNanoseconds = durationNanoseconds;
-    }
-
-    /**
-     * @return the priority
-     */
-    public short getPriority() {
-        return priority;
-    }
-
-    /**
-     * @param priority the priority to set
-     */
-    public void setPriority(short priority) {
-        this.priority = priority;
-    }
-
-    /**
-     * @return the idleTimeout
-     */
-    public short getIdleTimeout() {
-        return idleTimeout;
-    }
-
-    /**
-     * @param idleTimeout the idleTimeout to set
-     */
-    public void setIdleTimeout(short idleTimeout) {
-        this.idleTimeout = idleTimeout;
-    }
-
-    /**
-     * @return the hardTimeout
-     */
-    public short getHardTimeout() {
-        return hardTimeout;
-    }
-
-    /**
-     * @param hardTimeout the hardTimeout to set
-     */
-    public void setHardTimeout(short hardTimeout) {
-        this.hardTimeout = hardTimeout;
-    }
-
-    /**
-     * @return the cookie
-     */
-    public long getCookie() {
-        return cookie;
-    }
-
-    /**
-     * @param cookie the cookie to set
-     */
-    public void setCookie(long cookie) {
-        this.cookie = cookie;
-    }
-
-    /**
-     * @return the packetCount
-     */
-    public long getPacketCount() {
-        return packetCount;
-    }
-
-    /**
-     * @param packetCount the packetCount to set
-     */
-    public void setPacketCount(long packetCount) {
-        this.packetCount = packetCount;
-    }
-
-    /**
-     * @return the byteCount
-     */
-    public long getByteCount() {
-        return byteCount;
-    }
-
-    /**
-     * @param byteCount the byteCount to set
-     */
-    public void setByteCount(long byteCount) {
-        this.byteCount = byteCount;
-    }
-
-    /**
-     * @param length the length to set
-     */
-    public void setLength(short length) {
-        this.length = length;
-    }
-
-    @Override
-    public int getLength() {
-        return U16.f(length);
-    }
-
-    /**
-     * @param actionFactory the actionFactory to set
-     */
-    @Override
-    public void setActionFactory(OFActionFactory actionFactory) {
-        this.actionFactory = actionFactory;
-    }
-
-    /**
-     * @return the actions
-     */
-    public List<OFAction> getActions() {
-        return actions;
-    }
-
-    /**
-     * @param actions the actions to set
-     */
-    public void setActions(List<OFAction> actions) {
-        this.actions = actions;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        this.length = data.getShort();
-        this.tableId = data.get();
-        data.get(); // pad
-        if (this.match == null)
-            this.match = new OFMatch();
-        this.match.readFrom(data);
-        this.durationSeconds = data.getInt();
-        this.durationNanoseconds = data.getInt();
-        this.priority = data.getShort();
-        this.idleTimeout = data.getShort();
-        this.hardTimeout = data.getShort();
-        data.getInt(); // pad
-        data.getShort(); // pad
-        this.cookie = data.getLong();
-        this.packetCount = data.getLong();
-        this.byteCount = data.getLong();
-        if (this.actionFactory == null)
-            throw new RuntimeException("OFActionFactory not set");
-        this.actions = this.actionFactory.parseActions(data, getLength() -
-                MINIMUM_LENGTH);
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        data.putShort(this.length);
-        data.put(this.tableId);
-        data.put((byte) 0);
-        this.match.writeTo(data);
-        data.putInt(this.durationSeconds);
-        data.putInt(this.durationNanoseconds);
-        data.putShort(this.priority);
-        data.putShort(this.idleTimeout);
-        data.putShort(this.hardTimeout);
-        data.getInt(); // pad
-        data.getShort(); // pad
-        data.putLong(this.cookie);
-        data.putLong(this.packetCount);
-        data.putLong(this.byteCount);
-        if (actions != null) {
-            for (OFAction action : actions) {
-                action.writeTo(data);
-            }
-        }
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 419;
-        int result = 1;
-        result = prime * result + (int) (byteCount ^ (byteCount >>> 32));
-        result = prime * result + (int) (cookie ^ (cookie >>> 32));
-        result = prime * result + durationNanoseconds;
-        result = prime * result + durationSeconds;
-        result = prime * result + hardTimeout;
-        result = prime * result + idleTimeout;
-        result = prime * result + length;
-        result = prime * result + ((match == null) ? 0 : match.hashCode());
-        result = prime * result + (int) (packetCount ^ (packetCount >>> 32));
-        result = prime * result + priority;
-        result = prime * result + tableId;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof OFFlowStatisticsReply)) {
-            return false;
-        }
-        OFFlowStatisticsReply other = (OFFlowStatisticsReply) obj;
-        if (byteCount != other.byteCount) {
-            return false;
-        }
-        if (cookie != other.cookie) {
-            return false;
-        }
-        if (durationNanoseconds != other.durationNanoseconds) {
-            return false;
-        }
-        if (durationSeconds != other.durationSeconds) {
-            return false;
-        }
-        if (hardTimeout != other.hardTimeout) {
-            return false;
-        }
-        if (idleTimeout != other.idleTimeout) {
-            return false;
-        }
-        if (length != other.length) {
-            return false;
-        }
-        if (match == null) {
-            if (other.match != null) {
-                return false;
-            }
-        } else if (!match.equals(other.match)) {
-            return false;
-        }
-        if (packetCount != other.packetCount) {
-            return false;
-        }
-        if (priority != other.priority) {
-            return false;
-        }
-        if (tableId != other.tableId) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFFlowStatisticsRequest.java b/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFFlowStatisticsRequest.java
deleted file mode 100644 (file)
index fd70ed5..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-package org.openflow.protocol.statistics;
-
-import java.io.Serializable;
-import java.nio.ByteBuffer;
-
-import org.openflow.protocol.OFMatch;
-
-/**
- * Represents an ofp_flow_stats_request structure
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFFlowStatisticsRequest implements OFStatistics, Serializable {
-    protected OFMatch match;
-    protected byte tableId;
-    protected short outPort;
-
-    /**
-     * @return the match
-     */
-    public OFMatch getMatch() {
-        return match;
-    }
-
-    /**
-     * @param match the match to set
-     */
-    public void setMatch(OFMatch match) {
-        this.match = match;
-    }
-
-    /**
-     * @return the tableId
-     */
-    public byte getTableId() {
-        return tableId;
-    }
-
-    /**
-     * @param tableId the tableId to set
-     */
-    public void setTableId(byte tableId) {
-        this.tableId = tableId;
-    }
-
-    /**
-     * @return the outPort
-     */
-    public short getOutPort() {
-        return outPort;
-    }
-
-    /**
-     * @param outPort the outPort to set
-     */
-    public void setOutPort(short outPort) {
-        this.outPort = outPort;
-    }
-
-    @Override
-    public int getLength() {
-        return 44;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        if (this.match == null)
-            this.match = new OFMatch();
-        this.match.readFrom(data);
-        this.tableId = data.get();
-        data.get(); // pad
-        this.outPort = data.getShort();
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        this.match.writeTo(data);
-        data.put(this.tableId);
-        data.put((byte) 0);
-        data.putShort(this.outPort);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 421;
-        int result = 1;
-        result = prime * result + ((match == null) ? 0 : match.hashCode());
-        result = prime * result + outPort;
-        result = prime * result + tableId;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof OFFlowStatisticsRequest)) {
-            return false;
-        }
-        OFFlowStatisticsRequest other = (OFFlowStatisticsRequest) obj;
-        if (match == null) {
-            if (other.match != null) {
-                return false;
-            }
-        } else if (!match.equals(other.match)) {
-            return false;
-        }
-        if (outPort != other.outPort) {
-            return false;
-        }
-        if (tableId != other.tableId) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFPortStatisticsReply.java b/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFPortStatisticsReply.java
deleted file mode 100644 (file)
index fa45814..0000000
+++ /dev/null
@@ -1,332 +0,0 @@
-package org.openflow.protocol.statistics;
-
-import java.nio.ByteBuffer;
-
-/**
- * Represents an ofp_port_stats structure
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFPortStatisticsReply implements OFStatistics {
-    protected short portNumber;
-    protected long receivePackets;
-    protected long transmitPackets;
-    protected long receiveBytes;
-    protected long transmitBytes;
-    protected long receiveDropped;
-    protected long transmitDropped;
-    protected long receiveErrors;
-    protected long transmitErrors;
-    protected long receiveFrameErrors;
-    protected long receiveOverrunErrors;
-    protected long receiveCRCErrors;
-    protected long collisions;
-
-    /**
-     * @return the portNumber
-     */
-    public short getPortNumber() {
-        return portNumber;
-    }
-
-    /**
-     * @param portNumber the portNumber to set
-     */
-    public void setPortNumber(short portNumber) {
-        this.portNumber = portNumber;
-    }
-
-    /**
-     * @return the receivePackets
-     */
-    public long getreceivePackets() {
-        return receivePackets;
-    }
-
-    /**
-     * @param receivePackets the receivePackets to set
-     */
-    public void setreceivePackets(long receivePackets) {
-        this.receivePackets = receivePackets;
-    }
-
-    /**
-     * @return the transmitPackets
-     */
-    public long getTransmitPackets() {
-        return transmitPackets;
-    }
-
-    /**
-     * @param transmitPackets the transmitPackets to set
-     */
-    public void setTransmitPackets(long transmitPackets) {
-        this.transmitPackets = transmitPackets;
-    }
-
-    /**
-     * @return the receiveBytes
-     */
-    public long getReceiveBytes() {
-        return receiveBytes;
-    }
-
-    /**
-     * @param receiveBytes the receiveBytes to set
-     */
-    public void setReceiveBytes(long receiveBytes) {
-        this.receiveBytes = receiveBytes;
-    }
-
-    /**
-     * @return the transmitBytes
-     */
-    public long getTransmitBytes() {
-        return transmitBytes;
-    }
-
-    /**
-     * @param transmitBytes the transmitBytes to set
-     */
-    public void setTransmitBytes(long transmitBytes) {
-        this.transmitBytes = transmitBytes;
-    }
-
-    /**
-     * @return the receiveDropped
-     */
-    public long getReceiveDropped() {
-        return receiveDropped;
-    }
-
-    /**
-     * @param receiveDropped the receiveDropped to set
-     */
-    public void setReceiveDropped(long receiveDropped) {
-        this.receiveDropped = receiveDropped;
-    }
-
-    /**
-     * @return the transmitDropped
-     */
-    public long getTransmitDropped() {
-        return transmitDropped;
-    }
-
-    /**
-     * @param transmitDropped the transmitDropped to set
-     */
-    public void setTransmitDropped(long transmitDropped) {
-        this.transmitDropped = transmitDropped;
-    }
-
-    /**
-     * @return the receiveErrors
-     */
-    public long getreceiveErrors() {
-        return receiveErrors;
-    }
-
-    /**
-     * @param receiveErrors the receiveErrors to set
-     */
-    public void setreceiveErrors(long receiveErrors) {
-        this.receiveErrors = receiveErrors;
-    }
-
-    /**
-     * @return the transmitErrors
-     */
-    public long getTransmitErrors() {
-        return transmitErrors;
-    }
-
-    /**
-     * @param transmitErrors the transmitErrors to set
-     */
-    public void setTransmitErrors(long transmitErrors) {
-        this.transmitErrors = transmitErrors;
-    }
-
-    /**
-     * @return the receiveFrameErrors
-     */
-    public long getReceiveFrameErrors() {
-        return receiveFrameErrors;
-    }
-
-    /**
-     * @param receiveFrameErrors the receiveFrameErrors to set
-     */
-    public void setReceiveFrameErrors(long receiveFrameErrors) {
-        this.receiveFrameErrors = receiveFrameErrors;
-    }
-
-    /**
-     * @return the receiveOverrunErrors
-     */
-    public long getReceiveOverrunErrors() {
-        return receiveOverrunErrors;
-    }
-
-    /**
-     * @param receiveOverrunErrors the receiveOverrunErrors to set
-     */
-    public void setReceiveOverrunErrors(long receiveOverrunErrors) {
-        this.receiveOverrunErrors = receiveOverrunErrors;
-    }
-
-    /**
-     * @return the receiveCRCErrors
-     */
-    public long getReceiveCRCErrors() {
-        return receiveCRCErrors;
-    }
-
-    /**
-     * @param receiveCRCErrors the receiveCRCErrors to set
-     */
-    public void setReceiveCRCErrors(long receiveCRCErrors) {
-        this.receiveCRCErrors = receiveCRCErrors;
-    }
-
-    /**
-     * @return the collisions
-     */
-    public long getCollisions() {
-        return collisions;
-    }
-
-    /**
-     * @param collisions the collisions to set
-     */
-    public void setCollisions(long collisions) {
-        this.collisions = collisions;
-    }
-
-    @Override
-    public int getLength() {
-        return 104;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        this.portNumber = data.getShort();
-        data.getShort(); // pad
-        data.getInt(); // pad
-        this.receivePackets = data.getLong();
-        this.transmitPackets = data.getLong();
-        this.receiveBytes = data.getLong();
-        this.transmitBytes = data.getLong();
-        this.receiveDropped = data.getLong();
-        this.transmitDropped = data.getLong();
-        this.receiveErrors = data.getLong();
-        this.transmitErrors = data.getLong();
-        this.receiveFrameErrors = data.getLong();
-        this.receiveOverrunErrors = data.getLong();
-        this.receiveCRCErrors = data.getLong();
-        this.collisions = data.getLong();
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        data.putShort(this.portNumber);
-        data.putShort((short) 0); // pad
-        data.putInt(0); // pad
-        data.putLong(this.receivePackets);
-        data.putLong(this.transmitPackets);
-        data.putLong(this.receiveBytes);
-        data.putLong(this.transmitBytes);
-        data.putLong(this.receiveDropped);
-        data.putLong(this.transmitDropped);
-        data.putLong(this.receiveErrors);
-        data.putLong(this.transmitErrors);
-        data.putLong(this.receiveFrameErrors);
-        data.putLong(this.receiveOverrunErrors);
-        data.putLong(this.receiveCRCErrors);
-        data.putLong(this.collisions);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 431;
-        int result = 1;
-        result = prime * result + (int) (collisions ^ (collisions >>> 32));
-        result = prime * result + portNumber;
-        result = prime * result
-                + (int) (receivePackets ^ (receivePackets >>> 32));
-        result = prime * result + (int) (receiveBytes ^ (receiveBytes >>> 32));
-        result = prime * result
-                + (int) (receiveCRCErrors ^ (receiveCRCErrors >>> 32));
-        result = prime * result
-                + (int) (receiveDropped ^ (receiveDropped >>> 32));
-        result = prime * result
-                + (int) (receiveFrameErrors ^ (receiveFrameErrors >>> 32));
-        result = prime * result
-                + (int) (receiveOverrunErrors ^ (receiveOverrunErrors >>> 32));
-        result = prime * result
-                + (int) (receiveErrors ^ (receiveErrors >>> 32));
-        result = prime * result
-                + (int) (transmitBytes ^ (transmitBytes >>> 32));
-        result = prime * result
-                + (int) (transmitDropped ^ (transmitDropped >>> 32));
-        result = prime * result
-                + (int) (transmitErrors ^ (transmitErrors >>> 32));
-        result = prime * result
-                + (int) (transmitPackets ^ (transmitPackets >>> 32));
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof OFPortStatisticsReply)) {
-            return false;
-        }
-        OFPortStatisticsReply other = (OFPortStatisticsReply) obj;
-        if (collisions != other.collisions) {
-            return false;
-        }
-        if (portNumber != other.portNumber) {
-            return false;
-        }
-        if (receivePackets != other.receivePackets) {
-            return false;
-        }
-        if (receiveBytes != other.receiveBytes) {
-            return false;
-        }
-        if (receiveCRCErrors != other.receiveCRCErrors) {
-            return false;
-        }
-        if (receiveDropped != other.receiveDropped) {
-            return false;
-        }
-        if (receiveFrameErrors != other.receiveFrameErrors) {
-            return false;
-        }
-        if (receiveOverrunErrors != other.receiveOverrunErrors) {
-            return false;
-        }
-        if (receiveErrors != other.receiveErrors) {
-            return false;
-        }
-        if (transmitBytes != other.transmitBytes) {
-            return false;
-        }
-        if (transmitDropped != other.transmitDropped) {
-            return false;
-        }
-        if (transmitErrors != other.transmitErrors) {
-            return false;
-        }
-        if (transmitPackets != other.transmitPackets) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFPortStatisticsRequest.java b/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFPortStatisticsRequest.java
deleted file mode 100644 (file)
index f3de700..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.openflow.protocol.statistics;
-
-import java.nio.ByteBuffer;
-
-/**
- * Represents an ofp_port_stats_request structure
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFPortStatisticsRequest implements OFStatistics {
-    protected short portNumber;
-
-    /**
-     * @return the portNumber
-     */
-    public short getPortNumber() {
-        return portNumber;
-    }
-
-    /**
-     * @param portNumber the portNumber to set
-     */
-    public void setPortNumber(short portNumber) {
-        this.portNumber = portNumber;
-    }
-
-    @Override
-    public int getLength() {
-        return 8;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        this.portNumber = data.getShort();
-        data.getShort(); // pad
-        data.getInt(); // pad
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        data.putShort(this.portNumber);
-        data.putShort((short) 0); // pad
-        data.putInt(0); // pad
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 433;
-        int result = 1;
-        result = prime * result + portNumber;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof OFPortStatisticsRequest)) {
-            return false;
-        }
-        OFPortStatisticsRequest other = (OFPortStatisticsRequest) obj;
-        if (portNumber != other.portNumber) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFQueueStatisticsReply.java b/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFQueueStatisticsReply.java
deleted file mode 100644 (file)
index 5b1a339..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-package org.openflow.protocol.statistics;
-
-import java.nio.ByteBuffer;
-
-/**
- * Represents an ofp_queue_stats structure
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFQueueStatisticsReply implements OFStatistics {
-    protected short portNumber;
-    protected int queueId;
-    protected long transmitBytes;
-    protected long transmitPackets;
-    protected long transmitErrors;
-
-    /**
-     * @return the portNumber
-     */
-    public short getPortNumber() {
-        return portNumber;
-    }
-
-    /**
-     * @param portNumber the portNumber to set
-     */
-    public void setPortNumber(short portNumber) {
-        this.portNumber = portNumber;
-    }
-
-    /**
-     * @return the queueId
-     */
-    public int getQueueId() {
-        return queueId;
-    }
-
-    /**
-     * @param queueId the queueId to set
-     */
-    public void setQueueId(int queueId) {
-        this.queueId = queueId;
-    }
-
-    /**
-     * @return the transmitBytes
-     */
-    public long getTransmitBytes() {
-        return transmitBytes;
-    }
-
-    /**
-     * @param transmitBytes the transmitBytes to set
-     */
-    public void setTransmitBytes(long transmitBytes) {
-        this.transmitBytes = transmitBytes;
-    }
-
-    /**
-     * @return the transmitPackets
-     */
-    public long getTransmitPackets() {
-        return transmitPackets;
-    }
-
-    /**
-     * @param transmitPackets the transmitPackets to set
-     */
-    public void setTransmitPackets(long transmitPackets) {
-        this.transmitPackets = transmitPackets;
-    }
-
-    /**
-     * @return the transmitErrors
-     */
-    public long getTransmitErrors() {
-        return transmitErrors;
-    }
-
-    /**
-     * @param transmitErrors the transmitErrors to set
-     */
-    public void setTransmitErrors(long transmitErrors) {
-        this.transmitErrors = transmitErrors;
-    }
-
-    @Override
-    public int getLength() {
-        return 32;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        this.portNumber = data.getShort();
-        data.getShort(); // pad
-        this.queueId = data.getInt();
-        this.transmitBytes = data.getLong();
-        this.transmitPackets = data.getLong();
-        this.transmitErrors = data.getLong();
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        data.putShort(this.portNumber);
-        data.putShort((short) 0); // pad
-        data.putInt(this.queueId);
-        data.putLong(this.transmitBytes);
-        data.putLong(this.transmitPackets);
-        data.putLong(this.transmitErrors);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 439;
-        int result = 1;
-        result = prime * result + portNumber;
-        result = prime * result + queueId;
-        result = prime * result
-                + (int) (transmitBytes ^ (transmitBytes >>> 32));
-        result = prime * result
-                + (int) (transmitErrors ^ (transmitErrors >>> 32));
-        result = prime * result
-                + (int) (transmitPackets ^ (transmitPackets >>> 32));
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof OFQueueStatisticsReply)) {
-            return false;
-        }
-        OFQueueStatisticsReply other = (OFQueueStatisticsReply) obj;
-        if (portNumber != other.portNumber) {
-            return false;
-        }
-        if (queueId != other.queueId) {
-            return false;
-        }
-        if (transmitBytes != other.transmitBytes) {
-            return false;
-        }
-        if (transmitErrors != other.transmitErrors) {
-            return false;
-        }
-        if (transmitPackets != other.transmitPackets) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFQueueStatisticsRequest.java b/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFQueueStatisticsRequest.java
deleted file mode 100644 (file)
index 4317f3f..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-package org.openflow.protocol.statistics;
-
-import java.nio.ByteBuffer;
-
-/**
- * Represents an ofp_queue_stats_request structure
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFQueueStatisticsRequest implements OFStatistics {
-    protected short portNumber;
-    protected int queueId;
-
-    /**
-     * @return the portNumber
-     */
-    public short getPortNumber() {
-        return portNumber;
-    }
-
-    /**
-     * @param portNumber the portNumber to set
-     */
-    public void setPortNumber(short portNumber) {
-        this.portNumber = portNumber;
-    }
-
-    /**
-     * @return the queueId
-     */
-    public int getQueueId() {
-        return queueId;
-    }
-
-    /**
-     * @param queueId the queueId to set
-     */
-    public void setQueueId(int queueId) {
-        this.queueId = queueId;
-    }
-
-    @Override
-    public int getLength() {
-        return 8;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        this.portNumber = data.getShort();
-        data.getShort(); // pad
-        this.queueId = data.getInt();
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        data.putShort(this.portNumber);
-        data.putShort((short) 0); // pad
-        data.putInt(this.queueId);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 443;
-        int result = 1;
-        result = prime * result + portNumber;
-        result = prime * result + queueId;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof OFQueueStatisticsRequest)) {
-            return false;
-        }
-        OFQueueStatisticsRequest other = (OFQueueStatisticsRequest) obj;
-        if (portNumber != other.portNumber) {
-            return false;
-        }
-        if (queueId != other.queueId) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFStatistics.java b/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFStatistics.java
deleted file mode 100644 (file)
index 0893e17..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.openflow.protocol.statistics;
-
-import java.nio.ByteBuffer;
-
-/**
- * The base class for all OpenFlow statistics.
- *
- * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
- */
-public interface OFStatistics {
-    /**
-     * Returns the wire length of this message in bytes
-     * @return the length
-     */
-    public int getLength();
-
-    /**
-     * Read this message off the wire from the specified ByteBuffer
-     * @param data
-     */
-    public void readFrom(ByteBuffer data);
-
-    /**
-     * Write this message's binary format to the specified ByteBuffer
-     * @param data
-     */
-    public void writeTo(ByteBuffer data);
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFStatisticsType.java b/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFStatisticsType.java
deleted file mode 100644 (file)
index d9e7030..0000000
+++ /dev/null
@@ -1,300 +0,0 @@
-package org.openflow.protocol.statistics;
-
-import java.lang.reflect.Constructor;
-
-import org.openflow.protocol.Instantiable;
-import org.openflow.protocol.OFType;
-
-public enum OFStatisticsType {
-    DESC        (0, OFDescriptionStatistics.class, OFDescriptionStatistics.class,
-                    new Instantiable<OFStatistics>() {
-                        @Override
-                        public OFStatistics instantiate() {
-                            return new OFDescriptionStatistics();
-                        }
-                    },
-                    new Instantiable<OFStatistics>() {
-                        @Override
-                        public OFStatistics instantiate() {
-                            return new OFDescriptionStatistics();
-                        }
-                    }),
-    FLOW       (1, OFFlowStatisticsRequest.class, OFFlowStatisticsReply.class,
-                    new Instantiable<OFStatistics>() {
-                        @Override
-                        public OFStatistics instantiate() {
-                            return new OFFlowStatisticsRequest();
-                        }
-                    },
-                    new Instantiable<OFStatistics>() {
-                        @Override
-                        public OFStatistics instantiate() {
-                            return new OFFlowStatisticsReply();
-                        }
-                    }),
-    AGGREGATE  (2, OFAggregateStatisticsRequest.class, OFAggregateStatisticsReply.class,
-                    new Instantiable<OFStatistics>() {
-                        @Override
-                        public OFStatistics instantiate() {
-                            return new OFAggregateStatisticsRequest();
-                        }
-                    },
-                    new Instantiable<OFStatistics>() {
-                        @Override
-                        public OFStatistics instantiate() {
-                            return new OFAggregateStatisticsReply();
-                        }
-                    }),
-    TABLE      (3, OFTableStatistics.class, OFTableStatistics.class,
-                    new Instantiable<OFStatistics>() {
-                        @Override
-                        public OFStatistics instantiate() {
-                            return new OFTableStatistics();
-                        }
-                    },
-                    new Instantiable<OFStatistics>() {
-                        @Override
-                        public OFStatistics instantiate() {
-                            return new OFTableStatistics();
-                        }
-                    }),
-    PORT       (4, OFPortStatisticsRequest.class, OFPortStatisticsReply.class,
-                    new Instantiable<OFStatistics>() {
-                        @Override
-                        public OFStatistics instantiate() {
-                            return new OFPortStatisticsRequest();
-                        }
-                    },
-                    new Instantiable<OFStatistics>() {
-                        @Override
-                        public OFStatistics instantiate() {
-                            return new OFPortStatisticsReply();
-                        }
-                    }),
-    QUEUE      (5, OFQueueStatisticsRequest.class, OFQueueStatisticsReply.class,
-                    new Instantiable<OFStatistics>() {
-                        @Override
-                        public OFStatistics instantiate() {
-                            return new OFQueueStatisticsRequest();
-                        }
-                    },
-                    new Instantiable<OFStatistics>() {
-                        @Override
-                        public OFStatistics instantiate() {
-                            return new OFQueueStatisticsReply();
-                        }
-                    }),
-    VENDOR     (0xffff, OFVendorStatistics.class, OFVendorStatistics.class,
-                    new Instantiable<OFStatistics>() {
-                        @Override
-                        public OFStatistics instantiate() {
-                            return new OFVendorStatistics();
-                        }
-                    },
-                    new Instantiable<OFStatistics>() {
-                        @Override
-                        public OFStatistics instantiate() {
-                            return new OFVendorStatistics();
-                        }
-                    });
-
-    static OFStatisticsType[] requestMapping;
-    static OFStatisticsType[] replyMapping;
-
-    protected Class<? extends OFStatistics> requestClass;
-    protected Constructor<? extends OFStatistics> requestConstructor;
-    protected Instantiable<OFStatistics> requestInstantiable;
-    protected Class<? extends OFStatistics> replyClass;
-    protected Constructor<? extends OFStatistics> replyConstructor;
-    protected Instantiable<OFStatistics> replyInstantiable;
-    protected short type;
-
-    /**
-     * Store some information about the OpenFlow Statistic type, including wire
-     * protocol type number, and derived class
-     *
-     * @param type Wire protocol number associated with this OFStatisticsType
-     * @param requestClass The Statistics Java class to return when the
-     *                     containing OFType is STATS_REQUEST
-     * @param replyClass   The Statistics Java class to return when the
-     *                     containing OFType is STATS_REPLY
-     */
-    OFStatisticsType(int type, Class<? extends OFStatistics> requestClass,
-            Class<? extends OFStatistics> replyClass,
-            Instantiable<OFStatistics> requestInstantiable,
-            Instantiable<OFStatistics> replyInstantiable) {
-        this.type = (short) type;
-        this.requestClass = requestClass;
-        try {
-            this.requestConstructor = requestClass.getConstructor(new Class[]{});
-        } catch (Exception e) {
-            throw new RuntimeException(
-                    "Failure getting constructor for class: " + requestClass, e);
-        }
-
-        this.replyClass = replyClass;
-        try {
-            this.replyConstructor = replyClass.getConstructor(new Class[]{});
-        } catch (Exception e) {
-            throw new RuntimeException(
-                    "Failure getting constructor for class: " + replyClass, e);
-        }
-        this.requestInstantiable = requestInstantiable;
-        this.replyInstantiable = replyInstantiable;
-        OFStatisticsType.addMapping(this.type, OFType.STATS_REQUEST, this);
-        OFStatisticsType.addMapping(this.type, OFType.STATS_REPLY, this);
-    }
-
-    /**
-     * Adds a mapping from type value to OFStatisticsType enum
-     *
-     * @param i OpenFlow wire protocol type
-     * @param t type of containing OFMessage, only accepts STATS_REQUEST or
-     *          STATS_REPLY
-     * @param st type
-     */
-    static public void addMapping(short i, OFType t, OFStatisticsType st) {
-        if (i < 0)
-            i = (short) (16+i);
-        if (t == OFType.STATS_REQUEST) {
-            if (requestMapping == null)
-                requestMapping = new OFStatisticsType[16];
-            OFStatisticsType.requestMapping[i] = st;
-        } else if (t == OFType.STATS_REPLY){
-            if (replyMapping == null)
-                replyMapping = new OFStatisticsType[16];
-            OFStatisticsType.replyMapping[i] = st;
-        } else {
-            throw new RuntimeException(t.toString() + " is an invalid OFType");
-        }
-    }
-
-    /**
-     * Remove a mapping from type value to OFStatisticsType enum
-     *
-     * @param i OpenFlow wire protocol type
-     * @param t type of containing OFMessage, only accepts STATS_REQUEST or
-     *          STATS_REPLY
-     */
-    static public void removeMapping(short i, OFType t) {
-        if (i < 0)
-            i = (short) (16+i);
-        if (t == OFType.STATS_REQUEST) {
-            requestMapping[i] = null;
-        } else if (t == OFType.STATS_REPLY){
-            replyMapping[i] = null;
-        } else {
-            throw new RuntimeException(t.toString() + " is an invalid OFType");
-        }
-    }
-
-    /**
-     * Given a wire protocol OpenFlow type number, return the OFStatisticsType
-     * associated with it
-     *
-     * @param i wire protocol number
-     * @param t type of containing OFMessage, only accepts STATS_REQUEST or
-     *          STATS_REPLY
-     * @return OFStatisticsType enum type
-     */
-    static public OFStatisticsType valueOf(short i, OFType t) {
-        if (i < 0)
-            i = (short) (16+i);
-        if (t == OFType.STATS_REQUEST) {
-            return requestMapping[i];
-        } else if (t == OFType.STATS_REPLY){
-            return replyMapping[i];
-        } else {
-            throw new RuntimeException(t.toString() + " is an invalid OFType");
-        }
-    }
-
-    /**
-     * @return Returns the wire protocol value corresponding to this
-     * OFStatisticsType
-     */
-    public short getTypeValue() {
-        return this.type;
-    }
-
-    /**
-     * @param t type of containing OFMessage, only accepts STATS_REQUEST or
-     *          STATS_REPLY
-     * @return return the OFMessage subclass corresponding to this
-     *                OFStatisticsType
-     */
-    public Class<? extends OFStatistics> toClass(OFType t) {
-        if (t == OFType.STATS_REQUEST) {
-            return requestClass;
-        } else if (t == OFType.STATS_REPLY){
-            return replyClass;
-        } else {
-            throw new RuntimeException(t.toString() + " is an invalid OFType");
-        }
-    }
-
-    /**
-     * Returns the no-argument Constructor of the implementation class for
-     * this OFStatisticsType, either request or reply based on the supplied
-     * OFType
-     *
-     * @param t
-     * @return
-     */
-    public Constructor<? extends OFStatistics> getConstructor(OFType t) {
-        if (t == OFType.STATS_REQUEST) {
-            return requestConstructor;
-        } else if (t == OFType.STATS_REPLY) {
-            return replyConstructor;
-        } else {
-            throw new RuntimeException(t.toString() + " is an invalid OFType");
-        }
-    }
-
-    /**
-     * @return the requestInstantiable
-     */
-    public Instantiable<OFStatistics> getRequestInstantiable() {
-        return requestInstantiable;
-    }
-
-    /**
-     * @param requestInstantiable the requestInstantiable to set
-     */
-    public void setRequestInstantiable(
-            Instantiable<OFStatistics> requestInstantiable) {
-        this.requestInstantiable = requestInstantiable;
-    }
-
-    /**
-     * @return the replyInstantiable
-     */
-    public Instantiable<OFStatistics> getReplyInstantiable() {
-        return replyInstantiable;
-    }
-
-    /**
-     * @param replyInstantiable the replyInstantiable to set
-     */
-    public void setReplyInstantiable(Instantiable<OFStatistics> replyInstantiable) {
-        this.replyInstantiable = replyInstantiable;
-    }
-
-    /**
-     * Returns a new instance of the implementation class for
-     * this OFStatisticsType, either request or reply based on the supplied
-     * OFType
-     *
-     * @param t
-     * @return
-     */
-    public OFStatistics newInstance(OFType t) {
-        if (t == OFType.STATS_REQUEST) {
-            return requestInstantiable.instantiate();
-        } else if (t == OFType.STATS_REPLY) {
-            return replyInstantiable.instantiate();
-        } else {
-            throw new RuntimeException(t.toString() + " is an invalid OFType");
-        }
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFTableStatistics.java b/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFTableStatistics.java
deleted file mode 100644 (file)
index 478fdbf..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-package org.openflow.protocol.statistics;
-
-import java.io.Serializable;
-import java.nio.ByteBuffer;
-
-import org.openflow.util.StringByteSerializer;
-
-/**
- * Represents an ofp_table_stats structure
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFTableStatistics implements OFStatistics, Serializable {
-    public static int MAX_TABLE_NAME_LEN = 32;
-
-    protected byte tableId;
-    protected String name;
-    protected int wildcards;
-    protected int maximumEntries;
-    protected int activeCount;
-    protected long lookupCount;
-    protected long matchedCount;
-
-    /**
-     * @return the tableId
-     */
-    public byte getTableId() {
-        return tableId;
-    }
-
-    /**
-     * @param tableId the tableId to set
-     */
-    public void setTableId(byte tableId) {
-        this.tableId = tableId;
-    }
-
-    /**
-     * @return the name
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * @param name the name to set
-     */
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    /**
-     * @return the wildcards
-     */
-    public int getWildcards() {
-        return wildcards;
-    }
-
-    /**
-     * @param wildcards the wildcards to set
-     */
-    public void setWildcards(int wildcards) {
-        this.wildcards = wildcards;
-    }
-
-    /**
-     * @return the maximumEntries
-     */
-    public int getMaximumEntries() {
-        return maximumEntries;
-    }
-
-    /**
-     * @param maximumEntries the maximumEntries to set
-     */
-    public void setMaximumEntries(int maximumEntries) {
-        this.maximumEntries = maximumEntries;
-    }
-
-    /**
-     * @return the activeCount
-     */
-    public int getActiveCount() {
-        return activeCount;
-    }
-
-    /**
-     * @param activeCount the activeCount to set
-     */
-    public void setActiveCount(int activeCount) {
-        this.activeCount = activeCount;
-    }
-
-    /**
-     * @return the lookupCount
-     */
-    public long getLookupCount() {
-        return lookupCount;
-    }
-
-    /**
-     * @param lookupCount the lookupCount to set
-     */
-    public void setLookupCount(long lookupCount) {
-        this.lookupCount = lookupCount;
-    }
-
-    /**
-     * @return the matchedCount
-     */
-    public long getMatchedCount() {
-        return matchedCount;
-    }
-
-    /**
-     * @param matchedCount the matchedCount to set
-     */
-    public void setMatchedCount(long matchedCount) {
-        this.matchedCount = matchedCount;
-    }
-
-    @Override
-    public int getLength() {
-        return 64;
-    }
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        this.tableId = data.get();
-        data.get(); // pad
-        data.get(); // pad
-        data.get(); // pad
-        this.name = StringByteSerializer.readFrom(data, MAX_TABLE_NAME_LEN);
-        this.wildcards = data.getInt();
-        this.maximumEntries = data.getInt();
-        this.activeCount = data.getInt();
-        this.lookupCount = data.getLong();
-        this.matchedCount = data.getLong();
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        data.put(this.tableId);
-        data.put((byte) 0); // pad
-        data.put((byte) 0); // pad
-        data.put((byte) 0); // pad
-        StringByteSerializer.writeTo(data, MAX_TABLE_NAME_LEN, this.name);
-        data.putInt(this.wildcards);
-        data.putInt(this.maximumEntries);
-        data.putInt(this.activeCount);
-        data.putLong(this.lookupCount);
-        data.putLong(this.matchedCount);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 449;
-        int result = 1;
-        result = prime * result + activeCount;
-        result = prime * result + (int) (lookupCount ^ (lookupCount >>> 32));
-        result = prime * result + (int) (matchedCount ^ (matchedCount >>> 32));
-        result = prime * result + maximumEntries;
-        result = prime * result + ((name == null) ? 0 : name.hashCode());
-        result = prime * result + tableId;
-        result = prime * result + wildcards;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof OFTableStatistics)) {
-            return false;
-        }
-        OFTableStatistics other = (OFTableStatistics) obj;
-        if (activeCount != other.activeCount) {
-            return false;
-        }
-        if (lookupCount != other.lookupCount) {
-            return false;
-        }
-        if (matchedCount != other.matchedCount) {
-            return false;
-        }
-        if (maximumEntries != other.maximumEntries) {
-            return false;
-        }
-        if (name == null) {
-            if (other.name != null) {
-                return false;
-            }
-        } else if (!name.equals(other.name)) {
-            return false;
-        }
-        if (tableId != other.tableId) {
-            return false;
-        }
-        if (wildcards != other.wildcards) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFVendorStatistics.java b/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFVendorStatistics.java
deleted file mode 100644 (file)
index 28839d2..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-package org.openflow.protocol.statistics;
-
-import java.io.Serializable;
-import java.nio.ByteBuffer;
-
-import org.openflow.protocol.factory.OFActionFactory;
-import org.openflow.protocol.factory.OFActionFactoryAware;
-
-/**
- * The base class for vendor implemented statistics
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-public class OFVendorStatistics implements OFStatistics, OFActionFactoryAware, Serializable {
-    protected transient OFActionFactory actionFactory;
-    protected int vendor;
-    protected byte[] body;
-
-    // non-message fields
-    protected int length = 0;
-
-    @Override
-    public void readFrom(ByteBuffer data) {
-        this.vendor = data.getInt();
-        if (body == null)
-            body = new byte[length - 4];
-        data.get(body);
-    }
-
-    @Override
-    public void writeTo(ByteBuffer data) {
-        data.putInt(this.vendor);
-        if (body != null)
-            data.put(body);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 457;
-        int result = 1;
-        result = prime * result + vendor;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof OFVendorStatistics)) {
-            return false;
-        }
-        OFVendorStatistics other = (OFVendorStatistics) obj;
-        if (vendor != other.vendor) {
-            return false;
-        }
-        return true;
-    }
-
-    @Override
-    public int getLength() {
-        return length;
-    }
-
-    public void setLength(int length) {
-        this.length = length;
-    }
-
-    /**
-     * @param actionFactory the actionFactory to set
-     */
-    @Override
-    public void setActionFactory(OFActionFactory actionFactory) {
-        this.actionFactory = actionFactory;
-    }
-
-    public OFActionFactory getActionFactory() {
-        return this.actionFactory;
-    }
-
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/util/HexString.java b/third-party/openflowj/src/main/java/org/openflow/util/HexString.java
deleted file mode 100644 (file)
index 489e5a6..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-package org.openflow.util;
-
-import java.math.BigInteger;
-
-public class HexString {
-    /**
-     * Convert a string of bytes to a ':' separated hex string
-     * @param bytes
-     * @return "0f:ca:fe:de:ad:be:ef"
-     */
-    public static String toHexString(byte[] bytes) {
-        int i;
-        String ret = "";
-        String tmp;
-        for(i=0; i< bytes.length; i++) {
-            if(i> 0)
-                ret += ":";
-            tmp = Integer.toHexString(U8.f(bytes[i]));
-            if (tmp.length() == 1)
-                ret += "0";
-            ret += tmp; 
-        }
-        return ret;
-    }
-    
-    public static String toHexString(long val) {
-        char arr[] = Long.toHexString(val).toCharArray();
-        String ret = "";
-        // prepend the right number of leading zeros
-        int i = 0;
-        for (; i < (16 - arr.length); i++) {
-            ret += "0";
-            if ((i % 2) == 1)
-                ret += ":";
-        }
-        for (int j = 0; j < arr.length; j++) {
-            ret += arr[j];
-            if ((((i + j) % 2) == 1) && (j < (arr.length - 1)))
-                ret += ":";
-        }
-        return ret;
-    }
-    
-    
-    /**
-     * Convert a string of hex values into a string of bytes
-     * @param values "0f:ca:fe:de:ad:be:ef"
-     * @return [15, 5 ,2, 5, 17] 
-     */
-    
-    public static byte[] fromHexString(String values) {
-        String[] octets = values.split(":");
-        byte[] ret = new byte[octets.length];
-        int i;
-        
-        for(i=0;i<octets.length; i++)
-            ret[i] = Integer.valueOf(octets[i], 16).byteValue();
-        return ret;
-    }
-    
-    public static long toLong(String values) {
-               long value = new BigInteger(values.replaceAll(":", ""), 16).longValue();
-        return value;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/util/LRULinkedHashMap.java b/third-party/openflowj/src/main/java/org/openflow/util/LRULinkedHashMap.java
deleted file mode 100644 (file)
index 239ef38..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.openflow.util;
-
-import java.util.LinkedHashMap;
-
-public class LRULinkedHashMap<K, V> extends LinkedHashMap<K, V> {
-    private static final long serialVersionUID = -2964986094089626647L;
-    protected int maximumCapacity;
-
-    public LRULinkedHashMap(int initialCapacity, int maximumCapacity) {
-        super(initialCapacity, 0.75f, true);
-        this.maximumCapacity = maximumCapacity;
-    }
-
-    public LRULinkedHashMap(int maximumCapacity) {
-        super(16, 0.75f, true);
-        this.maximumCapacity = maximumCapacity;
-    }
-
-    @Override
-    protected boolean removeEldestEntry(java.util.Map.Entry<K, V> eldest) {
-        if (this.size() > maximumCapacity)
-            return true;
-        return false;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/util/StringByteSerializer.java b/third-party/openflowj/src/main/java/org/openflow/util/StringByteSerializer.java
deleted file mode 100644 (file)
index 80e3721..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.openflow.util;
-
-import java.io.UnsupportedEncodingException;
-import java.nio.ByteBuffer;
-import java.nio.charset.Charset;
-import java.util.Arrays;
-
-public class StringByteSerializer {
-    public static String readFrom(ByteBuffer data, int length) {
-        byte[] stringBytes = new byte[length];
-        data.get(stringBytes);
-        // find the first index of 0
-        int index = 0;
-        for (byte b : stringBytes) {
-            if (0 == b)
-                break;
-            ++index;
-        }
-        return new String(Arrays.copyOf(stringBytes, index),
-                Charset.forName("ascii"));
-    }
-
-    public static void writeTo(ByteBuffer data, int length, String value) {
-        try {
-            byte[] name = value.getBytes("ASCII");
-            if (name.length < length) {
-                data.put(name);
-                for (int i = name.length; i < length; ++i) {
-                    data.put((byte) 0);
-                }
-            } else {
-                data.put(name, 0, length-1);
-                data.put((byte) 0);
-            }
-        } catch (UnsupportedEncodingException e) {
-            throw new RuntimeException(e);
-        }
-
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/util/U16.java b/third-party/openflowj/src/main/java/org/openflow/util/U16.java
deleted file mode 100644 (file)
index 866e983..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openflow.util;
-
-public class U16 {
-    public static int f(short i) {
-        return (int)i & 0xffff;
-    }
-
-    public static short t(int l) {
-        return (short) l;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/util/U32.java b/third-party/openflowj/src/main/java/org/openflow/util/U32.java
deleted file mode 100644 (file)
index 64c324d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openflow.util;
-
-public class U32 {
-    public static long f(int i) {
-        return (long)i & 0xffffffffL;
-    }
-
-    public static int t(long l) {
-        return (int) l;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/util/U64.java b/third-party/openflowj/src/main/java/org/openflow/util/U64.java
deleted file mode 100644 (file)
index 2b3137e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.openflow.util;
-
-import java.math.BigInteger;
-
-public class U64 {
-    public static BigInteger f(long i) {
-        return new BigInteger(Long.toBinaryString(i), 2);
-    }
-
-    public static long t(BigInteger l) {
-        return l.longValue();
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/util/U8.java b/third-party/openflowj/src/main/java/org/openflow/util/U8.java
deleted file mode 100644 (file)
index 59ace48..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openflow.util;
-
-public class U8 {
-    public static short f(byte i) {
-        return (short) ((short)i & 0xff);
-    }
-
-    public static byte t(short l) {
-        return (byte) l;
-    }
-}
diff --git a/third-party/openflowj/src/main/java/org/openflow/util/Unsigned.java b/third-party/openflowj/src/main/java/org/openflow/util/Unsigned.java
deleted file mode 100644 (file)
index f2e40e6..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-package org.openflow.util;
-
-import java.math.BigInteger;
-import java.nio.ByteBuffer;
-
-/*****
- * A util library class for dealing with the lack of unsigned datatypes in Java
- *
- * @author Rob Sherwood (rob.sherwood@stanford.edu)
- * @author David Erickson (daviderickson@cs.stanford.edu)
- */
-
-public class Unsigned {
-    /**
-     * Get an unsigned byte from the current position of the ByteBuffer
-     *
-     * @param bb ByteBuffer to get the byte from
-     * @return an unsigned byte contained in a short
-     */
-    public static short getUnsignedByte(ByteBuffer bb) {
-        return ((short) (bb.get() & (short) 0xff));
-    }
-
-    /**
-     * Get an unsigned byte from the specified offset in the ByteBuffer
-     *
-     * @param bb ByteBuffer to get the byte from
-     * @param offset the offset to get the byte from
-     * @return an unsigned byte contained in a short
-     */
-    public static short getUnsignedByte(ByteBuffer bb, int offset) {
-        return ((short) (bb.get(offset) & (short) 0xff));
-    }
-
-    /**
-     * Put an unsigned byte into the specified ByteBuffer at the current
-     * position
-     *
-     * @param bb ByteBuffer to put the byte into
-     * @param v the short containing the unsigned byte
-     */
-    public static void putUnsignedByte(ByteBuffer bb, short v) {
-        bb.put((byte) (v & 0xff));
-    }
-
-    /**
-     * Put an unsigned byte into the specified ByteBuffer at the specified
-     * offset
-     *
-     * @param bb ByteBuffer to put the byte into
-     * @param v the short containing the unsigned byte
-     * @param offset the offset to insert the unsigned byte at
-     */
-    public static void putUnsignedByte(ByteBuffer bb, short v, int offset) {
-        bb.put(offset, (byte) (v & 0xff));
-    }
-
-    /**
-     * Get an unsigned short from the current position of the ByteBuffer
-     *
-     * @param bb ByteBuffer to get the byte from
-     * @return an unsigned short contained in a int
-     */
-    public static int getUnsignedShort(ByteBuffer bb) {
-        return (bb.getShort() & 0xffff);
-    }
-
-    /**
-     * Get an unsigned short from the specified offset in the ByteBuffer
-     *
-     * @param bb ByteBuffer to get the short from
-     * @param offset the offset to get the short from
-     * @return an unsigned short contained in a int
-     */
-    public static int getUnsignedShort(ByteBuffer bb, int offset) {
-        return (bb.getShort(offset) & 0xffff);
-    }
-
-    /**
-     * Put an unsigned short into the specified ByteBuffer at the current
-     * position
-     *
-     * @param bb ByteBuffer to put the short into
-     * @param v the int containing the unsigned short
-     */
-    public static void putUnsignedShort(ByteBuffer bb, int v) {
-        bb.putShort((short) (v & 0xffff));
-    }
-
-    /**
-     * Put an unsigned short into the specified ByteBuffer at the specified
-     * offset
-     *
-     * @param bb ByteBuffer to put the short into
-     * @param v the int containing the unsigned short
-     * @param offset the offset to insert the unsigned short at
-     */
-    public static void putUnsignedShort(ByteBuffer bb, int v, int offset) {
-        bb.putShort(offset, (short) (v & 0xffff));
-    }
-
-    /**
-     * Get an unsigned int from the current position of the ByteBuffer
-     *
-     * @param bb ByteBuffer to get the int from
-     * @return an unsigned int contained in a long
-     */
-    public static long getUnsignedInt(ByteBuffer bb) {
-        return ((long) bb.getInt() & 0xffffffffL);
-    }
-
-    /**
-     * Get an unsigned int from the specified offset in the ByteBuffer
-     *
-     * @param bb ByteBuffer to get the int from
-     * @param offset the offset to get the int from
-     * @return an unsigned int contained in a long
-     */
-    public static long getUnsignedInt(ByteBuffer bb, int offset) {
-        return ((long) bb.getInt(offset) & 0xffffffffL);
-    }
-
-    /**
-     * Put an unsigned int into the specified ByteBuffer at the current position
-     *
-     * @param bb ByteBuffer to put the int into
-     * @param v the long containing the unsigned int
-     */
-    public static void putUnsignedInt(ByteBuffer bb, long v) {
-        bb.putInt((int) (v & 0xffffffffL));
-    }
-
-    /**
-     * Put an unsigned int into the specified ByteBuffer at the specified offset
-     *
-     * @param bb ByteBuffer to put the int into
-     * @param v the long containing the unsigned int
-     * @param offset the offset to insert the unsigned int at
-     */
-    public static void putUnsignedInt(ByteBuffer bb, long v, int offset) {
-        bb.putInt(offset, (int) (v & 0xffffffffL));
-    }
-
-    /**
-     * Get an unsigned long from the current position of the ByteBuffer
-     *
-     * @param bb ByteBuffer to get the long from
-     * @return an unsigned long contained in a BigInteger
-     */
-    public static BigInteger getUnsignedLong(ByteBuffer bb) {
-        byte[] v = new byte[8];
-        for (int i = 0; i < 8; ++i) {
-            v[i] = bb.get(i);
-        }
-        return new BigInteger(1, v);
-    }
-
-    /**
-     * Get an unsigned long from the specified offset in the ByteBuffer
-     *
-     * @param bb ByteBuffer to get the long from
-     * @param offset the offset to get the long from
-     * @return an unsigned long contained in a BigInteger
-     */
-    public static BigInteger getUnsignedLong(ByteBuffer bb, int offset) {
-        byte[] v = new byte[8];
-        for (int i = 0; i < 8; ++i) {
-            v[i] = bb.get(offset+i);
-        }
-        return new BigInteger(1, v);
-    }
-
-    /**
-     * Put an unsigned long into the specified ByteBuffer at the current
-     * position
-     *
-     * @param bb ByteBuffer to put the long into
-     * @param v the BigInteger containing the unsigned long
-     */
-    public static void putUnsignedLong(ByteBuffer bb, BigInteger v) {
-        bb.putLong(v.longValue());
-    }
-
-    /**
-     * Put an unsigned long into the specified ByteBuffer at the specified
-     * offset
-     *
-     * @param bb  ByteBuffer to put the long into
-     * @param v the BigInteger containing the unsigned long
-     * @param offset the offset to insert the unsigned long at
-     */
-    public static void putUnsignedLong(ByteBuffer bb, BigInteger v, int offset) {
-        bb.putLong(offset, v.longValue());
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/io/OFMessageAsyncStreamTest.java b/third-party/openflowj/src/test/java/org/openflow/io/OFMessageAsyncStreamTest.java
deleted file mode 100644 (file)
index c7d270b..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.openflow.io;
-
-import org.openflow.protocol.*;
-import org.openflow.protocol.factory.BasicFactory;
-
-import java.util.*;
-import java.nio.channels.*;
-import java.net.InetSocketAddress;
-
-import org.junit.Assert;
-
-import org.junit.Test;
-
-
-/**
- * @author Rob Sherwood (rob.sherwood@stanford.edu)
- *
- */
-public class OFMessageAsyncStreamTest {
-    @Test
-    public void testMarshalling() throws Exception {
-        OFMessage h = new OFHello();
-        
-        ServerSocketChannel serverSC = ServerSocketChannel.open();
-        serverSC.socket().bind(new java.net.InetSocketAddress(0));
-        serverSC.configureBlocking(false);
-        
-        SocketChannel client = SocketChannel.open(
-                new InetSocketAddress("localhost",
-                        serverSC.socket().getLocalPort())
-                );
-        SocketChannel server = serverSC.accept();
-        OFMessageAsyncStream clientStream = new OFMessageAsyncStream(client, new BasicFactory());
-        OFMessageAsyncStream serverStream = new OFMessageAsyncStream(server, new BasicFactory());
-        
-        clientStream.write(h);
-        while(clientStream.needsFlush()) {
-            clientStream.flush();
-        }
-        List<OFMessage> l = serverStream.read();
-        Assert.assertEquals(l.size(), 1);
-        OFMessage m = l.get(0);
-        Assert.assertEquals(m.getLength(),h.getLength());
-        Assert.assertEquals(m.getVersion(), h.getVersion());
-        Assert.assertEquals(m.getType(), h.getType());
-        Assert.assertEquals(m.getType(), h.getType());
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/BasicFactoryTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/BasicFactoryTest.java
deleted file mode 100644 (file)
index 04cf0f7..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-import java.util.List;
-
-import org.openflow.protocol.factory.BasicFactory;
-import org.openflow.util.U16;
-
-import junit.framework.TestCase;
-
-
-
-public class BasicFactoryTest extends TestCase {
-    public void testCreateAndParse() {
-        BasicFactory factory = new BasicFactory();
-        OFMessage m = factory.getMessage(OFType.HELLO);
-        m.setVersion((byte) 1);
-        m.setType(OFType.ECHO_REQUEST);
-        m.setLength(U16.t(8));
-        m.setXid(0xdeadbeef);
-        ByteBuffer bb = ByteBuffer.allocate(1024);
-        m.writeTo(bb);
-        bb.flip();
-        bb.limit(bb.limit()-1);
-        TestCase.assertEquals(0, factory.parseMessages(bb).size());
-        bb.limit(bb.limit()+1);
-        List<OFMessage> messages = factory.parseMessages(bb);
-        TestCase.assertEquals(1, messages.size());
-        TestCase.assertTrue(messages.get(0).getType() == OFType.ECHO_REQUEST);
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/OFActionTypeTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/OFActionTypeTest.java
deleted file mode 100644 (file)
index dedb8dc..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.openflow.protocol;
-
-
-import org.junit.Test;
-import org.openflow.protocol.action.OFActionType;
-
-import junit.framework.TestCase;
-
-
-public class OFActionTypeTest extends TestCase {
-    @Test
-    public void testMapping() throws Exception {
-        TestCase.assertEquals(OFActionType.OUTPUT,
-                OFActionType.valueOf((short) 0));
-        TestCase.assertEquals(OFActionType.OPAQUE_ENQUEUE,
-                OFActionType.valueOf((short) 11));
-        TestCase.assertEquals(OFActionType.VENDOR,
-                OFActionType.valueOf((short) 0xffff));
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/OFBarrierReplyTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/OFBarrierReplyTest.java
deleted file mode 100644 (file)
index 8cdfe34..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-
-import junit.framework.TestCase;
-
-import org.openflow.util.OFTestCase;
-
-public class OFBarrierReplyTest extends OFTestCase {
-    public void testWriteRead() throws Exception {
-        OFBarrierReply msg = (OFBarrierReply) messageFactory
-                .getMessage(OFType.BARRIER_REPLY);
-        ByteBuffer bb = ByteBuffer.allocate(1024);
-        bb.clear();
-        msg.writeTo(bb);
-        bb.flip();
-        msg.readFrom(bb);
-        TestCase.assertEquals(OFType.BARRIER_REPLY, msg.getType());
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/OFBarrierRequestTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/OFBarrierRequestTest.java
deleted file mode 100644 (file)
index 64eed6f..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-
-import junit.framework.TestCase;
-
-import org.openflow.util.OFTestCase;
-
-public class OFBarrierRequestTest extends OFTestCase {
-    public void testWriteRead() throws Exception {
-        OFBarrierRequest msg = (OFBarrierRequest) messageFactory
-                .getMessage(OFType.BARRIER_REQUEST);
-        ByteBuffer bb = ByteBuffer.allocate(1024);
-        bb.clear();
-        msg.writeTo(bb);
-        bb.flip();
-        msg.readFrom(bb);
-        TestCase.assertEquals(OFType.BARRIER_REQUEST, msg.getType());
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/OFErrorTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/OFErrorTest.java
deleted file mode 100644 (file)
index 398d23a..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.openflow.protocol.OFError.OFErrorType;
-import org.openflow.protocol.OFError.OFHelloFailedCode;
-import org.openflow.protocol.factory.BasicFactory;
-import org.openflow.protocol.factory.OFMessageFactory;
-import org.openflow.util.OFTestCase;
-
-public class OFErrorTest extends OFTestCase {
-    public void testWriteRead() throws Exception {
-        OFError msg = (OFError) messageFactory.getMessage(OFType.ERROR);
-        msg.setMessageFactory(messageFactory);
-        msg.setErrorType((short) OFErrorType.OFPET_HELLO_FAILED.ordinal());
-        msg.setErrorCode((short) OFHelloFailedCode.OFPHFC_INCOMPATIBLE
-                .ordinal());
-        ByteBuffer bb = ByteBuffer.allocate(1024);
-        bb.clear();
-        msg.writeTo(bb);
-        bb.flip();
-        msg.readFrom(bb);
-        TestCase.assertEquals((short) OFErrorType.OFPET_HELLO_FAILED.ordinal(),
-                msg.getErrorType());
-        TestCase.assertEquals((short) OFHelloFailedCode.OFPHFC_INCOMPATIBLE
-                .ordinal(), msg.getErrorType());
-        TestCase.assertNull(msg.getOffendingMsg());
-
-        msg.setOffendingMsg(new OFHello());
-        bb.clear();
-        msg.writeTo(bb);
-        bb.flip();
-        msg.readFrom(bb);
-        TestCase.assertEquals((short) OFErrorType.OFPET_HELLO_FAILED.ordinal(),
-                msg.getErrorType());
-        TestCase.assertEquals((short) OFHelloFailedCode.OFPHFC_INCOMPATIBLE
-                .ordinal(), msg.getErrorType());
-        TestCase.assertNotNull(msg.getOffendingMsg());
-        TestCase.assertEquals(OFHello.MINIMUM_LENGTH,
-                msg.getOffendingMsg().length);
-    }
-
-    public void testGarbageAtEnd() {
-        // This is a OFError msg (12 bytes), that encaps a OFVendor msg (24
-        // bytes)
-        // AND some zeros at the end (40 bytes) for a total of 76 bytes
-        // THIS is what an NEC sends in reply to Nox's VENDOR request
-        byte[] oferrorRaw = { 0x01, 0x01, 0x00, 0x4c, 0x00, 0x00, 0x10,
-                (byte) 0xcc, 0x00, 0x01, 0x00, 0x01, 0x01, 0x04, 0x00, 0x18,
-                0x00, 0x00, 0x10, (byte) 0xcc, 0x00, 0x00, 0x23, 0x20, 0x00,
-                0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x00 };
-        OFMessageFactory factory = new BasicFactory();
-        ByteBuffer oferrorBuf = ByteBuffer.wrap(oferrorRaw);
-        List<OFMessage> msgs = factory.parseMessages(oferrorBuf,
-                oferrorRaw.length);
-        TestCase.assertEquals(1, msgs.size());
-        OFMessage msg = msgs.get(0);
-        TestCase.assertEquals(76, msg.getLengthU());
-        ByteBuffer out = ByteBuffer.allocate(1024);
-        msg.writeTo(out);
-        TestCase.assertEquals(76, out.position());
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/OFFeaturesReplyTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/OFFeaturesReplyTest.java
deleted file mode 100644 (file)
index 098f6b0..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.openflow.protocol;
-
-
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.openflow.util.OFTestCase;
-
-
-public class OFFeaturesReplyTest extends OFTestCase {
-    public void testWriteRead() throws Exception {
-        OFFeaturesReply ofr = (OFFeaturesReply) messageFactory
-                .getMessage(OFType.FEATURES_REPLY);
-        List<OFPhysicalPort> ports = new ArrayList<OFPhysicalPort>();
-        OFPhysicalPort port = new OFPhysicalPort();
-        port.setHardwareAddress(new byte[6]);
-        port.setName("eth0");
-        ports.add(port);
-        ofr.setPorts(ports);
-        ByteBuffer bb = ByteBuffer.allocate(1024);
-        bb.clear();
-        ofr.writeTo(bb);
-        bb.flip();
-        ofr.readFrom(bb);
-        TestCase.assertEquals(1, ofr.getPorts().size());
-        TestCase.assertEquals("eth0", ofr.getPorts().get(0).getName());
-
-        // test a 15 character name
-        ofr.getPorts().get(0).setName("012345678901234");
-        bb.clear();
-        ofr.writeTo(bb);
-        bb.flip();
-        ofr.readFrom(bb);
-        TestCase.assertEquals("012345678901234", ofr.getPorts().get(0).getName());
-
-        // test a 16 character name getting truncated
-        ofr.getPorts().get(0).setName("0123456789012345");
-        bb.clear();
-        ofr.writeTo(bb);
-        bb.flip();
-        ofr.readFrom(bb);
-        TestCase.assertEquals("012345678901234", ofr.getPorts().get(0).getName());
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/OFFlowRemovedTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/OFFlowRemovedTest.java
deleted file mode 100644 (file)
index 2fa7900..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-
-import junit.framework.TestCase;
-
-import org.openflow.protocol.OFFlowRemoved.OFFlowRemovedReason;
-import org.openflow.util.OFTestCase;
-
-public class OFFlowRemovedTest extends OFTestCase {
-    public void testWriteRead() throws Exception {
-        OFFlowRemoved msg = (OFFlowRemoved) messageFactory
-                .getMessage(OFType.FLOW_REMOVED);
-        msg.setMatch(new OFMatch());
-        byte[] hwAddr = new byte[6];
-        msg.getMatch().setDataLayerDestination(hwAddr);
-        msg.getMatch().setDataLayerSource(hwAddr);
-        msg.setReason(OFFlowRemovedReason.OFPRR_DELETE);
-        ByteBuffer bb = ByteBuffer.allocate(1024);
-        bb.clear();
-        msg.writeTo(bb);
-        bb.flip();
-        msg.readFrom(bb);
-        TestCase.assertEquals(OFType.FLOW_REMOVED, msg.getType());
-        TestCase.assertEquals(OFFlowRemovedReason.OFPRR_DELETE, msg.getReason());
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/OFGetConfigReplyTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/OFGetConfigReplyTest.java
deleted file mode 100644 (file)
index fbeeb1f..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-
-import junit.framework.TestCase;
-
-import org.openflow.util.OFTestCase;
-
-public class OFGetConfigReplyTest extends OFTestCase {
-    public void testWriteRead() throws Exception {
-        OFSetConfig msg = (OFSetConfig) messageFactory
-                .getMessage(OFType.SET_CONFIG);
-        msg.setFlags((short) 1);
-        ByteBuffer bb = ByteBuffer.allocate(1024);
-        bb.clear();
-        msg.writeTo(bb);
-        bb.flip();
-        msg.readFrom(bb);
-        TestCase.assertEquals(OFType.SET_CONFIG, msg.getType());
-        TestCase.assertEquals((short)1, msg.getFlags());
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/OFGetConfigRequestTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/OFGetConfigRequestTest.java
deleted file mode 100644 (file)
index 61ce115..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-
-import junit.framework.TestCase;
-
-import org.openflow.util.OFTestCase;
-
-public class OFGetConfigRequestTest extends OFTestCase {
-    public void testWriteRead() throws Exception {
-        OFGetConfigRequest msg = (OFGetConfigRequest) messageFactory
-                .getMessage(OFType.GET_CONFIG_REQUEST);
-        ByteBuffer bb = ByteBuffer.allocate(1024);
-        bb.clear();
-        msg.writeTo(bb);
-        bb.flip();
-        msg.readFrom(bb);
-        TestCase.assertEquals(OFType.GET_CONFIG_REQUEST, msg.getType());
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/OFMatchTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/OFMatchTest.java
deleted file mode 100644 (file)
index 88ae9a2..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-package org.openflow.protocol;
-
-import junit.framework.TestCase;
-
-public class OFMatchTest extends TestCase {
-    public void testFromString() {
-        OFMatch correct = new OFMatch();
-        OFMatch tester = new OFMatch();
-
-        // Various combinations of "all"/"any"
-        tester.fromString("OFMatch[]");
-        // correct is already wildcarded
-        TestCase.assertEquals(correct, tester);
-        tester.fromString("all");
-        TestCase.assertEquals(correct, tester);
-        tester.fromString("ANY");
-        TestCase.assertEquals(correct, tester);
-        tester.fromString("");
-        TestCase.assertEquals(correct, tester);
-        tester.fromString("[]");
-        TestCase.assertEquals(correct, tester);
-
-        // ip_src
-        correct.setWildcards(~OFMatch.OFPFW_NW_SRC_MASK);
-        correct.setNetworkSource(0x01010203);
-        tester.fromString("nw_src=1.1.2.3");
-        TestCase.assertEquals(correct.getNetworkSourceMaskLen(), tester
-                .getNetworkSourceMaskLen());
-        TestCase.assertEquals(correct, tester);
-        tester.fromString("IP_sRc=1.1.2.3");
-        TestCase.assertEquals(correct.getNetworkSourceMaskLen(), tester
-                .getNetworkSourceMaskLen());
-        TestCase.assertEquals(correct, tester);
-    }
-
-    public void testToString() {
-        OFMatch match = new OFMatch();
-        match.fromString("nw_dst=3.4.5.6/8");
-        TestCase.assertEquals(8, match.getNetworkDestinationMaskLen());
-        String correct = "OFMatch[nw_dst=3.0.0.0/8]";
-        String tester = match.toString();
-
-        TestCase.assertEquals(correct, tester);
-        tester = "OFMatch[dl_type=35020]";
-        correct = "OFMatch[dl_type=0x88cc]";
-        match = new OFMatch();
-        match.fromString(tester);
-        TestCase.assertEquals(correct, match.toString());
-        OFMatch match2 = new OFMatch();
-        match2.fromString(correct);
-        TestCase.assertEquals(match, match2);
-    }
-
-    public void testClone() {
-        OFMatch match1 = new OFMatch();
-        OFMatch match2 = match1.clone();
-        TestCase.assertEquals(match1, match2);
-        match2.setNetworkProtocol((byte) 4);
-        match2.setWildcards(match2.getWildcards() & ~OFMatch.OFPFW_NW_PROTO);
-        TestCase.assertNotSame(match1, match2);
-    }
-
-    public void testIpToString() {
-        String test = OFMatch.ipToString(-1);
-        TestCase.assertEquals("255.255.255.255", test);
-    }
-
-    public void testReverse() {
-        OFMatch match1 = new OFMatch();
-        OFMatch match2 = match1.reverse((short)0, true);
-        TestCase.assertEquals(match1, match2);
-
-        match1.fromString("dl_dst=00:11:22:33:44:55");
-        match2 = match1.reverse((short)0, true);
-        OFMatch match3 = new OFMatch();
-        match3.fromString("dl_src=00:11:22:33:44:55");
-        TestCase.assertEquals(match2, match3);
-
-        match1.fromString("nw_dst=192.168.0.0/24");
-        match2 = match1.reverse((short)0, true);
-        match3.fromString("nw_src=192.168.0.0/24");
-        TestCase.assertEquals(match2, match3);
-
-        match1.fromString("in_port=1");
-        match2 = match1.reverse((short)2, false);
-        match3.fromString("in_port=2");
-        TestCase.assertEquals(match2, match3);
-    }
-
-    public void testSubsumes() {
-        OFMatch match1 = new OFMatch();
-        OFMatch match2 = new OFMatch();
-        match2.fromString("dl_dst=00:11:22:33:44:55");
-        TestCase.assertTrue(match1.subsumes(match2));
-        TestCase.assertFalse(match2.subsumes(match1));
-
-        match1.fromString("nw_dst=192.168.0.0/16");
-        match2.fromString("nw_dst=192.168.0.0/24");
-        TestCase.assertTrue(match1.subsumes(match2));
-        TestCase.assertFalse(match2.subsumes(match1));
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/OFPortConfigTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/OFPortConfigTest.java
deleted file mode 100644 (file)
index 5e02901..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-
-import junit.framework.TestCase;
-
-import org.openflow.util.OFTestCase;
-
-public class OFPortConfigTest extends OFTestCase {
-    public void testWriteRead() throws Exception {
-        OFPortMod msg = (OFPortMod) messageFactory
-                .getMessage(OFType.PORT_MOD);
-        msg.setHardwareAddress(new byte[6]);
-        msg.portNumber = 1;
-        ByteBuffer bb = ByteBuffer.allocate(1024);
-        bb.clear();
-        msg.writeTo(bb);
-        bb.flip();
-        msg.readFrom(bb);
-        TestCase.assertEquals(OFType.PORT_MOD, msg.getType());
-        TestCase.assertEquals(1, msg.getPortNumber());
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/OFPortStatusTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/OFPortStatusTest.java
deleted file mode 100644 (file)
index 8509059..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-
-import junit.framework.TestCase;
-
-import org.openflow.protocol.OFPortStatus.OFPortReason;
-import org.openflow.util.OFTestCase;
-
-public class OFPortStatusTest extends OFTestCase {
-    public void testWriteRead() throws Exception {
-        OFPortStatus msg = (OFPortStatus) messageFactory
-                .getMessage(OFType.PORT_STATUS);
-        msg.setDesc(new OFPhysicalPort());
-        msg.getDesc().setHardwareAddress(new byte[6]);
-        msg.getDesc().setName("eth0");
-        msg.setReason((byte) OFPortReason.OFPPR_ADD.ordinal());
-        ByteBuffer bb = ByteBuffer.allocate(1024);
-        bb.clear();
-        msg.writeTo(bb);
-        bb.flip();
-        msg.readFrom(bb);
-        TestCase.assertEquals(OFType.PORT_STATUS, msg.getType());
-        TestCase.assertEquals((byte) OFPortReason.OFPPR_ADD.ordinal(), msg
-                .getReason());
-        TestCase.assertNotNull(msg.getDesc());
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/OFQueueConfigTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/OFQueueConfigTest.java
deleted file mode 100644 (file)
index 0941cbd..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.openflow.protocol.factory.BasicFactory;
-import org.openflow.protocol.queue.OFPacketQueue;
-import org.openflow.protocol.queue.OFQueueProperty;
-import org.openflow.protocol.queue.OFQueuePropertyMinRate;
-import org.openflow.protocol.queue.OFQueuePropertyType;
-import org.openflow.util.OFTestCase;
-
-public class OFQueueConfigTest extends OFTestCase {
-    public void testRequest() throws Exception {
-        OFQueueConfigRequest req = new OFQueueConfigRequest();
-        req.setPort((short) 5);
-        ByteBuffer bb = ByteBuffer.allocate(1024);
-        bb.clear();
-        req.writeTo(bb);
-        bb.flip();
-
-        OFQueueConfigRequest req2 = new OFQueueConfigRequest();
-        req2.readFrom(bb);
-        TestCase.assertEquals(req, req2);
-    }
-
-    public void testReply() throws Exception {
-        OFQueueConfigReply reply = new OFQueueConfigReply();
-        reply.setPort((short) 5);
-
-        OFPacketQueue queue = new OFPacketQueue();
-        queue.setQueueId(1);
-        List<OFQueueProperty> properties = new ArrayList<OFQueueProperty>();
-        properties.add(new OFQueuePropertyMinRate().setRate((short) 1));
-        queue.setProperties(properties);
-        queue.setLength((short) (OFPacketQueue.MINIMUM_LENGTH + OFQueuePropertyMinRate.MINIMUM_LENGTH));
-
-        List<OFPacketQueue> queues = new ArrayList<OFPacketQueue>();
-        queues.add(queue);
-        reply.setQueues(queues);
-        reply.setLengthU(OFQueueConfigReply.MINIMUM_LENGTH + queue.getLength());
-
-        ByteBuffer bb = ByteBuffer.allocate(1024);
-        bb.clear();
-        reply.writeTo(bb);
-        bb.flip();
-
-        OFQueueConfigReply reply2 = new OFQueueConfigReply();
-        reply2.setQueuePropertyFactory(new BasicFactory());
-        reply2.readFrom(bb);
-        TestCase.assertEquals(reply, reply2);
-        TestCase.assertEquals(1, reply2.getQueues().size());
-        TestCase.assertEquals(1, reply2.getQueues().get(0).getProperties().size());
-        TestCase.assertTrue(reply2.getQueues().get(0).getProperties().get(0) instanceof OFQueuePropertyMinRate);
-        TestCase.assertEquals(OFQueuePropertyType.MIN_RATE, reply2.getQueues().get(0).getProperties().get(0).getType());
-
-        reply.getQueues().add(queue.clone());
-        reply.setLengthU(reply.getLengthU() + queue.getLength());
-        bb.clear();
-        reply.writeTo(bb);
-        bb.flip();
-        reply2 = new OFQueueConfigReply();
-        reply2.setQueuePropertyFactory(new BasicFactory());
-        reply2.readFrom(bb);
-        TestCase.assertEquals(reply, reply2);
-        TestCase.assertEquals(2, reply2.getQueues().size());
-
-        queue.getProperties().add(new OFQueuePropertyMinRate().setRate((short) 2));
-        queue.setLength((short) (queue.getLength() + OFQueuePropertyMinRate.MINIMUM_LENGTH));
-        reply.setLengthU(reply.getLengthU() + OFQueuePropertyMinRate.MINIMUM_LENGTH);
-        bb.clear();
-        reply.writeTo(bb);
-        bb.flip();
-        reply2 = new OFQueueConfigReply();
-        reply2.setQueuePropertyFactory(new BasicFactory());
-        reply2.readFrom(bb);
-        TestCase.assertEquals(reply, reply2);
-        TestCase.assertEquals(2, reply2.getQueues().size());
-        TestCase.assertEquals(2, reply2.getQueues().get(0).getProperties().size());
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/OFSetConfigTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/OFSetConfigTest.java
deleted file mode 100644 (file)
index 1d0f757..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-
-import junit.framework.TestCase;
-
-import org.openflow.util.OFTestCase;
-
-public class OFSetConfigTest extends OFTestCase {
-    public void testWriteRead() throws Exception {
-        OFGetConfigReply msg = (OFGetConfigReply) messageFactory
-                .getMessage(OFType.GET_CONFIG_REPLY);
-        msg.setFlags((short) 1);
-        ByteBuffer bb = ByteBuffer.allocate(1024);
-        bb.clear();
-        msg.writeTo(bb);
-        bb.flip();
-        msg.readFrom(bb);
-        TestCase.assertEquals(OFType.GET_CONFIG_REPLY, msg.getType());
-        TestCase.assertEquals((short)1, msg.getFlags());
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/OFStatisticsReplyTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/OFStatisticsReplyTest.java
deleted file mode 100644 (file)
index e077efe..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.openflow.protocol.factory.BasicFactory;
-import org.openflow.protocol.factory.OFMessageFactory;
-import org.openflow.protocol.statistics.OFStatisticsType;
-import org.openflow.util.OFTestCase;
-
-public class OFStatisticsReplyTest extends OFTestCase {
-    public void testOFFlowStatisticsReply() throws Exception {
-        byte[] packet = new byte[] { 0x01, 0x11, 0x01, 0x2c, 0x00, 0x00, 0x00,
-                0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, (byte) 0xff,
-                (byte) 0xff, 0x00, 0x00, 0x08, 0x00, 0x00, 0x01, 0x00, 0x00,
-                0x0a, 0x00, 0x00, 0x03, 0x0a, 0x00, 0x00, 0x02, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, (byte) 0xa6,
-                (byte) 0xa6, 0x00, (byte) 0xff, (byte) 0xff, 0x00, 0x05, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                (byte) 0xc4, 0x00, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00,
-                0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
-                0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x02, (byte) 0xff, (byte) 0xff, 0x00, 0x00, 0x08, 0x06,
-                0x00, 0x02, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x03, 0x0a, 0x00,
-                0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x3b, 0x2f, (byte) 0xfa, 0x40, (byte) 0xff, (byte) 0xff, 0x00,
-                0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00,
-                0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x03, (byte) 0xff, (byte) 0xff, 0x00, 0x62, 0x08,
-                0x00, 0x00, 0x01, 0x62, 0x37, 0x0a, 0x00, 0x00, 0x02, 0x0a,
-                0x00, 0x00, 0x03, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x3a, (byte) 0xc5, 0x2a, (byte) 0x80, (byte) 0xff,
-                (byte) 0xff, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x00, (byte) 0xc4, 0x00, 0x00, 0x00,
-                0x08, 0x00, 0x02, 0x00, 0x00 };
-
-        OFMessageFactory factory = new BasicFactory();
-        ByteBuffer packetBuf = ByteBuffer.wrap(packet);
-        List<OFMessage> msgs = factory.parseMessages(packetBuf, packet.length);
-        TestCase.assertEquals(1, msgs.size());
-        TestCase.assertTrue(msgs.get(0) instanceof OFStatisticsReply);
-        OFStatisticsReply sr = (OFStatisticsReply) msgs.get(0);
-        TestCase.assertEquals(OFStatisticsType.FLOW, sr.getStatisticType());
-        TestCase.assertEquals(3, sr.getStatistics().size());
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/OFStatisticsRequestTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/OFStatisticsRequestTest.java
deleted file mode 100644 (file)
index d42f8e0..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.openflow.protocol.factory.BasicFactory;
-import org.openflow.protocol.factory.OFMessageFactory;
-import org.openflow.protocol.statistics.OFFlowStatisticsRequest;
-import org.openflow.protocol.statistics.OFStatisticsType;
-import org.openflow.protocol.statistics.OFVendorStatistics;
-import org.openflow.util.OFTestCase;
-
-public class OFStatisticsRequestTest extends OFTestCase {
-    public void testOFFlowStatisticsRequest() throws Exception {
-        byte[] packet = new byte[] { 0x01, 0x10, 0x00, 0x38, 0x00, 0x00, 0x00,
-                0x16, 0x00, 0x01, 0x00, 0x00, (byte) 0xff, (byte) 0xff,
-                (byte) 0xff, (byte) 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                (byte) 0xff, 0x00, (byte) 0xff, (byte) 0xff };
-
-        OFMessageFactory factory = new BasicFactory();
-        ByteBuffer packetBuf = ByteBuffer.wrap(packet);
-        List<OFMessage> msgs = factory.parseMessages(packetBuf, packet.length);
-        TestCase.assertEquals(1, msgs.size());
-        TestCase.assertTrue(msgs.get(0) instanceof OFStatisticsRequest);
-        OFStatisticsRequest sr = (OFStatisticsRequest) msgs.get(0);
-        TestCase.assertEquals(OFStatisticsType.FLOW, sr.getStatisticType());
-        TestCase.assertEquals(1, sr.getStatistics().size());
-        TestCase.assertTrue(sr.getStatistics().get(0) instanceof OFFlowStatisticsRequest);
-    }
-
-    public void testOFStatisticsRequestVendor() throws Exception {
-        byte[] packet = new byte[] { 0x01, 0x10, 0x00, 0x50, 0x00, 0x00, 0x00,
-                0x63, (byte) 0xff, (byte) 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x4c, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x01, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x20,
-                (byte) 0xe0, 0x00, 0x11, 0x00, 0x0c, 0x29, (byte) 0xc5,
-                (byte) 0x95, 0x57, 0x02, 0x25, 0x5c, (byte) 0xca, 0x00, 0x02,
-                (byte) 0xff, (byte) 0xff, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x50, 0x04,
-                0x00, 0x00, 0x00, 0x00, (byte) 0xff, 0x00, 0x00, 0x00,
-                (byte) 0xff, (byte) 0xff, 0x4e, 0x20 };
-
-        OFMessageFactory factory = new BasicFactory();
-        ByteBuffer packetBuf = ByteBuffer.wrap(packet);
-        List<OFMessage> msgs = factory.parseMessages(packetBuf, packet.length);
-        TestCase.assertEquals(1, msgs.size());
-        TestCase.assertTrue(msgs.get(0) instanceof OFStatisticsRequest);
-        OFStatisticsRequest sr = (OFStatisticsRequest) msgs.get(0);
-        TestCase.assertEquals(OFStatisticsType.VENDOR, sr.getStatisticType());
-        TestCase.assertEquals(1, sr.getStatistics().size());
-        TestCase.assertTrue(sr.getStatistics().get(0) instanceof OFVendorStatistics);
-        TestCase.assertEquals(68, ((OFVendorStatistics)sr.getStatistics().get(0)).getLength());
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/OFStatisticsTypeTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/OFStatisticsTypeTest.java
deleted file mode 100644 (file)
index ccd7237..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.openflow.protocol;
-
-
-import junit.framework.TestCase;
-
-import org.junit.Test;
-import org.openflow.protocol.statistics.OFStatisticsType;
-
-
-public class OFStatisticsTypeTest extends TestCase {
-    @Test
-    public void testMapping() throws Exception {
-        TestCase.assertEquals(OFStatisticsType.DESC,
-                OFStatisticsType.valueOf((short) 0, OFType.STATS_REQUEST));
-        TestCase.assertEquals(OFStatisticsType.QUEUE,
-                OFStatisticsType.valueOf((short) 5, OFType.STATS_REQUEST));
-        TestCase.assertEquals(OFStatisticsType.VENDOR,
-                OFStatisticsType.valueOf((short) 0xffff, OFType.STATS_REQUEST));
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/OFTypeTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/OFTypeTest.java
deleted file mode 100644 (file)
index b254a2b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.openflow.protocol;
-
-
-import junit.framework.TestCase;
-
-import org.junit.Test;
-
-
-public class OFTypeTest extends TestCase {
-
-    public void testOFTypeCreate() throws Exception {
-        OFType foo = OFType.HELLO;
-        Class<? extends OFMessage> c = foo.toClass();
-        TestCase.assertEquals(c, OFHello.class);
-    }
-
-    @Test
-    public void testMapping() throws Exception {
-        TestCase.assertEquals(OFType.HELLO, OFType.valueOf((byte) 0));
-        TestCase.assertEquals(OFType.BARRIER_REPLY, OFType.valueOf((byte) 19));
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/OFVendorTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/OFVendorTest.java
deleted file mode 100644 (file)
index d3a9c85..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.openflow.protocol;
-
-import java.nio.ByteBuffer;
-
-import junit.framework.TestCase;
-
-import org.openflow.util.OFTestCase;
-
-public class OFVendorTest extends OFTestCase {
-    public void testWriteRead() throws Exception {
-        OFVendor msg = (OFVendor) messageFactory.getMessage(OFType.VENDOR);
-        msg.setVendor(1);
-        ByteBuffer bb = ByteBuffer.allocate(1024);
-        bb.clear();
-        msg.writeTo(bb);
-        bb.flip();
-        msg.readFrom(bb);
-        TestCase.assertEquals(1, msg.getVendor());
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/protocol/queue/OFQueuePropertyTypeTest.java b/third-party/openflowj/src/test/java/org/openflow/protocol/queue/OFQueuePropertyTypeTest.java
deleted file mode 100644 (file)
index 415d713..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.openflow.protocol.queue;
-
-
-import junit.framework.TestCase;
-
-import org.junit.Test;
-
-
-public class OFQueuePropertyTypeTest extends TestCase {
-    @Test
-    public void testMapping() throws Exception {
-        TestCase.assertEquals(OFQueuePropertyType.NONE,
-                OFQueuePropertyType.valueOf((short) 0));
-        TestCase.assertEquals(OFQueuePropertyType.MIN_RATE,
-                OFQueuePropertyType.valueOf((short) 1));
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/util/HexStringTest.java b/third-party/openflowj/src/test/java/org/openflow/util/HexStringTest.java
deleted file mode 100644 (file)
index 126281c..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.openflow.util;
-
-import junit.framework.TestCase;
-
-/**
- * Does hexstring conversion work?
- * 
- * @author Rob Sherwood (rob.sherwood@stanford.edu)
- * 
- */
-
-public class HexStringTest extends TestCase {
-
-    public void testMarshalling() throws Exception {
-        String dpidStr = "00:00:00:23:20:2d:16:71";
-        long dpid = HexString.toLong(dpidStr);
-        String testStr = HexString.toHexString(dpid);
-        TestCase.assertEquals(dpidStr, testStr);
-    }
-
-    public void testToStringBytes() {
-        byte[] dpid = { 0, 0, 0, 0, 0, 0, 0, -1 };
-        String valid = "00:00:00:00:00:00:00:ff";
-        String testString = HexString.toHexString(dpid);
-        TestCase.assertEquals(valid, testString);
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/util/OFTestCase.java b/third-party/openflowj/src/test/java/org/openflow/util/OFTestCase.java
deleted file mode 100644 (file)
index a12e49d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.openflow.util;
-
-import org.openflow.protocol.factory.BasicFactory;
-import org.openflow.protocol.factory.OFMessageFactory;
-
-import junit.framework.TestCase;
-
-public class OFTestCase extends TestCase {
-    public OFMessageFactory messageFactory;
-    
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        messageFactory = new BasicFactory();
-    }
-
-    public void test() throws Exception {
-    }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/util/U16Test.java b/third-party/openflowj/src/test/java/org/openflow/util/U16Test.java
deleted file mode 100644 (file)
index 059b3cf..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.openflow.util;
-
-import junit.framework.TestCase;
-
-public class U16Test extends TestCase {
-  /**
-   * Tests that we correctly translate unsigned values in and out of a short
-   * @throws Exception
-   */
-  public void test() throws Exception {
-      int val = 0xffff;
-      TestCase.assertEquals((short)-1, U16.t(val));
-      TestCase.assertEquals((short)32767, U16.t(0x7fff));
-      TestCase.assertEquals(val, U16.f((short)-1));
-  }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/util/U32Test.java b/third-party/openflowj/src/test/java/org/openflow/util/U32Test.java
deleted file mode 100644 (file)
index 8eab857..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.openflow.util;
-
-import junit.framework.TestCase;
-
-public class U32Test extends TestCase {
-  /**
-   * Tests that we correctly translate unsigned values in and out of an int
-   * @throws Exception
-   */
-  public void test() throws Exception {
-      long val = 0xffffffffL;
-      TestCase.assertEquals(-1, U32.t(val));
-      TestCase.assertEquals(val, U32.f(-1));
-  }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/util/U64Test.java b/third-party/openflowj/src/test/java/org/openflow/util/U64Test.java
deleted file mode 100644 (file)
index 6fc625b..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.openflow.util;
-
-import java.math.BigInteger;
-
-import junit.framework.TestCase;
-
-public class U64Test extends TestCase {
-  /**
-   * Tests that we correctly translate unsigned values in and out of a long
-   * @throws Exception
-   */
-  public void test() throws Exception {
-      BigInteger val = new BigInteger("ffffffffffffffff", 16);
-      TestCase.assertEquals(-1, U64.t(val));
-      TestCase.assertEquals(val, U64.f(-1));
-  }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/util/U8Test.java b/third-party/openflowj/src/test/java/org/openflow/util/U8Test.java
deleted file mode 100644 (file)
index c5a3e32..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.openflow.util;
-
-import junit.framework.TestCase;
-
-public class U8Test extends TestCase {
-  /**
-   * Tests that we correctly translate unsigned values in and out of a byte
-   * @throws Exception
-   */
-  public void test() throws Exception {
-      short val = 0xff;
-      TestCase.assertEquals(-1, U8.t(val));
-      TestCase.assertEquals(val, U8.f((byte)-1));
-  }
-}
diff --git a/third-party/openflowj/src/test/java/org/openflow/util/UnsignedTest.java b/third-party/openflowj/src/test/java/org/openflow/util/UnsignedTest.java
deleted file mode 100644 (file)
index 6701f4a..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.openflow.util;
-
-import java.math.BigInteger;
-import java.nio.ByteBuffer;
-
-import junit.framework.TestCase;
-
-public class UnsignedTest extends TestCase {
-    public static String ULONG_MAX = "18446744073709551615";
-
-  /**
-   * Tests that we correctly extract an unsigned long into a BigInteger
-   * @throws Exception
-   */
-  public void testGetUnsignedLong() throws Exception {
-    ByteBuffer bb = ByteBuffer.allocate(8);
-    bb.put((byte)0xff).put((byte)0xff).put((byte)0xff).put((byte)0xff);
-    bb.put((byte)0xff).put((byte)0xff).put((byte)0xff).put((byte)0xff);
-    bb.position(0);
-    bb.limit(8);
-    BigInteger bi = Unsigned.getUnsignedLong(bb);
-    BigInteger uLongMax = new BigInteger(ULONG_MAX);
-    for (int i = 0; i < uLongMax.bitCount(); ++i) {
-        TestCase.assertTrue("Bit: " + i + " should be: " + uLongMax.testBit(i),
-                uLongMax.testBit(i) == bi.testBit(i));
-    }
-    TestCase.assertEquals(ULONG_MAX, bi.toString());
-
-    bb = ByteBuffer.allocate(10);
-    bb.put((byte)0x00);
-    bb.put((byte)0xff).put((byte)0xff).put((byte)0xff).put((byte)0xff);
-    bb.put((byte)0xff).put((byte)0xff).put((byte)0xff).put((byte)0xff);
-    bb.put((byte)0x00);
-    bb.position(0);
-    bb.limit(10);
-    bi = Unsigned.getUnsignedLong(bb, 1);
-    uLongMax = new BigInteger(ULONG_MAX);
-    for (int i = 0; i < uLongMax.bitCount(); ++i) {
-        TestCase.assertTrue("Bit: " + i + " should be: " + uLongMax.testBit(i),
-                uLongMax.testBit(i) == bi.testBit(i));
-    }
-    TestCase.assertEquals(ULONG_MAX, bi.toString());
-  }
-
-  /**
-   * Tests that we correctly put an unsigned long into a ByteBuffer
-   * @throws Exception
-   */
-  public void testPutUnsignedLong() throws Exception {
-    ByteBuffer bb = ByteBuffer.allocate(8);
-    BigInteger uLongMax = new BigInteger(ULONG_MAX);
-    Unsigned.putUnsignedLong(bb, uLongMax);
-    for (int i = 0; i < 8; ++i) {
-        TestCase.assertTrue("Byte: " + i + " should be 0xff, was: " + bb.get(i),
-                (bb.get(i) & (short)0xff) == 0xff);
-    }
-
-    bb = ByteBuffer.allocate(10);
-    Unsigned.putUnsignedLong(bb, uLongMax, 1);
-    int offset = 1;
-    for (int i = 0; i < 8; ++i) {
-        TestCase.assertTrue("Byte: " + i + " should be 0xff, was: " +
-                bb.get(offset+i), (bb.get(offset+i) & (short)0xff) == 0xff);
-    }
-  }
-}
diff --git a/third-party/org.apache.catalina.filters.CorsFilter/README b/third-party/org.apache.catalina.filters.CorsFilter/README
deleted file mode 100644 (file)
index e2d22ab..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-See: http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#CORS_Filter
-And: http://en.wikipedia.org/wiki/Cross-origin_resource_sharing
-This is done to allow a web page using javascript to be able to make calls
-to our REST APIs even though it does not originate in our domain.
-
-This bundle just rolls up org.apache.catalina.filters.CorsFilter and adds it as a 
-fragment to the org.apache.catalina bundle.
-
-The reason this is necessary is because the CorsFilter class was originally added
-at Tomcat 7.0.42, and we are using 7.0.32.  As the CorsFilter class is a simple one,
-with very few dependencies, this seemed the best way to bring it in.
-
diff --git a/third-party/org.apache.catalina.filters.CorsFilter/pom.xml b/third-party/org.apache.catalina.filters.CorsFilter/pom.xml
deleted file mode 100644 (file)
index 78996da..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <!-- Get some common settings for the project we are using it in -->
-  <parent>
-    <groupId>org.opendaylight.controller</groupId>
-    <artifactId>commons.thirdparty</artifactId>
-    <version>1.2.0-SNAPSHOT</version>
-    <relativePath>../commons/thirdparty</relativePath>
-  </parent>
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
-    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
-    <tag>HEAD</tag>
-  </scm>
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.opendaylight.controller.thirdparty</groupId>
-  <artifactId>org.apache.catalina.filters.CorsFilter</artifactId>
-  <version>7.1.0-SNAPSHOT</version>
-  <packaging>bundle</packaging>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <version>2.3.6</version>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Fragment-Host>
-              org.apache.catalina
-            </Fragment-Host>
-            <Import-Package>
-              javax.servlet,
-              javax.servlet.http,
-              org.apache.catalina.filters,
-              org.apache.tomcat.util.res,
-              org.apache.catalina.comet,
-              org.apache.tomcat.util
-            </Import-Package>
-            <Export-Package>
-              org.apache.juli.*
-            </Export-Package>
-          </instructions>
-          <manifestLocation>${project.basedir}/META-INF</manifestLocation>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-  <dependencies>
-    <dependency>
-      <groupId>equinoxSDK381</groupId>
-      <artifactId>javax.servlet</artifactId>
-      <version>3.0.0.v201112011016</version>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>org.apache.juli.extras</artifactId>
-      <version>7.0.32.v201211081135</version>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>org.apache.tomcat.util</artifactId>
-      <version>7.0.32.v201211201952</version>
-    </dependency>
-    <dependency>
-      <groupId>orbit</groupId>
-      <artifactId>org.apache.catalina</artifactId>
-      <version>7.0.32.v201211201336</version>
-    </dependency>
-  </dependencies>
-</project>
diff --git a/third-party/org.apache.catalina.filters.CorsFilter/src/main/java/org/apache/catalina/filters/CorsFilter.java b/third-party/org.apache.catalina.filters.CorsFilter/src/main/java/org/apache/catalina/filters/CorsFilter.java
deleted file mode 100644 (file)
index 8069c99..0000000
+++ /dev/null
@@ -1,1166 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.catalina.filters;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.catalina.filters.Constants;
-import org.apache.juli.logging.Log;
-import org.apache.juli.logging.LogFactory;
-import org.apache.tomcat.util.res.StringManager;
-
-/**
- * <p>
- * A {@link Filter} that enable client-side cross-origin requests by
- * implementing W3C's CORS (<b>C</b>ross-<b>O</b>rigin <b>R</b>esource
- * <b>S</b>haring) specification for resources. Each {@link HttpServletRequest}
- * request is inspected as per specification, and appropriate response headers
- * are added to {@link HttpServletResponse}.
- * </p>
- *
- * <p>
- * By default, it also sets following request attributes, that help to
- * determine the nature of the request downstream.
- * <ul>
- * <li><b>cors.isCorsRequest:</b> Flag to determine if the request is a CORS
- * request. Set to <code>true</code> if a CORS request; <code>false</code>
- * otherwise.</li>
- * <li><b>cors.request.origin:</b> The Origin URL, i.e. the URL of the page from
- * where the request is originated.</li>
- * <li>
- * <b>cors.request.type:</b> Type of request. Possible values:
- * <ul>
- * <li>SIMPLE: A request which is not preceded by a pre-flight request.</li>
- * <li>ACTUAL: A request which is preceded by a pre-flight request.</li>
- * <li>PRE_FLIGHT: A pre-flight request.</li>
- * <li>NOT_CORS: A normal same-origin request.</li>
- * <li>INVALID_CORS: A cross-origin request which is invalid.</li>
- * </ul>
- * </li>
- * <li><b>cors.request.headers:</b> Request headers sent as
- * 'Access-Control-Request-Headers' header, for pre-flight request.</li>
- * </ul>
- * </p>
- *
- * @see <a href="http://www.w3.org/TR/cors/">CORS specification</a>
- *
- */
-public final class CorsFilter implements Filter {
-
-    private static final Log log = LogFactory.getLog(CorsFilter.class);
-
-    private static final StringManager sm =
-            StringManager.getManager(Constants.Package);
-
-
-    /**
-     * A {@link Collection} of origins consisting of zero or more origins that
-     * are allowed access to the resource.
-     */
-    private final Collection<String> allowedOrigins;
-
-    /**
-     * Determines if any origin is allowed to make request.
-     */
-    private boolean anyOriginAllowed;
-
-    /**
-     * A {@link Collection} of methods consisting of zero or more methods that
-     * are supported by the resource.
-     */
-    private final Collection<String> allowedHttpMethods;
-
-    /**
-     * A {@link Collection} of headers consisting of zero or more header field
-     * names that are supported by the resource.
-     */
-    private final Collection<String> allowedHttpHeaders;
-
-    /**
-     * A {@link Collection} of exposed headers consisting of zero or more header
-     * field names of headers other than the simple response headers that the
-     * resource might use and can be exposed.
-     */
-    private final Collection<String> exposedHeaders;
-
-    /**
-     * A supports credentials flag that indicates whether the resource supports
-     * user credentials in the request. It is true when the resource does and
-     * false otherwise.
-     */
-    private boolean supportsCredentials;
-
-    /**
-     * Indicates (in seconds) how long the results of a pre-flight request can
-     * be cached in a pre-flight result cache.
-     */
-    private long preflightMaxAge;
-
-    /**
-     * Determines if the request should be decorated or not.
-     */
-    private boolean decorateRequest;
-
-
-    public CorsFilter() {
-        this.allowedOrigins = new HashSet<String>();
-        this.allowedHttpMethods = new HashSet<String>();
-        this.allowedHttpHeaders = new HashSet<String>();
-        this.exposedHeaders = new HashSet<String>();
-    }
-
-
-    @Override
-    public void doFilter(final ServletRequest servletRequest,
-            final ServletResponse servletResponse, final FilterChain filterChain)
-            throws IOException, ServletException {
-        if (!(servletRequest instanceof HttpServletRequest) ||
-                !(servletResponse instanceof HttpServletResponse)) {
-            throw new ServletException(sm.getString("corsFilter.onlyHttp"));
-        }
-
-        // Safe to downcast at this point.
-        HttpServletRequest request = (HttpServletRequest) servletRequest;
-        HttpServletResponse response = (HttpServletResponse) servletResponse;
-
-        // Determines the CORS request type.
-        CorsFilter.CORSRequestType requestType = checkRequestType(request);
-
-        // Adds CORS specific attributes to request.
-        if (decorateRequest) {
-            CorsFilter.decorateCORSProperties(request, requestType);
-        }
-        switch (requestType) {
-        case SIMPLE:
-            // Handles a Simple CORS request.
-            this.handleSimpleCORS(request, response, filterChain);
-            break;
-        case ACTUAL:
-            // Handles an Actual CORS request.
-            this.handleSimpleCORS(request, response, filterChain);
-            break;
-        case PRE_FLIGHT:
-            // Handles a Pre-flight CORS request.
-            this.handlePreflightCORS(request, response, filterChain);
-            break;
-        case NOT_CORS:
-            // Handles a Normal request that is not a cross-origin request.
-            this.handleNonCORS(request, response, filterChain);
-            break;
-        default:
-            // Handles a CORS request that violates specification.
-            this.handleInvalidCORS(request, response, filterChain);
-            break;
-        }
-    }
-
-
-    @Override
-    public void init(final FilterConfig filterConfig) throws ServletException {
-        // Initialize defaults
-        parseAndStore(DEFAULT_ALLOWED_ORIGINS, DEFAULT_ALLOWED_HTTP_METHODS,
-                DEFAULT_ALLOWED_HTTP_HEADERS, DEFAULT_EXPOSED_HEADERS,
-                DEFAULT_SUPPORTS_CREDENTIALS, DEFAULT_PREFLIGHT_MAXAGE,
-                DEFAULT_DECORATE_REQUEST);
-
-        if (filterConfig != null) {
-            String configAllowedOrigins = filterConfig
-                    .getInitParameter(PARAM_CORS_ALLOWED_ORIGINS);
-            String configAllowedHttpMethods = filterConfig
-                    .getInitParameter(PARAM_CORS_ALLOWED_METHODS);
-            String configAllowedHttpHeaders = filterConfig
-                    .getInitParameter(PARAM_CORS_ALLOWED_HEADERS);
-            String configExposedHeaders = filterConfig
-                    .getInitParameter(PARAM_CORS_EXPOSED_HEADERS);
-            String configSupportsCredentials = filterConfig
-                    .getInitParameter(PARAM_CORS_SUPPORT_CREDENTIALS);
-            String configPreflightMaxAge = filterConfig
-                    .getInitParameter(PARAM_CORS_PREFLIGHT_MAXAGE);
-            String configDecorateRequest = filterConfig
-                    .getInitParameter(PARAM_CORS_REQUEST_DECORATE);
-
-            parseAndStore(configAllowedOrigins, configAllowedHttpMethods,
-                    configAllowedHttpHeaders, configExposedHeaders,
-                    configSupportsCredentials, configPreflightMaxAge,
-                    configDecorateRequest);
-        }
-    }
-
-
-    /**
-     * Handles a CORS request of type {@link CORSRequestType}.SIMPLE.
-     *
-     * @param request
-     *            The {@link HttpServletRequest} object.
-     * @param response
-     *            The {@link HttpServletResponse} object.
-     * @param filterChain
-     *            The {@link FilterChain} object.
-     * @throws IOException
-     * @throws ServletException
-     * @see <a href="http://www.w3.org/TR/cors/#resource-requests">Simple
-     *      Cross-Origin Request, Actual Request, and Redirects</a>
-     */
-    protected void handleSimpleCORS(final HttpServletRequest request,
-            final HttpServletResponse response, final FilterChain filterChain)
-            throws IOException, ServletException {
-
-        CorsFilter.CORSRequestType requestType = checkRequestType(request);
-        if (!(requestType == CorsFilter.CORSRequestType.SIMPLE ||
-                requestType == CorsFilter.CORSRequestType.ACTUAL)) {
-            throw new IllegalArgumentException(
-                    sm.getString("corsFilter.wrongType2",
-                            CorsFilter.CORSRequestType.SIMPLE,
-                            CorsFilter.CORSRequestType.ACTUAL));
-        }
-
-        final String origin = request
-                .getHeader(CorsFilter.REQUEST_HEADER_ORIGIN);
-        final String method = request.getMethod();
-
-        // Section 6.1.2
-        if (!isOriginAllowed(origin)) {
-            handleInvalidCORS(request, response, filterChain);
-            return;
-        }
-
-        if (!allowedHttpMethods.contains(method)) {
-            handleInvalidCORS(request, response, filterChain);
-            return;
-        }
-
-        // Section 6.1.3
-        // Add a single Access-Control-Allow-Origin header.
-        if (anyOriginAllowed && !supportsCredentials) {
-            // If resource doesn't support credentials and if any origin is
-            // allowed
-            // to make CORS request, return header with '*'.
-            response.addHeader(
-                    CorsFilter.RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN,
-                    "*");
-        } else {
-            // If the resource supports credentials add a single
-            // Access-Control-Allow-Origin header, with the value of the Origin
-            // header as value.
-            response.addHeader(
-                    CorsFilter.RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN,
-                    origin);
-        }
-
-        // Section 6.1.3
-        // If the resource supports credentials, add a single
-        // Access-Control-Allow-Credentials header with the case-sensitive
-        // string "true" as value.
-        if (supportsCredentials) {
-            response.addHeader(
-                    CorsFilter.RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS,
-                    "true");
-        }
-
-        // Section 6.1.4
-        // If the list of exposed headers is not empty add one or more
-        // Access-Control-Expose-Headers headers, with as values the header
-        // field names given in the list of exposed headers.
-        if ((exposedHeaders != null) && (exposedHeaders.size() > 0)) {
-            String exposedHeadersString = join(exposedHeaders, ",");
-            response.addHeader(
-                    CorsFilter.RESPONSE_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS,
-                    exposedHeadersString);
-        }
-
-        // Forward the request down the filter chain.
-        filterChain.doFilter(request, response);
-    }
-
-
-    /**
-     * Handles CORS pre-flight request.
-     *
-     * @param request
-     *            The {@link HttpServletRequest} object.
-     * @param response
-     *            The {@link HttpServletResponse} object.
-     * @param filterChain
-     *            The {@link FilterChain} object.
-     * @throws IOException
-     * @throws ServletException
-     */
-    protected void handlePreflightCORS(final HttpServletRequest request,
-            final HttpServletResponse response, final FilterChain filterChain)
-            throws IOException, ServletException {
-
-        CORSRequestType requestType = checkRequestType(request);
-        if (requestType != CORSRequestType.PRE_FLIGHT) {
-            throw new IllegalArgumentException(
-                    sm.getString("corsFilter.wrongType1",
-                            CORSRequestType.PRE_FLIGHT.name().toLowerCase()));
-        }
-
-        final String origin = request
-                .getHeader(CorsFilter.REQUEST_HEADER_ORIGIN);
-
-        // Section 6.2.2
-        if (!isOriginAllowed(origin)) {
-            handleInvalidCORS(request, response, filterChain);
-            return;
-        }
-
-        // Section 6.2.3
-        String accessControlRequestMethod = request.getHeader(
-                CorsFilter.REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD);
-        if (accessControlRequestMethod == null ||
-                !HTTP_METHODS.contains(accessControlRequestMethod.trim())) {
-            handleInvalidCORS(request, response, filterChain);
-            return;
-        } else {
-            accessControlRequestMethod = accessControlRequestMethod.trim();
-        }
-
-        // Section 6.2.4
-        String accessControlRequestHeadersHeader = request.getHeader(
-                CorsFilter.REQUEST_HEADER_ACCESS_CONTROL_REQUEST_HEADERS);
-        List<String> accessControlRequestHeaders = new LinkedList<String>();
-        if (accessControlRequestHeadersHeader != null &&
-                !accessControlRequestHeadersHeader.trim().isEmpty()) {
-            String[] headers = accessControlRequestHeadersHeader.trim().split(
-                    ",");
-            for (String header : headers) {
-                accessControlRequestHeaders.add(header.trim().toLowerCase());
-            }
-        }
-
-        // Section 6.2.5
-        if (!allowedHttpMethods.contains(accessControlRequestMethod)) {
-            handleInvalidCORS(request, response, filterChain);
-            return;
-        }
-
-        // Section 6.2.6
-        if (!accessControlRequestHeaders.isEmpty()) {
-            for (String header : accessControlRequestHeaders) {
-                if (!allowedHttpHeaders.contains(header)) {
-                    handleInvalidCORS(request, response, filterChain);
-                    return;
-                }
-            }
-        }
-
-        // Section 6.2.7
-        if (supportsCredentials) {
-            response.addHeader(
-                    CorsFilter.RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN,
-                    origin);
-            response.addHeader(
-                    CorsFilter.RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS,
-                    "true");
-        } else {
-            if (anyOriginAllowed) {
-                response.addHeader(
-                        CorsFilter.RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN,
-                        "*");
-            } else {
-                response.addHeader(
-                        CorsFilter.RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN,
-                        origin);
-            }
-        }
-
-        // Section 6.2.8
-        if (preflightMaxAge > 0) {
-            response.addHeader(
-                    CorsFilter.RESPONSE_HEADER_ACCESS_CONTROL_MAX_AGE,
-                    String.valueOf(preflightMaxAge));
-        }
-
-        // Section 6.2.9
-        response.addHeader(
-                CorsFilter.RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_METHODS,
-                accessControlRequestMethod);
-
-        // Section 6.2.10
-        if ((allowedHttpHeaders != null) && (!allowedHttpHeaders.isEmpty())) {
-            response.addHeader(
-                    CorsFilter.RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_HEADERS,
-                    join(allowedHttpHeaders, ","));
-        }
-
-        // Do not forward the request down the filter chain.
-    }
-
-
-    /**
-     * Handles a request, that's not a CORS request, but is a valid request i.e.
-     * it is not a cross-origin request. This implementation, just forwards the
-     * request down the filter chain.
-     *
-     * @param request
-     *            The {@link HttpServletRequest} object.
-     * @param response
-     *            The {@link HttpServletResponse} object.
-     * @param filterChain
-     *            The {@link FilterChain} object.
-     * @throws IOException
-     * @throws ServletException
-     */
-    private void handleNonCORS(final HttpServletRequest request,
-            final HttpServletResponse response, final FilterChain filterChain)
-            throws IOException, ServletException {
-        // Let request pass.
-        filterChain.doFilter(request, response);
-    }
-
-
-    /**
-     * Handles a CORS request that violates specification.
-     *
-     * @param request
-     *            The {@link HttpServletRequest} object.
-     * @param response
-     *            The {@link HttpServletResponse} object.
-     * @param filterChain
-     *            The {@link FilterChain} object.
-     */
-    private void handleInvalidCORS(final HttpServletRequest request,
-            final HttpServletResponse response, final FilterChain filterChain) {
-        String origin = request.getHeader(CorsFilter.REQUEST_HEADER_ORIGIN);
-        String method = request.getMethod();
-        String accessControlRequestHeaders = request.getHeader(
-                REQUEST_HEADER_ACCESS_CONTROL_REQUEST_HEADERS);
-
-        response.setContentType("text/plain");
-        response.setStatus(HttpServletResponse.SC_FORBIDDEN);
-        response.resetBuffer();
-
-        if (log.isDebugEnabled()) {
-            // Debug so no need for i18n
-            StringBuilder message =
-                    new StringBuilder("Invalid CORS request; Origin=");
-            message.append(origin);
-            message.append(";Method=");
-            message.append(method);
-            if (accessControlRequestHeaders != null) {
-                message.append(";Access-Control-Request-Headers=");
-                message.append(accessControlRequestHeaders);
-            }
-            log.debug(message.toString());
-        }
-    }
-
-
-    @Override
-    public void destroy() {
-        // NOOP
-    }
-
-
-    /**
-     * Decorates the {@link HttpServletRequest}, with CORS attributes.
-     * <ul>
-     * <li><b>cors.isCorsRequest:</b> Flag to determine if request is a CORS
-     * request. Set to <code>true</code> if CORS request; <code>false</code>
-     * otherwise.</li>
-     * <li><b>cors.request.origin:</b> The Origin URL.</li>
-     * <li><b>cors.request.type:</b> Type of request. Values:
-     * <code>simple</code> or <code>preflight</code> or <code>not_cors</code> or
-     * <code>invalid_cors</code></li>
-     * <li><b>cors.request.headers:</b> Request headers sent as
-     * 'Access-Control-Request-Headers' header, for pre-flight request.</li>
-     * </ul>
-     *
-     * @param request
-     *            The {@link HttpServletRequest} object.
-     * @param corsRequestType
-     *            The {@link CORSRequestType} object.
-     */
-    protected static void decorateCORSProperties(
-            final HttpServletRequest request,
-            final CORSRequestType corsRequestType) {
-        if (request == null) {
-            throw new IllegalArgumentException(
-                    sm.getString("corsFilter.nullRequest"));
-        }
-
-        if (corsRequestType == null) {
-            throw new IllegalArgumentException(
-                    sm.getString("corsFilter.nullRequestType"));
-        }
-
-        switch (corsRequestType) {
-        case SIMPLE:
-            request.setAttribute(
-                    CorsFilter.HTTP_REQUEST_ATTRIBUTE_IS_CORS_REQUEST,
-                    Boolean.TRUE);
-            request.setAttribute(CorsFilter.HTTP_REQUEST_ATTRIBUTE_ORIGIN,
-                    request.getHeader(CorsFilter.REQUEST_HEADER_ORIGIN));
-            request.setAttribute(
-                    CorsFilter.HTTP_REQUEST_ATTRIBUTE_REQUEST_TYPE,
-                    corsRequestType.name().toLowerCase());
-            break;
-        case ACTUAL:
-            request.setAttribute(
-                    CorsFilter.HTTP_REQUEST_ATTRIBUTE_IS_CORS_REQUEST,
-                    Boolean.TRUE);
-            request.setAttribute(CorsFilter.HTTP_REQUEST_ATTRIBUTE_ORIGIN,
-                    request.getHeader(CorsFilter.REQUEST_HEADER_ORIGIN));
-            request.setAttribute(
-                    CorsFilter.HTTP_REQUEST_ATTRIBUTE_REQUEST_TYPE,
-                    corsRequestType.name().toLowerCase());
-            break;
-        case PRE_FLIGHT:
-            request.setAttribute(
-                    CorsFilter.HTTP_REQUEST_ATTRIBUTE_IS_CORS_REQUEST,
-                    Boolean.TRUE);
-            request.setAttribute(CorsFilter.HTTP_REQUEST_ATTRIBUTE_ORIGIN,
-                    request.getHeader(CorsFilter.REQUEST_HEADER_ORIGIN));
-            request.setAttribute(
-                    CorsFilter.HTTP_REQUEST_ATTRIBUTE_REQUEST_TYPE,
-                    corsRequestType.name().toLowerCase());
-            String headers = request.getHeader(
-                    REQUEST_HEADER_ACCESS_CONTROL_REQUEST_HEADERS);
-            if (headers == null) {
-                headers = "";
-            }
-            request.setAttribute(
-                    CorsFilter.HTTP_REQUEST_ATTRIBUTE_REQUEST_HEADERS, headers);
-            break;
-        case NOT_CORS:
-            request.setAttribute(
-                    CorsFilter.HTTP_REQUEST_ATTRIBUTE_IS_CORS_REQUEST,
-                    Boolean.FALSE);
-            break;
-        default:
-            // Don't set any attributes
-            break;
-        }
-    }
-
-
-    /**
-     * Joins elements of {@link Set} into a string, where each element is
-     * separated by the provided separator.
-     *
-     * @param elements
-     *            The {@link Set} containing elements to join together.
-     * @param joinSeparator
-     *            The character to be used for separating elements.
-     * @return The joined {@link String}; <code>null</code> if elements
-     *         {@link Set} is null.
-     */
-    protected static String join(final Collection<String> elements,
-            final String joinSeparator) {
-        String separator = ",";
-        if (elements == null) {
-            return null;
-        }
-        if (joinSeparator != null) {
-            separator = joinSeparator;
-        }
-        StringBuilder buffer = new StringBuilder();
-        boolean isFirst = true;
-        for (String element : elements) {
-            if (!isFirst) {
-                buffer.append(separator);
-            } else {
-                isFirst = false;
-            }
-
-            if (element != null) {
-                buffer.append(element);
-            }
-        }
-
-        return buffer.toString();
-    }
-
-
-    /**
-     * Determines the request type.
-     *
-     * @param request
-     */
-    protected CORSRequestType checkRequestType(final HttpServletRequest request) {
-        CORSRequestType requestType = CORSRequestType.INVALID_CORS;
-        if (request == null) {
-            throw new IllegalArgumentException(
-                    sm.getString("corsFilter.nullRequest"));
-        }
-        String originHeader = request.getHeader(REQUEST_HEADER_ORIGIN);
-        // Section 6.1.1 and Section 6.2.1
-        if (originHeader != null) {
-            if (originHeader.isEmpty()) {
-                requestType = CORSRequestType.INVALID_CORS;
-            } else if (!isValidOrigin(originHeader)) {
-                requestType = CORSRequestType.INVALID_CORS;
-            } else {
-                String method = request.getMethod();
-                if (method != null && HTTP_METHODS.contains(method)) {
-                    if ("OPTIONS".equals(method)) {
-                        String accessControlRequestMethodHeader =
-                                request.getHeader(
-                                        REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD);
-                        if (accessControlRequestMethodHeader != null &&
-                                !accessControlRequestMethodHeader.isEmpty()) {
-                            requestType = CORSRequestType.PRE_FLIGHT;
-                        } else if (accessControlRequestMethodHeader != null &&
-                                accessControlRequestMethodHeader.isEmpty()) {
-                            requestType = CORSRequestType.INVALID_CORS;
-                        } else {
-                            requestType = CORSRequestType.ACTUAL;
-                        }
-                    } else if ("GET".equals(method) || "HEAD".equals(method)) {
-                        requestType = CORSRequestType.SIMPLE;
-                    } else if ("POST".equals(method)) {
-                        String contentType = request.getContentType();
-                        if (contentType != null) {
-                            contentType = contentType.toLowerCase().trim();
-                            if (SIMPLE_HTTP_REQUEST_CONTENT_TYPE_VALUES
-                                    .contains(contentType)) {
-                                requestType = CORSRequestType.SIMPLE;
-                            } else {
-                                requestType = CORSRequestType.ACTUAL;
-                            }
-                        }
-                    } else if (COMPLEX_HTTP_METHODS.contains(method)) {
-                        requestType = CORSRequestType.ACTUAL;
-                    }
-                }
-            }
-        } else {
-            requestType = CORSRequestType.NOT_CORS;
-        }
-
-        return requestType;
-    }
-
-
-    /**
-     * Checks if the Origin is allowed to make a CORS request.
-     *
-     * @param origin
-     *            The Origin.
-     * @return <code>true</code> if origin is allowed; <code>false</code>
-     *         otherwise.
-     */
-    private boolean isOriginAllowed(final String origin) {
-        if (anyOriginAllowed) {
-            return true;
-        }
-
-        // If 'Origin' header is a case-sensitive match of any of allowed
-        // origins, then return true, else return false.
-        return allowedOrigins.contains(origin);
-    }
-
-
-    /**
-     * Parses each param-value and populates configuration variables. If a param
-     * is provided, it overrides the default.
-     *
-     * @param allowedOrigins
-     *            A {@link String} of comma separated origins.
-     * @param allowedHttpMethods
-     *            A {@link String} of comma separated HTTP methods.
-     * @param allowedHttpHeaders
-     *            A {@link String} of comma separated HTTP headers.
-     * @param exposedHeaders
-     *            A {@link String} of comma separated headers that needs to be
-     *            exposed.
-     * @param supportsCredentials
-     *            "true" if support credentials needs to be enabled.
-     * @param preflightMaxAge
-     *            The amount of seconds the user agent is allowed to cache the
-     *            result of the pre-flight request.
-     * @throws ServletException
-     */
-    private void parseAndStore(final String allowedOrigins,
-            final String allowedHttpMethods, final String allowedHttpHeaders,
-            final String exposedHeaders, final String supportsCredentials,
-            final String preflightMaxAge, final String decorateRequest)
-                    throws ServletException {
-        if (allowedOrigins != null) {
-            if (allowedOrigins.trim().equals("*")) {
-                this.anyOriginAllowed = true;
-            } else {
-                this.anyOriginAllowed = false;
-                Set<String> setAllowedOrigins =
-                        parseStringToSet(allowedOrigins);
-                this.allowedOrigins.clear();
-                this.allowedOrigins.addAll(setAllowedOrigins);
-            }
-        }
-
-        if (allowedHttpMethods != null) {
-            Set<String> setAllowedHttpMethods =
-                    parseStringToSet(allowedHttpMethods);
-            this.allowedHttpMethods.clear();
-            this.allowedHttpMethods.addAll(setAllowedHttpMethods);
-        }
-
-        if (allowedHttpHeaders != null) {
-            Set<String> setAllowedHttpHeaders =
-                    parseStringToSet(allowedHttpHeaders);
-            Set<String> lowerCaseHeaders = new HashSet<String>();
-            for (String header : setAllowedHttpHeaders) {
-                String lowerCase = header.toLowerCase();
-                lowerCaseHeaders.add(lowerCase);
-            }
-            this.allowedHttpHeaders.clear();
-            this.allowedHttpHeaders.addAll(lowerCaseHeaders);
-        }
-
-        if (exposedHeaders != null) {
-            Set<String> setExposedHeaders = parseStringToSet(exposedHeaders);
-            this.exposedHeaders.clear();
-            this.exposedHeaders.addAll(setExposedHeaders);
-        }
-
-        if (supportsCredentials != null) {
-            // For any value other then 'true' this will be false.
-            this.supportsCredentials = Boolean
-                    .parseBoolean(supportsCredentials);
-        }
-
-        if (preflightMaxAge != null) {
-            try {
-                if (!preflightMaxAge.isEmpty()) {
-                    this.preflightMaxAge = Long.parseLong(preflightMaxAge);
-                } else {
-                    this.preflightMaxAge = 0L;
-                }
-            } catch (NumberFormatException e) {
-                throw new ServletException(
-                        sm.getString("corsFilter.invalidPreflightMaxAge"), e);
-            }
-        }
-
-        if (decorateRequest != null) {
-            // For any value other then 'true' this will be false.
-            this.decorateRequest = Boolean.parseBoolean(decorateRequest);
-        }
-    }
-
-    /**
-     * Takes a comma separated list and returns a Set<String>.
-     *
-     * @param data
-     *            A comma separated list of strings.
-     * @return Set<String>
-     */
-    private Set<String> parseStringToSet(final String data) {
-        String[] splits;
-
-        if (data != null && data.length() > 0) {
-            splits = data.split(",");
-        } else {
-            splits = new String[] {};
-        }
-
-        Set<String> set = new HashSet<String>();
-        if (splits.length > 0) {
-            for (String split : splits) {
-                set.add(split.trim());
-            }
-        }
-
-        return set;
-    }
-
-
-    /**
-     * Checks if a given origin is valid or not. Criteria:
-     * <ul>
-     * <li>If an encoded character is present in origin, it's not valid.</li>
-     * <li>Origin should be a valid {@link URI}</li>
-     * </ul>
-     *
-     * @param origin
-     * @see <a href="http://tools.ietf.org/html/rfc952">RFC952</a>
-     */
-    protected static boolean isValidOrigin(String origin) {
-        // Checks for encoded characters. Helps prevent CRLF injection.
-        if (origin.contains("%")) {
-            return false;
-        }
-
-        URI originURI;
-
-        try {
-            originURI = new URI(origin);
-        } catch (URISyntaxException e) {
-            return false;
-        }
-        // If scheme for URI is null, return false. Return true otherwise.
-        return originURI.getScheme() != null;
-
-    }
-
-
-    /**
-     * Determines if any origin is allowed to make CORS request.
-     *
-     * @return <code>true</code> if it's enabled; false otherwise.
-     */
-    public boolean isAnyOriginAllowed() {
-        return anyOriginAllowed;
-    }
-
-
-    /**
-     * Returns a {@link Set} of headers that should be exposed by browser.
-     */
-    public Collection<String> getExposedHeaders() {
-        return exposedHeaders;
-    }
-
-
-    /**
-     * Determines is supports credentials is enabled.
-     */
-    public boolean isSupportsCredentials() {
-        return supportsCredentials;
-    }
-
-
-    /**
-     * Returns the preflight response cache time in seconds.
-     *
-     * @return Time to cache in seconds.
-     */
-    public long getPreflightMaxAge() {
-        return preflightMaxAge;
-    }
-
-
-    /**
-     * Returns the {@link Set} of allowed origins that are allowed to make
-     * requests.
-     *
-     * @return {@link Set}
-     */
-    public Collection<String> getAllowedOrigins() {
-        return allowedOrigins;
-    }
-
-
-    /**
-     * Returns a {@link Set} of HTTP methods that are allowed to make requests.
-     *
-     * @return {@link Set}
-     */
-    public Collection<String> getAllowedHttpMethods() {
-        return allowedHttpMethods;
-    }
-
-
-    /**
-     * Returns a {@link Set} of headers support by resource.
-     *
-     * @return {@link Set}
-     */
-    public Collection<String> getAllowedHttpHeaders() {
-        return allowedHttpHeaders;
-    }
-
-
-    // -------------------------------------------------- CORS Response Headers
-    /**
-     * The Access-Control-Allow-Origin header indicates whether a resource can
-     * be shared based by returning the value of the Origin request header in
-     * the response.
-     */
-    public static final String RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN =
-            "Access-Control-Allow-Origin";
-
-    /**
-     * The Access-Control-Allow-Credentials header indicates whether the
-     * response to request can be exposed when the omit credentials flag is
-     * unset. When part of the response to a preflight request it indicates that
-     * the actual request can include user credentials.
-     */
-    public static final String RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS =
-            "Access-Control-Allow-Credentials";
-
-    /**
-     * The Access-Control-Expose-Headers header indicates which headers are safe
-     * to expose to the API of a CORS API specification
-     */
-    public static final String RESPONSE_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS =
-            "Access-Control-Expose-Headers";
-
-    /**
-     * The Access-Control-Max-Age header indicates how long the results of a
-     * preflight request can be cached in a preflight result cache.
-     */
-    public static final String RESPONSE_HEADER_ACCESS_CONTROL_MAX_AGE =
-            "Access-Control-Max-Age";
-
-    /**
-     * The Access-Control-Allow-Methods header indicates, as part of the
-     * response to a preflight request, which methods can be used during the
-     * actual request.
-     */
-    public static final String RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_METHODS =
-            "Access-Control-Allow-Methods";
-
-    /**
-     * The Access-Control-Allow-Headers header indicates, as part of the
-     * response to a preflight request, which header field names can be used
-     * during the actual request.
-     */
-    public static final String RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_HEADERS =
-            "Access-Control-Allow-Headers";
-
-    // -------------------------------------------------- CORS Request Headers
-    /**
-     * The Origin header indicates where the cross-origin request or preflight
-     * request originates from.
-     */
-    public static final String REQUEST_HEADER_ORIGIN = "Origin";
-
-    /**
-     * The Access-Control-Request-Method header indicates which method will be
-     * used in the actual request as part of the preflight request.
-     */
-    public static final String REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD =
-            "Access-Control-Request-Method";
-
-    /**
-     * The Access-Control-Request-Headers header indicates which headers will be
-     * used in the actual request as part of the preflight request.
-     */
-    public static final String REQUEST_HEADER_ACCESS_CONTROL_REQUEST_HEADERS =
-            "Access-Control-Request-Headers";
-
-    // ----------------------------------------------------- Request attributes
-    /**
-     * The prefix to a CORS request attribute.
-     */
-    public static final String HTTP_REQUEST_ATTRIBUTE_PREFIX = "cors.";
-
-    /**
-     * Attribute that contains the origin of the request.
-     */
-    public static final String HTTP_REQUEST_ATTRIBUTE_ORIGIN =
-            HTTP_REQUEST_ATTRIBUTE_PREFIX + "request.origin";
-
-    /**
-     * Boolean value, suggesting if the request is a CORS request or not.
-     */
-    public static final String HTTP_REQUEST_ATTRIBUTE_IS_CORS_REQUEST =
-            HTTP_REQUEST_ATTRIBUTE_PREFIX + "isCorsRequest";
-
-    /**
-     * Type of CORS request, of type {@link CORSRequestType}.
-     */
-    public static final String HTTP_REQUEST_ATTRIBUTE_REQUEST_TYPE =
-            HTTP_REQUEST_ATTRIBUTE_PREFIX + "request.type";
-
-    /**
-     * Request headers sent as 'Access-Control-Request-Headers' header, for
-     * pre-flight request.
-     */
-    public static final String HTTP_REQUEST_ATTRIBUTE_REQUEST_HEADERS =
-            HTTP_REQUEST_ATTRIBUTE_PREFIX + "request.headers";
-
-    // -------------------------------------------------------------- Constants
-    /**
-     * Enumerates varies types of CORS requests. Also, provides utility methods
-     * to determine the request type.
-     */
-    protected static enum CORSRequestType {
-        /**
-         * A simple HTTP request, i.e. it shouldn't be pre-flighted.
-         */
-        SIMPLE,
-        /**
-         * A HTTP request that needs to be pre-flighted.
-         */
-        ACTUAL,
-        /**
-         * A pre-flight CORS request, to get meta information, before a
-         * non-simple HTTP request is sent.
-         */
-        PRE_FLIGHT,
-        /**
-         * Not a CORS request, but a normal request.
-         */
-        NOT_CORS,
-        /**
-         * An invalid CORS request, i.e. it qualifies to be a CORS request, but
-         * fails to be a valid one.
-         */
-        INVALID_CORS
-    }
-
-    /**
-     * {@link Collection} of HTTP methods. Case sensitive.
-     *
-     * @see  <a href="http://tools.ietf.org/html/rfc2616#section-5.1.1"
-     *       >http://tools.ietf.org/html/rfc2616#section-5.1.1</a>
-     *
-     */
-    public static final Collection<String> HTTP_METHODS =
-            new HashSet<String>(Arrays.asList("OPTIONS", "GET", "HEAD", "POST",
-                    "PUT", "DELETE", "TRACE", "CONNECT"));
-    /**
-     * {@link Collection} of non-simple HTTP methods. Case sensitive.
-     */
-    public static final Collection<String> COMPLEX_HTTP_METHODS =
-            new HashSet<String>(Arrays.asList("PUT", "DELETE", "TRACE",
-                    "CONNECT"));
-    /**
-     * {@link Collection} of Simple HTTP methods. Case sensitive.
-     *
-     * @see  <a href="http://www.w3.org/TR/cors/#terminology"
-     *       >http://www.w3.org/TR/cors/#terminology</a>
-     */
-    public static final Collection<String> SIMPLE_HTTP_METHODS =
-            new HashSet<String>(Arrays.asList("GET", "POST", "HEAD"));
-
-    /**
-     * {@link Collection} of Simple HTTP request headers. Case in-sensitive.
-     *
-     * @see  <a href="http://www.w3.org/TR/cors/#terminology"
-     *       >http://www.w3.org/TR/cors/#terminology</a>
-     */
-    public static final Collection<String> SIMPLE_HTTP_REQUEST_HEADERS =
-            new HashSet<String>(Arrays.asList("Accept", "Accept-Language",
-                    "Content-Language"));
-
-    /**
-     * {@link Collection} of Simple HTTP request headers. Case in-sensitive.
-     *
-     * @see  <a href="http://www.w3.org/TR/cors/#terminology"
-     *       >http://www.w3.org/TR/cors/#terminology</a>
-     */
-    public static final Collection<String> SIMPLE_HTTP_RESPONSE_HEADERS =
-            new HashSet<String>(Arrays.asList("Cache-Control",
-                    "Content-Language", "Content-Type", "Expires",
-                    "Last-Modified", "Pragma"));
-
-    /**
-     * {@link Collection} of Simple HTTP request headers. Case in-sensitive.
-     *
-     * @see  <a href="http://www.w3.org/TR/cors/#terminology"
-     *       >http://www.w3.org/TR/cors/#terminology</a>
-     */
-    public static final Collection<String> SIMPLE_HTTP_REQUEST_CONTENT_TYPE_VALUES =
-            new HashSet<String>(Arrays.asList(
-                    "application/x-www-form-urlencoded",
-                    "multipart/form-data", "text/plain"));
-
-    // ------------------------------------------------ Configuration Defaults
-    /**
-     * By default, all origins are allowed to make requests.
-     */
-    public static final String DEFAULT_ALLOWED_ORIGINS = "*";
-
-    /**
-     * By default, following methods are supported: GET, POST, HEAD and OPTIONS.
-     */
-    public static final String DEFAULT_ALLOWED_HTTP_METHODS =
-            "GET,POST,HEAD,OPTIONS";
-
-    /**
-     * By default, time duration to cache pre-flight response is 30 mins.
-     */
-    public static final String DEFAULT_PREFLIGHT_MAXAGE = "1800";
-
-    /**
-     * By default, support credentials is turned on.
-     */
-    public static final String DEFAULT_SUPPORTS_CREDENTIALS = "true";
-
-    /**
-     * By default, following headers are supported:
-     * Origin,Accept,X-Requested-With, Content-Type,
-     * Access-Control-Request-Method, and Access-Control-Request-Headers.
-     */
-    public static final String DEFAULT_ALLOWED_HTTP_HEADERS =
-            "Origin,Accept,X-Requested-With,Content-Type," +
-            "Access-Control-Request-Method,Access-Control-Request-Headers";
-
-    /**
-     * By default, none of the headers are exposed in response.
-     */
-    public static final String DEFAULT_EXPOSED_HEADERS = "";
-
-    /**
-     * By default, request is decorated with CORS attributes.
-     */
-    public static final String DEFAULT_DECORATE_REQUEST = "true";
-
-    // ----------------------------------------Filter Config Init param-name(s)
-    /**
-     * Key to retrieve allowed origins from {@link FilterConfig}.
-     */
-    public static final String PARAM_CORS_ALLOWED_ORIGINS =
-            "cors.allowed.origins";
-
-    /**
-     * Key to retrieve support credentials from {@link FilterConfig}.
-     */
-    public static final String PARAM_CORS_SUPPORT_CREDENTIALS =
-            "cors.support.credentials";
-
-    /**
-     * Key to retrieve exposed headers from {@link FilterConfig}.
-     */
-    public static final String PARAM_CORS_EXPOSED_HEADERS =
-            "cors.exposed.headers";
-
-    /**
-     * Key to retrieve allowed headers from {@link FilterConfig}.
-     */
-    public static final String PARAM_CORS_ALLOWED_HEADERS =
-            "cors.allowed.headers";
-
-    /**
-     * Key to retrieve allowed methods from {@link FilterConfig}.
-     */
-    public static final String PARAM_CORS_ALLOWED_METHODS =
-            "cors.allowed.methods";
-
-    /**
-     * Key to retrieve preflight max age from {@link FilterConfig}.
-     */
-    public static final String PARAM_CORS_PREFLIGHT_MAXAGE =
-            "cors.preflight.maxage";
-
-    /**
-     * Key to determine if request should be decorated.
-     */
-    public static final String PARAM_CORS_REQUEST_DECORATE =
-            "cors.request.decorate";
-}