Committed by
Gerrit Code Review
ONOS-3743 Adding end pattern to doRPC, removing unused rfc module and minor refa…
…ctoring of provider methods Change-Id: I95f896b80705ffb176534f2d4ba58acc786713e3
Showing
7 changed files
with
4 additions
and
79 deletions
... | @@ -126,7 +126,7 @@ public class NetconfSessionImpl implements NetconfSession { | ... | @@ -126,7 +126,7 @@ public class NetconfSessionImpl implements NetconfSession { |
126 | 126 | ||
127 | @Override | 127 | @Override |
128 | public String doRPC(String request) throws IOException { | 128 | public String doRPC(String request) throws IOException { |
129 | - String reply = doRequest(request); | 129 | + String reply = doRequest(request + "\n" + endpattern); |
130 | return checkReply(reply) ? reply : "ERROR " + reply; | 130 | return checkReply(reply) ? reply : "ERROR " + reply; |
131 | } | 131 | } |
132 | 132 | ... | ... |
protocols/netconf/rfc/pom.xml
deleted
100644 → 0
1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
2 | -<!-- | ||
3 | - ~ Copyright 2015 Open Networking Laboratory | ||
4 | - ~ | ||
5 | - ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | - ~ you may not use this file except in compliance with the License. | ||
7 | - ~ You may obtain a copy of the License at | ||
8 | - ~ | ||
9 | - ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | - ~ | ||
11 | - ~ Unless required by applicable law or agreed to in writing, software | ||
12 | - ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | - ~ See the License for the specific language governing permissions and | ||
15 | - ~ limitations under the License. | ||
16 | - --> | ||
17 | -<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
18 | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
19 | - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
20 | - <modelVersion>4.0.0</modelVersion> | ||
21 | - <parent> | ||
22 | - <groupId>org.onosproject</groupId> | ||
23 | - <artifactId>onos-netconf</artifactId> | ||
24 | - <version>1.5.0-SNAPSHOT</version> | ||
25 | - <relativePath>../pom.xml</relativePath> | ||
26 | - </parent> | ||
27 | - | ||
28 | - <artifactId>onos-netconf-rfc</artifactId> | ||
29 | - <packaging>bundle</packaging> | ||
30 | - | ||
31 | -</project> |
protocols/netconf/rfc/src/main/java/org/onosproject/netconf/rfc/package-info.java
deleted
100644 → 0
1 | -/* | ||
2 | - * Copyright 2015 Open Networking Laboratory | ||
3 | - * | ||
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | - * you may not use this file except in compliance with the License. | ||
6 | - * You may obtain a copy of the License at | ||
7 | - * | ||
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | - * | ||
10 | - * Unless required by applicable law or agreed to in writing, software | ||
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | - * See the License for the specific language governing permissions and | ||
14 | - * limitations under the License. | ||
15 | - */ | ||
16 | - | ||
17 | -/** | ||
18 | - * NETCONF libraries. | ||
19 | - */ | ||
20 | -package org.onosproject.netconf.rfc; |
... | @@ -19,7 +19,6 @@ | ... | @@ -19,7 +19,6 @@ |
19 | features="${project.artifactId}"> | 19 | features="${project.artifactId}"> |
20 | <description>${project.description}</description> | 20 | <description>${project.description}</description> |
21 | 21 | ||
22 | - <artifact>mvn:${project.groupId}/onos-netconf-rfc/${project.version}</artifact> | ||
23 | <artifact>mvn:${project.groupId}/onos-netconf-api/${project.version}</artifact> | 22 | <artifact>mvn:${project.groupId}/onos-netconf-api/${project.version}</artifact> |
24 | <artifact>mvn:${project.groupId}/onos-netconf-ctl/${project.version}</artifact> | 23 | <artifact>mvn:${project.groupId}/onos-netconf-ctl/${project.version}</artifact> |
25 | <artifact>mvn:${project.groupId}/onos-drivers/${project.version}</artifact> | 24 | <artifact>mvn:${project.groupId}/onos-drivers/${project.version}</artifact> | ... | ... |
... | @@ -49,7 +49,6 @@ import org.onosproject.netconf.NetconfDeviceListener; | ... | @@ -49,7 +49,6 @@ import org.onosproject.netconf.NetconfDeviceListener; |
49 | import org.slf4j.Logger; | 49 | import org.slf4j.Logger; |
50 | 50 | ||
51 | import java.io.IOException; | 51 | import java.io.IOException; |
52 | -import java.util.Map; | ||
53 | 52 | ||
54 | import static org.onosproject.net.config.basics.SubjectFactories.APP_SUBJECT_FACTORY; | 53 | import static org.onosproject.net.config.basics.SubjectFactories.APP_SUBJECT_FACTORY; |
55 | import static org.slf4j.LoggerFactory.getLogger; | 54 | import static org.slf4j.LoggerFactory.getLogger; |
... | @@ -65,8 +64,6 @@ public class NetconfDeviceProvider extends AbstractProvider | ... | @@ -65,8 +64,6 @@ public class NetconfDeviceProvider extends AbstractProvider |
65 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 64 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
66 | protected DeviceProviderRegistry providerRegistry; | 65 | protected DeviceProviderRegistry providerRegistry; |
67 | 66 | ||
68 | - // @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | ||
69 | -// protected DeviceService deviceService; | ||
70 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 67 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
71 | protected NetconfController controller; //where is initiated ? | 68 | protected NetconfController controller; //where is initiated ? |
72 | 69 | ||
... | @@ -102,7 +99,8 @@ public class NetconfDeviceProvider extends AbstractProvider | ... | @@ -102,7 +99,8 @@ public class NetconfDeviceProvider extends AbstractProvider |
102 | cfgService.registerConfigFactory(factory); | 99 | cfgService.registerConfigFactory(factory); |
103 | cfgService.addListener(cfgLister); | 100 | cfgService.addListener(cfgLister); |
104 | controller.addDeviceListener(innerNodeListener); | 101 | controller.addDeviceListener(innerNodeListener); |
105 | - connectExistingDevices(); | 102 | + appId = coreService.registerApplication("org.onosproject.netconf"); |
103 | + connectDevices(); | ||
106 | log.info("Started"); | 104 | log.info("Started"); |
107 | } | 105 | } |
108 | 106 | ||
... | @@ -132,14 +130,7 @@ public class NetconfDeviceProvider extends AbstractProvider | ... | @@ -132,14 +130,7 @@ public class NetconfDeviceProvider extends AbstractProvider |
132 | 130 | ||
133 | @Override | 131 | @Override |
134 | public boolean isReachable(DeviceId deviceId) { | 132 | public boolean isReachable(DeviceId deviceId) { |
135 | - Map<DeviceId, NetconfDevice> devices = controller.getDevicesMap(); | 133 | + NetconfDevice netconfDevice = controller.getNetconfDevice(deviceId); |
136 | - | ||
137 | - NetconfDevice netconfDevice = null; | ||
138 | - for (DeviceId key : devices.keySet()) { | ||
139 | - if (key.equals(deviceId)) { | ||
140 | - netconfDevice = controller.getDevicesMap().get(key); | ||
141 | - } | ||
142 | - } | ||
143 | if (netconfDevice == null) { | 134 | if (netconfDevice == null) { |
144 | log.warn("BAD REQUEST: the requested device id: " | 135 | log.warn("BAD REQUEST: the requested device id: " |
145 | + deviceId.toString() | 136 | + deviceId.toString() |
... | @@ -180,12 +171,6 @@ public class NetconfDeviceProvider extends AbstractProvider | ... | @@ -180,12 +171,6 @@ public class NetconfDeviceProvider extends AbstractProvider |
180 | } | 171 | } |
181 | } | 172 | } |
182 | 173 | ||
183 | - private void connectExistingDevices() { | ||
184 | - //TODO consolidate | ||
185 | - appId = coreService.registerApplication("org.onosproject.netconf"); | ||
186 | - connectDevices(); | ||
187 | - } | ||
188 | - | ||
189 | private void connectDevices() { | 174 | private void connectDevices() { |
190 | NetconfProviderConfig cfg = cfgService.getConfig(appId, NetconfProviderConfig.class); | 175 | NetconfProviderConfig cfg = cfgService.getConfig(appId, NetconfProviderConfig.class); |
191 | if (cfg != null) { | 176 | if (cfg != null) { | ... | ... |
-
Please register or login to post a comment