/**
* Implementation of {@link ActionServiceHandler}.
*/
+// FIXME: remove this class
@Singleton
-public class ActionServiceHandler implements Handler<DOMActionService> {
+public class ActionServiceHandler {
private final @NonNull DOMActionService actionService;
/**
this.actionService = requireNonNull(actionService);
}
- @Override
public @NonNull DOMActionService get() {
return this.actionService;
}
*/
package org.opendaylight.restconf.nb.rfc8040.handlers;
+import static java.util.Objects.requireNonNull;
+
import javax.inject.Inject;
import javax.inject.Singleton;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.mdsal.dom.api.DOMDataBroker;
/**
* Implementation of {@link DOMDataBrokerHandler}.
*/
+// FIXME: remove this class
@Singleton
-public class DOMDataBrokerHandler implements Handler<DOMDataBroker> {
-
+public class DOMDataBrokerHandler {
private final DOMDataBroker broker;
@Inject
public DOMDataBrokerHandler(final DOMDataBroker broker) {
- this.broker = broker;
+ this.broker = requireNonNull(broker);
}
- @Override
- public DOMDataBroker get() {
- return this.broker;
+ public @NonNull DOMDataBroker get() {
+ return broker;
}
}
import javax.inject.Inject;
import javax.inject.Singleton;
import org.apache.aries.blueprint.annotation.service.Reference;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.mdsal.dom.api.DOMMountPointService;
/**
* Implementation of {@link DOMMountPointServiceHandler}.
*/
+// FIXME: remove this class
@Singleton
-public final class DOMMountPointServiceHandler implements Handler<DOMMountPointService> {
+public final class DOMMountPointServiceHandler {
private final DOMMountPointService domMountPointService;
/**
this.domMountPointService = requireNonNull(domMountPointService);
}
- @Override
- public DOMMountPointService get() {
+ public @NonNull DOMMountPointService get() {
return this.domMountPointService;
}
}
+++ /dev/null
-/*
- * Copyright (c) 2016 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.restconf.nb.rfc8040.handlers;
-
-/**
- * Handler for handling object prepared by provider for Restconf services.
- *
- * @param <T> specific type go object for handling it
- */
-interface Handler<T> {
-
- /**
- * Get prepared object.
- *
- * @return T
- */
- T get();
-
- /**
- * Update object.
- *
- * @param object new object to update old object
- */
- default void update(final T object) {
-
- }
-}
import org.apache.aries.blueprint.annotation.service.Reference;
import org.opendaylight.mdsal.dom.api.DOMNotificationService;
+// FIXME: remove this class
@Singleton
-public class NotificationServiceHandler implements Handler<DOMNotificationService> {
-
+public class NotificationServiceHandler {
private final DOMNotificationService notificationService;
/**
this.notificationService = notificationService;
}
- @Override
public DOMNotificationService get() {
return this.notificationService;
}
/**
* Implementation of {@link RpcServiceHandler}.
*/
+// FIXME: remove this class
@Singleton
-public class RpcServiceHandler implements Handler<DOMRpcService> {
+public class RpcServiceHandler {
private final DOMRpcService rpcService;
@Inject
this.rpcService = rpcService;
}
- @Override
public DOMRpcService get() {
return this.rpcService;
}
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.data.api.schema.tree.ConflictingModificationAppliedException;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContextListener;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Implementation of {@link SchemaContextHandler}.
*/
+// FIXME: this really is a service which is maintaining ietf-yang-library contents inside the datastore. It really
+// should live in MD-SAL and be a dynamic store fragment. As a first step we should be turning this into a
+// completely standalone application.
@Singleton
-public class SchemaContextHandler implements SchemaContextListenerHandler, AutoCloseable {
+public class SchemaContextHandler implements EffectiveModelContextListener, AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(SchemaContextHandler.class);
private final AtomicInteger moduleSetId = new AtomicInteger(0);
}
}
- @Override
public EffectiveModelContext get() {
return schemaContext;
}
+++ /dev/null
-/*
- * Copyright (c) 2016 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.restconf.nb.rfc8040.handlers;
-
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContextListener;
-
-interface SchemaContextListenerHandler extends Handler<EffectiveModelContext>, EffectiveModelContextListener {
-
-}
/**
* Implementation of {@link TransactionChainHandler}.
*/
+// FIXME: untangle this class, what good is it, really?!
@Singleton
-public class TransactionChainHandler implements Handler<DOMTransactionChain>, AutoCloseable {
+public class TransactionChainHandler implements AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(TransactionChainHandler.class);
private final DOMTransactionChainListener transactionChainListener = new DOMTransactionChainListener() {
* After use, is important to close transactionChain by method {@link DOMTransactionChain#close()}.
* @return new instance of object {@link DOMTransactionChain}
*/
- @Override
public DOMTransactionChain get() {
final DOMTransactionChain transactionChain = dataBroker.createTransactionChain(transactionChainListener);
this.transactionChainList.add(transactionChain);
@Override
@PreDestroy
public synchronized void close() {
- for (DOMTransactionChain transactionChain: this.transactionChainList) {
+ for (DOMTransactionChain transactionChain : this.transactionChainList) {
transactionChain.close();
LOG.trace("Closed TransactionChain({})", transactionChain);
}