From: Martin Bobak Date: Tue, 14 Jan 2014 15:28:24 +0000 (+0100) Subject: sal-remote yang X-Git-Tag: jenkins-controller-bulk-release-prepare-only-2-1~2^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=a3a3b5486da08e794486e9228edaa44822369d05 sal-remote yang Change-Id: I7aaa6b341ce3199b3f90ed59b5d64f470f80d7b8 Signed-off-by: Martin Bobak --- diff --git a/opendaylight/md-sal/pom.xml b/opendaylight/md-sal/pom.xml index a53dadf971..bcbd48014d 100644 --- a/opendaylight/md-sal/pom.xml +++ b/opendaylight/md-sal/pom.xml @@ -36,6 +36,8 @@ model + sal-remote + sal-restconf-broker diff --git a/opendaylight/md-sal/sal-remote/pom.xml b/opendaylight/md-sal/sal-remote/pom.xml new file mode 100644 index 0000000000..d63cbfe781 --- /dev/null +++ b/opendaylight/md-sal/sal-remote/pom.xml @@ -0,0 +1,95 @@ + + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.0-SNAPSHOT + + sal-remote + jar + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + + + 0.6.0-SNAPSHOT + 0.5.9-SNAPSHOT + + + + + org.apache.felix + maven-bundle-plugin + true + + + org.opendaylight.yangtools + yang-maven-plugin + ${opendaylight.yang.version} + + + sal-remote + + generate-sources + + + src/main/yang + + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + + + target/generated-sources/ + + + + org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl + target/site/models + + + true + + + + + + org.opendaylight.yangtools + maven-sal-api-gen-plugin + ${opendaylight.binding.version} + jar + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.8 + + + add-source + generate-sources + + add-source + + + + ${project.build.directory}/generated-sources/ + + + + + + + + + + + org.opendaylight.controller + sal-binding-api + 1.0-SNAPSHOT + + + diff --git a/opendaylight/md-sal/sal-remote/src/main/java/org/opendaylight/controller/sal/restconf/service/impl/SalRemoteServiceImpl.java b/opendaylight/md-sal/sal-remote/src/main/java/org/opendaylight/controller/sal/restconf/service/impl/SalRemoteServiceImpl.java new file mode 100644 index 0000000000..1da603266b --- /dev/null +++ b/opendaylight/md-sal/sal-remote/src/main/java/org/opendaylight/controller/sal/restconf/service/impl/SalRemoteServiceImpl.java @@ -0,0 +1,34 @@ +/* + * 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.restconf.service.impl; + +import java.util.concurrent.Future; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.BeginTransactionOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.CreateDataChangeEventSubscriptionInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.CreateDataChangeEventSubscriptionOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.CreateNotificationStreamInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.CreateNotificationStreamOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.SalRemoteService; +import org.opendaylight.yangtools.yang.common.RpcResult; + +public class SalRemoteServiceImpl implements SalRemoteService { + @Override + public Future> beginTransaction() { + return null; + } + + @Override + public Future> createDataChangeEventSubscription(CreateDataChangeEventSubscriptionInput input) { + return null; + } + + @Override + public Future> createNotificationStream(CreateNotificationStreamInput input) { + return null; + } +} diff --git a/opendaylight/md-sal/sal-remote/src/main/yang/opendaylight-md-sal-remote.yang b/opendaylight/md-sal/sal-remote/src/main/yang/opendaylight-md-sal-remote.yang new file mode 100644 index 0000000000..cc77af57d6 --- /dev/null +++ b/opendaylight/md-sal/sal-remote/src/main/yang/opendaylight-md-sal-remote.yang @@ -0,0 +1,79 @@ +module sal-remote { + + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote"; + prefix "sal-remote"; + + + organization "Cisco Systems, Inc."; + contact "Martin Bobak "; + + description + "This module contains the definition of types related to + Internet Assigned Numbers Authority. + + Copyright (c)2013 Cisco Systems, Inc. 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"; + + revision "2014-01-14" { + description + "Initial revision"; + } + + + typedef q-name { + type string; + reference + "http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#QName"; + } + + rpc create-data-change-event-subscription { + input { + leaf path { + type instance-identifier; + description "Subtree path. "; + } + } + output { + leaf stream-name { + type string; + description "Notification stream name."; + } + } + } + + notification data-changed-notification { + description "Data change notification."; + leaf data-change-event { + type instance-identifier; + } + } + + rpc create-notification-stream { + input { + leaf-list notifications { + type q-name; + description "Notification QNames"; + } + } + output { + leaf notification-stream-identifier { + type string; + description "Unique notification stream identifier, in which notifications will be propagated"; + } + } + } + + rpc begin-transaction{ + output{ + anyxml data-modification-transaction{ + description "DataModificationTransaction xml"; + } + } + } + +} \ No newline at end of file diff --git a/opendaylight/md-sal/sal-restconf-broker/pom.xml b/opendaylight/md-sal/sal-restconf-broker/pom.xml new file mode 100644 index 0000000000..ffef1a9953 --- /dev/null +++ b/opendaylight/md-sal/sal-restconf-broker/pom.xml @@ -0,0 +1,56 @@ + + 4.0.0 + + org.opendaylight.controller + sal-parent + 1.0-SNAPSHOT + + sal-restconf-broker + jar + + scm:git:ssh://git.opendaylight.org:29418/controller.git + scm:git:ssh://git.opendaylight.org:29418/controller.git + https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL + + + 0.6.0-SNAPSHOT + 0.5.9-SNAPSHOT + + + + + org.apache.felix + maven-bundle-plugin + true + + + + + + + org.opendaylight.controller + sal-binding-api + 1.0-SNAPSHOT + + + org.opendaylight.controller + sal-remote + 1.0-SNAPSHOT + + + org.opendaylight.controller + sal-core-api + 1.0-SNAPSHOT + + + org.opendaylight.yangtools + restconf-client-api + 0.2.0-SNAPSHOT + + + org.slf4j + slf4j-api + + + diff --git a/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/DataBrokerServiceImpl.java b/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/DataBrokerServiceImpl.java new file mode 100644 index 0000000000..cbcdc99236 --- /dev/null +++ b/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/DataBrokerServiceImpl.java @@ -0,0 +1,115 @@ +/* + * 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.impl; + +import java.net.URL; +import java.util.concurrent.Future; +import org.opendaylight.controller.sal.binding.api.data.DataBrokerService; +import org.opendaylight.controller.sal.binding.api.data.DataChangeListener; +import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction; +import org.opendaylight.controller.sal.common.DataStoreIdentifier; +import org.opendaylight.yangtools.concepts.ListenerRegistration; +import org.opendaylight.yangtools.restconf.client.api.RestconfClientContext; +import org.opendaylight.yangtools.restconf.client.api.RestconfClientContextFactory; +import org.opendaylight.yangtools.restconf.client.api.UnsupportedProtocolException; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.DataRoot; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.common.RpcResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DataBrokerServiceImpl implements DataBrokerService { + + private static final Logger logger = LoggerFactory.getLogger(DataBrokerServiceImpl.class.toString()); + private final RestconfClientContext restconfClientContext; + private final RestconfClientContextFactory restconfClientContextFactory = null; + + public DataBrokerServiceImpl(URL baseUrl) throws UnsupportedProtocolException { + this.restconfClientContext = restconfClientContextFactory.getRestconfClientContext(baseUrl); + } + @Override + public T getData(DataStoreIdentifier store, Class rootType) { + return null; + } + + @Override + public T getData(DataStoreIdentifier store, T filter) { + return null; + } + + @Override + public T getCandidateData(DataStoreIdentifier store, Class rootType) { + return null; + } + + @Override + public T getCandidateData(DataStoreIdentifier store, T filter) { + return null; + } + + @Override + public RpcResult editCandidateData(DataStoreIdentifier store, DataRoot changeSet) { + return null; + } + + @Override + public Future> commit(DataStoreIdentifier store) { + return null; + } + + @Override + public DataObject getData(InstanceIdentifier data) { + return null; + } + + @Override + public DataObject getConfigurationData(InstanceIdentifier data) { + return null; + } + + @Override + public DataModificationTransaction beginTransaction() { + //TODO implementation using sal-remote + return null; + } + + @Override + public void registerChangeListener(InstanceIdentifier path, DataChangeListener changeListener) { + + } + + @Override + public void unregisterChangeListener(InstanceIdentifier path, DataChangeListener changeListener) { + + } + + @Override + public DataObject readConfigurationData(InstanceIdentifier path) { + //TODO implementation using restconf-client + return null; + + } + + @Override + public DataObject readOperationalData(InstanceIdentifier path) { + //TODO implementation using restconf-client + return null; + } + + @Override + public ListenerRegistration registerDataChangeListener(InstanceIdentifier path, DataChangeListener listener) { + //TODO implementation using restconf-client + return null; + } + + + + + +} diff --git a/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/NotificationServiceImpl.java b/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/NotificationServiceImpl.java new file mode 100644 index 0000000000..76c98e3dda --- /dev/null +++ b/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/NotificationServiceImpl.java @@ -0,0 +1,47 @@ +/* + * 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.impl; + +import org.opendaylight.controller.sal.binding.api.NotificationListener; +import org.opendaylight.controller.sal.binding.api.NotificationService; +import org.opendaylight.yangtools.concepts.Registration; +import org.opendaylight.yangtools.yang.binding.Notification; + +public class NotificationServiceImpl implements NotificationService { + @Override + public void addNotificationListener(Class notificationType, NotificationListener listener) { + + } + + @Override + public void addNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener) { + + } + + @Override + public void removeNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener) { + + } + + @Override + public void removeNotificationListener(Class notificationType, NotificationListener listener) { + + } + + @Override + public Registration> registerNotificationListener(Class notificationType, NotificationListener listener) { + //TODO implementation using sal-remote + return null; + } + + @Override + public Registration registerNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener) { + //TODO implementation using sal-remote + return null; + } +} diff --git a/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcConsumerRegistryImpl.java b/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcConsumerRegistryImpl.java new file mode 100644 index 0000000000..e6a67ee8eb --- /dev/null +++ b/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcConsumerRegistryImpl.java @@ -0,0 +1,19 @@ +/* + * 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.impl; + +import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry; +import org.opendaylight.yangtools.yang.binding.RpcService; + +public class RpcConsumerRegistryImpl implements RpcConsumerRegistry { + @Override + public T getRpcService(Class module) { + //TODO implementation using restconf-client + return null; + } +} diff --git a/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/SalRemoteServiceBroker.java b/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/SalRemoteServiceBroker.java new file mode 100644 index 0000000000..988bfd8ca5 --- /dev/null +++ b/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/SalRemoteServiceBroker.java @@ -0,0 +1,32 @@ +/* + * 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.restconf.broker; + + +import org.opendaylight.controller.sal.core.api.Broker; +import org.opendaylight.controller.sal.core.api.Consumer; +import org.opendaylight.controller.sal.core.api.Provider; +import org.osgi.framework.BundleContext; + +public class SalRemoteServiceBroker implements Broker,AutoCloseable { + + @Override + public void close() throws Exception { + + } + + @Override + public ConsumerSession registerConsumer(Consumer cons, BundleContext context) { + return null; + } + + @Override + public ProviderSession registerProvider(Provider prov, BundleContext context) { + return null; + } +}