+++ /dev/null
-/*
- * 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.sal.binding.api;
-
-import org.osgi.framework.BundleContext;
-
-@Deprecated
-public abstract class AbstractBindingAwareConsumer extends AbstractBrokerAwareActivator implements BindingAwareConsumer {
-
- @Override
- protected final void onBrokerAvailable(final BindingAwareBroker broker, final BundleContext context) {
- broker.registerConsumer(this);
- }
-
- /**
- * Called when this bundle is started (before
- * {@link #onSessionInitialized(org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext)}
- * so the Framework can perform the bundle-specific activities necessary to start this bundle.
- * This method can be used to register services or to allocate any resources that this bundle
- * needs.
- *
- * <p>
- * This method must complete and return to its caller in a timely manner.
- *
- * @param context The execution context of the bundle being started.
- * @throws Exception If this method throws an exception, this bundle is marked as stopped and
- * the Framework will remove this bundle's listeners, unregister all services registered
- * by this bundle, and release all services used by this bundle.
- */
- @Override
- protected void startImpl(final BundleContext context) throws Exception {
- // NOOP
- }
-}
+++ /dev/null
-/*
- * 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.sal.binding.api;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.osgi.framework.BundleContext;
-
-@Deprecated
-public abstract class AbstractBindingAwareProvider extends AbstractBrokerAwareActivator implements BindingAwareProvider {
-
- @Override
- protected final void onBrokerAvailable(final BindingAwareBroker broker, final BundleContext context) {
- final ProviderContext ctx = broker.registerProvider(this);
- }
-
- /**
- * Called when this bundle is started (before {@link #onSessionInitiated(ProviderContext)} so
- * the Framework can perform the bundle-specific activities necessary to start this bundle. This
- * method can be used to register services or to allocate any resources that this bundle needs.
- *
- * <p>
- * This method must complete and return to its caller in a timely manner.
- *
- * @param context The execution context of the bundle being started.
- * @throws Exception If this method throws an exception, this bundle is marked as stopped and
- * the Framework will remove this bundle's listeners, unregister all services registered
- * by this bundle, and release all services used by this bundle.
- */
- @Override
- protected void startImpl(final BundleContext context) throws Exception {
- // NOOP
- }
-}
+++ /dev/null
-/*
- * 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.binding.api;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTracker;
-import org.osgi.util.tracker.ServiceTrackerCustomizer;
-
-public abstract class AbstractBrokerAwareActivator implements BundleActivator {
-
- private static final ExecutorService mdActivationPool = Executors.newCachedThreadPool();
- private BundleContext context;
- private ServiceTracker<BindingAwareBroker, BindingAwareBroker> tracker;
- private BindingAwareBroker broker;
- private final ServiceTrackerCustomizer<BindingAwareBroker, BindingAwareBroker> customizer = new ServiceTrackerCustomizer<BindingAwareBroker, BindingAwareBroker>() {
-
- @Override
- public BindingAwareBroker addingService(final ServiceReference<BindingAwareBroker> reference) {
- broker = context.getService(reference);
- mdActivationPool.execute(new Runnable() {
-
- @Override
- public void run() {
- onBrokerAvailable(broker, context);
- }
- });
- return broker;
- }
-
- @Override
- public void modifiedService(final ServiceReference<BindingAwareBroker> reference, final BindingAwareBroker service) {
- removedService(reference, service);
- addingService(reference);
- }
-
- @Override
- public void removedService(final ServiceReference<BindingAwareBroker> reference, final BindingAwareBroker service) {
- broker = context.getService(reference);
- mdActivationPool.execute(new Runnable() {
-
- @Override
- public void run() {
- onBrokerRemoved(broker, context);
- }
- });
- }
-
- };
-
-
- @Override
- public final void start(final BundleContext context) throws Exception {
- this.context = context;
- startImpl(context);
- tracker = new ServiceTracker<>(context, BindingAwareBroker.class, customizer);
- tracker.open();
-
- }
-
-
-
- @Override
- public final void stop(final BundleContext context) throws Exception {
- tracker.close();
- stopImpl(context);
- }
-
- protected void startImpl(final BundleContext context) throws Exception {
- // NOOP
- }
-
- /**
- * Called when this bundle is stopped so the Framework can perform the
- * bundle-specific activities necessary to stop the bundle. In general, this
- * method should undo the work that the {@code BundleActivator.start} method
- * started. There should be no active threads that were started by this
- * bundle when this bundle returns. A stopped bundle must not call any
- * Framework objects.
- *
- * <p>
- * This method must complete and return to its caller in a timely manner.
- *
- * @param context The execution context of the bundle being stopped.
- */
- protected void stopImpl(final BundleContext context) {
- // NOOP
- }
-
-
- protected abstract void onBrokerAvailable(BindingAwareBroker broker, BundleContext context);
-
- protected void onBrokerRemoved(final BindingAwareBroker broker, final BundleContext context) {
- stopImpl(context);
- }
-}
+++ /dev/null
-/*
- * 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.sal.binding.api;
-
-
-
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
-
-import org.opendaylight.yangtools.concepts.ObjectRegistration;
-import org.opendaylight.yangtools.yang.binding.BaseIdentity;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.RpcService;
-
-/**
- * Binding-aware core of the SAL layer responsible for wiring the SAL consumers.
- *
- * The responsibility of the broker is to maintain registration of SAL functionality
- * {@link BindingAwareConsumer}s and {@link BindingAwareProvider}s, store provider and consumer
- * specific context and functionality registration via
- * {@link org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext} and
- * provide access to infrastructure services, which removes direct dependencies between providers
- * and consumers.
- *
- * The Binding-aware broker is also responsible for translation from Java classes modeling the
- * functionality and data to binding-independent form which is used in SAL Core.
- *
- *
- * <h3>Infrastructure services</h3> Some examples of infrastructure services: The services are
- * exposed via session.
- *
- * <h3>Session-based access</h3>
- *
- * The providers and consumers needs to register in order to use the binding-independent SAL layer
- * and to expose functionality via SAL layer.
- *
- * For more information about session-based access see
- * {@link org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext} and
- * {@link ProviderContext}
- */
-public interface BindingAwareBroker {
-
- /**
- * Registers the {@link BindingAwareConsumer}, which will use the SAL layer.
- *
- * <p>
- * Note that consumer could register additional functionality at later point by using service
- * and functionality specific APIs.
- *
- * <p>
- * The consumer is required to use returned session for all communication with broker or one of
- * the broker services. The session is announced to the consumer by invoking
- * {@link BindingAwareConsumer#onSessionInitialized(org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext)}.
- *
- * @param consumer Consumer to be registered.
- * @return a session specific to consumer registration
- * @throws IllegalArgumentException If the consumer is <code>null</code>.
- * @throws IllegalStateException If the consumer is already registered.
- */
- ConsumerContext registerConsumer(BindingAwareConsumer consumer);
-
- /**
- * Registers the {@link BindingAwareProvider}, which will use the SAL layer.
- *
- * <p>
- * Note that provider could register additional functionality at later point by using service
- * and functionality specific APIs.
- *
- * <p>
- * The consumer is <b>required to use</b> returned session for all communication with broker or
- * one of the broker services. The session is announced to the consumer by invoking
- * {@link BindingAwareProvider#onSessionInitiated(ProviderContext)}.
- *
- *
- * @param provider Provider to be registered.
- * @return a session unique to the provider registration.
- * @throws IllegalArgumentException If the provider is <code>null</code>.
- * @throws IllegalStateException If the consumer is already registered.
- */
- ProviderContext registerProvider(BindingAwareProvider provider);
-
- /**
- * {@link BindingAwareConsumer} specific access to the SAL functionality.
- *
- * <p>
- * ConsumerSession is {@link BindingAwareConsumer}-specific access to the SAL functionality and
- * infrastructure services.
- *
- * <p>
- * The session serves to store SAL context (e.g. registration of functionality) for the consumer
- * and provides access to the SAL infrastructure services and other functionality provided by
- * providers.
- */
- public interface ConsumerContext extends RpcConsumerRegistry {
-
- /**
- * Returns a session specific instance (implementation) of requested
- * binding-aware infrastructural service
- *
- * @param service
- * Broker service
- * @return Session specific implementation of service
- */
- <T extends BindingAwareService> T getSALService(Class<T> service);
- }
-
- /**
- * {@link BindingAwareProvider} specific access to the SAL functionality.
- *
- * <p>
- * ProviderSession is {@link BindingAwareProvider}-specific access to the
- * SAL functionality and infrastructure services, which also allows for
- * exposing the provider's functionality to the other
- * {@link BindingAwareConsumer}s.
- *
- * <p>
- * The session serves to store SAL context (e.g. registration of
- * functionality) for the providers and exposes access to the SAL
- * infrastructure services, dynamic functionality registration and any other
- * functionality provided by other {@link BindingAwareConsumer}s.
- *
- */
- public interface ProviderContext extends ConsumerContext, RpcProviderRegistry {
-
- }
-
- /**
- * Represents an RPC implementation registration. Users should call the
- * {@link ObjectRegistration#close close} method when the registration is no longer needed.
- *
- * @param <T> the implemented RPC service interface
- */
- public interface RpcRegistration<T extends RpcService> extends ObjectRegistration<T> {
-
- /**
- * Returns the implemented RPC service interface.
- */
- Class<T> getServiceType();
-
- @Override
- void close();
- }
-
- /**
- * Represents a routed RPC implementation registration. Users should call the
- * {@link RpcRegistration#close() close} method when the registration is no longer needed.
- *
- * @param <T> the implemented RPC service interface
- */
- public interface RoutedRpcRegistration<T extends RpcService> extends RpcRegistration<T> {
-
- /**
- * Register particular instance identifier to be processed by this
- * RpcService
- *
- * @param context
- * @param instance
- */
- void registerPath(Class<? extends BaseIdentity> context, InstanceIdentifier<?> instance);
-
- /**
- * Unregister particular instance identifier to be processed by this
- * RpcService
- *
- * @param context
- * @param instance
- */
- void unregisterPath(Class<? extends BaseIdentity> context, InstanceIdentifier<?> instance);
- }
-}
+++ /dev/null
-/*
- * 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.sal.binding.api;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
-
-/**
-*
-* A developer implemented component that gets registered with the Broker.
-*
-*/
-public interface BindingAwareConsumer {
-
- /**
- * Callback signaling initialization of the consumer session to the SAL.
- *
- * The consumer MUST use the session for all communication with SAL or
- * retrieving SAL infrastructure services.
- *
- * This method is invoked by
- * {@link BindingAwareBroker#registerConsumer(BindingAwareConsumer)}
- *
- * @param session
- * Unique session between consumer and SAL.
- */
- void onSessionInitialized(ConsumerContext session);
-
-}
+++ /dev/null
-/*
- * 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.sal.binding.api;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-
-/**
- *
- * A developer implemented component that gets registered with the Broker.
- *
- * Semantically, a provider may:
- *
- * <ol>
- * <li>Emit Notifications</li>
- * <li>Provide the implementation of RPCs</li>
- * <li>Write to the operational data tree</li>
- * </ol>
- *
- *
- * <p>
- *
- * In addition, a BindingAwareProvider can in pursuit of its goals:
- *
- * <ol>
- * <li>Subscribe for Notifications</li>
- * <li>Invoke RPCs</li>
- * <li>Read from either the operational or config data tree</li>
- * <li>Write to the config data tree</li>
- * </ol>
- * (All of the above are things a Consumer can also do).
- *
- * <p>
- *
- * Examples:
- *
- * <p>
- *
- * To get a NotificationService:
- *
- * <pre>
- * {code
- * public void onSessionInitiated(ProviderContext session) {
- * NotificationProviderService notificationService = session.getSALService(NotificationProviderService.class);
- * }
- * }
- * </pre>
- *
- *
- *
- * To register an RPC implementation:
- *
- * <pre>
- * {code
- * public void onSessionInitiated(ProviderContext session) {
- * RpcRegistration<MyService> registration = session.addRpcImplementation(MyService.class, myImplementationInstance);
- * }
- * }
- * </pre>
- *
- * <p>
- *
- * Where MyService.class is a Service interface generated from a yang model with RPCs modeled in it
- * and myImplementationInstance is an instance of a class that implements MyService.
- *
- * To register a Routed RPC Implementation:
- *
- * <pre>
- * {code
- * public void onSessionInitiated(ProviderContext session) {
- * RoutedRpcRegistration<SalFlowService> flowRegistration = session.addRoutedRpcImplementation(SalFlowService.class, salFlowServiceImplementationInstance);
- * flowRegistration.registerPath(NodeContext.class, nodeInstanceId);
- * }
- * }
- * </pre>
- *
- * Where SalFlowService.class is a Service interface generated from a yang model with RPCs modeled
- * in it and salFlowServiceImplementationInstance is an instance of a class that implements
- * SalFlowService.
- * <p>
- * The line:
- *
- * <pre>
- * {code
- * flowRegistration.registerPath(NodeContext.class, nodeInstanceId);
- * }
- * </pre>
- *
- * Is indicating that the RPC implementation is registered to handle RPC invocations that have their
- * NodeContext pointing to the node with instance id nodeInstanceId. This bears a bit of further
- * explanation. RoutedRPCs can be 'routed' to an implementation based upon 'context'. 'context' is a
- * pointer (instanceId) to some place in the data tree. In this example, the 'context' is a pointer
- * to a Node. In this way, a provider can register its ability to provide a service for a particular
- * Node, but not *all* Nodes. The Broker routes the RPC by 'context' to the correct implementation,
- * without the caller having to do extra work. Because of this when a RoutedRPC is registered, it
- * needs to also be able to indicate for which 'contexts' it is providing an implementation.
- *
- * An example of a Routed RPC would be an updateFlow(node, flow) that would be routed based on node
- * to the provider which had registered to provide it *for that node*.
- *
- * <p>
- *
- * To get a DataBroker to allow access to the data tree:
- *
- * <pre>
- * {code
- * public void onSessionInitiated(final ProviderContext session) {
- * DataBroker databroker = session.getSALService(BindingDataBroker.class);
- * }
- * }
- * </pre>
- *
- *
- */
-public interface BindingAwareProvider {
-
- /**
- * Callback signaling initialization of the consumer session to the SAL.
- *
- * The consumer MUST use the session for all communication with SAL or retrieving SAL
- * infrastructure services.
- *
- * This method is invoked by {@link BindingAwareBroker#registerProvider(BindingAwareProvider)}
- *
- * @param session Unique session between consumer and SAL.
- */
- void onSessionInitiated(ProviderContext session);
-}
+++ /dev/null
-/*
- * 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.sal.binding.api;
-
-/**
- * Session-specific instance of the broker functionality.
- *
- * <p>
- * BindingAwareService is marker interface for infrastructure services provided
- * by the SAL. These services are session-specific, each
- * {@link BindingAwareConsumer} and {@link BindingAwareProvider} usually has own
- * instance of the service with it's own context.
- *
- * <p>
- * The consumer's (or provider's) instance of specific service could be obtained
- * by invoking {@link org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext#getSALService(Class)} method on session
- * assigned to the consumer.
- *
- * <p>
- * {@link org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext} and {@link BindingAwareProvider} may seem
- * similar, but provider provides YANG model-based functionality and
- * {@link BindingAwareProvider} exposes the necessary supporting functionality
- * to implement specific functionality of YANG and to reuse it in the
- * development of {@link BindingAwareConsumer}s and {@link BindingAwareProvider}s.
- */
-public interface BindingAwareService {
-
-}
+++ /dev/null
-/*
- * 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.sal.binding.api;
-
-import java.util.EventListener;
-import org.opendaylight.yangtools.yang.binding.Notification;
-
-/**
- * Interface for a generic listener that is interested in receiving YANG modeled notifications.
- * This interface acts as a base interface for specific listeners which usually are a type
- * capture of this interface.
- *
- * @param <T> the interested notification type
- * @deprecated Deprecated unused API.
- */
-@Deprecated
-public interface NotificationListener<T extends Notification> extends EventListener {
- /**
- * Invoked to deliver a notification.
- * <p>
- * Note that this method may be invoked from a shared thread pool, so implementations SHOULD NOT
- * perform CPU-intensive operations and MUST NOT invoke any potentially blocking operations.
- *
- * @param notification the notification.
- */
- void onNotification(T notification);
-}
+++ /dev/null
-/*
- * 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.binding.api;
-
-public interface RpcAvailabilityListener {
-
-}
+++ /dev/null
-/*
- * 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.binding.api;
-
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
-import org.opendaylight.yangtools.yang.binding.RpcService;
-
-/**
- * Provides a registry for Remote Procedure Call (RPC) service implementations. The RPCs are defined
- * in YANG models.
- * <p>
- * There are 2 types of RPCs:
- * <ul>
- * <li>Global</li>
- * <li>Routed</li>
- * </ul>
- *
- * <h2>Global RPC</h2>
- * <p>
- * An RPC is global if there is intended to be only 1 registered implementation. A global RPC is not
- * explicitly declared as such, essentially any RPC that is not defined to be routed is considered
- * global.
- * <p>
- * Global RPCs are registered using the {@link #addRpcImplementation(Class, RpcService)} method.
- *
- * <h2>Routed RPC</h2>
- * <p>
- * MD-SAL supports routing of RPC between multiple implementations where the appropriate
- * implementation is selected at run time based on the content of the RPC message as described in
- * YANG model.
- * <p>
- * RPC routing is based on:
- * <ul>
- * <li><b>Route identifier</b> - An
- * {@link org.opendaylight.yangtools.yang.binding.InstanceIdentifier InstanceIdentifier} value which
- * is part of the RPC input. This value is used to select the correct implementation at run time.</li>
- * <li><b>Context Type</b> - A YANG-defined construct which constrains the subset of valid route
- * identifiers for a particular RPC.</li>
- * </ul>
- *
- * <h3>Context type</h3>
- * <p>
- * A context type is modeled in YANG using a combination of a YANG <code>identity</code> and
- * Opendaylight specific extensions from <code>yang-ext</code> module. These extensions are:
- * <ul>
- * <li><b>context-instance</b> - This is used in the data tree part of a YANG model to define a
- * context type that associates nodes with a specified context <code>identity</code>. Instance
- * identifiers that reference these nodes are valid route identifiers for RPCs that reference this
- * context type.</li>
- * <li><b>context-reference</b> - This is used in RPC input to mark a leaf of type
- * <code>instance-identifier</code> as a reference to the particular context type defined by the
- * specified context <code>identity</code>. The value of this leaf is used by the RPC broker at run
- * time to route the RPC request to the correct implementation. Note that
- * <code>context-reference</code> may only be used on leaf elements of type
- * <code>instance-identifier</code> or a type derived from <code>instance-identifier</code>.</li>
- * </ul>
- *
- *
- * <h3>Routed RPC example</h3>
- * <p>
- * <h4>1. Defining a Context Type</h4>
- * <p>
- * The following snippet declares a simple YANG <code>identity</code> named
- * <code>example-context</code>:
- *
- * <pre>
- * module example {
- * ...
- * identity example-context {
- * description "Identity used to define an example-context type";
- * }
- * ...
- * }
- * </pre>
- * <p>
- * We then use the declared identity to define a context type by using it in combination with the
- * <code>context-instance</code> YANG extension. We'll associate the context type with a list
- * element in the data tree. This defines the set of nodes whose instance identifiers are valid for
- * the <code>example-context</code> context type.
- * <p>
- * The following YANG snippet imports the <code>yang-ext</code> module and defines the list element
- * named <code>item</code> inside a container named <code>foo</code>:
- *
- * <pre>
- * module foo {
- * ...
- * import yang-ext {prefix ext;}
- * ...
- * container foo {
- * list item {
- * key "id";
- * leaf id {type string;}
- * ext:context-instance "example-context";
- * }
- * }
- * ...
- * }
- * </pre>
- * <p>
- * The statement <code>ext:context-instance "example-context";</code> inside the list element
- * declares that any instance identifier referencing <code>item</code> in the data tree is valid for
- * <code>example-context</code>. For example, the following instance identifier:
- *
- * <pre>
- * InstanceIdentifier.create(Foo.class).child(Item.class, new ItemKey("Foo"))
- * </pre>
- *
- * is valid for <code>example-context</code>. However the following:
- *
- * <pre>
- * InstanceIdentifier.create(Example.class)
- * </pre>
- *
- * is not valid.
- * <p>
- * So using an <code>identity</code> in combination with <code>context-instance</code> we have
- * effectively defined a context type that can be referenced in a YANG RPC input.
- *
- * <h5>2. Defining an RPC to use the Context Type</h5>
- * <p>
- * To define an RPC to be routed based on the context type we need to add an input leaf element that
- * references the context type which will hold an instance identifier value to be used to route the
- * RPC.
- * <p>
- * The following snippet defines an RPC named <code>show-item</code> with 2 leaf elements as input:
- * <code>item</code> of type <code>instance-identifier</code> and <code>description</code>:
- *
- * <pre>
- * module foo {
- * ...
- * import yang-ext {prefix ext;}
- * ...
- * rpc show-item {
- * input {
- * leaf item {
- * type instance-identifier;
- * ext:context-reference example-context;
- * }
- * leaf description {
- * type "string";
- * }
- * }
- * }
- * }
- * </pre>
- * <p>
- * We mark the <code>item</code> leaf with a <code>context-reference</code> statement that
- * references the <code>example-context</code> context type. RPC calls will then be routed based on
- * the instance identifier value contained in <code>item</code>. Only instance identifiers that
- * point to a <code>foo/item</code> node are valid as input.
- * <p>
- * The generated RPC Service interface for the module is:
- *
- * <pre>
- * interface FooService implements RpcService {
- * Future<RpcResult<Void>> showItem(ShowItemInput input);
- * }
- * </pre>
- * <p>
- * For constructing the RPC input, there are generated classes ShowItemInput and
- * ShowItemInputBuilder.
- *
- * <h5>3. Registering a routed RPC implementation</h5>
- * <p>
- * To register a routed implementation for the <code>show-item</code> RPC, we must use the
- * {@link #addRoutedRpcImplementation(Class, RpcService)} method. This will return a
- * {@link RoutedRpcRegistration} instance which can then be used to register / unregister routed
- * paths associated with the registered implementation.
- * <p>
- * The following snippet registers <code>myImpl</code> as the RPC implementation for an
- * <code>item</code> with key <code>"foo"</code>:
- *
- * <pre>
- * // Create the instance identifier path for item "foo"
- * InstanceIdentifier path = InstanceIdentifier.create(Foo.class).child(Item.class, new ItemKey("foo"));
- *
- * // Register myImpl as the implementation for the FooService RPC interface
- * RoutedRpcRegistration reg = rpcRegistry.addRoutedRpcImplementation(FooService.class, myImpl);
- *
- * // Now register for the context type and specific path ID. The context type is specified by the
- * // YANG-generated class for the example-context identity.
- * reg.registerPath(ExampleContext.class, path);
- * </pre>
- * <p>
- * It is also possible to register the same implementation for multiple paths:
- *
- * <pre>
- * InstanceIdentifier one = InstanceIdentifier.create(Foo.class).child(Item.class, new ItemKey("One"));
- * InstanceIdentifier two = InstanceIdentifier.create(Foo.class).child(Item.class, new ItemKey("Two"));
- *
- * RoutedRpcRegistration reg = rpcRegistry.addRoutedRpcImplementation(FooService.class, myImpl);
- * reg.registerPath(ExampleContext.class, one);
- * reg.registerPath(ExampleContext.class, two);
- * </pre>
- *
- * <p>
- * When another client invokes the <code>showItem(ShowItemInput)</code> method on the proxy instance
- * retrieved via {@link RpcConsumerRegistry#getRpcService(Class)}, the proxy will inspect the
- * arguments in ShowItemInput, extract the InstanceIdentifier value of the <code>item</code> leaf
- * and select the implementation whose registered path matches the InstanceIdentifier value of the
- * <code>item</code> leaf.
- *
- * <h2>Notes for RPC Implementations</h2>
- *
- * <h3>RpcResult</h3>
- * <p>
- * The generated interfaces require implementors to return {@link java.util.concurrent.Future
- * Future}<{@link org.opendaylight.yangtools.yang.common.RpcResult RpcResult}
- * <{RpcName}Output>> instances.
- *
- * Implementations should do processing of RPC calls asynchronously and update the returned
- * {@link java.util.concurrent.Future Future} instance when processing is complete. However using
- * {@link com.google.common.util.concurrent.Futures#immediateFuture(Object) Futures.immediateFuture}
- * is valid only if the result is immediately available and asynchronous processing is unnecessary
- * and would only introduce additional complexity.
- *
- * <p>
- * The {@link org.opendaylight.yangtools.yang.common.RpcResult RpcResult} is a generic wrapper for
- * the RPC output payload, if any, and also allows for attaching error or warning information
- * (possibly along with the payload) should the RPC processing partially or completely fail. This is
- * intended to provide additional human readable information for users of the API and to transfer
- * warning / error information across the system so it may be visible via other external APIs such
- * as Restconf.
- * <p>
- * It is recommended to use the {@link org.opendaylight.yangtools.yang.common.RpcResult RpcResult}
- * for conveying appropriate error information on failure rather than purposely throwing unchecked
- * exceptions if at all possible. While unchecked exceptions will fail the returned
- * {@link java.util.concurrent.Future Future}, using the intended RpcResult to convey the error
- * information is more user-friendly.
- */
-public interface RpcProviderRegistry extends RpcConsumerRegistry {
- /**
- * Registers a global implementation of the provided RPC service interface.
- * All methods of the interface are required to be implemented.
- *
- * @param serviceInterface the YANG-generated interface of the RPC Service for which to register.
- * @param implementation "the implementation of the RPC service interface.
- * @return an RpcRegistration instance that should be used to unregister the RPC implementation
- * when no longer needed by calling {@link RpcRegistration#close()}.
- *
- * @throws IllegalStateException
- * if the supplied RPC interface is a routed RPC type.
- */
- <T extends RpcService> RpcRegistration<T> addRpcImplementation(Class<T> serviceInterface, T implementation)
- throws IllegalStateException;
-
- /**
- * Registers an implementation of the given routed RPC service interface.
- * <p>
- * See the {@link RpcProviderRegistry class} documentation for information and example on how to
- * use routed RPCs.
- *
- * @param serviceInterface the YANG-generated interface of the RPC Service for which to
- * register.
- * @param implementation the implementation instance to register.
- * @return a RoutedRpcRegistration instance which can be used to register paths for the RPC
- * implementation via invoking
- * {@link RoutedRpcRegistration#registerPath(Class, org.opendaylight.yangtools.yang.binding.InstanceIdentifier)}
- * . {@link RoutedRpcRegistration#close()} should be called to unregister the
- * implementation and all previously registered paths when no longer needed.
- *
- * @throws IllegalStateException if the supplied RPC interface is not a routed RPC type.
- */
- <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(Class<T> serviceInterface,
- T implementation)
- throws IllegalStateException;
-}
+++ /dev/null
-/*
- * 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.sal.binding.api;
-
*/
package org.opendaylight.mdsal.binding.api;
-import org.opendaylight.controller.sal.binding.api.BindingAwareService;
/**
*
* delegator patterns in order to introduce additional semantics / checks
* to the system.
*
- * This interface extends {@link BindingAwareService}, order to be make
- * new services available via
- * {@link org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext}
- * and via
- * {@link org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext}
- *
*/
-public interface BindingService extends BindingAwareService {
+public interface BindingService {
}
*/
package org.opendaylight.mdsal.binding.api;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
+import org.opendaylight.mdsal.common.api.TransactionChain;
+
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
*/
package org.opendaylight.mdsal.binding.api;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainFactory;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionChainFactory;
+import org.opendaylight.mdsal.common.api.TransactionChainListener;
+
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
*/
package org.opendaylight.mdsal.binding.api;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeEvent;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeListener;
+
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
*/
package org.opendaylight.mdsal.binding.api;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+
import com.google.common.base.Preconditions;
import java.io.Serializable;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.yangtools.concepts.Immutable;
import org.opendaylight.yangtools.concepts.Path;
import org.opendaylight.yangtools.yang.binding.DataObject;
*/
package org.opendaylight.mdsal.binding.api;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncReadOnlyTransaction;
+import org.opendaylight.mdsal.common.api.AsyncReadOnlyTransaction;
+
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
* A transaction that provides a stateful read-only view of the data tree.
* <p>
* For more information on usage and examples, please see the documentation in
- * {@link org.opendaylight.controller.md.sal.common.api.data.AsyncReadTransaction}.
+ * {@link org.opendaylight.mdsal.common.api.AsyncReadTransaction}.
*/
public interface ReadOnlyTransaction extends ReadTransaction, AsyncReadOnlyTransaction<InstanceIdentifier<?>, DataObject> {
*/
package org.opendaylight.mdsal.binding.api;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncReadTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.mdsal.common.api.AsyncReadTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
+
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
*/
package org.opendaylight.mdsal.binding.api;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncReadWriteTransaction;
+import org.opendaylight.mdsal.common.api.AsyncReadWriteTransaction;
+
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
*/
package org.opendaylight.mdsal.binding.api;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+
import org.opendaylight.yangtools.yang.binding.RpcService;
* Provides access to registered Remote Procedure Call (RPC) service implementations. The RPCs are
* defined in YANG models.
* <p>
- * RPC implementations are registered using the {@link RpcProviderRegistry}.
+ * RPC implementations are registered using the {@link RpcProviderService}.
*
*/
public interface RpcConsumerRegistry extends BindingService {
--- /dev/null
+/*
+ * Copyright (c) 2015 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.mdsal.binding.api;
+
+import java.util.Set;
+import org.opendaylight.yangtools.concepts.ObjectRegistration;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.RpcService;
+
+/**
+ * Provides ability to registered Remote Procedure Call (RPC) service implementations. The RPCs are
+ * defined in YANG models.
+ *
+ */
+public interface RpcProviderService {
+
+ <S extends RpcService, T extends S> ObjectRegistration<T> registerRpcImplementation(final Class<S> type,
+ final T implementation);
+
+
+ <S extends RpcService, T extends S> ObjectRegistration<T> registerRpcImplementation(final Class<S> type,
+ final T implementation, final Set<InstanceIdentifier<?>> paths);
+
+}
package org.opendaylight.mdsal.binding.api;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataTransactionFactory;
+import org.opendaylight.mdsal.common.api.AsyncDataTransactionFactory;
+
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
*/
package org.opendaylight.mdsal.binding.api;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.AsyncWriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- <Export-Package>
- org.opendaylight.mdsal.sal.binding.impl,
- org.opendaylight.mdsal.md.sal.binding.impl,
- org.opendaylight.mdsal.md.sal.binding.compat,
- org.opendaylight.mdsal.md.sal.binding.spi,
- org.opendaylight.mdsal.sal.binding.codegen.impl,
- </Export-Package>
- </instructions>
- </configuration>
</plugin>
<plugin>
+++ /dev/null
-/*
- * 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.binding.impl;
-
-import static com.google.common.base.Preconditions.checkState;
-
-import org.opendaylight.mdsal.binding.api.MountPointService;
-
-import com.google.common.collect.ImmutableClassToInstanceMap;
-import org.opendaylight.controller.md.sal.binding.util.BindingContextUtils;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.BindingAwareConsumer;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.controller.sal.binding.api.BindingAwareService;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.yangtools.concepts.Identifiable;
-import org.opendaylight.yangtools.yang.binding.RpcService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RootBindingAwareBroker implements Identifiable<String>, BindingAwareBroker, AutoCloseable,
- RpcProviderRegistry {
-
- private final static Logger LOG = LoggerFactory.getLogger(RootBindingAwareBroker.class);
-
-
- private final String identifier;
-
-
- private final ImmutableClassToInstanceMap<BindingAwareService> supportedConsumerServices;
- private final ImmutableClassToInstanceMap<BindingAwareService> supportedProviderServices;
-
- public RootBindingAwareBroker(final String instanceName,
- final ImmutableClassToInstanceMap<BindingAwareService> consumerServices,
- final ImmutableClassToInstanceMap<BindingAwareService> providerServices) {
- this.identifier = instanceName;
- supportedConsumerServices = consumerServices;
- supportedProviderServices = providerServices;
- }
-
- @Override
- public String getIdentifier() {
- return identifier;
- }
-
-
- public RpcProviderRegistry getRpcProviderRegistry() {
- return supportedProviderServices.getInstance(RpcProviderRegistry.class);
- }
-
- public RpcProviderRegistry getRpcBroker() {
- return getRpcBroker();
- }
-
- public MountPointService getMountService() {
- return supportedConsumerServices.getInstance(MountPointService.class);
- }
-
- @Override
- public ConsumerContext registerConsumer(final BindingAwareConsumer consumer) {
- checkState(supportedConsumerServices != null, "Broker is not initialized.");
- return BindingContextUtils.createConsumerContextAndInitialize(consumer, supportedConsumerServices);
- }
-
- @Override
- public ProviderContext registerProvider(final BindingAwareProvider provider) {
- checkState(supportedProviderServices != null, "Broker is not initialized.");
- return BindingContextUtils.createProviderContextAndInitialize(provider, supportedProviderServices);
- }
-
- @Override
- public void close() throws Exception {
- // FIXME: Close all sessions
- }
-
- @Override
- public <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(final Class<T> type,
- final T implementation) throws IllegalStateException {
- return getRpcProviderRegistry().addRoutedRpcImplementation(type, implementation);
- }
-
- @Override
- public <T extends RpcService> RpcRegistration<T> addRpcImplementation(final Class<T> type, final T implementation)
- throws IllegalStateException {
- return getRpcProviderRegistry().addRpcImplementation(type, implementation);
- }
-
- @Override
- public <T extends RpcService> T getRpcService(final Class<T> module) {
- return getRpcBroker().getRpcService(module);
- }
-}
*/
package org.opendaylight.mdsal.binding.dom.adapter;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeEvent;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
+
import org.opendaylight.mdsal.dom.api.ClusteredDOMDataChangeListener;
import org.opendaylight.mdsal.dom.api.DOMDataBroker;
import org.opendaylight.mdsal.dom.api.DOMDataChangeListener;
-
import org.opendaylight.mdsal.binding.api.ClusteredDataChangeListener;
import org.opendaylight.mdsal.binding.api.DataChangeListener;
import com.google.common.base.MoreObjects;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
import org.opendaylight.yangtools.concepts.Delegator;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
private final BindingToNormalizedNodeCodec codec;
- protected AbstractForwardedDataBroker(final DOMDataBroker domDataBroker, final BindingToNormalizedNodeCodec codec,
- final SchemaService schemaService) {
- this.domDataBroker = domDataBroker;
- this.codec = codec;
- }
-
protected AbstractForwardedDataBroker(final DOMDataBroker domDataBroker, final BindingToNormalizedNodeCodec codec) {
this.domDataBroker = domDataBroker;
this.codec = codec;
*/
package org.opendaylight.mdsal.binding.dom.adapter;
-import org.opendaylight.mdsal.dom.api.DOMDataReadTransaction;
+import org.opendaylight.mdsal.common.api.AsyncTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
+import org.opendaylight.mdsal.dom.api.DOMDataReadTransaction;
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.Futures;
-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.yangtools.concepts.Delegator;
import org.opendaylight.yangtools.concepts.Identifiable;
import org.opendaylight.yangtools.util.concurrent.MappingCheckedFuture;
*/
package org.opendaylight.mdsal.binding.dom.adapter;
-import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
+import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.CheckedFuture;
import java.util.Map.Entry;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.Identifiable;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
package org.opendaylight.mdsal.binding.dom.adapter;
+import org.opendaylight.mdsal.common.api.TransactionChainListener;
+
import org.opendaylight.mdsal.dom.api.DOMDataBroker;
import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeService;
import org.opendaylight.mdsal.dom.api.DOMService;
-
import org.opendaylight.mdsal.binding.api.BindingTransactionChain;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
import com.google.common.collect.ClassToInstanceMap;
import com.google.common.collect.ImmutableSet;
import java.util.Set;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.DataObject;
*/
package org.opendaylight.mdsal.binding.dom.adapter;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener;
import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
import org.opendaylight.mdsal.binding.api.DataTreeModification;
import com.google.common.base.Preconditions;
import java.util.Collection;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
*/
package org.opendaylight.mdsal.binding.dom.adapter;
-import org.opendaylight.mdsal.dom.api.DOMMountPointService;
-
-import org.opendaylight.mdsal.binding.api.MountPointService.MountPointListener;
import com.google.common.base.Optional;
-import org.opendaylight.controller.sal.core.api.mount.MountProvisionListener;
+import org.opendaylight.mdsal.binding.api.MountPointService.MountPointListener;
+import org.opendaylight.mdsal.dom.api.DOMMountPointListener;
+import org.opendaylight.mdsal.dom.api.DOMMountPointService;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.impl.codec.DeserializationException;
-final class BindingDOMMountPointListenerAdapter<T extends MountPointListener> implements ListenerRegistration<T>, MountProvisionListener {
+final class BindingDOMMountPointListenerAdapter<T extends MountPointListener> implements ListenerRegistration<T>, DOMMountPointListener {
private final T listener;
- private final ListenerRegistration<MountProvisionListener> registration;
+ private final ListenerRegistration<DOMMountPointListener> registration;
private final BindingToNormalizedNodeCodec codec;
public BindingDOMMountPointListenerAdapter(final T listener, final BindingToNormalizedNodeCodec codec, final DOMMountPointService mountService) {
*/
package org.opendaylight.mdsal.binding.dom.adapter;
-import org.opendaylight.mdsal.dom.api.DOMDataReadOnlyTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
+import org.opendaylight.mdsal.dom.api.DOMDataReadOnlyTransaction;
import org.opendaylight.mdsal.binding.api.ReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import com.google.common.base.Optional;
*/
package org.opendaylight.mdsal.binding.dom.adapter;
-import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
+import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
import org.opendaylight.mdsal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import com.google.common.base.Optional;
*/
package org.opendaylight.mdsal.binding.dom.adapter;
+import org.opendaylight.mdsal.common.api.AsyncTransaction;
+import org.opendaylight.mdsal.common.api.TransactionChain;
+import org.opendaylight.mdsal.common.api.TransactionChainListener;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
+
import org.opendaylight.mdsal.dom.api.DOMDataBroker;
import org.opendaylight.mdsal.dom.api.DOMDataReadOnlyTransaction;
import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
-
import org.opendaylight.mdsal.binding.api.BindingTransactionChain;
import org.opendaylight.mdsal.binding.api.ReadOnlyTransaction;
import org.opendaylight.mdsal.binding.api.ReadWriteTransaction;
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
-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.yangtools.concepts.Delegator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
*/
package org.opendaylight.mdsal.binding.dom.adapter;
-import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
-import org.opendaylight.mdsal.binding.api.WriteTransaction;
import com.google.common.util.concurrent.CheckedFuture;
-import com.google.common.util.concurrent.ListenableFuture;
-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.api.data.TransactionCommitFailedException;
+import org.opendaylight.mdsal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.common.RpcResult;
class BindingDOMWriteTransactionAdapter<T extends DOMDataWriteTransaction> extends
AbstractWriteTransaction<T> implements WriteTransaction {
doDelete( store, path);
}
- @Deprecated
- @Override
- public ListenableFuture<RpcResult<TransactionStatus>> commit() {
- throw new UnsupportedOperationException();
- }
-
@Override
public CheckedFuture<Void,TransactionCommitFailedException> submit() {
return doSubmit();
package org.opendaylight.mdsal.binding.dom.adapter;
+import org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult;
+
import org.opendaylight.mdsal.dom.api.DOMRpcException;
import org.opendaylight.mdsal.dom.api.DOMRpcResult;
-
import com.google.common.base.Preconditions;
import com.google.common.base.Throwables;
import com.google.common.util.concurrent.CheckedFuture;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-import org.opendaylight.controller.md.sal.dom.spi.DefaultDOMRpcResult;
import org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry;
import org.opendaylight.yangtools.yang.binding.DataContainer;
import org.opendaylight.yangtools.yang.common.RpcResult;
*/
package org.opendaylight.mdsal.binding.dom.adapter;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+
import org.opendaylight.mdsal.binding.api.DataObjectModification;
import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
import org.opendaylight.mdsal.binding.api.DataTreeModification;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map.Entry;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.yangtools.binding.data.codec.api.BindingCodecTreeNode;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
package org.opendaylight.mdsal.binding.dom.adapter;
+import org.opendaylight.mdsal.dom.spi.RpcRoutingStrategy;
+
import org.opendaylight.mdsal.dom.api.DOMRpcException;
import org.opendaylight.mdsal.dom.api.DOMRpcResult;
import org.opendaylight.mdsal.dom.api.DOMRpcService;
-
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Map.Entry;
-import org.opendaylight.controller.md.sal.dom.broker.spi.rpc.RpcRoutingStrategy;
import org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry;
import org.opendaylight.yangtools.yang.binding.DataContainer;
import org.opendaylight.yangtools.yang.binding.DataObject;
*/
package org.opendaylight.mdsal.binding.dom.adapter.test;
-import org.opendaylight.mdsal.binding.api.DataChangeListener;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeEvent;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
+import org.opendaylight.mdsal.binding.api.DataChangeListener;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import com.google.common.util.concurrent.SettableFuture;
package org.opendaylight.mdsal.binding.dom.adapter.test;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeEvent;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+
import org.opendaylight.mdsal.dom.api.ClusteredDOMDataChangeListener;
import org.opendaylight.mdsal.dom.api.DOMDataBroker;
-
import org.opendaylight.mdsal.binding.api.ClusteredDataChangeListener;
import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMDataBrokerAdapter;
import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.Top;
import org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry;
import org.opendaylight.yangtools.sal.binding.generator.impl.GeneratedClassLoadingStrategy;
package org.opendaylight.mdsal.binding.dom.adapter.test;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.TOP_FOO_KEY;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.path;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.topLevelList;
import static org.opendaylight.mdsal.binding.dom.adapter.test.AssertCollections.assertContains;
import static org.opendaylight.mdsal.binding.dom.adapter.test.AssertCollections.assertEmpty;
-
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.TOP_FOO_KEY;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.path;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.topLevelList;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeEvent;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
-
import org.junit.Test;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugment;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugmentBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.complex.from.grouping.ContainerWithUsesBuilder;
*/
package org.opendaylight.mdsal.binding.dom.adapter.test;
-import static org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.CONFIGURATION;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.TOP_FOO_KEY;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.USES_ONE_KEY;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.USES_TWO_KEY;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.complexUsesAugment;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.path;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.top;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.topLevelList;
import static org.opendaylight.mdsal.binding.dom.adapter.test.AssertCollections.assertContains;
import static org.opendaylight.mdsal.binding.dom.adapter.test.AssertCollections.assertEmpty;
import static org.opendaylight.mdsal.binding.dom.adapter.test.AssertCollections.assertNotContains;
-
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.TOP_FOO_KEY;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.USES_ONE_KEY;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.USES_TWO_KEY;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.complexUsesAugment;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.path;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.top;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.topLevelList;
+import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeEvent;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
import org.opendaylight.mdsal.binding.api.ReadWriteTransaction;
-
import org.junit.Test;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugment;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.Top;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelList;
package org.opendaylight.mdsal.binding.dom.adapter.test;
import static org.junit.Assert.assertTrue;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.TOP_FOO_KEY;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.complexUsesAugment;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.leafOnlyUsesAugment;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.top;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.topLevelList;
import static org.opendaylight.mdsal.binding.dom.adapter.test.AssertCollections.assertContains;
import static org.opendaylight.mdsal.binding.dom.adapter.test.AssertCollections.assertEmpty;
-
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.TOP_FOO_KEY;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.complexUsesAugment;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.leafOnlyUsesAugment;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.top;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.topLevelList;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeEvent;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
-
import org.junit.Test;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugment;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeLeafOnlyUsesAugment;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.complex.from.grouping.ListViaUses;
*/
package org.opendaylight.mdsal.binding.dom.adapter.test;
-import org.opendaylight.mdsal.dom.broker.DOMNotificationRouter;
-import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker;
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
-import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.spi.store.DOMStore;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
+import javassist.ClassPool;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.mdsal.binding.api.NotificationService;
-import org.opendaylight.mdsal.binding.dom.adapter.test.util.MockSchemaService;
import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMDataBrokerAdapter;
import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMNotificationPublishServiceAdapter;
import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMNotificationServiceAdapter;
import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
-import javassist.ClassPool;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.controller.sal.core.spi.data.DOMStore;
+import org.opendaylight.mdsal.binding.dom.adapter.test.util.MockSchemaService;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
+import org.opendaylight.mdsal.dom.broker.DOMNotificationRouter;
+import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker;
import org.opendaylight.yangtools.binding.data.codec.gen.impl.DataObjectSerializerGenerator;
import org.opendaylight.yangtools.binding.data.codec.gen.impl.StreamWriterGenerator;
import org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry;
return bindingToNormalized;
}
- public SchemaService getSchemaService() {
+ public DOMSchemaService getSchemaService() {
return schemaService;
}
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.TOP_BAR_KEY;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.TOP_FOO_KEY;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.USES_ONE_KEY;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.complexUsesAugment;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.path;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.top;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.topLevelList;
-
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.TOP_BAR_KEY;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.TOP_FOO_KEY;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.USES_ONE_KEY;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.complexUsesAugment;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.path;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.top;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.topLevelList;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.DataObjectModification;
import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
import org.opendaylight.mdsal.binding.api.DataTreeModification;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
import org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType;
-
import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMDataBrokerAdapter;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import java.util.Collection;
import java.util.concurrent.TimeUnit;
import org.junit.Test;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugment;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.Top;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.TwoLevelList;
*/
package org.opendaylight.mdsal.binding.dom.adapter.test;
import static org.junit.Assert.assertFalse;
-import static org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.CONFIGURATION;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.TOP_BAR_KEY;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.TOP_FOO_KEY;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.top;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.topLevelList;
import static org.opendaylight.mdsal.binding.dom.adapter.test.AssertCollections.assertContains;
import static org.opendaylight.mdsal.binding.dom.adapter.test.AssertCollections.assertEmpty;
import static org.opendaylight.mdsal.binding.dom.adapter.test.AssertCollections.assertNotContains;
-
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.TOP_BAR_KEY;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.TOP_FOO_KEY;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.top;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.topLevelList;
+import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeEvent;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.ReadWriteTransaction;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
-
import org.junit.Test;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.Top;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelList;
import org.opendaylight.yangtools.yang.binding.DataObject;
import static org.junit.Assert.assertTrue;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
+
import org.opendaylight.mdsal.binding.api.ReadOnlyTransaction;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
-
import com.google.common.base.Optional;
import java.util.concurrent.ExecutionException;
import org.junit.Test;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.Top;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.TopBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelList;
import static com.google.common.base.Preconditions.checkState;
-import org.opendaylight.mdsal.dom.broker.DOMMountPointServiceImpl;
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
-import org.opendaylight.mdsal.dom.broker.DOMNotificationRouter;
-import org.opendaylight.mdsal.dom.broker.DOMRpcRouter;
-import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker;
-import org.opendaylight.mdsal.dom.api.DOMDataBroker;
-import org.opendaylight.mdsal.dom.api.DOMMountPointService;
-import org.opendaylight.mdsal.dom.api.DOMNotificationPublishService;
-import org.opendaylight.mdsal.dom.api.DOMNotificationService;
-import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
-import org.opendaylight.mdsal.dom.api.DOMRpcService;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.mdsal.dom.spi.store.DOMStore;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import com.google.common.annotations.Beta;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
+import javassist.ClassPool;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.MountPointService;
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.mdsal.binding.api.NotificationService;
+import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMDataBrokerAdapter;
import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMMountPointServiceAdapter;
import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMNotificationPublishServiceAdapter;
import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMRpcProviderServiceAdapter;
import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMRpcServiceAdapter;
import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
-import com.google.common.annotations.Beta;
-import com.google.common.collect.ClassToInstanceMap;
-import com.google.common.collect.ImmutableClassToInstanceMap;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.MutableClassToInstanceMap;
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
-import javassist.ClassPool;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
-import org.opendaylight.controller.sal.binding.api.BindingAwareService;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.controller.sal.binding.impl.RootBindingAwareBroker;
-import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
-import org.opendaylight.controller.sal.core.api.BrokerService;
-import org.opendaylight.controller.sal.core.spi.data.DOMStore;
-import org.opendaylight.controller.sal.dom.broker.BrokerImpl;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMMountPointService;
+import org.opendaylight.mdsal.dom.api.DOMNotificationPublishService;
+import org.opendaylight.mdsal.dom.api.DOMNotificationService;
+import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
+import org.opendaylight.mdsal.dom.api.DOMRpcService;
+import org.opendaylight.mdsal.dom.broker.DOMMountPointServiceImpl;
+import org.opendaylight.mdsal.dom.broker.DOMNotificationRouter;
+import org.opendaylight.mdsal.dom.broker.DOMRpcRouter;
+import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker;
import org.opendaylight.yangtools.binding.data.codec.gen.impl.DataObjectSerializerGenerator;
import org.opendaylight.yangtools.binding.data.codec.gen.impl.StreamWriterGenerator;
import org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry;
private BindingToNormalizedNodeCodec codec;
- private RootBindingAwareBroker baBrokerImpl;
-
- private BrokerImpl biBrokerImpl;
-
private final ListeningExecutorService executor;
private final ClassPool classPool;
baConsumerRpc = new BindingDOMRpcServiceAdapter(getDomRpcInvoker(), codec);
baProviderRpc = new BindingDOMRpcProviderServiceAdapter(getDomRpcRegistry(), codec);
final MountPointService mountService = new BindingDOMMountPointServiceAdapter(biMountImpl, codec);
-
- final ImmutableClassToInstanceMap<BindingAwareService> consumerServices =
- ImmutableClassToInstanceMap.<BindingAwareService>builder().build();
- final ImmutableClassToInstanceMap<BindingAwareService> providerServices =
- ImmutableClassToInstanceMap.<BindingAwareService>builder().build();;
- baBrokerImpl = new RootBindingAwareBroker("test", consumerServices, providerServices);
}
public void startForwarding() {
}
- private ProviderSession createMockContext() {
-
- final ClassToInstanceMap<BrokerService> domBrokerServices = ImmutableClassToInstanceMap
- .<BrokerService> builder()
- //
- .put(DOMRpcRouter.class, biBrokerImpl.getRouter()) //
- .put(DOMMountPointService.class, biMountImpl)
- .build();
-
- return new ProviderSession() {
-
- @Override
- public <T extends BrokerService> T getService(final Class<T> service) {
- return domBrokerServices.getInstance(service);
- }
-
- @Override
- public boolean isClosed() {
- return false;
- }
-
- @Override
- public void close() {
- }
- };
- }
-
public void startBindingToDomMappingService() {
checkState(classPool != null, "ClassPool needs to be present");
private void startDomBroker() {
checkState(executor != null);
-
domRouter = new DOMRpcRouter();
mockSchemaService.registerSchemaContextListener(domRouter);
-
- final ClassToInstanceMap<BrokerService> services = MutableClassToInstanceMap.create();
- services.put(DOMRpcService.class, domRouter);
-
- biBrokerImpl = new BrokerImpl(domRouter,services);
-
}
public void startBindingNotificationBroker() {
updateYangSchema(moduleInfos);
}
-
-
- public RpcProviderRegistry getBindingRpcRegistry() {
- return baBrokerImpl.getRpcProviderRegistry();
- }
-
public DOMRpcProviderService getDomRpcRegistry() {
return domRouter;
}
*/
package org.opendaylight.mdsal.binding.dom.adapter.test.util;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
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;
-public final class MockSchemaService implements SchemaService, SchemaContextProvider {
+public final class MockSchemaService implements DOMSchemaService, SchemaContextProvider {
private SchemaContext schemaContext;
ListenerRegistry<SchemaContextListener> listeners = ListenerRegistry.create();
- @Override
- public void addModule(final Module module) {
- throw new UnsupportedOperationException();
- }
-
@Override
public synchronized SchemaContext getGlobalContext() {
return schemaContext;
return listeners.register(listener);
}
- @Override
- public void removeModule(final Module module) {
- throw new UnsupportedOperationException();
- }
-
@Override
public synchronized SchemaContext getSchemaContext() {
return schemaContext;
<instructions>
<Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
<Export-Package>
+ org.opendaylight.mdsal.binding.dom.codec.*,
org.opendaylight.yangtools.binding.data.codec.*,
org.opendaylight.yangtools.binding.data.codec.gen.impl.*,
org.opendaylight.yangtools.binding.data.codec.impl.*,
--- /dev/null
+/*
+ * Copyright (c) 2015 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.mdsal.binding.dom.codec.api;
+
+import javax.annotation.Nullable;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+
+/**
+ *
+ * Navigable tree representing hierarchy of Binding to Normalized Node codecs
+ *
+ * This navigable tree is associated to conrete set of YANG models, represented by SchemaContext and
+ * provides access to subtree specific serialization context.
+ *
+ * TODO: Add more detailed documentation
+ **/
+public interface BindingCodecTree extends org.opendaylight.yangtools.binding.data.codec.api.BindingCodecTree {
+
+ @Override
+ @Nullable
+ <T extends DataObject> BindingCodecTreeNode<T> getSubtreeCodec(InstanceIdentifier<T> path);
+
+ @Override
+ @Nullable
+ BindingCodecTreeNode<?> getSubtreeCodec(YangInstanceIdentifier path);
+
+ @Override
+ @Nullable
+ BindingCodecTreeNode<?> getSubtreeCodec(SchemaPath path);
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2015 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.mdsal.binding.dom.codec.api;
+
+import com.google.common.annotations.Beta;
+import org.opendaylight.yangtools.sal.binding.generator.util.BindingRuntimeContext;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+
+public interface BindingCodecTreeFactory extends
+ org.opendaylight.yangtools.binding.data.codec.api.BindingCodecTreeFactory {
+
+ /**
+ *
+ * Creates Binding Codec Tree for specified Binding runtime context.
+ *
+ * @param context
+ * Binding Runtime Context for which Binding codecs should be
+ * instantiated.
+ * @return Binding Codec Tree for specified Binding runtime context.
+ */
+ @Override
+ BindingCodecTree create(BindingRuntimeContext context);
+
+ /**
+ *
+ * Creates Binding Codec Tree for specified Binding runtime context.
+ *
+ * @param context
+ * Binding Runtime Context for which Binding codecs should be
+ * instantiated.
+ * @param bindingClasses
+ * Binding Runtime Context will be constructed using bindings
+ * which contains specified classes, in order to support
+ * deserialization in multi-classloader environment.
+ * @return Binding Codec Tree for specified Binding runtime context.
+ */
+ @Override
+ @Beta
+ BindingCodecTree create(SchemaContext context, Class<?>... bindingClasses);
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2015 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.mdsal.binding.dom.codec.api;
+
+import com.google.common.annotations.Beta;
+import com.google.common.base.Optional;
+import com.google.common.collect.ImmutableCollection;
+import java.util.List;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import org.opendaylight.yangtools.yang.binding.BindingStreamEventWriter;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
+
+/**
+ * Subtree codec specific to model subtree between Java Binding and
+ * NormalizedNode.
+ *
+ */
+@Beta
+public interface BindingCodecTreeNode<T extends DataObject> extends BindingNormalizedNodeCodec<T>,
+ org.opendaylight.yangtools.binding.data.codec.api.BindingCodecTreeNode<T> {
+
+ /**
+ *
+ * Returns binding class of interface which represents API of current
+ * schema node.
+ *
+ * The result is same as invoking {@link DataObject#getImplementedInterface()}
+ * on instance of data.
+ *
+ * @return interface which defines API of binding representation of data.
+ */
+ @Override
+ @Nonnull
+ Class<T> getBindingClass();
+
+ /**
+ *
+ * Returns child context as if it was walked by
+ * {@link BindingStreamEventWriter}. This means that to enter case, one must
+ * issue getChild(ChoiceClass).getChild(CaseClass).
+ *
+ * @param childClass Child class by Biding Stream navigation
+ * @return Context of child
+ * @throws IllegalArgumentException
+ * If supplied child class is not valid in specified context.
+ */
+ @Override
+ @Nonnull
+ <E extends DataObject> BindingCodecTreeNode<E> streamChild(@Nonnull Class<E> childClass);
+
+ /**
+ *
+ * Returns child context as if it was walked by
+ * {@link BindingStreamEventWriter}. This means that to enter case, one must
+ * issue getChild(ChoiceClass).getChild(CaseClass).
+ *
+ * This method differs from {@link #streamChild(Class)}, that is less
+ * stricter for interfaces representing augmentation and cases, that
+ * may return {@link BindingCodecTreeNode} even if augmentation interface
+ * containing same data was supplied and does not represent augmentation
+ * of this node.
+ *
+ * @param childClass
+ * @return Context of child or Optional absent is supplied class is not
+ * applicable in context.
+ */
+ @Override
+ <E extends DataObject> Optional<? extends BindingCodecTreeNode<E>> possibleStreamChild(@Nonnull Class<E> childClass);
+
+ /**
+ * Returns nested node context using supplied YANG Instance Identifier
+ *
+ * @param child
+ * Yang Instance Identifier Argument
+ * @return Context of child
+ * @throws IllegalArgumentException
+ * If supplied argument does not represent valid child.
+ */
+ @Override
+ @Nonnull
+ BindingCodecTreeNode<?> yangPathArgumentChild(@Nonnull YangInstanceIdentifier.PathArgument child);
+
+ /**
+ * Returns nested node context using supplied Binding Instance Identifier
+ * and adds YANG instance identifiers to supplied list.
+ *
+ * @param arg
+ * Binding Instance Identifier Argument
+ * @param builder
+ * Mutable instance of list, which is appended by YangInstanceIdentifiers
+ * as tree is walked. Use null if such side-product is not needed.
+ * @return Context of child
+ * @throws IllegalArgumentException
+ * If supplied argument does not represent valid child.
+ */
+ @Override
+ @Nonnull
+ BindingCodecTreeNode<?> bindingPathArgumentChild(@Nonnull InstanceIdentifier.PathArgument arg,
+ @Nullable List<YangInstanceIdentifier.PathArgument> builder);
+
+ /**
+ *
+ * Returns codec which uses caches serialization / deserialization results
+ *
+ * Caching may introduce performance penalty to serialization / deserialization
+ * but may decrease use of heap for repetitive objects.
+ *
+ *
+ * @param cacheSpecifier Set of objects, for which cache may be in place
+ * @return Codec whihc uses cache for serialization / deserialization.
+ */
+ @Override
+ @Nonnull
+ BindingNormalizedNodeCachingCodec<T> createCachingCodec(@Nonnull
+ ImmutableCollection<Class<? extends DataObject>> cacheSpecifier);
+
+ @Override
+ @Beta
+ void writeAsNormalizedNode(T data, NormalizedNodeStreamWriter writer);
+
+ /**
+ * Serializes path argument for current node.
+ *
+ * @param arg Binding Path Argument, may be null if Binding Instance Identifier does not have
+ * representation for current node (e.g. choice or case).
+ * @return Yang Path Argument, may be null if Yang Instance Identifier does not have
+ * representation for current node (e.g. case).
+ * @throws IllegalArgumentException If supplied {@code arg} is not valid.
+ */
+ @Override
+ @Beta
+ @Nullable YangInstanceIdentifier.PathArgument serializePathArgument(@Nullable InstanceIdentifier.PathArgument arg);
+
+ /**
+ * Deserializes path argument for current node.
+ *
+ * @param arg Yang Path Argument, may be null if Yang Instance Identifier does not have
+ * representation for current node (e.g. case).
+ * @return Binding Path Argument, may be null if Binding Instance Identifier does not have
+ * representation for current node (e.g. choice or case).
+ * @throws IllegalArgumentException If supplied {@code arg} is not valid.
+ */
+ @Override
+ @Beta
+ @Nullable InstanceIdentifier.PathArgument deserializePathArgument(@Nullable YangInstanceIdentifier.PathArgument arg);
+
+ @Override
+ Object getSchema();
+}
--- /dev/null
+/*
+ * Copyright (c) 2015 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.mdsal.binding.dom.codec.api;
+
+import com.google.common.annotations.Beta;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+
+/**
+ * Caching variant of Binding to Normalized Node codec.
+ *
+ * Caching may introduce performance penalty to serialization / deserialization
+ * but may decrease use of heap for repetitive objects.
+ *
+ * @param <T> Binding representtion of data
+ */
+@Beta
+public interface BindingNormalizedNodeCachingCodec<T extends DataObject> extends
+ org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeCachingCodec<T>,
+ BindingNormalizedNodeCodec<T>, AutoCloseable {
+ /**
+ * Invoking close will invalidate this codec and any of its child
+ * codecs and will invalidate cache.
+ *
+ * Any subsequent calls to this codec will fail with {@link IllegalStateException}
+ * thrown.
+ */
+ @Override
+ void close();
+}
--- /dev/null
+/*
+ * Copyright (c) 2015 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.mdsal.binding.dom.codec.api;
+
+import com.google.common.annotations.Beta;
+import javax.annotation.Nonnull;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+
+/**
+ *
+ * Codec providing serialization and deserializiation between Binding
+ * and NormalizedNode representation of data.
+ *
+ *
+ * @param <T> Binding representation of data
+ */
+@Beta
+public interface BindingNormalizedNodeCodec<T extends DataObject> extends
+ org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeCodec<T> {
+
+ /**
+ * Converts from Normalized Node to Binding representation of data.
+ *
+ * @param data Normalized Node representation of data
+ * @return Binding representation of data
+ */
+ @Override
+ @Nonnull T deserialize(@Nonnull NormalizedNode<?,?> data);
+
+ /**
+ * Converts from Binding to Normalized Node representation of data.
+ *
+ * @param data Binding representation of data
+ * @return Normalized Node representation of data
+ */
+ @Override
+ @Nonnull NormalizedNode<?,?> serialize(@Nonnull T data);
+
+}
--- /dev/null
+/*
+ * 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.mdsal.binding.dom.codec.api;
+
+import java.util.Map.Entry;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import org.opendaylight.yangtools.yang.binding.DataContainer;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.Notification;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+
+/**
+ * Serialization service, which provides two-way serialization between Java
+ * Binding Data representation and NormalizedNode representation.
+ */
+public interface BindingNormalizedNodeSerializer extends
+ org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer {
+
+ /**
+ * Translates supplied Binding Instance Identifier into NormalizedNode
+ * instance identifier.
+ *
+ * @param binding
+ * Binding Instance Identifier
+ * @return DOM Instance Identifier
+ * @throws IllegalArgumentException
+ * If supplied Instance Identifier is not valid.
+ */
+ @Override
+ YangInstanceIdentifier toYangInstanceIdentifier(@Nonnull InstanceIdentifier<?> binding);
+
+ /**
+ * Translates supplied YANG Instance Identifier into Binding instance
+ * identifier.
+ *
+ * @param dom
+ * YANG Instance Identifier
+ * @return Binding Instance Identifier, or null if the instance identifier
+ * is not representable.
+ */
+ @Override
+ @Nullable
+ InstanceIdentifier<?> fromYangInstanceIdentifier(@Nonnull YangInstanceIdentifier dom);
+
+ /**
+ * Translates supplied Binding Instance Identifier and data into
+ * NormalizedNode representation.
+ *
+ * @param path
+ * Binding Instance Identifier pointing to data
+ * @param data
+ * Data object representing data
+ * @return NormalizedNode representation
+ * @throws IllegalArgumentException
+ * If supplied Instance Identifier is not valid.
+ */
+ @Override
+ <T extends DataObject> Entry<YangInstanceIdentifier, NormalizedNode<?, ?>> toNormalizedNode(
+ InstanceIdentifier<T> path, T data);
+
+ /**
+ * Translates supplied YANG Instance Identifier and NormalizedNode into
+ * Binding data.
+ *
+ * @param path Binding Instance Identifier
+ * @param data NormalizedNode representing data
+ * @return DOM Instance Identifier
+ */
+ @Override
+ @Nullable
+ Entry<InstanceIdentifier<?>, DataObject> fromNormalizedNode(@Nonnull YangInstanceIdentifier path,
+ NormalizedNode<?, ?> data);
+
+ /**
+ * Translates supplied NormalizedNode Notification into Binding data.
+ *
+ * @param path Schema Path of Notification, schema path is absolute, and consists of Notification QName.
+ * @param data NormalizedNode representing data
+ * @return Binding representation of Notification
+ */
+ @Override
+ @Nullable Notification fromNormalizedNodeNotification(@Nonnull SchemaPath path,@Nonnull ContainerNode data);
+
+ /**
+ * Translates supplied NormalizedNode RPC input or output into Binding data.
+ *
+ * @param path Schema path of RPC data, Schema path consists of rpc QName and input / output QName.
+ * @param data NormalizedNode representing data
+ * @return Binding representation of RPC data
+ */
+ @Override
+ @Nullable DataObject fromNormalizedNodeRpcData(@Nonnull SchemaPath path,@Nonnull ContainerNode data);
+
+ /**
+ * Translates supplied Binding Notification or output into NormalizedNode notification.
+ *
+ * @param data NormalizedNode representing notification data
+ * @return NormalizedNode representation of notification
+ */
+ @Override
+ @Nonnull ContainerNode toNormalizedNodeNotification(@Nonnull Notification data);
+
+ /**
+ * Translates supplied Binding RPC input or output into NormalizedNode data.
+ *
+ * @param data NormalizedNode representing rpc data
+ * @return NormalizedNode representation of rpc data
+ */
+ @Override
+ @Nonnull ContainerNode toNormalizedNodeRpcData(@Nonnull DataContainer data);
+}
--- /dev/null
+/*
+ * 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.mdsal.binding.dom.codec.api;
+
+import java.util.Map.Entry;
+import javax.annotation.Nonnull;
+import org.opendaylight.yangtools.yang.binding.BindingStreamEventWriter;
+import org.opendaylight.yangtools.yang.binding.DataContainer;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.Notification;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
+
+/**
+ *
+ * Factory for {@link BindingStreamEventWriter}, which provides stream writers
+ * which translates data and delegates calls to
+ * {@link NormalizedNodeStreamWriter}.
+ *
+ */
+public interface BindingNormalizedNodeWriterFactory extends
+ org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeWriterFactory {
+
+ /**
+ *
+ * Creates a {@link BindingStreamEventWriter} for data tree path which will
+ * translate to NormalizedNode model and invoke proper events on supplied
+ * {@link NormalizedNodeStreamWriter}.
+ * <p>
+ * Also provides translation of supplied Instance Identifier to
+ * {@link YangInstanceIdentifier} so client code, does not need to translate
+ * that separately.
+ * <p>
+ * If {@link YangInstanceIdentifier} is not needed, please use
+ * {@link #newWriter(InstanceIdentifier, NormalizedNodeStreamWriter)}
+ * method to conserve resources.
+ *
+ * @param path
+ * Binding Path in conceptual data tree, for which writer should
+ * be instantiated
+ * @param domWriter
+ * Stream writer on which events will be invoked.
+ * @return Instance Identifier and {@link BindingStreamEventWriter}
+ * which will write to supplied {@link NormalizedNodeStreamWriter}.
+ * @throws IllegalArgumentException If supplied Instance Identifier is not valid.
+ */
+ @Override
+ @Nonnull Entry<YangInstanceIdentifier, BindingStreamEventWriter> newWriterAndIdentifier(@Nonnull InstanceIdentifier<?> path,
+ @Nonnull NormalizedNodeStreamWriter domWriter);
+
+ /**
+ *
+ * Creates a {@link BindingStreamEventWriter} for data tree path which will
+ * translate to NormalizedNode model and invoke proper events on supplied
+ * {@link NormalizedNodeStreamWriter}.
+ * <p>
+ *
+ * This variation does not provide YANG instance identifier and is useful
+ * for use-cases, where {@link InstanceIdentifier} translation is done
+ * in other way, or YANG instance identifier is unnecessary (e.g. notifications, RPCs).
+ *
+ * @param path Binding Path in conceptual data tree, for which writer should
+ * be instantiated
+ * @param domWriter Stream writer on which events will be invoked.
+ * @return {@link BindingStreamEventWriter}
+ * which will write to supplied {@link NormalizedNodeStreamWriter}.
+ * @throws IllegalArgumentException If supplied Instance Identifier is not valid.
+ */
+ @Override
+ @Nonnull
+ BindingStreamEventWriter newWriter(@Nonnull InstanceIdentifier<?> path,
+ @Nonnull NormalizedNodeStreamWriter domWriter);
+
+ /**
+ *
+ * Creates a {@link BindingStreamEventWriter} for rpc data which will
+ * translate to NormalizedNode model and invoke proper events on supplied
+ * {@link NormalizedNodeStreamWriter}.
+ *
+ * @param rpcInputOrOutput Binding class representing RPC input or output,
+ * for which writer should be instantiated
+ * @param domWriter
+ * Stream writer on which events will be invoked.
+ * @return {@link BindingStreamEventWriter} which will write to supplied
+ * {@link NormalizedNodeStreamWriter}.
+ */
+ @Override
+ @Nonnull
+ BindingStreamEventWriter newRpcWriter(@Nonnull Class<? extends DataContainer> rpcInputOrOutput,
+ @Nonnull NormalizedNodeStreamWriter domWriter);
+
+ /**
+ *
+ * Creates a {@link BindingStreamEventWriter} for notification which will
+ * translate to NormalizedNode model and invoke proper events on supplied
+ * {@link NormalizedNodeStreamWriter}.
+ *
+ * @param notification Binding class representing notification,
+ * for which writer should be instantiated
+ * @param domWriter
+ * Stream writer on which events will be invoked.
+ * @return {@link BindingStreamEventWriter} which will write to supplied
+ * {@link NormalizedNodeStreamWriter}.
+ */
+ @Override
+ @Nonnull
+ BindingStreamEventWriter newNotificationWriter(@Nonnull Class<? extends Notification> notification,
+ @Nonnull NormalizedNodeStreamWriter domWriter);
+}
*
* Navigable tree representing hierarchy of Binding to Normalized Node codecs
*
- * This navigable tree is associated to conrete set of YANG models, represented
- * by SchemaContext and provides access to subtree specific serialization
- * context.
+ * This navigable tree is associated to conrete set of YANG models, represented by SchemaContext and
+ * provides access to subtree specific serialization context.
*
- * TODO: Add more detailed documentation
+ * @deprecated Use {@link org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTree} instead.
**/
+@Deprecated
public interface BindingCodecTree {
@Nullable <T extends DataObject> BindingCodecTreeNode<T> getSubtreeCodec(InstanceIdentifier<T> path);
import org.opendaylight.yangtools.sal.binding.generator.util.BindingRuntimeContext;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+
+/**
+ *
+ * @deprecated Use {@link org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeFactory}
+ * instead.
+ */
+@Deprecated
public interface BindingCodecTreeFactory {
/**
* NormalizedNode.
*
*/
-@Beta
+@Deprecated
public interface BindingCodecTreeNode<T extends DataObject> extends BindingNormalizedNodeCodec<T> {
/**
*/
package org.opendaylight.yangtools.binding.data.codec.api;
-import com.google.common.annotations.Beta;
import org.opendaylight.yangtools.yang.binding.DataObject;
/**
*
* @param <T> Binding representtion of data
*/
-@Beta
+@Deprecated
public interface BindingNormalizedNodeCachingCodec<T extends DataObject> extends BindingNormalizedNodeCodec<T>, AutoCloseable {
/**
* Invoking close will invalidate this codec and any of its child
*/
package org.opendaylight.yangtools.binding.data.codec.api;
-import com.google.common.annotations.Beta;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
*
* @param <T> Binding representation of data
*/
-@Beta
+@Deprecated
public interface BindingNormalizedNodeCodec<T extends DataObject> {
/**
* Serialization service, which provides two-way serialization between Java
* Binding Data representation and NormalizedNode representation.
*/
+@Deprecated
public interface BindingNormalizedNodeSerializer {
/**
* {@link NormalizedNodeStreamWriter}.
*
*/
+@Deprecated
public interface BindingNormalizedNodeWriterFactory {
/**
import java.util.concurrent.Callable;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingCodecTree;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingCodecTreeNode;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTree;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeNode;
import org.opendaylight.yangtools.binding.data.codec.impl.NodeCodecContext.CodecContextFactory;
import org.opendaylight.yangtools.concepts.Codec;
import org.opendaylight.yangtools.concepts.Immutable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingCodecTree;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingCodecTreeFactory;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeWriterFactory;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTree;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeFactory;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeWriterFactory;
import org.opendaylight.yangtools.binding.data.codec.gen.impl.DataObjectSerializerGenerator;
import org.opendaylight.yangtools.concepts.Delegator;
import org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext;
import com.google.common.base.Preconditions;
import java.util.Set;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeCachingCodec;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeCachingCodec;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeCachingCodec;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeCachingCodec;
import org.opendaylight.yangtools.yang.binding.BindingStreamEventWriter;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.DataObjectSerializer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingCodecTreeNode;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeCachingCodec;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeNode;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeCachingCodec;
import org.opendaylight.yangtools.concepts.Codec;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import com.google.common.collect.ImmutableMap;
import java.util.List;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingCodecTreeNode;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeNode;
import org.opendaylight.yangtools.concepts.Codec;
import org.opendaylight.yangtools.sal.binding.generator.util.BindingRuntimeContext;
import org.opendaylight.yangtools.yang.binding.DataObject;
*/
package org.opendaylight.yangtools.binding.data.codec.impl;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeCachingCodec;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeCodec;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeCachingCodec;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeCodec;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListKey;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingCodecTreeNode;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeCachingCodec;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeNode;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeCachingCodec;
import org.opendaylight.yangtools.binding.data.codec.gen.impl.StreamWriterGenerator;
import org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry;
import org.opendaylight.yangtools.sal.binding.generator.util.JavassistUtils;
package org.opendaylight.yangtools.binding.data.codec.test;
import static org.junit.Assert.assertEquals;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.top;
-import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.topLevelList;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.top;
+import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.topLevelList;
import static org.opendaylight.yangtools.yang.data.impl.schema.Builders.augmentationBuilder;
import static org.opendaylight.yangtools.yang.data.impl.schema.Builders.choiceBuilder;
import static org.opendaylight.yangtools.yang.data.impl.schema.Builders.containerBuilder;
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- </instructions>
- </configuration>
</plugin>
</plugins>
</build>
<instructions>
<Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
<Export-Package>
- org.opendaylight.yangtools.sal.binding.generator.impl.*,
- org.opendaylight.yangtools.sal.binding.generator.util.*
+ {local-packages},
+ org.opendaylight.yangtools.sal.binding.generator.impl,
</Export-Package>
<Embed-Dependency>
org.eclipse.xtend.lib;inline=true,
<groupId>org.eclipse.xtend</groupId>
<artifactId>xtend-maven-plugin</artifactId>
</plugin>
-<!-- <plugin>
- <artifactId>maven-enforcer-plugin</artifactId>
- <executions>
- <execution>
- <id>enforce</id>
- <phase>none</phase>
- </execution>
- </executions>
- </plugin> -->
</plugins>
</build>
* 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.test.model.util;
+package org.opendaylight.mdsal.binding.test.model.util;
import com.google.common.collect.ImmutableList;
import java.util.Arrays;
+++ /dev/null
-/*
- * 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.binding.util;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
-
-import com.google.common.collect.ClassToInstanceMap;
-import com.google.common.collect.MutableClassToInstanceMap;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
-import org.opendaylight.controller.sal.binding.api.BindingAwareConsumer;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.controller.sal.binding.api.BindingAwareService;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.yangtools.yang.binding.RpcService;
-
-public class BindingContextUtils {
-
- public static ConsumerContext createConsumerContext(final BindingAwareConsumer consumer,
- final ClassToInstanceMap<BindingAwareService> serviceProvider) {
- checkNotNull(consumer,"Consumer should not be null");
- checkNotNull(serviceProvider,"Service map should not be null");
- return new SingleConsumerContextImpl(serviceProvider);
- }
-
- public static ProviderContext createProviderContext(final BindingAwareProvider provider,
- final ClassToInstanceMap<BindingAwareService> serviceProvider) {
- checkNotNull(provider,"Provider should not be null");
- checkNotNull(serviceProvider,"Service map should not be null");
- return new SingleProviderContextImpl(serviceProvider);
- }
-
- public static ConsumerContext createConsumerContextAndInitialize(final BindingAwareConsumer consumer,
- final ClassToInstanceMap<BindingAwareService> serviceProvider) {
- final ConsumerContext context = createConsumerContext(consumer, serviceProvider);
- consumer.onSessionInitialized(context);
- return context;
- }
-
- public static ProviderContext createProviderContextAndInitialize(final BindingAwareProvider provider,
- final ClassToInstanceMap<BindingAwareService> serviceProvider) {
- final ProviderContext context = createProviderContext(provider, serviceProvider);
- provider.onSessionInitiated(context);
- return context;
- }
-
- public static <T extends BindingAwareService> T createContextProxyOrReturnService(final Class<T> service, final T instance) {
- // FIXME: Create Proxy
- return instance;
- }
-
- private static class SingleConsumerContextImpl implements ConsumerContext, AutoCloseable {
-
- private ClassToInstanceMap<BindingAwareService> alreadyRetrievedServices;
- private ClassToInstanceMap<BindingAwareService> serviceProvider;
-
- public SingleConsumerContextImpl(final ClassToInstanceMap<BindingAwareService> serviceProvider) {
- this.alreadyRetrievedServices = MutableClassToInstanceMap.create();
- this.serviceProvider = serviceProvider;
- }
-
- @Override
- public final <T extends RpcService> T getRpcService(final Class<T> module) {
- return getSALService(RpcConsumerRegistry.class).getRpcService(module);
- }
-
- @Override
- public final <T extends BindingAwareService> T getSALService(final Class<T> service) {
- checkNotNull(service,"Service class should not be null.");
- final T potential = alreadyRetrievedServices.getInstance(service);
- if(potential != null) {
- return potential;
- }
- return tryToRetrieveSalService(service);
- }
-
- private synchronized <T extends BindingAwareService> T tryToRetrieveSalService(final Class<T> service) {
- final T potential = alreadyRetrievedServices.getInstance(service);
- if(potential != null) {
- return potential;
- }
- final T requested = serviceProvider.getInstance(service);
- if(requested == null) {
- throw new IllegalArgumentException("Requested service "+service.getName() +" is not available.");
- }
- final T retrieved = BindingContextUtils.createContextProxyOrReturnService(service,requested);
- alreadyRetrievedServices.put(service, retrieved);
- return retrieved;
- }
-
- @Override
- public final void close() throws Exception {
- alreadyRetrievedServices = null;
- serviceProvider = null;
- }
- }
-
- private static class SingleProviderContextImpl extends SingleConsumerContextImpl implements ProviderContext {
-
- public SingleProviderContextImpl(final ClassToInstanceMap<BindingAwareService> serviceProvider) {
- super(serviceProvider);
- }
-
- @Override
- public <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(final Class<T> type,
- final T implementation) throws IllegalStateException {
- return getSALService(RpcProviderRegistry.class).addRoutedRpcImplementation(type, implementation);
- }
-
- @Override
- public <T extends RpcService> RpcRegistration<T> addRpcImplementation(final Class<T> type, final T implementation)
- throws IllegalStateException {
- return getSALService(RpcProviderRegistry.class).addRpcImplementation(type, implementation);
- }
- }
-}
* @param listKey component key type
* @return key associated with the component, or null if the component type
* is not present.
+ *
+ * @deprecated Use {@link #firstKeyOf(Class)} instead.
*/
+ @Deprecated
public final <N extends Identifiable<K> & DataObject, K extends Identifier<N>> K firstKeyOf(final Class<N> listItem, final Class<K> listKey) {
+ return firstKeyOf(listItem);
+ }
+
+ /**
+ * Return the key associated with the first component of specified type in
+ * an identifier.
+ *
+ * @param listItem component type
+ * @return key associated with the component, or null if the component type
+ * is not present.
+ */
+ public final <N extends Identifiable<K> & DataObject, K extends Identifier<N>> K firstKeyOf(final Class<N> listItem) {
for (final PathArgument i : pathArguments) {
if (listItem.equals(i.getType())) {
@SuppressWarnings("unchecked")
<dependencyManagement>
<dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>features-mdsal</artifactId>
+ <classifier>features</classifier>
+ <version>${project.version}</version>
+ <type>xml</type>
+ </dependency>
+
<!-- Common APIs for Binding and DOM -->
<dependency>
- <groupId>${project.groupId}</groupId>
+ <groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-common-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>${project.groupId}</groupId>
+ <groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-dom-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>${project.groupId}</groupId>
+ <groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-dom-spi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>${project.groupId}</groupId>
+ <groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-dom-broker</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>${project.groupId}</groupId>
+ <groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-dom-inmemory-datastore</artifactId>
<version>${project.version}</version>
</dependency>
<artifactId>maven-sal-api-gen-plugin</artifactId>
<version>0.8.0-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>mdsal-binding-model-api</artifactId>
- <version>0.8.0-SNAPSHOT</version>
- </dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-binding-generator-api</artifactId>
<version>0.8.0-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>mdsal-binding-generator-spi</artifactId>
- <version>0.8.0-SNAPSHOT</version>
- </dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-binding-generator-util</artifactId>
<artifactId>yang-binding</artifactId>
<version>0.8.0-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>mdsal-binding-type-provider</artifactId>
- <version>0.8.0-SNAPSHOT</version>
- </dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-binding-dom-codec</artifactId>
</dependency>
<dependency>
- <groupId>${project.groupId}</groupId>
+ <groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-binding-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>${project.groupId}</groupId>
+ <groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-binding-dom-adapter</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>${project.groupId}</groupId>
+ <groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-binding-util</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>yang-ext</artifactId>
+ <version>2013.09.07.8-SNAPSHOT</version>
+ </dependency>
+
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-binding-test-model</artifactId>
--- /dev/null
+= MD-SAL Karaf Features =
+
+
+[plantuml]
+....
+
+[odl-yangtools-yang-parser] as yang.parser
+[odl-yangtools-yang-data] as yang.data
+[odl-yangtools-common] as common
+
+[odl-mdsal-common] as common.api
+[odl-mdsal-dom] as dom
+[odl-mdsal-dom-api] as dom.api
+[odl-mdsal-dom-broker] as dom.broker
+[odl-mdsal-binding-base] as binding.base
+[odl-mdsal-binding] as binding
+[odl-mdsal-binding-api] as binding.api
+[odl-mdsal-binding-runtime] as binding.runtime
+[odl-mdsal-binding-dom-adapter] as binding.dom.adapter
+[odl-mdsal-binding-models] as binding.models
+
+
+yang.data --> common
+yang.data --> yang.parser
+yang.parser --> common
+
+dom.api --> yang.data
+dom.api --> common.api
+
+dom.broker --> dom.api
+dom.broker --> yang.parser
+
+
+binding.base --> common
+
+binding.dom.adapter --> binding.api
+binding.dom.adapter --> binding.runtime
+binding.dom.adapter --> dom.api
+
+binding.api --> binding.base
+binding.api --> common.api
+
+binding.runtime --> binding.base
+binding.runtime --> yang.data
+
+binding.models --> binding.base
+
+dom --> dom.broker
+dom --> dom.api
+
+binding --> binding.dom.adapter
+binding --> dom
+
+....
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ 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
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.opendaylight.odlparent</groupId>
+ <artifactId>features-parent</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>features-mdsal</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <properties>
+ <yangtools.version>0.8.0-SNAPSHOT</yangtools.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yangtools-artifacts</artifactId>
+ <version>${yangtools.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>${project.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>features-yangtools</artifactId>
+ <classifier>features</classifier>
+ <type>xml</type>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>mdsal-common-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>mdsal-dom-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>mdsal-dom-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>mdsal-dom-broker</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>mdsal-dom-inmemory-datastore</artifactId>
+ </dependency>
+
+ <!-- Binding MD-SAL & Java Binding -->
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>maven-sal-api-gen-plugin</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>mdsal-binding-generator-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>mdsal-binding-generator-util</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>mdsal-binding-generator-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>mdsal-binding-java-api-generator</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>yang-binding</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>mdsal-binding-dom-codec</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>mdsal-binding-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>mdsal-binding-dom-adapter</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>mdsal-binding-util</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>yang-binding</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}.model</groupId>
+ <artifactId>yang-ext</artifactId>
+ </dependency>
+ </dependencies>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ 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
+-->
+<features name="odl-yangtools-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
+
+ <repository>mvn:org.opendaylight.yangtools/features-yangtools/{{VERSION}}/xml/features</repository>
+
+ <feature name='odl-mdsal-binding' version='${project.version}' description='OpenDaylight :: MD-SAL :: Binding'>
+ <feature version='${project.version}'>odl-mdsal-binding-dom-adapter</feature>
+ <feature version='${project.version}'>odl-mdsal-dom</feature>
+ </feature>
+
+ <feature name='odl-mdsal-dom' version='${project.version}' description='OpenDaylight :: MD-SAL :: DOM'>
+ <feature version='${project.version}'>odl-mdsal-dom-broker</feature>
+ </feature>
+
+ <feature name='odl-mdsal-common' version='${project.version}' description='OpenDaylight :: MD-SAL :: DOM Broker'>
+ <feature version='${yangtools.version}'>odl-yangtools-common</feature>
+ <bundle>mvn:org.opendaylight.mdsal/mdsal-common-api/{{VERSION}}</bundle>
+ </feature>
+
+ <feature name='odl-mdsal-dom-api' version='${project.version}' description='OpenDaylight :: MD-SAL :: DOM API & SPI'>
+ <feature version='${project.version}'>odl-mdsal-common</feature>
+ <feature version='${yangtools.version}'>odl-yangtools-yang-data</feature>
+ <bundle>mvn:org.opendaylight.mdsal/mdsal-dom-api/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal/mdsal-dom-spi/{{VERSION}}</bundle>
+ </feature>
+
+ <feature name='odl-mdsal-dom-broker' version='${project.version}' description='OpenDaylight :: MD-SAL :: DOM Broker'>
+ <feature version='${yangtools.version}'>odl-yangtools-yang-parser</feature>
+ <feature version='${project.version}'>odl-mdsal-dom-api</feature>
+ <bundle>mvn:com.lmax/disruptor/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal/mdsal-dom-api/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal/mdsal-dom-spi/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal/mdsal-dom-broker/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal/mdsal-dom-inmemory-datastore/{{VERSION}}</bundle>
+ </feature>
+
+ <feature name='odl-mdsal-binding-base' version='${project.version}' description='OpenDaylight :: MD-SAL :: Binding Base Concepts'>
+ <feature version='${yangtools.version}'>odl-yangtools-common</feature>
+ <bundle>mvn:org.opendaylight.mdsal/yang-binding/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal.model/yang-ext/{{VERSION}}</bundle>
+ </feature>
+
+ <feature name='odl-mdsal-binding-runtime' version='${project.version}' description='OpenDaylight :: MD-SAL :: Binding Generator'>
+ <feature version='${project.version}'>odl-mdsal-binding-base</feature>
+ <feature version='${yangtools.version}'>odl-yangtools-yang-data</feature>
+ <bundle>mvn:org.javassist/javassist/{{VERSION}}</bundle>
+ <bundle>mvn:org.apache.commons/commons-lang3/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal/mdsal-binding-generator-api/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal/mdsal-binding-generator-impl/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal/mdsal-binding-generator-util/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal/mdsal-binding-dom-codec/{{VERSION}}</bundle>
+ </feature>
+
+ <feature name='odl-mdsal-binding-api' version='${project.version}' description='OpenDaylight :: MD-SAL :: Binding Base Concepts'>
+ <feature version='${project.version}'>odl-mdsal-common</feature>
+ <feature version='${project.version}'>odl-mdsal-binding-base</feature>
+ <bundle>mvn:org.opendaylight.mdsal/mdsal-binding-api/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal/mdsal-binding-util/{{VERSION}}</bundle>
+ </feature>
+
+ <feature name='odl-mdsal-binding-dom-adapter' version='${project.version}' description='OpenDaylight :: MD-SAL :: Binding Generator'>
+ <feature version='${project.version}'>odl-mdsal-binding-runtime</feature>
+ <feature version='${project.version}'>odl-mdsal-binding-api</feature>
+ <feature version='${project.version}'>odl-mdsal-dom-api</feature>
+ <bundle>mvn:org.opendaylight.mdsal/mdsal-binding-dom-adapter/{{VERSION}}</bundle>
+ </feature>
+
+</features>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ 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
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.opendaylight.odlparent</groupId>
+ <artifactId>features-parent</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>features-yangtools</artifactId>
+ <version>0.8.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yangtools-artifacts</artifactId>
+ <version>${project.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.yangtools.model</groupId>
+ <artifactId>iana-if-type-2014-05-08</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools.model</groupId>
+ <artifactId>ietf-inet-types</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools.model</groupId>
+ <artifactId>ietf-interfaces</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools.model</groupId>
+ <artifactId>ietf-restconf</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools.model</groupId>
+ <artifactId>ietf-yang-types</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools.model</groupId>
+ <artifactId>ietf-yang-types-20130715</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools.model</groupId>
+ <artifactId>yang-ext</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools.model</groupId>
+ <artifactId>opendaylight-l2-types</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools.model</groupId>
+ <artifactId>ietf-ted</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools.model</groupId>
+ <artifactId>ietf-topology</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools.model</groupId>
+ <artifactId>ietf-topology-isis</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools.model</groupId>
+ <artifactId>ietf-topology-ospf</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools.model</groupId>
+ <artifactId>ietf-topology-l3-unicast-igp</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools.thirdparty</groupId>
+ <artifactId>antlr4-runtime-osgi-nohead</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-data-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-data-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-data-operations</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-data-util</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-data-codec-gson</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-model-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-model-util</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-parser-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-parser-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-binding</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>util</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>concepts</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>object-cache-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>object-cache-guava</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>object-cache-noop</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>binding-generator-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>binding-generator-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>binding-generator-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>binding-generator-util</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>binding-model-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>binding-type-provider</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>restconf-client-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>restconf-client-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>restconf-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>binding-data-codec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+ </dependencies>
+</project>
+++ /dev/null
-/*
- * 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.common.api;
-
-import java.util.EventListener;
-
-import org.opendaylight.yangtools.concepts.Registration;
-
-public interface RegistrationListener<T extends Registration> extends EventListener {
-
- void onRegister(T registration);
-
- void onUnregister(T registration);
-}
+++ /dev/null
-/*
- * 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.common.api;
-
-public enum TransactionStatus {
- /**
- * The transaction has been freshly allocated. The user is still accessing
- * it and it has not been sealed.
- */
- NEW,
- /**
- * The transaction has been completed by the user and sealed. It is currently
- * awaiting execution.
- */
- SUBMITED,
- /**
- * The transaction has been successfully committed to backing store.
- */
- COMMITED,
- /**
- * The transaction has failed to commit due to some underlying issue.
- */
- FAILED,
- /**
- * Currently unused.
- */
- CANCELED,
-}
* 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.common.api.data;
+package org.opendaylight.mdsal.common.api;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.concepts.Path;
/**
*
- * Base interface that provides access to a conceptual data tree store and also provides the ability to
- * subscribe for changes to data under a given branch of the tree.
+ * Base interface that provides access to a conceptual data tree store and also provides the ability
+ * to subscribe for changes to data under a given branch of the tree.
*
* <p>
* All operations on the data tree are performed via one of the transactions:
* </ul>
*
* <p>
- * These transactions provide a stable isolated view of data tree, which is
- * guaranteed to be not affected by other concurrent transactions, until
- * transaction is committed.
+ * These transactions provide a stable isolated view of data tree, which is guaranteed to be not
+ * affected by other concurrent transactions, until transaction is committed.
*
* <p>
- * For a detailed explanation of how transaction are isolated and how transaction-local
- * changes are committed to global data tree, see
- * {@link AsyncReadTransaction}, {@link AsyncWriteTransaction},
- * {@link AsyncReadWriteTransaction} and {@link AsyncWriteTransaction#commit()}.
+ * For a detailed explanation of how transaction are isolated and how transaction-local changes are
+ * committed to global data tree, see {@link AsyncReadTransaction}, {@link AsyncWriteTransaction},
+ * {@link AsyncReadWriteTransaction} and {@link AsyncWriteTransaction#submit()}.
*
*
* <p>
- * It is strongly recommended to use the type of transaction, which
- * provides only the minimal capabilities you need. This allows for
- * optimizations at the data broker / data store level. For example,
- * implementations may optimize the transaction for reading if they know ahead
- * of time that you only need to read data - such as not keeping additional meta-data,
- * which may be required for write transactions.
+ * It is strongly recommended to use the type of transaction, which provides only the minimal
+ * capabilities you need. This allows for optimizations at the data broker / data store level. For
+ * example, implementations may optimize the transaction for reading if they know ahead of time that
+ * you only need to read data - such as not keeping additional meta-data, which may be required for
+ * write transactions.
*
* <p>
- * <b>Implementation Note:</b> This interface is not intended to be implemented
- * by users of MD-SAL, but only to be consumed by them.
+ * <b>Implementation Note:</b> This interface is not intended to be implemented by users of MD-SAL,
+ * but only to be consumed by them.
*
- * @param <P>
- * Type of path (subtree identifier), which represents location in
- * tree
- * @param <D>
- * Type of data (payload), which represents data payload
+ * @param <P> Type of path (subtree identifier), which represents location in tree
+ * @param <D> Type of data (payload), which represents data payload
*/
public interface AsyncDataBroker<P extends Path<P>, D, L extends AsyncDataChangeListener<P, D>> extends //
AsyncDataTransactionFactory<P, D> {
* 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.common.api.data;
+package org.opendaylight.mdsal.common.api;
import java.util.Map;
import java.util.Set;
* 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.common.api.data;
+package org.opendaylight.mdsal.common.api;
import java.util.EventListener;
import org.opendaylight.yangtools.concepts.Path;
* 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.common.api.data;
+package org.opendaylight.mdsal.common.api;
import org.opendaylight.yangtools.concepts.Path;
/**
- * A factory which allocates new transactions to operate on the data
- * tree.
+ * A factory which allocates new transactions to operate on the data tree.
*
* <p>
- * <b>Note:</b> This interface is not intended to be used directly, but rather
- * via subinterfaces which introduces additional semantics to allocated
- * transactions.
+ * <b>Note:</b> This interface is not intended to be used directly, but rather via subinterfaces
+ * which introduces additional semantics to allocated transactions.
* <ul>
* <li> {@link AsyncDataBroker}
* <li> {@link TransactionChain}
* </ul>
*
* <p>
- * These transactions provides a stable isolated view of the data tree, which is
- * guaranteed to be not affected by other concurrent transactions, until
- * transaction is committed.
+ * These transactions provides a stable isolated view of the data tree, which is guaranteed to be
+ * not affected by other concurrent transactions, until transaction is committed.
*
* <p>
- * For a detailed explanation of how transaction are isolated and how transaction-local
- * changes are committed to global data tree, see
- * {@link AsyncReadTransaction}, {@link AsyncWriteTransaction},
- * {@link AsyncReadWriteTransaction} and {@link AsyncWriteTransaction#commit()}.
+ * For a detailed explanation of how transaction are isolated and how transaction-local changes are
+ * committed to global data tree, see {@link AsyncReadTransaction}, {@link AsyncWriteTransaction},
+ * {@link AsyncReadWriteTransaction} and {@link AsyncWriteTransaction#submit()}.
*
* <p>
- * It is strongly recommended to use the type of transaction, which
- * provides only the minimal capabilities you need. This allows for
- * optimizations at the data broker / data store level. For example,
- * implementations may optimize the transaction for reading if they know ahead
- * of time that you only need to read data - such as not keeping additional meta-data,
- * which may be required for write transactions.
- *<p>
- * <b>Implementation Note:</b> This interface is not intended to be implemented
- * by users of MD-SAL, but only to be consumed by them.
+ * It is strongly recommended to use the type of transaction, which provides only the minimal
+ * capabilities you need. This allows for optimizations at the data broker / data store level. For
+ * example, implementations may optimize the transaction for reading if they know ahead of time that
+ * you only need to read data - such as not keeping additional meta-data, which may be required for
+ * write transactions.
+ * <p>
+ * <b>Implementation Note:</b> This interface is not intended to be implemented by users of MD-SAL,
+ * but only to be consumed by them.
*
* @see AsyncDataBroker
* @see TransactionChain
*
- * @param <P>
- * Type of path (subtree identifier), which represents location in
- * tree
- * @param <D>
- * Type of data (payload), which represents data payload
+ * @param <P> Type of path (subtree identifier), which represents location in tree
+ * @param <D> Type of data (payload), which represents data payload
*/
public interface AsyncDataTransactionFactory<P extends Path<P>, D> {
AsyncReadOnlyTransaction<P, D> newReadOnlyTransaction();
/**
- * Allocates new read-write transaction which provides a mutable view of the data
- * tree.
+ * Allocates new read-write transaction which provides a mutable view of the data tree.
*
* <p>
- * Preconditions for mutation of data tree are captured from the snapshot of
- * data tree state, when the transaction is allocated. If data was
- * changed during transaction in an incompatible way then the commit of this transaction
- * will fail. See {@link AsyncWriteTransaction#commit()} for more
- * details about conflicting and not-conflicting changes and
- * failure scenarios.
+ * Preconditions for mutation of data tree are captured from the snapshot of data tree state,
+ * when the transaction is allocated. If data was changed during transaction in an incompatible
+ * way then the commit of this transaction will fail. See {@link AsyncWriteTransaction#submit()}
+ * for more details about conflicting and not-conflicting changes and failure scenarios.
*
* @return new read-write transaction
*/
AsyncReadWriteTransaction<P, D> newReadWriteTransaction();
/**
- * Allocates new write-only transaction based on latest state of data
- * tree.
+ * Allocates new write-only transaction based on latest state of data tree.
*
* <p>
- * Preconditions for mutation of data tree are captured from the snapshot of
- * data tree state, when the transaction is allocated. If data was
- * changed during transaction in an incompatible way then the commit of this transaction
- * will fail. See {@link AsyncWriteTransaction#commit()} for more
- * details about conflicting and not-conflicting changes and
- * failure scenarios.
+ * Preconditions for mutation of data tree are captured from the snapshot of data tree state,
+ * when the transaction is allocated. If data was changed during transaction in an incompatible
+ * way then the commit of this transaction will fail. See {@link AsyncWriteTransaction#submit()}
+ * for more details about conflicting and not-conflicting changes and failure scenarios.
*
* <p>
- * Since this transaction does not provide a view of the data it SHOULD BE
- * used only by callers which are exclusive writers (exporters of data)
- * to the subtree they modify. This prevents optimistic
- * lock failures as described in {@link AsyncWriteTransaction#commit()}.
+ * Since this transaction does not provide a view of the data it SHOULD BE used only by callers
+ * which are exclusive writers (exporters of data) to the subtree they modify. This prevents
+ * optimistic lock failures as described in {@link AsyncWriteTransaction#submit()}.
* <p>
- * Exclusivity of writers to particular subtree SHOULD BE enforced by
- * external locking mechanism.
+ * Exclusivity of writers to particular subtree SHOULD BE enforced by external locking
+ * mechanism.
*
* @return new write-only transaction
*/
* 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.common.api.data;
+package org.opendaylight.mdsal.common.api;
import org.opendaylight.yangtools.concepts.Path;
* 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.common.api.data;
+package org.opendaylight.mdsal.common.api;
import org.opendaylight.yangtools.concepts.Path;
* Marker interface for stateful read view of the data tree.
*
* <p>
- * View of the data tree is a stable point-in-time snapshot of the current data tree state when
- * the transaction was created. It's state and underlying data tree
- * is not affected by other concurrently running transactions.
+ * View of the data tree is a stable point-in-time snapshot of the current data tree state when the
+ * transaction was created. It's state and underlying data tree is not affected by other
+ * concurrently running transactions.
*
* <p>
- * <b>Implementation Note:</b> This interface is not intended to be implemented
- * by users of MD-SAL, but only to be consumed by them.
+ * <b>Implementation Note:</b> This interface is not intended to be implemented by users of MD-SAL,
+ * but only to be consumed by them.
*
* <h2>Transaction isolation example</h2>
* Lets assume initial state of data tree for <code>PATH</code> is <code>A</code>.
*
* <pre>
- * txRead = broker.newReadOnlyTransaction(); // read Transaction is snapshot of data
+ * txRead = broker.newReadOnlyTransaction(); // read Transaction is snapshot of data
* txWrite = broker.newReadWriteTransactoin(); // concurrent write transaction
- *
- * txRead.read(OPERATIONAL,PATH).get(); // will return Optional containing A
- * txWrite = broker.put(OPERATIONAL,PATH,B); // writes B to PATH
- *
- * txRead.read(OPERATIONAL,PATH).get(); // still returns Optional containing A
- *
- * txWrite.commit().get(); // data tree is updated, PATH contains B
- * txRead.read(OPERATIONAL,PATH).get(); // still returns Optional containing A
- *
+ *
+ * txRead.read(OPERATIONAL, PATH).get(); // will return Optional containing A
+ * txWrite = broker.put(OPERATIONAL, PATH, B); // writes B to PATH
+ *
+ * txRead.read(OPERATIONAL, PATH).get(); // still returns Optional containing A
+ *
+ * txWrite.submit().get(); // data tree is updated, PATH contains B
+ * txRead.read(OPERATIONAL, PATH).get(); // still returns Optional containing A
+ *
* txAfterCommit = broker.newReadOnlyTransaction(); // read Transaction is snapshot of new state
- * txAfterCommit.read(OPERATIONAL,PATH).get(); // returns Optional containing B;
+ * txAfterCommit.read(OPERATIONAL, PATH).get(); // returns Optional containing B;
* </pre>
*
* <p>
- * <b>Note:</b> example contains blocking calls on future only to illustrate
- * that action happened after other asynchronous action. Use of blocking call
- * {@link com.google.common.util.concurrent.ListenableFuture#get()} is discouraged for most
- * uses and you should use
+ * <b>Note:</b> example contains blocking calls on future only to illustrate that action happened
+ * after other asynchronous action. Use of blocking call
+ * {@link com.google.common.util.concurrent.ListenableFuture#get()} is discouraged for most uses and
+ * you should use
* {@link com.google.common.util.concurrent.Futures#addCallback(com.google.common.util.concurrent.ListenableFuture, com.google.common.util.concurrent.FutureCallback)}
- * or other functions from {@link com.google.common.util.concurrent.Futures} to
- * register more specific listeners.
- *
- * @param <P>
- * Type of path (subtree identifier), which represents location in
- * tree
- * @param <D>
- * Type of data (payload), which represents data payload
+ * or other functions from {@link com.google.common.util.concurrent.Futures} to register more
+ * specific listeners.
+ *
+ * @param <P> Type of path (subtree identifier), which represents location in tree
+ * @param <D> Type of data (payload), which represents data payload
*
*/
public interface AsyncReadTransaction<P extends Path<P>, D> extends AsyncTransaction<P, D> {
* 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.common.api.data;
+package org.opendaylight.mdsal.common.api;
import org.opendaylight.yangtools.concepts.Path;
* Transaction enabling a client to have a combined read/write capabilities.
*
* <p>
- * The initial state of the write transaction is stable snapshot of current data tree
- * state captured when transaction was created and it's state and underlying
- * data tree are not affected by other concurrently running transactions.
+ * The initial state of the write transaction is stable snapshot of current data tree state captured
+ * when transaction was created and it's state and underlying data tree are not affected by other
+ * concurrently running transactions.
*
* <p>
- * Write transactions are isolated from other concurrent write transactions. All
- * writes are local to the transaction and represents only a proposal of state
- * change for data tree and it is not visible to any other concurrently running
- * transactions.
+ * Write transactions are isolated from other concurrent write transactions. All writes are local to
+ * the transaction and represents only a proposal of state change for data tree and it is not
+ * visible to any other concurrently running transactions.
*
* <p>
- * Applications publish the changes proposed in the transaction by calling {@link #commit}
- * on the transaction. This seals the transaction
- * (preventing any further writes using this transaction) and submits it to be
- * processed and applied to global conceptual data tree.
+ * Applications publish the changes proposed in the transaction by calling {@link #submit()} on the
+ * transaction. This seals the transaction (preventing any further writes using this transaction)
+ * and submits it to be processed and applied to global conceptual data tree.
*
* <p>
* The transaction commit may fail due to a concurrent transaction modifying and committing data in
- * an incompatible way. See {@link #commit()} for more concrete commit failure examples.
+ * an incompatible way. See {@link #submit()} for more concrete commit failure examples.
*
- * <b>Implementation Note:</b> This interface is not intended to be implemented
- * by users of MD-SAL, but only to be consumed by them.
+ * <b>Implementation Note:</b> This interface is not intended to be implemented by users of MD-SAL,
+ * but only to be consumed by them.
*
* <h2>Examples</h2>
*
* <h3>Transaction local state</h3>
*
- * Let assume initial state of data tree for <code>PATH</code> is <code>A</code>
- * .
+ * Let assume initial state of data tree for <code>PATH</code> is <code>A</code> .
*
* <pre>
* txWrite = broker.newReadWriteTransaction(); // concurrent write transaction
- *
+ *
* txWrite.read(OPERATIONAL,PATH).get() // will return Optional containing A
* txWrite.put(OPERATIONAL,PATH,B); // writes B to PATH
* txWrite.read(OPERATIONAL,PATH).get() // will return Optional Containing B
- *
- * txWrite.commit().get(); // data tree is updated, PATH contains B
- *
+ *
+ * txWrite.submit().get(); // data tree is updated, PATH contains B
+ *
* tx1afterCommit = broker.newReadOnlyTransaction(); // read Transaction is snapshot of new state
* tx1afterCommit.read(OPERATIONAL,PATH).get(); // returns Optional containing B
* </pre>
*
- * As you could see read-write transaction provides capabilities as
- * {@link AsyncWriteTransaction} but also allows for reading proposed changes as
- * if they already happened.
+ * As you could see read-write transaction provides capabilities as {@link AsyncWriteTransaction}
+ * but also allows for reading proposed changes as if they already happened.
*
- * <h3>Transaction isolation (read transaction, read-write transaction)</h3> Let
- * assume initial state of data tree for <code>PATH</code> is <code>A</code>.
+ * <h3>Transaction isolation (read transaction, read-write transaction)</h3> Let assume initial
+ * state of data tree for <code>PATH</code> is <code>A</code>.
*
* <pre>
* txRead = broker.newReadOnlyTransaction(); // read Transaction is snapshot of data
* txWrite = broker.newReadWriteTransaction(); // concurrent write transaction
- *
+ *
* txRead.read(OPERATIONAL,PATH).get(); // will return Optional containing A
* txWrite.read(OPERATIONAL,PATH).get() // will return Optional containing A
- *
+ *
* txWrite.put(OPERATIONAL,PATH,B); // writes B to PATH
* txWrite.read(OPERATIONAL,PATH).get() // will return Optional Containing B
- *
+ *
* txRead.read(OPERATIONAL,PATH).get(); // concurrent read transaction still returns
* // Optional containing A
- *
- * txWrite.commit().get(); // data tree is updated, PATH contains B
+ *
+ * txWrite.submit().get(); // data tree is updated, PATH contains B
* txRead.read(OPERATIONAL,PATH).get(); // still returns Optional containing A
- *
+ *
* tx1afterCommit = broker.newReadOnlyTransaction(); // read Transaction is snapshot of new state
* tx1afterCommit.read(OPERATIONAL,PATH).get(); // returns Optional containing B
* </pre>
*
- * <h3>Transaction isolation (2 concurrent read-write transactions)</h3> Let
- * assume initial state of data tree for <code>PATH</code> is <code>A</code>.
+ * <h3>Transaction isolation (2 concurrent read-write transactions)</h3> Let assume initial state of
+ * data tree for <code>PATH</code> is <code>A</code>.
*
* <pre>
* tx1 = broker.newReadWriteTransaction(); // read Transaction is snapshot of data
* tx2 = broker.newReadWriteTransaction(); // concurrent write transaction
- *
+ *
* tx1.read(OPERATIONAL,PATH).get(); // will return Optional containing A
* tx2.read(OPERATIONAL,PATH).get() // will return Optional containing A
- *
+ *
* tx2.put(OPERATIONAL,PATH,B); // writes B to PATH
* tx2.read(OPERATIONAL,PATH).get() // will return Optional Containing B
- *
+ *
* tx1.read(OPERATIONAL,PATH).get(); // tx1 read-write transaction still sees Optional
* // containing A since is isolated from tx2
* tx1.put(OPERATIONAL,PATH,C); // writes C to PATH
* tx1.read(OPERATIONAL,PATH).get() // will return Optional Containing C
- *
+ *
* tx2.read(OPERATIONAL,PATH).get() // tx2 read-write transaction still sees Optional
* // containing B since is isolated from tx1
- *
- * tx2.commit().get(); // data tree is updated, PATH contains B
+ *
+ * tx2.submit().get(); // data tree is updated, PATH contains B
* tx1.read(OPERATIONAL,PATH).get(); // still returns Optional containing C since is isolated from tx2
- *
+ *
* tx1afterCommit = broker.newReadOnlyTransaction(); // read Transaction is snapshot of new state
* tx1afterCommit.read(OPERATIONAL,PATH).get(); // returns Optional containing B
- *
- * tx1.commit() // Will fail with OptimisticLockFailedException
+ *
+ * tx1.submit() // Will fail with OptimisticLockFailedException
* // which means concurrent transaction changed the same PATH
*
* </pre>
*
* <p>
- * <b>Note:</b> examples contains blocking calls on future only to illustrate
- * that action happened after other asynchronous action. Use of blocking call
- * {@link com.google.common.util.concurrent.ListenableFuture#get()} is discouraged for most uses and you should
- * use
+ * <b>Note:</b> examples contains blocking calls on future only to illustrate that action happened
+ * after other asynchronous action. Use of blocking call
+ * {@link com.google.common.util.concurrent.ListenableFuture#get()} is discouraged for most uses and
+ * you should use
* {@link com.google.common.util.concurrent.Futures#addCallback(com.google.common.util.concurrent.ListenableFuture, com.google.common.util.concurrent.FutureCallback)}
- * or other functions from {@link com.google.common.util.concurrent.Futures} to
- * register more specific listeners.
+ * or other functions from {@link com.google.common.util.concurrent.Futures} to register more
+ * specific listeners.
*
* @see AsyncReadTransaction
* @see AsyncWriteTransaction
*
- * @param <P>
- * Type of path (subtree identifier), which represents location in
- * tree
- * @param <D>
- * Type of data (payload), which represents data payload
+ * @param <P> Type of path (subtree identifier), which represents location in tree
+ * @param <D> Type of data (payload), which represents data payload
*/
public interface AsyncReadWriteTransaction<P extends Path<P>, D> extends AsyncReadTransaction<P, D>,
AsyncWriteTransaction<P, D> {
* 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.common.api.data;
+package org.opendaylight.mdsal.common.api;
import org.opendaylight.yangtools.concepts.Identifiable;
import org.opendaylight.yangtools.concepts.Path;
* 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.common.api.data;
+package org.opendaylight.mdsal.common.api;
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.ListenableFuture;
-import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
import org.opendaylight.yangtools.concepts.Path;
-import org.opendaylight.yangtools.yang.common.RpcResult;
/**
* Write transaction provides mutation capabilities for a data tree.
/**
* Cancels the transaction.
*
- * Transactions can only be cancelled if it's status is
- * {@link TransactionStatus#NEW} or {@link TransactionStatus#SUBMITED}
+ * Transactions can only be cancelled if it was not yet submited.
*
- * Invoking cancel() on {@link TransactionStatus#FAILED} or
- * {@link TransactionStatus#CANCELED} will have no effect, and transaction
- * is considered cancelled.
+ * Invoking cancel() on failed or already canceled will have no effect, and transaction is
+ * considered cancelled.
*
- * Invoking cancel() on finished transaction (future returned by {@link #submit()}
- * already completed with {@link TransactionStatus#COMMITED}) will always
- * fail (return false).
+ * Invoking cancel() on finished transaction (future returned by {@link #submit()} already
+ * successfully completed) will always fail (return false).
*
- * @return <tt>false</tt> if the task could not be cancelled,
- * typically because it has already completed normally;
- * <tt>true</tt> otherwise
+ * @return <tt>false</tt> if the task could not be cancelled, typically because it has already
+ * completed normally; <tt>true</tt> otherwise
*
*/
boolean cancel();
/**
- * Removes a piece of data from specified path. This operation does not fail
- * if the specified path does not exist.
- *
- * @param store
- * Logical data store which should be modified
- * @param path
- * Data object path
- * @throws IllegalStateException
- * if the transaction is no longer {@link TransactionStatus#NEW}
+ * Removes a piece of data from specified path. This operation does not fail if the specified
+ * path does not exist.
+ *
+ * @param store Logical data store which should be modified
+ * @param path Data object path
+ * @throws IllegalStateException if the transaction was submitted or canceled.
*/
void delete(LogicalDatastoreType store, P path);
* <code>merge(LogicalDatastoreType, Path, Object)</code>,
* <code>delete(LogicalDatastoreType, Path)</code> will fail with {@link IllegalStateException}.
*
- * The transaction is marked as {@link TransactionStatus#SUBMITED} and enqueued into the data
- * store back-end for processing.
+ * The transaction is marked as submitted and enqueued into the data store back-end for
+ * processing.
*
* <p>
* Whether or not the commit is successful is determined by versioning of the data tree and
* <pre>
* private void doWrite( final int tries ) {
* WriteTransaction writeTx = dataBroker.newWriteOnlyTransaction();
- *
+ *
* MyDataObject data = ...;
* InstanceIdentifier<MyDataObject> path = ...;
* writeTx.put( LogicalDatastoreType.OPERATIONAL, path, data );
- *
+ *
* Futures.addCallback( writeTx.submit(), new FutureCallback<Void>() {
* public void onSuccess( Void result ) {
* // succeeded
* }
- *
+ *
* public void onFailure( Throwable t ) {
* if( t instanceof OptimisticLockFailedException ) {
* if( ( tries - 1 ) > 0 ) {
* <pre>
* txA = broker.newWriteTransaction(); // allocates new transaction, data tree is empty
* txB = broker.newWriteTransaction(); // allocates new transaction, data tree is empty
- *
+ *
* txA.put(CONFIGURATION, PATH, A); // writes to PATH value A
* txB.put(CONFIGURATION, PATH, B) // writes to PATH value B
- *
+ *
* ListenableFuture futureA = txA.submit(); // transaction A is sealed and submitted
* ListenebleFuture futureB = txB.submit(); // transaction B is sealed and submitted
* </pre>
* will fail with a {@link TransactionCommitFailedException} or an exception derived
* from TransactionCommitFailedException.
*
- * @throws IllegalStateException if the transaction is not {@link TransactionStatus#NEW}
+ * @throws IllegalStateException if the transaction is already submitted or was canceled.
*/
CheckedFuture<Void,TransactionCommitFailedException> submit();
- /**
- * @deprecated Use {@link #submit()} instead.
- */
- @Deprecated
- ListenableFuture<RpcResult<TransactionStatus>> commit();
-
}
* 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.common.api.data;
+package org.opendaylight.mdsal.common.api;
/**
* This exception occurs if the datastore is temporarily unavailable.
* 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.common.api.data;
+package org.opendaylight.mdsal.common.api;
import org.opendaylight.yangtools.concepts.Path;
import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
* 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.common.api.data;
+package org.opendaylight.mdsal.common.api;
public enum LogicalDatastoreType {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.md.sal.common.api.data;
+package org.opendaylight.mdsal.common.api;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.md.sal.common.api.data;
+package org.opendaylight.mdsal.common.api;
import org.opendaylight.yangtools.util.concurrent.ExceptionMapper;
import org.opendaylight.yangtools.yang.common.OperationFailedException;
* 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.common.api.data;
+package org.opendaylight.mdsal.common.api;
import org.opendaylight.yangtools.concepts.Path;
* 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.common.api.data;
+package org.opendaylight.mdsal.common.api;
/**
* Exception thrown when an attempt is made to open a new transaction in a closed
* 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.common.api.data;
+package org.opendaylight.mdsal.common.api;
import org.opendaylight.yangtools.concepts.Path;
* 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.common.api.data;
+package org.opendaylight.mdsal.common.api;
import java.util.EventListener;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.md.sal.common.api.data;
+package org.opendaylight.mdsal.common.api;
import com.google.common.base.Supplier;
import org.opendaylight.yangtools.yang.common.RpcError;
* 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.common.api.data;
+package org.opendaylight.mdsal.common.api;
import org.opendaylight.yangtools.yang.common.OperationFailedException;
import org.opendaylight.yangtools.yang.common.RpcError;
<modules>
<module>parent</module>
<module>artifacts</module>
+ <module>features</module>
<module>mdsal-common-api</module>
</modules>
+++ /dev/null
-/*
- * 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.sal.core.api;
-
-import org.osgi.framework.BundleContext;
-
-/**
- * Core component of the SAL layer responsible for wiring the SAL consumers.
- *
- * The responsibility of the broker is to maintain registration of SAL
- * functionality {@link Consumer}s and {@link Provider}s, store provider and
- * consumer specific context and functionality registration via
- * {@link ConsumerSession} and provide access to infrastructure services, which
- * removes direct dependencies between providers and consumers.
- *
- *
- * The services are exposed via session.
- *
- * <h3>Session-based access</h3>
- *
- * The providers and consumers needs to register in order to use the
- * binding-independent SAL layer and to expose functionality via SAL layer.
- *
- * For more information about session-based access see {@link ConsumerSession}
- * and {@link ProviderSession}
- *
- *
- *
- */
-public interface Broker {
-
- /**
- * Registers the {@link Consumer}, which will use the SAL layer.
- *
- * <p>
- * Note that consumer could register additional functionality at later point
- * by using service and functionality specific APIs.
- *
- * <p>
- * The consumer is required to use returned session for all communication
- * with broker or one of the broker services. The session is announced to
- * the consumer by invoking
- * {@link Consumer#onSessionInitiated(ConsumerSession)}.
- *
- * @param cons
- * Consumer to be registered.
- * @return a session specific to consumer registration
- * @throws IllegalArgumentException
- * If the consumer is <code>null</code>.
- * @throws IllegalStateException
- * If the consumer is already registered.
- */
- ConsumerSession registerConsumer(Consumer cons);
-
- /*
- * @deprecated Use registerConsumer(Consumer cons) instead (BundleContext is no longer used)
- */
- @Deprecated
- ConsumerSession registerConsumer(Consumer cons, BundleContext context);
-
- /**
- * Registers the {@link Provider}, which will use the SAL layer.
- *
- * <p>
- * The consumer is <b>required to use</b> returned session for all
- * communication with broker or one of the broker services. The session is
- * announced to the consumer by invoking
- * {@link Provider#onSessionInitiated(ProviderSession)}.
- *
- *
- * @param prov
- * Provider to be registered.
- * @return a session unique to the provider registration.
- * @throws IllegalArgumentException
- * If the provider is <code>null</code>.
- * @throws IllegalStateException
- * If the consumer is already registered.
- */
- ProviderSession registerProvider(Provider prov);
-
- /*
- * @deprecated Use registerProvider(Provider cons) instead (BundleContext is no longer used)
- */
- @Deprecated
- ProviderSession registerProvider(Provider prov, BundleContext context);
-
- /**
- * {@link Consumer} specific access to the SAL functionality.
- *
- * <p>
- * ConsumerSession is {@link Consumer}-specific access to the SAL
- * functionality and infrastructure services.
- *
- * <p>
- * The session serves to store SAL context (e.g. registration of
- * functionality) for the consumer and provides access to the SAL
- * infrastructure services and other functionality provided by
- * {@link Provider}s.
- *
- *
- *
- */
- public interface ConsumerSession {
-
- boolean isClosed();
-
- /**
- * Returns a session specific instance (implementation) of requested
- * service
- *
- * @param service
- * Broker service
- * @return Session specific implementation of service
- */
- <T extends BrokerService> T getService(Class<T> service);
-
- /**
- * Closes a session between consumer and broker.
- *
- * <p>
- * The close operation unregisters a consumer and remove all registered
- * functionality of the consumer from the system.
- *
- */
- void close();
- }
-
- /**
- * {@link Provider} specific access to the SAL functionality.
- *
- * <p>
- * ProviderSession is {@link Provider}-specific access to the SAL
- * functionality and infrastructure services, which also allows for exposing
- * the provider's functionality to the other {@link Consumer}s.
- *
- * <p>
- * The session serves to store SAL context (e.g. registration of
- * functionality) for the providers and exposes access to the SAL
- * infrastructure services, dynamic functionality registration and any other
- * functionality provided by other {@link Provider}s.
- *
- */
- public interface ProviderSession extends ConsumerSession {
- /**
- * Closes a session between provider and SAL.
- *
- * <p>
- * The close operation unregisters a provider and remove all registered
- * functionality of the provider from the system.
- */
- @Override
- void close();
-
- @Override
- boolean isClosed();
- }
-}
+++ /dev/null
-/*
- * 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.sal.core.api;
-
-/**
- *
- * Session-specific instance of the broker functionality.
- *
- * <p>
- * BrokerService is marker interface for infrastructure services provided by the
- * SAL. These services are session-specific, each {@link Provider} and
- * {@link Consumer} usually has own instance of the service with it's own
- * context.
- *
- * <p>
- * The consumer's (or provider's) instance of specific service could be obtained
- * by invoking {@link org.opendaylight.controller.sal.core.api.Broker.ConsumerSession#getService(Class)} method on session
- * assigned to the consumer.
- *
- * <p>
- * {@link BrokerService} and {@link Provider} may seem similar, but provider
- * provides YANG model-based functionality and {@link BrokerService} exposes the
- * necessary supporting functionality to implement specific functionality of
- * YANG and to reuse it in the development of {@link Consumer}s and
- * {@link Provider}s.
- *
- *
- */
-public interface BrokerService {
-
-}
+++ /dev/null
-/*
- * 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.sal.core.api;
-
-import java.util.Collection;
-
-import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession;
-
-/**
- *
- * Defines the component of controller and supplies additional metadata. A
- * component of the controller or application supplies a concrete implementation
- * of this interface.
- *
- * A user-implemented component (application) which facilitates the SAL and SAL
- * services to access infrastructure services or providers' functionality.
- *
- *
- */
-public interface Consumer {
-
- /**
- * Callback signaling initialization of the consumer session to the SAL.
- *
- * The consumer MUST use the session for all communication with SAL or
- * retrieving SAL infrastructure services.
- *
- * This method is invoked by {@link Broker#registerConsumer(Consumer)}
- *
- * @param session
- * Unique session between consumer and SAL.
- */
- public void onSessionInitiated(ConsumerSession session);
-
-}
+++ /dev/null
-/*
- * 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.sal.core.api;
-
-import java.util.Collection;
-
-import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
-
-/**
- *
- * Defines the component of controller and supplies additional metadata. A
- * component of the controller or application supplies a concrete implementation
- * of this interface.
- *
- * <p>
- * A user-implemented component (application) which facilitates the SAL and SAL
- * services to access infrastructure services and to provide functionality to
- * {@link Consumer}s and other providers.
- *
- *
- */
-public interface Provider {
-
- /**
- * Callback signaling initialization of the provider session to the SAL.
- *
- * <p>
- * The provider <b>MUST use the session</b> for all communication with SAL
- * or retrieving SAL infrastructure services.
- *
- * <p>
- * This method is invoked by {@link Broker#registerConsumer(Consumer)}
- *
- * @param session
- * Unique session between provider and SAL.
- */
- public void onSessionInitiated(ProviderSession session);
-}
+++ /dev/null
-/*
- * 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
- */
-/**
- * Core binding-independent SAL contracts and components
- */
-package org.opendaylight.controller.sal.core.api;
package org.opendaylight.mdsal.dom.api;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainFactory;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.controller.sal.core.api.BrokerService;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker;
+import org.opendaylight.mdsal.common.api.TransactionChainFactory;
+import org.opendaylight.mdsal.common.api.TransactionChainListener;
+
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
*/
public interface DOMDataBroker extends
AsyncDataBroker<YangInstanceIdentifier, NormalizedNode<?, ?>, DOMDataChangeListener>,
- TransactionChainFactory<YangInstanceIdentifier, NormalizedNode<?, ?>>, BrokerService, DOMExtensibleService<DOMDataBroker, DOMDataBrokerExtension> {
+ TransactionChainFactory<YangInstanceIdentifier, NormalizedNode<?, ?>>,
+ DOMExtensibleService<DOMDataBroker, DOMDataBrokerExtension> {
/**
* {@inheritDoc}
*/
package org.opendaylight.mdsal.dom.api;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeListener;
+
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
package org.opendaylight.mdsal.dom.api;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncReadOnlyTransaction;
+import org.opendaylight.mdsal.common.api.AsyncReadOnlyTransaction;
+
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
*/
package org.opendaylight.mdsal.dom.api;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncReadTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.mdsal.common.api.AsyncReadTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
+
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
*/
package org.opendaylight.mdsal.dom.api;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncReadWriteTransaction;
+import org.opendaylight.mdsal.common.api.AsyncReadWriteTransaction;
+
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
package org.opendaylight.mdsal.dom.api;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import java.io.Serializable;
import java.util.Iterator;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.yangtools.concepts.Immutable;
import org.opendaylight.yangtools.concepts.Path;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
*/
package org.opendaylight.mdsal.dom.api;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.AsyncWriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.sal.core.api.mount;
+package org.opendaylight.mdsal.dom.api;
import java.util.EventListener;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-public interface MountProvisionListener extends EventListener {
+public interface DOMMountPointListener extends EventListener {
void onMountPointCreated(YangInstanceIdentifier path);
package org.opendaylight.mdsal.dom.api;
-import org.opendaylight.controller.sal.core.api.BrokerService;
-import org.opendaylight.controller.sal.core.api.mount.MountProvisionListener;
+import com.google.common.base.Optional;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.concepts.ObjectRegistration;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import com.google.common.base.Optional;
-
-public interface DOMMountPointService extends BrokerService {
+public interface DOMMountPointService extends DOMService {
Optional<DOMMountPoint> getMountPoint(YangInstanceIdentifier path);
DOMMountPointBuilder createMountPoint(YangInstanceIdentifier path);
- ListenerRegistration<MountProvisionListener> registerProvisionListener(MountProvisionListener listener);
+ ListenerRegistration<DOMMountPointListener> registerProvisionListener(DOMMountPointListener listener);
public interface DOMMountPointBuilder {
import java.util.concurrent.TimeUnit;
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.sal.core.api.BrokerService;
/**
* A {@link DOMService} which allows its user to send {@link DOMNotification}s. It
* the caller to specify that it should never wait, or put an upper bound on how
* long it is going to wait.
*/
-public interface DOMNotificationPublishService extends DOMService, BrokerService {
+public interface DOMNotificationPublishService extends DOMService {
/**
* Well-known value indicating that the implementation is currently not
* able to accept a notification.
import java.util.Collection;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.sal.core.api.BrokerService;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
* A {@link DOMService} which allows its users to subscribe to receive
* {@link DOMNotification}s.
*/
-public interface DOMNotificationService extends DOMService, BrokerService {
+public interface DOMNotificationService extends DOMService {
/**
* Register a {@link DOMNotificationListener} to receive a set of notifications. As with other
* ListenerRegistration-based interfaces, registering an instance multiple times results in
* 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.core.api.model;
+package org.opendaylight.mdsal.dom.api;
-import org.opendaylight.controller.sal.core.api.BrokerService;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
-public interface SchemaService extends BrokerService {
-
- /**
- * Registers a YANG module to session and global context
- *
- * @param module
- */
- void addModule(Module module);
-
- /**
- * Unregisters a YANG module from session context
- *
- * @param module
- */
- void removeModule(Module module);
+public interface DOMSchemaService extends DOMService {
/**
* Returns session specific YANG schema context
package org.opendaylight.mdsal.dom.api;
-import org.opendaylight.controller.sal.core.api.BrokerService;
/**
* Marker interface for services which can be obtained from a {@link DOMMountPoint}
* instance. No further semantics are implied.
*/
-public interface DOMService extends BrokerService {
+public interface DOMService {
}
*/
package org.opendaylight.mdsal.dom.api;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
+import org.opendaylight.mdsal.common.api.TransactionChain;
+
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import static org.junit.Assert.assertNotNull;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
+
import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
import org.opendaylight.mdsal.dom.api.DOMDataTreeProducer;
import org.opendaylight.mdsal.dom.api.DOMDataTreeProducerException;
import org.opendaylight.mdsal.dom.api.DOMDataTreeService;
import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
-
import com.google.common.util.concurrent.CheckedFuture;
import java.net.URI;
import java.util.Collections;
import javax.annotation.Nonnull;
import org.junit.Test;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.QNameModule;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
<extensions>true</extensions>
<configuration>
<instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- <Bundle-Activator>org.opendaylight.mdsal.sal.dom.broker.osgi.SchemaServiceActivator</Bundle-Activator>
- <Export-Package>
- <!-- Legacy code -->
- org.opendaylight.mdsal.sal.dom.broker,
- org.opendaylight.mdsal.sal.dom.broker.impl,
- org.opendaylight.mdsal.sal.dom.broker.osgi,
- org.opendaylight.mdsal.sal.dom.broker.util,
- org.opendaylight.mdsal.sal.dom.broker.spi,
- <!--sal.broker.impl is exported for sal-netconf-connector to use SchemaAwareRpcRegistry.-->
- <!-- TODO Remove sal.broker.impl from export when SchemaAwareRpcRegistry is not used in connector anymore -->
- org.opendaylight.mdsal.md.sal.dom.broker.impl,
- org.opendaylight.mdsal.md.sal.dom.broker.impl.*,
- </Export-Package>
- <Import-Package>*</Import-Package>
+ <Bundle-Activator>org.opendaylight.mdsal.dom.broker.osgi.SchemaServiceActivator</Bundle-Activator>
</instructions>
</configuration>
</plugin>
+++ /dev/null
-/*
- * 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.sal.dom.broker;
-
-import org.opendaylight.mdsal.dom.broker.DOMRpcRouter;
-
-import org.opendaylight.mdsal.dom.api.DOMRpcAvailabilityListener;
-import org.opendaylight.mdsal.dom.api.DOMRpcException;
-import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
-import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
-import org.opendaylight.mdsal.dom.api.DOMRpcImplementationRegistration;
-import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
-import org.opendaylight.mdsal.dom.api.DOMRpcResult;
-import org.opendaylight.mdsal.dom.api.DOMRpcService;
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ClassToInstanceMap;
-import com.google.common.collect.ImmutableClassToInstanceMap;
-import com.google.common.util.concurrent.CheckedFuture;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import org.opendaylight.controller.sal.core.api.Broker;
-import org.opendaylight.controller.sal.core.api.BrokerService;
-import org.opendaylight.controller.sal.core.api.Consumer;
-import org.opendaylight.controller.sal.core.api.Provider;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BrokerImpl implements Broker, DOMRpcProviderService, DOMRpcService, AutoCloseable {
- private final static Logger log = LoggerFactory.getLogger(BrokerImpl.class);
-
- // Broker Generic Context
- private final Set<ConsumerContextImpl> sessions = Collections
- .synchronizedSet(new HashSet<ConsumerContextImpl>());
- private final Set<ProviderContextImpl> providerSessions = Collections
- .synchronizedSet(new HashSet<ProviderContextImpl>());
-
- private AutoCloseable deactivator = null;
-
- private DOMRpcRouter router = null;
-
- private final ClassToInstanceMap<BrokerService> services;
-
- public BrokerImpl(final DOMRpcRouter router,final ClassToInstanceMap<BrokerService> services) {
- this.router = Preconditions.checkNotNull(router, "RPC Router must not be null");
- this.services = ImmutableClassToInstanceMap.copyOf(services);
- }
-
-
- @Override
- public ConsumerSession registerConsumer(final Consumer consumer,
- final BundleContext ctx) {
- return registerConsumer(consumer);
- }
-
- @Override
- public ProviderSession registerProvider(final Provider provider,
- final BundleContext ctx) {
- return registerProvider(provider);
- }
-
- // Validation
- private void checkPredicates(final Provider prov) {
- Preconditions.checkNotNull(prov, "Provider should not be null.");
- for (final ProviderContextImpl session : providerSessions) {
- if (prov.equals(session.getProvider())) {
- throw new IllegalStateException("Provider already registered");
- }
- }
-
- }
-
- private void checkPredicates(final Consumer cons) {
- Preconditions.checkNotNull(cons, "Consumer should not be null.");
- for (final ConsumerContextImpl session : sessions) {
- if (cons.equals(session.getConsumer())) {
- throw new IllegalStateException("Consumer already registered");
- }
- }
- }
-
- // Private Factory methods
- private ConsumerContextImpl newSessionFor(final Consumer provider) {
- final ConsumerContextImpl ret = new ConsumerContextImpl(provider, this);
- return ret;
- }
-
- private ProviderContextImpl newSessionFor(final Provider provider) {
- final ProviderContextImpl ret = new ProviderContextImpl(provider, this);
- return ret;
- }
-
- protected void consumerSessionClosed(
- final ConsumerContextImpl consumerContextImpl) {
- sessions.remove(consumerContextImpl);
- providerSessions.remove(consumerContextImpl);
- }
-
- @Override
- public void close() throws Exception {
- if (deactivator != null) {
- deactivator.close();
- deactivator = null;
- }
- }
-
- /**
- * @return the deactivator
- */
- public AutoCloseable getDeactivator() {
- return deactivator;
- }
-
- /**
- * @param deactivator
- * the deactivator to set
- */
- public void setDeactivator(final AutoCloseable deactivator) {
- this.deactivator = deactivator;
- }
-
- /**
- * @return the router
- */
- public DOMRpcRouter getRouter() {
- return router;
- }
-
- /**
- * @param router
- * the router to set
- */
- public void setRouter(final DOMRpcRouter router) {
- this.router = router;
- }
-
- protected <T extends BrokerService> Optional<T> getGlobalService(final Class<T> service) {
- return Optional.fromNullable(services.getInstance(service));
- }
-
-
- @Override
- public ConsumerSession registerConsumer(final Consumer consumer) {
- checkPredicates(consumer);
- log.trace("Registering consumer {}", consumer);
- final ConsumerContextImpl session = newSessionFor(consumer);
- consumer.onSessionInitiated(session);
- sessions.add(session);
- return session;
- }
-
-
- @Override
- public ProviderSession registerProvider(final Provider provider) {
- checkPredicates(provider);
- final ProviderContextImpl session = newSessionFor(provider);
- provider.onSessionInitiated(session);
- providerSessions.add(session);
- return session;
- }
-
-
- @Nonnull
- @Override
- public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(@Nonnull final T implementation, @Nonnull final DOMRpcIdentifier... rpcs) {
- return router.registerRpcImplementation(implementation, rpcs);
- }
-
- @Nonnull
- @Override
- public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(@Nonnull final T implementation, @Nonnull final Set<DOMRpcIdentifier> rpcs) {
- return router.registerRpcImplementation(implementation, rpcs);
- }
-
- @Nonnull
- @Override
- public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(@Nonnull final SchemaPath type, @Nullable final NormalizedNode<?, ?> input) {
- return router.invokeRpc(type, input);
- }
-
- @Nonnull
- @Override
- public <T extends DOMRpcAvailabilityListener> ListenerRegistration<T> registerRpcListener(@Nonnull final T listener) {
- return router.registerRpcListener(listener);
- }
-}
+++ /dev/null
-/*
- * 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.dom.broker;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ClassToInstanceMap;
-import com.google.common.collect.MutableClassToInstanceMap;
-import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession;
-import org.opendaylight.controller.sal.core.api.BrokerService;
-import org.opendaylight.controller.sal.core.api.Consumer;
-import org.opendaylight.controller.sal.dom.broker.osgi.AbstractBrokerServiceProxy;
-import org.opendaylight.controller.sal.dom.broker.osgi.ProxyFactory;
-
-import javax.annotation.concurrent.GuardedBy;
-import java.util.Collection;
-
-class ConsumerContextImpl implements ConsumerSession {
-
- private final ClassToInstanceMap<BrokerService> instantiatedServices = MutableClassToInstanceMap
- .create();
- private final Consumer consumer;
-
- private BrokerImpl broker = null;
- @GuardedBy("this")
- private boolean closed = false;
-
- public ConsumerContextImpl(final Consumer provider, final BrokerImpl brokerImpl) {
- broker = brokerImpl;
- consumer = provider;
- }
-
- @Override
- public <T extends BrokerService> T getService(final Class<T> service) {
- checkNotClosed();
- final T localProxy = instantiatedServices.getInstance(service);
- if (localProxy != null) {
- return localProxy;
- }
- final Optional<T> serviceImpl = broker.getGlobalService(service);
- if(serviceImpl.isPresent()) {
- final T ret = ProxyFactory.createProxy(null,serviceImpl.get());
- instantiatedServices.putInstance(service, ret);
- return ret;
- } else {
- return null;
- }
- }
-
- @Override
- public void close() {
- synchronized (this) {
- if (closed) {
- return;
- }
- this.closed = true;
- }
-
- Collection<BrokerService> toStop = instantiatedServices.values();
- for (BrokerService brokerService : toStop) {
- if (brokerService instanceof AbstractBrokerServiceProxy<?>) {
- ((AbstractBrokerServiceProxy<?>) brokerService).close();
- }
- }
- broker.consumerSessionClosed(this);
- broker = null;
- }
-
-
- @Override
- public synchronized boolean isClosed() {
- return closed;
- }
-
- /**
- * @return the broker
- */
- protected final BrokerImpl getBrokerChecked() {
- checkNotClosed();
- return broker;
- }
-
- /**
- * @return the _consumer
- */
- public Consumer getConsumer() {
- return consumer;
- }
-
- protected final void checkNotClosed() {
- Preconditions.checkState(!closed, "Session is closed.");
- }
-}
+++ /dev/null
-/*
- * 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.dom.broker;
-
-import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
-import org.opendaylight.controller.sal.core.api.Provider;
-
-class ProviderContextImpl extends ConsumerContextImpl implements ProviderSession {
- private final Provider provider;
-
- public ProviderContextImpl(final Provider provider, final BrokerImpl broker) {
- super(null, broker);
- this.provider = provider;
- }
-
- @Override
- public void close() {
- }
-
- /**
- * @return the provider
- */
- public Provider getProvider() {
- return provider;
- }
-
- /**
- * @param provider
- * the provider to set
- */
-}
+++ /dev/null
-/*
- * 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.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 {
-
- private SchemaContextProviders() {
- throw new UnsupportedOperationException("Utility class.");
- }
-
- public static final SchemaContextProvider fromSchemaService(final SchemaService schemaService) {
- if (schemaService instanceof SchemaContextProvider) {
- return (SchemaContextProvider) schemaService;
- }
- return new SchemaServiceAdapter(schemaService);
- }
-
- private static final class SchemaServiceAdapter implements SchemaContextProvider, Delegator<SchemaService> {
-
- private final SchemaService service;
-
- public SchemaServiceAdapter(final SchemaService service) {
- super();
- this.service = service;
- }
-
- @Override
- public SchemaContext getSchemaContext() {
- return service.getGlobalContext();
- }
-
- @Override
- public SchemaService getDelegate() {
- return service;
- }
-
- @Override
- public String toString() {
- return "SchemaServiceAdapter [service=" + service + "]";
- }
- }
-}
+++ /dev/null
-/*
- * 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.dom.broker.osgi;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.annotation.Nullable;
-
-import org.opendaylight.controller.sal.core.api.BrokerService;
-import org.opendaylight.yangtools.concepts.Registration;
-import org.osgi.framework.ServiceReference;
-
-public abstract class AbstractBrokerServiceProxy<T extends BrokerService> implements AutoCloseable, BrokerService {
-
- private T delegate;
- private final ServiceReference<T> reference;
-
- public AbstractBrokerServiceProxy(final @Nullable ServiceReference<T> ref, final T delegate) {
- this.delegate = checkNotNull(delegate, "Delegate should not be null.");
- this.reference = ref;
- }
-
- protected final T getDelegate() {
- checkState(delegate != null, "Proxy was closed and unregistered.");
- return delegate;
- }
-
- protected final ServiceReference<T> getReference() {
- return reference;
- }
-
- private final Set<Registration> registrations = Collections.synchronizedSet(new HashSet<Registration>());
-
- protected <R extends Registration> R addRegistration(final R registration) {
- if (registration != null) {
- registrations.add(registration);
- }
- return registration;
- }
-
- protected void closeBeforeUnregistrations() {
- // NOOP
- }
-
- protected void closeAfterUnregistrations() {
- // NOOP
- }
-
- @Override
- public void close() {
- if (delegate != null) {
- delegate = null;
- RuntimeException potentialException = new RuntimeException(
- "Uncaught exceptions occured during unregistration");
- boolean hasSuppressed = false;
- for (Registration registration : registrations) {
- try {
- registration.close();
- } catch (Exception e) {
- potentialException.addSuppressed(e);
- hasSuppressed = true;
- }
- }
- if (hasSuppressed) {
- throw potentialException;
- }
- }
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2014, 2015 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.dom.broker.osgi;
-
-import org.opendaylight.mdsal.dom.api.DOMDataBroker;
-import org.opendaylight.mdsal.dom.api.DOMDataBrokerExtension;
-import org.opendaylight.mdsal.dom.api.DOMDataChangeListener;
-import org.opendaylight.mdsal.dom.api.DOMDataReadOnlyTransaction;
-import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
-import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
-import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
-
-import java.util.Map;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.osgi.framework.ServiceReference;
-
-public class DOMDataBrokerProxy extends AbstractBrokerServiceProxy<DOMDataBroker> implements DOMDataBroker {
-
- public DOMDataBrokerProxy(final ServiceReference<DOMDataBroker> ref, final DOMDataBroker delegate) {
- super(ref, delegate);
- }
-
- @Override
- public DOMDataReadOnlyTransaction newReadOnlyTransaction() {
- return getDelegate().newReadOnlyTransaction();
- }
-
- @Override
- public DOMDataReadWriteTransaction newReadWriteTransaction() {
- return getDelegate().newReadWriteTransaction();
- }
-
- @Override
- public DOMDataWriteTransaction newWriteOnlyTransaction() {
- return getDelegate().newWriteOnlyTransaction();
- }
-
- @Override
- public ListenerRegistration<DOMDataChangeListener> registerDataChangeListener(final LogicalDatastoreType store,
- final YangInstanceIdentifier path, final DOMDataChangeListener listener,
- final org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope triggeringScope) {
- return getDelegate().registerDataChangeListener(store, path, listener, triggeringScope);
- }
-
- @Override
- public DOMTransactionChain createTransactionChain(final TransactionChainListener listener) {
- return getDelegate().createTransactionChain(listener);
- }
-
- @Override
- public Map<Class<? extends DOMDataBrokerExtension>, DOMDataBrokerExtension> getSupportedExtensions() {
- return getDelegate().getSupportedExtensions();
- }
-}
+++ /dev/null
-/*
- * 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.dom.broker.osgi;
-
-import org.opendaylight.mdsal.dom.api.DOMMountPoint;
-import org.opendaylight.mdsal.dom.api.DOMMountPointService;
-
-import com.google.common.base.Optional;
-import org.opendaylight.controller.sal.core.api.mount.MountProvisionListener;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.osgi.framework.ServiceReference;
-
-public class DOMMountPointServiceProxy extends AbstractBrokerServiceProxy<DOMMountPointService> implements DOMMountPointService{
-
-
- public DOMMountPointServiceProxy(final ServiceReference<DOMMountPointService> ref, final DOMMountPointService delegate) {
- super(ref, delegate);
- }
-
- @Override
- public Optional<DOMMountPoint> getMountPoint(final YangInstanceIdentifier path) {
- return getDelegate().getMountPoint(path);
- }
-
- @Override
- public DOMMountPointBuilder createMountPoint(final YangInstanceIdentifier path) {
- return getDelegate().createMountPoint(path);
- }
-
- public ListenerRegistration<MountProvisionListener> registerProvisionListener(final MountProvisionListener listener) {
- return getDelegate().registerProvisionListener(listener);
- }
-}
+++ /dev/null
-/*
- * 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.dom.broker.osgi;
-
-import org.opendaylight.mdsal.dom.api.DOMDataBroker;
-import org.opendaylight.mdsal.dom.api.DOMMountPointService;
-
-import org.opendaylight.controller.sal.core.api.BrokerService;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.osgi.framework.ServiceReference;
-import java.util.Arrays;
-
-@SuppressWarnings("unchecked")
-public class ProxyFactory {
-
- public static <T extends BrokerService> T createProxy(
- final ServiceReference<T> serviceRef, final T service) {
-
- Object _createProxyImpl = ProxyFactory.createProxyImpl(serviceRef,
- service);
- return ((T) _createProxyImpl);
- }
-
- private static Object createProxyImpl(final ServiceReference<?> ref,
- final DOMMountPointService service) {
-
- return new DOMMountPointServiceProxy(
- ((ServiceReference<DOMMountPointService>) ref), service);
- }
-
- private static Object createProxyImpl(final ServiceReference<?> ref,
- final SchemaService service) {
-
- return new SchemaServiceProxy(((ServiceReference<SchemaService>) ref),
- service);
- }
-
- private static DOMDataBrokerProxy createProxyImpl(
- final ServiceReference<?> ref, final DOMDataBroker service) {
-
- return new DOMDataBrokerProxy(((ServiceReference<DOMDataBroker>) ref),
- service);
- }
-
- private static Object createProxyImplFallback(final ServiceReference<?> reference,
- final BrokerService service) {
-
- return service;
- }
-
- private static Object createProxyImpl(final ServiceReference<?> ref,
- final BrokerService service) {
-
- if (service instanceof DOMDataBroker) {
- return createProxyImpl(ref, (DOMDataBroker) service);
- } else if (service instanceof SchemaService) {
- return createProxyImpl(ref, (SchemaService) service);
- } else if (service instanceof DOMMountPointService) {
- return createProxyImpl(ref, (DOMMountPointService) service);
- } else if (service != null) {
- return createProxyImplFallback(ref, service);
- } else {
- throw new IllegalArgumentException("Unhandled parameter types: "
- + Arrays.<Object> asList(ref, service).toString());
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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.dom.broker.osgi;
-
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-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.osgi.framework.ServiceReference;
-
-public class SchemaServiceProxy extends AbstractBrokerServiceProxy<SchemaService> implements SchemaService {
-
- public SchemaServiceProxy(ServiceReference<SchemaService> ref, SchemaService delegate) {
- super(ref, delegate);
- }
-
- @Override
- public void addModule(Module module) {
- getDelegate().addModule(module);
- }
-
- @Override
- public void removeModule(Module module) {
- getDelegate().removeModule(module);
- }
-
- @Override
- public SchemaContext getSessionContext() {
- return null;
- }
-
- @Override
- public SchemaContext getGlobalContext() {
- return getDelegate().getGlobalContext();
- }
-
- @Override
- public ListenerRegistration<SchemaContextListener> registerSchemaContextListener(SchemaContextListener listener) {
- ListenerRegistration<SchemaContextListener> registration = getDelegate().registerSchemaContextListener(listener);
- addRegistration(registration);
- return registration;
- }
-}
+++ /dev/null
-/*
- * 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.sal.dom.broker;
\ No newline at end of file
+++ /dev/null
-/*
- * 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.dom.broker.util;
-
-import java.net.URI;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import java.util.Set;
-
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
-import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
-import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.ExtensionDefinition;
-import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.ModuleIdentifier;
-import org.opendaylight.yangtools.yang.model.api.NotificationDefinition;
-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.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.Status;
-import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.UsesNode;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-
-/**
- * ProxySchema Context for SchemaContextProviders
- */
-public class ProxySchemaContext implements SchemaContext {
-
- private final SchemaContextProvider schemaProvider;
-
- public ProxySchemaContext(final SchemaContextProvider schemaProvider) {
- this.schemaProvider = schemaProvider;
- }
-
- private SchemaContext getCurrentSchema() {
- Preconditions.checkState(schemaProvider.getSchemaContext() != null, "Schema context unavailable from %s", schemaProvider);
- return schemaProvider.getSchemaContext();
- }
-
- @Override
- public Set<DataSchemaNode> getDataDefinitions() {
- return getCurrentSchema().getDataDefinitions();
- }
-
- @Override
- public Set<Module> getModules() {
- return getCurrentSchema().getModules();
- }
-
- @Override
- public Set<NotificationDefinition> getNotifications() {
- return getCurrentSchema().getNotifications();
- }
-
- @Override
- public Set<RpcDefinition> getOperations() {
- return getCurrentSchema().getOperations();
- }
-
- @Override
- public Set<ExtensionDefinition> getExtensions() {
- return getCurrentSchema().getExtensions();
- }
-
- @Override
- public Module findModuleByName(final String s, final Date date) {
- return getCurrentSchema().findModuleByName(s, date);
- }
-
- @Override
- public Set<Module> findModuleByNamespace(final URI uri) {
- return getCurrentSchema().findModuleByNamespace(uri);
- }
-
- @Override
- public Module findModuleByNamespaceAndRevision(final URI uri, final Date date) {
- return getCurrentSchema().findModuleByNamespaceAndRevision(uri, date);
- }
-
- @Override
- public Optional<String> getModuleSource(final ModuleIdentifier moduleIdentifier) {
- return getCurrentSchema().getModuleSource(moduleIdentifier);
- }
-
- @Override
- public Set<ModuleIdentifier> getAllModuleIdentifiers() {
- return getCurrentSchema().getAllModuleIdentifiers();
- }
-
- @Override
- public boolean isPresenceContainer() {
- return getCurrentSchema().isPresenceContainer();
- }
-
- @Override
- public Set<TypeDefinition<?>> getTypeDefinitions() {
- return getCurrentSchema().getTypeDefinitions();
- }
-
- @Override
- public Collection<DataSchemaNode> getChildNodes() {
- return getCurrentSchema().getChildNodes();
- }
-
- @Override
- public Set<GroupingDefinition> getGroupings() {
- return getCurrentSchema().getGroupings();
- }
-
- @Override
- public DataSchemaNode getDataChildByName(final QName qName) {
- return getCurrentSchema().getDataChildByName(qName);
- }
-
- @Override
- public DataSchemaNode getDataChildByName(final String s) {
- return getCurrentSchema().getDataChildByName(s);
- }
-
- @Override
- public Set<UsesNode> getUses() {
- return getCurrentSchema().getUses();
- }
-
- @Override
- public Set<AugmentationSchema> getAvailableAugmentations() {
- return getCurrentSchema().getAvailableAugmentations();
- }
-
- @Override
- public boolean isAugmenting() {
- return getCurrentSchema().isAugmenting();
- }
-
- @Override
- public boolean isAddedByUses() {
- return getCurrentSchema().isAddedByUses();
- }
-
- @Override
- public boolean isConfiguration() {
- return getCurrentSchema().isConfiguration();
- }
-
- @Override
- public ConstraintDefinition getConstraints() {
- return getCurrentSchema().getConstraints();
- }
-
- @Override
- public QName getQName() {
- return getCurrentSchema().getQName();
- }
-
- @Override
- public SchemaPath getPath() {
- return getCurrentSchema().getPath();
- }
-
- @Override
- public List<UnknownSchemaNode> getUnknownSchemaNodes() {
- return getCurrentSchema().getUnknownSchemaNodes();
- }
-
- @Override
- public String getDescription() {
- return getCurrentSchema().getDescription();
- }
-
- @Override
- public String getReference() {
- return getCurrentSchema().getReference();
- }
-
- @Override
- public Status getStatus() {
- return getCurrentSchema().getStatus();
- }
-}
+++ /dev/null
-/*
- * 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.dom.broker.util;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkState;
-
-import com.google.common.base.Function;
-import com.google.common.collect.FluentIterable;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
-import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
-import org.opendaylight.yangtools.yang.model.api.ChoiceCaseNode;
-import org.opendaylight.yangtools.yang.model.api.ChoiceSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
-import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
-import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
-import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.Status;
-import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.UsesNode;
-
-public final class YangSchemaUtils {
-
- private static final Function<PathArgument, QName> QNAME_FROM_PATH_ARGUMENT = new Function<PathArgument, QName>(){
-
- @Override
- public QName apply(final PathArgument input) {
- if(input == null) {
- return null;
- }
- return input.getNodeType();
- }
- };
-
- private YangSchemaUtils() {
- throw new UnsupportedOperationException("Utility class.");
- }
-
- public static DataSchemaNode getSchemaNode(final SchemaContext schema,final YangInstanceIdentifier path) {
- checkArgument(schema != null,"YANG Schema must not be null.");
- checkArgument(path != null,"Path must not be null.");
- return getSchemaNode(schema, FluentIterable.from(path.getPathArguments()).transform(QNAME_FROM_PATH_ARGUMENT));
- }
-
- public static DataSchemaNode getSchemaNode(final SchemaContext schema,final Iterable<QName> path) {
- checkArgument(schema != null,"YANG Schema must not be null.");
- checkArgument(path != null,"Path must not be null.");
- if(!path.iterator().hasNext()){
- return toRootDataNode(schema);
- }
-
- QName firstNode = path.iterator().next();
- DataNodeContainer previous = schema.findModuleByNamespaceAndRevision(firstNode.getNamespace(),
- firstNode.getRevision());
- Iterator<QName> iterator = path.iterator();
-
- while (iterator.hasNext()) {
- checkArgument(previous!= null, "Supplied path does not resolve into valid schema node.");
- QName arg = iterator.next();
- DataSchemaNode currentNode = previous.getDataChildByName(arg);
- if (currentNode == null && previous instanceof DataNodeContainer) {
- currentNode = searchInChoices(previous, arg);
- }
- if (currentNode instanceof DataNodeContainer) {
- previous = (DataNodeContainer) currentNode;
- } else if (currentNode instanceof LeafSchemaNode || currentNode instanceof LeafListSchemaNode) {
- checkArgument(!iterator.hasNext(), "Path nests inside leaf node, which is not allowed.");
- return currentNode;
- }
- checkState(currentNode != null, "Current node should not be null for %s",path);
- }
- checkState(previous instanceof DataSchemaNode, "Schema node for %s should be instance of DataSchemaNode. Found %s",path,previous);
- return (DataSchemaNode) previous;
- }
-
- private static DataSchemaNode searchInChoices(final DataNodeContainer node, final QName arg) {
- for (DataSchemaNode child : node.getChildNodes()) {
- if (child instanceof ChoiceSchemaNode) {
- ChoiceSchemaNode choiceNode = (ChoiceSchemaNode) child;
- DataSchemaNode potential = searchInCases(choiceNode, arg);
- if (potential != null) {
- return potential;
- }
- }
- }
- return null;
- }
-
- private static DataSchemaNode searchInCases(final ChoiceSchemaNode choiceNode, final QName arg) {
- Set<ChoiceCaseNode> cases = choiceNode.getCases();
- for (ChoiceCaseNode caseNode : cases) {
- DataSchemaNode node = caseNode.getDataChildByName(arg);
- if (node != null) {
- return node;
- }
- }
- return null;
- }
-
- private static ContainerSchemaNode toRootDataNode(final SchemaContext schema) {
- return new NetconfDataRootNode(schema);
- }
-
- private static final class NetconfDataRootNode implements ContainerSchemaNode {
-
- public NetconfDataRootNode(final SchemaContext schema) {
- // TODO Auto-generated constructor stub
- }
-
- @Override
- public Set<TypeDefinition<?>> getTypeDefinitions() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public Set<DataSchemaNode> getChildNodes() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public Set<GroupingDefinition> getGroupings() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public DataSchemaNode getDataChildByName(final QName name) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public DataSchemaNode getDataChildByName(final String name) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public Set<UsesNode> getUses() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public Set<AugmentationSchema> getAvailableAugmentations() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public boolean isAugmenting() {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean isAddedByUses() {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean isConfiguration() {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public ConstraintDefinition getConstraints() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public QName getQName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public SchemaPath getPath() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public String getDescription() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public String getReference() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public Status getStatus() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public List<UnknownSchemaNode> getUnknownSchemaNodes() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public boolean isPresenceContainer() {
- // TODO Auto-generated method stub
- return false;
- }
-
- }
-
-}
import static com.google.common.base.Preconditions.checkState;
+import org.opendaylight.mdsal.dom.spi.store.DOMStore;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionChain;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreTreeChangePublisher;
+
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionChainListener;
import org.opendaylight.mdsal.dom.api.DOMDataBroker;
import org.opendaylight.mdsal.dom.api.DOMDataBrokerExtension;
import org.opendaylight.mdsal.dom.api.DOMDataChangeListener;
import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeService;
import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
-
import com.google.common.collect.ImmutableMap;
import java.util.Collections;
import java.util.EnumMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicLong;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.controller.sal.core.spi.data.DOMStore;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreTreeChangePublisher;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.slf4j.Logger;
package org.opendaylight.mdsal.dom.broker;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransaction;
+
+import org.opendaylight.mdsal.common.api.AsyncTransaction;
import com.google.common.base.Preconditions;
import java.util.Collection;
import java.util.Map;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransaction;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
*/
package org.opendaylight.mdsal.dom.broker;
-import org.opendaylight.mdsal.dom.api.DOMDataReadOnlyTransaction;
-import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
-import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
-
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.CheckedFuture;
import java.util.Collection;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionFactory;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
+import org.opendaylight.mdsal.dom.api.DOMDataReadOnlyTransaction;
+import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
+import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionFactory;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction;
/**
*
protected abstract Object newTransactionIdentifier();
/**
- * User-supplied implementation of {@link DOMDataWriteTransaction#submit()}
- * for transaction.
- *
- * Callback invoked when {@link DOMDataWriteTransaction#submit()} is invoked
- * on transaction created by this factory.
- *
- * @param transaction
- * Transaction on which {@link DOMDataWriteTransaction#commit()}
- * was invoked.
- * @param cohorts
- * Iteratable of cohorts for subtransactions associated with
- * the transaction being committed.
- * @return a CheckedFuture. if commit coordination on cohorts finished successfully,
- * nothing is returned from the Future, On failure,
- * the Future fails with a {@link TransactionCommitFailedException}.
+ * User-supplied implementation of {@link DOMDataWriteTransaction#submit()} for transaction.
+ *
+ * Callback invoked when {@link DOMDataWriteTransaction#submit()} is invoked on transaction
+ * created by this factory.
+ *
+ * @param transaction Transaction on which {@link DOMDataWriteTransaction#submit()} was invoked.
+ * @param cohorts Iteratable of cohorts for subtransactions associated with the transaction
+ * being committed.
+ * @return a CheckedFuture. if commit coordination on cohorts finished successfully, nothing is
+ * returned from the Future, On failure, the Future fails with a
+ * {@link TransactionCommitFailedException}.
*/
protected abstract CheckedFuture<Void,TransactionCommitFailedException> submit(final DOMDataWriteTransaction transaction,
final Collection<DOMStoreThreePhaseCommitCohort> cohorts);
* - backing subtransaction is selected by {@link LogicalDatastoreType},
* {@link DOMStoreWriteTransaction#delete(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)}
* is invoked on selected subtransaction.
- * <li> {@link DOMDataWriteTransaction#commit()} - results in invoking
+ * <li> {@link DOMDataWriteTransaction#submit()} - results in invoking
* {@link DOMStoreWriteTransaction#ready()}, gathering all resulting cohorts and then invoking
* finalized implementation callback {@link #submit(DOMDataWriteTransaction, Collection)} with
* transaction which was commited and gathered results.</li>
* - backing subtransaction is selected by {@link LogicalDatastoreType},
* {@link DOMStoreWriteTransaction#delete(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)}
* is invoked on selected subtransaction.</li>
- * <li> {@link DOMDataWriteTransaction#commit()} - results in invoking
+ * <li> {@link DOMDataWriteTransaction#submit()} - results in invoking
* {@link DOMStoreWriteTransaction#ready()}, gathering all resulting cohorts and then invoking
* finalized implementation callback {@link #submit(DOMDataWriteTransaction, Collection)} with
* transaction which was commited and gathered results.</li>
+++ /dev/null
-/*
- * Copyright (c) 2015 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.mdsal.dom.broker;
-
-import com.google.common.util.concurrent.AsyncFunction;
-import com.google.common.util.concurrent.CheckedFuture;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-
-class CommitCompatibility {
- private static final ListenableFuture<RpcResult<TransactionStatus>> SUCCESS_FUTURE = Futures
- .immediateFuture(RpcResultBuilder.success(TransactionStatus.COMMITED).build());
-
- private CommitCompatibility() {
- throw new UnsupportedOperationException("Helper class");
- }
-
- static ListenableFuture<RpcResult<TransactionStatus>> convertToLegacyCommitFuture(
- final CheckedFuture<Void, TransactionCommitFailedException> from) {
- return Futures.transform(from, new AsyncFunction<Void, RpcResult<TransactionStatus>>() {
- @Override
- public ListenableFuture<RpcResult<TransactionStatus>> apply(final Void input) {
- return SUCCESS_FUTURE;
- }
- });
- }
-}
package org.opendaylight.mdsal.dom.broker;
-import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
+import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
import com.google.common.base.Preconditions;
import com.google.common.base.Throwables;
import com.google.common.util.concurrent.Futures;
import java.util.Collection;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
import org.opendaylight.yangtools.util.DurationStatisticsTracker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
package org.opendaylight.mdsal.dom.broker;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionChain;
+
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionChainListener;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
-
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.FutureCallback;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * NormalizedNode implementation of {@link org.opendaylight.controller.md.sal.common.api.data.TransactionChain} which is backed
+ * NormalizedNode implementation of {@link org.opendaylight.mdsal.common.api.TransactionChain} which is backed
* by several {@link DOMStoreTransactionChain} differentiated by provided
- * {@link org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType} type.
+ * {@link org.opendaylight.mdsal.common.api.LogicalDatastoreType} type.
*
*/
final class DOMDataBrokerTransactionChainImpl extends AbstractDOMForwardedTransactionFactory<DOMStoreTransactionChain>
*/
package org.opendaylight.mdsal.dom.broker;
-import org.opendaylight.mdsal.dom.api.DOMDataReadOnlyTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
+import org.opendaylight.mdsal.dom.api.DOMDataReadOnlyTransaction;
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
import java.util.Map;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
package org.opendaylight.mdsal.dom.broker;
-import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
+import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
import java.util.Map;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
/**
*
- * Read-Write Transaction, which is composed of several
- * {@link DOMStoreReadWriteTransaction} transactions. Subtransaction is selected by
- * {@link LogicalDatastoreType} type parameter in:
+ * Read-Write Transaction, which is composed of several {@link DOMStoreReadWriteTransaction}
+ * transactions. Subtransaction is selected by {@link LogicalDatastoreType} type parameter in:
*
* <ul>
* <li>{@link #read(LogicalDatastoreType, YangInstanceIdentifier)}
* <li>{@link #delete(LogicalDatastoreType, YangInstanceIdentifier)}
* <li>{@link #merge(LogicalDatastoreType, YangInstanceIdentifier, NormalizedNode)}
* </ul>
- * {@link #commit()} will result in invocation of
+ * {@link #submit()} will result in invocation of
* {@link DOMDataCommitImplementation#submit(org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction, Iterable)}
- * invocation with all {@link org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort} for underlying
- * transactions.
+ * invocation with all
+ * {@link org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort} for
+ * underlying transactions.
*
*/
final class DOMForwardedReadWriteTransaction extends DOMForwardedWriteTransaction<DOMStoreReadWriteTransaction> implements DOMDataReadWriteTransaction {
*/
package org.opendaylight.mdsal.dom.broker;
-import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
-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.api.data.TransactionCommitFailedException;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
-import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.slf4j.Logger;
* <li>{@link #merge(LogicalDatastoreType, YangInstanceIdentifier, NormalizedNode)}
* </ul>
* <p>
- * {@link #commit()} will result in invocation of
+ * {@link #submit()} will result in invocation of
* {@link DOMDataCommitImplementation#submit(org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction, Iterable)}
- * invocation with all {@link org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort} for underlying
- * transactions.
+ * invocation with all
+ * {@link org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort} for
+ * underlying transactions.
*
- * @param <T> Subtype of {@link DOMStoreWriteTransaction} which is used as
- * subtransaction.
+ * @param <T> Subtype of {@link DOMStoreWriteTransaction} which is used as subtransaction.
*/
class DOMForwardedWriteTransaction<T extends DOMStoreWriteTransaction> extends
AbstractDOMForwardedCompositeTransaction<LogicalDatastoreType, T> implements DOMDataWriteTransaction {
return future.cancel(false);
}
- @Deprecated
- @Override
- public ListenableFuture<RpcResult<TransactionStatus>> commit() {
- return CommitCompatibility.convertToLegacyCommitFuture(submit());
- }
-
@Override
public CheckedFuture<Void, TransactionCommitFailedException> submit() {
final AbstractDOMForwardedTransactionFactory<?> impl = IMPL_UPDATER.getAndSet(this, null);
package org.opendaylight.mdsal.dom.broker;
+import org.opendaylight.mdsal.dom.spi.SimpleDOMMountPoint;
+
+import org.opendaylight.mdsal.dom.api.DOMMountPointListener;
import org.opendaylight.mdsal.dom.api.DOMMountPoint;
import org.opendaylight.mdsal.dom.api.DOMMountPointService;
import org.opendaylight.mdsal.dom.api.DOMService;
-
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.collect.ClassToInstanceMap;
import com.google.common.collect.MutableClassToInstanceMap;
import java.util.HashMap;
import java.util.Map;
-import org.opendaylight.controller.md.sal.dom.broker.spi.mount.SimpleDOMMountPoint;
-import org.opendaylight.controller.sal.core.api.mount.MountProvisionListener;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.concepts.ObjectRegistration;
import org.opendaylight.yangtools.util.ListenerRegistry;
private final Map<YangInstanceIdentifier, DOMMountPoint> mountPoints = new HashMap<>();
- private final ListenerRegistry<MountProvisionListener> listeners = ListenerRegistry.create();
+ private final ListenerRegistry<DOMMountPointListener> listeners = ListenerRegistry.create();
@Override
public Optional<DOMMountPoint> getMountPoint(final YangInstanceIdentifier path) {
}
public void notifyMountCreated(final YangInstanceIdentifier identifier) {
- for (final ListenerRegistration<MountProvisionListener> listener : listeners
+ for (final ListenerRegistration<DOMMountPointListener> listener : listeners
.getListeners()) {
listener.getInstance().onMountPointCreated(identifier);
}
}
public void notifyMountRemoved(final YangInstanceIdentifier identifier) {
- for (final ListenerRegistration<MountProvisionListener> listener : listeners
+ for (final ListenerRegistration<DOMMountPointListener> listener : listeners
.getListeners()) {
listener.getInstance().onMountPointRemoved(identifier);
}
}
@Override
- public ListenerRegistration<MountProvisionListener> registerProvisionListener(
- final MountProvisionListener listener) {
+ public ListenerRegistration<DOMMountPointListener> registerProvisionListener(
+ final DOMMountPointListener listener) {
return listeners.register(listener);
}
*/
package org.opendaylight.mdsal.dom.broker;
+import org.opendaylight.mdsal.dom.spi.DOMNotificationSubscriptionListener;
+import org.opendaylight.mdsal.dom.spi.DOMNotificationSubscriptionListenerRegistry;
+
import org.opendaylight.mdsal.dom.api.DOMNotification;
import org.opendaylight.mdsal.dom.api.DOMNotificationListener;
import org.opendaylight.mdsal.dom.api.DOMNotificationPublishService;
import org.opendaylight.mdsal.dom.api.DOMNotificationService;
-
import com.google.common.base.Preconditions;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
-import org.opendaylight.controller.md.sal.dom.spi.DOMNotificationSubscriptionListener;
-import org.opendaylight.controller.md.sal.dom.spi.DOMNotificationSubscriptionListenerRegistry;
import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.util.ListenerRegistry;
*/
package org.opendaylight.mdsal.dom.broker;
+import org.opendaylight.mdsal.dom.spi.AbstractDOMRpcImplementationRegistration;
+
import org.opendaylight.mdsal.dom.api.DOMRpcAvailabilityListener;
import org.opendaylight.mdsal.dom.api.DOMRpcException;
import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
import org.opendaylight.mdsal.dom.api.DOMRpcResult;
import org.opendaylight.mdsal.dom.api.DOMRpcService;
-
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import javax.annotation.concurrent.GuardedBy;
-import org.opendaylight.controller.md.sal.dom.spi.AbstractDOMRpcImplementationRegistration;
import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
*/
package org.opendaylight.mdsal.dom.broker;
+import org.opendaylight.mdsal.dom.spi.ForwardingDOMDataBroker;
+
+import org.opendaylight.mdsal.common.api.TransactionChainListener;
import org.opendaylight.mdsal.dom.api.DOMDataBroker;
import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener;
import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeService;
import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
-
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.spi.ForwardingDOMDataBroker;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
/**
*/
package org.opendaylight.mdsal.dom.broker;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
+
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 java.util.concurrent.Future} used to report the status of an future
*/
package org.opendaylight.mdsal.dom.broker;
-import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.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.yangtools.yang.common.RpcResult;
+import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
/**
* Transaction context. Tracks the relationship with the backend transaction.
*/
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;
this.delegate = Preconditions.checkNotNull(delegate);
future = SettableFuture.create();
submitFuture = new PingPongFuture(future);
- commitFuture = CommitCompatibility.convertToLegacyCommitFuture(submitFuture);
}
DOMDataReadWriteTransaction getTransaction() {
return submitFuture;
}
- ListenableFuture<RpcResult<TransactionStatus>> getCommitFuture() {
- return commitFuture;
- }
-
@Override
public void onSuccess(final Void result) {
future.set(result);
*/
package org.opendaylight.mdsal.dom.broker;
-import org.opendaylight.mdsal.dom.api.DOMDataBroker;
-import org.opendaylight.mdsal.dom.api.DOMDataReadOnlyTransaction;
-import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
-import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
-import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
-
+import org.opendaylight.mdsal.dom.spi.ForwardingDOMDataReadWriteTransaction;
+
+import org.opendaylight.mdsal.common.api.AsyncTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
+import org.opendaylight.mdsal.common.api.TransactionChain;
+import org.opendaylight.mdsal.common.api.TransactionChainListener;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
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 java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
import javax.annotation.Nonnull;
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.spi.ForwardingDOMDataReadWriteTransaction;
-import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataReadOnlyTransaction;
+import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
+import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.slf4j.Logger;
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");
package org.opendaylight.mdsal.dom.broker;
-import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStore;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
+import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.Futures;
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.RejectedExecutionException;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.controller.sal.core.spi.data.DOMStore;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
import org.opendaylight.yangtools.util.DurationStatisticsTracker;
import org.opendaylight.yangtools.util.concurrent.MappingCheckedFuture;
import org.slf4j.Logger;
*/
package org.opendaylight.mdsal.dom.broker;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeListener;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeProducer;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeService;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeShard;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeShardingConflictException;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeShardingService;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import com.google.common.base.Preconditions;
import java.util.Collection;
import java.util.Map.Entry;
import java.util.TreeMap;
import javax.annotation.concurrent.GuardedBy;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeListener;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeProducer;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeService;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeShard;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeShardingConflictException;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeShardingService;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
* this registration.
*/
final ShardingTableEntry parent = lookupShard(prefix);
- parentReg = parent.getRegistration();
- if (parentReg != null && prefix.equals(parentReg.getPrefix())) {
- throw new DOMDataTreeShardingConflictException(String.format("Prefix %s is already occupied by shard %s", prefix, parentReg.getInstance()));
+ if (parent != null) {
+ parentReg = parent.getRegistration();
+ if (parentReg != null && prefix.equals(parentReg.getPrefix())) {
+ throw new DOMDataTreeShardingConflictException(String.format(
+ "Prefix %s is already occupied by shard %s", prefix, parentReg.getInstance()));
+ }
+ } else {
+ parentReg = null;
}
// FIXME: wrap the shard in a proper adaptor based on implemented interface
private DOMDataTreeProducer createProducer(final Map<DOMDataTreeIdentifier, DOMDataTreeShard> shardMap) {
// Record the producer's attachment points
final DOMDataTreeProducer ret = ShardedDOMDataTreeProducer.create(this, shardMap);
- for (DOMDataTreeIdentifier s : shardMap.keySet()) {
+ for (final DOMDataTreeIdentifier s : shardMap.keySet()) {
idToProducer.put(s, ret);
}
*/
package org.opendaylight.mdsal.dom.broker;
+import org.opendaylight.mdsal.dom.spi.store.DOMStore;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionChain;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction;
+
import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
import org.opendaylight.mdsal.dom.api.DOMDataTreeProducer;
import org.opendaylight.mdsal.dom.api.DOMDataTreeProducerBusyException;
import org.opendaylight.mdsal.dom.api.DOMDataTreeProducerException;
import org.opendaylight.mdsal.dom.api.DOMDataTreeShard;
import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
-
import com.google.common.base.Preconditions;
import com.google.common.collect.BiMap;
import com.google.common.collect.ImmutableBiMap;
import java.util.Queue;
import java.util.Set;
import javax.annotation.concurrent.GuardedBy;
-import org.opendaylight.controller.sal.core.spi.data.DOMStore;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
*/
package org.opendaylight.mdsal.dom.broker;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
-import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableSet;
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
import javax.annotation.concurrent.GuardedBy;
import javax.annotation.concurrent.NotThreadSafe;
-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.api.data.TransactionCommitFailedException;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
-import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
+import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.slf4j.Logger;
}
}
- @Override
- @Deprecated
- public ListenableFuture<RpcResult<TransactionStatus>> commit() {
- return CommitCompatibility.convertToLegacyCommitFuture(submit());
- }
-
@Override
public synchronized void delete(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
lookup(store, path).delete(path);
*/
package org.opendaylight.mdsal.dom.broker;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
+
import org.opendaylight.yangtools.util.concurrent.ExceptionMapper;
/**
* 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.dom.broker;
+package org.opendaylight.mdsal.dom.broker.osgi;
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 java.util.Collections;
import java.util.Enumeration;
import java.util.List;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
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.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class GlobalBundleScanningSchemaServiceImpl implements SchemaContextProvider, SchemaService, ServiceTrackerCustomizer<SchemaContextListener, SchemaContextListener>, AutoCloseable {
- private static final Logger LOG = LoggerFactory.getLogger(GlobalBundleScanningSchemaServiceImpl.class);
+public class OsgiBundleScanningSchemaService implements SchemaContextProvider, DOMSchemaService, ServiceTrackerCustomizer<SchemaContextListener, SchemaContextListener>, AutoCloseable {
+ private static final Logger LOG = LoggerFactory.getLogger(OsgiBundleScanningSchemaService.class);
private final ListenerRegistry<SchemaContextListener> listeners = new ListenerRegistry<>();
private final URLSchemaContextResolver contextResolver = URLSchemaContextResolver.create("global-bundle");
private ServiceTracker<SchemaContextListener, SchemaContextListener> listenerTracker;
private BundleTracker<Iterable<Registration>> bundleTracker;
private boolean starting = true;
- private static GlobalBundleScanningSchemaServiceImpl instance;
+ private static OsgiBundleScanningSchemaService instance;
- private GlobalBundleScanningSchemaServiceImpl(final BundleContext context) {
+ private OsgiBundleScanningSchemaService(final BundleContext context) {
this.context = Preconditions.checkNotNull(context);
}
- public synchronized static GlobalBundleScanningSchemaServiceImpl createInstance(final BundleContext ctx) {
+ public synchronized static OsgiBundleScanningSchemaService createInstance(final BundleContext ctx) {
Preconditions.checkState(instance == null);
- instance = new GlobalBundleScanningSchemaServiceImpl(ctx);
+ instance = new OsgiBundleScanningSchemaService(ctx);
instance.start();
return instance;
}
- public synchronized static GlobalBundleScanningSchemaServiceImpl getInstance() {
+ public synchronized static OsgiBundleScanningSchemaService getInstance() {
Preconditions.checkState(instance != null, "Global Instance was not instantiated");
return instance;
}
checkState(context != null);
LOG.debug("start() starting");
- listenerTracker = new ServiceTracker<>(context, SchemaContextListener.class, GlobalBundleScanningSchemaServiceImpl.this);
+ listenerTracker = new ServiceTracker<>(context, SchemaContextListener.class, OsgiBundleScanningSchemaService.this);
bundleTracker = new BundleTracker<>(context, Bundle.RESOLVED | Bundle.STARTING |
Bundle.STOPPING | Bundle.ACTIVE, scanner);
bundleTracker.open();
return contextResolver.getSchemaContext().orNull();
}
- @Override
- public void addModule(final Module module) {
- throw new UnsupportedOperationException();
- }
-
@Override
public SchemaContext getSessionContext() {
throw new UnsupportedOperationException();
}
- @Override
- public void removeModule(final Module module) {
- throw new UnsupportedOperationException();
- }
-
@Override
public synchronized ListenerRegistration<SchemaContextListener> registerSchemaContextListener(final SchemaContextListener listener) {
- Optional<SchemaContext> potentialCtx = contextResolver.getSchemaContext();
+ final Optional<SchemaContext> potentialCtx = contextResolver.getSchemaContext();
if(potentialCtx.isPresent()) {
listener.onGlobalContextUpdated(potentialCtx.get());
}
listenerTracker.close();
}
- for (ListenerRegistration<SchemaContextListener> l : listeners.getListeners()) {
+ for (final ListenerRegistration<SchemaContextListener> l : listeners.getListeners()) {
l.close();
}
}
private synchronized void updateContext(final SchemaContext snapshot) {
- Object[] services = listenerTracker.getServices();
- for (ListenerRegistration<SchemaContextListener> listener : listeners) {
+ final Object[] services = listenerTracker.getServices();
+ for (final ListenerRegistration<SchemaContextListener> listener : listeners) {
try {
listener.getInstance().onGlobalContextUpdated(snapshot);
- } catch (Exception e) {
+ } catch (final Exception e) {
LOG.error("Exception occured during invoking listener", e);
}
}
if (services != null) {
- for (Object rawListener : services) {
+ for (final Object rawListener : services) {
final SchemaContextListener listener = (SchemaContextListener) rawListener;
try {
listener.onGlobalContextUpdated(snapshot);
- } catch (Exception e) {
+ } catch (final Exception e) {
LOG.error("Exception occured during invoking listener {}", listener, e);
}
}
try {
urls.add(contextResolver.registerSource(u));
LOG.debug("Registered {}", u);
- } catch (Exception e) {
+ } catch (final Exception e) {
LOG.warn("Failed to register {}, ignoring it", e);
}
}
@Override
public synchronized void removedBundle(final Bundle bundle, final BundleEvent event, final Iterable<Registration> urls) {
- for (Registration url : urls) {
+ for (final Registration url : urls) {
try {
url.close();
- } catch (Exception e) {
+ } catch (final Exception e) {
LOG.warn("Failed do unregister URL {}, proceeding", url, e);
}
}
- int numUrls = Iterables.size(urls);
+ final int numUrls = Iterables.size(urls);
if(numUrls > 0 ) {
if(LOG.isDebugEnabled()) {
LOG.debug("removedBundle: {}, state: {}, # urls: {}", bundle.getSymbolicName(), bundle.getState(), numUrls);
@Override
public synchronized SchemaContextListener addingService(final ServiceReference<SchemaContextListener> reference) {
- SchemaContextListener listener = context.getService(reference);
- SchemaContext _ctxContext = getGlobalContext();
+ final SchemaContextListener listener = context.getService(reference);
+ final SchemaContext _ctxContext = getGlobalContext();
if (getContext() != null && _ctxContext != null) {
listener.onGlobalContextUpdated(_ctxContext);
}
if (starting) {
return;
}
- Optional<SchemaContext> schema = contextResolver.getSchemaContext();
+ final Optional<SchemaContext> schema = contextResolver.getSchemaContext();
if(schema.isPresent()) {
if(LOG.isDebugEnabled()) {
LOG.debug("Got new SchemaContext: # of modules {}", schema.get().getAllModuleIdentifiers().size());
* 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.dom.broker.osgi;
+package org.opendaylight.mdsal.dom.broker.osgi;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import java.util.Hashtable;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.controller.sal.dom.broker.GlobalBundleScanningSchemaServiceImpl;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
public class SchemaServiceActivator implements BundleActivator {
- private ServiceRegistration<SchemaService> schemaServiceReg;
- private GlobalBundleScanningSchemaServiceImpl schemaService;
+ private ServiceRegistration<DOMSchemaService> schemaServiceReg;
+ private OsgiBundleScanningSchemaService schemaService;
@Override
public void start(final BundleContext context) {
- schemaService = GlobalBundleScanningSchemaServiceImpl.createInstance(context);
- schemaServiceReg = context.registerService(SchemaService.class, schemaService, new Hashtable<String,String>());
+ schemaService = OsgiBundleScanningSchemaService.createInstance(context);
+ schemaServiceReg = context.registerService(DOMSchemaService.class, schemaService, new Hashtable<String,String>());
}
@Override
* 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;
+package org.opendaylight.mdsal.dom.broker.test;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
+import org.opendaylight.mdsal.common.api.AsyncTransaction;
+import org.opendaylight.mdsal.common.api.TransactionChain;
+import org.opendaylight.mdsal.common.api.TransactionChainListener;
import com.google.common.util.concurrent.SettableFuture;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.md.sal.dom.broker.impl;
+package org.opendaylight.mdsal.dom.broker.test;
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 static org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION;
+import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.OPERATIONAL;
+import org.opendaylight.mdsal.dom.broker.test.util.TestModel;
+
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
+import org.opendaylight.mdsal.dom.spi.store.DOMStore;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.dom.broker.AbstractDOMDataBroker;
import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker;
-
import org.opendaylight.mdsal.dom.api.DOMDataReadTransaction;
import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
import com.google.common.base.Optional;
import java.util.concurrent.Executors;
import org.junit.Before;
import org.junit.Test;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
-import org.opendaylight.controller.md.sal.dom.store.impl.TestModel;
-import org.opendaylight.controller.sal.core.spi.data.DOMStore;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.md.sal.dom.broker.impl;
+package org.opendaylight.mdsal.dom.broker.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.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.CONFIGURATION;
-import static org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.OPERATIONAL;
-
+import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION;
+import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.OPERATIONAL;
+
+import org.opendaylight.mdsal.dom.broker.test.util.TestModel;
+
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
+import org.opendaylight.mdsal.dom.spi.store.DOMStore;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeEvent;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitDeadlockException;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
import org.opendaylight.mdsal.dom.broker.AbstractDOMDataBroker;
import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker;
-
import org.opendaylight.mdsal.dom.api.DOMDataChangeListener;
import org.opendaylight.mdsal.dom.api.DOMDataReadTransaction;
import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitDeadlockException;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
-import org.opendaylight.controller.md.sal.dom.store.impl.TestModel;
-import org.opendaylight.controller.sal.core.spi.data.DOMStore;
import org.opendaylight.yangtools.util.concurrent.DeadlockDetectingListeningExecutorService;
import org.opendaylight.yangtools.util.concurrent.SpecialExecutors;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
* 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;
+package org.opendaylight.mdsal.dom.broker.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.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.CONFIGURATION;
-import static org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.OPERATIONAL;
+import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION;
+import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.OPERATIONAL;
+import org.opendaylight.mdsal.dom.broker.test.util.TestModel;
+
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
+import org.opendaylight.mdsal.dom.spi.store.DOMStore;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitDeadlockException;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
import org.opendaylight.mdsal.dom.broker.AbstractDOMDataBroker;
import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker;
-
import org.opendaylight.mdsal.dom.api.DOMDataBrokerExtension;
import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener;
import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeService;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitDeadlockException;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
-import org.opendaylight.controller.md.sal.dom.store.impl.TestModel;
-import org.opendaylight.controller.sal.core.spi.data.DOMStore;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.util.concurrent.DeadlockDetectingListeningExecutorService;
import org.opendaylight.yangtools.util.concurrent.SpecialExecutors;
* 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;
+package org.opendaylight.mdsal.dom.broker.test;
import static org.junit.Assert.assertNotNull;
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 static org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION;
+import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.OPERATIONAL;
+import org.opendaylight.mdsal.dom.broker.test.util.TestModel;
+
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
+import org.opendaylight.mdsal.dom.spi.store.DOMStore;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.dom.broker.AbstractDOMDataBroker;
import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker;
-
import org.opendaylight.mdsal.dom.api.DOMDataReadTransaction;
import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
import java.util.concurrent.TimeoutException;
import org.junit.Before;
import org.junit.Test;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
-import org.opendaylight.controller.md.sal.dom.store.impl.TestModel;
-import org.opendaylight.controller.sal.core.spi.data.DOMStore;
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;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.md.sal.dom.broker.impl;
+package org.opendaylight.mdsal.dom.broker.test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
* 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.impl;
+package org.opendaylight.mdsal.dom.broker.test.util;
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.Set;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
-import java.io.InputStream;
-import java.util.Collections;
-import java.util.Set;
-
public class TestModel {
public static final QName TEST_QNAME = QName.create("urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test", "2014-03-13",
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
-
- <Export-Package>org.opendaylight.mdsal.md.sal.dom.store.impl.*</Export-Package>
-
- <Import-Package>*</Import-Package>
- </instructions>
- </configuration>
</plugin>
+
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
* 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.impl;
+package org.opendaylight.mdsal.dom.store.inmemory;
+
+import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction;
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.ListenableFuture;
-import org.opendaylight.controller.sal.core.spi.data.SnapshotBackedWriteTransaction;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
final class ChainedTransactionCommitImpl extends InMemoryDOMStoreThreePhaseCommitCohort {
* 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.impl;
+package org.opendaylight.mdsal.dom.store.inmemory;
-import com.google.common.base.Preconditions;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeEvent;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
+import com.google.common.base.Preconditions;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
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;
* 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.impl;
+package org.opendaylight.mdsal.dom.store.inmemory;
+
+import org.opendaylight.mdsal.dom.spi.store.AbstractSnapshotBackedTransactionChain;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction;
import com.google.common.base.Preconditions;
-import org.opendaylight.controller.sal.core.spi.data.AbstractSnapshotBackedTransactionChain;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
-import org.opendaylight.controller.sal.core.spi.data.SnapshotBackedWriteTransaction;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot;
* 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.impl;
+package org.opendaylight.mdsal.dom.store.inmemory;
+
+import org.opendaylight.mdsal.common.api.AsyncDataChangeListener;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
* 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.impl;
-
+package org.opendaylight.mdsal.dom.store.inmemory;
+
+import org.opendaylight.mdsal.dom.store.inmemory.tree.ListenerTree;
+
+import org.opendaylight.mdsal.dom.spi.store.DOMStore;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionChain;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreTreeChangePublisher;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedTransactions;
+import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction.TransactionReadyPrototype;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeListener;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener;
-
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
-import org.opendaylight.controller.md.sal.dom.store.impl.tree.ListenerTree;
-import org.opendaylight.controller.sal.core.spi.data.DOMStore;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreTreeChangePublisher;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
-import org.opendaylight.controller.sal.core.spi.data.SnapshotBackedTransactions;
-import org.opendaylight.controller.sal.core.spi.data.SnapshotBackedWriteTransaction;
-import org.opendaylight.controller.sal.core.spi.data.SnapshotBackedWriteTransaction.TransactionReadyPrototype;
import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
import org.opendaylight.yangtools.concepts.Identifiable;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
*
* Implementation of {@link DOMStore} which uses {@link DataTree} and other
* classes such as {@link SnapshotBackedWriteTransaction}.
- * {@link org.opendaylight.controller.sal.core.spi.data.SnapshotBackedReadTransaction} and {@link ResolveDataChangeEventsTask}
+ * {@link org.opendaylight.mdsal.dom.spi.store.SnapshotBackedReadTransaction} and {@link ResolveDataChangeEventsTask}
* to implement {@link DOMStore} contract.
*
*/
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.md.sal.dom.store.impl;
+package org.opendaylight.mdsal.dom.store.inmemory;
/**
* Holds configuration properties when creating an {@link InMemoryDOMDataStore} instance via 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.impl;
+package org.opendaylight.mdsal.dom.store.inmemory;
+
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import java.util.concurrent.ExecutorService;
import javax.annotation.Nullable;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
import org.opendaylight.yangtools.util.concurrent.SpecialExecutors;
/**
}
public static InMemoryDOMDataStore create(final String name,
- @Nullable final SchemaService schemaService) {
+ @Nullable final DOMSchemaService schemaService) {
return create(name, schemaService, null);
}
* @return an InMemoryDOMDataStore instance
*/
public static InMemoryDOMDataStore create(final String name,
- @Nullable final SchemaService schemaService,
+ @Nullable final DOMSchemaService schemaService,
@Nullable final InMemoryDOMDataStoreConfigProperties properties) {
return create(name, schemaService, false, properties);
}
* @return an InMemoryDOMDataStore instance
*/
public static InMemoryDOMDataStore create(final String name,
- @Nullable final SchemaService schemaService, final boolean debugTransactions,
+ @Nullable final DOMSchemaService schemaService, final boolean debugTransactions,
@Nullable final InMemoryDOMDataStoreConfigProperties properties) {
InMemoryDOMDataStoreConfigProperties actualProperties = properties;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.md.sal.dom.store.impl;
+package org.opendaylight.mdsal.dom.store.inmemory;
import static com.google.common.base.Preconditions.checkState;
+
+import org.opendaylight.mdsal.dom.spi.store.AbstractDOMStoreTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction;
+
+import org.opendaylight.mdsal.common.api.OptimisticLockFailedException;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
-import org.opendaylight.controller.md.sal.common.api.data.OptimisticLockFailedException;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.controller.sal.core.spi.data.AbstractDOMStoreTransaction;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
-import org.opendaylight.controller.sal.core.spi.data.SnapshotBackedWriteTransaction;
import org.opendaylight.yangtools.yang.data.api.schema.tree.ConflictingModificationAppliedException;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
* 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.impl;
+package org.opendaylight.mdsal.dom.store.inmemory;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener;
+import org.opendaylight.mdsal.dom.spi.store.AbstractDOMStoreTreeChangePublisher;
+import org.opendaylight.mdsal.dom.spi.AbstractDOMDataTreeChangeListenerRegistration;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener;
import com.google.common.base.Optional;
import java.util.Collection;
import java.util.Collections;
import java.util.concurrent.ExecutorService;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.dom.spi.AbstractDOMDataTreeChangeListenerRegistration;
-import org.opendaylight.controller.sal.core.spi.data.AbstractDOMStoreTreeChangePublisher;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.util.concurrent.QueuedNotificationManager;
import org.opendaylight.yangtools.util.concurrent.QueuedNotificationManager.Invoker;
* 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.impl;
+package org.opendaylight.mdsal.dom.store.inmemory;
+import org.opendaylight.mdsal.dom.store.inmemory.tree.ListenerTree;
+
+import org.opendaylight.mdsal.dom.store.inmemory.DOMImmutableDataChangeEvent.Builder;
+import org.opendaylight.mdsal.dom.store.inmemory.DOMImmutableDataChangeEvent.SimpleEventFactory;
+import org.opendaylight.mdsal.dom.spi.RegistrationTreeSnapshot;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
import com.google.common.annotations.Beta;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.collect.Multimap;
import java.util.Collection;
import java.util.Map.Entry;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.dom.spi.RegistrationTreeSnapshot;
-import org.opendaylight.controller.md.sal.dom.store.impl.DOMImmutableDataChangeEvent.Builder;
-import org.opendaylight.controller.md.sal.dom.store.impl.DOMImmutableDataChangeEvent.SimpleEventFactory;
-import org.opendaylight.controller.md.sal.dom.store.impl.tree.ListenerTree;
import org.opendaylight.yangtools.util.concurrent.NotificationManager;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
* 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.impl;
+package org.opendaylight.mdsal.dom.store.inmemory;
+import org.opendaylight.mdsal.dom.store.inmemory.DOMImmutableDataChangeEvent.Builder;
+
+import org.opendaylight.mdsal.dom.spi.RegistrationTreeNode;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
import com.google.common.base.Preconditions;
import com.google.common.collect.Iterables;
import com.google.common.collect.Multimap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.dom.spi.RegistrationTreeNode;
-import org.opendaylight.controller.md.sal.dom.store.impl.DOMImmutableDataChangeEvent.Builder;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
* 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.impl.tree;
+package org.opendaylight.mdsal.dom.store.inmemory.tree;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
-import org.opendaylight.controller.md.sal.dom.store.impl.DataChangeListenerRegistration;
+import org.opendaylight.mdsal.dom.store.inmemory.DataChangeListenerRegistration;
+
+import org.opendaylight.mdsal.common.api.AsyncDataChangeListener;
import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
* 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.impl.tree;
+package org.opendaylight.mdsal.dom.store.inmemory.tree;
+import org.opendaylight.mdsal.dom.store.inmemory.DataChangeListenerRegistration;
+
+import org.opendaylight.mdsal.dom.spi.RegistrationTreeNode;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import java.util.Collection;
-import org.opendaylight.controller.md.sal.dom.spi.RegistrationTreeNode;
-import org.opendaylight.controller.md.sal.dom.store.impl.DataChangeListenerRegistration;
import org.opendaylight.yangtools.concepts.Identifiable;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
import org.opendaylight.yangtools.yang.data.api.schema.tree.StoreTreeNode;
* 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.impl.tree;
+package org.opendaylight.mdsal.dom.store.inmemory.tree;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
-import org.opendaylight.controller.md.sal.dom.spi.AbstractRegistrationTree;
-import org.opendaylight.controller.md.sal.dom.spi.RegistrationTreeNode;
-import org.opendaylight.controller.md.sal.dom.store.impl.DataChangeListenerRegistration;
+import org.opendaylight.mdsal.dom.store.inmemory.DataChangeListenerRegistration;
+
+import org.opendaylight.mdsal.dom.spi.AbstractRegistrationTree;
+import org.opendaylight.mdsal.dom.spi.RegistrationTreeNode;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeListener;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
* 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.impl.tree;
+package org.opendaylight.mdsal.dom.store.inmemory.tree;
+import org.opendaylight.mdsal.dom.store.inmemory.DataChangeListenerRegistration;
+
+import org.opendaylight.mdsal.dom.spi.RegistrationTreeSnapshot;
import com.google.common.base.Preconditions;
-import org.opendaylight.controller.md.sal.dom.spi.RegistrationTreeSnapshot;
-import org.opendaylight.controller.md.sal.dom.store.impl.DataChangeListenerRegistration;
/**
* A walking context, pretty much equivalent to an iterator, but it
*/
package org.opendaylight.controller.md.sal.dom.store.impl;
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
+
import java.util.Collection;
import java.util.Map;
import org.junit.After;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import org.opendaylight.mdsal.dom.spi.store.DOMStore;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
+
+import org.opendaylight.mdsal.common.api.AsyncDataChangeEvent;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeListener;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
-import org.opendaylight.controller.sal.core.spi.data.DOMStore;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.SettableFuture;
*/
package org.opendaylight.controller.md.sal.dom.store.impl;
-import java.util.concurrent.ExecutionException;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
+import java.util.concurrent.ExecutionException;
import org.junit.Test;
import org.opendaylight.controller.md.sal.dom.store.impl.DatastoreTestTask.WriteTransactionCustomizer;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
/**
* Base template for a test suite for testing DataChangeListener functionality.
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
+
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionChain;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedTransactions;
+import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction.TransactionReadyPrototype;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.ListenableFuture;
import org.junit.Ignore;
import org.junit.Test;
import org.mockito.Mockito;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
-import org.opendaylight.controller.sal.core.spi.data.SnapshotBackedTransactions;
-import org.opendaylight.controller.sal.core.spi.data.SnapshotBackedWriteTransaction.TransactionReadyPrototype;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
*/
package org.opendaylight.controller.md.sal.dom.store.impl;
-import java.util.concurrent.ExecutionException;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeEvent;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
+import java.util.concurrent.ExecutionException;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import static org.junit.Assert.assertNotNull;
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
+
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
import com.google.common.util.concurrent.MoreExecutors;
import java.util.concurrent.ExecutionException;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeEvent;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
+
import java.util.concurrent.ExecutionException;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeEvent;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
+
import java.util.concurrent.ExecutionException;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+import org.opendaylight.mdsal.common.api.AsyncDataChangeEvent;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
+
import java.util.concurrent.ExecutionException;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+++ /dev/null
-/*
- * Copyright (c) 2015 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.core.spi;
-
-import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession;
-import org.opendaylight.controller.sal.core.api.BrokerService;
-
-public abstract class ForwardingConsumerSession implements ConsumerSession {
-
- protected abstract ConsumerSession delegate();
-
- @Override
- public void close() {
- delegate().close();
- }
-
- @Override
- public <T extends BrokerService> T getService(Class<T> arg0) {
- return delegate().getService(arg0);
- }
-
- @Override
- public boolean isClosed() {
- return delegate().isClosed();
- }
-
-}
+++ /dev/null
-/*
- * Copyright (c) 2015 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.core.spi;
-
-import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
-import org.opendaylight.controller.sal.core.api.BrokerService;
-
-public abstract class ForwardingProviderSession implements ProviderSession {
-
- protected abstract ProviderSession delegate();
-
- @Override
- public void close() {
- delegate().close();
- }
-
- @Override
- public <T extends BrokerService> T getService(Class<T> arg0) {
- return delegate().getService(arg0);
- }
-
- @Override
- public boolean isClosed() {
- return delegate().isClosed();
- }
-
-}
+++ /dev/null
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.sal.core.spi;
\ No newline at end of file
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener;
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
import org.opendaylight.mdsal.dom.api.DOMRpcImplementationRegistration;
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
import com.google.common.annotations.Beta;
import java.util.EventListener;
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
import com.google.common.annotations.Beta;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
import org.opendaylight.mdsal.dom.api.DOMRpcResult;
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
+
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionChainListener;
import org.opendaylight.mdsal.dom.api.DOMDataBroker;
import org.opendaylight.mdsal.dom.api.DOMDataBrokerExtension;
import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
-
import com.google.common.collect.ForwardingObject;
import java.util.Map;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
-import org.opendaylight.mdsal.dom.api.DOMDataReadOnlyTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
+import org.opendaylight.mdsal.dom.api.DOMDataReadOnlyTransaction;
import com.google.common.base.Optional;
import com.google.common.collect.ForwardingObject;
import com.google.common.util.concurrent.CheckedFuture;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
-import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
import com.google.common.base.Optional;
import com.google.common.collect.ForwardingObject;
import com.google.common.util.concurrent.CheckedFuture;
-import com.google.common.util.concurrent.ListenableFuture;
import javax.annotation.Nonnull;
-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.api.data.ReadFailedException;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
return delegate().submit();
}
- @Override
- @Deprecated
- public ListenableFuture<RpcResult<TransactionStatus>> commit() {
- return delegate().commit();
- }
}
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
-import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
import com.google.common.collect.ForwardingObject;
import com.google.common.util.concurrent.CheckedFuture;
-import com.google.common.util.concurrent.ListenableFuture;
import javax.annotation.Nonnull;
-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.api.data.TransactionCommitFailedException;
-import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
return delegate().submit();
}
- @Override
- @Deprecated
- public ListenableFuture<RpcResult<TransactionStatus>> commit() {
- return delegate().commit();
- }
}
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
import org.opendaylight.mdsal.dom.api.DOMNotification;
import org.opendaylight.mdsal.dom.api.DOMNotificationPublishService;
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
import org.opendaylight.mdsal.dom.api.DOMNotificationListener;
import org.opendaylight.mdsal.dom.api.DOMNotificationService;
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
import org.opendaylight.mdsal.dom.api.DOMRpcException;
import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
import org.opendaylight.mdsal.dom.api.DOMRpcResult;
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
import org.opendaylight.mdsal.dom.api.DOMRpcAvailabilityListener;
import org.opendaylight.mdsal.dom.api.DOMRpcException;
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
import org.opendaylight.mdsal.dom.api.DOMDataReadOnlyTransaction;
import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
* 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.spi;
+package org.opendaylight.mdsal.dom.spi;
import com.google.common.base.Preconditions;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
* 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.spi.rpc;
+package org.opendaylight.mdsal.dom.spi;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.md.sal.dom.broker.spi.mount;
+package org.opendaylight.mdsal.dom.spi;
import org.opendaylight.mdsal.dom.api.DOMMountPoint;
import org.opendaylight.mdsal.dom.api.DOMService;
* 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.core.spi.data;
+package org.opendaylight.mdsal.dom.spi.store;
import com.google.common.annotations.Beta;
import com.google.common.base.MoreObjects;
* 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.core.spi.data;
+package org.opendaylight.mdsal.dom.spi.store;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener;
+import org.opendaylight.mdsal.dom.spi.AbstractDOMDataTreeChangeListenerRegistration;
+import org.opendaylight.mdsal.dom.spi.AbstractRegistrationTree;
+import org.opendaylight.mdsal.dom.spi.RegistrationTreeNode;
+import org.opendaylight.mdsal.dom.spi.RegistrationTreeSnapshot;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener;
import com.google.common.collect.ImmutableList;
import java.util.Collection;
import java.util.List;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.dom.spi.AbstractDOMDataTreeChangeListenerRegistration;
-import org.opendaylight.controller.md.sal.dom.spi.AbstractRegistrationTree;
-import org.opendaylight.controller.md.sal.dom.spi.RegistrationTreeNode;
-import org.opendaylight.controller.md.sal.dom.spi.RegistrationTreeSnapshot;
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.tree.DataTreeCandidate;
* 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.core.spi.data;
+package org.opendaylight.mdsal.dom.spi.store;
+
+import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction.TransactionReadyPrototype;
import com.google.common.annotations.Beta;
import com.google.common.base.Preconditions;
import java.util.AbstractMap.SimpleEntry;
import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
-import org.opendaylight.controller.sal.core.spi.data.SnapshotBackedWriteTransaction.TransactionReadyPrototype;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot;
import org.slf4j.Logger;
* 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.core.spi.data;
+package org.opendaylight.mdsal.dom.spi.store;
+
+import org.opendaylight.mdsal.common.api.AsyncDataChangeListener;
+import org.opendaylight.mdsal.common.api.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
* Read and write access to stored data is provided only via transactions
* created using {@link #newReadOnlyTransaction()},
* {@link #newWriteOnlyTransaction()} and {@link #newReadWriteTransaction()}, or
- * by creating {@link org.opendaylight.controller.md.sal.common.api.data.TransactionChain}.
+ * by creating {@link org.opendaylight.mdsal.common.api.TransactionChain}.
*
*/
public interface DOMStore extends DOMStoreTransactionFactory {
* on the change of provided subpath. What constitutes a change depends on the @scope parameter.
*
* Listener upon registration receives an initial callback
- * {@link AsyncDataChangeListener#onDataChanged(org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent)}
+ * {@link AsyncDataChangeListener#onDataChanged(org.opendaylight.mdsal.common.api.AsyncDataChangeEvent)}
* which contains stable view of data tree at the time of registration.
*
* Â @param path Path (subtree identifier) on which client listener will be invoked.
* 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.core.spi.data;
+package org.opendaylight.mdsal.dom.spi.store;
+
+import org.opendaylight.mdsal.common.api.ReadFailedException;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
* 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.core.spi.data;
+package org.opendaylight.mdsal.dom.spi.store;
/**
* Combination of a {@link DOMStoreReadTransaction} and {@link DOMStoreWriteTransaction}.
* 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.core.spi.data;
+package org.opendaylight.mdsal.dom.spi.store;
import com.google.common.util.concurrent.ListenableFuture;
* 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.core.spi.data;
+package org.opendaylight.mdsal.dom.spi.store;
import org.opendaylight.yangtools.concepts.Identifiable;
* 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.core.spi.data;
+package org.opendaylight.mdsal.dom.spi.store;
/**
* A chain of transactions. Transactions in a chain need to be committed in
* 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.core.spi.data;
+package org.opendaylight.mdsal.dom.spi.store;
/**
* Factory for DOM Store Transactions
* 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.core.spi.data;
+package org.opendaylight.mdsal.dom.spi.store;
import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener;
* 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.core.spi.data;
+package org.opendaylight.mdsal.dom.spi.store;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
* 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.core.spi.data;
+package org.opendaylight.mdsal.dom.spi.store;
import com.google.common.annotations.Beta;
import com.google.common.collect.ForwardingObject;
* 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.core.spi.data;
+package org.opendaylight.mdsal.dom.spi.store;
import static com.google.common.base.Preconditions.checkNotNull;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
+
import com.google.common.annotations.Beta;
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.Futures;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot;
* 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.core.spi.data;
+package org.opendaylight.mdsal.dom.spi.store;
import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction.TransactionReadyPrototype;
+
+import org.opendaylight.mdsal.common.api.ReadFailedException;
import com.google.common.annotations.Beta;
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.Futures;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.sal.core.spi.data.SnapshotBackedWriteTransaction.TransactionReadyPrototype;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot;
* 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.core.spi.data;
+package org.opendaylight.mdsal.dom.spi.store;
+
+import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction.TransactionReadyPrototype;
import com.google.common.annotations.Beta;
-import org.opendaylight.controller.sal.core.spi.data.SnapshotBackedWriteTransaction.TransactionReadyPrototype;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot;
/**
* 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.core.spi.data;
+package org.opendaylight.mdsal.dom.spi.store;
import static com.google.common.base.Preconditions.checkState;
/**
* Implementation of Write transaction which is backed by
* {@link DataTreeSnapshot} and executed according to
- * {@link org.opendaylight.controller.sal.core.spi.data.SnapshotBackedWriteTransaction.TransactionReadyPrototype}.
+ * {@link org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction.TransactionReadyPrototype}.
*
* @param <T> Identifier type
*/
* Prototype implementation of {@link SnapshotBackedWriteTransaction#ready()}
*
* This class is intended to be implemented by Transaction factories responsible for allocation
- * of {@link org.opendaylight.controller.sal.core.spi.data.SnapshotBackedWriteTransaction} and
+ * of {@link org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction} and
* providing underlying logic for applying implementation.
*
* @param <T> identifier type
* terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
* and is available at http://www.eclipse.org/legal/epl-v10.html\r
*/\r
-package org.opendaylight.controller.sal.core.spi.data;
\ No newline at end of file
+package org.opendaylight.mdsal.dom.spi.store;
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ 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
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>mdsal-model-artifacts</artifactId>
+ <version>0.8.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <properties>
+ <!-- Model versions -->
+ <ietf.topology.version>2013.10.21.8-SNAPSHOT</ietf.topology.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>iana-if-type-2014-05-08</artifactId>
+ <version>2014.05.08.8-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-inet-types</artifactId>
+ <version>2010.09.24.8-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-yang-types</artifactId>
+ <version>2010.09.24.8-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-yang-types-20130715</artifactId>
+ <version>2013.07.15.8-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-interfaces</artifactId>
+ <version>2014.05.08.8-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-restconf</artifactId>
+ <version>2013.10.19.8-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-ted</artifactId>
+ <version>${ietf.topology.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-topology</artifactId>
+ <version>${ietf.topology.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-topology-isis</artifactId>
+ <version>${ietf.topology.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-topology-l3-unicast-igp</artifactId>
+ <version>${ietf.topology.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-topology-ospf</artifactId>
+ <version>${ietf.topology.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-topology-l3-unicast</artifactId>
+ <version>${ietf.topology.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>opendaylight-l2-types</artifactId>
+ <version>2013.08.27.8-SNAPSHOT</version>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ 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
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.opendaylight.odlparent</groupId>
+ <artifactId>features-parent</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>features-mdsal-model</artifactId>
+ <version>0.8.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <properties>
+ <yangtools.version>0.8.0-SNAPSHOT</yangtools.version>
+ <mdsal.version>2.0.0-SNAPSHOT</mdsal.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yangtools-artifacts</artifactId>
+ <version>${yangtools.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>${mdsal.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>mdsal-model-artifacts</artifactId>
+ <version>0.8.0-SNAPSHOT</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>features-mdsal</artifactId>
+ <classifier>features</classifier>
+ <type>xml</type>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>iana-if-type-2014-05-08</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-inet-types</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-interfaces</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-restconf</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-yang-types</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-yang-types-20130715</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>yang-ext</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>opendaylight-l2-types</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-ted</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-topology</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-topology-isis</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-topology-ospf</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-topology-l3-unicast-igp</artifactId>
+ </dependency>
+ </dependencies>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ 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
+-->
+<features name="odl-mdsal-models-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
+
+ <repository>mvn:org.opendaylight.mdsal/features-mdsal/{{VERSION}}/xml/features</repository>
+
+ <feature name='odl-mdsal-models' version='${project.version}' description='OpenDaylight :: MD-SAL :: Models'>
+ <feature version='${mdsal.version}'>odl-mdsal-binding-base</feature>
+ <bundle>mvn:org.opendaylight.mdsal.model/iana-if-type-2014-05-08/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal.model/ietf-inet-types/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal.model/ietf-interfaces/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal.model/ietf-yang-types/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal.model/ietf-yang-types-20130715/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal.model/ietf-restconf/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal.model/yang-ext/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal.model/opendaylight-l2-types/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal.model/ietf-ted/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal.model/ietf-topology/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal.model/ietf-topology-isis/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal.model/ietf-topology-ospf/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.mdsal.model/ietf-topology-l3-unicast-igp/{{VERSION}}</bundle>
+ </feature>
+
+</features>
<modelVersion>4.0.0</modelVersion>
<artifactId>iana-afn-safi</artifactId>
<version>2013.07.04.8-SNAPSHOT</version>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <packaging>bundle</packaging>
</project>
<version>2014.05.08.8-SNAPSHOT</version>
<name>${project.artifactId}</name>
<description>${project.artifactId}</description>
+ <packaging>bundle</packaging>
<dependencies>
<dependency>
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- </instructions>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
-
</project>
<modelVersion>4.0.0</modelVersion>
<artifactId>iana-if-type</artifactId>
<version>2013.07.04.8-SNAPSHOT</version>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <packaging>bundle</packaging>
</project>
<version>2010.09.24.8-SNAPSHOT</version>
<name>${project.artifactId}</name>
<description>${project.artifactId}</description>
+ <packaging>bundle</packaging>
<dependencies>
<dependency>
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- </instructions>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
-
</project>
<version>2014.05.08.8-SNAPSHOT</version>
<name>${project.artifactId}</name>
<description>${project.artifactId}</description>
+ <packaging>bundle</packaging>
<dependencies>
<dependency>
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- </instructions>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
-
</project>
<version>2013.10.19.8-SNAPSHOT</version>
<name>${project.artifactId}</name>
<description>${project.artifactId}</description>
+ <packaging>bundle</packaging>
<dependencies>
<dependency>
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
<version>2013.10.21.8-SNAPSHOT</version>
<name>${project.artifactId}</name>
<description>${project.artifactId}</description>
+ <packaging>bundle</packaging>
<dependencies>
<dependency>
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
<version>0.8.0-SNAPSHOT</version>
</parent>
-
<modelVersion>4.0.0</modelVersion>
<artifactId>ietf-topology-isis</artifactId>
<version>2013.10.21.8-SNAPSHOT</version>
<name>${project.artifactId}</name>
<description>${project.artifactId}</description>
+ <packaging>bundle</packaging>
<dependencies>
<dependency>
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
<version>2013.10.21.8-SNAPSHOT</version>
<name>${project.artifactId}</name>
<description>${project.artifactId}</description>
+ <packaging>bundle</packaging>
<dependencies>
<dependency>
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
<version>2013.10.21.8-SNAPSHOT</version>
<name>${project.artifactId}</name>
<description>${project.artifactId}</description>
+ <packaging>bundle</packaging>
<dependencies>
<dependency>
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
<version>2013.10.21.8-SNAPSHOT</version>
<name>${project.artifactId}</name>
<description>${project.artifactId}</description>
+ <packaging>bundle</packaging>
<dependencies>
<dependency>
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
<version>2013.07.15.8-SNAPSHOT</version>
<name>${project.artifactId}</name>
<description>${project.artifactId}</description>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <packaging>bundle</packaging>
</project>
<version>2010.09.24.8-SNAPSHOT</version>
<name>${project.artifactId}</name>
<description>${project.artifactId}</description>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <packaging>bundle</packaging>
</project>
<modelVersion>4.0.0</modelVersion>
<artifactId>opendaylight-l2-types</artifactId>
<version>2013.08.27.8-SNAPSHOT</version>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <packaging>bundle</packaging>
</project>
<description>${project.artifactId}</description>
<modules>
+ <module>features</module>
+ <module>artifacts</module>
<module>yang-ext</module>
<module>iana</module>
<module>ietf</module>
<version>2013.09.07.8-SNAPSHOT</version>
<name>${project.artifactId}</name>
<description>${project.artifactId}</description>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <packaging>bundle</packaging>
</project>