Merge "Bug 2267: Reuse leaf and leaf set entry builders in NormalizedNodeInputStreamR...
authorMoiz Raja <moraja@cisco.com>
Wed, 26 Nov 2014 18:34:42 +0000 (18:34 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 26 Nov 2014 18:34:42 +0000 (18:34 +0000)
304 files changed:
features/mdsal/pom.xml
opendaylight/adsal/routing/dijkstra_implementation/src/main/java/org/opendaylight/controller/routing/dijkstra_implementation/internal/DijkstraImplementation.java
opendaylight/commons/opendaylight/pom.xml
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/ConfigRegistry.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/ConfigTransactionController.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/DynamicMBeanWithInstance.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/IdentityAttributeRef.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/LookupRegistry.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/ServiceReferenceReadableRegistry.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/CommitStatus.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/ObjectNameUtil.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/spi/Module.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/spi/ModuleFactory.java
opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/IdentityAttributeRefTest.java
opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/JmxAttributeTest.java
opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/JmxAttributeValidationExceptionTest.java
opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/ModuleIdentifierTest.java
opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/ValidationExceptionTest.java
opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/jmx/ObjectNameUtilTest.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/CommitInfo.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigRegistryImpl.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionControllerImpl.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionControllerInternal.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionLookupRegistry.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/DeadlockMonitor.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ModuleInternalInfo.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/dependencyresolver/DependencyResolverImpl.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DependencyResolverManager.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DestroyedModule.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/ModuleInternalTransactionalInfo.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/ModulesHolder.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AbstractDynamicWrapper.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AnnotationsHelper.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AttributeHolder.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicReadableWrapper.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicWritableWrapper.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/factoriesresolver/ModuleFactoriesResolver.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/BaseJMXRegistrator.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ConfigRegistryJMXRegistrator.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/HierarchicalRuntimeBeanRegistrationImpl.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/InternalJMXRegistrator.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ModuleJMXRegistrator.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/RootRuntimeBeanRegistratorImpl.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReferenceRegistrator.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/TransactionJMXRegistrator.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/TransactionModuleJMXRegistrator.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BeanToOsgiServiceManager.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BlankTransactionServiceTracker.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BundleContextBackedModuleFactoriesResolver.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ExtensibleBundleTracker.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ModuleFactoryBundleTracker.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/mapping/CodecRegistryProvider.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/mapping/ModuleInfoBundleTracker.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/mapping/RefreshingSCPModuleInfoRegistry.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/LookupBeansUtil.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/ModuleQNameUtil.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/OsgiRegistrationUtil.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/ConfigRegistryImplTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/AbstractConfigTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/AbstractLockedPlatformMBeanServerTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/ClassBasedModuleFactory.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/ConfigRegistryImplLookupTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionControllerImplTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionManagerImplTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/ServiceReferenceRegistryImplTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DependencyResolverManagerTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AbstractDynamicWrapperTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AnnotationsTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicReadableWrapperTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/DynamicWritableWrapperTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/factoriesresolver/HardcodedModuleFactoriesResolver.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/osgi/BlankTransactionServiceTrackerTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/osgi/BundleContextBackedModuleFactoriesResolverTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/osgi/ModuleFactoryBundleTrackerTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/osgi/RefreshingSCPModuleInfoRegistryTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/runtimembean/RuntimeBeanRegistratorImplTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/util/InterfacesHelperTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/util/OsgiRegistrationUtilTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPConfigMXBean.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPImpl.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModule.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModuleFactory.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/AbstractParallelAPSPTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/DependentWiringTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/MockedDependenciesTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolImpl.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolModule.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/test/AbstractScheduledTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/test/RuntimeBeanTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/test/TwoInterfacesExportTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPool.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPoolModule.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/test/SimpleConfigurationTest.java
opendaylight/config/config-persister-directory-xml-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/directory/xml/XmlDirectoryPersister.java
opendaylight/config/config-persister-directory-xml-adapter/src/test/java/org/opendaylight/controller/config/persist/storage/directory/xml/DirectoryStorageAdapterTest.java
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/AbstractFeatureWrapper.java
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/ChildAwareFeatureWrapper.java
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/ConfigFeaturesListener.java
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/ConfigPushingRunnable.java
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/FeatureConfigSnapshotHolder.java
opendaylight/config/config-persister-file-xml-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/file/xml/XmlFileStorageAdapter.java
opendaylight/config/config-persister-file-xml-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/file/xml/model/Config.java
opendaylight/config/config-persister-file-xml-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/file/xml/model/ConfigSnapshot.java
opendaylight/config/config-persister-file-xml-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/file/xml/model/SnapshotHandler.java
opendaylight/config/config-persister-file-xml-adapter/src/test/java/org/opendaylight/controller/config/persist/storage/file/xml/FileStorageAdapterTest.java
opendaylight/config/config-util/src/main/java/org/opendaylight/controller/config/util/ConfigRegistryClient.java
opendaylight/config/config-util/src/main/java/org/opendaylight/controller/config/util/ConfigRegistryJMXClient.java
opendaylight/config/config-util/src/main/java/org/opendaylight/controller/config/util/ConfigTransactionClient.java
opendaylight/config/config-util/src/main/java/org/opendaylight/controller/config/util/ConfigTransactionJMXClient.java
opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/AttributeEntryTest.java
opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/ConfigRegistryClientsTest.java
opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/ConfigTransactionClientsTest.java
opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/LookupTest.java
opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/TestingConfigRegistry.java
opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/TestingConfigTransactionController.java
opendaylight/config/logback-config-loader/src/main/java/org/opendaylight/controller/logback/config/loader/Activator.java
opendaylight/config/logback-config-loader/src/main/java/org/opendaylight/controller/logback/config/loader/impl/LogbackConfigUtil.java
opendaylight/config/logback-config-loader/src/main/java/org/opendaylight/controller/logback/config/loader/impl/LogbackConfigurationLoader.java
opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/LogbackConfigurationLoaderTest.java
opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/TestAppender.java
opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Debugger.java
opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Errorer.java
opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Informer.java
opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Tracer.java
opendaylight/config/logback-config-loader/src/test/java/org/opendaylight/controller/logback/config/loader/test/logwork/Warner.java
opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryBrokerWriteTransactionBenchmark.java
opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWithExecutorServiceBenchmark.java [deleted file]
opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWithSameThreadedExecutorBenchmark.java
opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWriteTransactionBenchmark.java
opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/DataBrokerTestCustomizer.java
opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/MockSchemaService.java
opendaylight/md-sal/md-sal-config/src/main/resources/initial/01-md-sal.xml
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/FollowerLogInformation.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/FollowerLogInformationImpl.java
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/LeaderTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/MessageCollectorActor.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/binding/impl/BindingAsyncDataBrokerImplModule.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/ForwardedBackwardsCompatibleDataBroker.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/LegacyDataChangeEvent.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/DataBrokerImpl.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/DataTransactionImpl.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/connect/dom/BindingToDomTransaction.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/connect/dom/DomToBindingTransaction.java
opendaylight/md-sal/sal-binding-broker/src/main/yang/opendaylight-binding-broker-impl.yang
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/DataBrokerTestCustomizer.java
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/compat/MultipleAugmentationPutsTest.java
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/BindingTestContext.java
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/MockSchemaService.java
opendaylight/md-sal/sal-binding-it/src/test/resources/controller.xml
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/notify/NotificationPublishService.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/notify/NotificationSubscriptionService.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/AbstractDataModification.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/routing/AbstractDataReadRouter.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/service/AbstractDataBroker.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/service/AbstractDataTransaction.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/service/DataChangeEventImpl.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/service/ImmutableDataChangeEvent.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/service/InitialDataChangeEventImpl.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/service/ListenerStateCapture.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/service/TwoPhaseCommit.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/util/compat/DataNormalizationOperation.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/util/compat/DataNormalizer.java
opendaylight/md-sal/sal-common-impl/src/test/java/org/opendaylight/controller/md/sal/common/impl/util/compat/DataNormalizerTest.java
opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/CommitHandlerTransactions.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/shard/ShardMBeanFactory.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/shard/ShardStats.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataChangeListenerRegistrationProxyTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataChangeListenerRegistrationTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionFailureTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionProxyTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/modification/AbstractModificationTest.java
opendaylight/md-sal/sal-dom-broker/pom.xml
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/pingpong/PingpongDataBrokerModule.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/pingpong/PingpongDataBrokerModuleFactory.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/statistics/DomBrokerRuntimeMXBeanImpl.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/CommitCoordinationTask.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMDataCommitCoordinatorImpl.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongDataBroker.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongFuture.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongTransaction.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongTransactionChain.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/compat/BackwardsCompatibleDataBroker.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/compat/BackwardsCompatibleTransaction.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/compat/TranslatingDataChangeEvent.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/compat/TranslatingListenerInvoker.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BackwardsCompatibleMountPoint.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BackwardsCompatibleMountPointManager.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/DataBrokerImpl.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/DataTransactionImpl.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/GlobalBundleScanningSchemaServiceImpl.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/MountPointImpl.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/DataReaderRouter.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/DataStoreStatsWrapper.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaAwareDataStoreAdapter.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaAwareRpcBroker.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaContextProviders.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/DataBrokerServiceProxy.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/DataProviderServiceProxy.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/MountProviderServiceProxy.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/ProxyFactory.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/util/YangDataOperations.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/util/YangDataUtils.java
opendaylight/md-sal/sal-dom-broker/src/main/yang/opendaylight-pingpong-broker.yang [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMBrokerPerformanceTest.java
opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMBrokerTest.java
opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMTransactionChainTest.java
opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/sal/dom/broker/BackwardsCompatibleMountPointManagerTest.java
opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/sal/dom/broker/BackwardsCompatibleMountPointTest.java
opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLBluePrintRelation.java
opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/jdbc/JDBCCommand.java
opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/jdbc/JDBCResultSet.java
opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/jdbc/JDBCServer.java
opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/config/yang/inmemory_datastore_provider/InMemoryConfigDataStoreProviderModule.java
opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/config/yang/inmemory_datastore_provider/InMemoryOperationalDataStoreProviderModule.java
opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDOMDataStore.java
opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDOMDataStoreFactory.java
opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/jmx/InMemoryDataStoreStats.java
opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/AbstractDataChangeListenerTest.java
opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDataStoreTest.java
opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/SchemaUpdateForTransactionTest.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/sal/tx/NetconfDeviceWriteOnlyTx.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/util/NetconfMessageTransformUtil.java
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPostOperationTest.java
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/URITest.java
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/XmlAndJsonToCnSnInstanceIdentifierTest.java
opendaylight/md-sal/sal-rest-docgen/pom.xml
opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/impl/StaticDocGenerator.java [new file with mode: 0644]
opendaylight/md-sal/sal-rest-docgen/src/main/resources/README.txt [new file with mode: 0644]
opendaylight/md-sal/sal-rest-docgen/src/main/resources/explorer/static/fonts.css [new file with mode: 0644]
opendaylight/md-sal/sal-rest-docgen/src/main/resources/explorer/static/index.html [new file with mode: 0644]
opendaylight/md-sal/sal-rest-docgen/src/main/resources/explorer/static/opendaylight.css [new file with mode: 0644]
opendaylight/md-sal/sal-rest-docgen/src/main/resources/explorer/static/swagger-ui.js [new file with mode: 0644]
opendaylight/md-sal/sal-rest-docgen/src/main/resources/explorer/static/swagger.js [new file with mode: 0644]
opendaylight/md-sal/samples/toaster-it/src/test/resources/controller.xml
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/DataBrokerTestCustomizer.java
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/MockSchemaService.java
opendaylight/md-sal/topology-manager/src/test/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporterTest.java
opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientDispatcherImpl.java
opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSession.java
opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiator.java
opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorFactory.java
opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/SimpleNetconfClientSessionListener.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientConfigurationTest.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientDispatcherImplTest.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorFactoryTest.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorTest.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientSessionTest.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfReconnectingClientConfigurationTest.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/SimpleNetconfClientSessionListenerTest.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/SshClientChannelInitializerTest.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/TcpClientChannelInitializerTest.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/TestingNetconfClient.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/CapabilityProviderImpl.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/DefaultCommitNotificationProducer.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSession.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionListener.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionListenerFactory.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/NetconfServerSessionNegotiatorFactory.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/SubtreeFilter.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/CapabilityProvider.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCloseSession.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommit.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultGetSchema.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStartExi.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStopExi.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfImplActivator.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfMonitoringServiceImpl.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationRouterImpl.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceFactoryListenerImpl.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfOperationServiceSnapshotImpl.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/util/DeserializerExceptionHandler.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/AdditionalHeaderParserTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ConcurrentClientsTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfDispatcherImplTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfMonitoringServiceImplTest.java
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/mapping/operations/DefaultCloseSessionTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultCommitTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultGetSchemaTest.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/mapping/operations/DefaultStopExiTest.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/java/org/opendaylight/controller/netconf/impl/util/DeserializerExceptionHandlerTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/AbstractNetconfConfigTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITMonitoringTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/SSLUtil.java
opendaylight/netconf/netconf-mapping-api/src/main/java/org/opendaylight/controller/netconf/mapping/api/Capability.java
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/Get.java
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/osgi/NetconfMonitoringActivator.java
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/osgi/NetconfMonitoringServiceTracker.java
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/xml/JaxBSerializer.java
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/xml/model/MonitoringSchema.java
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/xml/model/MonitoringSession.java
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/xml/model/NetconfState.java
opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/xml/model/package-info.java
opendaylight/netconf/netconf-monitoring/src/test/java/org/opendaylight/controller/netconf/monitoring/osgi/NetconfMonitoringActivatorTest.java
opendaylight/netconf/netconf-monitoring/src/test/java/org/opendaylight/controller/netconf/monitoring/osgi/NetconfMonitoringOperationServiceTest.java
opendaylight/netconf/netconf-monitoring/src/test/java/org/opendaylight/controller/netconf/monitoring/osgi/NetconfMonitoringServiceTrackerTest.java

index 036d18fb859adb534507efe6c789694ffd3c2cc4..6f43768a9dbb4a966ce35e37bcf3679cb308ef1e 100644 (file)
           </dependenciesToScan>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>2.8</version>
+        <executions>
+          <execution>
+            <id>unpack-static-documentation</id>
+            <goals>
+              <goal>unpack-dependencies</goal>
+            </goals>
+            <phase>generate-resources</phase>
+            <configuration>
+              <outputDirectory>${project.build.directory}/generated-resources/swagger-api-documentation</outputDirectory>
+              <includeArtifactIds>sal-rest-docgen</includeArtifactIds>
+              <includes>**/explorer/css/**/*, **/explorer/images/**/*, **/explorer/lib/**/*, **/explorer/static/**/*,</includes>
+              <excludeTransitive>true</excludeTransitive>
+              <ignorePermissions>false</ignorePermissions>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.opendaylight.yangtools</groupId>
+        <artifactId>yang-maven-plugin</artifactId>
+        <version>${yangtools.version}</version>
+        <dependencies>
+          <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>maven-sal-api-gen-plugin</artifactId>
+            <version>${yangtools.version}</version>
+            <type>jar</type>
+          </dependency>
+          <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-binding</artifactId>
+            <version>${yangtools.version}</version>
+            <type>jar</type>
+          </dependency>
+          <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-rest-docgen</artifactId>
+            <version>${mdsal.version}</version>
+            <type>jar</type>
+          </dependency>
+        </dependencies>
+        <executions>
+          <execution>
+            <goals>
+              <goal>generate-sources</goal>
+            </goals>
+            <configuration>
+              <yangFilesRootDir>src</yangFilesRootDir>
+              <codeGenerators>
+                <generator>
+                  <codeGeneratorClass>org.opendaylight.controller.sal.rest.doc.impl.StaticDocGenerator</codeGeneratorClass>
+                  <outputBaseDir>${project.build.directory}/generated-resources/swagger-api-documentation/explorer/static</outputBaseDir>
+                </generator>
+              </codeGenerators>
+              <inspectDependencies>true</inspectDependencies>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
   <scm>
index 07f18ff6abfaefb616371fe99d787b95e997f813..b68cc0cab21632944ac36093db70251abc7fa26f 100644 (file)
@@ -397,7 +397,7 @@ public class DijkstraImplementation implements IRouting, ITopologyManagerCluster
      * dependencies are satisfied
      *
      */
-    @SuppressWarnings({ "unchecked", "rawtypes" })
+    @SuppressWarnings("unchecked")
     public void init() {
         log.debug("Routing init() is called");
         this.topologyBWAware = new ConcurrentHashMap<Short, Graph<Node, Edge>>();
index f61094ab48c501beb2a8d77b55faf06217d44a0f..b2585adb04908ab7a3ba69419bb45374ff13ef1c 100644 (file)
@@ -71,7 +71,7 @@
     <config.configfile.directory>etc/opendaylight/karaf</config.configfile.directory>
     <config.clustering.configfile>05-clustering.xml</config.clustering.configfile>
     <config.netty.configfile>00-netty.xml</config.netty.configfile>
-    <config.mdsal.configfile>01-mdsal.xml</config.mdsal.configfile>
+    <config.mdsal.configfile>01-md-sal.xml</config.mdsal.configfile>
     <config.xsql.configfile>04-xsql.xml</config.xsql.configfile>
     <config.netconf.client.configfile>01-netconf.xml</config.netconf.client.configfile>
     <config.toaster.configfile>03-toaster-sample.xml</config.toaster.configfile>
index d81c48a6020b6854cc75603a0513a27f8c41da9b..5c9ed8767c38986587052ea5d588e3b079338979 100644 (file)
@@ -9,9 +9,7 @@ package org.opendaylight.controller.config.api;
 
 import java.util.List;
 import java.util.Set;
-
 import javax.management.ObjectName;
-
 import org.opendaylight.controller.config.api.jmx.CommitStatus;
 import org.opendaylight.controller.config.api.jmx.constants.ConfigRegistryConstants;
 
index 264751318c3570415f412a82b4df7d992853c451..8afc80a4f36971edbf1bd562e68dd684506ff7ad 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.controller.config.api;
 
 import java.util.Set;
-
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
 import javax.management.ObjectName;
index 48aa6ae64667f502a39cb636ae319ef7617db478..e1462b6b703d046a7c46f72611840220f514ed8e 100644 (file)
@@ -7,9 +7,8 @@
  */
 package org.opendaylight.controller.config.api;
 
-import org.opendaylight.yangtools.yang.binding.BaseIdentity;
-
 import java.beans.ConstructorProperties;
+import org.opendaylight.yangtools.yang.binding.BaseIdentity;
 
 public final class IdentityAttributeRef {
 
index 376ecdb52a2f7324a1c5a9d02e2c9dea3f871a80..b90fc9c034753f467cd41a927c8afa3dbdf493a3 100644 (file)
@@ -7,9 +7,9 @@
  */
 package org.opendaylight.controller.config.api;
 
+import java.util.Set;
 import javax.management.InstanceNotFoundException;
 import javax.management.ObjectName;
-import java.util.Set;
 
 public interface LookupRegistry {
 
index d7e94e8a7631d64a55eb43729cfc83d6bd823e6a..a364e54bff584363405b2b88337b65301a000add 100644 (file)
@@ -7,10 +7,10 @@
  */
 package org.opendaylight.controller.config.api;
 
-import javax.management.InstanceNotFoundException;
-import javax.management.ObjectName;
 import java.util.Map;
 import java.util.Set;
+import javax.management.InstanceNotFoundException;
+import javax.management.ObjectName;
 
 public interface ServiceReferenceReadableRegistry {
 
index 4f9ea7ac6b57521697f85ca7e4cde7930601ad1e..3b724e8ebe271a32aaca781144fc4fc5eba9fe35 100644 (file)
@@ -7,16 +7,16 @@
  */
 package org.opendaylight.controller.config.api.jmx;
 
-import javax.annotation.concurrent.Immutable;
-import javax.management.ObjectName;
 import java.beans.ConstructorProperties;
 import java.util.Collections;
 import java.util.List;
+import javax.annotation.concurrent.Immutable;
+import javax.management.ObjectName;
 
 @Immutable
 public class CommitStatus {
     private final List<ObjectName> newInstances, reusedInstances,
-            recreatedInstances;
+    recreatedInstances;
 
     /**
      * @param newInstances       newly created instances
index c23a0cbf69850f364113a93579e79d9dc952ae5c..ee23206eebf35fba353d82581f3513e5ffb7f808 100644 (file)
@@ -7,12 +7,6 @@
  */
 package org.opendaylight.controller.config.api.jmx;
 
-import org.opendaylight.controller.config.api.ModuleIdentifier;
-import org.opendaylight.controller.config.api.jmx.constants.ConfigRegistryConstants;
-
-import javax.annotation.concurrent.ThreadSafe;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -20,6 +14,11 @@ import java.util.Hashtable;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
+import javax.annotation.concurrent.ThreadSafe;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.config.api.jmx.constants.ConfigRegistryConstants;
 
 /**
  * Provides ObjectName creation. Each created ObjectName consists of domain that
index 1b16ec828432624b120228c4cacfd91479a0406e..b557108d4d00a39b988d7f82e5e4bb3bc41957b3 100644 (file)
@@ -7,11 +7,10 @@
  */
 package org.opendaylight.controller.config.spi;
 
+import javax.annotation.concurrent.NotThreadSafe;
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.yangtools.concepts.Identifiable;
 
-import javax.annotation.concurrent.NotThreadSafe;
-
 
 /**
  * Represents one service that is to be configured. These methods need to be
index c86b38149377733fdc59d3281f97a49d31dcd3d6..e28608a198f2ea6346397fa86f28b2cf833d5db6 100644 (file)
@@ -7,14 +7,13 @@
  */
 package org.opendaylight.controller.config.spi;
 
+import java.util.Set;
 import org.opendaylight.controller.config.api.DependencyResolver;
 import org.opendaylight.controller.config.api.DependencyResolverFactory;
 import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
 import org.opendaylight.controller.config.api.annotations.AbstractServiceInterface;
 import org.osgi.framework.BundleContext;
 
-import java.util.Set;
-
 /**
  * Factory which creates {@link Module instances. An instance of this interface
  * needs to be exported into the OSGi Service Registry. Such an instance
index 91e1f14849c03364f57f67b28eee5ff2d6017f8c..9cb64c5cc8987d85584f8ada4640edfe2406ad21 100644 (file)
@@ -4,6 +4,7 @@ import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
+
 import org.junit.Assert;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
index 39609a0e16d606171eff825fa57d7a75739d90a0..d82d8f99a0e850aa0f4386f1375af9c553e31e81 100644 (file)
@@ -1,11 +1,11 @@
 package org.opendaylight.controller.config.api;
 
-import org.junit.Test;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
 
+import org.junit.Test;
+
 public class JmxAttributeTest {
 
     @Test
index 9ff74052579f14f70be71d9df771d61fccd06eb4..313b225f986ed535c454fac757920f3745361d1c 100644 (file)
@@ -2,6 +2,7 @@ package org.opendaylight.controller.config.api;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertThat;
+
 import com.google.common.collect.Lists;
 import java.nio.file.AccessDeniedException;
 import java.util.ArrayList;
index 2771b407f46725461088d99e9e1a1d1c8dd7a82e..c37b61d997b789a2cf1924010cb5ccbde1a6edf0 100644 (file)
@@ -2,6 +2,7 @@ package org.opendaylight.controller.config.api;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
+
 import org.junit.Test;
 
 public class ModuleIdentifierTest {
index 8b4f2fe25875149bae70d0d80157961549939c80..bc9a8c71ba0f6605b19785b50dc89447825d2a31 100644 (file)
@@ -5,6 +5,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+
 import com.google.common.collect.Lists;
 import java.util.Map;
 import org.junit.Assert;
index e69ff921ccc4975994d8c542a738d84f33f96c34..ad1a53a5436b8572184275c473f47d7b1f11502b 100644 (file)
@@ -11,6 +11,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+
 import com.google.common.base.Throwables;
 import com.google.common.collect.Maps;
 import java.util.HashMap;
index 28732d8f68ea6e53832e954ff388681c608bc26b..c0447bfb32c3705d435a51f18e58617bb473f905 100644 (file)
@@ -10,9 +10,7 @@ package org.opendaylight.controller.config.manager.impl;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
-
 import javax.annotation.concurrent.Immutable;
-
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.manager.impl.dependencyresolver.DestroyedModule;
 import org.opendaylight.controller.config.manager.impl.dependencyresolver.ModuleInternalTransactionalInfo;
index 605223ae227cfa2b6e22e7861e63df325b17686b..93a6168ec2e9bc121118dc7274c8e9101b1ee5c0 100644 (file)
@@ -8,6 +8,24 @@
 package org.opendaylight.controller.config.manager.impl;
 
 import com.google.common.collect.Maps;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import javax.annotation.concurrent.GuardedBy;
+import javax.annotation.concurrent.NotThreadSafe;
+import javax.annotation.concurrent.ThreadSafe;
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
 import org.opendaylight.controller.config.api.ConflictingVersionException;
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.api.RuntimeBeanRegistratorAwareModule;
@@ -35,32 +53,13 @@ import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.annotation.concurrent.GuardedBy;
-import javax.annotation.concurrent.NotThreadSafe;
-import javax.annotation.concurrent.ThreadSafe;
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
 /**
  * Singleton that is responsible for creating and committing Config
  * Transactions. It is registered in Platform MBean Server.
  */
 @ThreadSafe
 public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBean {
-    private static final Logger LOGGER = LoggerFactory.getLogger(ConfigRegistryImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ConfigRegistryImpl.class);
 
     private final ModuleFactoriesResolver resolver;
     private final MBeanServer configMBeanServer;
@@ -166,7 +165,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
         for (ModuleInternalInfo moduleInternalInfo : currentConfig.getEntries()) {
             String name = moduleInternalInfo.getModuleFactory().getImplementationName();
             if (allCurrentFactories.containsKey(name) == false) {
-                LOGGER.trace("Factory {} not found in SR, using reference from previous commit", name);
+                LOG.trace("Factory {} not found in SR, using reference from previous commit", name);
                 allCurrentFactories.put(name,
                         Maps.immutableEntry(moduleInternalInfo.getModuleFactory(), moduleInternalInfo.getBundleContext()));
             }
@@ -202,7 +201,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
             throws ConflictingVersionException, ValidationException {
         final String transactionName = ObjectNameUtil
                 .getTransactionName(transactionControllerON);
-        LOGGER.trace("About to commit {}. Current parentVersion: {}, versionCounter {}", transactionName, version, versionCounter);
+        LOG.trace("About to commit {}. Current parentVersion: {}, versionCounter {}", transactionName, version, versionCounter);
 
         // find ConfigTransactionController
         Map<String, Entry<ConfigTransactionControllerInternal, ConfigTransactionLookupRegistry>> transactions = transactionsHolder.getCurrentTransactions();
@@ -230,7 +229,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
         } catch (Error | RuntimeException t) { // some libs throw Errors: e.g.
             // javax.xml.ws.spi.FactoryFinder$ConfigurationError
             isHealthy = false;
-            LOGGER.error("Configuration Transaction failed on 2PC, server is unhealthy", t);
+            LOG.error("Configuration Transaction failed on 2PC, server is unhealthy", t);
             if (t instanceof RuntimeException) {
                 throw (RuntimeException) t;
             } else {
@@ -292,7 +291,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
 
         int orderingIdx = 0;
         for (ModuleIdentifier moduleIdentifier : orderedModuleIdentifiers) {
-            LOGGER.trace("Registering {}", moduleIdentifier);
+            LOG.trace("Registering {}", moduleIdentifier);
             ModuleInternalTransactionalInfo entry = commitInfo.getCommitted()
                     .get(moduleIdentifier);
             if (entry == null) {
@@ -427,7 +426,7 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
                 configTransactionControllerEntry.getValue().close();
                 configTransactionController.abortConfig();
             } catch (RuntimeException e) {
-                LOGGER.warn("Ignoring exception while aborting {}",
+                LOG.warn("Ignoring exception while aborting {}",
                         configTransactionController, e);
             }
         }
index a58f7a05c65ae9a1f31a407e53c6f54d028e3200..bb61c4acc70aa6506b6d3093748a519d5fa036be 100644 (file)
@@ -53,7 +53,7 @@ class ConfigTransactionControllerImpl implements
         ConfigTransactionControllerInternal,
         ConfigTransactionControllerImplMXBean,
         Identifiable<TransactionIdentifier> {
-    private static final Logger LOGGER = LoggerFactory.getLogger(ConfigTransactionControllerImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ConfigTransactionControllerImpl.class);
 
     private final ConfigTransactionLookupRegistry txLookupRegistry;
     private final ObjectName controllerON;
@@ -226,7 +226,7 @@ class ConfigTransactionControllerImpl implements
             boolean isDefaultBean, BundleContext bundleContext)
             throws InstanceAlreadyExistsException {
 
-        LOGGER.debug("Adding module {} to transaction {}", moduleIdentifier, this);
+        LOG.debug("Adding module {} to transaction {}", moduleIdentifier, this);
         if (moduleIdentifier.equals(module.getIdentifier()) == false) {
             throw new IllegalStateException("Incorrect name reported by module. Expected "
                     + moduleIdentifier + ", got " + module.getIdentifier());
@@ -271,13 +271,13 @@ class ConfigTransactionControllerImpl implements
     }
 
     private synchronized void destroyModule(ModuleIdentifier moduleIdentifier) {
-        LOGGER.debug("Destroying module {} in transaction {}", moduleIdentifier, this);
+        LOG.debug("Destroying module {} in transaction {}", moduleIdentifier, this);
         transactionStatus.checkNotAborted();
 
         ModuleInternalTransactionalInfo found = dependencyResolverManager.findModuleInternalTransactionalInfo(moduleIdentifier);
         if (blankTransaction == false &&
                 found.isDefaultBean()) {
-            LOGGER.warn("Warning: removing default bean. This will be forbidden in next version of config-subsystem");
+            LOG.warn("Warning: removing default bean. This will be forbidden in next version of config-subsystem");
         }
         // first remove refNames, it checks for objectname existence
 
@@ -285,7 +285,7 @@ class ConfigTransactionControllerImpl implements
             writableSRRegistry.removeServiceReferences(
                     ObjectNameUtil.createTransactionModuleON(getTransactionName(), moduleIdentifier));
         } catch (InstanceNotFoundException e) {
-            LOGGER.error("Possible code error: cannot find {} in {}", moduleIdentifier, writableSRRegistry);
+            LOG.error("Possible code error: cannot find {} in {}", moduleIdentifier, writableSRRegistry);
             throw new IllegalStateException("Possible code error: cannot find " + moduleIdentifier, e);
         }
 
@@ -319,7 +319,7 @@ class ConfigTransactionControllerImpl implements
 
     private void validateNoLocks() throws ValidationException {
         transactionStatus.checkNotAborted();
-        LOGGER.trace("Validating transaction {}", getTransactionIdentifier());
+        LOG.trace("Validating transaction {}", getTransactionIdentifier());
         // call validate()
         List<ValidationException> collectedExceptions = new ArrayList<>();
         for (Entry<ModuleIdentifier, Module> entry : dependencyResolverManager
@@ -329,7 +329,7 @@ class ConfigTransactionControllerImpl implements
             try {
                 module.validate();
             } catch (Exception e) {
-                LOGGER.warn("Validation exception in {}", getTransactionName(),
+                LOG.warn("Validation exception in {}", getTransactionName(),
                         e);
                 collectedExceptions.add(ValidationException
                         .createForSingleException(name, e));
@@ -339,7 +339,7 @@ class ConfigTransactionControllerImpl implements
             throw ValidationException
                     .createFromCollectedValidationExceptions(collectedExceptions);
         }
-        LOGGER.trace("Validated transaction {}", getTransactionIdentifier());
+        LOG.trace("Validated transaction {}", getTransactionIdentifier());
     }
 
     /**
@@ -358,7 +358,7 @@ class ConfigTransactionControllerImpl implements
         try {
             validateNoLocks();
         } catch (ValidationException e) {
-            LOGGER.trace("Commit failed on validation");
+            LOG.trace("Commit failed on validation");
             configBeanModificationDisabled.set(false); // recoverable error
             throw e;
         }
@@ -381,7 +381,7 @@ class ConfigTransactionControllerImpl implements
                             + "to obtain a lock");
         }
 
-        LOGGER.trace("Committing transaction {}", getTransactionIdentifier());
+        LOG.trace("Committing transaction {}", getTransactionIdentifier());
 
         // call getInstance()
         for (Entry<ModuleIdentifier, Module> entry : dependencyResolverManager
@@ -389,12 +389,12 @@ class ConfigTransactionControllerImpl implements
             Module module = entry.getValue();
             ModuleIdentifier name = entry.getKey();
             try {
-                LOGGER.debug("About to commit {} in transaction {}",
+                LOG.debug("About to commit {} in transaction {}",
                         name, getTransactionIdentifier());
                 AutoCloseable instance = module.getInstance();
                 checkNotNull(instance, "Instance is null:{} in transaction {}", name, getTransactionIdentifier());
             } catch (Exception e) {
-                LOGGER.error("Commit failed on {} in transaction {}", name,
+                LOG.error("Commit failed on {} in transaction {}", name,
                         getTransactionIdentifier(), e);
                 internalAbort();
                 throw new IllegalStateException(
@@ -405,7 +405,7 @@ class ConfigTransactionControllerImpl implements
 
         // count dependency order
 
-        LOGGER.trace("Committed configuration {}", getTransactionIdentifier());
+        LOG.trace("Committed configuration {}", getTransactionIdentifier());
         transactionStatus.setCommitted();
 
         return dependencyResolverManager.getSortedModuleIdentifiers();
@@ -419,7 +419,7 @@ class ConfigTransactionControllerImpl implements
     }
 
     private void internalAbort() {
-        LOGGER.trace("Aborting {}", this);
+        LOG.trace("Aborting {}", this);
         transactionStatus.setAborted();
         close();
     }
index c9df3409db46366acbae22d44166e05202e844fc..30183ebff30547a3b2f164aa9cb0df476b4f9a40 100644 (file)
@@ -7,15 +7,14 @@
  */
 package org.opendaylight.controller.config.manager.impl;
 
+import java.util.Collection;
+import java.util.List;
+import javax.management.ObjectName;
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.api.ValidationException;
 import org.opendaylight.controller.config.spi.ModuleFactory;
 import org.osgi.framework.BundleContext;
 
-import javax.management.ObjectName;
-import java.util.Collection;
-import java.util.List;
-
 /**
  * Defines contract between {@link ConfigTransactionControllerImpl} (producer)
  * and {@link ConfigRegistryImpl} (consumer).
index a7d426ebdd78aa9d940b818f6f57ec8e58cd119c..f9a3801171a0064a2c43b28f297e66adfabf7498 100644 (file)
@@ -7,6 +7,13 @@
  */
 package org.opendaylight.controller.config.manager.impl;
 
+import java.io.Closeable;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.InstanceNotFoundException;
+import javax.management.ObjectName;
 import org.opendaylight.controller.config.api.LookupRegistry;
 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
 import org.opendaylight.controller.config.manager.impl.jmx.TransactionJMXRegistrator;
@@ -16,14 +23,6 @@ import org.opendaylight.controller.config.manager.impl.util.ModuleQNameUtil;
 import org.opendaylight.controller.config.spi.ModuleFactory;
 import org.osgi.framework.BundleContext;
 
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.InstanceNotFoundException;
-import javax.management.ObjectName;
-import java.io.Closeable;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
 /**
  * Responsible for creating TransactionJMXRegistrator, registering transaction and all its beans,
  * lookup of beans, closing of TransactionJMXRegistrator.
index b59b48e5a98eafb05d92622e1b1d9363c81f91a0..f25dce89e8f536e84e979b9aaee6887d28236a1d 100644 (file)
@@ -1,17 +1,16 @@
 package org.opendaylight.controller.config.manager.impl;
 
-import org.opendaylight.controller.config.api.ModuleIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.annotation.Nullable;
-import javax.annotation.concurrent.GuardedBy;
 import java.util.Deque;
 import java.util.LinkedList;
 import java.util.concurrent.TimeUnit;
+import javax.annotation.Nullable;
+import javax.annotation.concurrent.GuardedBy;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class DeadlockMonitor implements AutoCloseable {
-    private static final Logger LOGGER = LoggerFactory.getLogger(DeadlockMonitorRunnable.class);
+    private static final Logger LOG = LoggerFactory.getLogger(DeadlockMonitor.class);
 
     private static final long WARN_AFTER_MILLIS = 5000;
 
@@ -43,7 +42,7 @@ public class DeadlockMonitor implements AutoCloseable {
             moduleIdentifierWithNanosStack.push(current);
             top = current;
         }
-        LOGGER.trace("setCurrentlyInstantiatedModule {}, top {}", currentlyInstantiatedModule, top);
+        LOG.trace("setCurrentlyInstantiatedModule {}, top {}", currentlyInstantiatedModule, top);
     }
 
     public boolean isAlive() {
@@ -78,7 +77,7 @@ public class DeadlockMonitor implements AutoCloseable {
                     // is the getInstance() running longer than WARN_AFTER_MILLIS ?
                     long runningTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - copy.nanoTime);
                     if (runningTime > WARN_AFTER_MILLIS) {
-                        LOGGER.warn("{} did not finish after {} ms", copy.moduleIdentifier, runningTime);
+                        LOG.warn("{} did not finish after {} ms", copy.moduleIdentifier, runningTime);
                     }
                 }
                 try {
@@ -87,7 +86,7 @@ public class DeadlockMonitor implements AutoCloseable {
                     interrupt();
                 }
             }
-            LOGGER.trace("Exiting {}", this);
+            LOG.trace("Exiting {}", this);
         }
 
         @Override
index 76299e67a287fc922dbd034bddeeecd8df361602..abef4d2fc4a775a26e920932c9e5f7e96622c11a 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.controller.config.manager.impl;
 
 import javax.annotation.Nullable;
-
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.manager.impl.dependencyresolver.DestroyedModule;
 import org.opendaylight.controller.config.manager.impl.dynamicmbean.DynamicReadableWrapper;
index 0dff41402ebd747bb69c3805d216a1e5f7e45b8e..27f0d5c1f287b60ab49eb679b8657a1f5b56c746 100644 (file)
@@ -8,6 +8,7 @@
 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;
@@ -39,7 +40,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceReadableRegistry, SearchableServiceReferenceWritableRegistry {
-    private static final Logger LOGGER = LoggerFactory.getLogger(ServiceReferenceRegistryImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ServiceReferenceRegistryImpl.class);
 
     private final Map<String, ModuleFactory> factories;
     private final Map<String, Set<String>> factoryNamesToQNames;
@@ -177,7 +178,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
                 boolean skipChecks = true;
                 newRegistry.saveServiceReference(refNameEntry.getKey(), currentImplementation, skipChecks);
             } catch (InstanceNotFoundException e) {
-                LOGGER.error("Cannot save service reference({}, {})", refNameEntry.getKey(), currentImplementation);
+                LOG.error("Cannot save service reference({}, {})", refNameEntry.getKey(), currentImplementation);
                 throw new IllegalStateException("Possible code error", e);
             }
         }
@@ -207,7 +208,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
 
         for (Entry<String, ModuleFactory> entry : factories.entrySet()) {
             if (entry.getKey().equals(entry.getValue().getImplementationName()) == false) {
-                LOGGER.error("Possible error in code: Mismatch between supplied and actual name of {}", entry);
+                LOG.error("Possible error in code: Mismatch between supplied and actual name of {}", entry);
                 throw new IllegalArgumentException("Possible error in code: Mismatch between supplied and actual name of " + entry);
             }
             Set<ServiceInterfaceAnnotation> siAnnotations = InterfacesHelper.getServiceInterfaceAnnotations(entry.getValue());
@@ -229,7 +230,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
                 modifiableNamespacesToAnnotations.put(sia.namespace(), ofNamespace);
             }
             if (ofNamespace.containsKey(sia.localName())) {
-                LOGGER.error("Cannot construct namespacesToAnnotations map, conflict between local names in {}, offending local name: {}, map so far {}",
+                LOG.error("Cannot construct namespacesToAnnotations map, conflict between local names in {}, offending local name: {}, map so far {}",
                         sia.namespace(), sia.localName(), modifiableNamespacesToAnnotations);
                 throw new IllegalArgumentException("Conflict between local names in " + sia.namespace() + " : " + sia.localName());
             }
@@ -238,7 +239,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
         }
         this.namespacesToAnnotations = ImmutableMap.copyOf(modifiableNamespacesToAnnotations);
         this.serviceQNamesToAnnotations = ImmutableMap.copyOf(modifiableServiceQNamesToAnnotations);
-        LOGGER.trace("factoryNamesToQNames:{}", this.factoryNamesToQNames);
+        LOG.trace("factoryNamesToQNames:{}", this.factoryNamesToQNames);
     }
 
     @Override
@@ -257,7 +258,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
         String factoryName = ObjectNameUtil.getFactoryName(objectName);
         Set<String> serviceInterfaceAnnotations = factoryNamesToQNames.get(factoryName);
         if (serviceInterfaceAnnotations == null) {
-            LOGGER.error("Possible error in code: cannot find factory annotations of '{}' extracted from ON {} in {}",
+            LOG.error("Possible error in code: cannot find factory annotations of '{}' extracted from ON {} in {}",
                     factoryName, objectName, factoryNamesToQNames);
             throw new IllegalArgumentException("Cannot find factory with name " + factoryName);
         }
@@ -268,12 +269,12 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
     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);
+            LOG.error("Cannot find namespace {} in {}", namespace, namespacesToAnnotations);
             throw new IllegalArgumentException("Cannot find namespace " + namespace);
         }
         ServiceInterfaceAnnotation sia = ofNamespace.get(localName);
         if (sia == null) {
-            LOGGER.error("Cannot find local name {} in namespace {}, found only {}", localName, namespace, ofNamespace);
+            LOG.error("Cannot find local name {} in namespace {}, found only {}", localName, namespace, ofNamespace);
             throw new IllegalArgumentException("Cannot find local name " + localName + " in namespace " + namespace);
         }
         return sia.value();
@@ -301,7 +302,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
         try {
             on = lookupRegistry.lookupConfigBean(moduleIdentifier.getFactoryName(), moduleIdentifier.getInstanceName());
         } catch (InstanceNotFoundException e) {
-            LOGGER.error("Cannot find instance {}", moduleIdentifier);
+            LOG.error("Cannot find instance {}", moduleIdentifier);
             throw new IllegalStateException("Cannot find instance " + moduleIdentifier, e);
         }
         return on;
@@ -312,7 +313,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
         ServiceReference serviceReference = new ServiceReference(serviceInterfaceQName, refName);
         ModuleIdentifier moduleIdentifier = refNames.get(serviceReference);
         if (moduleIdentifier == null) {
-            LOGGER.error("Cannot find qname {} and refName {} in {}", serviceInterfaceQName, refName, refName);
+            LOG.error("Cannot find qname {} and refName {} in {}", serviceInterfaceQName, refName, refName);
             throw new IllegalArgumentException("Cannot find " + serviceReference);
         }
         return getObjectName(moduleIdentifier);
@@ -323,7 +324,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
         Map<String, Map<String, ObjectName>> serviceMapping = getServiceMapping();
         Map<String, ObjectName> innerMap = serviceMapping.get(serviceInterfaceQName);
         if (innerMap == null) {
-            LOGGER.error("Cannot find qname {} in {}", serviceInterfaceQName, refNames);
+            LOG.error("Cannot find qname {} in {}", serviceInterfaceQName, refNames);
             throw new IllegalArgumentException("Cannot find " + serviceInterfaceQName);
         }
         return innerMap;
@@ -349,7 +350,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
         String referenceName = ObjectNameUtil.getReferenceName(objectName);
         ServiceReference serviceReference = new ServiceReference(serviceQName, referenceName);
         if (refNames.containsKey(serviceReference) == false) {
-            LOGGER.warn("Cannot find {} in {}", serviceReference, refNames);
+            LOG.warn("Cannot find {} in {}", serviceReference, refNames);
             throw new InstanceNotFoundException("Service reference not found:" + objectName);
         }
     }
@@ -388,13 +389,13 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
         // check that service interface name exist
         Set<String> serviceInterfaceQNames = factoryNamesToQNames.get(moduleIdentifier.getFactoryName());
         if (serviceInterfaceQNames == null) {
-            LOGGER.error("Possible error in code: cannot find factoryName {} in {}, {}", moduleIdentifier.getFactoryName(),
+            LOG.error("Possible error in code: cannot find factoryName {} in {}, {}", moduleIdentifier.getFactoryName(),
                     factoryNamesToQNames, moduleIdentifier);
             throw new IllegalStateException("Possible error in code: cannot find annotations of existing factory " + moduleIdentifier.getFactoryName());
         }
         // supplied serviceInterfaceName must exist in this collection
         if (serviceInterfaceQNames.contains(serviceReference.getServiceInterfaceQName()) == false) {
-            LOGGER.error("Cannot find qName {} with factory name {}, found {}", serviceReference.getServiceInterfaceQName(), moduleIdentifier.getFactoryName(), serviceInterfaceQNames);
+            LOG.error("Cannot find qName {} with factory name {}, found {}", serviceReference.getServiceInterfaceQName(), moduleIdentifier.getFactoryName(), serviceInterfaceQNames);
             throw new IllegalArgumentException("Cannot find service interface " + serviceReference.getServiceInterfaceQName() + " within factory " + moduleIdentifier.getFactoryName());
         }
 
@@ -466,11 +467,11 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
     }
 
     private synchronized void removeServiceReference(final ServiceReference serviceReference) throws InstanceNotFoundException {
-        LOGGER.debug("Removing service reference {} from {}", serviceReference, this);
+        LOG.debug("Removing service reference {} from {}", serviceReference, this);
         assertWritable();
         // is the qName known?
         if (allQNames.contains(serviceReference.getServiceInterfaceQName()) == false) {
-            LOGGER.error("Cannot find qname {} in {}", serviceReference.getServiceInterfaceQName(), allQNames);
+            LOG.error("Cannot find qname {} in {}", serviceReference.getServiceInterfaceQName(), allQNames);
             throw new IllegalArgumentException("Cannot find service interface " + serviceReference.getServiceInterfaceQName());
         }
         ModuleIdentifier removed = refNames.remove(serviceReference);
@@ -519,7 +520,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
     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);
+            LOG.warn("Possible error in code: cannot find factoryName {} in {}, object name {}", factoryName, factoryNamesToQNames, moduleObjectName);
             throw new IllegalStateException("Possible error in code: cannot find annotations of existing factory " + factoryName);
         }
         String instanceName = ObjectNameUtil.getInstanceName(moduleObjectName);
index a7a67d3d16c734267fd123472880dc598e5f0b28..0741dab69d8c783459baf12530bcf6153a6a2632 100644 (file)
@@ -45,7 +45,7 @@ import org.slf4j.LoggerFactory;
  */
 final class DependencyResolverImpl implements DependencyResolver,
         Comparable<DependencyResolverImpl> {
-    private static final Logger LOGGER = LoggerFactory.getLogger(DependencyResolverImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(DependencyResolverImpl.class);
 
     private final ModulesHolder modulesHolder;
     private final ModuleIdentifier name;
@@ -104,7 +104,7 @@ final class DependencyResolverImpl implements DependencyResolver,
                 format("ObjectName should not contain "
                                 + "transaction name. %s set to %s. ", jmxAttribute,
                         dependentReadOnlyON
-                ), jmxAttribute
+            ), jmxAttribute
         );
 
         ObjectName newDependentReadOnlyON = translateServiceRefIfPossible(dependentReadOnlyON);
@@ -200,7 +200,7 @@ final class DependencyResolverImpl implements DependencyResolver,
         if (expectedBaseClass.isAssignableFrom(deserialized)) {
             return (Class<T>) deserialized;
         } else {
-            LOGGER.error("Cannot resolve class of identity {} : deserialized class {} is not a subclass of {}.",
+            LOG.error("Cannot resolve class of identity {} : deserialized class {} is not a subclass of {}.",
                     identityRef, deserialized, expectedBaseClass);
             throw new IllegalArgumentException("Deserialized identity " + deserialized + " cannot be cast to " + expectedBaseClass);
         }
index 15f5d48a6f51f43decd567129ce5d0854cc9ddcb..da6349ac5386c75ef17a8120a8c5a10b16726367 100644 (file)
@@ -8,7 +8,7 @@
 package org.opendaylight.controller.config.manager.impl.dependencyresolver;
 
 import static com.google.common.base.Preconditions.checkState;
-
+import com.google.common.base.Preconditions;
 import com.google.common.reflect.AbstractInvocationHandler;
 import com.google.common.reflect.Reflection;
 import java.lang.reflect.InvocationTargetException;
@@ -54,10 +54,10 @@ public class DependencyResolverManager implements DependencyResolverFactory, Aut
     private final DeadlockMonitor deadlockMonitor;
     private final MBeanServer mBeanServer;
 
-    public DependencyResolverManager(TransactionIdentifier transactionIdentifier,
-                                     TransactionStatus transactionStatus,
-                                     ServiceReferenceReadableRegistry readableRegistry, CodecRegistry codecRegistry,
-                                     MBeanServer mBeanServer) {
+    public DependencyResolverManager(final TransactionIdentifier transactionIdentifier,
+                                     final TransactionStatus transactionStatus,
+                                     final ServiceReferenceReadableRegistry readableRegistry, final CodecRegistry codecRegistry,
+                                     final MBeanServer mBeanServer) {
         this.transactionIdentifier = transactionIdentifier;
         this.modulesHolder = new ModulesHolder(transactionIdentifier);
         this.transactionStatus = transactionStatus;
@@ -68,11 +68,11 @@ public class DependencyResolverManager implements DependencyResolverFactory, Aut
     }
 
     @Override
-    public DependencyResolver createDependencyResolver(ModuleIdentifier moduleIdentifier) {
+    public DependencyResolver createDependencyResolver(final ModuleIdentifier moduleIdentifier) {
         return getOrCreate(moduleIdentifier);
     }
 
-    public synchronized DependencyResolverImpl getOrCreate(ModuleIdentifier name) {
+    public synchronized DependencyResolverImpl getOrCreate(final ModuleIdentifier name) {
         DependencyResolverImpl dependencyResolver = moduleIdentifiersToDependencyResolverMap.get(name);
         if (dependencyResolver == null) {
             transactionStatus.checkNotCommitted();
@@ -109,7 +109,7 @@ public class DependencyResolverManager implements DependencyResolverFactory, Aut
     }
 
     public ModuleInternalTransactionalInfo destroyModule(
-            ModuleIdentifier moduleIdentifier) {
+            final ModuleIdentifier moduleIdentifier) {
         transactionStatus.checkNotCommitted();
         ModuleInternalTransactionalInfo found = modulesHolder
                 .destroyModule(moduleIdentifier);
@@ -119,52 +119,62 @@ public class DependencyResolverManager implements DependencyResolverFactory, Aut
 
     // protect write access
 
+    private static final class ModuleInvocationHandler extends AbstractInvocationHandler {
+        private final DeadlockMonitor deadlockMonitor;
+        private final ModuleIdentifier moduleIdentifier;
+        private final Module module;
+
+        // optimization: subsequent calls to getInstance MUST return the same value during transaction,
+        // so it is safe to cache the response
+        private Object cachedInstance;
+
+        ModuleInvocationHandler(final DeadlockMonitor deadlockMonitor, final ModuleIdentifier moduleIdentifier, final Module module) {
+            this.deadlockMonitor = Preconditions.checkNotNull(deadlockMonitor);
+            this.moduleIdentifier = Preconditions.checkNotNull(moduleIdentifier);
+            this.module = Preconditions.checkNotNull(module);
+        }
+
+        @Override
+        protected Object handleInvocation(final Object proxy, final Method method, final Object[] args) throws Throwable {
+            boolean isGetInstance = "getInstance".equals(method.getName());
+            if (isGetInstance) {
+                if (cachedInstance != null) {
+                    return cachedInstance;
+                }
+
+                checkState(deadlockMonitor.isAlive(), "Deadlock monitor is not alive");
+                deadlockMonitor.setCurrentlyInstantiatedModule(moduleIdentifier);
+            }
+            try {
+                Object response = method.invoke(module, args);
+                if (isGetInstance) {
+                    cachedInstance = response;
+                }
+                return response;
+            } catch(InvocationTargetException e) {
+                throw e.getCause();
+            } finally {
+                if (isGetInstance) {
+                    deadlockMonitor.setCurrentlyInstantiatedModule(null);
+                }
+            }
+        }
+    }
+
     public void put(
             final ModuleIdentifier moduleIdentifier,
             final Module module,
-            ModuleFactory moduleFactory,
-            ModuleInternalInfo maybeOldInternalInfo,
-            TransactionModuleJMXRegistration transactionModuleJMXRegistration,
-            boolean isDefaultBean, BundleContext bundleContext) {
+            final ModuleFactory moduleFactory,
+            final ModuleInternalInfo maybeOldInternalInfo,
+            final TransactionModuleJMXRegistration transactionModuleJMXRegistration,
+            final boolean isDefaultBean, final BundleContext bundleContext) {
         transactionStatus.checkNotCommitted();
 
         Class<? extends Module> moduleClass = Module.class;
         if (module instanceof RuntimeBeanRegistratorAwareModule) {
             moduleClass = RuntimeBeanRegistratorAwareModule.class;
         }
-        Module proxiedModule = Reflection.newProxy(moduleClass, new AbstractInvocationHandler() {
-            // optimization: subsequent calls to getInstance MUST return the same value during transaction,
-            // so it is safe to cache the response
-            private Object cachedInstance;
-
-            @Override
-            protected Object handleInvocation(Object proxy, Method method, Object[] args) throws Throwable {
-                boolean isGetInstance = "getInstance".equals(method.getName());
-                if (isGetInstance) {
-                    if (cachedInstance != null) {
-                        return cachedInstance;
-                    }
-
-                    checkState(deadlockMonitor.isAlive(), "Deadlock monitor is not alive");
-                    deadlockMonitor.setCurrentlyInstantiatedModule(moduleIdentifier);
-                }
-                try {
-                    Object response = method.invoke(module, args);
-                    if (isGetInstance) {
-                        cachedInstance = response;
-                    }
-                    return response;
-                } catch(InvocationTargetException e) {
-                    throw e.getCause();
-                } finally {
-                    if (isGetInstance) {
-                        deadlockMonitor.setCurrentlyInstantiatedModule(null);
-                    }
-                }
-            }
-        });
-
-
+        Module proxiedModule = Reflection.newProxy(moduleClass, new ModuleInvocationHandler(deadlockMonitor, moduleIdentifier, module));
         ModuleInternalTransactionalInfo moduleInternalTransactionalInfo = new ModuleInternalTransactionalInfo(
                 moduleIdentifier, proxiedModule, moduleFactory,
                 maybeOldInternalInfo, transactionModuleJMXRegistration, isDefaultBean, module, bundleContext);
@@ -177,18 +187,18 @@ public class DependencyResolverManager implements DependencyResolverFactory, Aut
         return modulesHolder.toCommitInfo();
     }
 
-    public Module findModule(ModuleIdentifier moduleIdentifier,
-                             JmxAttribute jmxAttributeForReporting) {
+    public Module findModule(final ModuleIdentifier moduleIdentifier,
+                             final JmxAttribute jmxAttributeForReporting) {
         return modulesHolder.findModule(moduleIdentifier,
                 jmxAttributeForReporting);
     }
 
-    public ModuleInternalTransactionalInfo findModuleInternalTransactionalInfo(ModuleIdentifier moduleIdentifier) {
+    public ModuleInternalTransactionalInfo findModuleInternalTransactionalInfo(final ModuleIdentifier moduleIdentifier) {
         return modulesHolder.findModuleInternalTransactionalInfo(moduleIdentifier);
     }
 
-    public ModuleFactory findModuleFactory(ModuleIdentifier moduleIdentifier,
-                                           JmxAttribute jmxAttributeForReporting) {
+    public ModuleFactory findModuleFactory(final ModuleIdentifier moduleIdentifier,
+                                           final JmxAttribute jmxAttributeForReporting) {
         return modulesHolder.findModuleFactory(moduleIdentifier,
                 jmxAttributeForReporting);
     }
@@ -197,12 +207,12 @@ public class DependencyResolverManager implements DependencyResolverFactory, Aut
         return modulesHolder.getAllModules();
     }
 
-    public void assertNotExists(ModuleIdentifier moduleIdentifier)
+    public void assertNotExists(final ModuleIdentifier moduleIdentifier)
             throws InstanceAlreadyExistsException {
         modulesHolder.assertNotExists(moduleIdentifier);
     }
 
-    public List<ModuleIdentifier> findAllByFactory(ModuleFactory factory) {
+    public List<ModuleIdentifier> findAllByFactory(final ModuleFactory factory) {
         List<ModuleIdentifier> result = new ArrayList<>();
         for (ModuleInternalTransactionalInfo info : modulesHolder.getAllInfos()) {
             if (factory.equals(info.getModuleFactory())) {
@@ -212,6 +222,7 @@ public class DependencyResolverManager implements DependencyResolverFactory, Aut
         return result;
     }
 
+    @Override
     public void close() {
         deadlockMonitor.close();
     }
index ec2418bc6c902749ba72896aeb3924e62dac381e..05c10077c46f07e25b36a2811b836c1725a1493b 100644 (file)
@@ -22,7 +22,7 @@ import org.slf4j.LoggerFactory;
  */
 public class DestroyedModule implements AutoCloseable,
         Comparable<DestroyedModule>, Identifiable<ModuleIdentifier> {
-    private static final Logger LOGGER = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(DestroyedModule.class);
 
     private final ModuleIdentifier identifier;
@@ -43,21 +43,21 @@ public class DestroyedModule implements AutoCloseable,
 
     @Override
     public void close() {
-        LOGGER.trace("Destroying {}", identifier);
+        LOG.trace("Destroying {}", identifier);
         try {
             instance.close();
         } catch (Exception e) {
-            LOGGER.error("Error while closing instance of {}", identifier, e);
+            LOG.error("Error while closing instance of {}", identifier, e);
         }
         try {
             oldJMXRegistrator.close();
         } catch (Exception e) {
-            LOGGER.error("Error while closing jmx registrator of {}", identifier, e);
+            LOG.error("Error while closing jmx registrator of {}", identifier, e);
         }
         try {
             osgiRegistration.close();
         } catch (Exception e) {
-            LOGGER.error("Error while closing osgi registration of {}", identifier, e);
+            LOG.error("Error while closing osgi registration of {}", identifier, e);
         }
     }
 
index 13424a60eb016cd1bfc1fb892d3c72da36cf8f35..26d8c74fb3384858446ca3e5f4ee147f34e212b2 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.controller.config.manager.impl.dependencyresolver;
 
+import javax.annotation.Nullable;
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.manager.impl.ModuleInternalInfo;
 import org.opendaylight.controller.config.manager.impl.dynamicmbean.DynamicReadableWrapper;
@@ -14,8 +15,6 @@ import org.opendaylight.controller.config.manager.impl.jmx.TransactionModuleJMXR
 import org.opendaylight.controller.config.spi.Module;
 import org.opendaylight.controller.config.spi.ModuleFactory;
 import org.opendaylight.yangtools.concepts.Identifiable;
-
-import javax.annotation.Nullable;
 import org.osgi.framework.BundleContext;
 
 public class ModuleInternalTransactionalInfo implements Identifiable<ModuleIdentifier> {
index 81cc34ac970f8540943b12cf1d45549329b95e46..1c5cd47c50455718f10042b9a66e670070c50d16 100644 (file)
@@ -7,16 +7,6 @@
  */
 package org.opendaylight.controller.config.manager.impl.dependencyresolver;
 
-import org.opendaylight.controller.config.api.JmxAttribute;
-import org.opendaylight.controller.config.api.JmxAttributeValidationException;
-import org.opendaylight.controller.config.api.ModuleIdentifier;
-import org.opendaylight.controller.config.manager.impl.CommitInfo;
-import org.opendaylight.controller.config.manager.impl.TransactionIdentifier;
-import org.opendaylight.controller.config.spi.Module;
-import org.opendaylight.controller.config.spi.ModuleFactory;
-
-import javax.annotation.concurrent.GuardedBy;
-import javax.management.InstanceAlreadyExistsException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -25,6 +15,15 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import javax.annotation.concurrent.GuardedBy;
+import javax.management.InstanceAlreadyExistsException;
+import org.opendaylight.controller.config.api.JmxAttribute;
+import org.opendaylight.controller.config.api.JmxAttributeValidationException;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.config.manager.impl.CommitInfo;
+import org.opendaylight.controller.config.manager.impl.TransactionIdentifier;
+import org.opendaylight.controller.config.spi.Module;
+import org.opendaylight.controller.config.spi.ModuleFactory;
 
 /**
  * Represents modules to be committed.
index 4a148669b16eaabaf076d41f7f89e56e6169786c..d868f7c3321dd8ee9b0c28697d2c0c8b43c60fd5 100644 (file)
@@ -7,15 +7,17 @@
  */
 package org.opendaylight.controller.config.manager.impl.dynamicmbean;
 
-import org.opendaylight.controller.config.api.ModuleIdentifier;
-import org.opendaylight.controller.config.api.annotations.Description;
-import org.opendaylight.controller.config.api.annotations.RequireInterface;
-import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
-import org.opendaylight.controller.config.manager.impl.util.InterfacesHelper;
-import org.opendaylight.controller.config.spi.Module;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import static java.lang.String.format;
 
+import java.lang.reflect.Array;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import javax.management.Attribute;
 import javax.management.AttributeList;
 import javax.management.AttributeNotFoundException;
@@ -38,15 +40,14 @@ import javax.management.Notification;
 import javax.management.NotificationListener;
 import javax.management.ObjectName;
 import javax.management.ReflectionException;
-import java.lang.reflect.Array;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.config.api.annotations.Description;
+import org.opendaylight.controller.config.api.annotations.RequireInterface;
+import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
+import org.opendaylight.controller.config.manager.impl.util.InterfacesHelper;
+import org.opendaylight.controller.config.spi.Module;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import static java.lang.String.format;
 
@@ -57,9 +58,42 @@ import static java.lang.String.format;
  * a read only wrapper.
  */
 abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
-    private static final Logger LOGGER = LoggerFactory
-            .getLogger(AbstractDynamicWrapper.class);
+    private static final class ModuleNotificationListener implements NotificationListener {
+        private final ObjectName objectNameInternal;
+        private final MBeanServer internalServer;
+        private final ObjectName thisWrapperObjectName;
+        private final MBeanServer configMBeanServer;
+
+        private ModuleNotificationListener(final ObjectName objectNameInternal, final MBeanServer internalServer,
+                final ObjectName thisWrapperObjectName, final MBeanServer configMBeanServer) {
+            this.objectNameInternal = objectNameInternal;
+            this.internalServer = internalServer;
+            this.thisWrapperObjectName = thisWrapperObjectName;
+            this.configMBeanServer = configMBeanServer;
+        }
 
+        @Override
+        public void handleNotification(final Notification n, final Object handback) {
+            if (n instanceof MBeanServerNotification
+                    && n.getType()
+                    .equals(MBeanServerNotification.UNREGISTRATION_NOTIFICATION)) {
+                if (((MBeanServerNotification) n).getMBeanName().equals(
+                        thisWrapperObjectName)) {
+                    try {
+                        internalServer.unregisterMBean(objectNameInternal);
+                        configMBeanServer.removeNotificationListener(
+                                MBeanServerDelegate.DELEGATE_NAME, this);
+                    } catch (MBeanRegistrationException
+                            | ListenerNotFoundException
+                            | InstanceNotFoundException e) {
+                        throw new IllegalStateException(e);
+                    }
+                }
+            }
+        }
+    }
+
+    private static final Logger LOG = LoggerFactory.getLogger(AbstractDynamicWrapper.class);
     protected final boolean writable;
     protected final Module module;
 
@@ -69,10 +103,10 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
     protected final ModuleIdentifier moduleIdentifier;
     protected final MBeanServer internalServer;
 
-    public AbstractDynamicWrapper(Module module, boolean writable,
-                                  ModuleIdentifier moduleIdentifier,
-                                  ObjectName thisWrapperObjectName, MBeanOperationInfo[] dOperations,
-                                  MBeanServer internalServer, MBeanServer configMBeanServer) {
+    public AbstractDynamicWrapper(final Module module, final boolean writable,
+                                  final ModuleIdentifier moduleIdentifier,
+                                  final ObjectName thisWrapperObjectName, final MBeanOperationInfo[] dOperations,
+                                  final MBeanServer internalServer, final MBeanServer configMBeanServer) {
 
         this.writable = writable;
         this.module = module;
@@ -96,7 +130,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
      * platform mbean server. Wait until this wrapper gets unregistered, in that
      * case unregister the module and remove listener.
      */
-    private final NotificationListener registerActualModule(Module module,
+    private final NotificationListener registerActualModule(final Module module,
                                                             final ObjectName thisWrapperObjectName,
                                                             final ObjectName objectNameInternal,
                                                             final MBeanServer internalServer,
@@ -110,27 +144,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
                     "Error occured during mbean registration with name " + objectNameInternal, e);
         }
 
-        NotificationListener listener = new NotificationListener() {
-            @Override
-            public void handleNotification(Notification n, Object handback) {
-                if (n instanceof MBeanServerNotification
-                        && n.getType()
-                        .equals(MBeanServerNotification.UNREGISTRATION_NOTIFICATION)) {
-                    if (((MBeanServerNotification) n).getMBeanName().equals(
-                            thisWrapperObjectName)) {
-                        try {
-                            internalServer.unregisterMBean(objectNameInternal);
-                            configMBeanServer.removeNotificationListener(
-                                    MBeanServerDelegate.DELEGATE_NAME, this);
-                        } catch (MBeanRegistrationException
-                                | ListenerNotFoundException
-                                | InstanceNotFoundException e) {
-                            throw new IllegalStateException(e);
-                        }
-                    }
-                }
-            }
-        };
+        NotificationListener listener = new ModuleNotificationListener(objectNameInternal, internalServer, thisWrapperObjectName, configMBeanServer);
         try {
             configMBeanServer.addNotificationListener(
                     MBeanServerDelegate.DELEGATE_NAME, listener, null, null);
@@ -140,9 +154,9 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
         return listener;
     }
 
-    private static MBeanInfo generateMBeanInfo(String className, Module module,
-                                               Map<String, AttributeHolder> attributeHolderMap,
-                                               MBeanOperationInfo[] dOperations, Set<Class<?>> jmxInterfaces) {
+    private static MBeanInfo generateMBeanInfo(final String className, final Module module,
+                                               final Map<String, AttributeHolder> attributeHolderMap,
+                                               final MBeanOperationInfo[] dOperations, final Set<Class<?>> jmxInterfaces) {
 
         String dDescription = findDescription(module.getClass(), jmxInterfaces);
         MBeanConstructorInfo[] dConstructors = new MBeanConstructorInfo[0];
@@ -156,7 +170,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
                 dOperations, new MBeanNotificationInfo[0]);
     }
 
-    static String findDescription(Class<?> clazz, Set<Class<?>> jmxInterfaces) {
+    static String findDescription(final Class<?> clazz, final Set<Class<?>> jmxInterfaces) {
         List<Description> descriptions = AnnotationsHelper
                 .findClassAnnotationInSuperClassesAndIfcs(clazz, Description.class, jmxInterfaces);
         return AnnotationsHelper.aggregateDescriptions(descriptions);
@@ -168,10 +182,10 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
 
     // inspect all exported interfaces ending with MXBean, extract getters &
     // setters into attribute holder
-    private static Map<String, AttributeHolder> buildMBeanInfo(Module module,
-                                                               boolean writable, ModuleIdentifier moduleIdentifier,
-                                                               Set<Class<?>> jmxInterfaces, MBeanServer internalServer,
-                                                               ObjectName internalObjectName) {
+    private static Map<String, AttributeHolder> buildMBeanInfo(final Module module,
+                                                               final boolean writable, final ModuleIdentifier moduleIdentifier,
+                                                               final Set<Class<?>> jmxInterfaces, final MBeanServer internalServer,
+                                                               final ObjectName internalObjectName) {
 
         // internal variables for describing MBean elements
         Set<Method> methods = new HashSet<>();
@@ -216,7 +230,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
                 }
                 AttributeHolder attributeHolder = new AttributeHolder(
                         attribName, module, attributeMap.get(attribName)
-                        .getType(), writable, ifc, description);
+                            .getType(), writable, ifc, description);
                 attributeHolderMap.put(attribName, attributeHolder);
             }
         }
@@ -231,7 +245,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
     }
 
     @Override
-    public Object getAttribute(String attributeName)
+    public Object getAttribute(final String attributeName)
             throws AttributeNotFoundException, MBeanException,
             ReflectionException {
         if ("MBeanInfo".equals(attributeName)) {
@@ -263,7 +277,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
         return obj;
     }
 
-    private Object fixDependencyListAttribute(Object attribute) {
+    private Object fixDependencyListAttribute(final Object attribute) {
         if (attribute.getClass().isArray() == false) {
             throw new IllegalArgumentException("Unexpected attribute type, should be an array, but was " + attribute.getClass());
         }
@@ -282,7 +296,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
         return attribute;
     }
 
-    private boolean isDependencyListAttr(String attributeName, Object attribute) {
+    private boolean isDependencyListAttr(final String attributeName, final Object attribute) {
         if (attributeHolderMap.containsKey(attributeName) == false) {
             return false;
         }
@@ -295,7 +309,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
         return isDepList;
     }
 
-    protected ObjectName fixObjectName(ObjectName on) {
+    protected ObjectName fixObjectName(final ObjectName on) {
         if (!ObjectNameUtil.ON_DOMAIN.equals(on.getDomain())) {
             throw new IllegalArgumentException("Wrong domain, expected "
                     + ObjectNameUtil.ON_DOMAIN + " setter on " + on);
@@ -310,7 +324,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
     }
 
     @Override
-    public AttributeList getAttributes(String[] attributes) {
+    public AttributeList getAttributes(final String[] attributes) {
         AttributeList result = new AttributeList();
         for (String attributeName : attributes) {
             try {
@@ -318,14 +332,14 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
                 result.add(new Attribute(attributeName, value));
 
             } catch (Exception e) {
-                LOGGER.debug("Getting attribute {} failed", attributeName, e);
+                LOG.debug("Getting attribute {} failed", attributeName, e);
             }
         }
         return result;
     }
 
     @Override
-    public Object invoke(String actionName, Object[] params, String[] signature)
+    public Object invoke(final String actionName, final Object[] params, final String[] signature)
             throws MBeanException, ReflectionException {
         if ("getAttribute".equals(actionName) && params.length == 1
                 && signature[0].equals(String.class.getName())) {
@@ -342,7 +356,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
                 && signature[0].equals(AttributeList.class.getName())) {
             return setAttributes((AttributeList) params[0]);
         } else {
-            LOGGER.debug("Operation not found {} ", actionName);
+            LOG.debug("Operation not found {} ", actionName);
             throw new UnsupportedOperationException(
                     format("Operation not found on %s. Method invoke is only supported for getInstance and getAttribute(s) "
                             + "method, got actionName %s, params %s, signature %s ",
@@ -356,7 +370,7 @@ abstract class AbstractDynamicWrapper implements DynamicMBeanModuleWrapper {
     }
 
     @Override
-    public final boolean equals(Object other) {
+    public final boolean equals(final Object other) {
         return module.equals(other);
     }
 
index c4dee3513d6e5bedd9376ddf64f6405c0c76647b..efb357466d52096db4506f9611ed6b4113c38fcb 100644 (file)
@@ -7,13 +7,12 @@
  */
 package org.opendaylight.controller.config.manager.impl.dynamicmbean;
 
-import org.opendaylight.controller.config.api.annotations.Description;
-
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
+import org.opendaylight.controller.config.api.annotations.Description;
 
 public class AnnotationsHelper {
 
index 14be2545047a87af8b1e514d0b81632cd3d71c06..35ba29ed176b4593fceb6577bff77af11254b25c 100644 (file)
@@ -7,17 +7,16 @@
  */
 package org.opendaylight.controller.config.manager.impl.dynamicmbean;
 
-import org.opendaylight.controller.config.api.annotations.Description;
-import org.opendaylight.controller.config.api.annotations.RequireInterface;
-
-import javax.annotation.Nullable;
-import javax.annotation.concurrent.Immutable;
-import javax.management.MBeanAttributeInfo;
-import javax.management.ObjectName;
 import java.lang.reflect.Method;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+import javax.annotation.Nullable;
+import javax.annotation.concurrent.Immutable;
+import javax.management.MBeanAttributeInfo;
+import javax.management.ObjectName;
+import org.opendaylight.controller.config.api.annotations.Description;
+import org.opendaylight.controller.config.api.annotations.RequireInterface;
 
 @Immutable
 class AttributeHolder {
index 7d3cb277fb2405cf59b81a9b73d0896575eac0c7..38c677ce351a4018faad395e9f4302201ea04085 100644 (file)
@@ -14,7 +14,6 @@ import javax.management.InvalidAttributeValueException;
 import javax.management.MBeanException;
 import javax.management.MBeanServer;
 import javax.management.ReflectionException;
-
 import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
index c3885150d572f80d1000320678424e597d2558ce..01ebdbdf94d9905999aa536e00152ddd2e79bc47 100644 (file)
@@ -7,14 +7,7 @@
  */
 package org.opendaylight.controller.config.manager.impl.dynamicmbean;
 
-import org.opendaylight.controller.config.api.ModuleIdentifier;
-import org.opendaylight.controller.config.api.ValidationException;
-import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
-import org.opendaylight.controller.config.manager.impl.TransactionIdentifier;
-import org.opendaylight.controller.config.spi.Module;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
+import java.lang.reflect.Method;
 import javax.annotation.concurrent.ThreadSafe;
 import javax.management.Attribute;
 import javax.management.AttributeList;
@@ -26,7 +19,13 @@ import javax.management.MBeanOperationInfo;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 import javax.management.ReflectionException;
-import java.lang.reflect.Method;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.config.api.ValidationException;
+import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
+import org.opendaylight.controller.config.manager.impl.TransactionIdentifier;
+import org.opendaylight.controller.config.spi.Module;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Wraps {@link org.opendaylight.controller.config.spi.Module} instance in a
@@ -47,7 +46,7 @@ import java.lang.reflect.Method;
  */
 @ThreadSafe
 public class DynamicWritableWrapper extends AbstractDynamicWrapper {
-    private static final Logger LOGGER = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(DynamicWritableWrapper.class);
 
     private final ReadOnlyAtomicBoolean configBeanModificationDisabled;
@@ -140,7 +139,7 @@ public class DynamicWritableWrapper extends AbstractDynamicWrapper {
                 setAttribute(attribute);
                 result.add(attribute);
             } catch (Exception e) {
-                LOGGER.warn("Setting attribute {} failed on {}", attribute.getName(), moduleIdentifier, e);
+                LOG.warn("Setting attribute {} failed on {}", attribute.getName(), moduleIdentifier, e);
                 throw new IllegalArgumentException(
                         "Setting attribute failed - " + attribute.getName()
                                 + " on " + moduleIdentifier, e);
index fc39fab1fb70bf81944777367601e874de0c7170..84e7270c940ce34bff3a05229ba3caada7e863e6 100644 (file)
@@ -7,11 +7,10 @@
  */
 package org.opendaylight.controller.config.manager.impl.factoriesresolver;
 
+import java.util.Map;
 import org.opendaylight.controller.config.spi.ModuleFactory;
 import org.osgi.framework.BundleContext;
 
-import java.util.Map;
-
 /**
  * {@link org.opendaylight.controller.config.manager.impl.ConfigTransactionControllerImpl}
  * receives list of factories using this interface. For testing, this could be
index d09fc75d7374f4aef55d96a08ebb291322512d4b..603c0f58a674dfe074c9e8b5f7ec255c0150620a 100644 (file)
@@ -7,12 +7,11 @@
  */
 package org.opendaylight.controller.config.manager.impl.jmx;
 
-import org.opendaylight.controller.config.api.ModuleIdentifier;
-
+import java.util.Set;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 import javax.management.QueryExp;
-import java.util.Set;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
 
 public class BaseJMXRegistrator implements AutoCloseable, NestableJMXRegistrator {
 
index ec7fc9ce92605eb8b161fe8cbd8d6f548d231143..42932d9385957f627fd5d0b448ff7b617218f9b8 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.config.manager.impl.jmx;
 
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.MBeanServer;
-
 import org.opendaylight.controller.config.api.jmx.ConfigRegistryMXBean;
 import org.opendaylight.controller.config.manager.impl.ConfigRegistryImplMXBean;
 
index 49fad61a89ebb51a8139b6583df382c6e4ffb7b8..2b0e525656723d7ffc3d0082b6c5744c41516eda 100644 (file)
@@ -9,10 +9,8 @@ package org.opendaylight.controller.config.manager.impl.jmx;
 
 import java.util.HashMap;
 import java.util.Map;
-
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.ObjectName;
-
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
 import org.opendaylight.controller.config.api.runtime.HierarchicalRuntimeBeanRegistration;
index ddb9c52c88337b0b4aaa051828682d88b15eae7b..85ad8c51340c045cc051150ec9e6159fc7144fbb 100644 (file)
@@ -7,9 +7,12 @@
  */
 package org.opendaylight.controller.config.manager.impl.jmx;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
+import java.io.Closeable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
 import javax.annotation.concurrent.GuardedBy;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
@@ -19,15 +22,11 @@ import javax.management.MBeanServer;
 import javax.management.NotCompliantMBeanException;
 import javax.management.ObjectName;
 import javax.management.QueryExp;
-import java.io.Closeable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class InternalJMXRegistrator implements Closeable {
-    private static final Logger LOGGER = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(InternalJMXRegistrator.class);
     private final MBeanServer configMBeanServer;
 
@@ -100,7 +99,7 @@ public class InternalJMXRegistrator implements Closeable {
             try {
                 configMBeanServer.unregisterMBean(on);
             } catch (Exception e) {
-                LOGGER.warn("Ignoring error while unregistering {}", on, e);
+                LOG.warn("Ignoring error while unregistering {}", on, e);
             }
         }
         registeredObjectNames.clear();
index c0e9b0d101b30bd912ff2674ccc254744356a68f..6af500fbd1c264068f85bba5649b479adae0ef26 100644 (file)
@@ -8,11 +8,9 @@
 package org.opendaylight.controller.config.manager.impl.jmx;
 
 import java.io.Closeable;
-
 import javax.annotation.concurrent.ThreadSafe;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.ObjectName;
-
 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
 import org.opendaylight.controller.config.manager.impl.jmx.InternalJMXRegistrator.InternalJMXRegistration;
 
index 55bfbf56fc3a9eefd9556009ce9438abd4e514df..d9ee3d322582637b66699ce8b9962ce4571eac14 100644 (file)
@@ -8,10 +8,8 @@
 package org.opendaylight.controller.config.manager.impl.jmx;
 
 import java.util.Collections;
-
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.ObjectName;
-
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
 import org.opendaylight.controller.config.api.runtime.RootRuntimeBeanRegistrator;
index 160ee1888a4121bb9fbff66621fde7190bc015b4..ed366f6a290ff853fce8a10d6fd57266022daafc 100644 (file)
@@ -7,11 +7,10 @@
  */
 package org.opendaylight.controller.config.manager.impl.jmx;
 
-import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
-import org.opendaylight.controller.config.manager.impl.jmx.InternalJMXRegistrator.InternalJMXRegistration;
-
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.ObjectName;
+import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
+import org.opendaylight.controller.config.manager.impl.jmx.InternalJMXRegistrator.InternalJMXRegistration;
 
 public interface ServiceReferenceRegistrator extends AutoCloseable {
 
index 6fd2a2fc65201ea0d48c974875e2fe9477300ac0..98131868d201485315217c75170dfda269a3dc59 100644 (file)
@@ -7,14 +7,13 @@
  */
 package org.opendaylight.controller.config.manager.impl.jmx;
 
-import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
-import org.opendaylight.controller.config.manager.impl.jmx.InternalJMXRegistrator.InternalJMXRegistration;
-
+import java.io.Closeable;
+import java.util.Set;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.ObjectName;
 import javax.management.QueryExp;
-import java.io.Closeable;
-import java.util.Set;
+import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
+import org.opendaylight.controller.config.manager.impl.jmx.InternalJMXRegistrator.InternalJMXRegistration;
 
 /**
  * Contains constraints on passed {@link ObjectName} parameters. Only allow (un)
index 238fd2447e894149b51246e04692dbe1b19bfaa4..fbdf47ebe4fba991cd2f138ab476fd88115f7238 100644 (file)
@@ -9,11 +9,9 @@ package org.opendaylight.controller.config.manager.impl.jmx;
 
 import java.io.Closeable;
 import java.util.Set;
-
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.ObjectName;
 import javax.management.QueryExp;
-
 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
 import org.opendaylight.controller.config.manager.impl.jmx.InternalJMXRegistrator.InternalJMXRegistration;
 
index c03bfa450034254360dca663f18abf54d607f83e..67475dacf86dde967fbf1877d5892678836a0d28 100644 (file)
@@ -49,7 +49,7 @@ public class BeanToOsgiServiceManager {
 
 
     public static class OsgiRegistration implements AutoCloseable {
-        private static final Logger LOGGER = LoggerFactory.getLogger(OsgiRegistration.class);
+        private static final Logger LOG = LoggerFactory.getLogger(OsgiRegistration.class);
 
         @GuardedBy("this")
         private AutoCloseable instance;
@@ -89,7 +89,7 @@ public class BeanToOsgiServiceManager {
                 try {
                     serviceRegistration.unregister();
                 } catch(IllegalStateException e) {
-                    LOGGER.trace("Cannot unregister {}", serviceRegistration, e);
+                    LOG.trace("Cannot unregister {}", serviceRegistration, e);
                 }
             }
             serviceRegistrations.clear();
@@ -101,7 +101,7 @@ public class BeanToOsgiServiceManager {
             notEquals |= newAnnotationMapping.equals(serviceNamesToAnnotations) == false;
             if (notEquals) {
                 // FIXME: changing from old state to new state can be improved by computing the diff
-                LOGGER.debug("Detected change in service registrations for {}: old: {}, new: {}", moduleIdentifier,
+                LOG.debug("Detected change in service registrations for {}: old: {}, new: {}", moduleIdentifier,
                         serviceNamesToAnnotations, newAnnotationMapping);
                 close();
                 this.instance = newInstance;
index b115f1acd94ef837c8b7309be87a86e41e1fd195..2e2bf969a93203c3beb2f7a126e2f3f04b57bb17 100644 (file)
@@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory;
  * functionality.
  */
 public class BlankTransactionServiceTracker implements ServiceTrackerCustomizer<ModuleFactory, Object> {
-    private static final Logger LOGGER = LoggerFactory.getLogger(BlankTransactionServiceTracker.class);
+    private static final Logger LOG = LoggerFactory.getLogger(BlankTransactionServiceTracker.class);
 
     public static final int DEFAULT_MAX_ATTEMPTS = 10;
 
@@ -65,7 +65,7 @@ public class BlankTransactionServiceTracker implements ServiceTrackerCustomizer<
             try {
                 // create transaction
                 CommitStatus commitStatus = blankTransaction.hit();
-                LOGGER.debug("Committed blank transaction with status {}", commitStatus);
+                LOG.debug("Committed blank transaction with status {}", commitStatus);
                 return;
             } catch (ConflictingVersionException e) {
                 lastException = e;
@@ -76,7 +76,7 @@ public class BlankTransactionServiceTracker implements ServiceTrackerCustomizer<
                     throw new IllegalStateException(interruptedException);
                 }
             } catch (ValidationException e) {
-                LOGGER.error("Validation exception while running blank transaction indicates programming error", e);
+                LOG.error("Validation exception while running blank transaction indicates programming error", e);
                 throw new RuntimeException("Validation exception while running blank transaction indicates programming error", e);
             }
         }
index 7cb4445328f84355e86ad8590120340354e7df6c..e8639d588197c146483b434fd83b4fb653a32c49 100644 (file)
@@ -7,6 +7,10 @@
  */
 package org.opendaylight.controller.config.manager.impl.osgi;
 
+import java.util.AbstractMap;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
 import org.opendaylight.controller.config.manager.impl.factoriesresolver.ModuleFactoriesResolver;
 import org.opendaylight.controller.config.spi.ModuleFactory;
 import org.osgi.framework.BundleContext;
@@ -15,17 +19,12 @@ import org.osgi.framework.ServiceReference;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.AbstractMap;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
 /**
  * Retrieves list of currently registered Module Factories using bundlecontext.
  */
 public class BundleContextBackedModuleFactoriesResolver implements
         ModuleFactoriesResolver {
-    private static final Logger LOGGER = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(BundleContextBackedModuleFactoriesResolver.class);
     private final BundleContext bundleContext;
 
@@ -62,14 +61,14 @@ public class BundleContextBackedModuleFactoriesResolver implements
             if (serviceReference.getBundle() == null || serviceReference.getBundle().getBundleContext() == null) {
                 throw new NullPointerException("Bundle context of " + factory + " ModuleFactory not found.");
             }
-            LOGGER.debug("Reading factory {} {}", moduleName, factory);
+            LOG.debug("Reading factory {} {}", moduleName, factory);
 
             Map.Entry<ModuleFactory, BundleContext> conflicting = result.get(moduleName);
             if (conflicting != null) {
                 String error = String
                         .format("Module name is not unique. Found two conflicting factories with same name '%s': '%s' '%s'",
                                 moduleName, conflicting.getKey(), factory);
-                LOGGER.error(error);
+                LOG.error(error);
                 throw new IllegalArgumentException(error);
             } else {
                 result.put(moduleName, new AbstractMap.SimpleImmutableEntry<>(factory,
index eff267ad1319c90c1ce9e06de2ff7bcaddc86c67..eb3c502cfb9f4765349d0a0e996b3d82d9bca9b9 100644 (file)
@@ -92,7 +92,7 @@ public final class ExtensibleBundleTracker<T> extends BundleTracker<Future<T>> {
                     LOG.trace("AddingBundle for {} and event {} finished successfully",bundle,event);
                     return primaryTrackerRetVal;
                 } catch (Exception e) {
-                    LOG.error("Failed to add bundle {}",e);
+                    LOG.error("Failed to add bundle ",e);
                     throw e;
                 }
             }
index 3c8fc042a37c5ebe048b8b1e47a1016674b6402c..cc71370c95891d58bb6473c8ec3f2425702fa7f9 100644 (file)
@@ -13,7 +13,6 @@ import com.google.common.annotations.VisibleForTesting;
 import java.io.InputStream;
 import java.net.URL;
 import java.util.List;
-
 import org.apache.commons.io.IOUtils;
 import org.opendaylight.controller.config.spi.ModuleFactory;
 import org.osgi.framework.Bundle;
@@ -35,7 +34,7 @@ import org.slf4j.LoggerFactory;
  */
 public class ModuleFactoryBundleTracker implements BundleTrackerCustomizer<Object> {
     private final BlankTransactionServiceTracker blankTransactionServiceTracker;
-    private static final Logger LOGGER = LoggerFactory.getLogger(ModuleFactoryBundleTracker.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ModuleFactoryBundleTracker.class);
 
     public ModuleFactoryBundleTracker(BlankTransactionServiceTracker blankTransactionServiceTracker) {
         this.blankTransactionServiceTracker = blankTransactionServiceTracker;
@@ -44,7 +43,7 @@ public class ModuleFactoryBundleTracker implements BundleTrackerCustomizer<Objec
     @Override
     public Object addingBundle(Bundle bundle, BundleEvent event) {
         URL resource = bundle.getEntry("META-INF/services/" + ModuleFactory.class.getName());
-        LOGGER.trace("Got addingBundle event of bundle {}, resource {}, event {}",
+        LOG.trace("Got addingBundle event of bundle {}, resource {}, event {}",
                 bundle, resource, event);
         if (resource != null) {
             try (InputStream inputStream = resource.openStream()) {
@@ -53,7 +52,7 @@ public class ModuleFactoryBundleTracker implements BundleTrackerCustomizer<Objec
                     registerFactory(factoryClassName, bundle);
                 }
             } catch (Exception e) {
-                LOGGER.error("Error while reading {}", resource, e);
+                LOG.error("Error while reading {}", resource, e);
                 throw new RuntimeException(e);
             }
         }
@@ -79,7 +78,7 @@ public class ModuleFactoryBundleTracker implements BundleTrackerCustomizer<Objec
             Class<?> clazz = bundle.loadClass(factoryClassName);
             if (ModuleFactory.class.isAssignableFrom(clazz)) {
                 try {
-                    LOGGER.debug("Registering {} in bundle {}",
+                    LOG.debug("Registering {} in bundle {}",
                             clazz.getName(), bundle);
                     return bundle.getBundleContext().registerService(
                             ModuleFactory.class.getName(), clazz.newInstance(),
@@ -111,7 +110,7 @@ public class ModuleFactoryBundleTracker implements BundleTrackerCustomizer<Objec
     }
 
     public static String logMessage(String slfMessage, Object... params) {
-        LOGGER.info(slfMessage, params);
+        LOG.info(slfMessage, params);
         String formatMessage = slfMessage.replaceAll("\\{\\}", "%s");
         return format(formatMessage, params);
     }
index 6050f7c07073061fe4233e99d915308489bc5a7f..a40ed99d1e62b580eaf13d3e6a257d5abaabb381 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.controller.config.manager.impl.osgi.mapping;
 
 import javassist.ClassPool;
-
 import org.opendaylight.controller.config.manager.impl.util.OsgiRegistrationUtil;
 import org.opendaylight.yangtools.sal.binding.generator.api.ClassLoadingStrategy;
 import org.opendaylight.yangtools.sal.binding.generator.impl.RuntimeGeneratedMappingServiceImpl;
index c5be03ca4dc1948fe776ef30b5d171ec0667ce83..2a2a7784ebed7a48f298b607f957dc1921393768 100644 (file)
@@ -14,7 +14,6 @@ import java.net.URL;
 import java.util.Collection;
 import java.util.LinkedList;
 import java.util.List;
-
 import org.apache.commons.io.IOUtils;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
 import org.opendaylight.yangtools.sal.binding.generator.api.ModuleInfoRegistry;
@@ -31,7 +30,7 @@ import org.slf4j.LoggerFactory;
  */
 public final class ModuleInfoBundleTracker implements BundleTrackerCustomizer<Collection<ObjectRegistration<YangModuleInfo>>> {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(ModuleInfoBundleTracker.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ModuleInfoBundleTracker.class);
 
     public static final String MODULE_INFO_PROVIDER_PATH_PREFIX = "META-INF/services/";
 
@@ -45,7 +44,7 @@ public final class ModuleInfoBundleTracker implements BundleTrackerCustomizer<Co
     @Override
     public Collection<ObjectRegistration<YangModuleInfo>> addingBundle(Bundle bundle, BundleEvent event) {
         URL resource = bundle.getEntry(MODULE_INFO_PROVIDER_PATH_PREFIX + YangModelBindingProvider.class.getName());
-        LOGGER.debug("Got addingBundle({}) with YangModelBindingProvider resource {}", bundle, resource);
+        LOG.debug("Got addingBundle({}) with YangModelBindingProvider resource {}", bundle, resource);
         if(resource==null) {
             return null;
         }
@@ -54,16 +53,16 @@ public final class ModuleInfoBundleTracker implements BundleTrackerCustomizer<Co
         try (InputStream inputStream = resource.openStream()) {
             List<String> lines = IOUtils.readLines(inputStream);
             for (String moduleInfoName : lines) {
-                LOGGER.trace("Retrieve ModuleInfo({}, {})", moduleInfoName, bundle);
+                LOG.trace("Retrieve ModuleInfo({}, {})", moduleInfoName, bundle);
                 YangModuleInfo moduleInfo = retrieveModuleInfo(moduleInfoName, bundle);
                 registrations.add(moduleInfoRegistry.registerModuleInfo(moduleInfo));
             }
 
         } catch (Exception e) {
-            LOGGER.error("Error while reading {}", resource, e);
+            LOG.error("Error while reading {}", resource, e);
             throw new RuntimeException(e);
         }
-        LOGGER.trace("Got following registrations {}", registrations);
+        LOG.trace("Got following registrations {}", registrations);
         return registrations;
     }
 
@@ -111,7 +110,7 @@ public final class ModuleInfoBundleTracker implements BundleTrackerCustomizer<Co
         } catch (NoClassDefFoundError e) {
 
 
-            LOGGER.error("Error while executing getModuleInfo on {}", instance, e);
+            LOG.error("Error while executing getModuleInfo on {}", instance, e);
             throw e;
         }
     }
@@ -126,7 +125,7 @@ public final class ModuleInfoBundleTracker implements BundleTrackerCustomizer<Co
     }
 
     public static String logMessage(String slfMessage, Object... params) {
-        LOGGER.info(slfMessage, params);
+        LOG.info(slfMessage, params);
         String formatMessage = slfMessage.replaceAll("\\{\\}", "%s");
         return format(formatMessage, params);
     }
index e51cf8d4c5edb8b98e3a032a5db950277f1cecb2..bee14c837d1fec553b4e0e72bbfbdab057fe96b9 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.controller.config.manager.impl.osgi.mapping;
 
+import java.util.Hashtable;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
 import org.opendaylight.yangtools.sal.binding.generator.api.ModuleInfoRegistry;
 import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
@@ -15,8 +16,6 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 
-import java.util.Hashtable;
-
 /**
  * Update SchemaContext service in Service Registry each time new YangModuleInfo is added or removed.
  */
index 284e109f2d11fc0b7d83cd45cf9dfc8cb6605151..0572bd9350c4a0e9beaf9536d53fbb42314626dd 100644 (file)
@@ -8,10 +8,8 @@
 package org.opendaylight.controller.config.manager.impl.util;
 
 import java.util.Set;
-
 import javax.management.InstanceNotFoundException;
 import javax.management.ObjectName;
-
 import org.opendaylight.controller.config.api.LookupRegistry;
 
 public class LookupBeansUtil {
index 1cb31caea166d62dbc7c343b30b3ad2c440f6f58..e5858ac2ee1231170b99f89ce8044d0a40dc1f21 100644 (file)
@@ -7,15 +7,14 @@
  */
 package org.opendaylight.controller.config.manager.impl.util;
 
-import org.opendaylight.controller.config.spi.ModuleFactory;
-import org.opendaylight.yangtools.yang.binding.annotations.ModuleQName;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.osgi.framework.BundleContext;
-
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
+import org.opendaylight.controller.config.spi.ModuleFactory;
+import org.opendaylight.yangtools.yang.binding.annotations.ModuleQName;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.osgi.framework.BundleContext;
 
 public class ModuleQNameUtil {
 
index 4f792e72b10ccb826acb99c3d4117b071bdeef84..fe8e30ee9ad2816a63f38365fb39c032193dd798 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.controller.config.manager.impl.util;
 
 import static com.google.common.base.Preconditions.checkNotNull;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.ListIterator;
@@ -20,7 +21,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class OsgiRegistrationUtil {
-    private static final Logger LOGGER = LoggerFactory.getLogger(OsgiRegistrationUtil.class);
+    private static final Logger LOG = LoggerFactory.getLogger(OsgiRegistrationUtil.class);
 
     private OsgiRegistrationUtil() {
     }
@@ -82,7 +83,7 @@ public class OsgiRegistrationUtil {
                     try {
                         ac.close();
                     } catch (Exception e) {
-                        LOGGER.warn("Exception while closing {}", ac, e);
+                        LOG.warn("Exception while closing {}", ac, e);
                         if (firstException == null) {
                             firstException = e;
                         } else {
index 7efd3ee0309fdfec46fbe9378975403637b43ff2..ee47316f8d546716872c34aff2680cd03233acc2 100644 (file)
@@ -7,6 +7,12 @@
  */
 package org.opendaylight.controller.config.manager;
 
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verifyZeroInteractions;
+
+import java.lang.management.ManagementFactory;
 import org.junit.Test;
 import org.opendaylight.controller.config.manager.impl.AbstractLockedPlatformMBeanServerTest;
 import org.opendaylight.controller.config.manager.impl.ConfigRegistryImpl;
@@ -18,16 +24,9 @@ import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.lang.management.ManagementFactory;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verifyZeroInteractions;
-
 public class ConfigRegistryImplTest extends
         AbstractLockedPlatformMBeanServerTest {
-    private static final Logger logger = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(ConfigRegistryImplTest.class);
 
     @Test
@@ -56,7 +55,7 @@ public class ConfigRegistryImplTest extends
                 configRegistry.close();
             } catch (Exception e) {
                 // ignore
-                logger.warn("Ignoring exception", e);
+                LOG.warn("Ignoring exception", e);
             }
         }
     }
index c4a4192cba796340cc845d496060dba7d0f268d5..db1b794d300ef9552039e52591f3dd358a147971 100644 (file)
@@ -7,7 +7,26 @@
  */
 package org.opendaylight.controller.config.manager.impl;
 
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.mock;
+
 import com.google.common.base.Preconditions;
+import java.lang.management.ManagementFactory;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.Dictionary;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.management.RuntimeMBeanException;
 import org.junit.After;
 import org.junit.Before;
 import org.mockito.Matchers;
@@ -29,26 +48,6 @@ import org.opendaylight.yangtools.yang.data.impl.codec.CodecRegistry;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.management.RuntimeMBeanException;
-import java.lang.management.ManagementFactory;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.Dictionary;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.mock;
-
 /**
  * Each test that relies on
  * {@link org.opendaylight.controller.config.manager.impl.ConfigRegistryImpl}
@@ -199,7 +198,7 @@ public abstract class AbstractConfigTest extends
 
     public static interface BundleContextServiceRegistrationHandler {
 
-       void handleServiceRegistration(Class<?> clazz, Object serviceInstance, Dictionary<String, ?> props);
+        void handleServiceRegistration(Class<?> clazz, Object serviceInstance, Dictionary<String, ?> props);
 
     }
 
@@ -260,19 +259,20 @@ public abstract class AbstractConfigTest extends
 
         Object proxy = Proxy.newProxyInstance(innerObject.getClass().getClassLoader(),
                 innerObject.getClass().getInterfaces(), new InvocationHandler() {
-            @Override
-            public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-                try {
-                    return method.invoke(innerObject, args);
-                } catch (InvocationTargetException e) {
-                    try {
-                        throw e.getTargetException();
-                    } catch (RuntimeMBeanException e2) {
-                        throw e2.getTargetException();
+                        @Override
+                        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+                            try {
+                                return method.invoke(innerObject, args);
+                            } catch (InvocationTargetException e) {
+                                try {
+                                    throw e.getTargetException();
+                                } catch (RuntimeMBeanException e2) {
+                                    throw e2.getTargetException();
+                                }
+                            }
+                        }
                     }
-                }
-            }
-        });
+        );
         return (T) proxy;
     }
 
index 2e97c49f26708994eeb986c864df45d20dcbc82f..4c896e7e830cc67db4914495dba4d9bb8152dace 100644 (file)
@@ -9,9 +9,7 @@ package org.opendaylight.controller.config.manager.impl;
 
 import java.lang.management.ManagementFactory;
 import java.util.concurrent.locks.ReentrantLock;
-
 import javax.management.MBeanServer;
-
 import org.junit.After;
 import org.junit.Before;
 
index 672f15091430f26532a20cf3636cbad0e6eee477..3c237d37f00f52ecde36938b87d9478dcd835b13 100644 (file)
@@ -8,6 +8,12 @@
 package org.opendaylight.controller.config.manager.impl;
 
 import com.google.common.base.Preconditions;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
 import org.opendaylight.controller.config.api.DependencyResolver;
 import org.opendaylight.controller.config.api.DependencyResolverFactory;
 import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
@@ -18,13 +24,6 @@ import org.opendaylight.controller.config.spi.Module;
 import org.opendaylight.controller.config.spi.ModuleFactory;
 import org.osgi.framework.BundleContext;
 
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
 /**
  * Creates new modules by reflection. Provided class must have this constructor:
  * ctor(DynamicMBeanWithInstance.class, ModuleIdentifier.class).
index 7a4b46f9f373bbf237e2a325a99e8d8569bf8d96..5fbe8688e0d8a2893ef4a56539cb4739da913f68 100644 (file)
@@ -11,15 +11,14 @@ import static org.hamcrest.core.Is.is;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertThat;
 
+import com.google.common.collect.Sets;
 import java.lang.management.ManagementFactory;
 import java.lang.reflect.Field;
 import java.util.Collections;
 import java.util.Map;
 import java.util.Set;
-
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.ObjectName;
-
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -30,8 +29,6 @@ import org.opendaylight.controller.config.manager.impl.jmx.BaseJMXRegistrator;
 import org.opendaylight.controller.config.manager.impl.jmx.RootRuntimeBeanRegistratorImpl;
 import org.opendaylight.controller.config.manager.impl.runtimembean.TestingRuntimeBean;
 
-import com.google.common.collect.Sets;
-
 public class ConfigRegistryImplLookupTest extends
         AbstractLockedPlatformMBeanServerTest {
 
index 5a3747ee142c7fd35ddef29bde078aef134d290c..5b2f7ad1e70ea79e515dd6c55ab65cacef593c58 100644 (file)
@@ -7,7 +7,16 @@
  */
 package org.opendaylight.controller.config.manager.impl;
 
+import static org.junit.Assert.assertEquals;
+
 import com.google.common.collect.Sets;
+import java.lang.management.ManagementFactory;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -19,16 +28,6 @@ import org.opendaylight.controller.config.manager.impl.runtimembean.TestingRunti
 import org.opendaylight.controller.config.spi.ModuleFactory;
 import org.osgi.framework.BundleContext;
 
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-import java.lang.management.ManagementFactory;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import static org.junit.Assert.assertEquals;
-
 public class ConfigTransactionControllerImplTest extends
         AbstractLockedPlatformMBeanServerTest {
 
index 9595e60ff64ccc325f7d8079cd64fd51ba26ed3c..3b7bbcd26739dcce3d1f8309adea4391968921a8 100644 (file)
@@ -7,17 +7,16 @@
  */
 package org.opendaylight.controller.config.manager.impl;
 
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
+
+import javax.management.InstanceAlreadyExistsException;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;
 import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
 
-import javax.management.InstanceAlreadyExistsException;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.Mockito.mock;
-
 public class ConfigTransactionManagerImplTest extends
         AbstractConfigTest {
 
index 8c132c93b298dee714f3efa063f329efc70a7878..27515cf9698e4756f4e9ee0844862a2d61302f7b 100644 (file)
@@ -7,13 +7,27 @@
  */
 package org.opendaylight.controller.config.manager.impl;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.opendaylight.controller.config.api.jmx.ObjectNameUtil.withoutTransactionName;
+
 import com.google.common.collect.ImmutableMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import javax.management.Attribute;
+import javax.management.AttributeNotFoundException;
+import javax.management.InstanceNotFoundException;
+import javax.management.JMX;
+import javax.management.MBeanException;
+import javax.management.ObjectName;
+import javax.management.ReflectionException;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
+import org.opendaylight.controller.config.api.jmx.ServiceReferenceMXBean;
 import org.opendaylight.controller.config.manager.impl.AbstractConfigTest.RecordingBundleContextServiceRegistrationHandler.RegistrationHolder;
 import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;
-import org.opendaylight.controller.config.api.jmx.ServiceReferenceMXBean;
 import org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPModuleFactory;
 import org.opendaylight.controller.config.manager.testingservices.parallelapsp.test.AbstractParallelAPSPTest;
 import org.opendaylight.controller.config.manager.testingservices.scheduledthreadpool.TestingScheduledThreadPoolModuleFactory;
@@ -22,21 +36,6 @@ import org.opendaylight.controller.config.manager.testingservices.threadpool.Tes
 import org.opendaylight.controller.config.manager.testingservices.threadpool.TestingThreadPoolIfc;
 import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
 
-import javax.management.Attribute;
-import javax.management.AttributeNotFoundException;
-import javax.management.InstanceNotFoundException;
-import javax.management.JMX;
-import javax.management.MBeanException;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.opendaylight.controller.config.api.jmx.ObjectNameUtil.withoutTransactionName;
-
 public class ServiceReferenceRegistryImplTest extends AbstractParallelAPSPTest {
 
 
index 83ee87ce0e4fefad73e46b78e236a0a45bc9b803..0029f26308d080ed12670b2725250669e28fdbc6 100644 (file)
@@ -99,11 +99,11 @@ public class DependencyResolverManagerTest extends AbstractLockedPlatformMBeanSe
         boolean isDefaultBean = false;
 
         tested.put(moduleIdentifier,
-        mockedModule(),
-        moduleFactory,
-        maybeOldInternalInfo,
-        transactionModuleJMXRegistration,
-        isDefaultBean, mock(BundleContext.class));
+            mockedModule(),
+            moduleFactory,
+            maybeOldInternalInfo,
+            transactionModuleJMXRegistration,
+            isDefaultBean, mock(BundleContext.class));
     }
 
     private static Module mockedModule() {
index e75bbaa1ebb953ae50d9b94315db495a240fd894..afd088c62fb1b7b3696910672fd3beb503b5b448 100644 (file)
@@ -7,6 +7,9 @@
  */
 package org.opendaylight.controller.config.manager.impl.dynamicmbean;
 
+import static org.junit.Assert.assertEquals;
+
+import java.lang.management.ManagementFactory;
 import javax.management.Attribute;
 import javax.management.AttributeList;
 import javax.management.DynamicMBean;
@@ -15,8 +18,6 @@ import javax.management.MBeanInfo;
 import javax.management.MBeanServer;
 import javax.management.MBeanServerFactory;
 import javax.management.ObjectName;
-import java.lang.management.ManagementFactory;
-
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -29,8 +30,6 @@ import org.opendaylight.controller.config.manager.testingservices.threadpool.Tes
 import org.opendaylight.controller.config.manager.testingservices.threadpool.TestingFixedThreadPoolModuleFactory;
 import org.opendaylight.controller.config.spi.Module;
 
-import static org.junit.Assert.assertEquals;
-
 public abstract class AbstractDynamicWrapperTest extends
         AbstractLockedPlatformMBeanServerTest {
     protected final MBeanServer platformMBeanServer = ManagementFactory
@@ -84,7 +83,7 @@ public abstract class AbstractDynamicWrapperTest extends
                 proxy.getAttribute(TRIGGER_NEW_INSTANCE_CREATION));
 
         AttributeList attributes = proxy.getAttributes(new String[] {
-                THREAD_COUNT, TRIGGER_NEW_INSTANCE_CREATION });
+            THREAD_COUNT, TRIGGER_NEW_INSTANCE_CREATION });
         assertEquals(2, attributes.size());
         Attribute threadCountAttr = (Attribute) attributes.get(0);
         assertEquals(THREAD_COUNT, threadCountAttr.getName());
index 75b0414711095d70b3e98f7964c84ff422a3ec75..9391378fbb942f8c58adc93d61c4338940008e28 100644 (file)
@@ -13,6 +13,8 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import com.google.common.base.Throwables;
+import com.google.common.collect.Sets;
 import java.lang.reflect.Method;
 import java.util.Arrays;
 import java.util.Collections;
@@ -20,18 +22,13 @@ import java.util.HashSet;
 import java.util.Set;
 import java.util.concurrent.Executor;
 import java.util.concurrent.ExecutorService;
-
 import javax.management.ObjectName;
-
 import org.junit.Test;
 import org.opendaylight.controller.config.api.annotations.AbstractServiceInterface;
 import org.opendaylight.controller.config.api.annotations.Description;
 import org.opendaylight.controller.config.api.annotations.RequireInterface;
 import org.opendaylight.controller.config.api.annotations.ServiceInterfaceAnnotation;
 
-import com.google.common.base.Throwables;
-import com.google.common.collect.Sets;
-
 public class AnnotationsTest {
 
     private final String setSomethingString = "setSomething";
index 3564489c4a45103d71ca27e99003c9e163bbbe9c..4299bb4e881c1e2443ea8836375944fcc67946e2 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.controller.config.manager.impl.dynamicmbean;
 
 import java.lang.management.ManagementFactory;
-
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.spi.Module;
 
index 77c7c390d586a2ea2541f537bdec85b510aa3096..d453f1e7798eee1aeb848ac9bd23ad98625f7bf4 100644 (file)
@@ -7,6 +7,16 @@
  */
 package org.opendaylight.controller.config.manager.impl.dynamicmbean;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+import javax.management.Attribute;
+import javax.management.AttributeList;
+import javax.management.DynamicMBean;
+import javax.management.JMX;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
 import org.junit.Test;
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
@@ -18,17 +28,6 @@ import org.opendaylight.controller.config.manager.testingservices.parallelapsp.T
 import org.opendaylight.controller.config.manager.testingservices.threadpool.TestingFixedThreadPoolConfigMXBean;
 import org.opendaylight.controller.config.spi.Module;
 
-import javax.management.Attribute;
-import javax.management.AttributeList;
-import javax.management.DynamicMBean;
-import javax.management.JMX;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
 public class DynamicWritableWrapperTest extends AbstractDynamicWrapperTest {
     private final int newThreadCount = 10;
     private final AtomicBoolean atomicBoolean = new AtomicBoolean();
index dd6588f3f63cb7c0f06589f1890cb68c3f94b619..e7e10e884ff3087aab7f0099822ba976a9c791b7 100644 (file)
@@ -7,24 +7,23 @@
  */
 package org.opendaylight.controller.config.manager.impl.factoriesresolver;
 
-import org.mockito.Matchers;
-import org.mockito.Mockito;
-import org.opendaylight.controller.config.spi.ModuleFactory;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
 
 import java.io.Closeable;
+import java.util.AbstractMap;
 import java.util.Arrays;
 import java.util.Dictionary;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.HashMap;
-import java.util.AbstractMap;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
+import org.mockito.Matchers;
+import org.mockito.Mockito;
+import org.opendaylight.controller.config.spi.ModuleFactory;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
 
 public class HardcodedModuleFactoriesResolver implements ModuleFactoriesResolver {
     private Map<String, Map.Entry<ModuleFactory, BundleContext>> factories;
index 8ceee0caf5596b798371436f0f81fc9c2294febc..5e532ef815a48b8ed039187f77d3801905572b5f 100644 (file)
@@ -8,6 +8,7 @@ import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
+
 import java.util.Collections;
 import javax.management.ObjectName;
 import org.junit.Before;
index 44e6e9ab778fc89b063e176a13cdcfdd2ab71103..ca95abb359bc621850fc978f9de77dcfd958ad04 100644 (file)
@@ -7,6 +7,7 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
+
 import com.google.common.collect.Lists;
 import java.util.Map;
 import org.junit.Before;
index 25d770e6c9577b11d24651515fc3f432b87eae59..fe4775533055e02cdf5eab581baf2ea3f2158f85 100644 (file)
@@ -11,6 +11,7 @@ import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyZeroInteractions;
+
 import java.util.Dictionary;
 import java.util.Set;
 import org.junit.Before;
index 9edb64ac6b8c83b594d85daad5cb3f2d48e6edd7..9d799cb47d56169eaa987df7aa30f4350da4f4d8 100644 (file)
@@ -3,6 +3,7 @@ package org.opendaylight.controller.config.manager.impl.osgi;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
+
 import java.util.Dictionary;
 import org.junit.Test;
 import org.mockito.Mockito;
index 16de00508ab4e7ecf4d7fc6df22b6b476b37ae1d..fd225f1b93f01fd1d5c1f5105d1f36c357090624 100644 (file)
@@ -11,15 +11,13 @@ import static org.hamcrest.CoreMatchers.containsString;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.fail;
+
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Maps;
-
 import java.lang.management.ManagementFactory;
 import java.util.Map;
-
 import javax.management.InstanceNotFoundException;
 import javax.management.ObjectName;
-
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
index 4be40a64f5a775e008e13ce592d9d7fdefb3eacb..34039ce8d04303338cca59f0d49b2793d8f5b5c5 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.config.manager.impl.util;
 
 import static org.junit.Assert.assertEquals;
+
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Sets;
 import java.util.Collections;
@@ -94,7 +95,7 @@ public class InterfacesHelperTest {
 
         Set<Class<?>> expected = ImmutableSet.of((Class<?>) TestingScheduledThreadPoolServiceInterface.class,
                 TestingThreadPoolServiceInterface.class
-                );
+        );
         assertEquals(expected, result);
     }
 
index f1efc4787dfc3320fc1017c88f6819caf9f2ad5d..6f3ca2995f3bc6cf3a08ef7da292f0c187019fd9 100644 (file)
@@ -4,6 +4,7 @@ import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
+
 import org.junit.Test;
 import org.mockito.InOrder;
 import org.mockito.Mockito;
index 9674a110ce18fd742f8534915fa8713a2ce4b550..830c67ca64ebe3c2608201960a4360f31f8243da 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.controller.config.manager.testingservices.parallelapsp;
 
 import javax.management.ObjectName;
-
 import org.opendaylight.controller.config.api.annotations.ServiceInterfaceAnnotation;
 
 @ServiceInterfaceAnnotation(value = TestingParallelAPSPConfigMXBean.NAME, osgiRegistrationType = TestingAPSP.class,
index 0c29386007f720137364d5a0f4297472c0c1b525..65b36deb43e579a26eea8f50d1e4408e9d4bbcad 100644 (file)
@@ -9,15 +9,12 @@ package org.opendaylight.controller.config.manager.testingservices.parallelapsp;
 
 import static com.google.common.base.Preconditions.checkArgument;
 
+import com.google.common.base.Strings;
 import java.io.Closeable;
 import java.io.IOException;
-
 import javax.annotation.concurrent.NotThreadSafe;
-
 import org.opendaylight.controller.config.manager.testingservices.threadpool.TestingThreadPoolIfc;
 
-import com.google.common.base.Strings;
-
 @NotThreadSafe
 public class TestingParallelAPSPImpl implements TestingAPSP, Closeable {
     public static final int MINIMAL_NUMBER_OF_THREADS = 10;
index 5c320ae2c159b6bdd132ad6fd1e5a15d4db33bd3..d25956b774b85ac965d68b4ce74a5cbcb6457859 100644 (file)
@@ -32,7 +32,7 @@ import org.slf4j.LoggerFactory;
 @NotThreadSafe
 public class TestingParallelAPSPModule implements Module,
         TestingParallelAPSPConfigMXBean {
-    private static final Logger logger = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(TestingParallelAPSPModule.class);
 
     private final DependencyResolver dependencyResolver;
@@ -125,13 +125,13 @@ public class TestingParallelAPSPModule implements Module,
                 // changing thread pool is not supported
                 boolean reuse = threadPoolInstance == oldInstance.getThreadPool();
                 if (reuse) {
-                    logger.debug("Reusing old instance");
+                    LOG.debug("Reusing old instance");
                     instance = oldInstance;
                     instance.setSomeParam(someParam);
                 }
             }
             if (instance == null) {
-                logger.debug("Creating new instance");
+                LOG.debug("Creating new instance");
                 if (oldCloseable != null) {
                     try {
                         oldCloseable.close();
index 50a58792e14b700b0bd43ddcccbb9517c9c3a0ab..89b70e3e7ab4fca00351a71dbcd5f75efcd87041 100644 (file)
@@ -7,6 +7,11 @@
  */
 package org.opendaylight.controller.config.manager.testingservices.parallelapsp;
 
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import javax.annotation.concurrent.ThreadSafe;
+import javax.management.ObjectName;
 import org.opendaylight.controller.config.api.DependencyResolver;
 import org.opendaylight.controller.config.api.DependencyResolverFactory;
 import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
@@ -16,12 +21,6 @@ import org.opendaylight.controller.config.spi.Module;
 import org.opendaylight.controller.config.spi.ModuleFactory;
 import org.osgi.framework.BundleContext;
 
-import javax.annotation.concurrent.ThreadSafe;
-import javax.management.ObjectName;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
 @ThreadSafe
 public class TestingParallelAPSPModuleFactory implements ModuleFactory {
 
index f979a45dd15c8dffcc8297c80502a5287b77a991..6fdc8fef412989ec1c8c1ef385820f594eff2774 100644 (file)
@@ -7,15 +7,14 @@
  */
 package org.opendaylight.controller.config.manager.testingservices.parallelapsp.test;
 
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.ObjectName;
 import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;
 import org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPConfigMXBean;
 import org.opendaylight.controller.config.manager.testingservices.parallelapsp.TestingParallelAPSPModuleFactory;
 import org.opendaylight.controller.config.manager.testingservices.threadpool.TestingFixedThreadPoolConfigMXBean;
 import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
 
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.ObjectName;
-
 public abstract class AbstractParallelAPSPTest extends AbstractConfigTest {
     protected final String fixed1 = "fixed1";
     protected final String apsp1 = "apsp-parallel";
index 165a6c7ed62e02bdbb05e5644962dc15b42712d9..598e6bffee1820b92864b9afec75832779720341 100644 (file)
@@ -14,9 +14,7 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.util.Map;
-
 import javax.management.ObjectName;
-
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -139,7 +137,7 @@ public class DependentWiringTest extends AbstractParallelAPSPTest {
     public void testUsingServiceReferences() throws Exception {
         ConfigTransactionJMXClient transaction = configRegistryClient.createTransaction();
         ObjectName threadPoolON = createFixed1(transaction, 10);
-                transaction.lookupConfigBean(getThreadPoolImplementationName(), fixed1);
+        transaction.lookupConfigBean(getThreadPoolImplementationName(), fixed1);
         String refName = "ref";
         ObjectName serviceReferenceON = transaction.saveServiceReference(TestingThreadPoolServiceInterface.QNAME, refName,
                 threadPoolON);
index 0d4fc91a51760963b5b1b6a7f7dae1792544b698..7deade5de25b79d97cbf79b4c0635e8cc3b97f6c 100644 (file)
@@ -7,6 +7,10 @@
  */
 package org.opendaylight.controller.config.manager.testingservices.parallelapsp.test;
 
+import java.io.Closeable;
+import java.io.IOException;
+import java.util.concurrent.Executor;
+import javax.management.ObjectName;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
@@ -21,11 +25,6 @@ import org.opendaylight.controller.config.manager.testingservices.threadpool.Tes
 import org.opendaylight.controller.config.spi.Module;
 import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
 
-import javax.management.ObjectName;
-import java.io.Closeable;
-import java.io.IOException;
-import java.util.concurrent.Executor;
-
 public class MockedDependenciesTest extends AbstractParallelAPSPTest {
     private final String threadPoolImplementationName = "mockedthreadpool";
 
index fb97b64faf769bc360c8e2a582e61b914675380d..0e60db899ded465a14dd3ba6aa8f810baae60fb1 100644 (file)
@@ -7,20 +7,17 @@
  */
 package org.opendaylight.controller.config.manager.testingservices.scheduledthreadpool;
 
+import com.google.common.collect.Lists;
 import java.io.Closeable;
 import java.util.List;
 import java.util.concurrent.Executor;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ScheduledThreadPoolExecutor;
-
 import org.opendaylight.controller.config.api.runtime.HierarchicalRuntimeBeanRegistration;
 import org.opendaylight.controller.config.api.runtime.RootRuntimeBeanRegistrator;
-import org.opendaylight.controller.config.manager.testingservices.scheduledthreadpool.runtimebeans
-        .TestingScheduledRuntimeBean;
+import org.opendaylight.controller.config.manager.testingservices.scheduledthreadpool.runtimebeans.TestingScheduledRuntimeBean;
 import org.opendaylight.controller.config.manager.testingservices.threadpool.TestingThreadPoolIfc;
 
-import com.google.common.collect.Lists;
-
 public class TestingScheduledThreadPoolImpl implements TestingThreadPoolIfc,
         TestingScheduledThreadPoolIfc, Closeable {
     private static volatile int numberOfCloseMethodCalls = 0;
index 2b9760cfc4e922fe8663bfd653bc285fc3c1bc4b..1811e7dd949625c8454d5dd6856bd39da4c40481 100644 (file)
@@ -12,9 +12,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 
 import java.io.Closeable;
-
 import javax.annotation.Nullable;
-
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.api.RuntimeBeanRegistratorAwareModule;
 import org.opendaylight.controller.config.api.runtime.RootRuntimeBeanRegistrator;
index 340e19480175a124bb8408cead317fe05624f08f..f686d27ef4fc5b2475bf5228d8b9a7b59f3bee4b 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.controller.config.manager.testingservices.scheduledthreadpool.test;
 
+import static org.junit.Assert.assertEquals;
+
 import org.junit.After;
 import org.junit.Before;
 import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;
@@ -16,8 +18,6 @@ import org.opendaylight.controller.config.manager.testingservices.scheduledthrea
 import org.opendaylight.controller.config.manager.testingservices.scheduledthreadpool.TestingScheduledThreadPoolModuleFactory;
 import org.opendaylight.controller.config.manager.testingservices.threadpool.TestingFixedThreadPoolModuleFactory;
 
-import static org.junit.Assert.assertEquals;
-
 public abstract class AbstractScheduledTest extends AbstractConfigTest {
     protected static final String scheduled1 = "scheduled1";
 
index d2a0507c2e5ad01f1e16add9656d4b17b9c0d0ba..19e6ef3b78baed4f3a55af2ad1ba650d96053337 100644 (file)
@@ -10,29 +10,24 @@ package org.opendaylight.controller.config.manager.testingservices.scheduledthre
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
 import java.util.Collections;
 import java.util.List;
-
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
 import javax.management.ObjectName;
-
 import org.junit.Test;
 import org.opendaylight.controller.config.api.ConflictingVersionException;
 import org.opendaylight.controller.config.api.ValidationException;
 import org.opendaylight.controller.config.api.jmx.CommitStatus;
 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
-import org.opendaylight.controller.config.manager.testingservices.scheduledthreadpool
-        .TestingScheduledThreadPoolConfigBeanMXBean;
-import org.opendaylight.controller.config.manager.testingservices.scheduledthreadpool
-        .TestingScheduledThreadPoolModuleFactory;
+import org.opendaylight.controller.config.manager.testingservices.scheduledthreadpool.TestingScheduledThreadPoolConfigBeanMXBean;
+import org.opendaylight.controller.config.manager.testingservices.scheduledthreadpool.TestingScheduledThreadPoolModuleFactory;
 import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
 
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-
 /**
  * TestingScheduledThreadPool exports 2 interfaces: <br>
  * {@link org.opendaylight.controller.config.manager.testingservices.scheduledthreadpool.TestingScheduledThreadPoolModuleFactory#NAME}
index 9c8b575fe59a799ca13bd10dd3558a2270fa8596..fcefd06e4da41f73c50b97d0b1e08ccfc324a3cc 100644 (file)
@@ -13,6 +13,7 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+
 import javax.annotation.Nullable;
 import javax.management.DynamicMBean;
 import javax.management.InstanceAlreadyExistsException;
index 25125fcd8287eb77928a258dd8c406a6c40d617b..0f4f00f0baf223c40239e4379b2a6529c10c9a8f 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.controller.config.manager.testingservices.threadpool;
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkNotNull;
 
+import com.google.common.collect.Lists;
 import java.io.Closeable;
 import java.io.IOException;
 import java.util.Collections;
@@ -19,8 +20,6 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ThreadPoolExecutor;
 
-import com.google.common.collect.Lists;
-
 public class TestingFixedThreadPool implements TestingThreadPoolIfc, Closeable,
         TestingModifiableThreadPoolIfc {
     private final ThreadPoolExecutor executorService;
index 0069b44c19d3d87db9b4f2249efaeea0eeb16975..464f786e6f61c55ade0b3047b58e95fc43720515 100644 (file)
@@ -10,10 +10,8 @@ package org.opendaylight.controller.config.manager.testingservices.threadpool;
 import static com.google.common.base.Preconditions.checkState;
 
 import java.io.Closeable;
-
 import javax.annotation.Nullable;
 import javax.annotation.concurrent.NotThreadSafe;
-
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.manager.testingservices.seviceinterface.ModifiableThreadPoolServiceInterface;
 import org.opendaylight.controller.config.spi.Module;
index 4ba3dc89399d11f157fdc833b5a72277e8e33ea1..4ed10036f78e0262442a9986ef14aabbb85db42d 100644 (file)
@@ -7,7 +7,25 @@
  */
 package org.opendaylight.controller.config.manager.testingservices.threadpool.test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import com.google.common.collect.Sets;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ThreadPoolExecutor;
+import javax.management.DynamicMBean;
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanException;
+import javax.management.ObjectName;
+import javax.management.ReflectionException;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -24,25 +42,6 @@ import org.opendaylight.controller.config.manager.testingservices.threadpool.Tes
 import org.opendaylight.controller.config.util.ConfigTransactionClient;
 import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
 
-import javax.management.DynamicMBean;
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanException;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ThreadPoolExecutor;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
 /**
  * Tests basic functionality of configuration registry:
  * <ol>
index 92bf080662b1bc0ecc89e6427b5a0ad1cb8f63ce..85f70b9a01172f314fec16020d508e9769efeea7 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.config.persist.storage.directory.xml;
 
 import static com.google.common.base.Preconditions.checkArgument;
+
 import com.google.common.base.Optional;
 import com.google.common.io.Files;
 import java.io.File;
@@ -90,10 +91,12 @@ public class XmlDirectoryPersister implements Persister {
         } catch (JAXBException e) {
             // In case of parse error, issue a warning, ignore and continue
             LOG.warn(
-                    "Unable to parse configuration snapshot from {}. Initial config from {} will be IGNORED in this run. " +
-                    "Note that subsequent config files may fail due to this problem. " +
+                    "Unable to parse configuration snapshot from {}. Initial config from {} will be IGNORED in this run. ",
+                    file, file);
+            LOG.warn(
+                    "Note that subsequent config files may fail due to this problem. ",
                     "Xml markup in this file needs to be fixed, for detailed information see enclosed exception.",
-                    file, file, e);
+                    e);
         }
 
         return Optional.absent();
index 3e004b4d7cf03a99a7bcfb4e2906f0c437fadf73..90b6d53bd15ef1135d0741627ab42ad676bb5060 100644 (file)
@@ -7,12 +7,11 @@
  */
 package org.opendaylight.controller.configpusherfeature.internal;
 
+import com.google.common.base.Preconditions;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
-
 import javax.xml.bind.JAXBException;
-
 import org.apache.karaf.features.BundleInfo;
 import org.apache.karaf.features.Conditional;
 import org.apache.karaf.features.ConfigFileInfo;
@@ -21,8 +20,6 @@ import org.apache.karaf.features.Feature;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
-
 /*
  * Wrap a Feature for the purposes of extracting the FeatureConfigSnapshotHolders from
  * its underlying ConfigFileInfo's
@@ -30,7 +27,7 @@ import com.google.common.base.Preconditions;
  * Delegates the the contained feature and provides additional methods.
  */
 public class AbstractFeatureWrapper implements Feature {
-    private static final Logger LOGGER = LoggerFactory.getLogger(AbstractFeatureWrapper.class);
+    private static final Logger LOG = LoggerFactory.getLogger(AbstractFeatureWrapper.class);
     protected Feature feature = null;
 
     protected AbstractFeatureWrapper() {
@@ -55,7 +52,7 @@ public class AbstractFeatureWrapper implements Feature {
             try {
                 snapShotHolders.add(new FeatureConfigSnapshotHolder(c,this));
             } catch (JAXBException e) {
-                LOGGER.debug("{} is not a config subsystem config file",c.getFinalname());
+                LOG.debug("{} is not a config subsystem config file",c.getFinalname());
             }
         }
         return snapShotHolders;
index 2bff9069007baa515c8f175740a79fe5e1b325a4..4ea3c5ff752968265d9f9513ba45dbb927a4e652 100644 (file)
@@ -7,11 +7,10 @@
  */
 package org.opendaylight.controller.configpusherfeature.internal;
 
+import com.google.common.base.Preconditions;
 import java.util.LinkedHashSet;
 import java.util.List;
-
 import javax.xml.bind.JAXBException;
-
 import org.apache.felix.utils.version.VersionRange;
 import org.apache.felix.utils.version.VersionTable;
 import org.apache.karaf.features.Dependency;
@@ -21,8 +20,6 @@ import org.osgi.framework.Version;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
-
 /*
  * Wrap a Feature for the purposes of extracting the FeatureConfigSnapshotHolders from
  * its underlying ConfigFileInfo's and those of its children recursively
@@ -30,7 +27,7 @@ import com.google.common.base.Preconditions;
  * Delegates the the contained feature and provides additional methods.
  */
 public class ChildAwareFeatureWrapper extends AbstractFeatureWrapper implements Feature {
-    private static final Logger LOGGER = LoggerFactory.getLogger(ChildAwareFeatureWrapper.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ChildAwareFeatureWrapper.class);
     private FeaturesService featuresService= null;
 
     protected ChildAwareFeatureWrapper(Feature f) {
@@ -79,7 +76,7 @@ public class ChildAwareFeatureWrapper extends AbstractFeatureWrapper implements
                     f = new FeatureConfigSnapshotHolder(h,this);
                     snapShotHolders.add(f);
                 } catch (JAXBException e) {
-                    LOGGER.debug("{} is not a config subsystem config file",h.getFileInfo().getFinalname());
+                    LOG.debug("{} is not a config subsystem config file",h.getFileInfo().getFinalname());
                 }
             }
         }
@@ -97,8 +94,8 @@ public class ChildAwareFeatureWrapper extends AbstractFeatureWrapper implements
                 Version v = VersionTable.getVersion(f.getVersion());
                 if (range.contains(v) &&
                     (fi == null || VersionTable.getVersion(fi.getVersion()).compareTo(v) < 0)) {
-                        fi = f;
-                        break;
+                    fi = f;
+                    break;
                 }
             }
         }
index 2af471999497dde9d933338e8b66526133e2bbc3..72abca1c9911caf4ffbbcc8cbf9939a0eb818daf 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.configpusherfeature.internal;
 
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
-
 import org.apache.karaf.features.FeatureEvent;
 import org.apache.karaf.features.FeaturesListener;
 import org.apache.karaf.features.FeaturesService;
@@ -19,7 +18,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class ConfigFeaturesListener implements  FeaturesListener,  AutoCloseable {
-    private static final Logger LOGGER = LoggerFactory.getLogger(ConfigFeaturesListener.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ConfigFeaturesListener.class);
     private static final int QUEUE_SIZE = 1000;
     private BlockingQueue<FeatureEvent> queue = new LinkedBlockingQueue<FeatureEvent>(QUEUE_SIZE);
     Thread pushingThread = null;
@@ -36,7 +35,7 @@ public class ConfigFeaturesListener implements  FeaturesListener,  AutoCloseable
 
     @Override
     public void repositoryEvent(RepositoryEvent event) {
-        LOGGER.debug("Repository: " + event.getType() + " " + event.getRepository());
+        LOG.debug("Repository: {} {}", event.getType(), event.getRepository());
     }
 
     @Override
index 1a40bb34d7b6fe1a8c296654dd1d6a448ae30421..5c257effba14cfe740c7ad10d1d94527beaf0546 100644 (file)
@@ -7,11 +7,11 @@
  */
 package org.opendaylight.controller.configpusherfeature.internal;
 
+import com.google.common.collect.LinkedHashMultimap;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.TimeUnit;
-
 import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.FeatureEvent;
 import org.apache.karaf.features.FeatureEvent.EventType;
@@ -20,10 +20,8 @@ import org.opendaylight.controller.config.persist.api.ConfigPusher;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.collect.LinkedHashMultimap;
-
 public class ConfigPushingRunnable implements Runnable {
-    private static final Logger LOGGER = LoggerFactory.getLogger(ConfigPushingRunnable.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ConfigPushingRunnable.class);
     private static final int POLL_TIME = 1;
     private BlockingQueue<FeatureEvent> queue;
     private FeatureConfigPusher configPusher;
@@ -49,14 +47,14 @@ public class ConfigPushingRunnable implements Runnable {
                         processFeatureEvent(event,toInstall);
                     }
                 } else if(toInstall.isEmpty()) {
-                    LOGGER.error("ConfigPushingRunnable - exiting");
+                    LOG.error("ConfigPushingRunnable - exiting");
                     return;
                 }
             } catch (InterruptedException e) {
-                LOGGER.error("ConfigPushingRunnable - interupted");
+                LOG.error("ConfigPushingRunnable - interupted");
                 interuppted = true;
             } catch (Exception e) {
-                LOGGER.error("Exception while processing features {}", e);
+                LOG.error("Exception while processing features ", e);
             }
         }
     }
@@ -73,7 +71,7 @@ public class ConfigPushingRunnable implements Runnable {
 
     protected void logPushResult(LinkedHashMultimap<Feature,FeatureConfigSnapshotHolder> results) {
         for(Feature f:results.keySet()) {
-            LOGGER.info("Pushed configs for feature {} {}",f,results.get(f));
+            LOG.info("Pushed configs for feature {} {}",f,results.get(f));
         }
     }
 }
index 5ab5c959f7fcd02d7742866fc35e3a37d6bf3152..1bce5f236414242c3523adbbebb5a551559d1fb1 100644 (file)
@@ -7,27 +7,24 @@
  */
 package org.opendaylight.controller.configpusherfeature.internal;
 
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
 import java.io.File;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.SortedSet;
-
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Unmarshaller;
-
 import org.apache.karaf.features.ConfigFileInfo;
 import org.apache.karaf.features.Feature;
 import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder;
 import org.opendaylight.controller.config.persist.storage.file.xml.model.ConfigSnapshot;
 
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
 /*
  * A ConfigSnapshotHolder that can track all the additional information
  * relavent to the fact we are getting these from a Feature.
index 02f9f8b80a4e0d4483249359c4272223affa23fd..7badc4b294679d6cd88a1d15169c13ca369dc101 100644 (file)
@@ -12,6 +12,11 @@ import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
+import java.io.File;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
+import java.util.SortedSet;
 import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder;
 import org.opendaylight.controller.config.persist.api.Persister;
 import org.opendaylight.controller.config.persist.api.PropertiesProvider;
@@ -21,17 +26,11 @@ import org.opendaylight.controller.config.persist.storage.file.xml.model.ConfigS
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.List;
-import java.util.SortedSet;
-
 /**
  * StorageAdapter that stores configuration in an xml file.
  */
 public class XmlFileStorageAdapter implements StorageAdapter, Persister {
-    private static final Logger LOGGER = LoggerFactory.getLogger(XmlFileStorageAdapter.class);
+    private static final Logger LOG = LoggerFactory.getLogger(XmlFileStorageAdapter.class);
 
     public static final String FILE_STORAGE_PROP = "fileStorage";
     public static final String NUMBER_OF_BACKUPS = "numberOfBackups";
@@ -42,15 +41,15 @@ public class XmlFileStorageAdapter implements StorageAdapter, Persister {
     @Override
     public Persister instantiate(PropertiesProvider propertiesProvider) {
         File storage = extractStorageFileFromProperties(propertiesProvider);
-        LOGGER.debug("Using file {}", storage.getAbsolutePath());
+        LOG.debug("Using file {}", storage.getAbsolutePath());
         // Create file if it does not exist
         File parentFile = storage.getAbsoluteFile().getParentFile();
         if (parentFile.exists() == false) {
-            LOGGER.debug("Creating parent folders {}", parentFile);
+            LOG.debug("Creating parent folders {}", parentFile);
             parentFile.mkdirs();
         }
         if (storage.exists() == false) {
-            LOGGER.debug("Storage file does not exist, creating empty file");
+            LOG.debug("Storage file does not exist, creating empty file");
             try {
                 boolean result = storage.createNewFile();
                 if (result == false)
@@ -87,7 +86,7 @@ public class XmlFileStorageAdapter implements StorageAdapter, Persister {
         } else {
             numberOfStoredBackups = Integer.MAX_VALUE;
         }
-        LOGGER.trace("Property {} set to {}", NUMBER_OF_BACKUPS, numberOfStoredBackups);
+        LOG.trace("Property {} set to {}", NUMBER_OF_BACKUPS, numberOfStoredBackups);
         return result;
     }
 
index fb84651ca1446771af3a2cb397d535a3cbbf3ec5..354c8c0540ea69330375e96051aadc67f76f8635 100644 (file)
@@ -12,8 +12,9 @@ import com.google.common.base.Optional;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 import com.google.common.io.Files;
-import org.apache.commons.lang3.StringUtils;
-
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Marshaller;
@@ -21,9 +22,7 @@ import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlRootElement;
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
+import org.apache.commons.lang3.StringUtils;
 
 @XmlRootElement(name = "persisted-snapshots")
 public final class Config {
index 03b03befe06f3074ad32cc98ceebb89b78e54f94..4f050640c5db829949a9909745da3e0bdc3ae5d1 100644 (file)
@@ -7,15 +7,14 @@
  */
 package org.opendaylight.controller.config.persist.storage.file.xml.model;
 
+import java.util.SortedSet;
 import java.util.TreeSet;
-import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder;
-
 import javax.xml.bind.annotation.XmlAnyElement;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import java.util.SortedSet;
+import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder;
 
 @XmlRootElement(name = ConfigSnapshot.SNAPSHOT_ROOT_ELEMENT_NAME)
 public class ConfigSnapshot {
index dd3941040905529bf353707a48f72524b7af8e28..8214b369702d4c1441975b6d13c019d00a306d95 100644 (file)
@@ -7,13 +7,13 @@
  */
 package org.opendaylight.controller.config.persist.storage.file.xml.model;
 
+import java.io.StringReader;
+import java.io.StringWriter;
 import javax.xml.bind.ValidationEventHandler;
 import javax.xml.bind.annotation.DomHandler;
 import javax.xml.transform.Source;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
-import java.io.StringReader;
-import java.io.StringWriter;
 
 class SnapshotHandler implements DomHandler<String, StreamResult> {
 
index 942ba4c4b3683f2590705b838c6fdf689fc26a76..3ea9a48a5d759bb9c2cecf830fdc4cd40e3c9bdf 100644 (file)
@@ -8,11 +8,12 @@
 
 package org.opendaylight.controller.config.persist.storage.file.xml;
 
-import static org.junit.Assert.assertFalse;
 import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertThat;
+
 import com.google.common.base.Charsets;
 import java.io.File;
 import java.io.FileNotFoundException;
index e907502497edcab40385747d570d6ab8e7d01044..99d46cb638c3255d59532f4018176720b51bd85b 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.controller.config.util;
 
 import javax.management.ObjectName;
-
 import org.opendaylight.controller.config.api.jmx.ConfigRegistryMXBean;
 
 public interface ConfigRegistryClient extends ConfigRegistryMXBean {
index 11f64e959b450eec42b744c8cfdabd3d91d66594..099d010642ee510052a43ade62b77e2e20f2a884 100644 (file)
@@ -7,12 +7,10 @@
  */
 package org.opendaylight.controller.config.util;
 
-import org.opendaylight.controller.config.api.ConflictingVersionException;
-import org.opendaylight.controller.config.api.ValidationException;
-import org.opendaylight.controller.config.api.jmx.CommitStatus;
-import org.opendaylight.controller.config.api.jmx.ConfigRegistryMXBean;
-import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
-
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import javax.management.AttributeNotFoundException;
 import javax.management.InstanceNotFoundException;
 import javax.management.JMException;
@@ -22,10 +20,11 @@ import javax.management.MBeanServer;
 import javax.management.ObjectInstance;
 import javax.management.ObjectName;
 import javax.management.ReflectionException;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import org.opendaylight.controller.config.api.ConflictingVersionException;
+import org.opendaylight.controller.config.api.ValidationException;
+import org.opendaylight.controller.config.api.jmx.CommitStatus;
+import org.opendaylight.controller.config.api.jmx.ConfigRegistryMXBean;
+import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
 import org.opendaylight.controller.config.api.jmx.ServiceReferenceMXBean;
 
 public class ConfigRegistryJMXClient implements ConfigRegistryClient {
index f5381424de8c217414a326212c69b25879c52fe8..359035d51dd57aebc9762ba27d5e272eeb80ceea 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.controller.config.util;
 import javax.management.Attribute;
 import javax.management.InstanceNotFoundException;
 import javax.management.ObjectName;
-
 import org.opendaylight.controller.config.api.ConflictingVersionException;
 import org.opendaylight.controller.config.api.ValidationException;
 import org.opendaylight.controller.config.api.jmx.CommitStatus;
index 20e26f6508513a70c60694586e8351e9e84709bc..a0af19796ebedfa5bedc809a5ce18f3b23d5858e 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.config.util;
 
 import java.util.Map;
 import java.util.Set;
-
 import javax.management.Attribute;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
@@ -18,7 +17,6 @@ import javax.management.JMX;
 import javax.management.MBeanException;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
-
 import org.opendaylight.controller.config.api.ConflictingVersionException;
 import org.opendaylight.controller.config.api.ValidationException;
 import org.opendaylight.controller.config.api.jmx.CommitStatus;
index 200fa8854db4965fa60c759c8e15d199a9f75264..c7c08c44e33e2fb525a52f15c360039396a8cc19 100644 (file)
@@ -2,6 +2,7 @@ package org.opendaylight.controller.config.util;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
+
 import org.junit.Before;
 import org.junit.Test;
 
index fc1c3f8afe30c9ed8965a085611745bf5306d44f..d0fcc7b6cdcca3dd70e1ae48d83997c5fe195f77 100644 (file)
@@ -12,6 +12,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertThat;
+
 import com.google.common.collect.Sets;
 import java.lang.management.ManagementFactory;
 import java.util.HashMap;
index 2f50513345c2b3ef727a8c027a1206ed78fe8bd9..37b08e4671cd1b424a140799fe6cc47036d33fd9 100644 (file)
@@ -12,16 +12,15 @@ import static org.junit.Assert.assertNull;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 
+import com.google.common.collect.Sets;
 import java.lang.management.ManagementFactory;
 import java.util.Collections;
 import java.util.Map;
 import java.util.Set;
-
 import javax.management.Attribute;
 import javax.management.MBeanException;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
-
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -31,8 +30,6 @@ import org.opendaylight.controller.config.api.ValidationException;
 import org.opendaylight.controller.config.api.ValidationException.ExceptionMessageWithStackTrace;
 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
 
-import com.google.common.collect.Sets;
-
 public class ConfigTransactionClientsTest {
     private final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
     private TestingConfigTransactionController transactionController;
@@ -156,7 +153,7 @@ public class ConfigTransactionClientsTest {
     @Ignore
     public void testAssertVersion() {
         jmxTransactionClient.assertVersion((int)jmxTransactionClient.getParentVersion(),
-        (int)jmxTransactionClient.getVersion());
+            (int)jmxTransactionClient.getVersion());
     }
 
     @Test(expected = NullPointerException.class)
index 3bc362b38c8bc9d0fa9b8e8ebb48185f72f1b07d..f9d0a5c647a56876ed0aa69f3a3131189c31c479 100644 (file)
@@ -7,8 +7,20 @@
  */
 package org.opendaylight.controller.config.util;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
+import java.lang.management.ManagementFactory;
+import java.lang.reflect.Method;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -17,19 +29,6 @@ import org.opendaylight.controller.config.api.LookupRegistry;
 import org.opendaylight.controller.config.api.jmx.ConfigTransactionControllerMXBean;
 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
 
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import java.lang.management.ManagementFactory;
-import java.lang.reflect.Method;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
 public class LookupTest {
 
     private TestingConfigRegistry testingRegistry;
index ab6cda935bd5976fc2c1f446d82bc68393c41d35..8732aa72d127a8d95831e7b34a34e5e5bb01ff3b 100644 (file)
@@ -7,14 +7,13 @@
  */
 package org.opendaylight.controller.config.util;
 
+import com.google.common.collect.Sets;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-
 import javax.management.InstanceNotFoundException;
 import javax.management.ObjectName;
-
 import org.opendaylight.controller.config.api.ConflictingVersionException;
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.api.ValidationException;
@@ -22,8 +21,6 @@ import org.opendaylight.controller.config.api.jmx.CommitStatus;
 import org.opendaylight.controller.config.api.jmx.ConfigRegistryMXBean;
 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
 
-import com.google.common.collect.Sets;
-
 public class TestingConfigRegistry implements ConfigRegistryMXBean {
 
     static final ObjectName conf1, conf2, conf3, run1, run2, run3;
index ee1e61967db9b7180f232de50fdd277cc0293009..e1138addc74bd9a6d2072b80d93fe98263a46ffc 100644 (file)
@@ -7,20 +7,17 @@
  */
 package org.opendaylight.controller.config.util;
 
+import com.google.common.collect.Sets;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
-
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
 import javax.management.ObjectName;
-
 import org.opendaylight.controller.config.api.ValidationException;
 import org.opendaylight.controller.config.api.jmx.ConfigTransactionControllerMXBean;
 import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
 
-import com.google.common.collect.Sets;
-
 public class TestingConfigTransactionController implements
         ConfigTransactionControllerMXBean {
 
index 99866d576727eb7149290aa5e74cc01071a00d9b..fa670098581e9108088ed7b81ca3b9e156a88b67 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.logback.config.loader;
 
 import java.io.File;
 import java.util.List;
-
 import org.opendaylight.controller.logback.config.loader.impl.LogbackConfigUtil;
 import org.opendaylight.controller.logback.config.loader.impl.LogbackConfigurationLoader;
 import org.osgi.framework.BundleActivator;
@@ -27,7 +26,7 @@ public class Activator implements BundleActivator {
      * logback configurations
      */
     private static final String LOGBACK_CONFIG_D = "logback.config.d";
-    private static Logger LOG = LoggerFactory.getLogger(Activator.class);
+    private static final Logger LOG = LoggerFactory.getLogger(Activator.class);
 
     @Override
     public void start(BundleContext context) {
index 2aa6b1a3484e4d8c53fb1132378403b54b2ea92b..accb6e1d038d21fb30c93b9a52b40adf78885549 100644 (file)
@@ -7,18 +7,16 @@
  */
 package org.opendaylight.controller.logback.config.loader.impl;
 
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.joran.JoranConfigurator;
+import ch.qos.logback.core.joran.spi.JoranException;
+import ch.qos.logback.core.util.StatusPrinter;
 import java.io.File;
 import java.net.URL;
-
 import org.slf4j.ILoggerFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import ch.qos.logback.classic.LoggerContext;
-import ch.qos.logback.classic.joran.JoranConfigurator;
-import ch.qos.logback.core.joran.spi.JoranException;
-import ch.qos.logback.core.util.StatusPrinter;
-
 /**
  * Logback configuration loader.
  * Strategy:
index adbb9f4cd63db212df666a68101f61459f76733f..44a84b7a9ed7a19577abe271cb14869a1994fd06 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.controller.logback.config.loader.test;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -33,7 +32,7 @@ public class LogbackConfigurationLoaderTest {
 
     /** logback config root */
     private static final String LOGBACK_D = "/logback.d";
-    private static Logger LOG = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(LogbackConfigurationLoaderTest.class);
 
     /**
index b273d2777ceb79312ce3c76044ffd409cda867d5..a950c818fe992eebffa9380c27db1d6a0725382c 100644 (file)
@@ -7,9 +7,6 @@
  */
 package org.opendaylight.controller.logback.config.loader.test;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import ch.qos.logback.classic.spi.LoggingEvent;
 import ch.qos.logback.core.Appender;
 import ch.qos.logback.core.Context;
@@ -17,6 +14,8 @@ import ch.qos.logback.core.LogbackException;
 import ch.qos.logback.core.filter.Filter;
 import ch.qos.logback.core.spi.FilterReply;
 import ch.qos.logback.core.status.Status;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * dummy appender for collecting log messages
index a8052f71c94828c5cda097848bb9b33d7973f566..ec10ae9fa699602839566045d507a966c8a56b72 100644 (file)
@@ -15,7 +15,7 @@ import org.slf4j.LoggerFactory;
  */
 public class Debugger {
 
-    private static Logger LOG = LoggerFactory.getLogger(Debugger.class);
+    private static final Logger LOG = LoggerFactory.getLogger(Debugger.class);
 
     /**
      * all logging
index 0bcd830ad10a83283e2245b6b6b8065d6b91e715..e33b7f9d15097bc91876900ef74c4bb9cbff097c 100644 (file)
@@ -15,7 +15,7 @@ import org.slf4j.LoggerFactory;
  */
 public class Errorer {
 
-    private static Logger LOG = LoggerFactory.getLogger(Errorer.class);
+    private static final Logger LOG = LoggerFactory.getLogger(Errorer.class);
 
     /**
      * all logging
index 44f09315cff09f4696d8e7e2e3164cb8170a90f6..06c518349c9ba4cfb90a5b5970da2710066144f9 100644 (file)
@@ -15,7 +15,7 @@ import org.slf4j.LoggerFactory;
  */
 public class Informer {
 
-    private static Logger LOG = LoggerFactory.getLogger(Informer.class);
+    private static final Logger LOG = LoggerFactory.getLogger(Informer.class);
 
     /**
      * all logging
index 70df607d8dbca275ec24fe94d84f3e2b0a7b0924..c842c1a26037e3b53d50ea39b6e71823a73c38e4 100644 (file)
@@ -15,7 +15,7 @@ import org.slf4j.LoggerFactory;
  */
 public class Tracer {
 
-    private static Logger LOG = LoggerFactory.getLogger(Tracer.class);
+    private static final Logger LOG = LoggerFactory.getLogger(Tracer.class);
 
     /**
      * all logging
index 8093180a8b94a321ca8156d09885a971fde37947..aae0c34512ea084939f7480b3a9e1997d8d15b21 100644 (file)
@@ -15,7 +15,7 @@ import org.slf4j.LoggerFactory;
  */
 public class Warner {
 
-    private static Logger LOG = LoggerFactory.getLogger(Warner.class);
+    private static final Logger LOG = LoggerFactory.getLogger(Warner.class);
 
     /**
      * all logging
index a46a6d1e79a21fc6b1811b762f11d0ec41515148..276f4ec2d0b7f58ef204abe0c1a267a555f3ccfa 100644 (file)
@@ -41,10 +41,8 @@ public class InMemoryBrokerWriteTransactionBenchmark extends AbstractInMemoryBro
         executor = MoreExecutors.listeningDecorator(
             MoreExecutors.getExitingExecutorService((ThreadPoolExecutor)Executors.newFixedThreadPool(1), 1L, TimeUnit.SECONDS));
 
-        InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER", dsExec,
-            MoreExecutors.sameThreadExecutor());
-        InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG", dsExec,
-            MoreExecutors.sameThreadExecutor());
+        InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER", dsExec);
+        InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG", dsExec);
         Map<LogicalDatastoreType, DOMStore> datastores = ImmutableMap.of(
             LogicalDatastoreType.OPERATIONAL, (DOMStore)operStore,
             LogicalDatastoreType.CONFIGURATION, configStore);
diff --git a/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWithExecutorServiceBenchmark.java b/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWithExecutorServiceBenchmark.java
deleted file mode 100644 (file)
index 77a4966..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.md.sal.dom.store.benchmark;
-
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.TimeUnit;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
-import org.opendaylight.yangtools.util.concurrent.SpecialExecutors;
-import org.openjdk.jmh.annotations.BenchmarkMode;
-import org.openjdk.jmh.annotations.Fork;
-import org.openjdk.jmh.annotations.Level;
-import org.openjdk.jmh.annotations.Mode;
-import org.openjdk.jmh.annotations.OutputTimeUnit;
-import org.openjdk.jmh.annotations.Scope;
-import org.openjdk.jmh.annotations.Setup;
-import org.openjdk.jmh.annotations.State;
-import org.openjdk.jmh.annotations.TearDown;
-
-/**
- * Benchmark for testing of performance of write operations for InMemoryDataStore. The instance
- * of benchmark creates InMemoryDataStore with Data Change Listener Executor Service as BlockingBoundedFastThreadPool
- * and DOM Store Executor Service as Blocking Bounded Fast Thread Pool.
- *
- * @see org.opendaylight.yangtools.util.concurrent.SpecialExecutors
- * @see org.opendaylight.controller.md.sal.dom.store.benchmark.AbstractInMemoryDatastoreWriteTransactionBenchmark
- *
- * @author Lukas Sedlak <lsedlak@cisco.com>
- */
-@State(Scope.Thread)
-@BenchmarkMode(Mode.AverageTime)
-@OutputTimeUnit(TimeUnit.MILLISECONDS)
-@Fork(1)
-public class InMemoryDataStoreWithExecutorServiceBenchmark extends AbstractInMemoryDatastoreWriteTransactionBenchmark  {
-
-    private static final int MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE = 20;
-    private static final int MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE = 1000;
-    private static final int MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE = 5000;
-
-    @Override
-    @Setup(Level.Trial)
-    public void setUp() throws Exception {
-        final String name = "DS_BENCHMARK";
-        final ExecutorService dataChangeListenerExecutor = SpecialExecutors.newBlockingBoundedFastThreadPool(
-            MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE, MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE, name + "-DCL");
-
-        final ListeningExecutorService domStoreExecutor = MoreExecutors.listeningDecorator(SpecialExecutors.newBoundedSingleThreadExecutor(
-            MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE, "DOMStore-" + name ));
-
-        domStore = new InMemoryDOMDataStore(name, domStoreExecutor,
-            dataChangeListenerExecutor);
-        schemaContext = BenchmarkModel.createTestContext();
-        domStore.onGlobalContextUpdated(schemaContext);
-        initTestNode();
-    }
-
-    @Override
-    @TearDown
-    public void tearDown() {
-        schemaContext = null;
-        domStore = null;
-    }
-}
index 6a0ceccd535daf2dbcf76dc726fd3a0be320e919..1aa19b2fe753ef13ef71c9587d4f40b03209c37b 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.controller.md.sal.dom.store.benchmark;
 
-import com.google.common.util.concurrent.MoreExecutors;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.TimeUnit;
 import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
@@ -44,8 +43,7 @@ public class InMemoryDataStoreWithSameThreadedExecutorBenchmark extends Abstract
         final ExecutorService dataChangeListenerExecutor = SpecialExecutors.newBlockingBoundedFastThreadPool(
             MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE, MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE, name + "-DCL");
 
-        domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", MoreExecutors.sameThreadExecutor(),
-            dataChangeListenerExecutor);
+        domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", dataChangeListenerExecutor);
         schemaContext = BenchmarkModel.createTestContext();
         domStore.onGlobalContextUpdated(schemaContext);
         initTestNode();
index d3dda96af5aa309d329b7800a94f831e7d3a898b..d697f3ca984ba42671387f6254747c7b19617b58 100644 (file)
@@ -35,8 +35,7 @@ public class InMemoryDataStoreWriteTransactionBenchmark extends AbstractInMemory
 
     @Setup(Level.Trial)
     public void setUp() throws Exception {
-        domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", MoreExecutors.sameThreadExecutor(),
-            MoreExecutors.sameThreadExecutor());
+        domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", MoreExecutors.sameThreadExecutor());
         schemaContext = BenchmarkModel.createTestContext();
         domStore.onGlobalContextUpdated(schemaContext);
         initTestNode();
index 36ab41fa6809b0c04e85e5e2db1ad3e0b445735b..30704997f3de32ef759f55d147598e2a23e15824 100644 (file)
@@ -56,15 +56,13 @@ public class DataBrokerTestCustomizer {
     }
 
     public DOMStore createConfigurationDatastore() {
-        InMemoryDOMDataStore store = new InMemoryDOMDataStore("CFG",
-                MoreExecutors.sameThreadExecutor(), MoreExecutors.sameThreadExecutor());
+        InMemoryDOMDataStore store = new InMemoryDOMDataStore("CFG", MoreExecutors.sameThreadExecutor());
         schemaService.registerSchemaContextListener(store);
         return store;
     }
 
     public DOMStore createOperationalDatastore() {
-        InMemoryDOMDataStore store = new InMemoryDOMDataStore("OPER",
-                MoreExecutors.sameThreadExecutor(), MoreExecutors.sameThreadExecutor());
+        InMemoryDOMDataStore store = new InMemoryDOMDataStore("OPER", MoreExecutors.sameThreadExecutor());
         schemaService.registerSchemaContextListener(store);
         return store;
     }
index b4876a3ee0883f1ac7dcc405fd6439e56e2a7f10..f6f594b34f5db5e392553cdf72b690d29743592a 100644 (file)
@@ -8,14 +8,13 @@
 package test.mock.util;
 
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.controller.sal.dom.broker.impl.SchemaContextProvider;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.util.ListenerRegistry;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 
-@SuppressWarnings("deprecation")
 public final class MockSchemaService implements SchemaService, SchemaContextProvider {
 
     private SchemaContext schemaContext;
index 7664a9bfe4bc37db0241a37f5c3d4983d7435b28..b9159dccd14e2721b463568bc5cca7ed3ba3fcb6 100644 (file)
                         </schema-service>
                     </inmemory-operational-datastore-provider>
                 </module>
+
+                <!-- PingPong broker -->
+                <module>
+                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:pingpong">prefix:pingpong-data-broker</type>
+                    <name>pingpong-data-broker</name>
+                    <data-broker>
+                        <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-async-data-broker</type>
+                        <name>inmemory-data-broker</name>
+                    </data-broker>
+                </module>
+                <module>
+                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-forwarded-data-broker</type>
+                    <name>pingpong-binding-data-broker</name>
+                    <binding-forwarded-data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
+                        <dom-async-broker>
+                            <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-async-data-broker</type>
+                            <name>pingpong-broker</name>
+                        </dom-async-broker>
+                        <schema-service>
+                            <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>
+                            <name>yang-schema-service</name>
+                        </schema-service>
+                        <binding-mapping-service>
+                            <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-dom-mapping-service</type>
+                            <name>runtime-mapping-singleton</name>
+                        </binding-mapping-service>
+                    </binding-forwarded-data-broker>
+                </module>
+
                 <!--
                      Tree-based in-memory data store. This is the data store which is currently
                      recommended for single-node deployments.
                     <name>binding-async-data-broker</name>
                     <binding-forwarded-data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
                         <dom-async-broker>
-                            <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-broker-osgi-registry</type>
-                            <name>dom-broker</name>
+                            <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-async-data-broker</type>
+                            <name>inmemory-data-broker</name>
                         </dom-async-broker>
+                        <schema-service>
+                            <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>
+                            <name>yang-schema-service</name>
+                        </schema-service>
                         <binding-mapping-service>
                             <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-dom-mapping-service</type>
                             <name>runtime-mapping-singleton</name>
                             <name>binding-data-broker</name>
                             <provider>/modules/module[type='binding-forwarded-data-broker'][name='binding-async-data-broker']</provider>
                         </instance>
+                        <instance>
+                            <name>pingpong-binding-data-broker</name>
+                            <provider>/modules/module[type='binding-forwarded-data-broker'][name='pingpong-binding-data-broker']</provider>
+                        </instance>
                     </service>
 
                     <service>
                             <name>inmemory-data-broker</name>
                             <provider>/modules/module[type='dom-inmemory-data-broker'][name='inmemory-data-broker']</provider>
                         </instance>
+                        <instance>
+                            <name>pingpong-broker</name>
+                            <provider>/modules/module[type='pingpong-data-broker'][name='pingpong-data-broker']</provider>
+                        </instance>
                     </service>
             </services>
         </data>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&amp;revision=2013-10-28</capability>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom?module=opendaylight-md-sal-dom&amp;revision=2013-10-28</capability>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl?module=opendaylight-sal-binding-broker-impl&amp;revision=2013-10-28</capability>
+        <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:pingpong?module=opendaylight-pingpong-broker&amp;revision=2014-11-07</capability>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl?module=opendaylight-sal-dom-broker-impl&amp;revision=2013-10-28</capability>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:common?module=opendaylight-md-sal-common&amp;revision=2013-10-28</capability>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:core:spi:config-dom-store?module=opendaylight-config-dom-datastore&amp;revision=2014-06-17</capability>
index 2c4304d404a57ca919cb0c71f274588c6654f6e5..4d2bad5c2effe1f55a7abb3e74786e30390abaab 100644 (file)
@@ -72,5 +72,10 @@ public interface FollowerLogInformation {
      */
     public void markFollowerActive();
 
+    /**
+     * This will stop the timeout clock
+     */
+    public void markFollowerInActive();
+
 
 }
index c0cfd7e862e189b42036a246cc81f32e3d253e01..7df80af58a717e99c1a226c3bd6cbb17ccd92afc 100644 (file)
@@ -80,4 +80,11 @@ public class FollowerLogInformationImpl implements FollowerLogInformation{
         }
         stopwatch.start();
     }
+
+    @Override
+    public void markFollowerInActive() {
+        if (stopwatch.isRunning()) {
+            stopwatch.stop();
+        }
+    }
 }
index 0dd39001136a25416c241eb8fb69085266d3752c..97ecef370f08f00c7a2041b1897498a10d42fd60 100644 (file)
@@ -113,4 +113,9 @@ public class Leader extends AbstractLeader {
     void markFollowerActive(String followerId) {
         followerToLog.get(followerId).markFollowerActive();
     }
+
+    @VisibleForTesting
+    void markFollowerInActive(String followerId) {
+        followerToLog.get(followerId).markFollowerInActive();
+    }
 }
index 6b534deb1f5db6e8f7b773ddd2004f6b0f44ee71..0fc0b4ccfde37a802322e8d023c759f0e58ffd7e 100644 (file)
@@ -6,7 +6,6 @@ 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;
@@ -994,10 +993,7 @@ public class LeaderTest extends AbstractRaftActorBehaviorTest {
             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.markFollowerInActive("follower-1");
             leader.markFollowerActive("follower-2");
             behavior = leader.handleMessage(leaderActor, new IsolatedLeaderCheck());
             Assert.assertTrue("Behavior not instance of Leader when majority of followers are active",
@@ -1010,10 +1006,7 @@ public class LeaderTest extends AbstractRaftActorBehaviorTest {
             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);
-
+            leader.markFollowerInActive("follower-2");
             behavior = leader.handleMessage(leaderActor, new IsolatedLeaderCheck());
             Assert.assertTrue("Behavior not instance of IsolatedLeader when majority followers are inactive",
                 behavior instanceof IsolatedLeader);
index 2a79c8f4bccae74605923ae5c90af5d59b1f3512..9fbdd4587f2c5e9f5b4a53e53876ca6981fb8af9 100644 (file)
@@ -29,7 +29,7 @@ public class MessageCollectorActor extends UntypedActor {
     @Override public void onReceive(Object message) throws Exception {
         if(message instanceof String){
             if("get-all-messages".equals(message)){
-                getSender().tell(messages, getSelf());
+                getSender().tell(new ArrayList(messages), getSelf());
             }
         } else {
             messages.add(message);
index 93d99c832fcc2bbffe5a7c5f851fe2fec2ef7558..d0d68218c04635bc6835bdca9f5bb84a33a4f38c 100644 (file)
@@ -1,18 +1,12 @@
 package org.opendaylight.controller.config.yang.md.sal.binding.impl;
 
-import java.util.Collection;
-import java.util.Collections;
 import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
 import org.opendaylight.controller.md.sal.binding.impl.ForwardedBindingDataBroker;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.sal.core.api.Broker;
-import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
-import org.opendaylight.controller.sal.core.api.Provider;
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
 
 public class BindingAsyncDataBrokerImplModule extends
-        org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractBindingAsyncDataBrokerImplModule implements
-        Provider {
+        org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractBindingAsyncDataBrokerImplModule {
 
     public BindingAsyncDataBrokerImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
             final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
@@ -34,29 +28,10 @@ public class BindingAsyncDataBrokerImplModule extends
 
     @Override
     public java.lang.AutoCloseable createInstance() {
-        Broker domBroker = getDomAsyncBrokerDependency();
-        BindingToNormalizedNodeCodec mappingService = getBindingMappingServiceDependency();
-
-        // FIXME: Switch this to DOM Broker registration which would not require
-        // BundleContext when API are updated.
-        ProviderSession session = domBroker.registerProvider(this, null);
-        DOMDataBroker domDataBroker = session.getService(DOMDataBroker.class);
-        SchemaService schemaService = session.getService(SchemaService.class);
+        final BindingToNormalizedNodeCodec mappingService = getBindingMappingServiceDependency();
+        final DOMDataBroker domDataBroker = getDomAsyncBrokerDependency();
+        final SchemaService schemaService = getSchemaServiceDependency();
         return new ForwardedBindingDataBroker(domDataBroker, mappingService, schemaService);
     }
 
-
-
-
-
-    @Override
-    public Collection<ProviderFunctionality> getProviderFunctionality() {
-        return Collections.emptySet();
-    }
-
-    @Override
-    public void onSessionInitiated(final ProviderSession arg0) {
-        // intentional NOOP
-    }
-
 }
index 52e114b0ea969436bd4ea2928babf0df7e5f9b96..d7763d837f50827c85f0094dbd889acd8751ce72 100644 (file)
@@ -52,7 +52,7 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@SuppressWarnings("deprecation")
+@Deprecated
 public class ForwardedBackwardsCompatibleDataBroker extends AbstractForwardedDataBroker implements DataProviderService, AutoCloseable {
 
     private static final Logger LOG = LoggerFactory.getLogger(ForwardedBackwardsCompatibleDataBroker.class);
@@ -183,6 +183,7 @@ public class ForwardedBackwardsCompatibleDataBroker extends AbstractForwardedDat
         });
     }
 
+    @Deprecated
     private class ForwardedBackwardsCompatibleTransacion extends
             AbstractReadWriteTransaction implements DataModificationTransaction {
 
index ce1ff450c979775e2546d8c2463580abc7b57d5e..667d28ed8d4b958104143ac1d7cee1ebd99c7c75 100644 (file)
@@ -17,6 +17,7 @@ import org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
+@Deprecated
 public abstract class LegacyDataChangeEvent implements
         DataChangeEvent<InstanceIdentifier<? extends DataObject>, DataObject> {
 
index d4cfb563f633cb1f21a0a6055010a9a98bfd19b7..4ed0ce9b4072c27b13fc439805bedc3e4d1d9d0a 100644 (file)
@@ -29,6 +29,7 @@ import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableMap.Builder;
 import com.google.common.collect.Maps;
 
+@Deprecated
 public class DataBrokerImpl extends
         AbstractDataBroker<InstanceIdentifier<? extends DataObject>, DataObject, DataChangeListener> //
         implements DataProviderService, AutoCloseable {
index 15314d3bdcd077ec96f772123648512a024763f8..4020232bf48fdb87381bba22e87adda25d0f6104 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.yangtools.util.ListenerRegistry;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
+@Deprecated
 public class DataTransactionImpl extends AbstractDataTransaction<InstanceIdentifier<? extends DataObject>, DataObject>
     implements DataModificationTransaction {
     private final ListenerRegistry<DataTransactionListener> listeners = new ListenerRegistry<DataTransactionListener>();
index 081adb44dc521a618dcc4ae8848f9885f2cb8cfb..3c8e787c4aa336abed6fd45ddc4c2a3b88df2468 100644 (file)
@@ -13,6 +13,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 
+@Deprecated
 class BindingToDomTransaction implements
     DataCommitHandler.DataCommitTransaction<InstanceIdentifier<? extends DataObject>, DataObject> {
 
index a5a34dad807e7800fc422c4b256f6067a61c5451..82c15ef993bd2a5c76641916810ee25734315287 100644 (file)
@@ -12,6 +12,7 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
+@Deprecated
 class DomToBindingTransaction implements
     DataCommitHandler.DataCommitTransaction<YangInstanceIdentifier, CompositeNode> {
 
index aec27235910633fb34389208e02b550c81a85a43..de8ab63c0a72b403438505f5f3aeadb918e0e4b9 100644 (file)
@@ -135,7 +135,32 @@ module opendaylight-sal-binding-broker-impl {
         case binding-forwarded-data-broker {
             when "/config:modules/config:module/config:type = 'binding-forwarded-data-broker'";
             container binding-forwarded-data-broker {
-                uses dom-forwarding-component;
+                container dom-async-broker {
+                    uses config:service-ref {
+                        refine type {
+                            mandatory true;
+                            config:required-identity dom:dom-async-data-broker;
+                        }
+                    }
+                }
+
+                container binding-mapping-service {
+                    uses config:service-ref {
+                        refine type {
+                            mandatory true;
+                            config:required-identity binding-dom-mapping-service;
+                        }
+                    }
+                }
+
+                container schema-service {
+                    uses config:service-ref {
+                        refine type {
+                            mandatory false;
+                            config:required-identity dom:schema-service;
+                        }
+                    }
+                }
             }
         }
     }
index c869b1dbd3e1df95165f46b5ef992bbe4199cafc..d99ac6f2f0fe11d802c079ca92d9712dc1755a1d 100644 (file)
@@ -56,15 +56,13 @@ public class DataBrokerTestCustomizer {
     }
 
     public DOMStore createConfigurationDatastore() {
-        InMemoryDOMDataStore store = new InMemoryDOMDataStore("CFG",
-                MoreExecutors.sameThreadExecutor(), MoreExecutors.sameThreadExecutor());
+        InMemoryDOMDataStore store = new InMemoryDOMDataStore("CFG", MoreExecutors.sameThreadExecutor());
         schemaService.registerSchemaContextListener(store);
         return store;
     }
 
     public DOMStore createOperationalDatastore() {
-        InMemoryDOMDataStore store = new InMemoryDOMDataStore("OPER",
-                MoreExecutors.sameThreadExecutor(), MoreExecutors.sameThreadExecutor());
+        InMemoryDOMDataStore store = new InMemoryDOMDataStore("OPER", MoreExecutors.sameThreadExecutor());
         schemaService.registerSchemaContextListener(store);
         return store;
     }
index 63e0e2290aadd37e697d6a36d6de3fb779c3ab7f..7aed0dba39e1f27d086ed1aa9a4e433dbbcb42b1 100644 (file)
@@ -47,6 +47,7 @@ import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 
+@Deprecated
 public class MultipleAugmentationPutsTest extends AbstractDataServiceTest implements DataChangeListener {
 
     private static final QName NODE_ID_QNAME = QName.create(Node.QNAME, "id");
index d0a326adff83054ff99cbc9e0b1278dde8ed6ad4..979f9aa73eaa6eba113a09fc28f56b5aaa6ccfe7 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.controller.sal.binding.test.util;
 
 import static com.google.common.base.Preconditions.checkState;
-
 import com.google.common.annotations.Beta;
 import com.google.common.collect.ClassToInstanceMap;
 import com.google.common.collect.ImmutableClassToInstanceMap;
@@ -138,10 +137,8 @@ public class BindingTestContext implements AutoCloseable {
 
     public void startNewDomDataBroker() {
         checkState(executor != null, "Executor needs to be set");
-        InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER", executor,
-                MoreExecutors.sameThreadExecutor());
-        InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG", executor,
-                MoreExecutors.sameThreadExecutor());
+        InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER", MoreExecutors.sameThreadExecutor());
+        InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG", MoreExecutors.sameThreadExecutor());
         newDatastores = ImmutableMap.<LogicalDatastoreType, DOMStore>builder()
                 .put(LogicalDatastoreType.OPERATIONAL, operStore)
                 .put(LogicalDatastoreType.CONFIGURATION, configStore)
@@ -319,12 +316,12 @@ public class BindingTestContext implements AutoCloseable {
         updateYangSchema(moduleInfos);
     }
 
-    @SuppressWarnings("deprecation")
+    @Deprecated
     public DataProviderService getBindingDataBroker() {
         return baData;
     }
 
-    @SuppressWarnings("deprecation")
+    @Deprecated
     public org.opendaylight.controller.sal.core.api.data.DataProviderService getDomDataBroker() {
         return biDataLegacyBroker;
     }
index 356a4b810ecb6a74bb484974e6e1477aa7da4bba..8fc60e4bbbeb3271f7c559040485abed88f23e00 100644 (file)
@@ -8,14 +8,13 @@
 package org.opendaylight.controller.sal.binding.test.util;
 
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.controller.sal.dom.broker.impl.SchemaContextProvider;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.util.ListenerRegistry;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 
-@SuppressWarnings("deprecation")
 public final class MockSchemaService implements SchemaService, SchemaContextProvider {
 
     private SchemaContext schemaContext;
index 5e37f36a2c1d6e16c85696315d5427e1a2f2d9de..1b5aca2bee49636581f20451277d58db5545642f 100644 (file)
                             <name>binding-async-data-broker</name>
                             <binding-forwarded-data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
                                 <dom-async-broker>
-                                    <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-broker-osgi-registry</type>
-                                    <name>dom-broker</name>
+                            <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-async-data-broker</type>
+                            <name>inmemory-data-broker</name>
                                 </dom-async-broker>
+                        <schema-service>
+                            <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>
+                            <name>yang-schema-service</name>
+                        </schema-service>
                                 <binding-mapping-service>
                                     <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-dom-mapping-service</type>
                                     <name>runtime-mapping-singleton</name>
index bb866f276e713151ccf18b0e57e589c65633647f..0dd04d539c93617d95d4f6bffc834dc4c99947f8 100644 (file)
@@ -15,7 +15,7 @@ import java.util.concurrent.ExecutorService;
  * Users of this interface can publish any YANG-modeled notification which will
  * be delivered to all subscribed listeners.
  * <p>
- * Prefered way of publishing of notifications is done by invoking {@link #publish(Object)}.
+ * Preferred way of publishing of notifications is done by invoking {@link #publish(Object)}.
  *
  * <p>You may consider using {@link #publish(Object, ExecutorService)} if and only if
  * your use-case requires customized  execution policy or run-to-completion
@@ -50,7 +50,7 @@ public interface NotificationPublishService<N> {
      * Publishes a notification and notifies subscribed listeners. All listener
      * notifications are done via the provided executor.
      * <p>
-     * <b>Note:</b> Use only if ineccessary. Consider using
+     * <b>Note:</b> Use only if necessary. Consider using
      * {@link #publish(Object)} for most use-cases.
      *
      * <p>
index feccbbad92f694fb070af73c355376acbf26e928..a83610fe9166b537defe8f790c5e6369ee634674 100644 (file)
@@ -8,10 +8,9 @@
 package org.opendaylight.controller.md.sal.common.api.notify;
 
 import java.util.EventListener;
-
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 
-public interface NotificationSubscriptionService<T,N,L extends EventListener> {
+public interface NotificationSubscriptionService<T, N, L extends EventListener> {
 
-    ListenerRegistration<L> registerNotificationListener(T type,L listener);
+    ListenerRegistration<L> registerNotificationListener(T type, L listener);
 }
index dc3fef15069e6949a0e93e9fa94f6a2418651012..8950b3c849fe8ed3534feddf186413a6dadaed05 100644 (file)
@@ -18,6 +18,7 @@ import org.opendaylight.controller.md.sal.common.api.data.DataModification;
 import org.opendaylight.controller.md.sal.common.api.data.DataReader;
 import org.opendaylight.yangtools.concepts.Path;
 
+@Deprecated
 public abstract class AbstractDataModification<P extends Path<P>, D> implements DataModification<P, D> {
 
     private final Map<P, D> operationalOriginal;
index 5dfb55ebd939615a10c6b0b0ceb4c4a6758c0940..fea06bb2a12fd32a5bd5fe579971392a6c6947bd 100644 (file)
@@ -28,6 +28,7 @@ import com.google.common.collect.Multimaps;
  * @param <P>
  * @param <D>
  */
+@Deprecated
 public abstract class AbstractDataReadRouter<P extends Path<P>, D> implements DataReader<P, D> {
 
     Multimap<P, DataReaderRegistration<P, D>> configReaders = Multimaps.synchronizedSetMultimap(HashMultimap.<P, DataReaderRegistration<P, D>>create());
index ca6e6e9718c5fd516860df86080838e30bfc5ce8..88cb039a8822f0e2365ed1df1b83e6f99f9beba0 100644 (file)
@@ -52,6 +52,7 @@ import com.google.common.collect.Multimap;
 import com.google.common.collect.Multimaps;
 import com.google.common.util.concurrent.MoreExecutors;
 
+@Deprecated
 public abstract class AbstractDataBroker<P extends Path<P>, D extends Object, DCL extends DataChangeListener<P, D>>
         implements DataModificationTransactionFactory<P, D>, DataReader<P, D>, DataChangePublisher<P, D, DCL>,
         DataProvisionService<P, D> {
index b2a03c298772caba9509e3122598dd8f1bc06aee..be95bc4f71ba02ff7445f985a1d397e098cc16a1 100644 (file)
@@ -23,6 +23,7 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+@Deprecated
 public abstract class AbstractDataTransaction<P extends Path<P>, D extends Object> extends
         AbstractDataModification<P, D> {
     private static final Logger LOG = LoggerFactory.getLogger(AbstractDataTransaction.class);
index c86aec96d13ad711870ad0b248695be5bffb1ed6..5e2e9de578547a395a32edf1ba267583ad1a1ea2 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent;
 import org.opendaylight.yangtools.concepts.Immutable;
 import org.opendaylight.yangtools.concepts.Path;
 
+@Deprecated
 public class DataChangeEventImpl<P extends Path<P>, D> implements DataChangeEvent<P, D>, Immutable {
 
     private final DataChange<P, D> dataChange;
index 19235d2ddfe56bac11b05cfe2bc9d36fee271bde..88f1df64bc255b15e91c0be59e142f8880daf565 100644 (file)
@@ -13,6 +13,7 @@ import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
 
+@Deprecated
 public final class ImmutableDataChangeEvent<P extends Path<P>, D> implements DataChangeEvent<P,D> {
 
     private final D updatedOperationalSubtree;
index f35d6dc6af29e2780a4d090d44984eb6ec6d3f97..ebe7d9dae2242ae7b77ff16a424cb2acf422330d 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent;
 import org.opendaylight.yangtools.concepts.Immutable;
 import org.opendaylight.yangtools.concepts.Path;
 
+@Deprecated
 public class InitialDataChangeEventImpl<P extends Path<P>,D> implements DataChangeEvent<P, D>, Immutable {
 
     private final D updatedOperationalTree;
index 502ca90ab923d22a831d3ba6408e3a9c51595773..025cadb8bd2f1eb2480ed6d9c850514282fb56c8 100644 (file)
@@ -9,6 +9,7 @@ import org.opendaylight.yangtools.concepts.Path;
 
 import com.google.common.base.Predicate;
 
+@Deprecated
 public final class ListenerStateCapture<P extends Path<P>, D, DCL extends DataChangeListener<P, D>> {
 
     final P path;
index 007122e41df26eaf6c3c9e803e2d3f75abcf8deb..30c5898ea32c4fec3792ec934bd0182ad1104961 100644 (file)
@@ -33,6 +33,7 @@ import com.google.common.collect.ImmutableList.Builder;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Sets;
 
+@Deprecated
 public class TwoPhaseCommit<P extends Path<P>, D extends Object, DCL extends DataChangeListener<P, D>> implements
         Callable<RpcResult<TransactionStatus>> {
     private final static Logger log = LoggerFactory.getLogger(TwoPhaseCommit.class);
index b8dfca1604eb9e1ca82454f60f508abfffe01694..6fe9d1d6f7777f37feb844d401feb42a9c615d3a 100644 (file)
@@ -54,6 +54,11 @@ import com.google.common.collect.FluentIterable;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
 
+/**
+ * @deprecated This class provides compatibility between {@link CompositeNode} and {@link NormalizedNode}.
+ *             Users of this class should use {@link NormalizedNode}s directly.
+ */
+@Deprecated
 public abstract class DataNormalizationOperation<T extends PathArgument> implements Identifiable<T> {
 
     private final T identifier;
index 3e14d5e4b7682abca507d1cc666bb9d19b09fd01..e8b239d2c490049b2ea88768799ddda3ab1bff38 100644 (file)
@@ -38,6 +38,11 @@ import com.google.common.collect.FluentIterable;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
 
+/**
+ * @deprecated This class provides compatibility between {@link CompositeNode} and {@link NormalizedNode}.
+ *             Users of this class should use {@link NormalizedNode}s directly.
+ */
+@Deprecated
 public class DataNormalizer {
 
     private final DataNormalizationOperation<?> operation;
index 3fa8d4e5e9ad48c57b3e811188d916c33e5c5f5f..e841b866ba64976159895f9de8f0333759ce4ee6 100644 (file)
@@ -64,6 +64,7 @@ import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
 
+@Deprecated
 public class DataNormalizerTest {
 
     static class NormalizedNodeData {
index 9aacf1e0a8b8123d0c75360b7e9c9c88a73cb827..ded2d599eba499776edab17679a44a050bd5a0ee 100644 (file)
@@ -13,6 +13,10 @@ import org.opendaylight.yangtools.concepts.Path;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 
+/**
+ * @deprecated Utility class for {@link DataCommitTransaction}, will be removed at the same time.
+ */
+@Deprecated
 public class CommitHandlerTransactions {
 
     private static class AllwaysSuccessfulTransaction<P extends Path<P>,D> implements DataCommitTransaction<P, D> {
index 4b130950f27d9f40585cc432eedf4b31e71e3a9b..d53cb48e501c75c25e3532ce2c71e481717612ad 100644 (file)
@@ -139,8 +139,8 @@ public class Shard extends RaftActor {
 
     private final Map<String, DOMStoreTransactionChain> transactionChains = new HashMap<>();
 
-    protected Shard(ShardIdentifier name, Map<ShardIdentifier, String> peerAddresses,
-            DatastoreContext datastoreContext, SchemaContext schemaContext) {
+    protected Shard(final ShardIdentifier name, final Map<ShardIdentifier, String> peerAddresses,
+            final DatastoreContext datastoreContext, final SchemaContext schemaContext) {
         super(name.toString(), mapPeerAddresses(peerAddresses),
                 Optional.of(datastoreContext.getShardRaftConfig()));
 
@@ -160,7 +160,6 @@ public class Shard extends RaftActor {
 
         shardMBean = ShardMBeanFactory.getShardStatsMBean(name.toString(),
                 datastoreContext.getDataStoreMXBeanType());
-        shardMBean.setDataStoreExecutor(store.getDomStoreExecutor());
         shardMBean.setNotificationManager(store.getDataChangeListenerNotificationManager());
 
         if (isMetricsCaptureEnabled()) {
@@ -175,7 +174,7 @@ public class Shard extends RaftActor {
     }
 
     private static Map<String, String> mapPeerAddresses(
-        Map<ShardIdentifier, String> peerAddresses) {
+        final Map<ShardIdentifier, String> peerAddresses) {
         Map<String, String> map = new HashMap<>();
 
         for (Map.Entry<ShardIdentifier, String> entry : peerAddresses
@@ -188,7 +187,7 @@ public class Shard extends RaftActor {
 
     public static Props props(final ShardIdentifier name,
         final Map<ShardIdentifier, String> peerAddresses,
-        DatastoreContext datastoreContext, SchemaContext schemaContext) {
+        final DatastoreContext datastoreContext, final SchemaContext schemaContext) {
         Preconditions.checkNotNull(name, "name should not be null");
         Preconditions.checkNotNull(peerAddresses, "peerAddresses should not be null");
         Preconditions.checkNotNull(datastoreContext, "dataStoreContext should not be null");
@@ -207,7 +206,7 @@ public class Shard extends RaftActor {
     }
 
     @Override
-    public void onReceiveRecover(Object message) throws Exception {
+    public void onReceiveRecover(final Object message) throws Exception {
         if(LOG.isDebugEnabled()) {
             LOG.debug("onReceiveRecover: Received message {} from {}",
                 message.getClass().toString(),
@@ -226,7 +225,7 @@ public class Shard extends RaftActor {
     }
 
     @Override
-    public void onReceiveCommand(Object message) throws Exception {
+    public void onReceiveCommand(final Object message) throws Exception {
         if(LOG.isDebugEnabled()) {
             LOG.debug("onReceiveCommand: Received message {} from {}", message, getSender());
         }
@@ -273,7 +272,7 @@ public class Shard extends RaftActor {
         }
     }
 
-    private void handleCommitTransaction(CommitTransaction commit) {
+    private void handleCommitTransaction(final CommitTransaction commit) {
         final String transactionID = commit.getTransactionID();
 
         LOG.debug("Committing transaction {}", transactionID);
@@ -368,7 +367,7 @@ public class Shard extends RaftActor {
         commitCoordinator.currentTransactionComplete(transactionID, true);
     }
 
-    private void handleCanCommitTransaction(CanCommitTransaction canCommit) {
+    private void handleCanCommitTransaction(final CanCommitTransaction canCommit) {
         LOG.debug("Can committing transaction {}", canCommit.getTransactionID());
         commitCoordinator.handleCanCommit(canCommit, getSender(), self());
     }
@@ -401,11 +400,11 @@ public class Shard extends RaftActor {
                 readyTransactionReply, getSelf());
     }
 
-    private void handleAbortTransaction(AbortTransaction abort) {
+    private void handleAbortTransaction(final AbortTransaction abort) {
         doAbortTransaction(abort.getTransactionID(), getSender());
     }
 
-    private void doAbortTransaction(String transactionID, final ActorRef sender) {
+    private void doAbortTransaction(final String transactionID, final ActorRef sender) {
         final CohortEntry cohortEntry = commitCoordinator.getCohortEntryIfCurrent(transactionID);
         if(cohortEntry != null) {
             LOG.debug("Aborting transaction {}", transactionID);
@@ -420,7 +419,7 @@ public class Shard extends RaftActor {
 
             Futures.addCallback(future, new FutureCallback<Void>() {
                 @Override
-                public void onSuccess(Void v) {
+                public void onSuccess(final Void v) {
                     shardMBean.incrementAbortTransactionsCount();
 
                     if(sender != null) {
@@ -429,7 +428,7 @@ public class Shard extends RaftActor {
                 }
 
                 @Override
-                public void onFailure(Throwable t) {
+                public void onFailure(final Throwable t) {
                     LOG.error(t, "An exception happened during abort");
 
                     if(sender != null) {
@@ -440,7 +439,7 @@ public class Shard extends RaftActor {
         }
     }
 
-    private void handleCreateTransaction(Object message) {
+    private void handleCreateTransaction(final Object message) {
         if (isLeader()) {
             createTransaction(CreateTransaction.fromSerializable(message));
         } else if (getLeader() != null) {
@@ -453,7 +452,7 @@ public class Shard extends RaftActor {
         }
     }
 
-    private void handleReadDataReply(Object message) {
+    private void handleReadDataReply(final Object message) {
         // This must be for install snapshot. Don't want to open this up and trigger
         // deSerialization
 
@@ -467,7 +466,7 @@ public class Shard extends RaftActor {
         getSender().tell(PoisonPill.getInstance(), self());
     }
 
-    private void closeTransactionChain(CloseTransactionChain closeTransactionChain) {
+    private void closeTransactionChain(final CloseTransactionChain closeTransactionChain) {
         DOMStoreTransactionChain chain =
             transactionChains.remove(closeTransactionChain.getTransactionChainId());
 
@@ -562,14 +561,14 @@ public class Shard extends RaftActor {
         return transactionActor;
     }
 
-    private void syncCommitTransaction(DOMStoreWriteTransaction transaction)
+    private void syncCommitTransaction(final DOMStoreWriteTransaction transaction)
         throws ExecutionException, InterruptedException {
         DOMStoreThreePhaseCommitCohort commitCohort = transaction.ready();
         commitCohort.preCommit().get();
         commitCohort.commit().get();
     }
 
-    private void commitWithNewTransaction(Modification modification) {
+    private void commitWithNewTransaction(final Modification modification) {
         DOMStoreWriteTransaction tx = store.newWriteOnlyTransaction();
         modification.apply(tx);
         try {
@@ -582,18 +581,18 @@ public class Shard extends RaftActor {
         }
     }
 
-    private void updateSchemaContext(UpdateSchemaContext message) {
+    private void updateSchemaContext(final UpdateSchemaContext message) {
         this.schemaContext = message.getSchemaContext();
         updateSchemaContext(message.getSchemaContext());
         store.onGlobalContextUpdated(message.getSchemaContext());
     }
 
     @VisibleForTesting
-    void updateSchemaContext(SchemaContext schemaContext) {
+    void updateSchemaContext(final SchemaContext schemaContext) {
         store.onGlobalContextUpdated(schemaContext);
     }
 
-    private void registerChangeListener(RegisterChangeListener registerChangeListener) {
+    private void registerChangeListener(final RegisterChangeListener registerChangeListener) {
 
         LOG.debug("registerDataChangeListener for {}", registerChangeListener.getPath());
 
@@ -621,7 +620,7 @@ public class Shard extends RaftActor {
 
     private ListenerRegistration<AsyncDataChangeListener<YangInstanceIdentifier,
                                                NormalizedNode<?, ?>>> doChangeListenerRegistration(
-            RegisterChangeListener registerChangeListener) {
+            final RegisterChangeListener registerChangeListener) {
 
         ActorSelection dataChangeListenerPath = getContext().system().actorSelection(
                 registerChangeListener.getDataChangeListenerPath());
@@ -651,7 +650,7 @@ public class Shard extends RaftActor {
 
     @Override
     protected
-    void startLogRecoveryBatch(int maxBatchSize) {
+    void startLogRecoveryBatch(final int maxBatchSize) {
         currentLogRecoveryBatch = Lists.newArrayListWithCapacity(maxBatchSize);
 
         if(LOG.isDebugEnabled()) {
@@ -660,7 +659,7 @@ public class Shard extends RaftActor {
     }
 
     @Override
-    protected void appendRecoveredLogEntry(Payload data) {
+    protected void appendRecoveredLogEntry(final Payload data) {
         if (data instanceof CompositeModificationPayload) {
             currentLogRecoveryBatch.add(((CompositeModificationPayload) data).getModification());
         } else {
@@ -669,7 +668,7 @@ public class Shard extends RaftActor {
     }
 
     @Override
-    protected void applyRecoverySnapshot(ByteString snapshot) {
+    protected void applyRecoverySnapshot(final ByteString snapshot) {
         if(recoveryCoordinator == null) {
             recoveryCoordinator = new ShardRecoveryCoordinator(persistenceId(), schemaContext);
         }
@@ -734,7 +733,7 @@ public class Shard extends RaftActor {
     }
 
     @Override
-    protected void applyState(ActorRef clientActor, String identifier, Object data) {
+    protected void applyState(final ActorRef clientActor, final String identifier, final Object data) {
 
         if (data instanceof CompositeModificationPayload) {
             Object modification = ((CompositeModificationPayload) data).getModification();
@@ -793,7 +792,7 @@ public class Shard extends RaftActor {
 
     @VisibleForTesting
     @Override
-    protected void applySnapshot(ByteString snapshot) {
+    protected void applySnapshot(final ByteString snapshot) {
         // Since this will be done only on Recovery or when this actor is a Follower
         // we can safely commit everything in here. We not need to worry about event notifications
         // as they would have already been disabled on the follower
@@ -858,7 +857,7 @@ public class Shard extends RaftActor {
         return dataPersistenceProvider;
     }
 
-    @Override protected void onLeaderChanged(String oldLeader, String newLeader) {
+    @Override protected void onLeaderChanged(final String oldLeader, final String newLeader) {
         shardMBean.setLeader(newLeader);
     }
 
@@ -880,8 +879,8 @@ public class Shard extends RaftActor {
         final DatastoreContext datastoreContext;
         final SchemaContext schemaContext;
 
-        ShardCreator(ShardIdentifier name, Map<ShardIdentifier, String> peerAddresses,
-                DatastoreContext datastoreContext, SchemaContext schemaContext) {
+        ShardCreator(final ShardIdentifier name, final Map<ShardIdentifier, String> peerAddresses,
+                final DatastoreContext datastoreContext, final SchemaContext schemaContext) {
             this.name = name;
             this.peerAddresses = peerAddresses;
             this.datastoreContext = datastoreContext;
@@ -914,11 +913,11 @@ public class Shard extends RaftActor {
         private volatile ListenerRegistration<AsyncDataChangeListener<YangInstanceIdentifier,
                                                              NormalizedNode<?, ?>>> delegate;
 
-        DelayedListenerRegistration(RegisterChangeListener registerChangeListener) {
+        DelayedListenerRegistration(final RegisterChangeListener registerChangeListener) {
             this.registerChangeListener = registerChangeListener;
         }
 
-        void setDelegate( ListenerRegistration<AsyncDataChangeListener<YangInstanceIdentifier,
+        void setDelegate( final ListenerRegistration<AsyncDataChangeListener<YangInstanceIdentifier,
                                             NormalizedNode<?, ?>>> registration) {
             this.delegate = registration;
         }
index 946e525a6d0019418fd00e310064b0f78487485a..4a7752aec1535454913894ef31de0f2ce427e647 100644 (file)
@@ -7,15 +7,13 @@
  */
 package org.opendaylight.controller.cluster.datastore.jmx.mbeans.shard;
 
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.cache.Cache;
-import com.google.common.cache.CacheBuilder;
-
 /**
  * @author Basheeruddin syedbahm@cisco.com
  *
@@ -24,7 +22,7 @@ public class ShardMBeanFactory {
 
     private static final Logger LOG = LoggerFactory.getLogger(ShardMBeanFactory.class);
 
-    private static Cache<String,ShardStats> shardMBeansCache =
+    private static final Cache<String,ShardStats> shardMBeansCache =
                                       CacheBuilder.newBuilder().weakValues().build();
 
     public static ShardStats getShardStatsMBean(final String shardName, final String mxBeanType) {
index 0959c2a95949a6332fd66859f0796e103746c5d8..9decd82822a2533a092c39b3708b15e21a3be063 100644 (file)
@@ -8,20 +8,18 @@
 
 package org.opendaylight.controller.cluster.datastore.jmx.mbeans.shard;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.List;
-import java.util.concurrent.ExecutorService;
 import java.util.concurrent.atomic.AtomicLong;
-
 import org.opendaylight.controller.md.sal.common.util.jmx.AbstractMXBean;
 import org.opendaylight.controller.md.sal.common.util.jmx.QueuedNotificationManagerMXBeanImpl;
 import org.opendaylight.controller.md.sal.common.util.jmx.ThreadExecutorStats;
 import org.opendaylight.controller.md.sal.common.util.jmx.ThreadExecutorStatsMXBeanImpl;
+import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
 import org.opendaylight.yangtools.util.concurrent.ListenerNotificationQueueStats;
 import org.opendaylight.yangtools.util.concurrent.QueuedNotificationManager;
 
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
 /**
  * Maintains statistics for a shard.
  *
@@ -62,22 +60,16 @@ public class ShardStats extends AbstractMXBean implements ShardStatsMXBean {
 
     private ThreadExecutorStatsMXBeanImpl notificationExecutorStatsBean;
 
-    private ThreadExecutorStatsMXBeanImpl dataStoreExecutorStatsBean;
-
     private QueuedNotificationManagerMXBeanImpl notificationManagerStatsBean;
 
     private final SimpleDateFormat sdf =
         new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
 
-    public ShardStats(String shardName, String mxBeanType) {
+    public ShardStats(final String shardName, final String mxBeanType) {
         super(shardName, mxBeanType, JMX_CATEGORY_SHARD);
     }
 
-    public void setDataStoreExecutor(ExecutorService dsExecutor) {
-        this.dataStoreExecutorStatsBean = ThreadExecutorStatsMXBeanImpl.create(dsExecutor);
-    }
-
-    public void setNotificationManager(QueuedNotificationManager<?, ?> manager) {
+    public void setNotificationManager(final QueuedNotificationManager<?, ?> manager) {
         this.notificationManagerStatsBean = new QueuedNotificationManagerMXBeanImpl(manager,
                 "notification-manager", getMBeanType(), getMBeanCategory());
 
@@ -194,42 +186,42 @@ public class ShardStats extends AbstractMXBean implements ShardStatsMXBean {
         return abortTransactionsCount.incrementAndGet();
     }
 
-    public void setLeader(String leader) {
+    public void setLeader(final String leader) {
         this.leader = leader;
     }
 
-    public void setRaftState(String raftState) {
+    public void setRaftState(final String raftState) {
         this.raftState = raftState;
     }
 
-    public void setLastLogTerm(long lastLogTerm) {
+    public void setLastLogTerm(final long lastLogTerm) {
         this.lastLogTerm = lastLogTerm;
     }
 
-    public void setLastLogIndex(long lastLogIndex) {
+    public void setLastLogIndex(final long lastLogIndex) {
         this.lastLogIndex = lastLogIndex;
     }
 
-    public void setCurrentTerm(long currentTerm) {
+    public void setCurrentTerm(final long currentTerm) {
         this.currentTerm = currentTerm;
     }
 
-    public void setCommitIndex(long commitIndex) {
+    public void setCommitIndex(final long commitIndex) {
         this.commitIndex = commitIndex;
     }
 
-    public void setLastApplied(long lastApplied) {
+    public void setLastApplied(final long lastApplied) {
         this.lastApplied = lastApplied;
     }
 
-    public void setLastCommittedTransactionTime(long lastCommittedTransactionTime) {
+    public void setLastCommittedTransactionTime(final long lastCommittedTransactionTime) {
         this.lastCommittedTransactionTime = lastCommittedTransactionTime;
     }
 
     @Override
     public ThreadExecutorStats getDataStoreExecutorStats() {
-        return dataStoreExecutorStatsBean == null ? null :
-                                        dataStoreExecutorStatsBean.toThreadExecutorStats();
+        // FIXME: this particular thing does not work, as it really is DS-specific
+        return null;
     }
 
     @Override
@@ -269,4 +261,8 @@ public class ShardStats extends AbstractMXBean implements ShardStatsMXBean {
         abortTransactionsCount.set(0);
 
     }
+
+    public void setDataStore(final InMemoryDOMDataStore store) {
+        setNotificationManager(store.getDataChangeListenerNotificationManager());
+    }
 }
index 9ac30095a5d9da2075168e946afa893f7e8c8eeb..6f8035e2d1bda329dd975fd1d5d87fd5856e4581 100644 (file)
@@ -66,7 +66,6 @@ public class DataChangeListenerRegistrationProxyTest extends AbstractActorTest {
         Assert.assertEquals(mockListener, proxy.getInstance());
     }
 
-    @SuppressWarnings("unchecked")
     @Test(timeout=10000)
     public void testSuccessfulRegistration() {
         new JavaTestKit(getSystem()) {{
@@ -217,7 +216,6 @@ public class DataChangeListenerRegistrationProxyTest extends AbstractActorTest {
         }};
     }
 
-    @SuppressWarnings("unchecked")
     @Test
     public void testCloseBeforeRegistration() {
         new JavaTestKit(getSystem()) {{
index eb2c24292aee6663a669e9b42ba29a82d966fbd6..bf994eb5b6696694a716747d3729c2a756fbf44b 100644 (file)
@@ -1,9 +1,9 @@
 package org.opendaylight.controller.cluster.datastore;
 
+import static org.junit.Assert.assertEquals;
 import akka.actor.ActorRef;
 import akka.actor.Props;
 import akka.testkit.JavaTestKit;
-import com.google.common.util.concurrent.ListeningExecutorService;
 import com.google.common.util.concurrent.MoreExecutors;
 import org.junit.Test;
 import org.opendaylight.controller.cluster.datastore.messages.CloseDataChangeListenerRegistration;
@@ -16,13 +16,8 @@ import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
-import static org.junit.Assert.assertEquals;
-
 public class DataChangeListenerRegistrationTest extends AbstractActorTest {
-  private static ListeningExecutorService storeExecutor = MoreExecutors.listeningDecorator(MoreExecutors.sameThreadExecutor());
-
-  private static final InMemoryDOMDataStore store = new InMemoryDOMDataStore("OPER", storeExecutor,
-          MoreExecutors.sameThreadExecutor());
+  private static final InMemoryDOMDataStore store = new InMemoryDOMDataStore("OPER", MoreExecutors.sameThreadExecutor());
 
   static {
     store.onGlobalContextUpdated(TestModel.createTestContext());
@@ -46,7 +41,7 @@ public class DataChangeListenerRegistrationTest extends AbstractActorTest {
           final String out = new ExpectMsg<String>(duration("1 seconds"), "match hint") {
             // do not put code outside this method, will run afterwards
             @Override
-            protected String match(Object in) {
+            protected String match(final Object in) {
               if (in.getClass().equals(CloseDataChangeListenerRegistrationReply.SERIALIZABLE_CLASS)) {
                 return "match";
               } else {
@@ -68,7 +63,7 @@ public class DataChangeListenerRegistrationTest extends AbstractActorTest {
   private  AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>> noOpDataChangeListener(){
     return new AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>() {
       @Override
-      public void onDataChanged(AsyncDataChangeEvent<YangInstanceIdentifier, NormalizedNode<?, ?>> change) {
+      public void onDataChanged(final AsyncDataChangeEvent<YangInstanceIdentifier, NormalizedNode<?, ?>> change) {
 
       }
     };
index e5b5643297b88d49ab74bffdf90637a61988a72e..926cef6ba53ea2805f4310e2d9a55b59371f4094 100644 (file)
@@ -101,7 +101,6 @@ import scala.concurrent.Await;
 import scala.concurrent.Future;
 import scala.concurrent.duration.FiniteDuration;
 
-
 public class ShardTest extends AbstractActorTest {
 
     private static final SchemaContext SCHEMA_CONTEXT = TestModel.createTestContext();
@@ -1264,8 +1263,7 @@ public class ShardTest extends AbstractActorTest {
      */
     @Test
     public void testInMemoryDataStoreRestore() throws ReadFailedException {
-        InMemoryDOMDataStore store = new InMemoryDOMDataStore("test", MoreExecutors.listeningDecorator(
-            MoreExecutors.sameThreadExecutor()), MoreExecutors.sameThreadExecutor());
+        InMemoryDOMDataStore store = new InMemoryDOMDataStore("test", MoreExecutors.sameThreadExecutor());
 
         store.onGlobalContextUpdated(SCHEMA_CONTEXT);
 
@@ -1287,7 +1285,6 @@ public class ShardTest extends AbstractActorTest {
         NormalizedNode<?, ?> actual = readStore(store);
 
         assertEquals(expected, actual);
-
     }
 
     @Test
index 5781c19b252717c24c1795d83131ea6c158bcf32..9f57359429bf5938721f269604109ce5cb49981e 100644 (file)
@@ -14,7 +14,6 @@ import akka.actor.ActorRef;
 import akka.actor.Props;
 import akka.pattern.AskTimeoutException;
 import akka.testkit.TestActorRef;
-import com.google.common.util.concurrent.ListeningExecutorService;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.util.Collections;
 import java.util.concurrent.TimeUnit;
@@ -42,12 +41,8 @@ import scala.concurrent.duration.Duration;
  * @author Basheeruddin Ahmed <syedbahm@cisco.com>
  */
 public class ShardTransactionFailureTest extends AbstractActorTest {
-    private static ListeningExecutorService storeExecutor =
-        MoreExecutors.listeningDecorator(MoreExecutors.sameThreadExecutor());
-
     private static final InMemoryDOMDataStore store =
-        new InMemoryDOMDataStore("OPER", storeExecutor,
-            MoreExecutors.sameThreadExecutor());
+        new InMemoryDOMDataStore("OPER", MoreExecutors.sameThreadExecutor());
 
     private static final SchemaContext testSchemaContext =
         TestModel.createTestContext();
index 4ccc9430ace37605e002fbcf8800279b85fa4fcd..f5af93d584ce4ff62678f9f499cd629c96ccc80b 100644 (file)
@@ -9,7 +9,6 @@ import akka.actor.Props;
 import akka.actor.Terminated;
 import akka.testkit.JavaTestKit;
 import akka.testkit.TestActorRef;
-import com.google.common.util.concurrent.ListeningExecutorService;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.util.Collections;
 import java.util.concurrent.TimeUnit;
@@ -48,11 +47,8 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import scala.concurrent.duration.Duration;
 
 public class ShardTransactionTest extends AbstractActorTest {
-    private static ListeningExecutorService storeExecutor =
-        MoreExecutors.listeningDecorator(MoreExecutors.sameThreadExecutor());
-
     private static final InMemoryDOMDataStore store =
-        new InMemoryDOMDataStore("OPER", storeExecutor, MoreExecutors.sameThreadExecutor());
+        new InMemoryDOMDataStore("OPER", MoreExecutors.sameThreadExecutor());
 
     private static final SchemaContext testSchemaContext = TestModel.createTestContext();
 
@@ -347,7 +343,6 @@ public class ShardTransactionTest extends AbstractActorTest {
 
     }
 
-    @SuppressWarnings("unchecked")
     @Test
     public void testOnReceiveCloseTransaction() throws Exception {
         new JavaTestKit(getSystem()) {{
index cdf085e2ff2bd1c069281cfc8b96fdfc50c1382f..38254dd01ac7a909022ef3abcb4243ec9144fef3 100644 (file)
@@ -807,7 +807,6 @@ public class TransactionProxyTest {
         }
     }
 
-    @SuppressWarnings("unchecked")
     @Test
     public void testReady() throws Exception {
         ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), READ_WRITE);
@@ -842,7 +841,6 @@ public class TransactionProxyTest {
         verifyCohortFutures(proxy, getSystem().actorSelection(actorRef.path()));
     }
 
-    @SuppressWarnings("unchecked")
     @Test
     public void testReadyForwardCompatibility() throws Exception {
         ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), READ_WRITE, 0);
@@ -883,7 +881,6 @@ public class TransactionProxyTest {
                 eq(actorRef.path().toString()));
     }
 
-    @SuppressWarnings("unchecked")
     @Test
     public void testReadyWithRecordingOperationFailure() throws Exception {
         ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), WRITE_ONLY);
@@ -920,7 +917,6 @@ public class TransactionProxyTest {
                 MergeDataReply.SERIALIZABLE_CLASS, TestException.class);
     }
 
-    @SuppressWarnings("unchecked")
     @Test
     public void testReadyWithReplyFailure() throws Exception {
         ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), WRITE_ONLY);
@@ -977,7 +973,6 @@ public class TransactionProxyTest {
         verifyCohortFutures(proxy, PrimaryNotFoundException.class);
     }
 
-    @SuppressWarnings("unchecked")
     @Test
     public void testReadyWithInvalidReplyMessageType() throws Exception {
         ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), WRITE_ONLY);
@@ -1016,7 +1011,6 @@ public class TransactionProxyTest {
         assertTrue("Invalid identifier: " + id, id.toString().startsWith(memberName));
     }
 
-    @SuppressWarnings("unchecked")
     @Test
     public void testClose() throws Exception{
         ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), READ_WRITE);
index 84f3b92f1ba6dba08ae7a29992fe7d9e39b4e33c..abb2d31df32f2bce8200126b6261a16b7b467211 100644 (file)
@@ -26,18 +26,17 @@ public abstract class AbstractModificationTest {
 
   @Before
   public void setUp(){
-    store = new InMemoryDOMDataStore("test", MoreExecutors.sameThreadExecutor(),
-            MoreExecutors.sameThreadExecutor());
+    store = new InMemoryDOMDataStore("test", MoreExecutors.sameThreadExecutor());
     store.onGlobalContextUpdated(TestModel.createTestContext());
   }
 
-  protected void commitTransaction(DOMStoreWriteTransaction transaction){
+  protected void commitTransaction(final DOMStoreWriteTransaction transaction){
     DOMStoreThreePhaseCommitCohort cohort = transaction.ready();
     cohort.preCommit();
     cohort.commit();
   }
 
-  protected Optional<NormalizedNode<?,?>> readData(YangInstanceIdentifier path) throws Exception{
+  protected Optional<NormalizedNode<?,?>> readData(final YangInstanceIdentifier path) throws Exception{
     DOMStoreReadTransaction transaction = store.newReadOnlyTransaction();
     ListenableFuture<Optional<NormalizedNode<?, ?>>> future = transaction.read(path);
     return future.get();
index 60581f99cb26d40a016b285b8c7ae49fb8b8fd39..79408669cc0763a7cd7415af2a6ba0ca06e17e81 100644 (file)
                             org.opendaylight.controller.sal.dom.broker.osgi,
                             org.opendaylight.controller.sal.dom.broker.util,
                             org.opendaylight.controller.config.yang.md.sal.dom.impl,
+                            org.opendaylight.controller.config.yang.md.sal.dom.pingpong,
                             org.opendaylight.controller.config.yang.md.sal.dom.statistics,\
                             org.opendaylight.controller.md.sal.dom.broker.impl,
                             org.opendaylight.controller.md.sal.dom.broker.impl.*,
                             org.opendaylight.yangtools.yang.util,
-                            org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.dom.impl.rev131028.*</Private-Package>
+                            org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.dom.impl.rev131028.*,
+                            org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.dom.pingpong.rev141107.*
+            </Private-Package>
             <Import-Package>*</Import-Package>
           </instructions>
         </configuration>
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/pingpong/PingpongDataBrokerModule.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/pingpong/PingpongDataBrokerModule.java
new file mode 100644 (file)
index 0000000..1664a37
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * 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.config.yang.md.sal.dom.pingpong;
+
+import org.opendaylight.controller.config.api.DependencyResolver;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.md.sal.dom.broker.impl.PingPongDataBroker;
+
+public class PingpongDataBrokerModule extends AbstractPingpongDataBrokerModule {
+    public PingpongDataBrokerModule(final ModuleIdentifier identifier, final DependencyResolver dependencyResolver) {
+        super(identifier, dependencyResolver);
+    }
+
+    public PingpongDataBrokerModule(final ModuleIdentifier identifier, final DependencyResolver dependencyResolver, final PingpongDataBrokerModule oldModule, final java.lang.AutoCloseable oldInstance) {
+        super(identifier, dependencyResolver, oldModule, oldInstance);
+    }
+
+    @Override
+    public java.lang.AutoCloseable createInstance() {
+        return new PingPongDataBroker(getDataBrokerDependency());
+    }
+}
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/pingpong/PingpongDataBrokerModuleFactory.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/pingpong/PingpongDataBrokerModuleFactory.java
new file mode 100644 (file)
index 0000000..8ec17fd
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * 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.config.yang.md.sal.dom.pingpong;
+
+public class PingpongDataBrokerModuleFactory extends AbstractPingpongDataBrokerModuleFactory {
+
+}
index 8e2a11184c973504c7784b8c748a9cf7a347937c..666378ddb355912e08888c355e0cda3ed2770993 100644 (file)
@@ -12,6 +12,7 @@ import org.opendaylight.controller.config.yang.md.sal.dom.impl.DomBrokerImplRunt
 import org.opendaylight.controller.config.yang.md.sal.dom.impl.Transactions;
 import org.opendaylight.controller.sal.dom.broker.DataBrokerImpl;
 
+@Deprecated
 public class DomBrokerRuntimeMXBeanImpl implements
         DomBrokerImplRuntimeMXBean {
 
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/CommitCoordinationTask.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/CommitCoordinationTask.java
new file mode 100644 (file)
index 0000000..e0ac702
--- /dev/null
@@ -0,0 +1,274 @@
+/*
+ * 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.md.sal.dom.broker.impl;
+
+import com.google.common.base.Preconditions;
+import com.google.common.base.Throwables;
+import com.google.common.collect.Iterables;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.yangtools.util.DurationStatisticsTracker;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Implementation of blocking three-phase commit-coordination tasks without
+ * support of cancellation.
+ */
+final class CommitCoordinationTask implements Callable<Void> {
+    private static enum Phase {
+        canCommit,
+        preCommit,
+        doCommit,
+    };
+
+    private static final Logger LOG = LoggerFactory.getLogger(CommitCoordinationTask.class);
+    private final Iterable<DOMStoreThreePhaseCommitCohort> cohorts;
+    private final DurationStatisticsTracker commitStatTracker;
+    private final DOMDataWriteTransaction tx;
+    private final int cohortSize;
+
+    public CommitCoordinationTask(final DOMDataWriteTransaction transaction,
+            final Iterable<DOMStoreThreePhaseCommitCohort> cohorts,
+            final DurationStatisticsTracker commitStatTracker) {
+        this.tx = Preconditions.checkNotNull(transaction, "transaction must not be null");
+        this.cohorts = Preconditions.checkNotNull(cohorts, "cohorts must not be null");
+        this.commitStatTracker = commitStatTracker;
+        this.cohortSize = Iterables.size(cohorts);
+    }
+
+    @Override
+    public Void call() throws TransactionCommitFailedException {
+        final long startTime = commitStatTracker != null ? System.nanoTime() : 0;
+
+        Phase phase = Phase.canCommit;
+
+        try {
+            LOG.debug("Transaction {}: canCommit Started", tx.getIdentifier());
+            canCommitBlocking();
+
+            phase = Phase.preCommit;
+            LOG.debug("Transaction {}: preCommit Started", tx.getIdentifier());
+            preCommitBlocking();
+
+            phase = Phase.doCommit;
+            LOG.debug("Transaction {}: doCommit Started", tx.getIdentifier());
+            commitBlocking();
+
+            LOG.debug("Transaction {}: doCommit completed", tx.getIdentifier());
+            return null;
+        } catch (TransactionCommitFailedException e) {
+            LOG.warn("Tx: {} Error during phase {}, starting Abort", tx.getIdentifier(), phase, e);
+            abortBlocking(e);
+            throw e;
+        } finally {
+            if (commitStatTracker != null) {
+                commitStatTracker.addDuration(System.nanoTime() - startTime);
+            }
+        }
+    }
+
+    /**
+     *
+     * Invokes canCommit on underlying cohorts and blocks till
+     * all results are returned.
+     *
+     * Valid state transition is from SUBMITTED to CAN_COMMIT,
+     * if currentPhase is not SUBMITTED throws IllegalStateException.
+     *
+     * @throws TransactionCommitFailedException
+     *             If one of cohorts failed can Commit
+     *
+     */
+    private void canCommitBlocking() throws TransactionCommitFailedException {
+        for (ListenableFuture<?> canCommit : canCommitAll()) {
+            try {
+                final Boolean result = (Boolean)canCommit.get();
+                if (result == null || !result) {
+                    throw new TransactionCommitFailedException("Can Commit failed, no detailed cause available.");
+                }
+            } catch (InterruptedException | ExecutionException e) {
+                throw TransactionCommitFailedExceptionMapper.CAN_COMMIT_ERROR_MAPPER.apply(e);
+            }
+        }
+    }
+
+    /**
+     *
+     * Invokes canCommit on underlying cohorts and returns composite future
+     * which will contains {@link Boolean#TRUE} only and only if
+     * all cohorts returned true.
+     *
+     * Valid state transition is from SUBMITTED to CAN_COMMIT,
+     * if currentPhase is not SUBMITTED throws IllegalStateException.
+     *
+     * @return List of all cohorts futures from can commit phase.
+     *
+     */
+    private ListenableFuture<?>[] canCommitAll() {
+        final ListenableFuture<?>[] ops = new ListenableFuture<?>[cohortSize];
+        int i = 0;
+        for (DOMStoreThreePhaseCommitCohort cohort : cohorts) {
+            ops[i++] = cohort.canCommit();
+        }
+        return ops;
+    }
+
+    /**
+     *
+     * Invokes preCommit on underlying cohorts and blocks till
+     * all results are returned.
+     *
+     * Valid state transition is from CAN_COMMIT to PRE_COMMIT, if current
+     * state is not CAN_COMMIT
+     * throws IllegalStateException.
+     *
+     * @throws TransactionCommitFailedException
+     *             If one of cohorts failed preCommit
+     *
+     */
+    private void preCommitBlocking() throws TransactionCommitFailedException {
+        final ListenableFuture<?>[] preCommitFutures = preCommitAll();
+        try {
+            for(ListenableFuture<?> future : preCommitFutures) {
+                future.get();
+            }
+        } catch (InterruptedException | ExecutionException e) {
+            throw TransactionCommitFailedExceptionMapper.PRE_COMMIT_MAPPER.apply(e);
+        }
+    }
+
+    /**
+     *
+     * Invokes preCommit on underlying cohorts and returns future
+     * which will complete once all preCommit on cohorts completed or
+     * failed.
+     *
+     *
+     * Valid state transition is from CAN_COMMIT to PRE_COMMIT, if current
+     * state is not CAN_COMMIT
+     * throws IllegalStateException.
+     *
+     * @return List of all cohorts futures from can commit phase.
+     *
+     */
+    private ListenableFuture<?>[] preCommitAll() {
+        final ListenableFuture<?>[] ops = new ListenableFuture<?>[cohortSize];
+        int i = 0;
+        for (DOMStoreThreePhaseCommitCohort cohort : cohorts) {
+            ops[i++] = cohort.preCommit();
+        }
+        return ops;
+    }
+
+    /**
+     *
+     * Invokes commit on underlying cohorts and blocks till
+     * all results are returned.
+     *
+     * Valid state transition is from PRE_COMMIT to COMMIT, if not throws
+     * IllegalStateException.
+     *
+     * @throws TransactionCommitFailedException
+     *             If one of cohorts failed preCommit
+     *
+     */
+    private void commitBlocking() throws TransactionCommitFailedException {
+        final ListenableFuture<?>[] commitFutures = commitAll();
+        try {
+            for(ListenableFuture<?> future : commitFutures) {
+                future.get();
+            }
+        } catch (InterruptedException | ExecutionException e) {
+            throw TransactionCommitFailedExceptionMapper.COMMIT_ERROR_MAPPER.apply(e);
+        }
+    }
+
+    /**
+     *
+     * Invokes commit on underlying cohorts and returns future which
+     * completes
+     * once all commits on cohorts are completed.
+     *
+     * Valid state transition is from PRE_COMMIT to COMMIT, if not throws
+     * IllegalStateException
+     *
+     * @return List of all cohorts futures from can commit phase.
+     */
+    private ListenableFuture<?>[] commitAll() {
+        final ListenableFuture<?>[] ops = new ListenableFuture<?>[cohortSize];
+        int i = 0;
+        for (DOMStoreThreePhaseCommitCohort cohort : cohorts) {
+            ops[i++] = cohort.commit();
+        }
+        return ops;
+    }
+
+    /**
+     * Aborts transaction.
+     *
+     * Invokes {@link DOMStoreThreePhaseCommitCohort#abort()} on all
+     * cohorts, blocks
+     * for all results. If any of the abort failed throws
+     * IllegalStateException,
+     * which will contains originalCause as suppressed Exception.
+     *
+     * If aborts we're successful throws supplied exception
+     *
+     * @param originalCause
+     *            Exception which should be used to fail transaction for
+     *            consumers of transaction
+     *            future and listeners of transaction failure.
+     * @param phase phase in which the problem ensued
+     * @throws TransactionCommitFailedException
+     *             on invocation of this method.
+     *             originalCa
+     * @throws IllegalStateException
+     *             if abort failed.
+     */
+    private void abortBlocking(final TransactionCommitFailedException originalCause) throws TransactionCommitFailedException {
+        Exception cause = originalCause;
+        try {
+            abortAsyncAll().get();
+        } catch (InterruptedException | ExecutionException e) {
+            LOG.error("Tx: {} Error during Abort.", tx.getIdentifier(), e);
+            cause = new IllegalStateException("Abort failed.", e);
+            cause.addSuppressed(e);
+        }
+        Throwables.propagateIfPossible(cause, TransactionCommitFailedException.class);
+    }
+
+    /**
+     * Invokes abort on underlying cohorts and returns future which
+     * completes once all abort on cohorts are completed.
+     *
+     * @return Future which will complete once all cohorts completed
+     *         abort.
+     */
+    private ListenableFuture<Void> abortAsyncAll() {
+
+        final ListenableFuture<?>[] ops = new ListenableFuture<?>[cohortSize];
+        int i = 0;
+        for (DOMStoreThreePhaseCommitCohort cohort : cohorts) {
+            ops[i++] = cohort.abort();
+        }
+
+        /*
+         * We are returning all futures as list, not only succeeded ones in
+         * order to fail composite future if any of them failed.
+         * See Futures.allAsList for this description.
+         */
+        @SuppressWarnings({ "unchecked", "rawtypes" })
+        ListenableFuture<Void> compositeResult = (ListenableFuture) Futures.allAsList(ops);
+        return compositeResult;
+    }
+}
index c1ecaa67dfbd9af34f022c110ae35bc5b9002f83..7b5350023113fee05df7e56aa6df6b54204400a1 100644 (file)
@@ -7,16 +7,11 @@
 package org.opendaylight.controller.md.sal.dom.broker.impl;
 
 import com.google.common.base.Preconditions;
-import com.google.common.base.Throwables;
-import com.google.common.collect.Iterables;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.ListeningExecutorService;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
 import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
@@ -82,319 +77,4 @@ public class DOMDataCommitCoordinatorImpl implements DOMDataCommitExecutor {
         return MappingCheckedFuture.create(commitFuture,
                 TransactionCommitFailedExceptionMapper.COMMIT_ERROR_MAPPER);
     }
-
-    /**
-     *
-     * Phase of 3PC commit
-     *
-     * Represents phase of 3PC Commit
-     *
-     *
-     */
-    private static enum CommitPhase {
-        /**
-         *
-         * Commit Coordination Task is submitted for executing
-         *
-         */
-        SUBMITTED,
-        /**
-         * Commit Coordination Task is in can commit phase of 3PC
-         *
-         */
-        CAN_COMMIT,
-        /**
-         * Commit Coordination Task is in pre-commit phase of 3PC
-         *
-         */
-        PRE_COMMIT,
-        /**
-         * Commit Coordination Task is in commit phase of 3PC
-         *
-         */
-        COMMIT,
-        /**
-         * Commit Coordination Task is in abort phase of 3PC
-         *
-         */
-        ABORT
-    }
-
-    /**
-     * Implementation of blocking three-phase commit-coordination tasks without
-     * support of cancellation.
-     */
-    private static final class CommitCoordinationTask implements Callable<Void> {
-        private static final AtomicReferenceFieldUpdater<CommitCoordinationTask, CommitPhase> PHASE_UPDATER =
-                AtomicReferenceFieldUpdater.newUpdater(CommitCoordinationTask.class, CommitPhase.class, "currentPhase");
-        private final DOMDataWriteTransaction tx;
-        private final Iterable<DOMStoreThreePhaseCommitCohort> cohorts;
-        private final DurationStatisticsTracker commitStatTracker;
-        private final int cohortSize;
-        private volatile CommitPhase currentPhase = CommitPhase.SUBMITTED;
-
-        public CommitCoordinationTask(final DOMDataWriteTransaction transaction,
-                final Iterable<DOMStoreThreePhaseCommitCohort> cohorts,
-                final DurationStatisticsTracker commitStatsTracker) {
-            this.tx = Preconditions.checkNotNull(transaction, "transaction must not be null");
-            this.cohorts = Preconditions.checkNotNull(cohorts, "cohorts must not be null");
-            this.commitStatTracker = commitStatsTracker;
-            this.cohortSize = Iterables.size(cohorts);
-        }
-
-        @Override
-        public Void call() throws TransactionCommitFailedException {
-            final long startTime = commitStatTracker != null ? System.nanoTime() : 0;
-
-            try {
-                canCommitBlocking();
-                preCommitBlocking();
-                commitBlocking();
-                return null;
-            } catch (TransactionCommitFailedException e) {
-                final CommitPhase phase = currentPhase;
-                LOG.warn("Tx: {} Error during phase {}, starting Abort", tx.getIdentifier(), phase, e);
-                abortBlocking(e, phase);
-                throw e;
-            } finally {
-                if (commitStatTracker != null) {
-                    commitStatTracker.addDuration(System.nanoTime() - startTime);
-                }
-            }
-        }
-
-        /**
-         *
-         * Invokes canCommit on underlying cohorts and blocks till
-         * all results are returned.
-         *
-         * Valid state transition is from SUBMITTED to CAN_COMMIT,
-         * if currentPhase is not SUBMITTED throws IllegalStateException.
-         *
-         * @throws TransactionCommitFailedException
-         *             If one of cohorts failed can Commit
-         *
-         */
-        private void canCommitBlocking() throws TransactionCommitFailedException {
-            for (ListenableFuture<?> canCommit : canCommitAll()) {
-                try {
-                    final Boolean result = (Boolean)canCommit.get();
-                    if (result == null || !result) {
-                        throw new TransactionCommitFailedException("Can Commit failed, no detailed cause available.");
-                    }
-                } catch (InterruptedException | ExecutionException e) {
-                    throw TransactionCommitFailedExceptionMapper.CAN_COMMIT_ERROR_MAPPER.apply(e);
-                }
-            }
-        }
-
-        /**
-         *
-         * Invokes canCommit on underlying cohorts and returns composite future
-         * which will contains {@link Boolean#TRUE} only and only if
-         * all cohorts returned true.
-         *
-         * Valid state transition is from SUBMITTED to CAN_COMMIT,
-         * if currentPhase is not SUBMITTED throws IllegalStateException.
-         *
-         * @return List of all cohorts futures from can commit phase.
-         *
-         */
-        private ListenableFuture<?>[] canCommitAll() {
-            changeStateFrom(CommitPhase.SUBMITTED, CommitPhase.CAN_COMMIT);
-
-            final ListenableFuture<?>[] ops = new ListenableFuture<?>[cohortSize];
-            int i = 0;
-            for (DOMStoreThreePhaseCommitCohort cohort : cohorts) {
-                ops[i++] = cohort.canCommit();
-            }
-            return ops;
-        }
-
-        /**
-         *
-         * Invokes preCommit on underlying cohorts and blocks till
-         * all results are returned.
-         *
-         * Valid state transition is from CAN_COMMIT to PRE_COMMIT, if current
-         * state is not CAN_COMMIT
-         * throws IllegalStateException.
-         *
-         * @throws TransactionCommitFailedException
-         *             If one of cohorts failed preCommit
-         *
-         */
-        private void preCommitBlocking() throws TransactionCommitFailedException {
-            final ListenableFuture<?>[] preCommitFutures = preCommitAll();
-            try {
-                for(ListenableFuture<?> future : preCommitFutures) {
-                    future.get();
-                }
-            } catch (InterruptedException | ExecutionException e) {
-                throw TransactionCommitFailedExceptionMapper.PRE_COMMIT_MAPPER.apply(e);
-            }
-        }
-
-        /**
-         *
-         * Invokes preCommit on underlying cohorts and returns future
-         * which will complete once all preCommit on cohorts completed or
-         * failed.
-         *
-         *
-         * Valid state transition is from CAN_COMMIT to PRE_COMMIT, if current
-         * state is not CAN_COMMIT
-         * throws IllegalStateException.
-         *
-         * @return List of all cohorts futures from can commit phase.
-         *
-         */
-        private ListenableFuture<?>[] preCommitAll() {
-            changeStateFrom(CommitPhase.CAN_COMMIT, CommitPhase.PRE_COMMIT);
-
-            final ListenableFuture<?>[] ops = new ListenableFuture<?>[cohortSize];
-            int i = 0;
-            for (DOMStoreThreePhaseCommitCohort cohort : cohorts) {
-                ops[i++] = cohort.preCommit();
-            }
-            return ops;
-        }
-
-        /**
-         *
-         * Invokes commit on underlying cohorts and blocks till
-         * all results are returned.
-         *
-         * Valid state transition is from PRE_COMMIT to COMMIT, if not throws
-         * IllegalStateException.
-         *
-         * @throws TransactionCommitFailedException
-         *             If one of cohorts failed preCommit
-         *
-         */
-        private void commitBlocking() throws TransactionCommitFailedException {
-            final ListenableFuture<?>[] commitFutures = commitAll();
-            try {
-                for(ListenableFuture<?> future : commitFutures) {
-                    future.get();
-                }
-            } catch (InterruptedException | ExecutionException e) {
-                throw TransactionCommitFailedExceptionMapper.COMMIT_ERROR_MAPPER.apply(e);
-            }
-        }
-
-        /**
-         *
-         * Invokes commit on underlying cohorts and returns future which
-         * completes
-         * once all commits on cohorts are completed.
-         *
-         * Valid state transition is from PRE_COMMIT to COMMIT, if not throws
-         * IllegalStateException
-         *
-         * @return List of all cohorts futures from can commit phase.
-         *
-         */
-        private ListenableFuture<?>[] commitAll() {
-            changeStateFrom(CommitPhase.PRE_COMMIT, CommitPhase.COMMIT);
-
-            final ListenableFuture<?>[] ops = new ListenableFuture<?>[cohortSize];
-            int i = 0;
-            for (DOMStoreThreePhaseCommitCohort cohort : cohorts) {
-                ops[i++] = cohort.commit();
-            }
-            return ops;
-        }
-
-        /**
-         * Aborts transaction.
-         *
-         * Invokes {@link DOMStoreThreePhaseCommitCohort#abort()} on all
-         * cohorts, blocks
-         * for all results. If any of the abort failed throws
-         * IllegalStateException,
-         * which will contains originalCause as suppressed Exception.
-         *
-         * If aborts we're successful throws supplied exception
-         *
-         * @param originalCause
-         *            Exception which should be used to fail transaction for
-         *            consumers of transaction
-         *            future and listeners of transaction failure.
-         * @param phase phase in which the problem ensued
-         * @throws TransactionCommitFailedException
-         *             on invocation of this method.
-         *             originalCa
-         * @throws IllegalStateException
-         *             if abort failed.
-         */
-        private void abortBlocking(final TransactionCommitFailedException originalCause, final CommitPhase phase)
-                throws TransactionCommitFailedException {
-            LOG.warn("Tx: {} Error during phase {}, starting Abort", tx.getIdentifier(), phase, originalCause);
-            Exception cause = originalCause;
-            try {
-                abortAsyncAll(phase).get();
-            } catch (InterruptedException | ExecutionException e) {
-                LOG.error("Tx: {} Error during Abort.", tx.getIdentifier(), e);
-                cause = new IllegalStateException("Abort failed.", e);
-                cause.addSuppressed(e);
-            }
-            Throwables.propagateIfPossible(cause, TransactionCommitFailedException.class);
-        }
-
-        /**
-         * Invokes abort on underlying cohorts and returns future which
-         * completes once all abort on cohorts are completed.
-         *
-         * @param phase phase in which the problem ensued
-         * @return Future which will complete once all cohorts completed
-         *         abort.
-         */
-        private ListenableFuture<Void> abortAsyncAll(final CommitPhase phase) {
-            changeStateFrom(phase, CommitPhase.ABORT);
-
-            final ListenableFuture<?>[] ops = new ListenableFuture<?>[cohortSize];
-            int i = 0;
-            for (DOMStoreThreePhaseCommitCohort cohort : cohorts) {
-                ops[i++] = cohort.abort();
-            }
-
-            /*
-             * We are returning all futures as list, not only succeeded ones in
-             * order to fail composite future if any of them failed.
-             * See Futures.allAsList for this description.
-             */
-            @SuppressWarnings({ "unchecked", "rawtypes" })
-            ListenableFuture<Void> compositeResult = (ListenableFuture) Futures.allAsList(ops);
-            return compositeResult;
-        }
-
-        /**
-         * Change phase / state of transaction from expected value to new value
-         *
-         * This method checks state and updates state to new state of
-         * of this task if current state equals expected state.
-         * If expected state and current state are different raises
-         * IllegalStateException
-         * which means there is probably bug in implementation of commit
-         * coordination.
-         *
-         * If transition is successful, it logs transition on DEBUG level.
-         *
-         * @param currentExpected
-         *            Required phase for change of state
-         * @param newState
-         *            New Phase which will be entered by transaction.
-         * @throws IllegalStateException
-         *             If currentState of task does not match expected state
-         */
-        private void changeStateFrom(final CommitPhase currentExpected, final CommitPhase newState) {
-            final boolean success = PHASE_UPDATER.compareAndSet(this, currentExpected, newState);
-            Preconditions.checkState(success, "Invalid state transition: Tx: %s expected: %s current: %s target: %s",
-                tx.getIdentifier(), currentExpected, currentPhase, newState);
-
-            LOG.debug("Transaction {}: Phase {} Started", tx.getIdentifier(), newState);
-        };
-    }
-
 }
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongDataBroker.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongDataBroker.java
new file mode 100644 (file)
index 0000000..715a136
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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.md.sal.dom.broker.impl;
+
+import com.google.common.base.Preconditions;
+import javax.annotation.Nonnull;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.controller.md.sal.dom.spi.ForwardingDOMDataBroker;
+
+/**
+ * An implementation of a {@link DOMDataBroker}, which forwards most requests to a delegate.
+ *
+ * Its interpretation of the API contract is somewhat looser, specifically it does not
+ * guarantee transaction ordering between transactions allocated directly from the broker
+ * and its transaction chains.
+ */
+public final class PingPongDataBroker extends ForwardingDOMDataBroker implements AutoCloseable {
+    private final DOMDataBroker delegate;
+
+    /**
+     * Instantiate a new broker, backed by the the specified delegate
+     * {@link DOMDataBroker}.
+     *
+     * @param delegate Backend broker, may not be null.
+     */
+    public PingPongDataBroker(final @Nonnull DOMDataBroker delegate) {
+        this.delegate = Preconditions.checkNotNull(delegate);
+    }
+
+    @Override
+    protected DOMDataBroker delegate() {
+        return delegate;
+    }
+
+    @Override
+    public PingPongTransactionChain createTransactionChain(final TransactionChainListener listener) {
+        return new PingPongTransactionChain(delegate, listener);
+    }
+
+    @Override
+    public void close() {
+        // TODO Auto-generated method stub
+    }
+}
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongFuture.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongFuture.java
new file mode 100644 (file)
index 0000000..1dfc607
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * 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.md.sal.dom.broker.impl;
+
+import com.google.common.base.Preconditions;
+import com.google.common.util.concurrent.AbstractCheckedFuture;
+import com.google.common.util.concurrent.ListenableFuture;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+
+/**
+ * A {@link Future} used to report the status of an future {@link java.util.concurrent.Future}.
+ */
+final class PingPongFuture extends AbstractCheckedFuture<Void, TransactionCommitFailedException> {
+    protected PingPongFuture(final ListenableFuture<Void> delegate) {
+        super(delegate);
+    }
+
+    @Override
+    protected TransactionCommitFailedException mapException(final Exception e) {
+        Preconditions.checkArgument(e instanceof TransactionCommitFailedException);
+        return (TransactionCommitFailedException) e;
+    }
+}
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongTransaction.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongTransaction.java
new file mode 100644 (file)
index 0000000..fdb80eb
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * 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.md.sal.dom.broker.impl;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+import com.google.common.base.Preconditions;
+import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.SettableFuture;
+import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.controller.md.sal.common.impl.service.AbstractDataTransaction;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+/**
+ * Transaction context. Tracks the relationship with the backend transaction.
+ * We never leak this class to the user and have it implement the {@link FutureCallback}
+ * interface so we have a simple way of propagating the result.
+ */
+final class PingPongTransaction implements FutureCallback<Void> {
+    private final CheckedFuture<Void, TransactionCommitFailedException> submitFuture;
+    private final ListenableFuture<RpcResult<TransactionStatus>> commitFuture;
+    private final DOMDataReadWriteTransaction delegate;
+    private final SettableFuture<Void> future;
+    private DOMDataReadWriteTransaction frontendTransaction;
+
+    PingPongTransaction(final DOMDataReadWriteTransaction delegate) {
+        this.delegate = Preconditions.checkNotNull(delegate);
+        future = SettableFuture.create();
+        submitFuture = new PingPongFuture(future);
+        commitFuture = AbstractDataTransaction.convertToLegacyCommitFuture(submitFuture);
+    }
+
+    DOMDataReadWriteTransaction getTransaction() {
+        return delegate;
+    }
+
+    DOMDataReadWriteTransaction getFrontendTransaction() {
+        return frontendTransaction;
+    }
+
+    CheckedFuture<Void, TransactionCommitFailedException> getSubmitFuture() {
+        return submitFuture;
+    }
+
+    ListenableFuture<RpcResult<TransactionStatus>> getCommitFuture() {
+        return commitFuture;
+    }
+
+    @Override
+    public void onSuccess(final Void result) {
+        future.set(result);
+    }
+
+    @Override
+    public void onFailure(final Throwable t) {
+        future.setException(t);
+    }
+
+    void recordFrontendTransaction(final DOMDataReadWriteTransaction tx) {
+        if (frontendTransaction != null) {
+            frontendTransaction = tx;
+        }
+    }
+
+    @Override
+    public String toString() {
+        return addToStringAttributes(Objects.toStringHelper(this)).toString();
+    }
+
+    protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
+        return toStringHelper.add("delegate", delegate);
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongTransactionChain.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongTransactionChain.java
new file mode 100644 (file)
index 0000000..83f31b9
--- /dev/null
@@ -0,0 +1,250 @@
+/*
+ * 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.md.sal.dom.broker.impl;
+
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+import javax.annotation.concurrent.GuardedBy;
+import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
+import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
+import org.opendaylight.controller.md.sal.dom.spi.ForwardingDOMDataReadWriteTransaction;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * An implementation of {@link DOMTransactionChain}, which has a very specific
+ * behavior, which some users may find surprising. If keeps the general
+ * intent of the contract, but it makes sure there are never more than two
+ * transactions allocated at any given time: one of them is being committed,
+ * and while that is happening, the other one acts as the scratch pad. Once
+ * the committing transaction completes successfully, the scratch transaction
+ * is enqueued as soon as it is ready.
+ *
+ * This mode of operation means that there is no inherent isolation between
+ * the front-end transactions and transactions cannot be reasonably cancelled.
+ *
+ * It furthermore means that the transactions returned by {@link #newReadOnlyTransaction()}
+ * counts as an outstanding transaction and the user may not allocate multiple
+ * read-only transactions at the same time.
+ */
+public final class PingPongTransactionChain implements DOMTransactionChain {
+    private static final Logger LOG = LoggerFactory.getLogger(PingPongTransactionChain.class);
+    private final DOMTransactionChain delegate;
+
+    @GuardedBy("this")
+    private PingPongTransaction bufferTransaction;
+    @GuardedBy("this")
+    private PingPongTransaction inflightTransaction;
+    @GuardedBy("this")
+    private boolean haveLocked;
+    @GuardedBy("this")
+    private boolean failed;
+
+    PingPongTransactionChain(final DOMDataBroker broker, final TransactionChainListener listener) {
+        this.delegate = broker.createTransactionChain(new TransactionChainListener() {
+            @Override
+            public void onTransactionChainFailed(final TransactionChain<?, ?> chain, final AsyncTransaction<?, ?> transaction, final Throwable cause) {
+                LOG.debug("Delegate chain {} reported failure in {}", chain, transaction, cause);
+
+                final DOMDataReadWriteTransaction frontend;
+                if (inflightTransaction == null) {
+                    LOG.warn("Transaction chain {} failed with no pending transactions", chain);
+                    frontend = null;
+                } else {
+                    frontend = inflightTransaction.getFrontendTransaction();
+                }
+
+                listener.onTransactionChainFailed(PingPongTransactionChain.this, frontend , cause);
+                delegateFailed();
+            }
+
+            @Override
+            public void onTransactionChainSuccessful(final TransactionChain<?, ?> chain) {
+                listener.onTransactionChainSuccessful(PingPongTransactionChain.this);
+            }
+        });
+    }
+
+    private synchronized void delegateFailed() {
+        failed = true;
+        if (!haveLocked) {
+            processBuffer();
+        }
+    }
+
+    private synchronized PingPongTransaction allocateTransaction() {
+        Preconditions.checkState(!haveLocked, "Attempted to start a transaction while a previous one is still outstanding");
+        Preconditions.checkState(!failed, "Attempted to use a failed chain");
+
+        if (bufferTransaction == null) {
+            bufferTransaction = new PingPongTransaction(delegate.newReadWriteTransaction());
+        }
+
+        haveLocked = true;
+        return bufferTransaction;
+    }
+
+    @GuardedBy("this")
+    private void processBuffer() {
+        final PingPongTransaction tx = bufferTransaction;
+
+        if (tx != null) {
+            if (failed) {
+                LOG.debug("Cancelling transaction {}", tx);
+                tx.getTransaction().cancel();
+                bufferTransaction = null;
+                return;
+            }
+
+            LOG.debug("Submitting transaction {}", tx);
+            final CheckedFuture<Void, ?> f = tx.getTransaction().submit();
+            bufferTransaction = null;
+            inflightTransaction = tx;
+
+            Futures.addCallback(f, new FutureCallback<Void>() {
+                @Override
+                public void onSuccess(final Void result) {
+                    transactionSuccessful(tx, result);
+                }
+
+                @Override
+                public void onFailure(final Throwable t) {
+                    transactionFailed(tx, t);
+                }
+            });
+        }
+    }
+
+    private void transactionSuccessful(final PingPongTransaction tx, final Void result) {
+        LOG.debug("Transaction {} completed successfully", tx);
+
+        synchronized (this) {
+            Preconditions.checkState(inflightTransaction == tx, "Successful transaction %s while %s was submitted", tx, inflightTransaction);
+            inflightTransaction = null;
+
+            if (!haveLocked) {
+                processBuffer();
+            }
+        }
+
+        // Can run unsynchronized
+        tx.onSuccess(result);
+    }
+
+    private void transactionFailed(final PingPongTransaction tx, final Throwable t) {
+        LOG.debug("Transaction {} failed", tx, t);
+
+        synchronized (this) {
+            Preconditions.checkState(inflightTransaction == tx, "Failed transaction %s while %s was submitted", tx, inflightTransaction);
+            inflightTransaction = null;
+        }
+
+        tx.onFailure(t);
+    }
+
+    private synchronized void readyTransaction(final PingPongTransaction tx) {
+        Preconditions.checkState(haveLocked, "Attempted to submit transaction while it is not outstanding");
+        Preconditions.checkState(bufferTransaction == tx, "Attempted to submit transaction %s while we have %s", tx, bufferTransaction);
+
+        haveLocked = false;
+        LOG.debug("Transaction {} unlocked", bufferTransaction);
+
+        if (inflightTransaction == null) {
+            processBuffer();
+        }
+    }
+
+    @Override
+    public synchronized void close() {
+        Preconditions.checkState(!haveLocked, "Attempted to close chain while a transaction is outstanding");
+        processBuffer();
+        delegate.close();
+    }
+
+    @Override
+    public DOMDataReadOnlyTransaction newReadOnlyTransaction() {
+        final PingPongTransaction tx = allocateTransaction();
+
+        return new DOMDataReadOnlyTransaction() {
+            @Override
+            public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(final LogicalDatastoreType store,
+                    final YangInstanceIdentifier path) {
+                return tx.getTransaction().read(store, path);
+            }
+
+            @Override
+            public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store,
+                    final YangInstanceIdentifier path) {
+                return tx.getTransaction().exists(store, path);
+            }
+
+            @Override
+            public Object getIdentifier() {
+                return tx.getTransaction().getIdentifier();
+            }
+
+            @Override
+            public void close() {
+                readyTransaction(tx);
+            }
+        };
+    }
+
+    @Override
+    public DOMDataReadWriteTransaction newReadWriteTransaction() {
+        final PingPongTransaction tx = allocateTransaction();
+        final DOMDataReadWriteTransaction ret = new ForwardingDOMDataReadWriteTransaction() {
+            @Override
+            protected DOMDataReadWriteTransaction delegate() {
+                return tx.getTransaction();
+            }
+
+            @Override
+            public CheckedFuture<Void, TransactionCommitFailedException> submit() {
+                readyTransaction(tx);
+                return tx.getSubmitFuture();
+            }
+
+            @Override
+            public ListenableFuture<RpcResult<TransactionStatus>> commit() {
+                readyTransaction(tx);
+                return tx.getCommitFuture();
+            }
+
+            @Override
+            public boolean cancel() {
+                throw new UnsupportedOperationException("Transaction cancellation is not supported");
+            }
+        };
+
+        tx.recordFrontendTransaction(ret);
+        return ret;
+    }
+
+    @Override
+    public DOMDataWriteTransaction newWriteOnlyTransaction() {
+        return newReadWriteTransaction();
+    }
+}
index dc122cfdc24d672f9bcf563e26501a57b79bbad4..2d715e348588f8479cf61a12ccbcfd81d5c19f53 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.controller.md.sal.dom.broker.impl.compat;
 
 import javax.annotation.concurrent.ThreadSafe;
-
 import org.opendaylight.controller.md.sal.common.api.RegistrationListener;
 import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandler;
 import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandlerRegistration;
@@ -29,6 +28,7 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
 
+@Deprecated
 @ThreadSafe
 public class BackwardsCompatibleDataBroker implements DataProviderService {
 
index 70baaae33939c59d4f1cf4336aed30c29b48826a..c35fe82750aabcb6153ae0eea711dce697279182 100644 (file)
@@ -8,7 +8,9 @@
 package org.opendaylight.controller.md.sal.dom.broker.impl.compat;
 
 import static com.google.common.base.Preconditions.checkNotNull;
-
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
@@ -18,7 +20,6 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
-
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.impl.service.AbstractDataTransaction;
@@ -39,12 +40,8 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-import com.google.common.util.concurrent.ListenableFuture;
-
-public abstract class BackwardsCompatibleTransaction<T extends DOMDataReadTransaction> implements
-DataModificationTransaction, Delegator<T> {
+@Deprecated
+public abstract class BackwardsCompatibleTransaction<T extends DOMDataReadTransaction> implements DataModificationTransaction, Delegator<T> {
 
     private static final Logger LOG = LoggerFactory.getLogger(BackwardsCompatibleTransaction.class);
 
index d6d79cd624ae05ae178eaf67228525cfe4c80f43..309748526d1ebf4762639b4ff53bf9c38a8f3bce 100644 (file)
@@ -7,11 +7,11 @@
  */
 package org.opendaylight.controller.md.sal.dom.broker.impl.compat;
 
+import com.google.common.collect.Maps;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
-
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
 import org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent;
 import org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizationException;
@@ -20,10 +20,8 @@ import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
-import com.google.common.collect.Maps;
-
-public abstract class TranslatingDataChangeEvent implements
-DataChangeEvent<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier, CompositeNode> {
+@Deprecated
+public abstract class TranslatingDataChangeEvent implements DataChangeEvent<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier, CompositeNode> {
 
     private TranslatingDataChangeEvent() {
     }
index 1c12d20504702eb7bf551922463bac74535f42c9..7bcd02ed68a0c4ee491071c5f9cc3cba3b72c8ea 100644 (file)
@@ -21,6 +21,7 @@ import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
+@Deprecated
 abstract class TranslatingListenerInvoker implements AutoCloseable, DOMDataChangeListener, Delegator<DataChangeListener> {
 
     private final DataChangeListener delegate;
index fb72b5a99a130efbcfcd0ea04056ef61978f2e06..9e1134ece2b1a1b7888d0b5663ed4229ceb1302e 100644 (file)
@@ -11,10 +11,15 @@ import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Function;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
+import com.google.common.collect.Iterables;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.JdkFutureAdapters;
 import com.google.common.util.concurrent.ListenableFuture;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ExecutionException;
+import javax.annotation.Nullable;
 import org.opendaylight.controller.md.sal.common.api.RegistrationListener;
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandler;
@@ -56,7 +61,6 @@ import org.opendaylight.controller.sal.core.api.notify.NotificationListener;
 import org.opendaylight.controller.sal.core.api.notify.NotificationPublishService;
 import org.opendaylight.controller.sal.dom.broker.impl.NotificationRouterImpl;
 import org.opendaylight.controller.sal.dom.broker.impl.SchemaAwareRpcBroker;
-import org.opendaylight.controller.sal.dom.broker.impl.SchemaContextProvider;
 import org.opendaylight.controller.sal.dom.broker.spi.NotificationRouter;
 import org.opendaylight.controller.sal.dom.broker.util.ProxySchemaContext;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
@@ -65,18 +69,13 @@ import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 
-import javax.annotation.Nullable;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ExecutionException;
-
+@Deprecated
 public class BackwardsCompatibleMountPoint implements MountProvisionInstance, SchemaContextProvider, SchemaService {
 
     private final DataProviderService dataReader;
@@ -285,12 +284,10 @@ public class BackwardsCompatibleMountPoint implements MountProvisionInstance, Sc
 
     class ReadWrapper implements DataReader<YangInstanceIdentifier, CompositeNode> {
         private YangInstanceIdentifier shortenPath(final YangInstanceIdentifier path) {
-            YangInstanceIdentifier ret = null;
-            if(mountPath.contains(path)) {
-                final List<PathArgument> newArgs = path.getPath().subList(mountPath.getPath().size(), path.getPath().size());
-                ret = YangInstanceIdentifier.create(newArgs);
+            if (!mountPath.contains(path)) {
+                return null;
             }
-            return ret;
+            return YangInstanceIdentifier.create(Iterables.skip(path.getPathArguments(), Iterables.size(mountPath.getPathArguments())));
         }
 
         @Override
@@ -405,8 +402,8 @@ public class BackwardsCompatibleMountPoint implements MountProvisionInstance, Sc
                 return Futures.immediateCheckedFuture(normalizedNodeOptional);
             }
 
-            @Override public CheckedFuture<Boolean, ReadFailedException> exists(LogicalDatastoreType store,
-                YangInstanceIdentifier path) {
+            @Override public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store,
+                final YangInstanceIdentifier path) {
 
                 try {
                     return Futures.immediateCheckedFuture(read(store, path).get().isPresent());
@@ -527,8 +524,8 @@ public class BackwardsCompatibleMountPoint implements MountProvisionInstance, Sc
                 return new BackwardsCompatibleReadTransaction(dataReader, dataNormalizer).read(store, path);
             }
 
-            @Override public CheckedFuture<Boolean, ReadFailedException> exists(LogicalDatastoreType store,
-                YangInstanceIdentifier path) {
+            @Override public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store,
+                final YangInstanceIdentifier path) {
 
                 try {
                     return Futures.immediateCheckedFuture(read(store, path).get().isPresent());
index fef2a808c318dc4ceed1375e4c4935d3805f7456..389e62e11ced46e0205184c4030e63e5aaeb3773 100644 (file)
@@ -21,6 +21,7 @@ import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.util.ListenerRegistry;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
+@Deprecated
 public class BackwardsCompatibleMountPointManager implements MountProvisionService, MountProvisionListener {
 
     private final ListenerRegistry<MountProvisionListener> listeners = ListenerRegistry.create();
index 27e351c28a05707a782be3b3e708b01d5cde60e6..c06aefba158c9e422b739b59dbfd82adcb0263fc 100644 (file)
@@ -22,6 +22,7 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
 import com.google.common.util.concurrent.MoreExecutors;
 
+@Deprecated
 public class DataBrokerImpl extends AbstractDataBroker<YangInstanceIdentifier, CompositeNode, DataChangeListener> implements
         DataProviderService, AutoCloseable {
 
index df4549f1f8ec34c7aa5b707b4a58b42701166f4e..c229e94661dfa19d909fc8101449158b7c48fd43 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.yangtools.util.ListenerRegistry;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
+@Deprecated
 public class DataTransactionImpl extends AbstractDataTransaction<YangInstanceIdentifier, CompositeNode>
     implements DataModificationTransaction {
     private final ListenerRegistry<DataTransactionListener> listeners = new ListenerRegistry<DataTransactionListener>();
index 4911bfe60308d95ba7546af1a65f86d44809bed1..68edea7d754657927936d8cc28eae8f573855e44 100644 (file)
@@ -8,26 +8,23 @@
 package org.opendaylight.controller.sal.dom.broker;
 
 import static com.google.common.base.Preconditions.checkState;
-
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
-
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.List;
-
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.controller.sal.dom.broker.impl.SchemaContextProvider;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.util.ListenerRegistry;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 import org.opendaylight.yangtools.yang.parser.repo.URLSchemaContextResolver;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
index 054c8ea851cf2e8f56e6891a40c0dd790b72e34e..385d4009e0fcde6827c287cc978c6b2551f02ff7 100644 (file)
@@ -7,9 +7,9 @@
  */
 package org.opendaylight.controller.sal.dom.broker;
 
-import java.util.List;
+import com.google.common.collect.Iterables;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.Set;
-
 import org.opendaylight.controller.md.sal.common.api.RegistrationListener;
 import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandler;
 import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandlerRegistration;
@@ -29,7 +29,6 @@ import org.opendaylight.controller.sal.core.api.mount.MountProvisionInstance;
 import org.opendaylight.controller.sal.core.api.notify.NotificationListener;
 import org.opendaylight.controller.sal.dom.broker.impl.NotificationRouterImpl;
 import org.opendaylight.controller.sal.dom.broker.impl.SchemaAwareRpcBroker;
-import org.opendaylight.controller.sal.dom.broker.impl.SchemaContextProvider;
 import org.opendaylight.controller.sal.dom.broker.spi.NotificationRouter;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.Registration;
@@ -37,10 +36,8 @@ import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-
-import com.google.common.util.concurrent.ListenableFuture;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 
 @Deprecated
 public class MountPointImpl implements MountProvisionInstance, SchemaContextProvider {
@@ -187,12 +184,11 @@ public class MountPointImpl implements MountProvisionInstance, SchemaContextProv
 
     class ReadWrapper implements DataReader<YangInstanceIdentifier, CompositeNode> {
         private YangInstanceIdentifier shortenPath(final YangInstanceIdentifier path) {
-            YangInstanceIdentifier ret = null;
-            if(mountPath.contains(path)) {
-                List<PathArgument> newArgs = path.getPath().subList(mountPath.getPath().size(), path.getPath().size());
-                ret = YangInstanceIdentifier.create(newArgs);
+            if (!mountPath.contains(path)) {
+                return null;
             }
-            return ret;
+
+            return YangInstanceIdentifier.create(Iterables.skip(path.getPathArguments(), Iterables.size(mountPath.getPathArguments())));
         }
 
         @Override
index 4f029bc919b1f58a1542a501e63987ea9334433f..c03ae7317737abe4029e608d5e77560c83b665e2 100644 (file)
@@ -34,8 +34,8 @@ import org.opendaylight.yangtools.yang.data.impl.CompositeNodeTOImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class DataReaderRouter extends
-AbstractDataReadRouter<YangInstanceIdentifier, CompositeNode> {
+@Deprecated
+public class DataReaderRouter extends AbstractDataReadRouter<YangInstanceIdentifier, CompositeNode> {
     private final static Logger LOG = LoggerFactory
             .getLogger(DataReaderRouter.class);
     private final static URI NETCONF_NAMESPACE = URI
index 82c913327962132068aa663d941848402f8031bc..bc86581a2023460ab7019212c49bb899663571a7 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.yangtools.concepts.Delegator;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
+@Deprecated
 public class DataStoreStatsWrapper implements Delegator<DataStore>, DataStore {
 
     private final DataStore delegate;
index 94553f52757dbc24a811ab2a840c797d29608f3a..6a456ba0e8d2af5393cd09d3186d3dfbd4fb14d3 100644 (file)
@@ -8,12 +8,10 @@
 package org.opendaylight.controller.sal.dom.broker.impl;
 
 import static com.google.common.base.Preconditions.checkState;
-
 import com.google.common.base.Predicate;
 import com.google.common.collect.FluentIterable;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
-
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.HashMap;
@@ -21,7 +19,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.concurrent.Future;
-
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.md.sal.common.api.data.DataModification;
 import org.opendaylight.controller.md.sal.common.api.data.DataReader;
@@ -33,9 +30,9 @@ import org.opendaylight.controller.sal.dom.broker.util.YangSchemaUtils;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.Node;
 import org.opendaylight.yangtools.yang.data.api.SimpleNode;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.impl.CompositeNodeTOImpl;
 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
@@ -45,10 +42,8 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator<DataStore> implements //
-DataStore, //
-SchemaContextListener, //
-AutoCloseable {
+@Deprecated
+public class SchemaAwareDataStoreAdapter extends AbstractLockableDelegator<DataStore> implements DataStore, SchemaContextListener, AutoCloseable {
 
     private final static Logger LOG = LoggerFactory.getLogger(SchemaAwareDataStoreAdapter.class);
 
@@ -226,7 +221,7 @@ AutoCloseable {
         public int compare(final Entry<YangInstanceIdentifier, CompositeNode> o1, final Entry<YangInstanceIdentifier, CompositeNode> o2) {
             YangInstanceIdentifier o1Key = o1.getKey();
             YangInstanceIdentifier o2Key = o2.getKey();
-            return Integer.compare(o1Key.getPath().size(), o2Key.getPath().size());
+            return Integer.compare(Iterables.size(o1Key.getPathArguments()), Iterables.size(o2Key.getPathArguments()));
         }
     };
 
@@ -246,7 +241,7 @@ AutoCloseable {
                     childNodes.addAll(original.getValue());
                     qname = original.getNodeType();
                 } else {
-                    qname = path.getPath().get(path.getPath().size() - 1).getNodeType();
+                    qname = path.getLastPathArgument().getNodeType();
                 }
 
                 FluentIterable<YangInstanceIdentifier> directChildren = FluentIterable.from(getStoredConfigurationPaths())
@@ -254,7 +249,7 @@ AutoCloseable {
                             @Override
                             public boolean apply(final YangInstanceIdentifier input) {
                                 if (path.contains(input)) {
-                                    int nesting = input.getPath().size() - path.getPath().size();
+                                    int nesting = Iterables.size(input.getPathArguments()) - Iterables.size(path.getPathArguments());
                                     if (nesting == 1) {
                                         return true;
                                     }
@@ -289,7 +284,7 @@ AutoCloseable {
                     childNodes.addAll(original.getValue());
                     qname = original.getNodeType();
                 } else {
-                    qname = path.getPath().get(path.getPath().size() - 1).getNodeType();
+                    qname = path.getLastPathArgument().getNodeType();
                 }
 
                 FluentIterable<YangInstanceIdentifier> directChildren = FluentIterable.from(getStoredOperationalPaths())
@@ -297,7 +292,7 @@ AutoCloseable {
                             @Override
                             public boolean apply(final YangInstanceIdentifier input) {
                                 if (path.contains(input)) {
-                                    int nesting = input.getPath().size() - path.getPath().size();
+                                    int nesting = Iterables.size(input.getPathArguments()) - Iterables.size(path.getPathArguments());
                                     if (nesting == 1) {
                                         return true;
                                     }
index b4d7d2d00109b394f36c1ef138176da4fda364ab..9a3cee708506c2d10a60f31a4a7d88edc6e11d15 100644 (file)
@@ -9,18 +9,15 @@ package org.opendaylight.controller.sal.dom.broker.impl;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkState;
-
 import com.google.common.base.Preconditions;
 import com.google.common.collect.FluentIterable;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
-
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
-
 import org.opendaylight.controller.md.sal.common.api.routing.RouteChange;
 import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
 import org.opendaylight.controller.md.sal.common.impl.routing.RoutingUtils;
@@ -43,6 +40,7 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index df985cb404556ec783376fe45ca16b061da096c7..0d1e1af671a9fe2bffdbd57fef898c5b12a23ae8 100644 (file)
@@ -10,10 +10,11 @@ package org.opendaylight.controller.sal.dom.broker.impl;
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
 import org.opendaylight.yangtools.concepts.Delegator;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 
 public class SchemaContextProviders {
 
-    public static final SchemaContextProvider fromSchemaService(SchemaService schemaService) {
+    public static final SchemaContextProvider fromSchemaService(final SchemaService schemaService) {
         if (schemaService instanceof SchemaContextProvider) {
             return (SchemaContextProvider) schemaService;
         }
@@ -24,7 +25,7 @@ public class SchemaContextProviders {
 
         private final SchemaService service;
 
-        public SchemaServiceAdapter(SchemaService service) {
+        public SchemaServiceAdapter(final SchemaService service) {
             super();
             this.service = service;
         }
index 94d423e0126931559e08ca40fd7c56b5e98f1843..35b94be68684dc6bcb5d1f137cd5487de5dbce72 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.osgi.framework.ServiceReference;
 
+@Deprecated
 public class DataBrokerServiceProxy extends AbstractBrokerServiceProxy<DataBrokerService> implements DataBrokerService {
 
     public DataBrokerServiceProxy(ServiceReference<DataBrokerService> ref, DataBrokerService delegate) {
@@ -37,6 +38,4 @@ public class DataBrokerServiceProxy extends AbstractBrokerServiceProxy<DataBroke
     public DataModificationTransaction beginTransaction() {
         return getDelegate().beginTransaction();
     }
-
-
 }
index 86bfa23ed22c38b2135f3fcf80dc70b2701a104f..21d7f44e5b19faf5d10fa010b690599a142351a7 100644 (file)
@@ -22,71 +22,75 @@ import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.osgi.framework.ServiceReference;
 
-public class DataProviderServiceProxy extends AbstractBrokerServiceProxy<DataProviderService> implements
-        DataProviderService {
+@Deprecated
+public class DataProviderServiceProxy extends AbstractBrokerServiceProxy<DataProviderService> implements DataProviderService {
 
-    public DataProviderServiceProxy(ServiceReference<DataProviderService> ref, DataProviderService delegate) {
+    public DataProviderServiceProxy(final ServiceReference<DataProviderService> ref, final DataProviderService delegate) {
         super(ref, delegate);
     }
 
-    public ListenerRegistration<DataChangeListener> registerDataChangeListener(YangInstanceIdentifier path,
-            DataChangeListener listener) {
+    @Override
+    public ListenerRegistration<DataChangeListener> registerDataChangeListener(final YangInstanceIdentifier path,
+            final DataChangeListener listener) {
         return addRegistration(getDelegate().registerDataChangeListener(path, listener));
     }
 
-    public CompositeNode readConfigurationData(YangInstanceIdentifier path) {
+    @Override
+    public CompositeNode readConfigurationData(final YangInstanceIdentifier path) {
         return getDelegate().readConfigurationData(path);
     }
 
-    public CompositeNode readOperationalData(YangInstanceIdentifier path) {
+    @Override
+    public CompositeNode readOperationalData(final YangInstanceIdentifier path) {
         return getDelegate().readOperationalData(path);
     }
 
+    @Override
     public DataModificationTransaction beginTransaction() {
         return getDelegate().beginTransaction();
     }
 
     @Override
-    public void addRefresher(DataStoreIdentifier store, DataRefresher refresher) {
+    public void addRefresher(final DataStoreIdentifier store, final DataRefresher refresher) {
         getDelegate().addRefresher(store, refresher);
     }
 
     @Override
-    public void addValidator(DataStoreIdentifier store, DataValidator validator) {
+    public void addValidator(final DataStoreIdentifier store, final DataValidator validator) {
         getDelegate().addValidator(store, validator);
     }
 
     @Override
     public Registration registerCommitHandler(
-            YangInstanceIdentifier path, DataCommitHandler<YangInstanceIdentifier, CompositeNode> commitHandler) {
+            final YangInstanceIdentifier path, final DataCommitHandler<YangInstanceIdentifier, CompositeNode> commitHandler) {
         return addRegistration(getDelegate().registerCommitHandler(path, commitHandler));
     }
 
     @Override
     public Registration registerConfigurationReader(
-            YangInstanceIdentifier path, DataReader<YangInstanceIdentifier, CompositeNode> reader) {
+            final YangInstanceIdentifier path, final DataReader<YangInstanceIdentifier, CompositeNode> reader) {
         return addRegistration(getDelegate().registerConfigurationReader(path, reader));
     }
 
     @Override
     public Registration registerOperationalReader(
-            YangInstanceIdentifier path, DataReader<YangInstanceIdentifier, CompositeNode> reader) {
+            final YangInstanceIdentifier path, final DataReader<YangInstanceIdentifier, CompositeNode> reader) {
         return addRegistration(getDelegate().registerOperationalReader(path, reader));
     }
 
     @Override
-    public void removeRefresher(DataStoreIdentifier store, DataRefresher refresher) {
+    public void removeRefresher(final DataStoreIdentifier store, final DataRefresher refresher) {
         getDelegate().removeRefresher(store, refresher);
     }
 
     @Override
-    public void removeValidator(DataStoreIdentifier store, DataValidator validator) {
+    public void removeValidator(final DataStoreIdentifier store, final DataValidator validator) {
         getDelegate().removeValidator(store, validator);
     }
 
     @Override
     public ListenerRegistration<RegistrationListener<DataCommitHandlerRegistration<YangInstanceIdentifier, CompositeNode>>> registerCommitHandlerListener(
-            RegistrationListener<DataCommitHandlerRegistration<YangInstanceIdentifier, CompositeNode>> commitHandlerListener) {
+            final RegistrationListener<DataCommitHandlerRegistration<YangInstanceIdentifier, CompositeNode>> commitHandlerListener) {
         return addRegistration(getDelegate().registerCommitHandlerListener(commitHandlerListener));
     }
 }
index c807aa0b84e8e6e9d745cd285b33692fdc785871..89f9836ecf9415ba8b3a8f68a458ef8d37c78f8d 100644 (file)
@@ -14,6 +14,7 @@ import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.osgi.framework.ServiceReference;
 
+@Deprecated
 public class MountProviderServiceProxy extends AbstractBrokerServiceProxy<MountProvisionService> implements MountProvisionService{
 
 
index 2ce2bac86227f2e9b0decf770a68dea7f5bcd1bb..ebb923c375a8ba4ddea8f53119912b295f39e6d3 100644 (file)
@@ -32,6 +32,7 @@ public class ProxyFactory {
         return ((T) _createProxyImpl);
     }
 
+    @Deprecated
     private static Object _createProxyImpl(final ServiceReference<?> ref,
             final DataBrokerService service) {
 
@@ -39,6 +40,7 @@ public class ProxyFactory {
                 ((ServiceReference<DataBrokerService>) ref), service);
     }
 
+    @Deprecated
     private static Object _createProxyImpl(final ServiceReference<?> ref,
             final DataProviderService service) {
 
@@ -60,6 +62,7 @@ public class ProxyFactory {
                 ((ServiceReference<NotificationService>) ref), service);
     }
 
+    @Deprecated
     private static Object _createProxyImpl(final ServiceReference<?> ref,
             final MountProvisionService service) {
 
index 5adf39142ec5ee2af194b921a76b2ce01031ffd5..41fcd087733a1bfa697db86f2ac381d9aaac2d5d 100644 (file)
@@ -32,6 +32,7 @@ import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
 
+@Deprecated
 public class YangDataOperations {
 
     public static CompositeNode merge(final DataSchemaNode schema,
index 0444fad65c7cd7a795fa1cdfd0b9c218eae487c7..bdd3e8d69b07af9d4bc6ccbc752031f3bb8a8cfa 100644 (file)
@@ -18,6 +18,7 @@ import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.data.api.SimpleNode;
 
+@Deprecated
 public final class YangDataUtils {
 
     private YangDataUtils() {
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/yang/opendaylight-pingpong-broker.yang b/opendaylight/md-sal/sal-dom-broker/src/main/yang/opendaylight-pingpong-broker.yang
new file mode 100644 (file)
index 0000000..0ed1bbd
--- /dev/null
@@ -0,0 +1,39 @@
+module opendaylight-pingpong-broker {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:pingpong";
+    prefix "pingpong";
+
+    import config { prefix config; revision-date 2013-04-05; }
+    import opendaylight-md-sal-dom {prefix sal;}
+    import opendaylight-md-sal-common {prefix common;}
+    import opendaylight-config-dom-datastore {prefix config-dom-store-spi;}
+    import opendaylight-operational-dom-datastore {prefix operational-dom-store-spi;}
+
+    description
+        "Service definition for Ping-Pong DOM broker";
+
+    revision "2014-11-07" {
+        description
+            "Initial revision";
+    }
+
+    identity pingpong-data-broker {
+        base config:module-type;
+        config:provided-service sal:dom-async-data-broker;
+    }
+
+    augment "/config:modules/config:module/config:configuration" {
+        case pingpong-data-broker {
+            when "/config:modules/config:module/config:type = 'pingpong-data-broker'";
+
+            container data-broker {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity sal:dom-async-data-broker;
+                    }
+                }
+            }
+        }
+    }
+}
index e9ed5b1b303592c9f8b59d0a7a1145bebeb3e716..eb51db2398fdb1062735553c0d5bb8af43cacbc8 100644 (file)
@@ -4,12 +4,16 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.CONFIGURATION;
 import static org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.OPERATIONAL;
-
+import com.google.common.base.Optional;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.Callable;
 import java.util.concurrent.Executors;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -25,13 +29,6 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Optional;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
-
 public class DOMBrokerPerformanceTest {
 
     private static final Logger log = LoggerFactory.getLogger(DOMBrokerPerformanceTest.class);
@@ -63,10 +60,8 @@ public class DOMBrokerPerformanceTest {
 
     @Before
     public void setupStore() {
-        InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER",
-                 MoreExecutors.sameThreadExecutor(), MoreExecutors.sameThreadExecutor());
-        InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG",
-                 MoreExecutors.sameThreadExecutor(), MoreExecutors.sameThreadExecutor());
+        InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER", MoreExecutors.sameThreadExecutor());
+        InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG", MoreExecutors.sameThreadExecutor());
         schemaContext = TestModel.createTestContext();
 
         operStore.onGlobalContextUpdated(schemaContext);
index 674d2ff44a24a959dd7a0ca7f3ecc6bcb5662f03..80c42010338d65edb1ad8cabdf185c03ab50440c 100644 (file)
@@ -57,9 +57,9 @@ public class DOMBrokerTest {
     public void setupStore() {
 
         InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER",
-                MoreExecutors.sameThreadExecutor(), MoreExecutors.sameThreadExecutor());
+                MoreExecutors.sameThreadExecutor());
         InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG",
-                MoreExecutors.sameThreadExecutor(), MoreExecutors.sameThreadExecutor());
+                MoreExecutors.sameThreadExecutor());
         schemaContext = TestModel.createTestContext();
 
         operStore.onGlobalContextUpdated(schemaContext);
index 18b11c8300ab37a526a2018c1285a9a9817f7d3a..17f477bb0f3083921a13dd101e019357d6195052 100644 (file)
@@ -12,12 +12,15 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 import static org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.CONFIGURATION;
 import static org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.OPERATIONAL;
-
+import com.google.common.base.Optional;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -31,12 +34,6 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
-import com.google.common.base.Optional;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
-
 public class DOMTransactionChainTest {
 
     private SchemaContext schemaContext;
@@ -44,10 +41,8 @@ public class DOMTransactionChainTest {
 
     @Before
     public void setupStore() {
-        InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER",
-                MoreExecutors.sameThreadExecutor(), MoreExecutors.sameThreadExecutor());
-        InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG",
-                MoreExecutors.sameThreadExecutor(), MoreExecutors.sameThreadExecutor());
+        InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER", MoreExecutors.sameThreadExecutor());
+        InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG", MoreExecutors.sameThreadExecutor());
         schemaContext = TestModel.createTestContext();
 
         operStore.onGlobalContextUpdated(schemaContext);
index e876ccb3064454463767d9aa7f138b7b3e57a180..9a45c26964d7b58584a433aa44344ccc2368dbee 100644 (file)
@@ -36,6 +36,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+@Deprecated
 public class BackwardsCompatibleMountPointManagerTest {
     private static final Logger log = LoggerFactory.getLogger(BackwardsCompatibleMountPointManagerTest.class);
 
index f1b7261bcb78e41b89cf085888702094e2844707..fac1c2414f6363958372af75ec0c89c4de66f7b8 100644 (file)
@@ -29,11 +29,11 @@ import org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizat
 import org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizer;
 import org.opendaylight.controller.sal.core.api.data.DataModificationTransaction;
 import org.opendaylight.controller.sal.core.api.data.DataProviderService;
-import org.opendaylight.controller.sal.dom.broker.impl.SchemaContextProvider;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index 38a96dc45737bf5f0d82382a62c071af98940d78..9053f00aae32d09768efd4f159bf29e7a3cd8250 100644 (file)
@@ -99,7 +99,7 @@ public class XSQLBluePrintRelation implements Serializable {
             }
             return result;
         } else if (Map.class.isAssignableFrom(o.getClass())) {
-            Map map = (Map) o;
+            Map<?, ?> map = (Map<?, ?>) o;
             for (Object oo : map.values()) {
                 addToResult(result, execute(oo));
             }
@@ -126,7 +126,7 @@ public class XSQLBluePrintRelation implements Serializable {
                 result.add(oo);
             }
         } else if (Map.class.isAssignableFrom(o.getClass())) {
-            Map map = (Map) o;
+            Map<?, ?> map = (Map<?, ?>) o;
             for (Object oo : map.values()) {
                 result.add(oo);
             }
index ba0626fdfe68c2335a9beeb4cb5b22637488ab86..649709ecf385bf893993370e4cf3d10545f72fca 100644 (file)
@@ -18,7 +18,7 @@ public class JDBCCommand implements Serializable {
     public static final int TYPE_METADATA_REPLY = 7;
 
     private JDBCResultSet rs = null;
-    private Map record = null;
+    private Map<String, Object> record = null;
     private int rsID = -1;
     private Exception err = null;
     private XSQLBluePrint bluePrint = null;
@@ -49,7 +49,7 @@ public class JDBCCommand implements Serializable {
         this.rsID = rs.getID();
     }
 
-    public JDBCCommand(Map _record, int _rsID) {
+    public JDBCCommand(Map<String, Object> _record, int _rsID) {
         this.record = _record;
         this.rsID = _rsID;
         this.type = TYPE_QUERY_RECORD;
@@ -68,7 +68,7 @@ public class JDBCCommand implements Serializable {
         return this.rs;
     }
 
-    public Map getRecord() {
+    public Map<String, Object> getRecord() {
         return this.record;
     }
 
index 5abe8a3165bacbd99daff7e1e7e732d51d8b032a..37eacd5595975404a03cbf0390e12994d65bbe8c 100644 (file)
@@ -46,8 +46,8 @@ public class JDBCResultSet implements Serializable, ResultSet,
     private List<XSQLBluePrintNode> tablesInQuery = new ArrayList<XSQLBluePrintNode>();
     private Map<String, XSQLBluePrintNode> tablesInQueryMap = new ConcurrentHashMap<String, XSQLBluePrintNode>();
     private List<XSQLColumn> fieldsInQuery = new ArrayList<XSQLColumn>();
-    private transient LinkedList<Map> records = new LinkedList<Map>();
-    private transient Map currentRecord = null;
+    private transient LinkedList<Map<String, Object>> records = new LinkedList<>();
+    private transient Map<String, Object> currentRecord = null;
     private boolean finished = false;
     private int id = 0;
     private static Integer nextID = new Integer(0);
@@ -108,7 +108,7 @@ public class JDBCResultSet implements Serializable, ResultSet,
         }
     }
 
-    public int isObjectFitCriteria(Map objValues, String tableName) {
+    public int isObjectFitCriteria(Map<String, Object> objValues, String tableName) {
         Map<XSQLColumn, List<XSQLCriteria>> tblCriteria = criteria
                 .get(tableName);
         if (tblCriteria == null) {
@@ -197,10 +197,10 @@ public class JDBCResultSet implements Serializable, ResultSet,
         return this.records.size();
     }
 
-    public void addRecord(Map r) {
+    public void addRecord(Map<String, Object> r) {
         synchronized (this) {
             if (records == null) {
-                records = new LinkedList<Map>();
+                records = new LinkedList<>();
             }
             records.add(r);
             this.notifyAll();
@@ -208,7 +208,7 @@ public class JDBCResultSet implements Serializable, ResultSet,
     }
 
     public void addRecord(ArrayList<?> hierarchy) {
-        Map rec = new HashMap();
+        Map<String, Object> rec = new HashMap<>();
         for (int i = hierarchy.size() - 1; i >= 0; i--) {
             Object element = hierarchy.get(i);
             for (XSQLColumn c : fieldsInQuery) {
@@ -230,7 +230,7 @@ public class JDBCResultSet implements Serializable, ResultSet,
     public boolean next() {
         this.currentRecord = null;
         if (records == null) {
-            records = new LinkedList<Map>();
+            records = new LinkedList<>();
         }
         while (!finished || records.size() > 0) {
             synchronized (this) {
@@ -260,12 +260,12 @@ public class JDBCResultSet implements Serializable, ResultSet,
         return false;
     }
 
-    public Map getCurrent() {
+    public Map<String, Object> getCurrent() {
         return this.currentRecord;
     }
 
     private void createRecord(Object data, XSQLBluePrintNode node) {
-        Map rec = new HashMap();
+        Map<String, Object> rec = new HashMap<>();
         for (XSQLColumn c : this.fieldsInQuery) {
             if (c.getTableName().equals(node.getBluePrintNodeName())) {
                 try {
@@ -285,20 +285,20 @@ public class JDBCResultSet implements Serializable, ResultSet,
     }
 
     public static class Record {
-        public Map data = new HashMap();
+        public Map<String, Object> data = new HashMap<>();
         public Object element = null;
 
-        public Map getRecord() {
+        public Map<String, Object> getRecord() {
             return this.data;
         }
     }
 
-    private Map collectColumnValues(Object node, XSQLBluePrintNode bpn) {
-        Map subChildren = XSQLODLUtils.getChildren(node);
-        Map result = new HashMap();
+    private Map<String, Object> collectColumnValues(Object node, XSQLBluePrintNode bpn) {
+        Map<?, ?> subChildren = XSQLODLUtils.getChildren(node);
+        Map<String, Object> result = new HashMap<>();
         for (Object stc : subChildren.values()) {
             if (stc.getClass().getName().endsWith("ImmutableAugmentationNode")) {
-                Map values = XSQLODLUtils.getChildren(stc);
+                Map<?, ?> values = XSQLODLUtils.getChildren(stc);
                 for (Object key : values.keySet()) {
                     Object val = values.get(key);
                     if (val.getClass().getName().endsWith("ImmutableLeafNode")) {
@@ -323,7 +323,7 @@ public class JDBCResultSet implements Serializable, ResultSet,
     }
 
     private void addToData(Record rec, XSQLBluePrintNode bpn,
-            XSQLBluePrint bluePrint, Map fullRecord) {
+            XSQLBluePrint bluePrint, Map<String, Object> fullRecord) {
         XSQLBluePrintNode eNodes[] = bluePrint
                 .getBluePrintNodeByODLTableName(XSQLODLUtils
                         .getNodeIdentiofier(rec.element));
@@ -432,7 +432,7 @@ public class JDBCResultSet implements Serializable, ResultSet,
                     .getBluePrintNodeName());
             if (this.criteria.containsKey(bluePrintNode.getBluePrintNodeName())
                     || bpn != null) {
-                Map<?, ?> allKeyValues = collectColumnValues(element, bpn);
+                Map<String, Object> allKeyValues = collectColumnValues(element, bpn);
                 if (!(isObjectFitCriteria(allKeyValues,
                         bpn.getBluePrintNodeName()) == 1)) {
                     return EMPTY_RESULT;
@@ -471,7 +471,7 @@ public class JDBCResultSet implements Serializable, ResultSet,
                     }
                     boolean isObjectInCriteria = true;
                     if (bpn != null) {
-                        Map allKeyValues = collectColumnValues(rec.element, bpn);
+                        Map<String, Object> allKeyValues = collectColumnValues(rec.element, bpn);
                         if ((isObjectFitCriteria(allKeyValues,
                                 bpn.getBluePrintNodeName()) == 1)) {
                             addToData(rec, bpn, bluePrint, allKeyValues);
index 5979771d28c88e1ad765bfa5d83053b5974a724c..b348d8fda8b64da5509c39346e976e59b453ed99 100644 (file)
@@ -5,12 +5,10 @@ import java.net.Socket;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.StringTokenizer;
 import java.util.concurrent.ConcurrentHashMap;
-
 import org.opendaylight.controller.md.sal.dom.xsql.XSQLAdapter;
 import org.opendaylight.controller.md.sal.dom.xsql.XSQLBluePrint;
 import org.opendaylight.controller.md.sal.dom.xsql.XSQLBluePrintNode;
@@ -91,8 +89,8 @@ public class JDBCServer extends Thread {
                 }
                 rs.getFields().addAll(entry.getValue().getFields());
                 while (entry.getValue().next()) {
-                    Map rec = entry.getValue().getCurrent();
-                    Map newRec = new HashMap();
+                    Map<String, Object> rec = entry.getValue().getCurrent();
+                    Map<String, Object> newRec = new HashMap<>();
                     newRec.putAll(rec);
                     rs.addRecord(newRec);
                 }
@@ -119,13 +117,11 @@ public class JDBCServer extends Thread {
         rs.getFields().addAll(columnOrder);
         for (Map.Entry<String, JDBCResultSet> entry : rs.getSubQueries().entrySet()) {
             while (entry.getValue().next()) {
-                Map rec = entry.getValue().getCurrent();
-                Map newRec = new HashMap();
-                for (Iterator<?> iter = rec.entrySet().iterator(); iter.hasNext();) {
-                    Map.Entry e = (Map.Entry) iter.next();
-                    String key = (String) e.getKey();
+                Map<String, Object> rec = entry.getValue().getCurrent();
+                Map<String, Object> newRec = new HashMap<>();
+                for (Map.Entry<String, Object> e : rec.entrySet()) {
                     Object value = e.getValue();
-                    String logicalKey = origNameToName.get(key);
+                    String logicalKey = origNameToName.get(e.getKey());
                     if (value != null && logicalKey != null) {
                         newRec.put(logicalKey, value);
                     }
index 1ab12ff26f1bddc451f4aa3ceeddd111b8546f19..3f26266fef4ae945bbe839c5036e947ad44a48fe 100644 (file)
@@ -28,9 +28,7 @@ public class InMemoryConfigDataStoreProviderModule extends org.opendaylight.cont
                         getMaxDataChangeExecutorQueueSize(), getMaxDataChangeListenerQueueSize(),
                         getMaxDataStoreExecutorQueueSize()));
 
-        InMemoryDataStoreStats statsBean = new InMemoryDataStoreStats("InMemoryConfigDataStore",
-                dataStore.getDataChangeListenerNotificationManager(), dataStore.getDomStoreExecutor());
-
+        InMemoryDataStoreStats statsBean = new InMemoryDataStoreStats("InMemoryConfigDataStore", dataStore);
         dataStore.setCloseable(statsBean);
 
         return dataStore;
index 9358552579bb155d76357bbbdbbe7e94eab98f56..c91c53aba49874cbd8aa9fb316fa5e6bada3e571 100644 (file)
@@ -28,8 +28,7 @@ public class InMemoryOperationalDataStoreProviderModule extends org.opendaylight
                         getMaxDataStoreExecutorQueueSize()));
 
 
-        InMemoryDataStoreStats statsBean = new InMemoryDataStoreStats("InMemoryOperationalDataStore",
-                dataStore.getDataChangeListenerNotificationManager(), dataStore.getDomStoreExecutor());
+        InMemoryDataStoreStats statsBean = new InMemoryDataStoreStats("InMemoryOperationalDataStore", dataStore);
 
         dataStore.setCloseable(statsBean);
 
index 213f60e951cc41794864fcb1fd813a1958469728..4e01fa98e4be2ab2692ac58fa0e14fe7f3fcffcb 100644 (file)
@@ -12,8 +12,6 @@ import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.ListeningExecutorService;
-import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
@@ -61,6 +59,7 @@ import org.slf4j.LoggerFactory;
 public class InMemoryDOMDataStore extends TransactionReadyPrototype implements DOMStore, Identifiable<String>, SchemaContextListener, AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(InMemoryDOMDataStore.class);
     private static final ListenableFuture<Void> SUCCESSFUL_FUTURE = Futures.immediateFuture(null);
+    private static final ListenableFuture<Boolean> CAN_COMMIT_FUTURE = Futures.immediateFuture(Boolean.TRUE);
 
     private static final Invoker<DataChangeListenerRegistration<?>, DOMImmutableDataChangeEvent> DCL_NOTIFICATION_MGR_INVOKER =
             new Invoker<DataChangeListenerRegistration<?>, DOMImmutableDataChangeEvent>() {
@@ -80,23 +79,18 @@ public class InMemoryDOMDataStore extends TransactionReadyPrototype implements D
 
     private final QueuedNotificationManager<DataChangeListenerRegistration<?>, DOMImmutableDataChangeEvent> dataChangeListenerNotificationManager;
     private final ExecutorService dataChangeListenerExecutor;
-    private final ListeningExecutorService commitExecutor;
     private final boolean debugTransactions;
     private final String name;
 
     private volatile AutoCloseable closeable;
 
-    public InMemoryDOMDataStore(final String name, final ListeningExecutorService commitExecutor,
-            final ExecutorService dataChangeListenerExecutor) {
-        this(name, commitExecutor, dataChangeListenerExecutor,
-             InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE, false);
+    public InMemoryDOMDataStore(final String name, final ExecutorService dataChangeListenerExecutor) {
+        this(name, dataChangeListenerExecutor, InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE, false);
     }
 
-    public InMemoryDOMDataStore(final String name, final ListeningExecutorService commitExecutor,
-            final ExecutorService dataChangeListenerExecutor, final int maxDataChangeListenerQueueSize,
-            final boolean debugTransactions) {
+    public InMemoryDOMDataStore(final String name, final ExecutorService dataChangeListenerExecutor,
+            final int maxDataChangeListenerQueueSize, final boolean debugTransactions) {
         this.name = Preconditions.checkNotNull(name);
-        this.commitExecutor = Preconditions.checkNotNull(commitExecutor);
         this.dataChangeListenerExecutor = Preconditions.checkNotNull(dataChangeListenerExecutor);
         this.debugTransactions = debugTransactions;
 
@@ -114,10 +108,6 @@ public class InMemoryDOMDataStore extends TransactionReadyPrototype implements D
         return dataChangeListenerNotificationManager;
     }
 
-    public ExecutorService getDomStoreExecutor() {
-        return commitExecutor;
-    }
-
     @Override
     public final String getIdentifier() {
         return name;
@@ -150,7 +140,6 @@ public class InMemoryDOMDataStore extends TransactionReadyPrototype implements D
 
     @Override
     public void close() {
-        ExecutorServiceUtil.tryGracefulShutdown(commitExecutor, 30, TimeUnit.SECONDS);
         ExecutorServiceUtil.tryGracefulShutdown(dataChangeListenerExecutor, 30, TimeUnit.SECONDS);
 
         if(closeable != null) {
@@ -239,38 +228,36 @@ public class InMemoryDOMDataStore extends TransactionReadyPrototype implements D
 
         @Override
         public ListenableFuture<Boolean> canCommit() {
-            return commitExecutor.submit(new Callable<Boolean>() {
-                @Override
-                public Boolean call() throws TransactionCommitFailedException {
-                    try {
-                        dataTree.validate(modification);
-                        LOG.debug("Store Transaction: {} can be committed", transaction.getIdentifier());
-                        return true;
-                    } catch (ConflictingModificationAppliedException e) {
-                        LOG.warn("Store Tx: {} Conflicting modification for {}.", transaction.getIdentifier(),
-                                e.getPath());
-                        transaction.warnDebugContext(LOG);
-                        throw new OptimisticLockFailedException("Optimistic lock failed.",e);
-                    } catch (DataValidationFailedException e) {
-                        LOG.warn("Store Tx: {} Data Precondition failed for {}.", transaction.getIdentifier(),
-                                e.getPath(), e);
-                        transaction.warnDebugContext(LOG);
-                        throw new TransactionCommitFailedException("Data did not pass validation.",e);
-                    }
-                }
-            });
+            try {
+                dataTree.validate(modification);
+                LOG.debug("Store Transaction: {} can be committed", transaction.getIdentifier());
+                return CAN_COMMIT_FUTURE;
+            } catch (ConflictingModificationAppliedException e) {
+                LOG.warn("Store Tx: {} Conflicting modification for {}.", transaction.getIdentifier(),
+                        e.getPath());
+                transaction.warnDebugContext(LOG);
+                return Futures.immediateFailedFuture(new OptimisticLockFailedException("Optimistic lock failed.", e));
+            } catch (DataValidationFailedException e) {
+                LOG.warn("Store Tx: {} Data Precondition failed for {}.", transaction.getIdentifier(),
+                        e.getPath(), e);
+                transaction.warnDebugContext(LOG);
+                return Futures.immediateFailedFuture(new TransactionCommitFailedException("Data did not pass validation.", e));
+            } catch (Exception e) {
+                LOG.warn("Unexpected failure in validation phase", e);
+                return Futures.immediateFailedFuture(e);
+            }
         }
 
         @Override
         public ListenableFuture<Void> preCommit() {
-            return commitExecutor.submit(new Callable<Void>() {
-                @Override
-                public Void call() {
-                    candidate = dataTree.prepare(modification);
-                    listenerResolver = ResolveDataChangeEventsTask.create(candidate, listenerTree);
-                    return null;
-                }
-            });
+            try {
+                candidate = dataTree.prepare(modification);
+                listenerResolver = ResolveDataChangeEventsTask.create(candidate, listenerTree);
+                return SUCCESSFUL_FUTURE;
+            } catch (Exception e) {
+                LOG.warn("Unexpected failure in pre-commit phase", e);
+                return Futures.immediateFailedFuture(e);
+            }
         }
 
         @Override
index 2ee8e182c255fef59d8b219fa565473e2e8f362a..00af3dfdd7fee6098b488739d743a332ba6d8ff8 100644 (file)
@@ -7,8 +7,6 @@
  */
 package org.opendaylight.controller.md.sal.dom.store.impl;
 
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
 import java.util.concurrent.ExecutorService;
 import javax.annotation.Nullable;
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
@@ -73,9 +71,7 @@ public final class InMemoryDOMDataStoreFactory {
         ExecutorService dataChangeListenerExecutor = SpecialExecutors.newBlockingBoundedFastThreadPool(
                 dclExecutorMaxPoolSize, dclExecutorMaxQueueSize, name + "-DCL" );
 
-        final ListeningExecutorService commitExecutor = MoreExecutors.sameThreadExecutor();
-        final InMemoryDOMDataStore dataStore = new InMemoryDOMDataStore(name,
-            commitExecutor, dataChangeListenerExecutor,
+        final InMemoryDOMDataStore dataStore = new InMemoryDOMDataStore(name, dataChangeListenerExecutor,
                 actualProperties.getMaxDataChangeListenerQueueSize(), debugTransactions);
 
         if (schemaService != null) {
index e00be2446a5e690b1053b6373974d4f767ef0740..cb91b4c81ac2c7bf1222678eb6f3f063bd02fd42 100644 (file)
@@ -8,10 +8,10 @@
 
 package org.opendaylight.controller.md.sal.dom.store.impl.jmx;
 
-import java.util.concurrent.ExecutorService;
 import org.opendaylight.controller.md.sal.common.util.jmx.AbstractMXBean;
 import org.opendaylight.controller.md.sal.common.util.jmx.QueuedNotificationManagerMXBeanImpl;
 import org.opendaylight.controller.md.sal.common.util.jmx.ThreadExecutorStatsMXBeanImpl;
+import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
 import org.opendaylight.yangtools.util.concurrent.QueuedNotificationManager;
 
 /**
@@ -22,11 +22,9 @@ import org.opendaylight.yangtools.util.concurrent.QueuedNotificationManager;
 public class InMemoryDataStoreStats implements AutoCloseable {
 
     private final AbstractMXBean notificationExecutorStatsBean;
-    private final AbstractMXBean dataStoreExecutorStatsBean;
     private final QueuedNotificationManagerMXBeanImpl notificationManagerStatsBean;
 
-    public InMemoryDataStoreStats(final String mBeanType, final QueuedNotificationManager<?, ?> manager,
-            final ExecutorService dataStoreExecutor) {
+    public InMemoryDataStoreStats(final String mBeanType, final QueuedNotificationManager<?, ?> manager) {
 
         notificationManagerStatsBean = new QueuedNotificationManagerMXBeanImpl(manager,
                 "notification-manager", mBeanType, null);
@@ -37,12 +35,10 @@ public class InMemoryDataStoreStats implements AutoCloseable {
         if (notificationExecutorStatsBean != null) {
             notificationExecutorStatsBean.registerMBean();
         }
+    }
 
-        dataStoreExecutorStatsBean = ThreadExecutorStatsMXBeanImpl.create(dataStoreExecutor,
-                "data-store-executor", mBeanType, null);
-        if (dataStoreExecutorStatsBean != null) {
-            dataStoreExecutorStatsBean.registerMBean();
-        }
+    public InMemoryDataStoreStats(final String name, final InMemoryDOMDataStore dataStore) {
+        this(name, dataStore.getDataChangeListenerNotificationManager());
     }
 
     @Override
@@ -51,10 +47,6 @@ public class InMemoryDataStoreStats implements AutoCloseable {
             notificationExecutorStatsBean.unregisterMBean();
         }
 
-        if(dataStoreExecutorStatsBean != null) {
-            dataStoreExecutorStatsBean.unregisterMBean();
-        }
-
         if(notificationManagerStatsBean != null) {
             notificationManagerStatsBean.unregisterMBean();
         }
index 0e064cd50404cea82d7ae2bf63435f45a7c54b62..8d329624219916de411dec97d0c6e5c3e930a0bb 100644 (file)
@@ -7,11 +7,8 @@
  */
 package org.opendaylight.controller.md.sal.dom.store.impl;
 
-import com.google.common.util.concurrent.MoreExecutors;
-
 import java.util.Collection;
 import java.util.Map;
-
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -63,8 +60,7 @@ public abstract class AbstractDataChangeListenerTest {
         dclExecutorService = new TestDCLExecutorService(
                 SpecialExecutors.newBlockingBoundedFastThreadPool(1, 10, "DCL" ));
 
-        datastore = new InMemoryDOMDataStore("TEST",
-                MoreExecutors.sameThreadExecutor(), dclExecutorService );
+        datastore = new InMemoryDOMDataStore("TEST", dclExecutorService);
         datastore.onGlobalContextUpdated(schemaContext);
     }
 
index 04e19493dbb98051118553cd4573cc00d390bdd2..4720f4b4b9f4fcc0c04cad1b2470f2fb15097006 100644 (file)
@@ -11,14 +11,11 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
-
 import com.google.common.base.Optional;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
-
 import java.util.concurrent.ExecutionException;
-
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -48,8 +45,7 @@ public class InMemoryDataStoreTest {
 
     @Before
     public void setupStore() {
-        domStore = new InMemoryDOMDataStore("TEST", MoreExecutors.sameThreadExecutor(),
-                MoreExecutors.sameThreadExecutor());
+        domStore = new InMemoryDOMDataStore("TEST", MoreExecutors.sameThreadExecutor());
         schemaContext = TestModel.createTestContext();
         domStore.onGlobalContextUpdated(schemaContext);
     }
index 364712c7b393ba87ee1d4900e9b3fab9fed41185..15e5f716f62c17ccb66d29f09430d8aa4dac7f5b 100644 (file)
@@ -8,9 +8,9 @@
 package org.opendaylight.controller.md.sal.dom.store.impl;
 
 import static org.junit.Assert.assertNotNull;
-
+import com.google.common.base.Throwables;
+import com.google.common.util.concurrent.MoreExecutors;
 import java.util.concurrent.ExecutionException;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
@@ -23,9 +23,6 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
-import com.google.common.base.Throwables;
-import com.google.common.util.concurrent.MoreExecutors;
-
 public class SchemaUpdateForTransactionTest {
 
     private static final YangInstanceIdentifier TOP_PATH = YangInstanceIdentifier.of(Top.QNAME);
@@ -34,8 +31,7 @@ public class SchemaUpdateForTransactionTest {
 
     @Before
     public void setupStore() {
-        domStore = new InMemoryDOMDataStore("TEST", MoreExecutors.sameThreadExecutor(),
-                MoreExecutors.sameThreadExecutor());
+        domStore = new InMemoryDOMDataStore("TEST", MoreExecutors.sameThreadExecutor());
         loadSchemas(RockTheHouseInput.class);
     }
 
index 87f5477d35d0f986b6f2a0fd8b1044b8b421e58c..4b53dd7c44dc74a67eedf75f923fe220befb3e1c 100644 (file)
@@ -19,18 +19,17 @@ import static org.opendaylight.controller.sal.connect.netconf.util.NetconfMessag
 import static org.opendaylight.controller.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_RUNNING_QNAME;
 import static org.opendaylight.controller.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_TARGET_QNAME;
 import static org.opendaylight.controller.sal.connect.netconf.util.NetconfMessageTransformUtil.ROLLBACK_ON_ERROR_OPTION;
-
 import com.google.common.base.Function;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.util.Collections;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
@@ -48,10 +47,11 @@ import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.ModifyAction;
 import org.opendaylight.yangtools.yang.data.api.Node;
 import org.opendaylight.yangtools.yang.data.api.SimpleNode;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.impl.ImmutableCompositeNode;
 import org.opendaylight.yangtools.yang.data.impl.NodeFactory;
@@ -260,17 +260,16 @@ public class NetconfDeviceWriteOnlyTx implements DOMDataWriteTransaction, Future
                                                     final Optional<CompositeNode> lastChildOverride) {
         Preconditions.checkArgument(Iterables.isEmpty(dataPath.getPathArguments()) == false, "Instance identifier with empty path %s", dataPath);
 
-        List<YangInstanceIdentifier.PathArgument> reversedPath = Lists.reverse(dataPath.getPath());
-
         // Create deepest edit element with expected edit operation
-        CompositeNode previous = getDeepestEditElement(reversedPath.get(0), operation, lastChildOverride);
+        CompositeNode previous = getDeepestEditElement(dataPath.getLastPathArgument(), operation, lastChildOverride);
 
+        Iterator<PathArgument> it = dataPath.getReversePathArguments().iterator();
         // Remove already processed deepest child
-        reversedPath = Lists.newArrayList(reversedPath);
-        reversedPath.remove(0);
+        it.next();
 
         // Create edit structure in reversed order
-        for (final YangInstanceIdentifier.PathArgument arg : reversedPath) {
+        while (it.hasNext()) {
+            final YangInstanceIdentifier.PathArgument arg = it.next();
             final CompositeNodeBuilder<ImmutableCompositeNode> builder = ImmutableCompositeNode.builder();
             builder.setQName(arg.getNodeType());
 
index efc020ecd0044ef4e8d13f081611972e20db1efa..e3a7441caf746fdb56cc8d0a4cc87287908c41b9 100644 (file)
@@ -7,15 +7,21 @@
  */
 package org.opendaylight.controller.sal.connect.netconf.util;
 
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Collections2;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Sets;
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
-
 import javax.annotation.Nullable;
-
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.NetconfMessage;
 import org.opendaylight.controller.netconf.util.messages.NetconfMessageUtil;
@@ -40,15 +46,6 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Sets;
-
 public class NetconfMessageTransformUtil {
 
     public static final String MESSAGE_ID_ATTR = "message-id";
@@ -62,34 +59,34 @@ public class NetconfMessageTransformUtil {
     public static final QName IETF_NETCONF_MONITORING_SCHEMA_VERSION = QName.create(IETF_NETCONF_MONITORING, "version");
     public static final QName IETF_NETCONF_MONITORING_SCHEMA_NAMESPACE = QName.create(IETF_NETCONF_MONITORING, "namespace");
 
-    public static URI NETCONF_URI = URI.create("urn:ietf:params:xml:ns:netconf:base:1.0");
-    public static QName NETCONF_QNAME = QName.create(NETCONF_URI, null, "netconf");
-    public static QName NETCONF_DATA_QNAME = QName.create(NETCONF_QNAME, "data");
-    public static QName NETCONF_RPC_REPLY_QNAME = QName.create(NETCONF_QNAME, "rpc-reply");
-    public static QName NETCONF_ERROR_OPTION_QNAME = QName.create(NETCONF_QNAME, "error-option");
-    public static QName NETCONF_RUNNING_QNAME = QName.create(NETCONF_QNAME, "running");
-    static List<Node<?>> RUNNING = Collections.<Node<?>> singletonList(new SimpleNodeTOImpl<>(NETCONF_RUNNING_QNAME, null, null));
-    public static QName NETCONF_SOURCE_QNAME = QName.create(NETCONF_QNAME, "source");
-    public static CompositeNode CONFIG_SOURCE_RUNNING = new CompositeNodeTOImpl(NETCONF_SOURCE_QNAME, null, RUNNING);
-    public static QName NETCONF_CANDIDATE_QNAME = QName.create(NETCONF_QNAME, "candidate");
-    public static QName NETCONF_TARGET_QNAME = QName.create(NETCONF_QNAME, "target");
-    public static QName NETCONF_CONFIG_QNAME = QName.create(NETCONF_QNAME, "config");
-    public static QName NETCONF_COMMIT_QNAME = QName.create(NETCONF_QNAME, "commit");
-    public static QName NETCONF_OPERATION_QNAME = QName.create(NETCONF_QNAME, "operation");
-    public static QName NETCONF_DEFAULT_OPERATION_QNAME = QName.create(NETCONF_OPERATION_QNAME, "default-operation");
-    public static QName NETCONF_EDIT_CONFIG_QNAME = QName.create(NETCONF_QNAME, "edit-config");
-    public static QName NETCONF_GET_CONFIG_QNAME = QName.create(NETCONF_QNAME, "get-config");
-    public static QName NETCONF_DISCARD_CHANGES_QNAME = QName.create(NETCONF_QNAME, "discard-changes");
-    public static QName NETCONF_TYPE_QNAME = QName.create(NETCONF_QNAME, "type");
-    public static QName NETCONF_FILTER_QNAME = QName.create(NETCONF_QNAME, "filter");
-    public static QName NETCONF_GET_QNAME = QName.create(NETCONF_QNAME, "get");
-    public static QName NETCONF_RPC_QNAME = QName.create(NETCONF_QNAME, "rpc");
-
-    public static URI NETCONF_ROLLBACK_ON_ERROR_URI = URI
+    public static final URI NETCONF_URI = URI.create("urn:ietf:params:xml:ns:netconf:base:1.0");
+    public static final QName NETCONF_QNAME = QName.create(NETCONF_URI, null, "netconf");
+    public static final QName NETCONF_DATA_QNAME = QName.create(NETCONF_QNAME, "data");
+    public static final QName NETCONF_RPC_REPLY_QNAME = QName.create(NETCONF_QNAME, "rpc-reply");
+    public static final QName NETCONF_ERROR_OPTION_QNAME = QName.create(NETCONF_QNAME, "error-option");
+    public static final QName NETCONF_RUNNING_QNAME = QName.create(NETCONF_QNAME, "running");
+    static final List<Node<?>> RUNNING = Collections.<Node<?>> singletonList(new SimpleNodeTOImpl<>(NETCONF_RUNNING_QNAME, null, null));
+    public static final QName NETCONF_SOURCE_QNAME = QName.create(NETCONF_QNAME, "source");
+    public static final CompositeNode CONFIG_SOURCE_RUNNING = new CompositeNodeTOImpl(NETCONF_SOURCE_QNAME, null, RUNNING);
+    public static final QName NETCONF_CANDIDATE_QNAME = QName.create(NETCONF_QNAME, "candidate");
+    public static final QName NETCONF_TARGET_QNAME = QName.create(NETCONF_QNAME, "target");
+    public static final QName NETCONF_CONFIG_QNAME = QName.create(NETCONF_QNAME, "config");
+    public static final QName NETCONF_COMMIT_QNAME = QName.create(NETCONF_QNAME, "commit");
+    public static final QName NETCONF_OPERATION_QNAME = QName.create(NETCONF_QNAME, "operation");
+    public static final QName NETCONF_DEFAULT_OPERATION_QNAME = QName.create(NETCONF_OPERATION_QNAME, "default-operation");
+    public static final QName NETCONF_EDIT_CONFIG_QNAME = QName.create(NETCONF_QNAME, "edit-config");
+    public static final QName NETCONF_GET_CONFIG_QNAME = QName.create(NETCONF_QNAME, "get-config");
+    public static final QName NETCONF_DISCARD_CHANGES_QNAME = QName.create(NETCONF_QNAME, "discard-changes");
+    public static final QName NETCONF_TYPE_QNAME = QName.create(NETCONF_QNAME, "type");
+    public static final QName NETCONF_FILTER_QNAME = QName.create(NETCONF_QNAME, "filter");
+    public static final QName NETCONF_GET_QNAME = QName.create(NETCONF_QNAME, "get");
+    public static final QName NETCONF_RPC_QNAME = QName.create(NETCONF_QNAME, "rpc");
+
+    public static final URI NETCONF_ROLLBACK_ON_ERROR_URI = URI
             .create("urn:ietf:params:netconf:capability:rollback-on-error:1.0");
-    public static String ROLLBACK_ON_ERROR_OPTION = "rollback-on-error";
+    public static final String ROLLBACK_ON_ERROR_OPTION = "rollback-on-error";
 
-    public static URI NETCONF_CANDIDATE_URI = URI
+    public static final URI NETCONF_CANDIDATE_URI = URI
             .create("urn:ietf:params:netconf:capability:candidate:1.0");
 
     // Discard changes message
index 97cd67d34b70095a1571c1384e4a0e46c61f155a..423825827a4749f559f4b831fad5a71c98338750 100644 (file)
@@ -16,8 +16,8 @@ import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 import static org.opendaylight.controller.sal.restconf.impl.test.RestOperationUtils.XML;
-
 import com.google.common.base.Optional;
+import com.google.common.collect.ImmutableList;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
 import java.io.IOException;
@@ -188,7 +188,7 @@ public class RestPostOperationTest extends JerseyTest {
         assertEquals(400, post(uri, MediaType.APPLICATION_JSON, ""));
     }
 
-    private void mockInvokeRpc(CompositeNode result, boolean sucessful, Collection<RpcError> errors) {
+    private void mockInvokeRpc(final CompositeNode result, final boolean sucessful, final Collection<RpcError> errors) {
 
         DummyRpcResult.Builder<CompositeNode> builder = new DummyRpcResult.Builder<CompositeNode>().result(result)
                 .isSuccessful(sucessful);
@@ -200,7 +200,7 @@ public class RestPostOperationTest extends JerseyTest {
                 Futures.<RpcResult<CompositeNode>> immediateFuture(rpcResult));
     }
 
-    private void mockInvokeRpc(CompositeNode result, boolean sucessful) {
+    private void mockInvokeRpc(final CompositeNode result, final boolean sucessful) {
         mockInvokeRpc(result, sucessful, Collections.<RpcError> emptyList());
     }
 
@@ -229,14 +229,14 @@ public class RestPostOperationTest extends JerseyTest {
         assertEquals(204, post(URI_1, Draft02.MediaTypes.DATA + XML, xmlTestInterface));
         verify(brokerFacade).commitConfigurationDataPost(instanceIdCaptor.capture(), compNodeCaptor.capture());
         String identifier = "[(urn:ietf:params:xml:ns:yang:test-interface?revision=2014-07-01)interfaces]";
-        assertEquals(identifier, instanceIdCaptor.getValue().getPath().toString());
+        assertEquals(identifier, ImmutableList.copyOf(instanceIdCaptor.getValue().getPathArguments()).toString());
 
         String URI_2 = "/config/test-interface:interfaces";
         assertEquals(204, post(URI_2, Draft02.MediaTypes.DATA + XML, xmlBlockData));
         verify(brokerFacade, times(2))
                 .commitConfigurationDataPost(instanceIdCaptor.capture(), compNodeCaptor.capture());
         identifier = "[(urn:ietf:params:xml:ns:yang:test-interface?revision=2014-07-01)interfaces, (urn:ietf:params:xml:ns:yang:test-interface?revision=2014-07-01)block]";
-        assertEquals(identifier, instanceIdCaptor.getValue().getPath().toString());
+        assertEquals(identifier, ImmutableList.copyOf(instanceIdCaptor.getValue().getPathArguments()).toString());
     }
 
     @Test
@@ -264,7 +264,7 @@ public class RestPostOperationTest extends JerseyTest {
         restconfImpl.setControllerContext(controllerContext);
     }
 
-    private int post(String uri, String mediaType, String data) {
+    private int post(final String uri, final String mediaType, final String data) {
         return target(uri).request(mediaType).post(Entity.entity(data, mediaType)).getStatus();
     }
 
index 4900e6a66f1ab9d9d3324c85e6ca5c98f103e5ba..efd5482bfe7925e1dd81706544ca8d1f178ea2ed 100644 (file)
@@ -13,8 +13,8 @@ import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
-
 import com.google.common.base.Optional;
+import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
 import java.io.FileNotFoundException;
 import java.util.Set;
@@ -124,7 +124,7 @@ public class URITest {
                 .toInstanceIdentifier("simple-nodes:users/yang-ext:mount/test-interface2:class/student/name");
         assertEquals(
                 "[(urn:ietf:params:xml:ns:yang:test-interface2?revision=2014-08-01)class, (urn:ietf:params:xml:ns:yang:test-interface2?revision=2014-08-01)student[{(urn:ietf:params:xml:ns:yang:test-interface2?revision=2014-08-01)name=name}]]",
-                instanceIdentifier.getInstanceIdentifier().getPath().toString());
+                ImmutableList.copyOf(instanceIdentifier.getInstanceIdentifier().getPathArguments()).toString());
     }
 
     @Test
@@ -140,8 +140,7 @@ public class URITest {
         exception.expect(RestconfDocumentedException.class);
 
         controllerContext.setMountService(null);
-        InstanceIdentifierContext instanceIdentifier = controllerContext
-                .toInstanceIdentifier("simple-nodes:users/yang-ext:mount/test-interface2:class/student/name");
+        controllerContext.toInstanceIdentifier("simple-nodes:users/yang-ext:mount/test-interface2:class/student/name");
     }
 
     @Test
@@ -149,8 +148,7 @@ public class URITest {
         initMountService(false);
         exception.expect(RestconfDocumentedException.class);
 
-        InstanceIdentifierContext instanceIdentifier = controllerContext
-                .toInstanceIdentifier("simple-nodes:users/yang-ext:mount/test-interface2:class");
+        controllerContext.toInstanceIdentifier("simple-nodes:users/yang-ext:mount/test-interface2:class");
     }
 
     public void initMountService(final boolean withSchema) {
index 23e868c8b2d738e040081603234a86038146f593..6bd5178f1343a6b328ea641613abda7424896dc7 100644 (file)
@@ -8,12 +8,12 @@
 package org.opendaylight.controller.sal.restconf.impl.test;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
-
 import java.io.IOException;
 import java.net.URISyntaxException;
-import java.util.List;
+import java.util.Iterator;
 import java.util.Map;
 import javax.ws.rs.WebApplicationException;
 import org.junit.BeforeClass;
@@ -22,12 +22,12 @@ 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;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
-import org.opendaylight.yangtools.yang.data.api.Node;
-import org.opendaylight.yangtools.yang.data.api.SimpleNode;
 
 public class XmlAndJsonToCnSnInstanceIdentifierTest extends YangAndXmlAndDataSchemaLoader {
 
@@ -80,52 +80,51 @@ public class XmlAndJsonToCnSnInstanceIdentifierTest extends YangAndXmlAndDataSch
         verifyLeafListPredicate(cnSn);
     }
 
-    private void verifyLeafListPredicate(CompositeNode cnSn) throws URISyntaxException {
+    private void verifyLeafListPredicate(final CompositeNode cnSn) throws URISyntaxException {
         SimpleNode<?> lf11 = getSnWithInstanceIdentifierWhenLeafList(cnSn);
         Object value = lf11.getValue();
         assertTrue(value instanceof YangInstanceIdentifier);
 
         YangInstanceIdentifier instanceIdentifier = (YangInstanceIdentifier) value;
-        List<PathArgument> pathArguments = instanceIdentifier.getPath();
-        assertEquals(3, pathArguments.size());
+        Iterator<PathArgument> it = instanceIdentifier.getPathArguments().iterator();
         String revisionDate = "2014-01-17";
-        assertEquals(TestUtils.buildQName("cont", "instance:identifier:module", revisionDate), pathArguments.get(0)
-                .getNodeType());
-        assertEquals(TestUtils.buildQName("cont1", "instance:identifier:module", revisionDate), pathArguments.get(1)
-                .getNodeType());
-        assertEquals(TestUtils.buildQName("lflst11", "augment:module:leaf:list", "2014-01-27"), pathArguments.get(2)
-                .getNodeType());
 
-        assertTrue(pathArguments.get(2) instanceof NodeWithValue);
-        assertEquals("lflst11_1", ((NodeWithValue) pathArguments.get(2)).getValue());
+        assertEquals(TestUtils.buildQName("cont", "instance:identifier:module", revisionDate), it.next().getNodeType());
+        assertEquals(TestUtils.buildQName("cont1", "instance:identifier:module", revisionDate), it.next().getNodeType());
+
+        PathArgument arg = it.next();
+        assertFalse(it.hasNext());
+        assertEquals(TestUtils.buildQName("lflst11", "augment:module:leaf:list", "2014-01-27"), arg.getNodeType());
+
+        assertTrue(arg instanceof NodeWithValue);
+        assertEquals("lflst11_1", ((NodeWithValue) arg).getValue());
 
     }
 
-    private void verifyListPredicate(CompositeNode cnSn) throws URISyntaxException {
+    private void verifyListPredicate(final CompositeNode cnSn) throws URISyntaxException {
         SimpleNode<?> lf111 = getSnWithInstanceIdentifierWhenList(cnSn);
         Object value = lf111.getValue();
         assertTrue(value instanceof YangInstanceIdentifier);
 
         YangInstanceIdentifier instanceIdentifier = (YangInstanceIdentifier) value;
-        List<PathArgument> pathArguments = instanceIdentifier.getPath();
-        assertEquals(4, pathArguments.size());
+        Iterator<PathArgument> it = instanceIdentifier.getPathArguments().iterator();
         String revisionDate = "2014-01-17";
-        assertEquals(TestUtils.buildQName("cont", "instance:identifier:module", revisionDate), pathArguments.get(0)
-                .getNodeType());
-        assertEquals(TestUtils.buildQName("cont1", "instance:identifier:module", revisionDate), pathArguments.get(1)
-                .getNodeType());
-        assertEquals(TestUtils.buildQName("lst11", "augment:module", revisionDate), pathArguments.get(2).getNodeType());
-        assertEquals(TestUtils.buildQName("lf112", "augment:augment:module", revisionDate), pathArguments.get(3)
-                .getNodeType());
-
-        assertTrue(pathArguments.get(2) instanceof NodeIdentifierWithPredicates);
-        Map<QName, Object> predicates = ((NodeIdentifierWithPredicates) pathArguments.get(2)).getKeyValues();
+        assertEquals(TestUtils.buildQName("cont", "instance:identifier:module", revisionDate), it.next().getNodeType());
+        assertEquals(TestUtils.buildQName("cont1", "instance:identifier:module", revisionDate), it.next().getNodeType());
+
+        PathArgument arg = it.next();
+        assertEquals(TestUtils.buildQName("lst11", "augment:module", revisionDate), arg.getNodeType());
+        assertEquals(TestUtils.buildQName("lf112", "augment:augment:module", revisionDate), it.next().getNodeType());
+        assertFalse(it.hasNext());
+
+        assertTrue(arg instanceof NodeIdentifierWithPredicates);
+        Map<QName, Object> predicates = ((NodeIdentifierWithPredicates) arg).getKeyValues();
         assertEquals(2, predicates.size());
         assertEquals("value1", predicates.get(TestUtils.buildQName("keyvalue111", "augment:module", revisionDate)));
         assertEquals("value2", predicates.get(TestUtils.buildQName("keyvalue112", "augment:module", revisionDate)));
     }
 
-    private SimpleNode<?> getSnWithInstanceIdentifierWhenList(CompositeNode cnSn) throws URISyntaxException {
+    private SimpleNode<?> getSnWithInstanceIdentifierWhenList(final CompositeNode cnSn) throws URISyntaxException {
         CompositeNode cont1 = cnSn.getFirstCompositeByName(TestUtils.buildQName("cont1", "instance:identifier:module",
                 "2014-01-17"));
         assertNotNull(cont1);
@@ -138,7 +137,7 @@ public class XmlAndJsonToCnSnInstanceIdentifierTest extends YangAndXmlAndDataSch
         return lf111;
     }
 
-    private SimpleNode<?> getSnWithInstanceIdentifierWhenLeafList(CompositeNode cnSn) throws URISyntaxException {
+    private SimpleNode<?> getSnWithInstanceIdentifierWhenLeafList(final CompositeNode cnSn) throws URISyntaxException {
         CompositeNode cont1 = cnSn.getFirstCompositeByName(TestUtils.buildQName("cont1", "instance:identifier:module",
                 "2014-01-17"));
         assertNotNull(cont1);
index 3d3c52d7d1237375e5483d2eccadde7d29736f07..53f1b2e69274465a01dc6d34000eafe446b3bdb0 100644 (file)
       <artifactId>yang-parser-impl</artifactId>
     </dependency>
 
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>yang-maven-plugin-spi</artifactId>
+    </dependency>
+
     <dependency>
       <groupId>org.osgi</groupId>
       <artifactId>org.osgi.core</artifactId>
 
           <instructions>
             <Bundle-Name>MD SAL Rest Api Doc Generator</Bundle-Name>
-            <Import-Package>*,
-              com.sun.jersey.spi.container.servlet, org.eclipse.jetty.servlets</Import-Package>
+            <Import-Package>!org.apache.maven.plugin.logging,
+              !org.apache.maven.project,
+              !org.opendaylight.yangtools.yang2sources.spi,
+              *,
+              com.sun.jersey.spi.container.servlet, org.eclipse.jetty.servlets
+            </Import-Package>
             <Bundle-Activator>org.opendaylight.controller.sal.rest.doc.DocProvider</Bundle-Activator>
             <Web-ContextPath>/apidoc</Web-ContextPath>
           </instructions>
diff --git a/opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/impl/StaticDocGenerator.java b/opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/impl/StaticDocGenerator.java
new file mode 100644 (file)
index 0000000..b658102
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+ * 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.sal.rest.doc.impl;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.project.MavenProject;
+import org.opendaylight.controller.sal.rest.doc.swagger.ApiDeclaration;
+import org.opendaylight.controller.sal.rest.doc.swagger.Resource;
+import org.opendaylight.controller.sal.rest.doc.swagger.ResourceList;
+import org.opendaylight.yangtools.yang.model.api.Module;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.opendaylight.yangtools.yang2sources.spi.CodeGenerator;
+
+import javax.ws.rs.core.UriInfo;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * This class gathers all yang defined {@link Module}s and generates Swagger compliant documentation.
+ */
+public class StaticDocGenerator extends ApiDocGenerator implements CodeGenerator {
+
+    private static final String DEFAULT_OUTPUT_BASE_DIR_PATH = "target" + File.separator + "generated-resources"
+        + File.separator + "swagger-api-documentation";
+
+    private static Logger _logger = LoggerFactory.getLogger(ApiDocGenerator.class);
+
+    private MavenProject mavenProject;
+    private File projectBaseDir;
+    private Map<String, String> additionalConfig;
+    private File resourceBaseDir;
+    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+
+    /**
+     *
+     * @param context
+     * @param outputDir
+     * @param yangModules
+     * @return
+     * @throws IOException
+     */
+    @Override
+    public Collection<File> generateSources(SchemaContext context, File outputDir, Set<Module> yangModules) throws IOException {
+        List<File> result = new ArrayList<>();
+
+        // Create Base Directory
+        final File outputBaseDir;
+        if (outputDir == null) {
+            outputBaseDir = new File(DEFAULT_OUTPUT_BASE_DIR_PATH);
+        }
+        else outputBaseDir = outputDir;
+        outputBaseDir.mkdirs();
+
+        // Create Resources directory
+        File resourcesDir = new File(outputBaseDir, "resources");
+        resourcesDir.mkdirs();
+
+        // Create JS file
+        File resourcesJsFile = new File(outputBaseDir, "resources.js");
+        resourcesJsFile.createNewFile();
+        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(resourcesJsFile));
+        ObjectMapper mapper = new ObjectMapper();
+        mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
+
+        // Write resource listing to JS file
+        ResourceList resourceList = super.getResourceListing(null, context, "");
+        String resourceListJson = mapper.writeValueAsString(resourceList);
+        resourceListJson = resourceListJson.replace("\'", "\\\'").replace("\\n", "\\\\n");
+        bufferedWriter.write("function getSpec() {\n\treturn \'" + resourceListJson + "\';\n}\n\n");
+
+        // Write resources/APIs to JS file and to disk
+        bufferedWriter.write("function jsonFor(resource) {\n\tswitch(resource) {\n");
+        for (Resource resource : resourceList.getApis()) {
+            int revisionIndex = resource.getPath().indexOf('(');
+            String name = resource.getPath().substring(0, revisionIndex);
+            String revision = resource.getPath().substring(revisionIndex + 1, resource.getPath().length() - 1);
+            ApiDeclaration apiDeclaration = super.getApiDeclaration(name, revision, null, context, "");
+            String json = mapper.writeValueAsString(apiDeclaration);
+            // Manually insert models because org.json.JSONObject cannot be serialized by ObjectMapper
+            json = json.replace("\"models\":{}", "\"models\":" + apiDeclaration.getModels().toString().replace("\\\"", "\""));
+            // Escape single quotes and new lines
+            json = json.replace("\'", "\\\'").replace("\\n", "\\\\n");
+            bufferedWriter.write("\t\tcase \"" + name + "(" + revision + ")\": return \'" + json + "\';\n");
+
+            File resourceFile = new File(resourcesDir, name + "(" + revision + ").json");
+            BufferedWriter resourceFileWriter = new BufferedWriter(new FileWriter(resourceFile));
+            resourceFileWriter.write(json);
+            resourceFileWriter.close();
+            result.add(resourceFile);
+        }
+        bufferedWriter.write("\t}\n\treturn \"\";\n}");
+        bufferedWriter.close();
+
+        result.add(resourcesJsFile);
+        return result;
+    }
+
+    @Override
+    protected String generatePath(UriInfo uriInfo, String name, String revision) {
+        if (uriInfo == null) {
+            return name + "(" + revision + ")";
+        }
+        return super.generatePath(uriInfo, name, revision);
+    }
+
+    @Override
+    protected String createBasePathFromUriInfo(UriInfo uriInfo) {
+        if (uriInfo == null) {
+            return RESTCONF_CONTEXT_ROOT;
+        }
+        return super.createBasePathFromUriInfo(uriInfo);
+    }
+
+    @Override
+    public void setLog(Log log) {
+    }
+
+    @Override
+    public void setAdditionalConfig(Map<String, String> additionalConfig) {
+        this.additionalConfig = additionalConfig;
+    }
+
+    @Override
+    public void setResourceBaseDir(File resourceBaseDir) {
+        this.resourceBaseDir = resourceBaseDir;
+    }
+
+    @Override
+    public void setMavenProject(MavenProject mavenProject) {
+        this.mavenProject = mavenProject;
+        this.projectBaseDir = mavenProject.getBasedir();
+    }
+}
diff --git a/opendaylight/md-sal/sal-rest-docgen/src/main/resources/README.txt b/opendaylight/md-sal/sal-rest-docgen/src/main/resources/README.txt
new file mode 100644 (file)
index 0000000..7e72e83
--- /dev/null
@@ -0,0 +1,79 @@
+This component offers Swagger documentation of the RestConf APIs.
+
+This Swagger documentation can be accessed in two ways:
+I. Running server
+Open a browser and go to http://<host>:8181/apidoc/explorer/index.html
+
+II. Static documentation generation
+By adding a reference to the StaticDocGenerator class in any pom.xml,
+static documentation will be generated.  This static documentation will
+document all the RestConf APIs for the YANG files in that artifact and
+all the YANG files in that artifact's dependencies.
+
+In order to generate static documentation for all resources,
+this should be placed in a downstream project.
+
+Below is what you would add to the <plugins> section under <build>.
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>2.8</version>
+        <executions>
+          <execution>
+            <id>unpack-static-documentation</id>
+            <goals>
+              <goal>unpack-dependencies</goal>
+            </goals>
+            <phase>generate-resources</phase>
+            <configuration>
+              <outputDirectory>${project.build.directory}/generated-resources/swagger-api-documentation</outputDirectory>
+              <includeArtifactIds>sal-rest-docgen</includeArtifactIds>
+              <includes>**/explorer/css/**/*, **/explorer/images/**/*, **/explorer/lib/**/*, **/explorer/static/**/*,</includes>
+              <excludeTransitive>true</excludeTransitive>
+              <ignorePermissions>false</ignorePermissions>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.opendaylight.yangtools</groupId>
+        <artifactId>yang-maven-plugin</artifactId>
+        <version>${yangtools.version}</version>
+        <dependencies>
+          <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>maven-sal-api-gen-plugin</artifactId>
+            <version>${yangtools.version}</version>
+            <type>jar</type>
+          </dependency>
+          <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-binding</artifactId>
+            <version>${yangtools.version}</version>
+            <type>jar</type>
+          </dependency>
+          <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-rest-docgen</artifactId>
+            <version>${mdsal.version}</version>
+            <type>jar</type>
+          </dependency>
+        </dependencies>
+        <executions>
+          <execution>
+            <goals>
+              <goal>generate-sources</goal>
+            </goals>
+            <configuration>
+              <yangFilesRootDir>src</yangFilesRootDir>
+              <codeGenerators>
+                <generator>
+                  <codeGeneratorClass>org.opendaylight.controller.sal.rest.doc.impl.StaticDocGenerator</codeGeneratorClass>
+                  <outputBaseDir>${project.build.directory}/generated-resources/swagger-api-documentation/explorer/static</outputBaseDir>
+                </generator>
+              </codeGenerators>
+              <inspectDependencies>true</inspectDependencies>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
diff --git a/opendaylight/md-sal/sal-rest-docgen/src/main/resources/explorer/static/fonts.css b/opendaylight/md-sal/sal-rest-docgen/src/main/resources/explorer/static/fonts.css
new file mode 100644 (file)
index 0000000..4825d09
--- /dev/null
@@ -0,0 +1,16 @@
+/* latin */
+@font-face {
+    font-family: 'Droid Sans';
+    font-style: normal;
+    font-weight: 400;
+    src: local('Droid Sans'), local('DroidSans'), url(http://fonts.gstatic.com/s/droidsans/v6/s-BiyweUPV0v-yRb-cjciAsYbbCjybiHxArTLjt7FRU.woff2) format('woff2');
+    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
+}
+/* latin */
+@font-face {
+    font-family: 'Droid Sans';
+    font-style: normal;
+    font-weight: 700;
+    src: local('Droid Sans Bold'), local('DroidSans-Bold'), url(http://fonts.gstatic.com/s/droidsans/v6/EFpQQyG9GqCrobXxL-KRMX9tREKe1lLHLCwOC24WjMs.woff2) format('woff2');
+    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
+}
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-rest-docgen/src/main/resources/explorer/static/index.html b/opendaylight/md-sal/sal-rest-docgen/src/main/resources/explorer/static/index.html
new file mode 100644 (file)
index 0000000..6a7f6aa
--- /dev/null
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>RestConf Documentation</title>
+    <link href='fonts.css'
+          rel='stylesheet' type='text/css' />   <!--original location: //fonts.googleapis.com/css?family=Droid+Sans:400,700 -->
+    <link href='../css/highlight.default.css' media='screen' rel='stylesheet'
+          type='text/css' />
+    <link href='../css/screen.css' media='screen' rel='stylesheet'
+          type='text/css' />
+    <link rel="stylesheet" type="text/css" href="opendaylight.css">
+    <link rel="stylesheet" type="text/css"
+          href="../css/ui-lightness/jquery-ui-1.10.4.custom.min.css">
+    <script type="text/javascript" src="../lib/shred.bundle.js"></script>
+    <script src='../lib/jquery-1.8.0.min.js' type='text/javascript'></script>
+    <script src='../lib/jquery-ui-1.11.0.min.js' type="text/javascript"></script>
+    <script src='../lib/jquery.slideto.min.js' type='text/javascript'></script>
+    <script src='../lib/jquery.wiggle.min.js' type='text/javascript'></script>
+    <script src='../lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
+    <script src='../lib/handlebars-1.0.0.js' type='text/javascript'></script>
+    <script src='../lib/underscore-min.js' type='text/javascript'></script>
+    <script src='../lib/backbone-min.js' type='text/javascript'></script>
+    <script src='swagger.js' type='text/javascript'></script>
+    <script src='swagger-ui.js' type='text/javascript'></script>
+    <script src='../lib/odl/list_mounts.js' type='text/javascript'></script>
+    <script src='../lib/highlight.7.3.pack.js' type='text/javascript'></script>
+    <script src='../lib/odl/swagger.js' type='text/javascript'></script>
+    <script src='resources.js' type='text/javascript'></script>
+
+    <script type="text/javascript">
+
+        //reloads the swagger UI documentation for the specified mount.
+        var loadMount = function(mountIndex, mountPath) {
+            $("#message").empty();
+            $("#message").append( "<p>Loading...</p>" );
+            loadSwagger("/apidoc/apis/mounts/" + mountIndex,
+                    "swagger-ui-container");
+            $("#message").empty();
+            $("#message").append( "<h2><b>Showing mount points for " + mountPath + "</b></h2>");
+        }
+
+        //clears the swagger UI and adds text prompting use to select a mount point.
+        var selectAMount = function(string) {
+            $("#swagger-ui-container").empty();
+            $("#message").empty();
+            $("#message").append("<p>Select a mount point.</p>");
+        }
+
+        //loads the root swagger documenation (which comes from RestConf)
+        var loadRootSwagger = function() {
+            $("#message").empty();
+            loadSwagger("/apidoc/apis", "swagger-ui-container");
+        }
+
+        //main method to initialize the mount list / swagger docs / tabs on page load
+        $(function() {
+            $("#tabs").tabs();
+
+            loadMountList($("#mountlist"));
+
+            loadRootSwagger();
+        });
+    </script>
+</head>
+
+<body>
+<div>
+    <!-- style="background-color: #FCA000;" -->
+    <div class="swagger-ui-wrap ui-tabs">
+        <table>
+            <tr>
+                <td><img src="../images/logo_small.png" /></td>
+                <td><h1 width="100%">OpenDaylight RestConf API
+                    Documentation</h1></td>
+            </tr>
+        </table>
+    </div>
+</div>
+
+<div class="navbar-inner">
+    <div class="brand"></div>
+</div>
+
+<!--  defines the div shells which represent the jquery tabs -->
+<div id="tabs" class="swagger-ui-wrap">
+    <ul>
+        <li><a href="#Controller" onclick="loadRootSwagger()">Controller
+            Resources</a></li>
+    </ul>
+
+    <div id="Controller">
+        <div>
+            <h3>Below are the list of APIs supported by the Controller.</h3>
+        </div>
+    </div>
+</div>
+
+<div class="swagger-ui-wrap"><hr/></div>
+
+<!-- messages -->
+<div id="message" class="swagger-ui-wrap"></div>
+
+<!-- the swagger is always loaded in this div -->
+<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
+
+<div id="message-bar" class="swagger-ui-wrap">&nbsp;</div>
+</body>
+
+</html>
diff --git a/opendaylight/md-sal/sal-rest-docgen/src/main/resources/explorer/static/opendaylight.css b/opendaylight/md-sal/sal-rest-docgen/src/main/resources/explorer/static/opendaylight.css
new file mode 100644 (file)
index 0000000..7579388
--- /dev/null
@@ -0,0 +1,92 @@
+.fuelux [class^="icon-"],
+.fuelux [class*=" icon-"] {
+    display: inline-block;
+    width: 14px;
+    height: 14px;
+    margin-top: 1px;
+    *margin-right: .3em;
+    line-height: 14px;
+    vertical-align: text-top;
+    background-position: 14px 14px;
+    background-repeat: no-repeat;
+}
+
+.fuelux .icon-white,
+.fuelux .nav-pills > .active > a > [class^="icon-"],
+.fuelux .nav-pills > .active > a > [class*=" icon-"],
+.fuelux .nav-list > .active > a > [class^="icon-"],
+.fuelux .nav-list > .active > a > [class*=" icon-"],
+.fuelux .navbar-inverse .nav > .active > a > [class^="icon-"],
+.fuelux .navbar-inverse .nav > .active > a > [class*=" icon-"],
+.fuelux .dropdown-menu > li > a:hover > [class^="icon-"],
+.fuelux .dropdown-menu > li > a:focus > [class^="icon-"],
+.fuelux .dropdown-menu > li > a:hover > [class*=" icon-"],
+.fuelux .dropdown-menu > li > a:focus > [class*=" icon-"],
+.fuelux .dropdown-menu > .active > a > [class^="icon-"],
+.fuelux .dropdown-menu > .active > a > [class*=" icon-"],
+.fuelux .dropdown-submenu:hover > a > [class^="icon-"],
+.fuelux .dropdown-submenu:focus > a > [class^="icon-"],
+.fuelux .dropdown-submenu:hover > a > [class*=" icon-"],
+.fuelux .dropdown-submenu:focus > a > [class*=" icon-"] {
+}
+
+.fuelux .icon-search {
+    background:url('../img/search.png') 0 0 no-repeat;
+    height: 16px;
+    line-height: 16px;
+    width: 16px;
+}
+.fuelux .icon-remove {
+    background:url('../img/searchremove.png') 0 0 no-repeat;
+    height: 16px;
+    line-height: 16px;
+    width: 16px;
+}
+
+.fuelux .icon-chevron-up {
+    background:url('../img/sort_up.png') 0 0 no-repeat;
+    height: 16px;
+    line-height: 16px;
+    width: 16px;
+}
+
+.fuelux .icon-chevron-down {
+    background:url('../img/sort_down.png') 0 0 no-repeat;
+    height: 16px;
+    line-height: 16px;
+    width: 16px;
+}
+
+.fuelux .icon-chevron-left {
+    background:url('../img/nextpageleft.png') 0 0 no-repeat;
+    height: 16px;
+    line-height: 16px;
+    width: 16px;
+}
+
+.fuelux .icon-chevron-right {
+    background:url('../img/nextpageright.png') 0 0 no-repeat;
+    height: 16px;
+    line-height: 16px;
+    width: 16px;
+}
+
+.fuelux .icon-chevron-right {
+    background:url('../img/nextpageright.png') 0 0 no-repeat;
+    height: 16px;
+    line-height: 16px;
+    width: 16px;
+}
+
+.tip {
+    background-color: white;
+    border: 1px solid #CCCCCC;
+    box-shadow: 2px 2px 8px #555555;
+    color: #111111;
+    font-family: Verdana,Geneva,Arial,Helvetica,sans-serif;
+    font-size: 14px;
+    opacity: 0.9;
+    padding: 7px;
+    width: 260px;
+    border-radius: 8px;
+}
diff --git a/opendaylight/md-sal/sal-rest-docgen/src/main/resources/explorer/static/swagger-ui.js b/opendaylight/md-sal/sal-rest-docgen/src/main/resources/explorer/static/swagger-ui.js
new file mode 100644 (file)
index 0000000..aabab7c
--- /dev/null
@@ -0,0 +1,2114 @@
+$(function() {
+
+  // Helper function for vertically aligning DOM elements
+  // http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/
+  $.fn.vAlign = function() {
+    return this.each(function(i){
+      var ah = $(this).height();
+      var ph = $(this).parent().height();
+      var mh = (ph - ah) / 2;
+      $(this).css('margin-top', mh);
+    });
+  };
+
+  $.fn.stretchFormtasticInputWidthToParent = function() {
+    return this.each(function(i){
+      var p_width = $(this).closest("form").innerWidth();
+      var p_padding = parseInt($(this).closest("form").css('padding-left') ,10) + parseInt($(this).closest("form").css('padding-right'), 10);
+      var this_padding = parseInt($(this).css('padding-left'), 10) + parseInt($(this).css('padding-right'), 10);
+      $(this).css('width', p_width - p_padding - this_padding);
+    });
+  };
+
+  $('form.formtastic li.string input, form.formtastic textarea').stretchFormtasticInputWidthToParent();
+
+  // Vertically center these paragraphs
+  // Parent may need a min-height for this to work..
+  $('ul.downplayed li div.content p').vAlign();
+
+  // When a sandbox form is submitted..
+  $("form.sandbox").submit(function(){
+
+    var error_free = true;
+
+    // Cycle through the forms required inputs
+    $(this).find("input.required").each(function() {
+
+      // Remove any existing error styles from the input
+      $(this).removeClass('error');
+
+      // Tack the error style on if the input is empty..
+      if ($(this).val() == '') {
+        $(this).addClass('error');
+        $(this).wiggle();
+        error_free = false;
+      }
+
+    });
+
+    return error_free;
+  });
+
+});
+
+function clippyCopiedCallback(a) {
+  $('#api_key_copied').fadeIn().delay(1000).fadeOut();
+
+  // var b = $("#clippy_tooltip_" + a);
+  // b.length != 0 && (b.attr("title", "copied!").trigger("tipsy.reload"), setTimeout(function() {
+  //   b.attr("title", "copy to clipboard")
+  // },
+  // 500))
+}
+
+// Logging function that accounts for browsers that don't have window.console
+function log() {
+  if (window.console) console.log.apply(console,arguments);
+}
+// Handle browsers that do console incorrectly (IE9 and below, see http://stackoverflow.com/a/5539378/7913)
+if (Function.prototype.bind && console && typeof console.log == "object") {
+  [
+    "log","info","warn","error","assert","dir","clear","profile","profileEnd"
+  ].forEach(function (method) {
+      console[method] = this.bind(console[method], console);
+    }, Function.prototype.call);
+}
+
+var Docs = {
+
+  shebang: function() {
+
+    // If shebang has an operation nickname in it..
+    // e.g. /docs/#!/words/get_search
+    var fragments = $.param.fragment().split('/');
+    fragments.shift(); // get rid of the bang
+
+    switch (fragments.length) {
+      case 1:
+        // Expand all operations for the resource and scroll to it
+//                             log('shebang resource:' + fragments[0]);
+        var dom_id = 'resource_' + fragments[0];
+
+        Docs.expandEndpointListForResource(fragments[0]);
+        $("#"+dom_id).slideto({highlight: false});
+        break;
+      case 2:
+        // Refer to the endpoint DOM element, e.g. #words_get_search
+//                             log('shebang endpoint: ' + fragments.join('_'));
+
+        // Expand Resource
+        Docs.expandEndpointListForResource(fragments[0]);
+        $("#"+dom_id).slideto({highlight: false});
+
+        // Expand operation
+        var li_dom_id = fragments.join('_');
+        var li_content_dom_id = li_dom_id + "_content";
+
+//                log("li_dom_id " + li_dom_id);
+//                log("li_content_dom_id " + li_content_dom_id);
+
+        Docs.expandOperation($('#'+li_content_dom_id));
+        $('#'+li_dom_id).slideto({highlight: false});
+        break;
+    }
+
+  },
+
+  toggleEndpointListForResource: function(resource) {
+    var elem = $('li#resource_' + Docs.escapeResourceName(resource) + ' ul.endpoints');
+    if (elem.is(':visible')) {
+      Docs.collapseEndpointListForResource(resource);
+    } else {
+      Docs.expandEndpointListForResource(resource);
+    }
+  },
+
+  // Expand resource
+  expandEndpointListForResource: function(resource) {
+    var resource = Docs.escapeResourceName(resource);
+    if (resource == '') {
+      $('.resource ul.endpoints').slideDown();
+      return;
+    }
+
+    $('li#resource_' + resource).addClass('active');
+
+    var elem = $('li#resource_' + resource + ' ul.endpoints');
+    elem.slideDown();
+  },
+
+  // Collapse resource and mark as explicitly closed
+  collapseEndpointListForResource: function(resource) {
+    var resource = Docs.escapeResourceName(resource);
+    $('li#resource_' + resource).removeClass('active');
+
+    var elem = $('li#resource_' + resource + ' ul.endpoints');
+    elem.slideUp();
+  },
+
+  expandOperationsForResource: function(resource) {
+    // Make sure the resource container is open..
+    Docs.expandEndpointListForResource(resource);
+
+    if (resource == '') {
+      $('.resource ul.endpoints li.operation div.content').slideDown();
+      return;
+    }
+
+    $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
+      Docs.expandOperation($(this));
+    });
+  },
+
+  collapseOperationsForResource: function(resource) {
+    // Make sure the resource container is open..
+    Docs.expandEndpointListForResource(resource);
+
+    $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
+      Docs.collapseOperation($(this));
+    });
+  },
+
+  escapeResourceName: function(resource) {
+    return resource.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g, "\\$&");
+  },
+
+  expandOperation: function(elem) {
+    elem.slideDown();
+  },
+
+  collapseOperation: function(elem) {
+    elem.slideUp();
+  }
+
+};
+(function() {
+  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
+  templates['content_type'] = template(function (Handlebars,depth0,helpers,partials,data) {
+    this.compilerInfo = [4,'>= 1.0.0'];
+    helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+    var buffer = "", stack1, functionType="function", self=this;
+
+    function program1(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n  ";
+      stack1 = helpers.each.call(depth0, depth0.produces, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "\n";
+      return buffer;
+    }
+    function program2(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n    <option value=\"";
+      stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0);
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "\">";
+      stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0);
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "</option>\n   ";
+      return buffer;
+    }
+
+    function program4(depth0,data) {
+
+
+      return "\n  <option value=\"application/json\">application/json</option>\n";
+    }
+
+    buffer += "<label for=\"contentType\"></label>\n<select name=\"contentType\">\n";
+    stack1 = helpers['if'].call(depth0, depth0.produces, {hash:{},inverse:self.program(4, program4, data),fn:self.program(1, program1, data),data:data});
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "\n</select>\n";
+    return buffer;
+  });
+})();
+
+(function() {
+  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
+  templates['main'] = template(function (Handlebars,depth0,helpers,partials,data) {
+    this.compilerInfo = [4,'>= 1.0.0'];
+    helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+    var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
+
+    function program1(depth0,data) {
+
+      var buffer = "", stack1, stack2;
+      buffer += "\n    <div class=\"info_title\">"
+        + escapeExpression(((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.title)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+        + "</div>\n    <div class=\"info_description\">";
+      stack2 = ((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.description)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1);
+      if(stack2 || stack2 === 0) { buffer += stack2; }
+      buffer += "</div>\n    ";
+      stack2 = helpers['if'].call(depth0, ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.termsOfServiceUrl), {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
+      if(stack2 || stack2 === 0) { buffer += stack2; }
+      buffer += "\n    ";
+      stack2 = helpers['if'].call(depth0, ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.contact), {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data});
+      if(stack2 || stack2 === 0) { buffer += stack2; }
+      buffer += "\n    ";
+      stack2 = helpers['if'].call(depth0, ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.license), {hash:{},inverse:self.noop,fn:self.program(6, program6, data),data:data});
+      if(stack2 || stack2 === 0) { buffer += stack2; }
+      buffer += "\n  ";
+      return buffer;
+    }
+    function program2(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "<div class=\"info_tos\"><a href=\""
+        + escapeExpression(((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.termsOfServiceUrl)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+        + "\">Terms of service</a></div>";
+      return buffer;
+    }
+
+    function program4(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "<div class='info_contact'><a href=\"mailto:"
+        + escapeExpression(((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.contact)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+        + "\">Contact the developer</a></div>";
+      return buffer;
+    }
+
+    function program6(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "<div class='info_license'><a href='"
+        + escapeExpression(((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.licenseUrl)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+        + "'>"
+        + escapeExpression(((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.license)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+        + "</a></div>";
+      return buffer;
+    }
+
+    function program8(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n        , <span style=\"font-variant: small-caps\">api version</span>: ";
+      if (stack1 = helpers.apiVersion) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.apiVersion; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "\n        ";
+      return buffer;
+    }
+
+    buffer += "<div class='info' id='api_info'>\n  ";
+    stack1 = helpers['if'].call(depth0, depth0.info, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "\n</div>\n<div class='container' id='resources_container'>\n    <ul id='resources'>\n    </ul>\n\n    <div class=\"footer\">\n        <br>\n        <br>\n        <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: ";
+    if (stack1 = helpers.basePath) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.basePath; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "\n        ";
+    stack1 = helpers['if'].call(depth0, depth0.apiVersion, {hash:{},inverse:self.noop,fn:self.program(8, program8, data),data:data});
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "]</h4>\n    </div>\n</div>\n";
+    return buffer;
+  });
+})();
+
+(function() {
+  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
+  templates['operation'] = template(function (Handlebars,depth0,helpers,partials,data) {
+    this.compilerInfo = [4,'>= 1.0.0'];
+    helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+    var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
+
+    function program1(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n        <h4>Implementation Notes</h4>\n        <p>";
+      if (stack1 = helpers.notes) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.notes; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "</p>\n        ";
+      return buffer;
+    }
+
+    function program3(depth0,data) {
+
+
+      return "\n          <h4>Response Class</h4>\n          <p><span class=\"model-signature\" /></p>\n          <br/>\n          <div class=\"response-content-type\" />\n        ";
+    }
+
+    function program5(depth0,data) {
+
+
+      return "\n          <h4>Parameters</h4>\n          <table class='fullwidth'>\n          <thead>\n            <tr>\n            <th style=\"width: 100px; max-width: 100px\">Parameter</th>\n            <th style=\"width: 310px; max-width: 310px\">Value</th>\n            <th style=\"width: 200px; max-width: 200px\">Description</th>\n            <th style=\"width: 100px; max-width: 100px\">Parameter Type</th>\n            <th style=\"width: 220px; max-width: 230px\">Data Type</th>\n            </tr>\n          </thead>\n          <tbody class=\"operation-params\">\n\n          </tbody>\n          </table>\n          ";
+    }
+
+    function program7(depth0,data) {
+
+
+      return "\n          <div style='margin:0;padding:0;display:inline'></div>\n          <h4>Error Status Codes</h4>\n          <table class='fullwidth'>\n            <thead>\n            <tr>\n              <th>HTTP Status Code</th>\n              <th>Reason</th>\n            </tr>\n            </thead>\n            <tbody class=\"operation-status\">\n            \n            </tbody>\n          </table>\n          ";
+    }
+
+    function program9(depth0,data) {
+
+
+      return "\n          ";
+    }
+
+    function program11(depth0,data) {
+
+
+      return "\n          <div class='sandbox_header'>\n            <a href='#' class='response_hider' style='display:none'>Hide Response</a>\n            <img alt='Throbber' class='response_throbber' src='../images/throbber.gif' style='display:none' />\n          </div>\n          ";
+    }
+
+    buffer += "\n  <ul class='operations' >\n    <li class='";
+    if (stack1 = helpers.method) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.method; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + " operation' id='";
+    if (stack1 = helpers.resourceName) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.resourceName; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "_";
+    if (stack1 = helpers.nickname) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.nickname; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "_";
+    if (stack1 = helpers.method) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.method; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "_";
+    if (stack1 = helpers.number) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.number; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "'>\n      <div class='heading'>\n        <h3>\n          <span class='http_method'>\n          <a href='#!/";
+    if (stack1 = helpers.resourceName) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.resourceName; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "/";
+    if (stack1 = helpers.nickname) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.nickname; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "_";
+    if (stack1 = helpers.method) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.method; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "_";
+    if (stack1 = helpers.number) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.number; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "' class=\"toggleOperation\">";
+    if (stack1 = helpers.method) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.method; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "</a>\n          </span>\n          <span class='path'>\n          <a href='#!/";
+    if (stack1 = helpers.resourceName) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.resourceName; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "/";
+    if (stack1 = helpers.nickname) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.nickname; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "_";
+    if (stack1 = helpers.method) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.method; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "_";
+    if (stack1 = helpers.number) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.number; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "' class=\"toggleOperation\">";
+    if (stack1 = helpers.path) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.path; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "</a>\n          </span>\n        </h3>\n        <ul class='options'>\n          <li>\n          <a href='#!/";
+    if (stack1 = helpers.resourceName) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.resourceName; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "/";
+    if (stack1 = helpers.nickname) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.nickname; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "_";
+    if (stack1 = helpers.method) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.method; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "_";
+    if (stack1 = helpers.number) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.number; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "' class=\"toggleOperation\">";
+    if (stack1 = helpers.summary) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.summary; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "</a>\n          </li>\n        </ul>\n      </div>\n      <div class='content' id='";
+    if (stack1 = helpers.resourceName) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.resourceName; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "_";
+    if (stack1 = helpers.nickname) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.nickname; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "_";
+    if (stack1 = helpers.method) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.method; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "_";
+    if (stack1 = helpers.number) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.number; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "_content' style='display:none'>\n        ";
+    stack1 = helpers['if'].call(depth0, depth0.notes, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "\n        ";
+    stack1 = helpers['if'].call(depth0, depth0.type, {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data});
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "\n        <form accept-charset='UTF-8' class='sandbox'>\n          <div style='margin:0;padding:0;display:inline'></div>\n          ";
+    stack1 = helpers['if'].call(depth0, depth0.parameters, {hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data});
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "\n          ";
+    stack1 = helpers['if'].call(depth0, depth0.responseMessages, {hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data});
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "\n          ";
+    stack1 = helpers['if'].call(depth0, depth0.isReadOnly, {hash:{},inverse:self.program(11, program11, data),fn:self.program(9, program9, data),data:data});
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "\n        </form>\n        <div class='response' style='display:none'>\n          <h4>Request URL</h4>\n          <div class='block request_url'></div>\n          <h4>Response Body</h4>\n          <div class='block response_body'></div>\n          <h4>Response Code</h4>\n          <div class='block response_code'></div>\n          <h4>Response Headers</h4>\n          <div class='block response_headers'></div>\n        </div>\n      </div>\n    </li>\n  </ul>\n";
+    return buffer;
+  });
+})();
+
+(function() {
+  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
+  templates['param'] = template(function (Handlebars,depth0,helpers,partials,data) {
+    this.compilerInfo = [4,'>= 1.0.0'];
+    helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+    var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
+
+    function program1(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n            ";
+      stack1 = helpers['if'].call(depth0, depth0.isFile, {hash:{},inverse:self.program(4, program4, data),fn:self.program(2, program2, data),data:data});
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "\n    ";
+      return buffer;
+    }
+    function program2(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n                    <input type=\"file\" name='";
+      if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "'/>\n                       <div class=\"parameter-content-type\" />\n              ";
+      return buffer;
+    }
+
+    function program4(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n                    ";
+      stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(7, program7, data),fn:self.program(5, program5, data),data:data});
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "\n            ";
+      return buffer;
+    }
+    function program5(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n                            <textarea class='body-textarea' name='";
+      if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "'>";
+      if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "</textarea>\n                       ";
+      return buffer;
+    }
+
+    function program7(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n                            <textarea class='body-textarea' name='";
+      if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "'></textarea>\n                             <br />\n                                <div class=\"parameter-content-type\" />\n                      ";
+      return buffer;
+    }
+
+    function program9(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n            ";
+      stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(12, program12, data),fn:self.program(10, program10, data),data:data});
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "\n    ";
+      return buffer;
+    }
+    function program10(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n                    <input class='parameter' minlength='0' name='";
+      if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "' placeholder='' type='text' value='";
+      if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "'/>\n               ";
+      return buffer;
+    }
+
+    function program12(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n                    <input class='parameter' minlength='0' name='";
+      if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "' placeholder='' type='text' value=''/>\n           ";
+      return buffer;
+    }
+
+    buffer += "<td class='code'>";
+    if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "</td>\n<td>\n\n       ";
+    stack1 = helpers['if'].call(depth0, depth0.isBody, {hash:{},inverse:self.program(9, program9, data),fn:self.program(1, program1, data),data:data});
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "\n\n</td>\n<td>";
+    if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "</td>\n<td>";
+    if (stack1 = helpers.paramType) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.paramType; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "</td>\n<td>\n   <span class=\"model-signature\"></span>\n</td>\n";
+    return buffer;
+  });
+})();
+
+(function() {
+  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
+  templates['param_list'] = template(function (Handlebars,depth0,helpers,partials,data) {
+    this.compilerInfo = [4,'>= 1.0.0'];
+    helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+    var buffer = "", stack1, stack2, self=this, functionType="function", escapeExpression=this.escapeExpression;
+
+    function program1(depth0,data) {
+
+
+      return " multiple='multiple'";
+    }
+
+    function program3(depth0,data) {
+
+
+      return "\n    ";
+    }
+
+    function program5(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n      ";
+      stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(8, program8, data),fn:self.program(6, program6, data),data:data});
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "\n    ";
+      return buffer;
+    }
+    function program6(depth0,data) {
+
+
+      return "\n      ";
+    }
+
+    function program8(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n        ";
+      stack1 = helpers['if'].call(depth0, depth0.allowMultiple, {hash:{},inverse:self.program(11, program11, data),fn:self.program(9, program9, data),data:data});
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "\n      ";
+      return buffer;
+    }
+    function program9(depth0,data) {
+
+
+      return "\n         ";
+    }
+
+    function program11(depth0,data) {
+
+
+      return "\n          <option selected=\"\" value=''></option>\n         ";
+    }
+
+    function program13(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n      ";
+      stack1 = helpers['if'].call(depth0, depth0.isDefault, {hash:{},inverse:self.program(16, program16, data),fn:self.program(14, program14, data),data:data});
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "\n    ";
+      return buffer;
+    }
+    function program14(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n        <option selected=\"\" value='";
+      if (stack1 = helpers.value) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.value; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "'>";
+      if (stack1 = helpers.value) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.value; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + " (default)</option>\n      ";
+      return buffer;
+    }
+
+    function program16(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n        <option value='";
+      if (stack1 = helpers.value) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.value; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "'>";
+      if (stack1 = helpers.value) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.value; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "</option>\n      ";
+      return buffer;
+    }
+
+    buffer += "<td class='code'>";
+    if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "</td>\n<td>\n  <select ";
+    stack1 = helpers['if'].call(depth0, depth0.allowMultiple, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += " class='parameter' name='";
+    if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "'>\n    ";
+    stack1 = helpers['if'].call(depth0, depth0.required, {hash:{},inverse:self.program(5, program5, data),fn:self.program(3, program3, data),data:data});
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "\n    ";
+    stack2 = helpers.each.call(depth0, ((stack1 = depth0.allowableValues),stack1 == null || stack1 === false ? stack1 : stack1.descriptiveValues), {hash:{},inverse:self.noop,fn:self.program(13, program13, data),data:data});
+    if(stack2 || stack2 === 0) { buffer += stack2; }
+    buffer += "\n  </select>\n</td>\n<td>";
+    if (stack2 = helpers.description) { stack2 = stack2.call(depth0, {hash:{},data:data}); }
+    else { stack2 = depth0.description; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }
+    if(stack2 || stack2 === 0) { buffer += stack2; }
+    buffer += "</td>\n<td>";
+    if (stack2 = helpers.paramType) { stack2 = stack2.call(depth0, {hash:{},data:data}); }
+    else { stack2 = depth0.paramType; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }
+    if(stack2 || stack2 === 0) { buffer += stack2; }
+    buffer += "</td>\n<td><span class=\"model-signature\"></span></td>";
+    return buffer;
+  });
+})();
+
+(function() {
+  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
+  templates['param_readonly'] = template(function (Handlebars,depth0,helpers,partials,data) {
+    this.compilerInfo = [4,'>= 1.0.0'];
+    helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+    var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
+
+    function program1(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n        <textarea class='body-textarea' readonly='readonly' name='";
+      if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "'>";
+      if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "</textarea>\n    ";
+      return buffer;
+    }
+
+    function program3(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n        ";
+      stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(6, program6, data),fn:self.program(4, program4, data),data:data});
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "\n    ";
+      return buffer;
+    }
+    function program4(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n            ";
+      if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "\n        ";
+      return buffer;
+    }
+
+    function program6(depth0,data) {
+
+
+      return "\n            (empty)\n        ";
+    }
+
+    buffer += "<td class='code'>";
+    if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "</td>\n<td>\n    ";
+    stack1 = helpers['if'].call(depth0, depth0.isBody, {hash:{},inverse:self.program(3, program3, data),fn:self.program(1, program1, data),data:data});
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "\n</td>\n<td>";
+    if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "</td>\n<td>";
+    if (stack1 = helpers.paramType) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.paramType; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "</td>\n<td><span class=\"model-signature\"></span></td>\n";
+    return buffer;
+  });
+})();
+
+(function() {
+  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
+  templates['param_readonly_required'] = template(function (Handlebars,depth0,helpers,partials,data) {
+    this.compilerInfo = [4,'>= 1.0.0'];
+    helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+    var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
+
+    function program1(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n        <textarea class='body-textarea'  readonly='readonly' placeholder='(required)' name='";
+      if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "'>";
+      if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "</textarea>\n    ";
+      return buffer;
+    }
+
+    function program3(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n        ";
+      stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(6, program6, data),fn:self.program(4, program4, data),data:data});
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "\n    ";
+      return buffer;
+    }
+    function program4(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n            ";
+      if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "\n        ";
+      return buffer;
+    }
+
+    function program6(depth0,data) {
+
+
+      return "\n            (empty)\n        ";
+    }
+
+    buffer += "<td class='code required'>";
+    if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "</td>\n<td>\n    ";
+    stack1 = helpers['if'].call(depth0, depth0.isBody, {hash:{},inverse:self.program(3, program3, data),fn:self.program(1, program1, data),data:data});
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "\n</td>\n<td>";
+    if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "</td>\n<td>";
+    if (stack1 = helpers.paramType) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.paramType; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "</td>\n<td><span class=\"model-signature\"></span></td>\n";
+    return buffer;
+  });
+})();
+
+(function() {
+  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
+  templates['param_required'] = template(function (Handlebars,depth0,helpers,partials,data) {
+    this.compilerInfo = [4,'>= 1.0.0'];
+    helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+    var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
+
+    function program1(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n            ";
+      stack1 = helpers['if'].call(depth0, depth0.isFile, {hash:{},inverse:self.program(4, program4, data),fn:self.program(2, program2, data),data:data});
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "\n    ";
+      return buffer;
+    }
+    function program2(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n                    <input type=\"file\" name='";
+      if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "'/>\n               ";
+      return buffer;
+    }
+
+    function program4(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n                    ";
+      stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(7, program7, data),fn:self.program(5, program5, data),data:data});
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "\n            ";
+      return buffer;
+    }
+    function program5(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n                            <textarea class='body-textarea' placeholder='(required)' name='";
+      if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "'>";
+      if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "</textarea>\n                       ";
+      return buffer;
+    }
+
+    function program7(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n                            <textarea class='body-textarea' placeholder='(required)' name='";
+      if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "'></textarea>\n                             <br />\n                                <div class=\"parameter-content-type\" />\n                      ";
+      return buffer;
+    }
+
+    function program9(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n            ";
+      stack1 = helpers['if'].call(depth0, depth0.isFile, {hash:{},inverse:self.program(12, program12, data),fn:self.program(10, program10, data),data:data});
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "\n    ";
+      return buffer;
+    }
+    function program10(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n                    <input class='parameter' class='required' type='file' name='";
+      if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "'/>\n               ";
+      return buffer;
+    }
+
+    function program12(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n                    ";
+      stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(15, program15, data),fn:self.program(13, program13, data),data:data});
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "\n            ";
+      return buffer;
+    }
+    function program13(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n                            <input class='parameter required' minlength='1' name='";
+      if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "' placeholder='(required)' type='text' value='";
+      if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "'/>\n                       ";
+      return buffer;
+    }
+
+    function program15(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n                            <input class='parameter required' minlength='1' name='";
+      if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+      else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+      buffer += escapeExpression(stack1)
+        + "' placeholder='(required)' type='text' value=''/>\n                 ";
+      return buffer;
+    }
+
+    buffer += "<td class='code required'>";
+    if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "</td>\n<td>\n ";
+    stack1 = helpers['if'].call(depth0, depth0.isBody, {hash:{},inverse:self.program(9, program9, data),fn:self.program(1, program1, data),data:data});
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "\n</td>\n<td>\n <strong>";
+    if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "</strong>\n</td>\n<td>";
+    if (stack1 = helpers.paramType) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.paramType; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "</td>\n<td><span class=\"model-signature\"></span></td>\n";
+    return buffer;
+  });
+})();
+
+(function() {
+  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
+  templates['parameter_content_type'] = template(function (Handlebars,depth0,helpers,partials,data) {
+    this.compilerInfo = [4,'>= 1.0.0'];
+    helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+    var buffer = "", stack1, functionType="function", self=this;
+
+    function program1(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n  ";
+      stack1 = helpers.each.call(depth0, depth0.consumes, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "\n";
+      return buffer;
+    }
+    function program2(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n  <option value=\"";
+      stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0);
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "\">";
+      stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0);
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "</option>\n  ";
+      return buffer;
+    }
+
+    function program4(depth0,data) {
+
+
+      return "\n  <option value=\"application/json\">application/json</option>\n";
+    }
+
+    stack1 = helpers['if'].call(depth0, depth0.consumes, {hash:{},inverse:self.program(4, program4, data),fn:self.program(1, program1, data),data:data});
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "\n</select>\n";
+    return buffer;
+  });
+})();
+
+(function() {
+  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
+  templates['resource'] = template(function (Handlebars,depth0,helpers,partials,data) {
+    this.compilerInfo = [4,'>= 1.0.0'];
+    helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+    var buffer = "", stack1, options, functionType="function", escapeExpression=this.escapeExpression, self=this, blockHelperMissing=helpers.blockHelperMissing;
+
+    function program1(depth0,data) {
+
+
+      return " : ";
+    }
+
+    buffer += "<div class='heading'>\n  <h2>\n    <a href='#!/";
+    if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "' onclick=\"Docs.toggleEndpointListForResource('";
+    if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "');\">";
+    if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "</a> ";
+    options = {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data};
+    if (stack1 = helpers.description) { stack1 = stack1.call(depth0, options); }
+    else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    if (!helpers.description) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "\n  </h2>\n  <ul class='options'>\n    <li>\n      <a href='#!/";
+    if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "' id='endpointListTogger_";
+    if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "'\n         onclick=\"Docs.toggleEndpointListForResource('";
+    if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "');\">Show/Hide</a>\n    </li>\n    <li>\n      <a href='#' onclick=\"Docs.collapseOperationsForResource('";
+    if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "'); return false;\">\n        List Operations\n      </a>\n    </li>\n    <li>\n      <a href='#' onclick=\"Docs.expandOperationsForResource('";
+    if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "'); return false;\">\n        Expand Operations\n      </a>\n    </li>\n    <li>\n      <a href='";
+    stack1 = "resources/" + depth0.path + ".json";
+    buffer += escapeExpression(stack1)
+      + "'>Raw</a>\n    </li>\n  </ul>\n</div>\n<ul class='endpoints' id='";
+    if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "_endpoint_list' style='display:none'>\n\n</ul>\n";
+    return buffer;
+  });
+})();
+
+(function() {
+  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
+  templates['response_content_type'] = template(function (Handlebars,depth0,helpers,partials,data) {
+    this.compilerInfo = [4,'>= 1.0.0'];
+    helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+    var buffer = "", stack1, functionType="function", self=this;
+
+    function program1(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n  ";
+      stack1 = helpers.each.call(depth0, depth0.produces, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "\n";
+      return buffer;
+    }
+    function program2(depth0,data) {
+
+      var buffer = "", stack1;
+      buffer += "\n  <option value=\"";
+      stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0);
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "\">";
+      stack1 = (typeof depth0 === functionType ? depth0.apply(depth0) : depth0);
+      if(stack1 || stack1 === 0) { buffer += stack1; }
+      buffer += "</option>\n  ";
+      return buffer;
+    }
+
+    function program4(depth0,data) {
+
+
+      return "\n  <option value=\"application/json\">application/json</option>\n";
+    }
+
+    stack1 = helpers['if'].call(depth0, depth0.produces, {hash:{},inverse:self.program(4, program4, data),fn:self.program(1, program1, data),data:data});
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "\n</select>\n";
+    return buffer;
+  });
+})();
+
+(function() {
+  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
+  templates['signature'] = template(function (Handlebars,depth0,helpers,partials,data) {
+    this.compilerInfo = [4,'>= 1.0.0'];
+    helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+    var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
+
+
+    buffer += "<div>\n<ul class=\"signature-nav\">\n    <li><a class=\"description-link\" href=\"#\">Model</a></li>\n    <li><a class=\"snippet-link\" href=\"#\">Model Schema</a></li>\n</ul>\n<div>\n\n<div class=\"signature-container\">\n    <div class=\"description\">\n        ";
+    if (stack1 = helpers.signature) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.signature; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "\n    </div>\n\n    <div class=\"snippet\">\n        <pre><code>";
+    if (stack1 = helpers.sampleJSON) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.sampleJSON; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "</code></pre>\n        <small class=\"notice\"></small>\n    </div>\n</div>\n\n";
+    return buffer;
+  });
+})();
+
+(function() {
+  var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
+  templates['status_code'] = template(function (Handlebars,depth0,helpers,partials,data) {
+    this.compilerInfo = [4,'>= 1.0.0'];
+    helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+    var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
+
+
+    buffer += "<td width='15%' class='code'>";
+    if (stack1 = helpers.code) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.code; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    buffer += escapeExpression(stack1)
+      + "</td>\n<td>";
+    if (stack1 = helpers.message) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
+    else { stack1 = depth0.message; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
+    if(stack1 || stack1 === 0) { buffer += stack1; }
+    buffer += "</td>\n";
+    return buffer;
+  });
+})();
+
+
+
+// Generated by CoffeeScript 1.6.3
+(function() {
+  var ContentTypeView, HeaderView, MainView, OperationView, ParameterContentTypeView, ParameterView, ResourceView, ResponseContentTypeView, SignatureView, StatusCodeView, SwaggerUi, _ref, _ref1, _ref10, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9,
+    __hasProp = {}.hasOwnProperty,
+    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
+
+  SwaggerUi = (function(_super) {
+    __extends(SwaggerUi, _super);
+
+    function SwaggerUi() {
+      _ref = SwaggerUi.__super__.constructor.apply(this, arguments);
+      return _ref;
+    }
+
+    SwaggerUi.prototype.dom_id = "swagger_ui";
+
+    SwaggerUi.prototype.options = null;
+
+    SwaggerUi.prototype.api = null;
+
+    SwaggerUi.prototype.headerView = null;
+
+    SwaggerUi.prototype.mainView = null;
+
+    SwaggerUi.prototype.initialize = function(options) {
+      var _this = this;
+      if (options == null) {
+        options = {};
+      }
+      if (options.dom_id != null) {
+        this.dom_id = options.dom_id;
+        delete options.dom_id;
+      }
+      if ($('#' + this.dom_id) == null) {
+        $('body').append('<div id="' + this.dom_id + '"></div>');
+      }
+      this.options = options;
+      this.options.success = function() {
+        return _this.render();
+      };
+      this.options.progress = function(d) {
+        return _this.showMessage(d);
+      };
+      this.options.failure = function(d) {
+        return _this.onLoadFailure(d);
+      };
+      this.headerView = new HeaderView({
+        el: $('#header')
+      });
+      return this.headerView.on('update-swagger-ui', function(data) {
+        return _this.updateSwaggerUi(data);
+      });
+    };
+
+    SwaggerUi.prototype.updateSwaggerUi = function(data) {
+      this.options.url = data.url;
+      return this.load();
+    };
+
+    SwaggerUi.prototype.load = function() {
+      var url, _ref1;
+      if ((_ref1 = this.mainView) != null) {
+        _ref1.clear();
+      }
+      url = this.options.url;
+      if (url.indexOf("http") !== 0) {
+        url = this.buildUrl(window.location.href.toString(), url);
+      }
+      this.options.url = url;
+      this.headerView.update(url);
+      this.api = new SwaggerApi(this.options);
+      this.api.build();
+      return this.api;
+    };
+
+    SwaggerUi.prototype.render = function() {
+      var _this = this;
+      this.showMessage('Finished Loading Resource Information. Rendering Swagger UI...');
+      this.mainView = new MainView({
+        model: this.api,
+        el: $('#' + this.dom_id)
+      }).render();
+      this.showMessage();
+      switch (this.options.docExpansion) {
+        case "full":
+          Docs.expandOperationsForResource('');
+          break;
+        case "list":
+          Docs.collapseOperationsForResource('');
+      }
+      if (this.options.onComplete) {
+        this.options.onComplete(this.api, this);
+      }
+      return setTimeout(function() {
+        return Docs.shebang();
+      }, 400);
+    };
+
+    SwaggerUi.prototype.buildUrl = function(base, url) {
+      var parts;
+      console.log("base is " + base);
+      parts = base.split("/");
+      base = parts[0] + "//" + parts[2];
+      if (url.indexOf("/") === 0) {
+        return base + url;
+      } else {
+        return base + "/" + url;
+      }
+    };
+
+    SwaggerUi.prototype.showMessage = function(data) {
+      if (data == null) {
+        data = '';
+      }
+      $('#message-bar').removeClass('message-fail');
+      $('#message-bar').addClass('message-success');
+      return $('#message-bar').html(data);
+    };
+
+    SwaggerUi.prototype.onLoadFailure = function(data) {
+      var val;
+      if (data == null) {
+        data = '';
+      }
+      $('#message-bar').removeClass('message-success');
+      $('#message-bar').addClass('message-fail');
+      val = $('#message-bar').html(data);
+      if (this.options.onFailure != null) {
+        this.options.onFailure(data);
+      }
+      return val;
+    };
+
+    return SwaggerUi;
+
+  })(Backbone.Router);
+
+  window.SwaggerUi = SwaggerUi;
+
+  HeaderView = (function(_super) {
+    __extends(HeaderView, _super);
+
+    function HeaderView() {
+      _ref1 = HeaderView.__super__.constructor.apply(this, arguments);
+      return _ref1;
+    }
+
+    HeaderView.prototype.events = {
+      'click #show-pet-store-icon': 'showPetStore',
+      'click #show-wordnik-dev-icon': 'showWordnikDev',
+      'click #explore': 'showCustom',
+      'keyup #input_baseUrl': 'showCustomOnKeyup',
+      'keyup #input_apiKey': 'showCustomOnKeyup'
+    };
+
+    HeaderView.prototype.initialize = function() {};
+
+    HeaderView.prototype.showPetStore = function(e) {
+      return this.trigger('update-swagger-ui', {
+        url: "http://petstore.swagger.wordnik.com/api/api-docs"
+      });
+    };
+
+    HeaderView.prototype.showWordnikDev = function(e) {
+      return this.trigger('update-swagger-ui', {
+        url: "http://api.wordnik.com/v4/resources.json"
+      });
+    };
+
+    HeaderView.prototype.showCustomOnKeyup = function(e) {
+      if (e.keyCode === 13) {
+        return this.showCustom();
+      }
+    };
+
+    HeaderView.prototype.showCustom = function(e) {
+      if (e != null) {
+        e.preventDefault();
+      }
+      return this.trigger('update-swagger-ui', {
+        url: $('#input_baseUrl').val(),
+        apiKey: $('#input_apiKey').val()
+      });
+    };
+
+    HeaderView.prototype.update = function(url, apiKey, trigger) {
+      if (trigger == null) {
+        trigger = false;
+      }
+      $('#input_baseUrl').val(url);
+      if (trigger) {
+        return this.trigger('update-swagger-ui', {
+          url: url
+        });
+      }
+    };
+
+    return HeaderView;
+
+  })(Backbone.View);
+
+  MainView = (function(_super) {
+    __extends(MainView, _super);
+
+    function MainView() {
+      _ref2 = MainView.__super__.constructor.apply(this, arguments);
+      return _ref2;
+    }
+
+    MainView.prototype.initialize = function() {};
+
+    MainView.prototype.render = function() {
+      var resource, _i, _len, _ref3;
+      $(this.el).html(Handlebars.templates.main(this.model));
+      _ref3 = this.model.apisArray;
+      for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
+        resource = _ref3[_i];
+        this.addResource(resource);
+      }
+      return this;
+    };
+
+    MainView.prototype.addResource = function(resource) {
+      var resourceView;
+      resourceView = new ResourceView({
+        model: resource,
+        tagName: 'li',
+        id: 'resource_' + resource.name,
+        className: 'resource'
+      });
+      return $('#resources').append(resourceView.render().el);
+    };
+
+    MainView.prototype.clear = function() {
+      return $(this.el).html('');
+    };
+
+    return MainView;
+
+  })(Backbone.View);
+
+  ResourceView = (function(_super) {
+    __extends(ResourceView, _super);
+
+    function ResourceView() {
+      _ref3 = ResourceView.__super__.constructor.apply(this, arguments);
+      return _ref3;
+    }
+
+    ResourceView.prototype.initialize = function() {};
+
+    ResourceView.prototype.render = function() {
+      var operation, _i, _len, _ref4;
+      console.log(this.model.description);
+      $(this.el).html(Handlebars.templates.resource(this.model));
+      this.number = 0;
+      _ref4 = this.model.operationsArray;
+      for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
+        operation = _ref4[_i];
+        this.addOperation(operation);
+      }
+      return this;
+    };
+
+    ResourceView.prototype.addOperation = function(operation) {
+      var operationView;
+      operation.number = this.number;
+      operationView = new OperationView({
+        model: operation,
+        tagName: 'li',
+        className: 'endpoint'
+      });
+      $('.endpoints', $(this.el)).append(operationView.render().el);
+      return this.number++;
+    };
+
+    return ResourceView;
+
+  })(Backbone.View);
+
+  OperationView = (function(_super) {
+    __extends(OperationView, _super);
+
+    function OperationView() {
+      _ref4 = OperationView.__super__.constructor.apply(this, arguments);
+      return _ref4;
+    }
+
+    OperationView.prototype.invocationUrl = null;
+
+    OperationView.prototype.events = {
+      'submit .sandbox': 'submitOperation',
+      'click .submit': 'submitOperation',
+      'click .response_hider': 'hideResponse',
+      'click .toggleOperation': 'toggleOperationContent'
+    };
+
+    OperationView.prototype.initialize = function() {};
+
+    OperationView.prototype.render = function() {
+      var contentTypeModel, isMethodSubmissionSupported, param, responseContentTypeView, responseSignatureView, signatureModel, statusCode, type, _i, _j, _k, _len, _len1, _len2, _ref5, _ref6, _ref7;
+      isMethodSubmissionSupported = true;
+      if (!isMethodSubmissionSupported) {
+        this.model.isReadOnly = true;
+      }
+      $(this.el).html(Handlebars.templates.operation(this.model));
+      if (this.model.responseClassSignature && this.model.responseClassSignature !== 'string') {
+        signatureModel = {
+          sampleJSON: this.model.responseSampleJSON,
+          isParam: false,
+          signature: this.model.responseClassSignature
+        };
+        responseSignatureView = new SignatureView({
+          model: signatureModel,
+          tagName: 'div'
+        });
+        $('.model-signature', $(this.el)).append(responseSignatureView.render().el);
+      } else {
+        $('.model-signature', $(this.el)).html(this.model.type);
+      }
+      contentTypeModel = {
+        isParam: false
+      };
+      contentTypeModel.consumes = this.model.consumes;
+      contentTypeModel.produces = this.model.produces;
+      _ref5 = this.model.parameters;
+      for (_i = 0, _len = _ref5.length; _i < _len; _i++) {
+        param = _ref5[_i];
+        type = param.type || param.dataType;
+        if (type.toLowerCase() === 'file') {
+          if (!contentTypeModel.consumes) {
+            console.log("set content type ");
+            contentTypeModel.consumes = 'multipart/form-data';
+          }
+        }
+      }
+      responseContentTypeView = new ResponseContentTypeView({
+        model: contentTypeModel
+      });
+      $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el);
+      _ref6 = this.model.parameters;
+      for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) {
+        param = _ref6[_j];
+        this.addParameter(param, contentTypeModel.consumes);
+      }
+      _ref7 = this.model.responseMessages;
+      for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) {
+        statusCode = _ref7[_k];
+        this.addStatusCode(statusCode);
+      }
+      return this;
+    };
+
+    OperationView.prototype.addParameter = function(param, consumes) {
+      var paramView;
+      param.consumes = consumes;
+      paramView = new ParameterView({
+        model: param,
+        tagName: 'tr',
+        readOnly: this.model.isReadOnly
+      });
+      return $('.operation-params', $(this.el)).append(paramView.render().el);
+    };
+
+    OperationView.prototype.addStatusCode = function(statusCode) {
+      var statusCodeView;
+      statusCodeView = new StatusCodeView({
+        model: statusCode,
+        tagName: 'tr'
+      });
+      return $('.operation-status', $(this.el)).append(statusCodeView.render().el);
+    };
+
+    OperationView.prototype.submitOperation = function(e) {
+      var error_free, form, isFileUpload, map, o, opts, val, _i, _j, _k, _len, _len1, _len2, _ref5, _ref6, _ref7;
+      if (e != null) {
+        e.preventDefault();
+      }
+      form = $('.sandbox', $(this.el));
+      error_free = true;
+      form.find("input.required").each(function() {
+        var _this = this;
+        $(this).removeClass("error");
+        if (jQuery.trim($(this).val()) === "") {
+          $(this).addClass("error");
+          $(this).wiggle({
+            callback: function() {
+              return $(_this).focus();
+            }
+          });
+          return error_free = false;
+        }
+      });
+      if (error_free) {
+        map = {};
+        opts = {
+          parent: this
+        };
+        isFileUpload = false;
+        _ref5 = form.find("input");
+        for (_i = 0, _len = _ref5.length; _i < _len; _i++) {
+          o = _ref5[_i];
+          if ((o.value != null) && jQuery.trim(o.value).length > 0) {
+            map[o.name] = o.value;
+          }
+          if (o.type === "file") {
+            isFileUpload = true;
+          }
+        }
+        _ref6 = form.find("textarea");
+        for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) {
+          o = _ref6[_j];
+          if ((o.value != null) && jQuery.trim(o.value).length > 0) {
+            map["body"] = o.value;
+          }
+        }
+        _ref7 = form.find("select");
+        for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) {
+          o = _ref7[_k];
+          val = this.getSelectedValue(o);
+          if ((val != null) && jQuery.trim(val).length > 0) {
+            map[o.name] = val;
+          }
+        }
+        opts.responseContentType = $("div select[name=responseContentType]", $(this.el)).val();
+        opts.requestContentType = $("div select[name=parameterContentType]", $(this.el)).val();
+        $(".response_throbber", $(this.el)).show();
+        if (isFileUpload) {
+          return this.handleFileUpload(map, form);
+        } else {
+          return this.model["do"](map, opts, this.showCompleteStatus, this.showErrorStatus, this);
+        }
+      }
+    };
+
+    OperationView.prototype.success = function(response, parent) {
+      return parent.showCompleteStatus(response);
+    };
+
+    OperationView.prototype.handleFileUpload = function(map, form) {
+      var bodyParam, headerParams, o, obj, param, _i, _j, _k, _len, _len1, _len2, _ref5, _ref6, _ref7,
+        _this = this;
+      console.log("it's a file upload");
+      _ref5 = form.serializeArray();
+      for (_i = 0, _len = _ref5.length; _i < _len; _i++) {
+        o = _ref5[_i];
+        if ((o.value != null) && jQuery.trim(o.value).length > 0) {
+          map[o.name] = o.value;
+        }
+      }
+      bodyParam = new FormData();
+      _ref6 = this.model.parameters;
+      for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) {
+        param = _ref6[_j];
+        if (param.paramType === 'form') {
+          bodyParam.append(param.name, map[param.name]);
+        }
+      }
+      headerParams = {};
+      _ref7 = this.model.parameters;
+      for (_k = 0, _len2 = _ref7.length; _k < _len2; _k++) {
+        param = _ref7[_k];
+        if (param.paramType === 'header') {
+          headerParams[param.name] = map[param.name];
+        }
+      }
+      console.log(headerParams);
+      $.each($('input[type~="file"]'), function(i, el) {
+        return bodyParam.append($(el).attr('name'), el.files[0]);
+      });
+      console.log(bodyParam);
+      this.invocationUrl = this.model.supportHeaderParams() ? (headerParams = this.model.getHeaderParams(map), this.model.urlify(map, false)) : this.model.urlify(map, true);
+      $(".request_url", $(this.el)).html("<pre>" + this.invocationUrl + "</pre>");
+      obj = {
+        type: this.model.method,
+        url: this.invocationUrl,
+        headers: headerParams,
+        data: bodyParam,
+        dataType: 'json',
+        contentType: false,
+        processData: false,
+        error: function(data, textStatus, error) {
+          return _this.showErrorStatus(_this.wrap(data), _this);
+        },
+        success: function(data) {
+          return _this.showResponse(data, _this);
+        },
+        complete: function(data) {
+          return _this.showCompleteStatus(_this.wrap(data), _this);
+        }
+      };
+      if (window.authorizations) {
+        window.authorizations.apply(obj);
+      }
+      jQuery.ajax(obj);
+      return false;
+    };
+
+    OperationView.prototype.wrap = function(data) {
+      var o,
+        _this = this;
+      o = {};
+      o.content = {};
+      o.content.data = data.responseText;
+      o.getHeaders = function() {
+        return {
+          "Content-Type": data.getResponseHeader("Content-Type")
+        };
+      };
+      o.request = {};
+      o.request.url = this.invocationUrl;
+      o.status = data.status;
+      return o;
+    };
+
+    OperationView.prototype.getSelectedValue = function(select) {
+      var opt, options, _i, _len, _ref5;
+      if (!select.multiple) {
+        return select.value;
+      } else {
+        options = [];
+        _ref5 = select.options;
+        for (_i = 0, _len = _ref5.length; _i < _len; _i++) {
+          opt = _ref5[_i];
+          if (opt.selected) {
+            options.push(opt.value);
+          }
+        }
+        if (options.length > 0) {
+          return options.join(",");
+        } else {
+          return null;
+        }
+      }
+    };
+
+    OperationView.prototype.hideResponse = function(e) {
+      if (e != null) {
+        e.preventDefault();
+      }
+      $(".response", $(this.el)).slideUp();
+      return $(".response_hider", $(this.el)).fadeOut();
+    };
+
+    OperationView.prototype.showResponse = function(response) {
+      var prettyJson;
+      prettyJson = JSON.stringify(response, null, "\t").replace(/\n/g, "<br>");
+      return $(".response_body", $(this.el)).html(escape(prettyJson));
+    };
+
+    OperationView.prototype.showErrorStatus = function(data, parent) {
+      return parent.showStatus(data);
+    };
+
+    OperationView.prototype.showCompleteStatus = function(data, parent) {
+      return parent.showStatus(data);
+    };
+
+    OperationView.prototype.formatXml = function(xml) {
+      var contexp, formatted, indent, lastType, lines, ln, pad, reg, transitions, wsexp, _fn, _i, _len;
+      reg = /(>)(<)(\/*)/g;
+      wsexp = /[ ]*(.*)[ ]+\n/g;
+      contexp = /(<.+>)(.+\n)/g;
+      xml = xml.replace(reg, '$1\n$2$3').replace(wsexp, '$1\n').replace(contexp, '$1\n$2');
+      pad = 0;
+      formatted = '';
+      lines = xml.split('\n');
+      indent = 0;
+      lastType = 'other';
+      transitions = {
+        'single->single': 0,
+        'single->closing': -1,
+        'single->opening': 0,
+        'single->other': 0,
+        'closing->single': 0,
+        'closing->closing': -1,
+        'closing->opening': 0,
+        'closing->other': 0,
+        'opening->single': 1,
+        'opening->closing': 0,
+        'opening->opening': 1,
+        'opening->other': 1,
+        'other->single': 0,
+        'other->closing': -1,
+        'other->opening': 0,
+        'other->other': 0
+      };
+      _fn = function(ln) {
+        var fromTo, j, key, padding, type, types, value;
+        types = {
+          single: Boolean(ln.match(/<.+\/>/)),
+          closing: Boolean(ln.match(/<\/.+>/)),
+          opening: Boolean(ln.match(/<[^!?].*>/))
+        };
+        type = ((function() {
+          var _results;
+          _results = [];
+          for (key in types) {
+            value = types[key];
+            if (value) {
+              _results.push(key);
+            }
+          }
+          return _results;
+        })())[0];
+        type = type === void 0 ? 'other' : type;
+        fromTo = lastType + '->' + type;
+        lastType = type;
+        padding = '';
+        indent += transitions[fromTo];
+        padding = ((function() {
+          var _j, _ref5, _results;
+          _results = [];
+          for (j = _j = 0, _ref5 = indent; 0 <= _ref5 ? _j < _ref5 : _j > _ref5; j = 0 <= _ref5 ? ++_j : --_j) {
+            _results.push('  ');
+          }
+          return _results;
+        })()).join('');
+        if (fromTo === 'opening->closing') {
+          return formatted = formatted.substr(0, formatted.length - 1) + ln + '\n';
+        } else {
+          return formatted += padding + ln + '\n';
+        }
+      };
+      for (_i = 0, _len = lines.length; _i < _len; _i++) {
+        ln = lines[_i];
+        _fn(ln);
+      }
+      return formatted;
+    };
+
+    OperationView.prototype.showStatus = function(data) {
+      var code, content, contentType, headers, pre, response_body;
+      content = data.content.data;
+      headers = data.getHeaders();
+      contentType = headers["Content-Type"];
+      if (content === void 0) {
+        code = $('<code />').text("no content");
+        pre = $('<pre class="json" />').append(code);
+      } else if (contentType.indexOf("application/json") === 0 || contentType.indexOf("application/hal+json") === 0) {
+        code = $('<code />').text(JSON.stringify(JSON.parse(content), null, 2));
+        pre = $('<pre class="json" />').append(code);
+      } else if (contentType.indexOf("application/xml") === 0) {
+        code = $('<code />').text(this.formatXml(content));
+        pre = $('<pre class="xml" />').append(code);
+      } else if (contentType.indexOf("text/html") === 0) {
+        code = $('<code />').html(content);
+        pre = $('<pre class="xml" />').append(code);
+      } else if (contentType.indexOf("image/") === 0) {
+        pre = $('<img>').attr('src', data.request.url);
+      } else {
+        code = $('<code />').text(content);
+        pre = $('<pre class="json" />').append(code);
+      }
+      response_body = pre;
+      $(".request_url", $(this.el)).html("<pre>" + data.request.url + "</pre>");
+      $(".response_code", $(this.el)).html("<pre>" + data.status + "</pre>");
+      $(".response_body", $(this.el)).html(response_body);
+      $(".response_headers", $(this.el)).html("<pre>" + JSON.stringify(data.getHeaders(), null, "  ").replace(/\n/g, "<br>") + "</pre>");
+      $(".response", $(this.el)).slideDown();
+      $(".response_hider", $(this.el)).show();
+      $(".response_throbber", $(this.el)).hide();
+      return hljs.highlightBlock($('.response_body', $(this.el))[0]);
+    };
+
+    OperationView.prototype.toggleOperationContent = function() {
+      var elem;
+      elem = $('#' + Docs.escapeResourceName(this.model.resourceName) + "_" + this.model.nickname + "_" + this.model.method + "_" + this.model.number + "_content");
+      if (elem.is(':visible')) {
+        return Docs.collapseOperation(elem);
+      } else {
+        return Docs.expandOperation(elem);
+      }
+    };
+
+    return OperationView;
+
+  })(Backbone.View);
+
+  StatusCodeView = (function(_super) {
+    __extends(StatusCodeView, _super);
+
+    function StatusCodeView() {
+      _ref5 = StatusCodeView.__super__.constructor.apply(this, arguments);
+      return _ref5;
+    }
+
+    StatusCodeView.prototype.initialize = function() {};
+
+    StatusCodeView.prototype.render = function() {
+      var template;
+      template = this.template();
+      $(this.el).html(template(this.model));
+      return this;
+    };
+
+    StatusCodeView.prototype.template = function() {
+      return Handlebars.templates.status_code;
+    };
+
+    return StatusCodeView;
+
+  })(Backbone.View);
+
+  ParameterView = (function(_super) {
+    __extends(ParameterView, _super);
+
+    function ParameterView() {
+      _ref6 = ParameterView.__super__.constructor.apply(this, arguments);
+      return _ref6;
+    }
+
+    ParameterView.prototype.initialize = function() {};
+
+    ParameterView.prototype.render = function() {
+      var contentTypeModel, isParam, parameterContentTypeView, responseContentTypeView, signatureModel, signatureView, template, type;
+      type = this.model.type || this.model.dataType;
+      if (this.model.paramType === 'body') {
+        this.model.isBody = true;
+      }
+      if (type.toLowerCase() === 'file') {
+        this.model.isFile = true;
+      }
+      template = this.template();
+      $(this.el).html(template(this.model));
+      signatureModel = {
+        sampleJSON: this.model.sampleJSON,
+        isParam: true,
+        signature: this.model.signature
+      };
+      if (this.model.sampleJSON) {
+        signatureView = new SignatureView({
+          model: signatureModel,
+          tagName: 'div'
+        });
+        $('.model-signature', $(this.el)).append(signatureView.render().el);
+      } else {
+        $('.model-signature', $(this.el)).html(this.model.signature);
+      }
+      isParam = false;
+      if (this.model.isBody) {
+        isParam = true;
+      }
+      contentTypeModel = {
+        isParam: isParam
+      };
+      contentTypeModel.consumes = this.model.consumes;
+      if (isParam) {
+        parameterContentTypeView = new ParameterContentTypeView({
+          model: contentTypeModel
+        });
+        $('.parameter-content-type', $(this.el)).append(parameterContentTypeView.render().el);
+      } else {
+        responseContentTypeView = new ResponseContentTypeView({
+          model: contentTypeModel
+        });
+        $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el);
+      }
+      return this;
+    };
+
+    ParameterView.prototype.template = function() {
+      if (this.model.isList) {
+        return Handlebars.templates.param_list;
+      } else {
+        if (this.options.readOnly) {
+          if (this.model.required) {
+            return Handlebars.templates.param_readonly_required;
+          } else {
+            return Handlebars.templates.param_readonly;
+          }
+        } else {
+          if (this.model.required) {
+            return Handlebars.templates.param_required;
+          } else {
+            return Handlebars.templates.param;
+          }
+        }
+      }
+    };
+
+    return ParameterView;
+
+  })(Backbone.View);
+
+  SignatureView = (function(_super) {
+    __extends(SignatureView, _super);
+
+    function SignatureView() {
+      _ref7 = SignatureView.__super__.constructor.apply(this, arguments);
+      return _ref7;
+    }
+
+    SignatureView.prototype.events = {
+      'click a.description-link': 'switchToDescription',
+      'click a.snippet-link': 'switchToSnippet',
+      'mousedown .snippet': 'snippetToTextArea'
+    };
+
+    SignatureView.prototype.initialize = function() {};
+
+    SignatureView.prototype.render = function() {
+      var template;
+      template = this.template();
+      $(this.el).html(template(this.model));
+      this.switchToDescription();
+      this.isParam = this.model.isParam;
+      if (this.isParam) {
+        $('.notice', $(this.el)).text('Click to set as parameter value');
+      }
+      return this;
+    };
+
+    SignatureView.prototype.template = function() {
+      return Handlebars.templates.signature;
+    };
+
+    SignatureView.prototype.switchToDescription = function(e) {
+      if (e != null) {
+        e.preventDefault();
+      }
+      $(".snippet", $(this.el)).hide();
+      $(".description", $(this.el)).show();
+      $('.description-link', $(this.el)).addClass('selected');
+      return $('.snippet-link', $(this.el)).removeClass('selected');
+    };
+
+    SignatureView.prototype.switchToSnippet = function(e) {
+      if (e != null) {
+        e.preventDefault();
+      }
+      $(".description", $(this.el)).hide();
+      $(".snippet", $(this.el)).show();
+      $('.snippet-link', $(this.el)).addClass('selected');
+      return $('.description-link', $(this.el)).removeClass('selected');
+    };
+
+    SignatureView.prototype.snippetToTextArea = function(e) {
+      var textArea;
+      if (this.isParam) {
+        if (e != null) {
+          e.preventDefault();
+        }
+        textArea = $('textarea', $(this.el.parentNode.parentNode.parentNode));
+        if ($.trim(textArea.val()) === '') {
+          return textArea.val(this.model.sampleJSON);
+        }
+      }
+    };
+
+    return SignatureView;
+
+  })(Backbone.View);
+
+  ContentTypeView = (function(_super) {
+    __extends(ContentTypeView, _super);
+
+    function ContentTypeView() {
+      _ref8 = ContentTypeView.__super__.constructor.apply(this, arguments);
+      return _ref8;
+    }
+
+    ContentTypeView.prototype.initialize = function() {};
+
+    ContentTypeView.prototype.render = function() {
+      var template;
+      template = this.template();
+      $(this.el).html(template(this.model));
+      $('label[for=contentType]', $(this.el)).text('Response Content Type');
+      return this;
+    };
+
+    ContentTypeView.prototype.template = function() {
+      return Handlebars.templates.content_type;
+    };
+
+    return ContentTypeView;
+
+  })(Backbone.View);
+
+  ResponseContentTypeView = (function(_super) {
+    __extends(ResponseContentTypeView, _super);
+
+    function ResponseContentTypeView() {
+      _ref9 = ResponseContentTypeView.__super__.constructor.apply(this, arguments);
+      return _ref9;
+    }
+
+    ResponseContentTypeView.prototype.initialize = function() {};
+
+    ResponseContentTypeView.prototype.render = function() {
+      var template;
+      template = this.template();
+      $(this.el).html(template(this.model));
+      $('label[for=responseContentType]', $(this.el)).text('Response Content Type');
+      return this;
+    };
+
+    ResponseContentTypeView.prototype.template = function() {
+      return Handlebars.templates.response_content_type;
+    };
+
+    return ResponseContentTypeView;
+
+  })(Backbone.View);
+
+  ParameterContentTypeView = (function(_super) {
+    __extends(ParameterContentTypeView, _super);
+
+    function ParameterContentTypeView() {
+      _ref10 = ParameterContentTypeView.__super__.constructor.apply(this, arguments);
+      return _ref10;
+    }
+
+    ParameterContentTypeView.prototype.initialize = function() {};
+
+    ParameterContentTypeView.prototype.render = function() {
+      var template;
+      template = this.template();
+      $(this.el).html(template(this.model));
+      $('label[for=parameterContentType]', $(this.el)).text('Parameter content type:');
+      return this;
+    };
+
+    ParameterContentTypeView.prototype.template = function() {
+      return Handlebars.templates.parameter_content_type;
+    };
+
+    return ParameterContentTypeView;
+
+  })(Backbone.View);
+
+}).call(this);
diff --git a/opendaylight/md-sal/sal-rest-docgen/src/main/resources/explorer/static/swagger.js b/opendaylight/md-sal/sal-rest-docgen/src/main/resources/explorer/static/swagger.js
new file mode 100644 (file)
index 0000000..a037790
--- /dev/null
@@ -0,0 +1,1199 @@
+// Generated by CoffeeScript 1.6.3
+(function() {
+  var ApiKeyAuthorization, PasswordAuthorization, SwaggerApi, SwaggerAuthorizations, SwaggerHttp, SwaggerModel, SwaggerModelProperty, SwaggerOperation, SwaggerRequest, SwaggerResource,
+    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
+
+  SwaggerApi = (function() {
+    SwaggerApi.prototype.url = "http://api.wordnik.com/v4/resources.json";
+
+    SwaggerApi.prototype.debug = false;
+
+    SwaggerApi.prototype.basePath = null;
+
+    SwaggerApi.prototype.authorizations = null;
+
+    SwaggerApi.prototype.authorizationScheme = null;
+
+    SwaggerApi.prototype.info = null;
+
+    function SwaggerApi(url, options) {
+      if (options == null) {
+        options = {};
+      }
+      if (url) {
+        if (url.url) {
+          options = url;
+        } else {
+          this.url = url;
+        }
+      } else {
+        options = url;
+      }
+      if (options.url != null) {
+        this.url = options.url;
+      }
+      if (options.success != null) {
+        this.success = options.success;
+      }
+      this.failure = options.failure != null ? options.failure : function() {};
+      this.progress = options.progress != null ? options.progress : function() {};
+      if (options.success != null) {
+        this.build();
+      }
+    }
+
+    SwaggerApi.prototype.build = function() {
+      var e, obj,
+        _this = this;
+      this.progress('fetching resource list: ' + this.url);
+      var response;
+      response = JSON.parse(getSpec());
+
+      _this.swaggerVersion = response.swaggerVersion;
+      if (_this.swaggerVersion === "1.2") {
+        setTimeout(function(){return _this.buildFromSpec(response);}, 500);
+      } else {
+        return setTimeout(function(){return _this.buildFrom1_1Spec(response);}, 500);
+      }
+      return this;
+    };
+
+    SwaggerApi.prototype.buildFromSpec = function(response) {
+      var api, isApi, newName, operation, res, resource, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2;
+      if (response.apiVersion != null) {
+        this.apiVersion = response.apiVersion;
+      }
+      this.apis = {};
+      this.apisArray = [];
+      this.produces = response.produces;
+      this.authSchemes = response.authorizations;
+      if (response.info != null) {
+        this.info = response.info;
+      }
+      isApi = false;
+      _ref = response.apis;
+      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+        api = _ref[_i];
+        if (api.operations) {
+          _ref1 = api.operations;
+          for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
+            operation = _ref1[_j];
+            isApi = true;
+          }
+        }
+      }
+      if (response.basePath) {
+        this.basePath = response.basePath;
+      } else if (this.url.indexOf('?') > 0) {
+        this.basePath = this.url.substring(0, this.url.lastIndexOf('?'));
+      } else {
+        this.basePath = this.url;
+      }
+      if (isApi) {
+        newName = response.resourcePath.replace(/\//g, '');
+        this.resourcePath = response.resourcePath;
+        res = new SwaggerResource(response, this);
+        this.apis[newName] = res;
+        this.apisArray.push(res);
+      } else {
+        _ref2 = response.apis;
+        for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
+          resource = _ref2[_k];
+          res = new SwaggerResource(resource, this);
+          this.apis[res.name] = res;
+          this.apisArray.push(res);
+        }
+      }
+      if (this.success) {
+        this.success();
+      }
+      return this;
+    };
+
+    SwaggerApi.prototype.buildFrom1_1Spec = function(response) {
+      var api, isApi, newName, operation, res, resource, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2;
+      console.log("This API is using a deprecated version of Swagger!  Please see http://github.com/wordnik/swagger-core/wiki for more info");
+      if (response.apiVersion != null) {
+        this.apiVersion = response.apiVersion;
+      }
+      this.apis = {};
+      this.apisArray = [];
+      this.produces = response.produces;
+      if (response.info != null) {
+        this.info = response.info;
+      }
+      isApi = false;
+      _ref = response.apis;
+      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+        api = _ref[_i];
+        if (api.operations) {
+          _ref1 = api.operations;
+          for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
+            operation = _ref1[_j];
+            isApi = true;
+          }
+        }
+      }
+      if (response.basePath) {
+        this.basePath = response.basePath;
+      } else if (this.url.indexOf('?') > 0) {
+        this.basePath = this.url.substring(0, this.url.lastIndexOf('?'));
+      } else {
+        this.basePath = this.url;
+      }
+      if (isApi) {
+        newName = response.resourcePath.replace(/\//g, '');
+        this.resourcePath = response.resourcePath;
+        res = new SwaggerResource(response, this);
+        this.apis[newName] = res;
+        this.apisArray.push(res);
+      } else {
+        _ref2 = response.apis;
+        for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
+          resource = _ref2[_k];
+          res = new SwaggerResource(resource, this);
+          this.apis[res.name] = res;
+          this.apisArray.push(res);
+        }
+      }
+      if (this.success) {
+        this.success();
+      }
+      return this;
+    };
+
+    SwaggerApi.prototype.selfReflect = function() {
+      var resource, resource_name, _ref;
+      if (this.apis == null) {
+        return false;
+      }
+      _ref = this.apis;
+      for (resource_name in _ref) {
+        resource = _ref[resource_name];
+        if (resource.ready == null) {
+          return false;
+        }
+      }
+      this.setConsolidatedModels();
+      this.ready = true;
+      if (this.success != null) {
+        return this.success();
+      }
+    };
+
+    SwaggerApi.prototype.fail = function(message) {
+      this.failure(message);
+      throw message;
+    };
+
+    SwaggerApi.prototype.setConsolidatedModels = function() {
+      var model, modelName, resource, resource_name, _i, _len, _ref, _ref1, _results;
+      this.modelsArray = [];
+      this.models = {};
+      _ref = this.apis;
+      for (resource_name in _ref) {
+        resource = _ref[resource_name];
+        for (modelName in resource.models) {
+          if (this.models[modelName] == null) {
+            this.models[modelName] = resource.models[modelName];
+            this.modelsArray.push(resource.models[modelName]);
+          }
+        }
+      }
+      _ref1 = this.modelsArray;
+      _results = [];
+      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+        model = _ref1[_i];
+        _results.push(model.setReferencedModels(this.models));
+      }
+      return _results;
+    };
+
+    SwaggerApi.prototype.help = function() {
+      var operation, operation_name, parameter, resource, resource_name, _i, _len, _ref, _ref1, _ref2;
+      _ref = this.apis;
+      for (resource_name in _ref) {
+        resource = _ref[resource_name];
+        console.log(resource_name);
+        _ref1 = resource.operations;
+        for (operation_name in _ref1) {
+          operation = _ref1[operation_name];
+          console.log("  " + operation.nickname);
+          _ref2 = operation.parameters;
+          for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+            parameter = _ref2[_i];
+            console.log("    " + parameter.name + (parameter.required ? ' (required)' : '') + " - " + parameter.description);
+          }
+        }
+      }
+      return this;
+    };
+
+    return SwaggerApi;
+
+  })();
+
+  SwaggerResource = (function() {
+    SwaggerResource.prototype.api = null;
+
+    SwaggerResource.prototype.produces = null;
+
+    SwaggerResource.prototype.consumes = null;
+
+    function SwaggerResource(resourceObj, api) {
+      var consumes, e, obj, parts, produces,
+        _this = this;
+      this.api = api;
+      this.api = this.api;
+      produces = [];
+      consumes = [];
+      this.path = this.api.resourcePath != null ? this.api.resourcePath : resourceObj.path;
+      this.description = resourceObj.description;
+      parts = this.path.split("/");
+      this.name = parts[parts.length - 1].replace('.{format}', '');
+      this.basePath = this.api.basePath;
+      this.operations = {};
+      this.operationsArray = [];
+      this.modelsArray = [];
+      this.models = {};
+      if ((resourceObj.apis != null) && (this.api.resourcePath != null)) {
+        this.addApiDeclaration(resourceObj);
+      } else {
+        if (this.path == null) {
+          this.api.fail("SwaggerResources must have a path.");
+        }
+        if (this.path.substring(0, 4) === 'http') {
+          this.url = this.path.replace('{format}', 'json');
+        } else {
+          this.url = this.api.basePath + this.path.replace('{format}', 'json');
+        }
+        this.api.progress('fetching resource ' + this.name + ': ' + this.url);
+        var response;
+        var split = resourceObj.path.split("/");
+        var resource = split[split.length-1];
+        response = JSON.parse(jsonFor(resource));
+        setTimeout(function(){return _this.addApiDeclaration(response);}, 500);
+      }
+    }
+
+    SwaggerResource.prototype.addApiDeclaration = function(response) {
+      var endpoint, _i, _len, _ref;
+      if (response.produces != null) {
+        this.produces = response.produces;
+      }
+      if (response.consumes != null) {
+        this.consumes = response.consumes;
+      }
+      if ((response.basePath != null) && response.basePath.replace(/\s/g, '').length > 0) {
+        this.basePath = response.basePath;
+      }
+      this.addModels(response.models);
+      if (response.apis) {
+        _ref = response.apis;
+        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+          endpoint = _ref[_i];
+          this.addOperations(endpoint.path, endpoint.operations, response.consumes, response.produces);
+        }
+      }
+      this.api[this.name] = this;
+      this.ready = true;
+      return this.api.selfReflect();
+    };
+
+    SwaggerResource.prototype.addModels = function(models) {
+      var model, modelName, swaggerModel, _i, _len, _ref, _results;
+      if (models != null) {
+        for (modelName in models) {
+          if (this.models[modelName] == null) {
+            swaggerModel = new SwaggerModel(modelName, models[modelName]);
+            this.modelsArray.push(swaggerModel);
+            this.models[modelName] = swaggerModel;
+          }
+        }
+        _ref = this.modelsArray;
+        _results = [];
+        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+          model = _ref[_i];
+          _results.push(model.setReferencedModels(this.models));
+        }
+        return _results;
+      }
+    };
+
+    SwaggerResource.prototype.addOperations = function(resource_path, ops, consumes, produces) {
+      var method, o, op, r, ref, responseMessages, type, _i, _j, _len, _len1, _results;
+      if (ops) {
+        _results = [];
+        for (_i = 0, _len = ops.length; _i < _len; _i++) {
+          o = ops[_i];
+          consumes = this.consumes;
+          produces = this.produces;
+          if (o.consumes != null) {
+            consumes = o.consumes;
+          } else {
+            consumes = this.consumes;
+          }
+          if (o.produces != null) {
+            produces = o.produces;
+          } else {
+            produces = this.produces;
+          }
+          type = o.type || o.responseClass;
+          if (type === "array") {
+            ref = null;
+            if (o.items) {
+              ref = o.items["type"] || o.items["$ref"];
+            }
+            type = "array[" + ref + "]";
+          }
+          responseMessages = o.responseMessages;
+          method = o.method;
+          if (o.httpMethod) {
+            method = o.httpMethod;
+          }
+          if (o.supportedContentTypes) {
+            consumes = o.supportedContentTypes;
+          }
+          if (o.errorResponses) {
+            responseMessages = o.errorResponses;
+            for (_j = 0, _len1 = responseMessages.length; _j < _len1; _j++) {
+              r = responseMessages[_j];
+              r.message = r.reason;
+              r.reason = null;
+            }
+          }
+          o.nickname = this.sanitize(o.nickname);
+          op = new SwaggerOperation(o.nickname, resource_path, method, o.parameters, o.summary, o.notes, type, responseMessages, this, consumes, produces);
+          this.operations[op.nickname] = op;
+          _results.push(this.operationsArray.push(op));
+        }
+        return _results;
+      }
+    };
+
+    SwaggerResource.prototype.sanitize = function(nickname) {
+      var op;
+      op = nickname.replace(/[\s!@#$%^&*()_+=\[{\]};:<>|./?,\\'""-]/g, '_');
+      op = op.replace(/((_){2,})/g, '_');
+      op = op.replace(/^(_)*/g, '');
+      op = op.replace(/([_])*$/g, '');
+      return op;
+    };
+
+    SwaggerResource.prototype.help = function() {
+      var msg, operation, operation_name, parameter, _i, _len, _ref, _ref1, _results;
+      _ref = this.operations;
+      _results = [];
+      for (operation_name in _ref) {
+        operation = _ref[operation_name];
+        msg = "  " + operation.nickname;
+        _ref1 = operation.parameters;
+        for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+          parameter = _ref1[_i];
+          msg.concat("    " + parameter.name + (parameter.required ? ' (required)' : '') + " - " + parameter.description);
+        }
+        _results.push(msg);
+      }
+      return _results;
+    };
+
+    return SwaggerResource;
+
+  })();
+
+  SwaggerModel = (function() {
+    function SwaggerModel(modelName, obj) {
+      var prop, propertyName, value;
+      this.name = obj.id != null ? obj.id : modelName;
+      this.properties = [];
+      for (propertyName in obj.properties) {
+        if (obj.required != null) {
+          for (value in obj.required) {
+            if (propertyName === obj.required[value]) {
+              obj.properties[propertyName].required = true;
+            }
+          }
+        }
+        prop = new SwaggerModelProperty(propertyName, obj.properties[propertyName]);
+        this.properties.push(prop);
+      }
+    }
+
+    SwaggerModel.prototype.setReferencedModels = function(allModels) {
+      var prop, type, _i, _len, _ref, _results;
+      _ref = this.properties;
+      _results = [];
+      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+        prop = _ref[_i];
+        type = prop.type || prop.dataType;
+        if (allModels[type] != null) {
+          _results.push(prop.refModel = allModels[type]);
+        } else if ((prop.refDataType != null) && (allModels[prop.refDataType] != null)) {
+          _results.push(prop.refModel = allModels[prop.refDataType]);
+        } else {
+          _results.push(void 0);
+        }
+      }
+      return _results;
+    };
+
+    SwaggerModel.prototype.getMockSignature = function(modelsToIgnore) {
+      var classClose, classOpen, prop, propertiesStr, returnVal, strong, strongClose, stronger, _i, _j, _len, _len1, _ref, _ref1;
+      propertiesStr = [];
+      _ref = this.properties;
+      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+        prop = _ref[_i];
+        propertiesStr.push(prop.toString());
+      }
+      strong = '<span class="strong">';
+      stronger = '<span class="stronger">';
+      strongClose = '</span>';
+      classOpen = strong + this.name + ' {' + strongClose;
+      classClose = strong + '}' + strongClose;
+      returnVal = classOpen + '<div>' + propertiesStr.join(',</div><div>') + '</div>' + classClose;
+      if (!modelsToIgnore) {
+        modelsToIgnore = [];
+      }
+      modelsToIgnore.push(this);
+      _ref1 = this.properties;
+      for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
+        prop = _ref1[_j];
+        if ((prop.refModel != null) && (modelsToIgnore.indexOf(prop.refModel)) === -1) {
+          returnVal = returnVal + ('<br>' + prop.refModel.getMockSignature(modelsToIgnore));
+        }
+      }
+      return returnVal;
+    };
+
+    SwaggerModel.prototype.createJSONSample = function(modelsToIgnore) {
+      var prop, result, _i, _len, _ref;
+      result = {};
+      modelsToIgnore = modelsToIgnore || [];
+      modelsToIgnore.push(this.name);
+      _ref = this.properties;
+      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+        prop = _ref[_i];
+        result[prop.name] = prop.getSampleValue(modelsToIgnore);
+      }
+      modelsToIgnore.pop(this.name);
+      return result;
+    };
+
+    return SwaggerModel;
+
+  })();
+
+  SwaggerModelProperty = (function() {
+    function SwaggerModelProperty(name, obj) {
+      this.name = name;
+      this.dataType = obj.type || obj.dataType || obj["$ref"];
+      this.isCollection = this.dataType && (this.dataType.toLowerCase() === 'array' || this.dataType.toLowerCase() === 'list' || this.dataType.toLowerCase() === 'set');
+      this.descr = obj.description;
+      this.required = obj.required;
+      if (obj.items != null) {
+        if (obj.items.type != null) {
+          this.refDataType = obj.items.type;
+        }
+        if (obj.items.$ref != null) {
+          this.refDataType = obj.items.$ref;
+        }
+      }
+      this.dataTypeWithRef = this.refDataType != null ? this.dataType + '[' + this.refDataType + ']' : this.dataType;
+      if (obj.allowableValues != null) {
+        this.valueType = obj.allowableValues.valueType;
+        this.values = obj.allowableValues.values;
+        if (this.values != null) {
+          this.valuesString = "'" + this.values.join("' or '") + "'";
+        }
+      }
+      if (obj["enum"] != null) {
+        this.valueType = "string";
+        this.values = obj["enum"];
+        if (this.values != null) {
+          this.valueString = "'" + this.values.join("' or '") + "'";
+        }
+      }
+    }
+
+    SwaggerModelProperty.prototype.getSampleValue = function(modelsToIgnore) {
+      var result;
+      if ((this.refModel != null) && (modelsToIgnore.indexOf(this.refModel.name) === -1)) {
+        result = this.refModel.createJSONSample(modelsToIgnore);
+      } else {
+        if (this.isCollection) {
+          result = this.refDataType;
+        } else {
+          result = this.dataType;
+        }
+      }
+      if (this.isCollection) {
+        return [result];
+      } else {
+        return result;
+      }
+    };
+
+    SwaggerModelProperty.prototype.toString = function() {
+      var req, str;
+      req = this.required ? 'propReq' : 'propOpt';
+      str = '<span class="propName ' + req + '">' + this.name + '</span> (<span class="propType">' + this.dataTypeWithRef + '</span>';
+      if (!this.required) {
+        str += ', <span class="propOptKey">optional</span>';
+      }
+      str += ')';
+      if (this.values != null) {
+        str += " = <span class='propVals'>['" + this.values.join("' or '") + "']</span>";
+      }
+      if (this.descr != null) {
+        str += ': <span class="propDesc">' + this.descr + '</span>';
+      }
+      return str;
+    };
+
+    return SwaggerModelProperty;
+
+  })();
+
+  SwaggerOperation = (function() {
+    function SwaggerOperation(nickname, path, method, parameters, summary, notes, type, responseMessages, resource, consumes, produces) {
+      var parameter, v, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3,
+        _this = this;
+      this.nickname = nickname;
+      this.path = path;
+      this.method = method;
+      this.parameters = parameters != null ? parameters : [];
+      this.summary = summary;
+      this.notes = notes;
+      this.type = type;
+      this.responseMessages = responseMessages;
+      this.resource = resource;
+      this.consumes = consumes;
+      this.produces = produces;
+      this["do"] = __bind(this["do"], this);
+      if (this.nickname == null) {
+        this.resource.api.fail("SwaggerOperations must have a nickname.");
+      }
+      if (this.path == null) {
+        this.resource.api.fail("SwaggerOperation " + nickname + " is missing path.");
+      }
+      if (this.method == null) {
+        this.resource.api.fail("SwaggerOperation " + nickname + " is missing method.");
+      }
+      this.path = this.path.replace('{format}', 'json');
+      this.method = this.method.toLowerCase();
+      this.isGetMethod = this.method === "get";
+      this.resourceName = this.resource.name;
+      if (((_ref = this.type) != null ? _ref.toLowerCase() : void 0) === 'void') {
+        this.type = void 0;
+      }
+      if (this.type != null) {
+        this.responseClassSignature = this.getSignature(this.type, this.resource.models);
+        this.responseSampleJSON = this.getSampleJSON(this.type, this.resource.models);
+      }
+      this.responseMessages = this.responseMessages || [];
+      _ref1 = this.parameters;
+      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+        parameter = _ref1[_i];
+        parameter.name = parameter.name || parameter.type || parameter.dataType;
+        type = parameter.type || parameter.dataType;
+        if (type.toLowerCase() === 'boolean') {
+          parameter.allowableValues = {};
+          parameter.allowableValues.values = ["true", "false"];
+        }
+        parameter.signature = this.getSignature(type, this.resource.models);
+        parameter.sampleJSON = this.getSampleJSON(type, this.resource.models);
+        if (parameter["enum"] != null) {
+          parameter.isList = true;
+          parameter.allowableValues = {};
+          parameter.allowableValues.descriptiveValues = [];
+          _ref2 = parameter["enum"];
+          for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
+            v = _ref2[_j];
+            if ((parameter.defaultValue != null) && parameter.defaultValue === v) {
+              parameter.allowableValues.descriptiveValues.push({
+                value: v,
+                isDefault: true
+              });
+            } else {
+              parameter.allowableValues.descriptiveValues.push({
+                value: v,
+                isDefault: false
+              });
+            }
+          }
+        }
+        if (parameter.allowableValues != null) {
+          if (parameter.allowableValues.valueType === "RANGE") {
+            parameter.isRange = true;
+          } else {
+            parameter.isList = true;
+          }
+          if (parameter.allowableValues.values != null) {
+            parameter.allowableValues.descriptiveValues = [];
+            _ref3 = parameter.allowableValues.values;
+            for (_k = 0, _len2 = _ref3.length; _k < _len2; _k++) {
+              v = _ref3[_k];
+              if ((parameter.defaultValue != null) && parameter.defaultValue === v) {
+                parameter.allowableValues.descriptiveValues.push({
+                  value: v,
+                  isDefault: true
+                });
+              } else {
+                parameter.allowableValues.descriptiveValues.push({
+                  value: v,
+                  isDefault: false
+                });
+              }
+            }
+          }
+        }
+      }
+      this.resource[this.nickname] = function(args, callback, error) {
+        return _this["do"](args, callback, error);
+      };
+      this.resource[this.nickname].help = function() {
+        return _this.help();
+      };
+    }
+
+    SwaggerOperation.prototype.isListType = function(type) {
+      if (type.indexOf('[') >= 0) {
+        return type.substring(type.indexOf('[') + 1, type.indexOf(']'));
+      } else {
+        return void 0;
+      }
+    };
+
+    SwaggerOperation.prototype.getSignature = function(type, models) {
+      var isPrimitive, listType;
+      listType = this.isListType(type);
+      isPrimitive = ((listType != null) && models[listType]) || (models[type] != null) ? false : true;
+      if (isPrimitive) {
+        return type;
+      } else {
+        if (listType != null) {
+          return models[listType].getMockSignature();
+        } else {
+          return models[type].getMockSignature();
+        }
+      }
+    };
+
+    SwaggerOperation.prototype.getSampleJSON = function(type, models) {
+      var isPrimitive, listType, val;
+      listType = this.isListType(type);
+      isPrimitive = ((listType != null) && models[listType]) || (models[type] != null) ? false : true;
+      val = isPrimitive ? void 0 : (listType != null ? models[listType].createJSONSample() : models[type].createJSONSample());
+      if (val) {
+        val = listType ? [val] : val;
+        return JSON.stringify(val, null, 2);
+      }
+    };
+
+    SwaggerOperation.prototype["do"] = function(args, opts, callback, error) {
+      var key, param, params, possibleParams, req, requestContentType, responseContentType, value, _i, _len, _ref;
+      if (args == null) {
+        args = {};
+      }
+      if (opts == null) {
+        opts = {};
+      }
+      requestContentType = null;
+      responseContentType = null;
+      if ((typeof args) === "function") {
+        error = opts;
+        callback = args;
+        args = {};
+      }
+      if ((typeof opts) === "function") {
+        error = callback;
+        callback = opts;
+      }
+      if (error == null) {
+        error = function(xhr, textStatus, error) {
+          return console.log(xhr, textStatus, error);
+        };
+      }
+      if (callback == null) {
+        callback = function(data) {
+          var content;
+          content = null;
+          if (data.content != null) {
+            content = data.content.data;
+          } else {
+            content = "no data";
+          }
+          return console.log("default callback: " + content);
+        };
+      }
+      params = {};
+      params.headers = [];
+      if (args.headers != null) {
+        params.headers = args.headers;
+        delete args.headers;
+      }
+      _ref = this.parameters;
+      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+        param = _ref[_i];
+        if (param.paramType === "header") {
+          if (args[param.name]) {
+            params.headers[param.name] = args[param.name];
+          }
+        }
+      }
+      if (args.body != null) {
+        params.body = args.body;
+        delete args.body;
+      }
+      possibleParams = (function() {
+        var _j, _len1, _ref1, _results;
+        _ref1 = this.parameters;
+        _results = [];
+        for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
+          param = _ref1[_j];
+          if (param.paramType === "form" || param.paramType.toLowerCase() === "file") {
+            _results.push(param);
+          }
+        }
+        return _results;
+      }).call(this);
+      if (possibleParams) {
+        for (key in possibleParams) {
+          value = possibleParams[key];
+          if (args[value.name]) {
+            params[value.name] = args[value.name];
+          }
+        }
+      }
+      req = new SwaggerRequest(this.method, this.urlify(args), params, opts, callback, error, this);
+      if (opts.mock != null) {
+        return req;
+      } else {
+        return true;
+      }
+    };
+
+    SwaggerOperation.prototype.pathJson = function() {
+      return this.path.replace("{format}", "json");
+    };
+
+    SwaggerOperation.prototype.pathXml = function() {
+      return this.path.replace("{format}", "xml");
+    };
+
+    SwaggerOperation.prototype.urlify = function(args) {
+      var param, queryParams, reg, url, _i, _j, _len, _len1, _ref, _ref1;
+      url = this.resource.basePath + this.pathJson();
+      _ref = this.parameters;
+      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+        param = _ref[_i];
+        if (param.paramType === 'path') {
+          if (args[param.name]) {
+            reg = new RegExp('\{' + param.name + '[^\}]*\}', 'gi');
+            url = url.replace(reg, encodeURIComponent(args[param.name]));
+            delete args[param.name];
+          } else {
+            throw "" + param.name + " is a required path param.";
+          }
+        }
+      }
+      queryParams = "";
+      _ref1 = this.parameters;
+      for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
+        param = _ref1[_j];
+        if (param.paramType === 'query') {
+          if (args[param.name]) {
+            if (queryParams !== "") {
+              queryParams += "&";
+            }
+            queryParams += encodeURIComponent(param.name) + '=' + encodeURIComponent(args[param.name]);
+          }
+        }
+      }
+      if ((queryParams != null) && queryParams.length > 0) {
+        url += "?" + queryParams;
+      }
+      return url;
+    };
+
+    SwaggerOperation.prototype.supportHeaderParams = function() {
+      return this.resource.api.supportHeaderParams;
+    };
+
+    SwaggerOperation.prototype.supportedSubmitMethods = function() {
+      return this.resource.api.supportedSubmitMethods;
+    };
+
+    SwaggerOperation.prototype.getQueryParams = function(args) {
+      return this.getMatchingParams(['query'], args);
+    };
+
+    SwaggerOperation.prototype.getHeaderParams = function(args) {
+      return this.getMatchingParams(['header'], args);
+    };
+
+    SwaggerOperation.prototype.getMatchingParams = function(paramTypes, args) {
+      var matchingParams, name, param, value, _i, _len, _ref, _ref1;
+      matchingParams = {};
+      _ref = this.parameters;
+      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+        param = _ref[_i];
+        if (args && args[param.name]) {
+          matchingParams[param.name] = args[param.name];
+        }
+      }
+      _ref1 = this.resource.api.headers;
+      for (name in _ref1) {
+        value = _ref1[name];
+        matchingParams[name] = value;
+      }
+      return matchingParams;
+    };
+
+    SwaggerOperation.prototype.help = function() {
+      var msg, parameter, _i, _len, _ref;
+      msg = "";
+      _ref = this.parameters;
+      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+        parameter = _ref[_i];
+        if (msg !== "") {
+          msg += "\n";
+        }
+        msg += "* " + parameter.name + (parameter.required ? ' (required)' : '') + " - " + parameter.description;
+      }
+      return msg;
+    };
+
+    return SwaggerOperation;
+
+  })();
+
+  SwaggerRequest = (function() {
+    function SwaggerRequest(type, url, params, opts, successCallback, errorCallback, operation, execution) {
+      var body, e, fields, headers, key, myHeaders, name, obj, param, parent, possibleParams, requestContentType, responseContentType, urlEncoded, value, values,
+        _this = this;
+      this.type = type;
+      this.url = url;
+      this.params = params;
+      this.opts = opts;
+      this.successCallback = successCallback;
+      this.errorCallback = errorCallback;
+      this.operation = operation;
+      this.execution = execution;
+      if (this.type == null) {
+        throw "SwaggerRequest type is required (get/post/put/delete).";
+      }
+      if (this.url == null) {
+        throw "SwaggerRequest url is required.";
+      }
+      if (this.successCallback == null) {
+        throw "SwaggerRequest successCallback is required.";
+      }
+      if (this.errorCallback == null) {
+        throw "SwaggerRequest error callback is required.";
+      }
+      if (this.operation == null) {
+        throw "SwaggerRequest operation is required.";
+      }
+      this.type = this.type.toUpperCase();
+      headers = params.headers;
+      myHeaders = {};
+      body = params.body;
+      parent = params["parent"];
+      requestContentType = "application/json";
+      if (body && (this.type === "POST" || this.type === "PUT" || this.type === "PATCH")) {
+        if (this.opts.requestContentType) {
+          requestContentType = this.opts.requestContentType;
+        }
+      } else {
+        if (((function() {
+          var _i, _len, _ref, _results;
+          _ref = this.operation.parameters;
+          _results = [];
+          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+            param = _ref[_i];
+            if (param.paramType === "form") {
+              _results.push(param);
+            }
+          }
+          return _results;
+        }).call(this)).length > 0) {
+          type = param.type || param.dataType;
+          if (((function() {
+            var _i, _len, _ref, _results;
+            _ref = this.operation.parameters;
+            _results = [];
+            for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+              param = _ref[_i];
+              if (type.toLowerCase() === "file") {
+                _results.push(param);
+              }
+            }
+            return _results;
+          }).call(this)).length > 0) {
+            requestContentType = "multipart/form-data";
+          } else {
+            requestContentType = "application/x-www-form-urlencoded";
+          }
+        } else if (this.type !== "DELETE") {
+          requestContentType = null;
+        }
+      }
+      if (requestContentType && this.operation.consumes) {
+        if (this.operation.consumes.indexOf(requestContentType) === -1) {
+          console.log("server doesn't consume " + requestContentType + ", try " + JSON.stringify(this.operation.consumes));
+          if (this.requestContentType === null) {
+            requestContentType = this.operation.consumes[0];
+          }
+        }
+      }
+      responseContentType = null;
+      if (this.type === "POST" || this.type === "GET" || this.type === "PATCH") {
+        if (this.opts.responseContentType) {
+          responseContentType = this.opts.responseContentType;
+        } else {
+          responseContentType = "application/json";
+        }
+      } else {
+        responseContentType = null;
+      }
+      if (responseContentType && this.operation.produces) {
+        if (this.operation.produces.indexOf(responseContentType) === -1) {
+          console.log("server can't produce " + responseContentType);
+        }
+      }
+      if (requestContentType && requestContentType.indexOf("application/x-www-form-urlencoded") === 0) {
+        fields = {};
+        possibleParams = (function() {
+          var _i, _len, _ref, _results;
+          _ref = this.operation.parameters;
+          _results = [];
+          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+            param = _ref[_i];
+            if (param.paramType === "form") {
+              _results.push(param);
+            }
+          }
+          return _results;
+        }).call(this);
+        values = {};
+        for (key in possibleParams) {
+          value = possibleParams[key];
+          if (this.params[value.name]) {
+            values[value.name] = this.params[value.name];
+          }
+        }
+        urlEncoded = "";
+        for (key in values) {
+          value = values[key];
+          if (urlEncoded !== "") {
+            urlEncoded += "&";
+          }
+          urlEncoded += encodeURIComponent(key) + '=' + encodeURIComponent(value);
+        }
+        body = urlEncoded;
+      }
+      for (name in headers) {
+        myHeaders[name] = headers[name];
+      }
+      if (requestContentType) {
+        myHeaders["Content-Type"] = requestContentType;
+      }
+      if (responseContentType) {
+        myHeaders["Accept"] = responseContentType;
+      }
+      if (!((headers != null) && (headers.mock != null))) {
+        obj = {
+          url: this.url,
+          method: this.type,
+          headers: myHeaders,
+          body: body,
+          on: {
+            error: function(response) {
+              return _this.errorCallback(response, _this.opts.parent);
+            },
+            redirect: function(response) {
+              return _this.successCallback(response, _this.opts.parent);
+            },
+            307: function(response) {
+              return _this.successCallback(response, _this.opts.parent);
+            },
+            response: function(response) {
+              return _this.successCallback(response, _this.opts.parent);
+            }
+          }
+        };
+        e = {};
+        if (typeof window !== 'undefined') {
+          e = window;
+        } else {
+          e = exports;
+        }
+        e.authorizations.apply(obj);
+        if (opts.mock == null) {
+          new SwaggerHttp().execute(obj);
+        } else {
+          console.log(obj);
+          return obj;
+        }
+      }
+    }
+
+    SwaggerRequest.prototype.asCurl = function() {
+      var header_args, k, v;
+      header_args = (function() {
+        var _ref, _results;
+        _ref = this.headers;
+        _results = [];
+        for (k in _ref) {
+          v = _ref[k];
+          _results.push("--header \"" + k + ": " + v + "\"");
+        }
+        return _results;
+      }).call(this);
+      return "curl " + (header_args.join(" ")) + " " + this.url;
+    };
+
+    return SwaggerRequest;
+
+  })();
+
+  SwaggerHttp = (function() {
+    SwaggerHttp.prototype.Shred = null;
+
+    SwaggerHttp.prototype.shred = null;
+
+    SwaggerHttp.prototype.content = null;
+
+    function SwaggerHttp() {
+      var identity, toString,
+        _this = this;
+      if (typeof window !== 'undefined') {
+        this.Shred = require("./shred");
+      } else {
+        this.Shred = require("shred");
+      }
+      this.shred = new this.Shred();
+      identity = function(x) {
+        return x;
+      };
+      toString = function(x) {
+        return x.toString();
+      };
+      if (typeof window !== 'undefined') {
+        this.content = require("./shred/content");
+        this.content.registerProcessor(["application/json; charset=utf-8", "application/json", "json"], {
+          parser: identity,
+          stringify: toString
+        });
+      } else {
+        this.Shred.registerProcessor(["application/json; charset=utf-8", "application/json", "json"], {
+          parser: identity,
+          stringify: toString
+        });
+      }
+    }
+
+    SwaggerHttp.prototype.execute = function(obj) {
+      return this.shred.request(obj);
+    };
+
+    return SwaggerHttp;
+
+  })();
+
+  SwaggerAuthorizations = (function() {
+    SwaggerAuthorizations.prototype.authz = null;
+
+    function SwaggerAuthorizations() {
+      this.authz = {};
+    }
+
+    SwaggerAuthorizations.prototype.add = function(name, auth) {
+      this.authz[name] = auth;
+      return auth;
+    };
+
+    SwaggerAuthorizations.prototype.apply = function(obj) {
+      var key, value, _ref, _results;
+      _ref = this.authz;
+      _results = [];
+      for (key in _ref) {
+        value = _ref[key];
+        _results.push(value.apply(obj));
+      }
+      return _results;
+    };
+
+    return SwaggerAuthorizations;
+
+  })();
+
+  ApiKeyAuthorization = (function() {
+    ApiKeyAuthorization.prototype.type = null;
+
+    ApiKeyAuthorization.prototype.name = null;
+
+    ApiKeyAuthorization.prototype.value = null;
+
+    function ApiKeyAuthorization(name, value, type) {
+      this.name = name;
+      this.value = value;
+      this.type = type;
+    }
+
+    ApiKeyAuthorization.prototype.apply = function(obj) {
+      if (this.type === "query") {
+        if (obj.url.indexOf('?') > 0) {
+          obj.url = obj.url + "&" + this.name + "=" + this.value;
+        } else {
+          obj.url = obj.url + "?" + this.name + "=" + this.value;
+        }
+        return true;
+      } else if (this.type === "header") {
+        return obj.headers[this.name] = this.value;
+      }
+    };
+
+    return ApiKeyAuthorization;
+
+  })();
+
+  PasswordAuthorization = (function() {
+    PasswordAuthorization.prototype.name = null;
+
+    PasswordAuthorization.prototype.username = null;
+
+    PasswordAuthorization.prototype.password = null;
+
+    function PasswordAuthorization(name, username, password) {
+      this.name = name;
+      this.username = username;
+      this.password = password;
+    }
+
+    PasswordAuthorization.prototype.apply = function(obj) {
+      return obj.headers["Authorization"] = "Basic " + btoa(this.username + ":" + this.password);
+    };
+
+    return PasswordAuthorization;
+
+  })();
+
+  this.SwaggerApi = SwaggerApi;
+
+  this.SwaggerResource = SwaggerResource;
+
+  this.SwaggerOperation = SwaggerOperation;
+
+  this.SwaggerRequest = SwaggerRequest;
+
+  this.SwaggerModelProperty = SwaggerModelProperty;
+
+  this.ApiKeyAuthorization = ApiKeyAuthorization;
+
+  this.PasswordAuthorization = PasswordAuthorization;
+
+  this.authorizations = new SwaggerAuthorizations();
+
+}).call(this);
index 4cce64dcd329a9404d9273a24d45dd253db08dad..cf61887d49ebefc9b7467e7b01e0ca3288a55635 100644 (file)
                             <name>binding-async-data-broker</name>
                             <binding-forwarded-data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
                                 <dom-async-broker>
-                                    <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-broker-osgi-registry</type>
-                                    <name>dom-broker</name>
+                            <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-async-data-broker</type>
+                            <name>inmemory-data-broker</name>
                                 </dom-async-broker>
+                        <schema-service>
+                            <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>
+                            <name>yang-schema-service</name>
+                        </schema-service>
                                 <binding-mapping-service>
                                     <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-dom-mapping-service</type>
                                     <name>runtime-mapping-singleton</name>
index 36ab41fa6809b0c04e85e5e2db1ad3e0b445735b..30704997f3de32ef759f55d147598e2a23e15824 100644 (file)
@@ -56,15 +56,13 @@ public class DataBrokerTestCustomizer {
     }
 
     public DOMStore createConfigurationDatastore() {
-        InMemoryDOMDataStore store = new InMemoryDOMDataStore("CFG",
-                MoreExecutors.sameThreadExecutor(), MoreExecutors.sameThreadExecutor());
+        InMemoryDOMDataStore store = new InMemoryDOMDataStore("CFG", MoreExecutors.sameThreadExecutor());
         schemaService.registerSchemaContextListener(store);
         return store;
     }
 
     public DOMStore createOperationalDatastore() {
-        InMemoryDOMDataStore store = new InMemoryDOMDataStore("OPER",
-                MoreExecutors.sameThreadExecutor(), MoreExecutors.sameThreadExecutor());
+        InMemoryDOMDataStore store = new InMemoryDOMDataStore("OPER", MoreExecutors.sameThreadExecutor());
         schemaService.registerSchemaContextListener(store);
         return store;
     }
index b4876a3ee0883f1ac7dcc405fd6439e56e2a7f10..f6f594b34f5db5e392553cdf72b690d29743592a 100644 (file)
@@ -8,14 +8,13 @@
 package test.mock.util;
 
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.controller.sal.dom.broker.impl.SchemaContextProvider;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.util.ListenerRegistry;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 
-@SuppressWarnings("deprecation")
 public final class MockSchemaService implements SchemaService, SchemaContextProvider {
 
     private SchemaContext schemaContext;
index c3357b7c6c7f2c61d331add3a14dde66aa6005a2..e1d643cd5b2f9230a3b8ea23f0b45e6a23718c21 100644 (file)
@@ -380,7 +380,6 @@ public class FlowCapableTopologyExporterTest {
         assertEquals("getInventoryNodeRef", new NodeRef(invNodeID), augmentation.getInventoryNodeRef());
     }
 
-    @SuppressWarnings("rawtypes")
     @Test
     public void testOnNodeConnectorUpdated() {
 
index bdebfa28cc36bf6d95c4f40b1e10512444cc6b5d..5d584f3b987f90ca65920a9befcb945616b1b8c7 100644 (file)
@@ -8,24 +8,22 @@
 
 package org.opendaylight.controller.netconf.client;
 
+import io.netty.channel.EventLoopGroup;
+import io.netty.channel.socket.SocketChannel;
+import io.netty.util.Timer;
+import io.netty.util.concurrent.Future;
+import io.netty.util.concurrent.Promise;
 import java.io.Closeable;
-
 import org.opendaylight.controller.netconf.client.conf.NetconfClientConfiguration;
 import org.opendaylight.controller.netconf.client.conf.NetconfReconnectingClientConfiguration;
 import org.opendaylight.protocol.framework.AbstractDispatcher;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import io.netty.channel.EventLoopGroup;
-import io.netty.channel.socket.SocketChannel;
-import io.netty.util.Timer;
-import io.netty.util.concurrent.Future;
-import io.netty.util.concurrent.Promise;
-
 public class NetconfClientDispatcherImpl extends AbstractDispatcher<NetconfClientSession, NetconfClientSessionListener>
         implements NetconfClientDispatcher, Closeable {
 
-    private static final Logger logger = LoggerFactory.getLogger(NetconfClientDispatcherImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfClientDispatcherImpl.class);
 
     private final Timer timer;
 
@@ -48,14 +46,17 @@ public class NetconfClientDispatcherImpl extends AbstractDispatcher<NetconfClien
     @Override
     public Future<Void> createReconnectingClient(final NetconfReconnectingClientConfiguration clientConfiguration) {
         switch (clientConfiguration.getProtocol()) {
-            case TCP: return createReconnectingTcpClient(clientConfiguration);
-            case SSH: return createReconnectingSshClient(clientConfiguration);
-            default: throw new IllegalArgumentException("Unknown client protocol " + clientConfiguration.getProtocol());
+        case TCP:
+            return createReconnectingTcpClient(clientConfiguration);
+        case SSH:
+            return createReconnectingSshClient(clientConfiguration);
+        default:
+            throw new IllegalArgumentException("Unknown client protocol " + clientConfiguration.getProtocol());
         }
     }
 
     private Future<NetconfClientSession> createTcpClient(final NetconfClientConfiguration currentConfiguration) {
-        logger.debug("Creating TCP client with configuration: {}", currentConfiguration);
+        LOG.debug("Creating TCP client with configuration: {}", currentConfiguration);
         return super.createClient(currentConfiguration.getAddress(), currentConfiguration.getReconnectStrategy(),
                 new PipelineInitializer<NetconfClientSession>() {
 
@@ -72,7 +73,7 @@ public class NetconfClientDispatcherImpl extends AbstractDispatcher<NetconfClien
     }
 
     private Future<Void> createReconnectingTcpClient(final NetconfReconnectingClientConfiguration currentConfiguration) {
-        logger.debug("Creating reconnecting TCP client with configuration: {}", currentConfiguration);
+        LOG.debug("Creating reconnecting TCP client with configuration: {}", currentConfiguration);
         final TcpClientChannelInitializer init = new TcpClientChannelInitializer(getNegotiatorFactory(currentConfiguration),
                 currentConfiguration.getSessionListener());
 
@@ -86,7 +87,7 @@ public class NetconfClientDispatcherImpl extends AbstractDispatcher<NetconfClien
     }
 
     private Future<NetconfClientSession> createSshClient(final NetconfClientConfiguration currentConfiguration) {
-        logger.debug("Creating SSH client with configuration: {}", currentConfiguration);
+        LOG.debug("Creating SSH client with configuration: {}", currentConfiguration);
         return super.createClient(currentConfiguration.getAddress(), currentConfiguration.getReconnectStrategy(),
                 new PipelineInitializer<NetconfClientSession>() {
 
@@ -102,7 +103,7 @@ public class NetconfClientDispatcherImpl extends AbstractDispatcher<NetconfClien
     }
 
     private Future<Void> createReconnectingSshClient(final NetconfReconnectingClientConfiguration currentConfiguration) {
-        logger.debug("Creating reconnecting SSH client with configuration: {}", currentConfiguration);
+        LOG.debug("Creating reconnecting SSH client with configuration: {}", currentConfiguration);
         final SshClientChannelInitializer init = new SshClientChannelInitializer(currentConfiguration.getAuthHandler(),
                 getNegotiatorFactory(currentConfiguration), currentConfiguration.getSessionListener());
 
index bd91af5bcc95ba7f691d6880bbabe9483a865d2a..732b8fa1caa572e590ee090c2d04bec511bfd774 100644 (file)
@@ -9,9 +9,7 @@
 package org.opendaylight.controller.netconf.client;
 
 import io.netty.channel.Channel;
-
 import java.util.Collection;
-
 import org.opendaylight.controller.netconf.nettyutil.AbstractNetconfSession;
 import org.opendaylight.controller.netconf.nettyutil.handler.NetconfEXICodec;
 import org.opendaylight.controller.netconf.nettyutil.handler.NetconfEXIToMessageDecoder;
@@ -23,7 +21,7 @@ import org.slf4j.LoggerFactory;
 
 public class NetconfClientSession extends AbstractNetconfSession<NetconfClientSession, NetconfClientSessionListener> {
 
-    private static final Logger logger = LoggerFactory.getLogger(NetconfClientSession.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfClientSession.class);
     private final Collection<String> capabilities;
 
     /**
@@ -38,7 +36,7 @@ public class NetconfClientSession extends AbstractNetconfSession<NetconfClientSe
             final Collection<String> capabilities) {
         super(sessionListener, channel, sessionId);
         this.capabilities = capabilities;
-        logger.debug("Client Session {} created", toString());
+        LOG.debug("Client Session {} created", toString());
     }
 
     public Collection<String> getServerCapabilities() {
index cbbee1f65508353b117bbd21db22b523b4244694..a8c9a6526ddde26b67b42b6c09fe738fd7484f87 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.controller.netconf.client;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
-
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.ChannelFutureListener;
@@ -18,12 +17,9 @@ import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.ChannelInboundHandlerAdapter;
 import io.netty.util.Timer;
 import io.netty.util.concurrent.Promise;
-
 import java.util.Collection;
-
 import javax.xml.xpath.XPathConstants;
 import javax.xml.xpath.XPathExpression;
-
 import org.opendaylight.controller.netconf.api.NetconfClientSessionPreferences;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.NetconfMessage;
@@ -44,7 +40,7 @@ import org.w3c.dom.NodeList;
 public class NetconfClientSessionNegotiator extends
         AbstractNetconfSessionNegotiator<NetconfClientSessionPreferences, NetconfClientSession, NetconfClientSessionListener>
 {
-    private static final Logger logger = LoggerFactory.getLogger(NetconfClientSessionNegotiator.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfClientSessionNegotiator.class);
 
     private static final XPathExpression sessionIdXPath = XMLNetconfUtil
             .compileXPath("/netconf:hello/netconf:session-id");
@@ -68,12 +64,12 @@ public class NetconfClientSessionNegotiator extends
         // If exi should be used, try to initiate exi communication
         // Call negotiationSuccessFul after exi negotiation is finished successfully or not
         if (shouldUseExi(netconfMessage)) {
-            logger.debug("Netconf session {} should use exi.", session);
+            LOG.debug("Netconf session {} should use exi.", session);
             NetconfStartExiMessage startExiMessage = (NetconfStartExiMessage) sessionPreferences.getStartExiMessage();
             tryToInitiateExi(session, startExiMessage);
         } else {
             // Exi is not supported, release session immediately
-            logger.debug("Netconf session {} isn't capable of using exi.", session);
+            LOG.debug("Netconf session {} isn't capable of using exi.", session);
             negotiationSuccessful(session);
         }
     }
@@ -92,10 +88,10 @@ public class NetconfClientSessionNegotiator extends
             @Override
             public void operationComplete(final ChannelFuture f) {
                 if (!f.isSuccess()) {
-                    logger.warn("Failed to send start-exi message {} on session {}", startExiMessage, this, f.cause());
+                    LOG.warn("Failed to send start-exi message {} on session {}", startExiMessage, this, f.cause());
                     channel.pipeline().remove(ExiConfirmationInboundHandler.EXI_CONFIRMED_HANDLER);
                 } else {
-                    logger.trace("Start-exi message {} sent to socket on session {}", startExiMessage, this);
+                    LOG.trace("Start-exi message {} sent to socket on session {}", startExiMessage, this);
                 }
             }
         });
@@ -161,26 +157,26 @@ public class NetconfClientSessionNegotiator extends
 
             // Ok response to start-exi, try to add exi handlers
             if (NetconfMessageUtil.isOKMessage(netconfMessage)) {
-                logger.trace("Positive response on start-exi call received on session {}", session);
+                LOG.trace("Positive response on start-exi call received on session {}", session);
                 try {
                     session.startExiCommunication(startExiMessage);
                 } catch (RuntimeException e) {
                     // Unable to add exi, continue without exi
-                    logger.warn("Unable to start exi communication, Communication will continue without exi on session {}", session, e);
+                    LOG.warn("Unable to start exi communication, Communication will continue without exi on session {}", session, e);
                 }
 
                 // Error response
             } else if(NetconfMessageUtil.isErrorMessage(netconfMessage)) {
-                logger.warn(
+                LOG.warn(
                         "Error response to start-exi message {}, Communication will continue without exi on session {}",
                         XmlUtil.toString(netconfMessage.getDocument()), session);
 
                 // Unexpected response to start-exi, throwing message away, continue without exi
             } else {
-                logger.warn(
-                        "Unexpected response to start-exi message, should be ok, was {}, " +
-                                "Communication will continue without exi and response message will be thrown away on session {}",
-                        XmlUtil.toString(netconfMessage.getDocument()), session);
+                LOG.warn(
+                        "Unexpected response to start-exi message, should be ok, was {}, ",XmlUtil.toString(netconfMessage.getDocument()),
+                        "Communication will continue without exi and response message will be thrown away on session {}",
+                         session);
             }
 
             negotiationSuccessful(session);
index 3b1de348ff86858884d27a6436ddc0c0d62692fb..7efb28b4674e4fd592b169a2c7191c8f999f6585 100644 (file)
@@ -11,11 +11,9 @@ package org.opendaylight.controller.netconf.client;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Sets;
-
 import io.netty.channel.Channel;
 import io.netty.util.Timer;
 import io.netty.util.concurrent.Promise;
-
 import org.opendaylight.controller.netconf.api.NetconfClientSessionPreferences;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.NetconfMessage;
@@ -45,7 +43,7 @@ public class NetconfClientSessionNegotiatorFactory implements SessionNegotiatorF
     private final long connectionTimeoutMillis;
     private final Timer timer;
     private final EXIOptions options;
-    private static final Logger logger = LoggerFactory.getLogger(NetconfClientSessionNegotiatorFactory.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfClientSessionNegotiatorFactory.class);
 
     public NetconfClientSessionNegotiatorFactory(Timer timer,
                                                  Optional<NetconfHelloMessageAdditionalHeader> additionalHeader,
@@ -72,7 +70,7 @@ public class NetconfClientSessionNegotiatorFactory implements SessionNegotiatorF
         try {
             helloMessage = NetconfHelloMessage.createClientHello(CLIENT_CAPABILITIES, additionalHeader);
         } catch (NetconfDocumentedException e) {
-            logger.error("Unable to create client hello message with capabilities {} and additional handler {}",CLIENT_CAPABILITIES,additionalHeader);
+            LOG.error("Unable to create client hello message with capabilities {} and additional handler {}",CLIENT_CAPABILITIES,additionalHeader);
             throw new IllegalStateException(e);
         }
 
index 524f0b52b7e22f4dc01317d5c7cf7dbcc1c045a0..77f8741a4f7c9e8bad4cc1971ce24b48cfe095a2 100644 (file)
@@ -8,22 +8,18 @@
 
 package org.opendaylight.controller.netconf.client;
 
+import com.google.common.base.Preconditions;
 import io.netty.util.concurrent.Future;
 import io.netty.util.concurrent.GlobalEventExecutor;
 import io.netty.util.concurrent.Promise;
-
 import java.util.ArrayDeque;
 import java.util.Queue;
-
 import javax.annotation.concurrent.GuardedBy;
-
 import org.opendaylight.controller.netconf.api.NetconfMessage;
 import org.opendaylight.controller.netconf.api.NetconfTerminationReason;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
-
 public class SimpleNetconfClientSessionListener implements NetconfClientSessionListener {
     private static final class RequestEntry {
         private final Promise<NetconfMessage> promise;
@@ -35,7 +31,7 @@ public class SimpleNetconfClientSessionListener implements NetconfClientSessionL
         }
     }
 
-    private static final Logger logger = LoggerFactory.getLogger(SimpleNetconfClientSessionListener.class);
+    private static final Logger LOG = LoggerFactory.getLogger(SimpleNetconfClientSessionListener.class);
 
     @GuardedBy("this")
     private final Queue<RequestEntry> requests = new ArrayDeque<>();
@@ -48,12 +44,12 @@ public class SimpleNetconfClientSessionListener implements NetconfClientSessionL
         while (!requests.isEmpty()) {
             final RequestEntry e = requests.peek();
             if (e.promise.setUncancellable()) {
-                logger.debug("Sending message {}", e.request);
+                LOG.debug("Sending message {}", e.request);
                 clientSession.sendMessage(e.request);
                 break;
             }
 
-            logger.debug("Message {} has been cancelled, skipping it", e.request);
+            LOG.debug("Message {} has been cancelled, skipping it", e.request);
             requests.poll();
         }
     }
@@ -61,7 +57,7 @@ public class SimpleNetconfClientSessionListener implements NetconfClientSessionL
     @Override
     public final synchronized void onSessionUp(NetconfClientSession clientSession) {
         this.clientSession = Preconditions.checkNotNull(clientSession);
-        logger.debug("Client session {} went up", clientSession);
+        LOG.debug("Client session {} went up", clientSession);
         dispatchRequest();
     }
 
@@ -76,28 +72,28 @@ public class SimpleNetconfClientSessionListener implements NetconfClientSessionL
 
     @Override
     public final void onSessionDown(NetconfClientSession clientSession, Exception e) {
-        logger.debug("Client Session {} went down unexpectedly", clientSession, e);
+        LOG.debug("Client Session {} went down unexpectedly", clientSession, e);
         tearDown(e);
     }
 
     @Override
     public final void onSessionTerminated(NetconfClientSession clientSession,
             NetconfTerminationReason netconfTerminationReason) {
-        logger.debug("Client Session {} terminated, reason: {}", clientSession,
+        LOG.debug("Client Session {} terminated, reason: {}", clientSession,
                 netconfTerminationReason.getErrorMessage());
         tearDown(new RuntimeException(netconfTerminationReason.getErrorMessage()));
     }
 
     @Override
     public synchronized void onMessage(NetconfClientSession session, NetconfMessage message) {
-        logger.debug("New message arrived: {}", message);
+        LOG.debug("New message arrived: {}", message);
 
         final RequestEntry e = requests.poll();
         if (e != null) {
             e.promise.setSuccess(message);
             dispatchRequest();
         } else {
-            logger.info("Ignoring unsolicited message {}", message);
+            LOG.info("Ignoring unsolicited message {}", message);
         }
     }
 
index 592cdad4c196bdc47fb24588fad630192da593fa..5fa217839d8bb01f0f504819a512a80f9913f9bc 100644 (file)
@@ -9,19 +9,16 @@
 package org.opendaylight.controller.netconf.client;
 
 import com.google.common.base.Optional;
+import java.net.InetSocketAddress;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
-import org.opendaylight.controller.netconf.client.NetconfClientSessionListener;
-import org.opendaylight.controller.netconf.client.SimpleNetconfClientSessionListener;
 import org.opendaylight.controller.netconf.client.conf.NetconfClientConfiguration;
 import org.opendaylight.controller.netconf.client.conf.NetconfClientConfigurationBuilder;
 import org.opendaylight.controller.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.protocol.framework.ReconnectStrategy;
 
-import java.net.InetSocketAddress;
-
 public class NetconfClientConfigurationTest {
     @Test
     public void testNetconfClientConfiguration() throws Exception {
index dfbb972e8c8f90b5e6f3285fea974c6924ff4640..ab25f96088482810cec53d55dab697f95e4484c1 100644 (file)
@@ -8,6 +8,10 @@
 
 package org.opendaylight.controller.netconf.client;
 
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doReturn;
+
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.ChannelPromise;
@@ -15,11 +19,10 @@ import io.netty.channel.EventLoopGroup;
 import io.netty.util.HashedWheelTimer;
 import io.netty.util.Timer;
 import io.netty.util.concurrent.GenericFutureListener;
+import java.net.InetSocketAddress;
+import java.util.concurrent.Future;
 import org.junit.Test;
 import org.mockito.Mockito;
-import org.opendaylight.controller.netconf.client.NetconfClientDispatcherImpl;
-import org.opendaylight.controller.netconf.client.NetconfClientSessionListener;
-import org.opendaylight.controller.netconf.client.SimpleNetconfClientSessionListener;
 import org.opendaylight.controller.netconf.client.conf.NetconfClientConfiguration;
 import org.opendaylight.controller.netconf.client.conf.NetconfReconnectingClientConfiguration;
 import org.opendaylight.controller.netconf.client.conf.NetconfReconnectingClientConfigurationBuilder;
@@ -28,13 +31,6 @@ import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAddi
 import org.opendaylight.protocol.framework.ReconnectStrategy;
 import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
 
-import java.net.InetSocketAddress;
-import java.util.concurrent.Future;
-
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.doReturn;
-
 public class NetconfClientDispatcherImplTest {
     @Test
     public void testNetconfClientDispatcherImpl() throws Exception {
index 62d6275b9ef004440db7f6a075b114b476edb2c1..ecb14cc84dbd8f902e424be893984dc198082774 100644 (file)
@@ -8,6 +8,10 @@
 
 package org.opendaylight.controller.netconf.client;
 
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+
 import com.google.common.base.Optional;
 import io.netty.channel.Channel;
 import io.netty.util.HashedWheelTimer;
@@ -17,9 +21,6 @@ import org.junit.Test;
 import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.protocol.framework.SessionListenerFactory;
 import org.opendaylight.protocol.framework.SessionNegotiator;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
 
 public class NetconfClientSessionNegotiatorFactoryTest {
     @Test
index 187f13b2585d9fda02fdc6de209e58cc92001ebd..ce18ac057944e4d6676a8a018083e5e1a224cfad 100644 (file)
@@ -16,6 +16,7 @@ import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
+
 import com.google.common.base.Optional;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
@@ -61,7 +62,6 @@ public class NetconfClientSessionNegotiatorTest {
         pipeline = mockChannelPipeline();
         future = mockChannelFuture();
         channel = mockChannel();
-        System.out.println("setup done");
     }
 
     private ChannelHandler mockChannelHandler() {
index 731a3fe9606197f6ecf95fea28944fc09b435b69..850ad55fc61314481cde821ff575bee9789a3f86 100644 (file)
@@ -8,27 +8,24 @@
 
 package org.opendaylight.controller.netconf.client;
 
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.mock;
+
 import com.google.common.collect.Lists;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelPipeline;
+import java.util.Collection;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.netconf.client.NetconfClientSession;
-import org.opendaylight.controller.netconf.client.NetconfClientSessionListener;
 import org.opendaylight.controller.netconf.nettyutil.handler.NetconfEXICodec;
 import org.openexi.proc.common.EXIOptions;
 
-import java.util.Collection;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.mock;
-
 public class NetconfClientSessionTest {
 
     @Mock
index a9754654d5a7a4e1ee1e2588fb3a127bcc677d61..c74aa2bf15c3b7d8e6342cb0567b3a0810ab624b 100644 (file)
@@ -9,11 +9,10 @@
 package org.opendaylight.controller.netconf.client;
 
 import com.google.common.base.Optional;
+import java.net.InetSocketAddress;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
-import org.opendaylight.controller.netconf.client.NetconfClientSessionListener;
-import org.opendaylight.controller.netconf.client.SimpleNetconfClientSessionListener;
 import org.opendaylight.controller.netconf.client.conf.NetconfClientConfiguration;
 import org.opendaylight.controller.netconf.client.conf.NetconfReconnectingClientConfiguration;
 import org.opendaylight.controller.netconf.client.conf.NetconfReconnectingClientConfigurationBuilder;
@@ -22,8 +21,6 @@ import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAddi
 import org.opendaylight.protocol.framework.ReconnectStrategy;
 import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
 
-import java.net.InetSocketAddress;
-
 public class NetconfReconnectingClientConfigurationTest {
     @Test
     public void testNetconfReconnectingClientConfiguration() throws Exception {
index 9065ca45a290a4b761dc693caf6b17ca3723182d..8ce1ef0db501c1986d8f54d410ab305af4c7423e 100644 (file)
@@ -7,20 +7,25 @@
  */
 
 package org.opendaylight.controller.netconf.client;
-import io.netty.channel.*;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
+import io.netty.channel.Channel;
+import io.netty.channel.ChannelFuture;
 import io.netty.util.concurrent.Future;
+import java.util.Set;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.internal.util.collections.Sets;
 import org.opendaylight.controller.netconf.api.NetconfMessage;
 import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessage;
 
-import java.util.Set;
-
-import static org.junit.Assert.*;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.*;
-
 public class SimpleNetconfClientSessionListenerTest {
 
     private Channel channel;
index 8c55d8cc10eaadf1d01ad18391383013fcc68068..dc8fde6e2c615aa8a35958d7f805589b85e467cb 100644 (file)
@@ -8,6 +8,13 @@
 
 package org.opendaylight.controller.netconf.client;
 
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelPipeline;
@@ -17,10 +24,6 @@ import org.opendaylight.controller.netconf.nettyutil.handler.ssh.authentication.
 import org.opendaylight.protocol.framework.SessionListenerFactory;
 import org.opendaylight.protocol.framework.SessionNegotiator;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.*;
-
 public class SshClientChannelInitializerTest {
     @Test
     public void test() throws Exception {
index 9c57565981d40069ee010458357c1f388879e8c6..210f898659f7980ea6a4a49d4078ef6fec7cc087 100644 (file)
@@ -8,6 +8,13 @@
 
 package org.opendaylight.controller.netconf.client;
 
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelPipeline;
@@ -16,8 +23,6 @@ import org.junit.Test;
 import org.opendaylight.protocol.framework.SessionListenerFactory;
 import org.opendaylight.protocol.framework.SessionNegotiator;
 
-import static org.mockito.Mockito.*;
-
 public class TcpClientChannelInitializerTest {
     @Test
     public void testInitializeSessionNegotiator() throws Exception {
index d7209d929514c6ddb2dcb835f5cc8273bea95ebc..256dc30a149b2e7b7af68f916c001e34f8a27ecd 100644 (file)
@@ -108,7 +108,7 @@ public class TestingNetconfClient implements Closeable {
         NetconfClientDispatcherImpl netconfClientDispatcher = new NetconfClientDispatcherImpl(nettyGroup, nettyGroup, hashedWheelTimer);
         LoginPassword authHandler = new LoginPassword("admin", "admin");
         TestingNetconfClient client = new TestingNetconfClient("client", netconfClientDispatcher, getClientConfig("127.0.0.1", 1830, true, Optional.of(authHandler)));
-        System.out.println(client.getCapabilities());
+        System.console().writer().println(client.getCapabilities());
     }
 
     private static NetconfClientConfiguration getClientConfig(String host ,int port, boolean ssh, Optional<? extends AuthenticationHandler> maybeAuthHandler) throws UnknownHostException {
index 91385bab33e5102659e72c7f42a435f509b5c1fa..13cc973ba7127ccd16180dd0d0ff30c2a75acd07 100644 (file)
@@ -11,25 +11,24 @@ package org.opendaylight.controller.netconf.impl;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Maps;
-import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider;
-import org.opendaylight.controller.netconf.mapping.api.Capability;
-import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService;
-import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceSnapshot;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
+import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider;
+import org.opendaylight.controller.netconf.mapping.api.Capability;
+import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService;
+import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceSnapshot;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class CapabilityProviderImpl implements CapabilityProvider {
     private final NetconfOperationServiceSnapshot netconfOperationServiceSnapshot;
     private final Set<String> capabilityURIs;
 
-    private static final Logger logger = LoggerFactory.getLogger(DefaultCommitNotificationProducer.class);
+    private static final Logger LOG = LoggerFactory.getLogger(CapabilityProviderImpl.class);
 
     public CapabilityProviderImpl(NetconfOperationServiceSnapshot netconfOperationServiceSnapshot) {
         this.netconfOperationServiceSnapshot = netconfOperationServiceSnapshot;
@@ -49,7 +48,7 @@ public class CapabilityProviderImpl implements CapabilityProvider {
             for (Capability cap : caps) {
 
                 if(capabilityMap.containsKey(cap.getCapabilityUri())) {
-                    logger.debug("Duplicate capability {} from service {}", cap.getCapabilityUri(), netconfOperationService);
+                    LOG.debug("Duplicate capability {} from service {}", cap.getCapabilityUri(), netconfOperationService);
                 }
 
                 capabilityMap.put(cap.getCapabilityUri(), cap);
index 203fdf272584015f40f8bde0dd4e80b753eb51f0..ab37bac683829a95cc4e78ec24bcfb56c584faf1 100644 (file)
@@ -8,13 +8,7 @@
 
 package org.opendaylight.controller.netconf.impl;
 
-import org.opendaylight.controller.netconf.api.jmx.CommitJMXNotification;
-import org.opendaylight.controller.netconf.api.jmx.DefaultCommitOperationMXBean;
-import org.opendaylight.controller.netconf.api.jmx.NetconfJMXNotification;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Element;
-
+import java.util.Set;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
 import javax.management.MBeanRegistrationException;
@@ -22,12 +16,17 @@ import javax.management.MBeanServer;
 import javax.management.NotCompliantMBeanException;
 import javax.management.NotificationBroadcasterSupport;
 import javax.management.ObjectName;
-import java.util.Set;
+import org.opendaylight.controller.netconf.api.jmx.CommitJMXNotification;
+import org.opendaylight.controller.netconf.api.jmx.DefaultCommitOperationMXBean;
+import org.opendaylight.controller.netconf.api.jmx.NetconfJMXNotification;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Element;
 
 public class DefaultCommitNotificationProducer extends NotificationBroadcasterSupport implements
         DefaultCommitOperationMXBean, AutoCloseable {
 
-    private static final Logger logger = LoggerFactory.getLogger(DefaultCommitNotificationProducer.class);
+    private static final Logger LOG = LoggerFactory.getLogger(DefaultCommitNotificationProducer.class);
 
     private final MBeanServer mbeanServer;
 
@@ -35,7 +34,7 @@ public class DefaultCommitNotificationProducer extends NotificationBroadcasterSu
 
     public DefaultCommitNotificationProducer(MBeanServer mBeanServer) {
         this.mbeanServer = mBeanServer;
-        logger.debug("Registering to JMX under {}", on);
+        LOG.debug("Registering to JMX under {}", on);
         registerMBean(this, mbeanServer, on);
     }
 
@@ -49,7 +48,7 @@ public class DefaultCommitNotificationProducer extends NotificationBroadcasterSu
 
     public void sendCommitNotification(String message, Element cfgSnapshot, Set<String> capabilities) {
         CommitJMXNotification notif = NetconfJMXNotification.afterCommit(this, message, cfgSnapshot, capabilities);
-        logger.debug("Notification about commit {} sent", notif);
+        LOG.debug("Notification about commit {} sent", notif);
         sendNotification(notif);
     }
 
@@ -58,7 +57,7 @@ public class DefaultCommitNotificationProducer extends NotificationBroadcasterSu
         try {
             mbeanServer.unregisterMBean(on);
         } catch (InstanceNotFoundException | MBeanRegistrationException e) {
-            logger.warn("Ignoring exception while unregistering {} as {}", this, on, e);
+            LOG.warn("Ignoring exception while unregistering {} as {}", this, on, e);
         }
     }
 }
index 7d409092b9178bcd2816c96371108930f200fe3a..ca604a4f6531c4f03d878825ac5fde5cfd360aeb 100644 (file)
@@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
 
 public final class NetconfServerSession extends AbstractNetconfSession<NetconfServerSession, NetconfServerSessionListener> implements NetconfManagementSession {
 
-    private static final Logger logger = LoggerFactory.getLogger(NetconfServerSession.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfServerSession.class);
 
     private final NetconfHelloMessageAdditionalHeader header;
 
@@ -50,7 +50,7 @@ public final class NetconfServerSession extends AbstractNetconfSession<NetconfSe
             NetconfHelloMessageAdditionalHeader header) {
         super(sessionListener, channel, sessionId);
         this.header = header;
-        logger.debug("Session {} created", toString());
+        LOG.debug("Session {} created", toString());
     }
 
     @Override
@@ -111,9 +111,12 @@ public final class NetconfServerSession extends AbstractNetconfSession<NetconfSe
 
     private Class<? extends Transport> getTransportForString(String transport) {
         switch(transport) {
-        case "ssh" : return NetconfSsh.class;
-        case "tcp" : return NetconfTcp.class;
-        default: throw new IllegalArgumentException("Unknown transport type " + transport);
+        case "ssh" :
+            return NetconfSsh.class;
+        case "tcp" :
+            return NetconfTcp.class;
+        default:
+            throw new IllegalArgumentException("Unknown transport type " + transport);
         }
     }
 
index 4f2f65c1a00732137229fba7e1416d9c1db70904..b2b8c50029868d507971cf70d1f22af940861e0d 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.controller.netconf.impl;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
-
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.NetconfMessage;
 import org.opendaylight.controller.netconf.api.NetconfSessionListener;
@@ -31,7 +30,7 @@ import org.w3c.dom.Node;
 
 public class NetconfServerSessionListener implements NetconfSessionListener<NetconfServerSession> {
 
-    static final Logger logger = LoggerFactory.getLogger(NetconfServerSessionListener.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfServerSessionListener.class);
     private final SessionMonitoringService monitoringService;
     private final NetconfOperationRouter operationRouter;
     private final AutoCloseable onSessionDownCloseable;
@@ -50,7 +49,7 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
 
     @Override
     public void onSessionDown(NetconfServerSession netconfNetconfServerSession, Exception cause) {
-        logger.debug("Session {} down, reason: {}", netconfNetconfServerSession, cause.getMessage());
+        LOG.debug("Session {} down, reason: {}", netconfNetconfServerSession, cause.getMessage());
         onDown(netconfNetconfServerSession);
     }
 
@@ -60,19 +59,19 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
         try {
             operationRouter.close();
         } catch (Exception closingEx) {
-            logger.debug("Ignoring exception while closing operationRouter", closingEx);
+            LOG.debug("Ignoring exception while closing operationRouter", closingEx);
         }
         try {
             onSessionDownCloseable.close();
         } catch(Exception ex){
-            logger.debug("Ignoring exception while closing onSessionDownCloseable", ex);
+            LOG.debug("Ignoring exception while closing onSessionDownCloseable", ex);
         }
     }
 
     @Override
     public void onSessionTerminated(NetconfServerSession netconfNetconfServerSession,
             NetconfTerminationReason netconfTerminationReason) {
-        logger.debug("Session {} terminated, reason: {}", netconfNetconfServerSession,
+        LOG.debug("Session {} terminated, reason: {}", netconfNetconfServerSession,
                 netconfTerminationReason.getErrorMessage());
         onDown(netconfNetconfServerSession);
     }
@@ -86,7 +85,7 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
             // schemas
             final NetconfMessage message = processDocument(netconfMessage,
                     session);
-            logger.debug("Responding with message {}", XmlUtil.toString(message.getDocument()));
+            LOG.debug("Responding with message {}", XmlUtil.toString(message.getDocument()));
             session.sendMessage(message);
 
             if (isCloseSession(netconfMessage)) {
@@ -95,11 +94,11 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
 
         } catch (final RuntimeException e) {
             // TODO: should send generic error or close session?
-            logger.error("Unexpected exception", e);
+            LOG.error("Unexpected exception", e);
             session.onIncommingRpcFail();
             throw new IllegalStateException("Unable to process incoming message " + netconfMessage, e);
         } catch (NetconfDocumentedException e) {
-            logger.trace("Error occurred while processing message",e);
+            LOG.trace("Error occurred while processing message",e);
             session.onOutgoingRpcError();
             session.onIncommingRpcFail();
             SendErrorExceptionUtil.sendErrorMessage(session, e, netconfMessage);
@@ -109,7 +108,7 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
     private void closeNetconfSession(NetconfServerSession session) {
         // destroy NetconfOperationService
         session.close();
-        logger.info("Session {} closed successfully", session.getSessionId());
+        LOG.info("Session {} closed successfully", session.getSessionId());
     }
 
 
@@ -148,7 +147,9 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
     }
 
     private void checkMessageId(Node rootNode) throws NetconfDocumentedException {
-            NamedNodeMap attributes = rootNode.getAttributes();
+
+        NamedNodeMap attributes = rootNode.getAttributes();
+
         if(attributes.getNamedItemNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.MESSAGE_ID)!=null) {
             return;
         }
@@ -159,8 +160,9 @@ public class NetconfServerSessionListener implements NetconfSessionListener<Netc
 
         throw new NetconfDocumentedException("Missing attribute" + rootNode.getNodeName(),
                 NetconfDocumentedException.ErrorType.protocol, NetconfDocumentedException.ErrorTag.missing_attribute,
-                NetconfDocumentedException.ErrorSeverity.error, ImmutableMap.of(NetconfDocumentedException.ErrorTag.missing_attribute.toString(),
-                XmlNetconfConstants.MESSAGE_ID));
+                NetconfDocumentedException.ErrorSeverity.error,
+                ImmutableMap.of(NetconfDocumentedException.ErrorTag.missing_attribute.toString(),
+                        XmlNetconfConstants.MESSAGE_ID));
     }
 
     private static boolean isCloseSession(final NetconfMessage incomingDocument) {
index 34a8bc4fd57f7a670aad66aa68cc824bf2905572..4be8b91a946ebbc115077d71e5d8751e8757f047 100644 (file)
@@ -8,8 +8,8 @@
 
 package org.opendaylight.controller.netconf.impl;
 
-import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter;
 import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider;
+import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter;
 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouterImpl;
 import org.opendaylight.controller.netconf.impl.osgi.SessionMonitoringService;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceSnapshot;
index f7bb281b9122b259e6e4df1a2e15b5bdca63b22f..2f72ad4d4769964021c0cc5f443692c4993ec0aa 100644 (file)
@@ -13,6 +13,10 @@ 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 java.net.SocketAddress;
+import java.util.AbstractMap;
+import java.util.Map;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.NetconfServerSessionPreferences;
 import org.opendaylight.controller.netconf.nettyutil.AbstractNetconfSessionNegotiator;
@@ -21,17 +25,12 @@ import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAddi
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-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);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfServerSessionNegotiator.class);
+    
     private static final String UNKNOWN = "unknown";
 
     protected NetconfServerSessionNegotiator(
@@ -71,7 +70,7 @@ public class NetconfServerSessionNegotiator
 
         }
 
-        logger.debug("Additional header from hello parsed as {} from {}",
+        LOG.debug("Additional header from hello parsed as {} from {}",
                 parsedHeader, additionalHeader);
 
         return new NetconfServerSession(sessionListener, channel,
index 487ffd6e5dc2d8f5e7dbd13db1402b3d7e0559a7..34f4f0e653137235a22e917a99224bb96f138ca7 100644 (file)
@@ -12,9 +12,11 @@ import static org.opendaylight.controller.netconf.mapping.api.NetconfOperationPr
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableSet;
-
+import com.google.common.collect.Sets;
+import io.netty.channel.Channel;
+import io.netty.util.Timer;
+import io.netty.util.concurrent.Promise;
 import java.util.Set;
-
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.NetconfServerSessionPreferences;
 import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
@@ -26,13 +28,6 @@ import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessage;
 import org.opendaylight.protocol.framework.SessionListenerFactory;
 import org.opendaylight.protocol.framework.SessionNegotiator;
 import org.opendaylight.protocol.framework.SessionNegotiatorFactory;
-
-import com.google.common.collect.Sets;
-
-import io.netty.channel.Channel;
-import io.netty.util.Timer;
-import io.netty.util.concurrent.Promise;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -51,7 +46,7 @@ public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorF
     private final long connectionTimeoutMillis;
     private final DefaultCommitNotificationProducer commitNotificationProducer;
     private final SessionMonitoringService monitoringService;
-    private static final Logger logger = LoggerFactory.getLogger(NetconfServerSessionNegotiatorFactory.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfServerSessionNegotiatorFactory.class);
     private final Set<String> baseCapabilities;
 
     // TODO too many params, refactor
@@ -112,7 +107,7 @@ public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorF
             proposal = new NetconfServerSessionPreferences(
                     createHelloMessage(sessionId, capabilityProvider), sessionId);
         } catch (NetconfDocumentedException e) {
-            logger.error("Unable to create hello mesage for session {} with capability provider {}", sessionId,capabilityProvider);
+            LOG.error("Unable to create hello mesage for session {} with capability provider {}", sessionId,capabilityProvider);
             throw new IllegalStateException(e);
         }
 
index 8b2ca86010a06aa5c1b509bd617a08de72fd684a..2e7accad45e8950b7be2c3fb11a0a1ad1e74b93d 100644 (file)
@@ -28,14 +28,14 @@ import org.xml.sax.SAXException;
  * See <a href="http://tools.ietf.org/html/rfc6241#section-6">rfc6241</a> for details.
  */
 public class SubtreeFilter {
-    private static final Logger logger = LoggerFactory.getLogger(SubtreeFilter.class);
+    private static final Logger LOG = LoggerFactory.getLogger(SubtreeFilter.class);
 
     static Document applySubtreeFilter(Document requestDocument, Document rpcReply) throws NetconfDocumentedException {
         // FIXME: rpcReply document must be reread otherwise some nodes do not inherit namespaces. (services/service)
         try {
             rpcReply = XmlUtil.readXmlToDocument(XmlUtil.toString(rpcReply, true));
         } catch (SAXException | IOException e) {
-            logger.error("Cannot transform document", e);
+            LOG.error("Cannot transform document", e);
             throw new NetconfDocumentedException("Cannot transform document");
         }
 
@@ -49,8 +49,8 @@ public class SubtreeFilter {
                     XmlNetconfConstants.FILTER, XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
             if (maybeFilter.isPresent() && (
                     "subtree".equals(maybeFilter.get().getAttribute("type"))||
-                            "subtree".equals(maybeFilter.get().getAttribute("type", XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0))
-            )) {
+                            "subtree".equals(maybeFilter.get().getAttribute("type", XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0)))
+            ) {
 
 
                 // do
@@ -160,7 +160,7 @@ public class SubtreeFilter {
         if (result == null) {
             result = MatchingResult.NO_MATCH;
         }
-        logger.debug("Matching {} to {} resulted in {}", src, filter, result);
+        LOG.debug("Matching {} to {} resulted in {}", src, filter, result);
         return result;
     }
 
index b7a98bae83acae9a1ee0f525a015db251c998f3e..8c7465b02961197e4a1bc5c836d10d00c0441be5 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.controller.netconf.impl.mapping.operations;
 
+import com.google.common.base.Optional;
+import java.util.Collections;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation;
@@ -16,10 +18,6 @@ import org.opendaylight.controller.netconf.util.xml.XmlUtil;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import com.google.common.base.Optional;
-
-import java.util.Collections;
-
 public class DefaultCloseSession extends AbstractSingletonNetconfOperation {
     public static final String CLOSE_SESSION = "close-session";
     private final AutoCloseable sessionResources;
@@ -49,7 +47,7 @@ public class DefaultCloseSession extends AbstractSingletonNetconfOperation {
                     + getNetconfSessionIdForReporting(), NetconfDocumentedException.ErrorType.application,
                     NetconfDocumentedException.ErrorTag.operation_failed,
                     NetconfDocumentedException.ErrorSeverity.error, Collections.singletonMap(
-                    NetconfDocumentedException.ErrorSeverity.error.toString(), e.getMessage()));
+                        NetconfDocumentedException.ErrorSeverity.error.toString(), e.getMessage()));
         }
         return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
     }
index 67b782c7c1d7666a32f78fe08f0ff77d5dd9f17e..fbe855f8bebddcb8aeffd728b553ce112fc50f6c 100644 (file)
@@ -9,12 +9,12 @@
 package org.opendaylight.controller.netconf.impl.mapping.operations;
 
 import com.google.common.base.Preconditions;
-
+import java.io.InputStream;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
-import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter;
 import org.opendaylight.controller.netconf.impl.DefaultCommitNotificationProducer;
 import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider;
+import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationRouter;
 import org.opendaylight.controller.netconf.mapping.api.HandlingPriority;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationChainedExecution;
 import org.opendaylight.controller.netconf.util.mapping.AbstractNetconfOperation;
@@ -25,11 +25,9 @@ import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import java.io.InputStream;
-
 public class DefaultCommit extends AbstractNetconfOperation {
 
-    private static final Logger logger = LoggerFactory.getLogger(DefaultCommit.class);
+    private static final Logger LOG = LoggerFactory.getLogger(DefaultCommit.class);
 
     private static final String NOTIFY_ATTR = "notify";
 
@@ -69,12 +67,12 @@ public class DefaultCommit extends AbstractNetconfOperation {
                 "Subsequent netconf operation expected by %s", this);
 
         if (isCommitWithoutNotification(requestMessage)) {
-            logger.debug("Skipping commit notification");
+            LOG.debug("Skipping commit notification");
         } else {
             // Send commit notification if commit was not issued by persister
             removePersisterAttributes(requestMessage);
             Element cfgSnapshot = getConfigSnapshot(operationRouter);
-            logger.debug("Config snapshot retrieved successfully {}", cfgSnapshot);
+            LOG.debug("Config snapshot retrieved successfully {}", cfgSnapshot);
             notificationProducer.sendCommitNotification("ok", cfgSnapshot, cap.getCapabilities());
         }
 
@@ -101,7 +99,7 @@ public class DefaultCommit extends AbstractNetconfOperation {
             xmlElement = XmlElement.fromDomElementWithExpected(message.getDocumentElement(),
                     XmlNetconfConstants.RPC_KEY, XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
         } catch (NetconfDocumentedException e) {
-            logger.trace("Commit operation is not valid due to  {}",e);
+            LOG.trace("Commit operation is not valid due to ",e);
             return false;
         }
 
@@ -110,7 +108,7 @@ public class DefaultCommit extends AbstractNetconfOperation {
         if (attr == null || attr.equals("")){
             return false;
         } else if (attr.equals(Boolean.toString(false))) {
-            logger.debug("Commit operation received with notify=false attribute {}", message);
+            LOG.debug("Commit operation received with notify=false attribute {}", message);
             return true;
         } else {
             return false;
index 6db74eaba2ec0aba6efb421b40e12e735709edde..53107048760dbee1ae27f23be7977b15481ba39a 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.controller.netconf.impl.mapping.operations;
 
 import com.google.common.base.Optional;
 import com.google.common.collect.Maps;
-
+import java.util.Map;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.controller.netconf.impl.mapping.CapabilityProvider;
@@ -23,14 +23,12 @@ import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import java.util.Map;
-
 public final class DefaultGetSchema extends AbstractLastNetconfOperation {
     public static final String GET_SCHEMA = "get-schema";
     public static final String IDENTIFIER = "identifier";
     public static final String VERSION = "version";
 
-    private static final Logger logger = LoggerFactory.getLogger(DefaultGetSchema.class);
+    private static final Logger LOG = LoggerFactory.getLogger(DefaultGetSchema.class);
     private final CapabilityProvider cap;
 
     public DefaultGetSchema(CapabilityProvider cap, String netconfSessionIdForReporting) {
@@ -60,7 +58,7 @@ public final class DefaultGetSchema extends AbstractLastNetconfOperation {
         } catch (IllegalStateException e) {
             Map<String, String> errorInfo = Maps.newHashMap();
             errorInfo.put(entry.identifier, e.getMessage());
-            logger.warn("Rpc error: {}", NetconfDocumentedException.ErrorTag.operation_failed, e);
+            LOG.warn("Rpc error: {}", NetconfDocumentedException.ErrorTag.operation_failed, e);
             throw new NetconfDocumentedException(e.getMessage(), NetconfDocumentedException.ErrorType.application,
                     NetconfDocumentedException.ErrorTag.operation_failed,
                     NetconfDocumentedException.ErrorSeverity.error, errorInfo);
@@ -69,7 +67,7 @@ public final class DefaultGetSchema extends AbstractLastNetconfOperation {
         Element getSchemaResult;
         getSchemaResult = XmlUtil.createTextElement(document, XmlNetconfConstants.DATA_KEY, schema,
                 Optional.of(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_YANG_IETF_NETCONF_MONITORING));
-        logger.trace("{} operation successful", GET_SCHEMA);
+        LOG.trace("{} operation successful", GET_SCHEMA);
 
         return getSchemaResult;
     }
@@ -86,7 +84,7 @@ public final class DefaultGetSchema extends AbstractLastNetconfOperation {
             try {
                 identifierElement = getSchemaElement.getOnlyChildElementWithSameNamespace(IDENTIFIER);
             } catch (MissingNameSpaceException e) {
-                logger.trace("Can't get identifier element as only child element with same namespace due to {}",e);
+                LOG.trace("Can't get identifier element as only child element with same namespace due to ",e);
                 throw NetconfDocumentedException.wrap(e);
             }
             identifier = identifierElement.getTextContent();
index 6de185ac1c1da4948fc343a4be19759362af03f0..3f0ae27dbbcea4e1226694eedd3aaab4a05ce586 100644 (file)
@@ -11,8 +11,8 @@ import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorSeverity;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorTag;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException.ErrorType;
-import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.controller.netconf.api.NetconfMessage;
+import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.controller.netconf.impl.NetconfServerSession;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationChainedExecution;
 import org.opendaylight.controller.netconf.util.mapping.AbstractSingletonNetconfOperation;
@@ -25,7 +25,7 @@ import org.w3c.dom.Element;
 public class DefaultStartExi extends AbstractSingletonNetconfOperation implements DefaultNetconfOperation {
     public static final String START_EXI = "start-exi";
 
-    private static final Logger logger = LoggerFactory.getLogger(DefaultStartExi.class);
+    private static final Logger LOG = LoggerFactory.getLogger(DefaultStartExi.class);
     private NetconfServerSession netconfSession;
 
     public DefaultStartExi(String netconfSessionIdForReporting) {
@@ -35,7 +35,7 @@ public class DefaultStartExi extends AbstractSingletonNetconfOperation implement
     @Override
     public Document handle(Document message,
                            NetconfOperationChainedExecution subsequentOperation) throws NetconfDocumentedException {
-        logger.debug("Received start-exi message {} ", XmlUtil.toString(message));
+        LOG.debug("Received start-exi message {} ", XmlUtil.toString(message));
 
         try {
             netconfSession.startExiCommunication(new NetconfMessage(message));
@@ -50,7 +50,7 @@ public class DefaultStartExi extends AbstractSingletonNetconfOperation implement
     @Override
     protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException {
         Element getSchemaResult = document.createElementNS( XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.OK);
-        logger.trace("{} operation successful", START_EXI);
+        LOG.trace("{} operation successful", START_EXI);
         return getSchemaResult;
     }
 
index 233638d5b08d57b608957d1f18085535918f80f6..2b90a6150552e9306f3a137c6fe7056b2e422b3d 100644 (file)
@@ -23,8 +23,8 @@ public class DefaultStopExi extends AbstractSingletonNetconfOperation implements
     public static final String STOP_EXI = "stop-exi";
     private NetconfServerSession netconfSession;
 
-    private static final Logger logger = LoggerFactory
-            .getLogger(DefaultStartExi.class);
+    private static final Logger LOG = LoggerFactory
+            .getLogger(DefaultStopExi.class);
 
     public DefaultStopExi(String netconfSessionIdForReporting) {
         super(netconfSessionIdForReporting);
@@ -32,12 +32,12 @@ public class DefaultStopExi extends AbstractSingletonNetconfOperation implements
 
     @Override
     protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement) throws NetconfDocumentedException {
-        logger.debug("Received stop-exi message {} ", XmlUtil.toString(operationElement));
+        LOG.debug("Received stop-exi message {} ", XmlUtil.toString(operationElement));
 
         netconfSession.stopExiCommunication();
 
         Element getSchemaResult = document.createElementNS( XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, XmlNetconfConstants.OK);
-        logger.trace("{} operation successful", STOP_EXI);
+        LOG.trace("{} operation successful", STOP_EXI);
         return getSchemaResult;
     }
 
index 6ab62ef29a82037cd12e01c5f71d88e34a32a5bd..27423c09b7fb732e0bd6364dc3469efd2c13f884 100644 (file)
@@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
 
 public class NetconfImplActivator implements BundleActivator {
 
-    private static final Logger logger = LoggerFactory.getLogger(NetconfImplActivator.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfImplActivator.class);
 
     private NetconfOperationServiceFactoryTracker factoriesTracker;
     private DefaultCommitNotificationProducer commitNot;
@@ -62,7 +62,7 @@ public class NetconfImplActivator implements BundleActivator {
         NetconfServerDispatcher dispatch = new NetconfServerDispatcher(serverChannelInitializer, eventLoopGroup, eventLoopGroup);
 
         LocalAddress address = NetconfConfigUtil.getNetconfLocalAddress();
-        logger.trace("Starting local netconf server at {}", address);
+        LOG.trace("Starting local netconf server at {}", address);
         dispatch.createLocalServer(address);
 
         context.registerService(NetconfOperationProvider.class, factoriesListener, null);
@@ -84,7 +84,7 @@ public class NetconfImplActivator implements BundleActivator {
 
     @Override
     public void stop(final BundleContext context) {
-        logger.info("Shutting down netconf because YangStoreService service was removed");
+        LOG.info("Shutting down netconf because YangStoreService service was removed");
 
         commitNot.close();
         eventLoopGroup.shutdownGracefully(0, 1, TimeUnit.SECONDS);
index 2a45e1757b8655a6b6be8bcf097867b677fd70d1..3f44ff4ff834120d3edb655e55b5419b1569e7e0 100644 (file)
@@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
 
 public class NetconfMonitoringServiceImpl implements NetconfMonitoringService, SessionMonitoringService {
 
-    private static final Logger logger = LoggerFactory.getLogger(NetconfMonitoringServiceImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfMonitoringServiceImpl.class);
 
     private final Set<NetconfManagementSession> sessions = new ConcurrentSet<>();
     private final NetconfOperationProvider netconfOperationProvider;
@@ -49,14 +49,14 @@ public class NetconfMonitoringServiceImpl implements NetconfMonitoringService, S
 
     @Override
     public void onSessionUp(NetconfManagementSession session) {
-        logger.debug("Session {} up", session);
+        LOG.debug("Session {} up", session);
         Preconditions.checkState(!sessions.contains(session), "Session %s was already added", session);
         sessions.add(session);
     }
 
     @Override
     public void onSessionDown(NetconfManagementSession session) {
-        logger.debug("Session {} down", session);
+        LOG.debug("Session {} down", session);
         Preconditions.checkState(sessions.contains(session), "Session %s not present", session);
         sessions.remove(session);
     }
index aa590604b0087d5f7cc79f135a246b6a929abe07..6915ee4bfe373fa2ac402cedb5edd5f7540f643f 100644 (file)
@@ -10,6 +10,12 @@ package org.opendaylight.controller.netconf.impl.osgi;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.NavigableMap;
+import java.util.Set;
+import java.util.TreeMap;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.impl.DefaultCommitNotificationProducer;
 import org.opendaylight.controller.netconf.impl.NetconfServerSession;
@@ -30,16 +36,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.NavigableMap;
-import java.util.Set;
-import java.util.TreeMap;
-
 public class NetconfOperationRouterImpl implements NetconfOperationRouter {
 
-    private static final Logger logger = LoggerFactory.getLogger(NetconfOperationRouterImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfOperationRouterImpl.class);
 
     private final NetconfOperationServiceSnapshot netconfOperationServiceSnapshot;
     private Set<NetconfOperation> allNetconfOperations;
@@ -104,7 +103,7 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter {
             messageAsString = XmlUtil.toString(message);
             netconfOperationExecution = getNetconfOperationWithHighestPriority(message, session);
         } catch (IllegalArgumentException | IllegalStateException e) {
-            logger.warn("Unable to handle rpc {} on session {}", messageAsString, session, e);
+            LOG.warn("Unable to handle rpc {} on session {}", messageAsString, session, e);
 
             String errorMessage = String.format("Unable to handle rpc %s on session %s", messageAsString, session);
             Map<String, String> errorInfo = Maps.newHashMap();
@@ -137,7 +136,7 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter {
     }
 
     private NetconfDocumentedException handleUnexpectedEx(String s, Exception e) throws NetconfDocumentedException {
-        logger.error(s, e);
+        LOG.error(s, e);
 
         Map<String, String> info = Maps.newHashMap();
         info.put(NetconfDocumentedException.ErrorSeverity.error.toString(), e.toString());
@@ -150,7 +149,7 @@ public class NetconfOperationRouterImpl implements NetconfOperationRouter {
     private Document executeOperationWithHighestPriority(Document message,
             NetconfOperationExecution netconfOperationExecution, String messageAsString)
             throws NetconfDocumentedException {
-        logger.debug("Forwarding netconf message {} to {}", messageAsString, netconfOperationExecution.netconfOperation);
+        LOG.debug("Forwarding netconf message {} to {}", messageAsString, netconfOperationExecution.netconfOperation);
         return netconfOperationExecution.execute(message);
     }
 
index 63cd0baf347f8821a2f639cac5fca55cf4eae774..6c55c35e25b44716e1f930007f77d9c90f238e56 100644 (file)
@@ -7,11 +7,10 @@
  */
 package org.opendaylight.controller.netconf.impl.osgi;
 
-import org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider;
-import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory;
-
 import java.util.HashSet;
 import java.util.Set;
+import org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider;
+import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory;
 
 public class NetconfOperationServiceFactoryListenerImpl implements NetconfOperationServiceFactoryListener,
         NetconfOperationProvider {
index ce312548b2858f7884596ea1f8d2b9f927f966a5..1a35e4d6bace2e313c084cf5ffdf23bbfd3833bb 100644 (file)
@@ -8,15 +8,14 @@
 
 package org.opendaylight.controller.netconf.impl.osgi;
 
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceSnapshot;
 import org.opendaylight.controller.netconf.util.CloseableUtil;
 
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
 public class NetconfOperationServiceSnapshotImpl implements NetconfOperationServiceSnapshot {
 
     private final Set<NetconfOperationService> services;
index 31c4d4f57e7b65f6f4b9ae5e28376346e3be3600..e336914981222e5572a77a4f2b09a05fea82dc50 100644 (file)
@@ -11,18 +11,15 @@ package org.opendaylight.controller.netconf.impl.util;
 import com.google.common.collect.Maps;
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelHandlerContext;
+import java.util.Map;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.util.messages.SendErrorExceptionUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Map;
-
-public final class
-        DeserializerExceptionHandler implements ChannelHandler {
-
-    private static final Logger logger = LoggerFactory.getLogger(DeserializerExceptionHandler.class);
+public final class DeserializerExceptionHandler implements ChannelHandler {
 
+    private static final Logger LOG = LoggerFactory.getLogger(DeserializerExceptionHandler.class);
 
     @Override
     public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
@@ -36,7 +33,7 @@ public final class
 
     @Override
     public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
-        logger.warn("An exception occurred during message handling", cause);
+        LOG.warn("An exception occurred during message handling", cause);
         handleDeserializerException(ctx, cause);
     }
 
index 444d4fe4abad44c6168d7ef2befff13f5d1af7fe..355f84ac66a581ed73557885cf0f4d2428bc1c78 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.netconf.impl;
 
 import static org.junit.Assert.assertEquals;
+
 import org.junit.Test;
 import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader;
 
index 5f8bc06e1015625cf48b9134058f928c54f337c1..3b83daa693fb926a7e28831fcf64f6761d3cdd7d 100644 (file)
@@ -18,13 +18,11 @@ import static org.mockito.Mockito.mock;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
-
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.EventLoopGroup;
 import io.netty.channel.nio.NioEventLoopGroup;
 import io.netty.util.HashedWheelTimer;
 import io.netty.util.concurrent.GlobalEventExecutor;
-
 import java.io.DataOutputStream;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -42,7 +40,6 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.atomic.AtomicLong;
-
 import org.apache.commons.io.IOUtils;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -57,9 +54,9 @@ import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.controller.netconf.client.NetconfClientDispatcher;
 import org.opendaylight.controller.netconf.client.NetconfClientDispatcherImpl;
 import org.opendaylight.controller.netconf.client.SimpleNetconfClientSessionListener;
+import org.opendaylight.controller.netconf.client.TestingNetconfClient;
 import org.opendaylight.controller.netconf.client.conf.NetconfClientConfiguration;
 import org.opendaylight.controller.netconf.client.conf.NetconfClientConfigurationBuilder;
-import org.opendaylight.controller.netconf.client.TestingNetconfClient;
 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl;
 import org.opendaylight.controller.netconf.impl.osgi.SessionMonitoringService;
 import org.opendaylight.controller.netconf.mapping.api.Capability;
@@ -80,7 +77,7 @@ import org.w3c.dom.Document;
 
 @RunWith(Parameterized.class)
 public class ConcurrentClientsTest {
-    private static final Logger logger = LoggerFactory.getLogger(ConcurrentClientsTest.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ConcurrentClientsTest.class);
 
     private static ExecutorService clientExecutor;
 
@@ -99,16 +96,14 @@ public class ConcurrentClientsTest {
 
     @Parameterized.Parameters()
     public static Collection<Object[]> data() {
-        return Arrays.asList(new Object[][]{
-                {4, TestingNetconfClientRunnable.class, NetconfServerSessionNegotiatorFactory.DEFAULT_BASE_CAPABILITIES},
-                {1, TestingNetconfClientRunnable.class, NetconfServerSessionNegotiatorFactory.DEFAULT_BASE_CAPABILITIES},
-                // empty set of capabilities = only base 1.0 netconf capability
-                {4, TestingNetconfClientRunnable.class, Collections.emptySet()},
-                {4, TestingNetconfClientRunnable.class, getOnlyExiServerCaps()},
-                {4, TestingNetconfClientRunnable.class, getOnlyChunkServerCaps()},
-
-                {4, BlockingClientRunnable.class, getOnlyExiServerCaps()},
-                {1, BlockingClientRunnable.class, getOnlyExiServerCaps()},
+        return Arrays.asList(new Object[][]{{4, TestingNetconfClientRunnable.class, NetconfServerSessionNegotiatorFactory.DEFAULT_BASE_CAPABILITIES},
+                                            {1, TestingNetconfClientRunnable.class, NetconfServerSessionNegotiatorFactory.DEFAULT_BASE_CAPABILITIES},
+                                            // empty set of capabilities = only base 1.0 netconf capability
+                                            {4, TestingNetconfClientRunnable.class, Collections.emptySet()},
+                                            {4, TestingNetconfClientRunnable.class, getOnlyExiServerCaps()},
+                                            {4, TestingNetconfClientRunnable.class, getOnlyChunkServerCaps()},
+                                            {4, BlockingClientRunnable.class, getOnlyExiServerCaps()},
+                                            {1, BlockingClientRunnable.class, getOnlyExiServerCaps()},
         });
     }
 
@@ -174,7 +169,7 @@ public class ConcurrentClientsTest {
         try {
             nettyGroup.shutdownGracefully().get();
         } catch (InterruptedException | ExecutionException e) {
-            logger.warn("Ignoring exception while cleaning up after test", e);
+            LOG.warn("Ignoring exception while cleaning up after test", e);
         }
     }
 
@@ -198,7 +193,7 @@ public class ConcurrentClientsTest {
             } catch (InterruptedException e) {
                 throw new IllegalStateException(e);
             } catch (ExecutionException e) {
-                logger.error("Thread for testing client failed", e);
+                LOG.error("Thread for testing client failed", e);
                 fail("Client failed: " + e.getMessage());
             }
         }
@@ -241,7 +236,7 @@ public class ConcurrentClientsTest {
         @Override
         public Document handle(Document requestMessage, NetconfOperationChainedExecution subsequentOperation) throws NetconfDocumentedException {
             try {
-                logger.info("Handling netconf message from test {}", XmlUtil.toString(requestMessage));
+                LOG.info("Handling netconf message from test {}", XmlUtil.toString(requestMessage));
                 counter.getAndIncrement();
                 return XmlUtil.readXmlToDocument("<test/>");
             } catch (Exception e) {
@@ -310,7 +305,7 @@ public class ConcurrentClientsTest {
             while (sb.toString().endsWith("]]>]]>") == false) {
                 sb.append((char) inFromServer.read());
             }
-            logger.info(sb.toString());
+            LOG.info(sb.toString());
 
             outToServer.write(IOUtils.toByteArray(clientHello));
             outToServer.write("]]>]]>".getBytes());
@@ -324,7 +319,7 @@ public class ConcurrentClientsTest {
             while (sb.toString().endsWith("]]>]]>") == false) {
                 sb.append((char) inFromServer.read());
             }
-            logger.info(sb.toString());
+            LOG.info(sb.toString());
             clientSocket.close();
         }
     }
@@ -340,19 +335,19 @@ public class ConcurrentClientsTest {
                 final TestingNetconfClient netconfClient =
                         new TestingNetconfClient(Thread.currentThread().getName(), netconfClientDispatcher, getClientConfig());
                 long sessionId = netconfClient.getSessionId();
-                logger.info("Client with session id {}: hello exchanged", sessionId);
+                LOG.info("Client with session id {}: hello exchanged", sessionId);
 
                 final NetconfMessage getMessage = XmlFileLoader
                         .xmlFileToNetconfMessage("netconfMessages/getConfig.xml");
                 NetconfMessage result = netconfClient.sendRequest(getMessage).get();
-                logger.info("Client with session id {}: got result {}", sessionId, result);
+                LOG.info("Client with session id {}: got result {}", sessionId, result);
 
                 Preconditions.checkState(NetconfMessageUtil.isErrorMessage(result) == false,
                         "Received error response: " + XmlUtil.toString(result.getDocument()) + " to request: "
                                 + XmlUtil.toString(getMessage.getDocument()));
 
                 netconfClient.close();
-                logger.info("Client with session id {}: ended", sessionId);
+                LOG.info("Client with session id {}: ended", sessionId);
             } catch (final Exception e) {
                 throw new IllegalStateException(Thread.currentThread().getName(), e);
             }
index 42bd033c712d22daf600322680739b1f7b9f2b10..ecc33ca90fd05f5392d6173c6d88cd4a7a36128c 100644 (file)
@@ -12,14 +12,13 @@ import io.netty.channel.ChannelFuture;
 import io.netty.channel.EventLoopGroup;
 import io.netty.channel.nio.NioEventLoopGroup;
 import io.netty.util.HashedWheelTimer;
+import java.lang.management.ManagementFactory;
+import java.net.InetSocketAddress;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.controller.netconf.impl.osgi.NetconfOperationServiceFactoryListenerImpl;
 
-import java.lang.management.ManagementFactory;
-import java.net.InetSocketAddress;
-
 public class NetconfDispatcherImplTest {
 
     private EventLoopGroup nettyGroup;
index 21250357994644a7bafa0940acc880a802c43a0f..395e5c03384abad0e988789d5bf5d42f8db42d9c 100644 (file)
@@ -8,6 +8,17 @@
 
 package org.opendaylight.controller.netconf.impl;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
 import com.google.common.base.Optional;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
@@ -18,8 +29,6 @@ import org.junit.Test;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.opendaylight.controller.netconf.api.monitoring.NetconfManagementSession;
-import org.opendaylight.controller.netconf.impl.NetconfServerSession;
-import org.opendaylight.controller.netconf.impl.NetconfServerSessionListener;
 import org.opendaylight.controller.netconf.impl.osgi.NetconfMonitoringServiceImpl;
 import org.opendaylight.controller.netconf.mapping.api.Capability;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider;
@@ -27,11 +36,6 @@ import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceSnapshot;
 import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.*;
-
 public class NetconfMonitoringServiceImplTest {
 
     private NetconfMonitoringServiceImpl service;
index 51dfa4b1a8df3ed9a785c468ec38b8ddfc5136f7..b925295e74a8ec86e8b235a48f691c2222d82aa8 100644 (file)
@@ -29,7 +29,7 @@ import org.xml.sax.SAXException;
 
 @RunWith(value = Parameterized.class)
 public class SubtreeFilterTest {
-    private static final Logger logger = LoggerFactory.getLogger(SubtreeFilterTest.class);
+    private static final Logger LOG = LoggerFactory.getLogger(SubtreeFilterTest.class);
 
     private final int directoryIndex;
 
@@ -57,7 +57,7 @@ public class SubtreeFilterTest {
         Document preFilterDocument = getDocument("pre-filter.xml");
         Document postFilterDocument = getDocument("post-filter.xml");
         Document actualPostFilterDocument = SubtreeFilter.applySubtreeFilter(requestDocument, preFilterDocument);
-        logger.info("Actual document: {}", XmlUtil.toString(actualPostFilterDocument));
+        LOG.info("Actual document: {}", XmlUtil.toString(actualPostFilterDocument));
         Diff diff = XMLUnit.compareXML(postFilterDocument, actualPostFilterDocument);
         assertTrue(diff.toString(), diff.similar());
 
index d6b0201ab88a0245e666b4bb7fe2e77552a0075b..d82c1484e49e2f4786c5ac3ee7ddca51d6a3b95d 100644 (file)
@@ -8,14 +8,15 @@
 
 package org.opendaylight.controller.netconf.impl.mapping.operations;
 
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+
 import org.junit.Test;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.util.xml.XmlElement;
 import org.opendaylight.controller.netconf.util.xml.XmlUtil;
 import org.w3c.dom.Document;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.mock;
 
 public class DefaultCloseSessionTest {
     @Test
index 98050de565c868a8e234da1c20757a52b1e1a81f..15aeb8d27c8badbafa64db0a7614174ce7155ceb 100644 (file)
@@ -8,6 +8,16 @@
 
 package org.opendaylight.controller.netconf.impl.mapping.operations;
 
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.anySetOf;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
 import com.google.common.collect.Sets;
 import org.junit.Before;
 import org.junit.Test;
@@ -22,8 +32,6 @@ import org.opendaylight.controller.netconf.util.xml.XmlUtil;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import static org.mockito.Mockito.*;
-
 public class DefaultCommitTest {
 
     private NetconfOperationChainedExecution operation;
index 4218176f1d8ff7297f769c9c0f097287c5ae24a8..4ca50f6a1cb1aaeb92ea65d6a5313270fb95e18a 100644 (file)
@@ -14,6 +14,7 @@ import static org.mockito.Matchers.anyString;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
+
 import com.google.common.base.Optional;
 import org.junit.Before;
 import org.junit.Test;
index b335165706e137ae2fd840a90c988c38b88329a7..c06e78aa997cfaafdc5dd2624d784a33bb047364 100644 (file)
@@ -8,6 +8,14 @@
 
 package org.opendaylight.controller.netconf.impl.mapping.operations;
 
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelPipeline;
@@ -17,9 +25,6 @@ import org.opendaylight.controller.netconf.util.xml.XmlElement;
 import org.opendaylight.controller.netconf.util.xml.XmlUtil;
 import org.w3c.dom.Document;
 
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Mockito.*;
-
 public class DefaultStopExiTest {
     @Test
     public void testHandleWithNoSubsequentOperations() throws Exception {
index fd9295a4b365fe7908b8a330cd205ae5ba2fa62c..413c9cc9452334640e3aab9269def616e99b1ff3 100644 (file)
@@ -8,6 +8,13 @@
 
 package org.opendaylight.controller.netconf.impl.osgi;
 
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
 import java.util.Arrays;
 import java.util.Dictionary;
 import org.junit.Before;
@@ -20,13 +27,6 @@ import org.osgi.framework.ServiceListener;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.anyString;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
 public class NetconfImplActivatorTest {
 
     @Mock
index 0d7158aa21de7fc02d69d85697f6031abbba6cfa..d744504bb2aa4160dfb6b57229a29e2623cad864 100644 (file)
@@ -8,6 +8,14 @@
 
 package org.opendaylight.controller.netconf.impl.osgi;
 
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mock;
@@ -17,10 +25,6 @@ import org.osgi.framework.BundleContext;
 import org.osgi.framework.Filter;
 import org.osgi.framework.ServiceReference;
 
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.*;
-
 public class NetconfOperationServiceFactoryTrackerTest {
 
     @Mock
index 6512b4bd334e298785712dafb234993425fc00b8..946654e60e6b009a0fe4b7a639edc31c36363d2f 100644 (file)
@@ -8,6 +8,13 @@
 
 package org.opendaylight.controller.netconf.impl.util;
 
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.anyObject;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.ChannelHandlerContext;
@@ -15,8 +22,6 @@ import io.netty.util.concurrent.GenericFutureListener;
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.mockito.Mockito.*;
-
 public class DeserializerExceptionHandlerTest {
 
     private DeserializerExceptionHandler handler;
index bd931c33d0212858b615aed61d843e1e6f1744d9..a724d1d9c5e4e8b6cec46cdb94f98a7158c48407 100644 (file)
@@ -78,9 +78,11 @@ public abstract class AbstractNetconfConfigTest extends AbstractConfigTest {
     public static final String LOOPBACK_ADDRESS = "127.0.0.1";
     public static final int SERVER_CONNECTION_TIMEOUT_MILLIS = 5000;
 
-    static ModuleFactory[] FACTORIES = { new TestImplModuleFactory(),
-            new DepTestImplModuleFactory(), new NetconfTestImplModuleFactory(),
-            new IdentityTestModuleFactory(), new MultipleDependenciesModuleFactory() };
+    static ModuleFactory[] FACTORIES = {new TestImplModuleFactory(),
+                                        new DepTestImplModuleFactory(),
+                                        new NetconfTestImplModuleFactory(),
+                                        new IdentityTestModuleFactory(),
+                                        new MultipleDependenciesModuleFactory() };
 
     private EventLoopGroup nettyThreadgroup;
     private HashedWheelTimer hashedWheelTimer;
index a9558c06cdcd34472315c9ac80019e55dbb98b71..463b5f045efa9ea1f34a3694198ecc7e26fdd937 100644 (file)
@@ -72,17 +72,17 @@ public class NetconfITMonitoringTest extends AbstractNetconfConfigTest {
         return TCP_ADDRESS;
     }
 
-    static SessionMonitoringService getNetconfMonitoringListenerService(final Logger logger, final NetconfMonitoringServiceImpl monitor) {
+    static SessionMonitoringService getNetconfMonitoringListenerService(final Logger LOG, final NetconfMonitoringServiceImpl monitor) {
         return new SessionMonitoringService() {
             @Override
             public void onSessionUp(final NetconfManagementSession session) {
-                logger.debug("Management session up {}", session);
+                LOG.debug("Management session up {}", session);
                 monitor.onSessionUp(session);
             }
 
             @Override
             public void onSessionDown(final NetconfManagementSession session) {
-                logger.debug("Management session down {}", session);
+                LOG.debug("Management session down {}", session);
                 monitor.onSessionDown(session);
             }
         };
index f76bf4f4c37ebf96c99ba0eeccc90c9280f773da..56015b962519a9fd4945e81a7875f1beb062da0f 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.controller.netconf.it;
 
+import com.google.common.base.Preconditions;
 import java.io.IOException;
 import java.io.InputStream;
 import java.security.KeyManagementException;
@@ -15,13 +16,10 @@ import java.security.KeyStoreException;
 import java.security.NoSuchAlgorithmException;
 import java.security.UnrecoverableKeyException;
 import java.security.cert.CertificateException;
-
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.TrustManagerFactory;
 
-import com.google.common.base.Preconditions;
-
 public final class SSLUtil {
 
     private SSLUtil() {}
index 3b3f71b0ed0f3aad635d88d6b0bb93a3e4229aa3..6ab3cd4b6e638999ed9fa1787b8b3b8652e09422 100644 (file)
@@ -24,7 +24,7 @@ import org.w3c.dom.Element;
 
 public class Get extends AbstractNetconfOperation {
 
-    private static final Logger logger = LoggerFactory.getLogger(Get.class);
+    private static final Logger LOG = LoggerFactory.getLogger(Get.class);
     private final NetconfMonitoringService netconfMonitor;
 
     public Get(final NetconfMonitoringService netconfMonitor) {
@@ -72,7 +72,7 @@ public class Get extends AbstractNetconfOperation {
             return innerResult;
         } catch (final RuntimeException e) {
             final String errorMessage = "Get operation for netconf-state subtree failed";
-            logger.warn(errorMessage, e);
+            LOG.warn(errorMessage, e);
 
             throw new NetconfDocumentedException(errorMessage, NetconfDocumentedException.ErrorType.application,
                     NetconfDocumentedException.ErrorTag.operation_failed,
index 9d332c644029ff3c26a2725703e4b348ff046cf0..1411350cd3dce0fec1d4854e3eeabe580c4aef4d 100644 (file)
@@ -16,7 +16,7 @@ import org.slf4j.LoggerFactory;
 
 public class NetconfMonitoringActivator implements BundleActivator {
 
-    private static final Logger logger = LoggerFactory.getLogger(NetconfMonitoringActivator.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfMonitoringActivator.class);
 
     private NetconfMonitoringServiceTracker monitor;
 
@@ -32,7 +32,7 @@ public class NetconfMonitoringActivator implements BundleActivator {
             try {
                 monitor.close();
             } catch (Exception e) {
-                logger.warn("Ignoring exception while closing {}", monitor, e);
+                LOG.warn("Ignoring exception while closing {}", monitor, e);
             }
         }
     }
index f99ae54e6dafac6e9ea01f36e85ab46261d9ce67..0b4d1c2688d64307b51815b0d3b441f0ff9722ec 100644 (file)
@@ -20,7 +20,7 @@ import org.slf4j.LoggerFactory;
 
 public class NetconfMonitoringServiceTracker extends ServiceTracker<NetconfMonitoringService, NetconfMonitoringService> {
 
-    private static final Logger logger = LoggerFactory.getLogger(NetconfMonitoringServiceTracker.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfMonitoringServiceTracker.class);
 
     private ServiceRegistration<NetconfOperationServiceFactory> reg;
 
@@ -51,7 +51,7 @@ public class NetconfMonitoringServiceTracker extends ServiceTracker<NetconfMonit
             try {
                 reg.unregister();
             } catch (final Exception e) {
-                logger.warn("Ignoring exception while unregistering {}", reg, e);
+                LOG.warn("Ignoring exception while unregistering {}", reg, e);
             }
         }
     }
index 962ad17b66c280c5e7fb68cfc279ff30d79c2285..45f02af78994d1e87b8dc1c86c7b81e7e57d9f1a 100644 (file)
@@ -7,14 +7,13 @@
  */
 package org.opendaylight.controller.netconf.monitoring.xml;
 
-import org.opendaylight.controller.netconf.monitoring.xml.model.NetconfState;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Marshaller;
 import javax.xml.transform.dom.DOMResult;
+import org.opendaylight.controller.netconf.monitoring.xml.model.NetconfState;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
 
 public class JaxBSerializer {
 
@@ -29,7 +28,7 @@ public class JaxBSerializer {
             res = new DOMResult();
             marshaller.marshal(monitoringModel, res);
         } catch (final JAXBException e) {
-           throw new RuntimeException("Unable to serialize netconf state " + monitoringModel, e);
+            throw new RuntimeException("Unable to serialize netconf state " + monitoringModel, e);
         }
         return ((Document)res.getNode()).getDocumentElement();
     }
index 16b38eca5172a96a6254713dbefb6dbd44324949..259fd73197b44d32b758720f775d7573e36df4a5 100644 (file)
@@ -11,13 +11,12 @@ package org.opendaylight.controller.netconf.monitoring.xml.model;
 import com.google.common.base.Function;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Collections2;
+import java.util.Collection;
 import javax.annotation.Nonnull;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.Yang;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.schemas.Schema;
-
 import javax.annotation.Nullable;
 import javax.xml.bind.annotation.XmlElement;
-import java.util.Collection;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.Yang;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.schemas.Schema;
 
 final class MonitoringSchema {
 
index 8685ef72208b15fd77845b7486724846d67780a4..c70db895bf19300be20d30e2d1b1b4ababbdccd0 100644 (file)
@@ -7,10 +7,9 @@
  */
 package org.opendaylight.controller.netconf.monitoring.xml.model;
 
+import com.google.common.base.Joiner;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlTransient;
-
-import com.google.common.base.Joiner;
 import org.opendaylight.controller.netconf.monitoring.MonitoringConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.extension.rev131210.Session1;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.sessions.Session;
index 8f5a1c029d8611b9f75c7b4570fc63002d9f1e18..58f5b1897b4f0d67d4544f9048b3afb60d05baca 100644 (file)
@@ -9,6 +9,11 @@ package org.opendaylight.controller.netconf.monitoring.xml.model;
 
 import com.google.common.base.Function;
 import com.google.common.collect.Collections2;
+import java.util.Collection;
+import javax.annotation.Nullable;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
 import org.opendaylight.controller.netconf.api.monitoring.NetconfMonitoringService;
 import org.opendaylight.controller.netconf.monitoring.MonitoringConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Schemas;
@@ -16,12 +21,6 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.mon
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.schemas.Schema;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.sessions.Session;
 
-import javax.annotation.Nullable;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Collection;
-
 @XmlRootElement(name = MonitoringConstants.NETCONF_MONITORING_XML_ROOT_ELEMENT)
 public final class NetconfState {
 
index a96c3a3836e55309751011af56bcea32f39d069a..1e510d4ed0395117e2be2406ae627fb00a2bb919 100644 (file)
@@ -15,8 +15,7 @@
 )
 package org.opendaylight.controller.netconf.monitoring.xml.model;
 
-import org.opendaylight.controller.netconf.monitoring.MonitoringConstants;
-
 import javax.xml.bind.annotation.XmlNs;
 import javax.xml.bind.annotation.XmlNsForm;
-import javax.xml.bind.annotation.XmlSchema;
\ No newline at end of file
+import javax.xml.bind.annotation.XmlSchema;
+import org.opendaylight.controller.netconf.monitoring.MonitoringConstants;
\ No newline at end of file
index b5b9f3c060f5bdf6c98abf832c256ab894ad95c2..6664f3e733bc399bd08d710dfbed882a36baa24e 100644 (file)
@@ -14,6 +14,7 @@ import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
+
 import java.util.Arrays;
 import org.junit.Before;
 import org.junit.Test;
index b8e35e934b23dc8c064eebe809be12320f488aee..74e6747ab79608b9c13fefd37348d0e3e18555e4 100644 (file)
@@ -8,14 +8,14 @@
 
 package org.opendaylight.controller.netconf.monitoring.osgi;
 
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+
 import com.google.common.base.Optional;
 import org.junit.Test;
 import org.opendaylight.controller.netconf.api.monitoring.NetconfMonitoringService;
 import org.opendaylight.controller.netconf.monitoring.MonitoringConstants;
 
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-
 public class NetconfMonitoringOperationServiceTest {
     @Test
     public void testGetters() throws Exception {
index b992b0e44f363deaba01eeca50d9194d40fefc81..de716ccf6635e9a0eebb1c312170cc02658a21cd 100644 (file)
@@ -9,11 +9,12 @@
 package org.opendaylight.controller.netconf.monitoring.osgi;
 
 import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.anyString;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
+
 import java.util.Hashtable;
 import org.junit.Before;
 import org.junit.Test;