Remove CSS code JIRA: TSC-111 Change-Id: Ib74c1d3dfc029c2472b8834ae55ce05c8231d225 Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Adjust to yangtools-2.0.0 changes Change-Id: Ib86747e5ed19c0c00bb46b8d7e4936f4d90c4364 Signed-off-by: Robert Varga <robert.varga@pantheon.tech> Signed-off-by: Stephen Kitt <skitt@redhat.com>
Fix checkstyle reported by odlparent-3.0.0 Change-Id: I08c548fbbbef8527ad7b037b0def33d3c1c09bf6 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Remove explicit default super-constructor calls The default constructor is called by default (hence its name), no need to call it explicitly. Change-Id: I0f4ac3bf4a1d582b7a9d50beeaa1de6d2f107499 Signed-off-by: David Suarez <david.suarez.fuentes@gmail.com>
String performance and maintenability Use StringBuilder for strings built in loops. Use plain concatenation for string construction not involving loops. Change-Id: I8299eb54a347d132f0d19dfb39c8fb52366049f2 Signed-off-by: Stephen Kitt <skitt@redhat.com>
Fix checkstyle issues to enforce it Fix checkstyle issues to enforce it. Change-Id: I6e876b21f092b6d10e6f9ee1304ddf5a535dcb13 Signed-off-by: David Suarez <david.suarez.fuentes@gmail.com>
Simplify code with new Map features This is mostly computeIfAbsent to replace the “get, if null, initialise and put” pattern. Change-Id: Ie866025c3a6d5099f6f5494ab9d4437d7e9d2320 Signed-off-by: Stephen Kitt <skitt@redhat.com>
StringBuffer cleanup This patch cleans up StringBuffer use, mostly replacing StringBuffer with StringBuilder or plain String concatenation for short sequences (or constants). * HexEncode: additionally, avoid using a separate return variable, drop the useless ":" handling in bytesToHexString(), and add the test class from l2switch. * HardcodedModuleFactoriesResolver: rework the conflicting module handling. Change-Id: Id76e91bba9ce40bd8ed5947c2d40e3a7baf0a949 Signed-off-by: Stephen Kitt <skitt@redhat.com>
config-api: final parameters This automatically-generated patch flags all appropriate parameters as final (including caught exceptions). Change-Id: If0dfb559a3d27e6d54af29ad7f3f1796d5d4ffd4 Signed-off-by: Stephen Kitt <skitt@redhat.com>
Fixup Typos in Comments - Fix typos - Fix duplicate words Change-Id: I33eb78183fbc56e4d7c574e486b7f811dd846b18 Signed-off-by: Shrenik Jain <shrenik.jain@research.iiit.ac.in>
Fix javadocs and enable doclint This eliminates the doclint suppression and fixes up javadoc, so they work with Java 8 out of the box. Change-Id: I7294f0dcd570e3e3c445e54cc8989078175d05d7 Signed-off-by: Robert Varga <rovarga@cisco.com>
Mechanical code cleanup (config) * Remove unnecessary type specifiers (use Java 7 <>) * Remove unnecessary "extends Object" declarations * Remove unnecessary semi-colons * Merge identical catch blocks * Remove redundant modifiers: - enum constructors are private by default - interface properties are public static final by default - interface methods are public abstract by default - interfaces are abstract by default - inner interfaces are static by default - inner classes in interfaces are public static by default Change-Id: Iefd8363a5eb120fdd43a4632b9e3db0e7e347dba Signed-off-by: Stephen Kitt <skitt@redhat.com>
Add config system API to recreate a module instance For the blueprint work, I need to be able to restart/recreate a config module, ie close the previous instance and create a new instance, when the corresponding service instance is recreated/re-advertised via blueprint container restart. The ConfigSubsystemFacade has no API to restart a config module. One can push a new configuration but there has to be an actual change in order for a new instance to be created otherwise it reuses the prior instance. Therefore I added a new EditStrategyType enum, recreate, with a corresponding EditConfigStrategy class that forces re-creation of a config module instance. This strategy calls a new method, reCreateModule, on the ConfigTransactionController interface. The decision logic to reuse or create a new instance is in the AbstractModule class and generated derived classes. Therefore the reCreateModule method sets a canReuseInstance flag on the real AbstractModule instance. This is probably not the cleanest approach but I wanted to avoid changing the Module interface as that looked to be too invasive. The AbstractModule getInstance and canReuse methods check the canReuseInstance override flag to determine if the old module/instance can be reused. Change-Id: I8cfb8408bae0127331676dcf32519b176f0a8844 Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Modify config Module impls to co-exist with blueprint Modified various config system Module implementation classes which have corresponding instances created and advertised via blueprint to obtain the instance in createInstance from the OSGi registry. The instance may not be available yet so it will wait. I added a WaitingServiceTracker class to encapsulate this logic using a ServiceTracker. For those modules that don't advertise services, createInstance simply returns a noop AutoCloseable since the components are created via blueprint. I also added the new disable-osgi-service-registration flag to the corresponding service yang identities to prevent the CSS from duplicating the service registrations. This patch also adds the blueprint bundle to the mdsal features and "turns on" blueprint. Change-Id: I60099c82a2a248fc233ad930c4808d6ab19ea881 Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Add registerToOsgi flag to ServiceInterfaceAnnotation Added a flag to the ServiceInterfaceAnnotation to allow disabling OSGi service registration. This is needed for blueprint bundles that have already registered the service and also need to create the module and service in the config system for compatibility support. Change-Id: Ic12d2cdcf6de77ee043a708c76502f8bc36a4717 Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
BUG-4514: clear oldModule/oldInstance when no longer needed When we acquire a new instance we no longer need the old module nor instance. Failing to clear these references leads to slow memory leak, as we retain the complete history of modules as transactions are being made. Change-Id: I42899176d335e5f6ac66ecb1dfe080c4dd14ab2a Signed-off-by: Robert Varga <rovarga@cisco.com>
Fix ModuleFactory not found errors https://git.opendaylight.org/gerrit/#/c/27874/ improvements to the config system but had the side-effect of introducing timing issues where a ModuleFactory wasn't found when trying to push a config. The reason is that yang schemas load earlier and much quicker than ModuleFactory's, which are scanned from ACTIVE bundles, so the capabilities may resolve but a ModuleFactory may not be available yet. As a result, that patch was partially reverted for the time being. To fix the missing ModuleFactory issue, I added retries in the ConfigPusherImpl when a ModuleFactory isn't found, similar to the ConflictingVersionException retries. The backend now throws a new checked exception, ModuleFactoryNotFoundException, which is caught to trigger a retry after a delay. Prior, it threw an InstanceNotFoundException which was wrapped in an IllegalArgumentException. I didn't keep the InstanceNotFoundException b/c it can be thrown for other reasons and I wanted to distinguish missing ModuleFactoryNotFoundException. I derived ModuleFactoryNotFoundException from RuntimeException to avoid having to change signatures in the call chain and thus changing the API. Prior it threw an unchecked IllegalArgumentException anyway so it's consistent plus other areas of the code throw unchecked exceptions along with checked exceptions. Since the missing ModuleFactory issue is fixed, I re-enabled scanning of RESOLVED bundles in the ModuleInfoBundleTracker. Change-Id: I89ff346c0a89afdfa76ce402f2cf3211ac68b5c0 Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Decouple config and netconf subsystems. Extract a common mapping for config pusher and config subsystem netconf Add a ConfigPersisterFacade for XML that allows reads/writes from/to config subsystem using XML format Push notifications from YangStoreService to NetconfNotificationManager instead of using custom listeners Migrate netconf features from controller features, untangle features Change-Id: I71e4ca6e0258e0b1f0d6c19119f93eb9d68b7bca Signed-off-by: Tomas Cere <tcere@cisco.com> Signed-off-by: Maros Marsalek <mmarsale@cisco.com> Signed-off-by: Ed Warnicke <hagbard@gmail.com>