Use java.util.Optional, cascading that to all users.
Change-Id: I3ba97d060c8ea564bec378285bf6d8dbdb6a59d6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Jakub Morvay <jmorvay@frinx.io>
*/
package org.opendaylight.netconf.callhome.protocol;
-import com.google.common.base.Optional;
import io.netty.channel.DefaultEventLoopGroup;
import io.netty.channel.EventLoopGroup;
import io.netty.util.HashedWheelTimer;
import java.net.InetSocketAddress;
+import java.util.Optional;
import java.util.concurrent.TimeUnit;
import org.apache.sshd.client.SshClient;
import org.opendaylight.netconf.callhome.protocol.CallHomeSessionContext.Factory;
private static NetconfClientSessionNegotiatorFactory defaultNegotiationFactory() {
return new NetconfClientSessionNegotiatorFactory(new HashedWheelTimer(),
- Optional.absent(), DEFAULT_SESSION_TIMEOUT_MILLIS);
+ Optional.empty(), DEFAULT_SESSION_TIMEOUT_MILLIS);
}
private static EventLoopGroup defaultNettyGroup() {
* 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.netconf.mdsal.connector.ops;
import static java.nio.charset.StandardCharsets.UTF_8;
-import com.google.common.base.Optional;
import com.google.common.base.Strings;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLConnection;
import java.net.URLStreamHandler;
import java.util.Base64;
+import java.util.Optional;
import org.opendaylight.netconf.api.DocumentedException;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
final Optional<XmlElement> configElement = parent.getOnlyChildElementOptionally(CONFIG_KEY);
if (configElement.isPresent()) {
return configElement.get();
- } else {
- final Optional<XmlElement> urlElement = parent.getOnlyChildElementOptionally(URL_KEY);
- if (!urlElement.isPresent()) {
- throw new DocumentedException("Invalid RPC, neither <config> not <url> element is present",
- DocumentedException.ErrorType.PROTOCOL,
- DocumentedException.ErrorTag.MISSING_ELEMENT,
- DocumentedException.ErrorSeverity.ERROR);
- }
+ }
- final Document document = getDocumentFromUrl(urlElement.get().getTextContent());
- return XmlElement.fromDomElementWithExpected(document.getDocumentElement(), CONFIG_KEY,
- XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
+ final Optional<XmlElement> urlElement = parent.getOnlyChildElementOptionally(URL_KEY);
+ if (!urlElement.isPresent()) {
+ throw new DocumentedException("Invalid RPC, neither <config> not <url> element is present",
+ DocumentedException.ErrorType.PROTOCOL,
+ DocumentedException.ErrorTag.MISSING_ELEMENT,
+ DocumentedException.ErrorSeverity.ERROR);
}
+
+ final Document document = getDocumentFromUrl(urlElement.get().getTextContent());
+ return XmlElement.fromDomElementWithExpected(document.getDocumentElement(), CONFIG_KEY,
+ XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
}
/**
* 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.netconf.mdsal.connector.ops;
-import com.google.common.base.Optional;
import org.opendaylight.netconf.api.DocumentedException;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
boolean commitStatus = transactionProvider.commitTransaction();
LOG.trace("Commit completed successfully {}", commitStatus);
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK);
}
@Override
protected String getOperationName() {
return OPERATION_NAME;
}
-
}
import static org.opendaylight.netconf.api.xml.XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0;
-import com.google.common.base.Optional;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
+import java.util.Optional;
import java.util.concurrent.ExecutionException;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
ErrorTag.BAD_ELEMENT,
ErrorSeverity.ERROR);
}
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK);
}
private void copyToCandidate(final XmlElement operationElement)
* 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.netconf.mdsal.connector.ops;
-import com.google.common.base.Optional;
import java.util.HashMap;
import java.util.Map;
import org.opendaylight.netconf.api.DocumentedException;
throw new DocumentedException(e.getMessage(), e, ErrorType.APPLICATION, ErrorTag.OPERATION_FAILED,
ErrorSeverity.ERROR, errorInfo);
}
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK);
}
@Override
*/
package org.opendaylight.netconf.mdsal.connector.ops;
-import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import java.util.List;
import java.util.ListIterator;
executeOperations(changeTracker);
}
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK);
}
private void executeOperations(final DataTreeChangeTracker changeTracker) throws DocumentedException {
* 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.netconf.mdsal.connector.ops;
-import com.google.common.base.Optional;
import org.opendaylight.netconf.api.DocumentedException;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
final Datastore targetDatastore = extractTargetParameter(operationElement);
if (targetDatastore == Datastore.candidate) {
LOG.debug("Locking candidate datastore on session: {}", getNetconfSessionIdForReporting());
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK);
}
throw new DocumentedException("Unable to lock " + targetDatastore + " datastore",
*/
package org.opendaylight.netconf.mdsal.connector.ops;
-import com.google.common.base.Optional;
import java.io.IOException;
import java.net.URI;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
+import java.util.Optional;
import java.util.concurrent.ExecutionException;
import javax.annotation.Nullable;
import javax.xml.stream.XMLOutputFactory;
//this returns module with the newest revision if more then 1 module with same namespace is found
private Optional<Module> getModule(final URI namespaceURI) {
- return Optional.fromJavaUtil(schemaContext.getCurrentContext().findModules(namespaceURI).stream().findFirst());
+ return schemaContext.getCurrentContext().findModules(namespaceURI).stream().findFirst();
}
private static Optional<RpcDefinition> getRpcDefinitionFromModule(final Module module, final URI namespaceURI,
return Optional.of(rpcDef);
}
}
- return Optional.absent();
+ return Optional.empty();
}
@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.netconf.mdsal.connector.ops;
-import com.google.common.base.Optional;
import org.opendaylight.netconf.api.DocumentedException;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
final Datastore targetDatastore = Lock.extractTargetParameter(operationElement);
if (targetDatastore == Datastore.candidate) {
LOG.debug("Unlocking candidate datastore on session: {}", getNetconfSessionIdForReporting());
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK);
}
throw new DocumentedException("Unable to unlock " + targetDatastore + " datastore",
* 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.netconf.mdsal.connector.ops;
-import com.google.common.base.Optional;
import com.google.common.collect.ImmutableMap;
import java.util.Map;
import org.opendaylight.netconf.api.DocumentedException;
transactionProvider.validateTransaction();
LOG.trace("<validate> request completed successfully on session {}", getNetconfSessionIdForReporting());
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK);
}
protected static Datastore extractSourceParameter(final XmlElement operationElement, final String operationName)
package org.opendaylight.netconf.mdsal.connector.ops.get;
import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Optional;
import com.google.common.collect.Iterables;
import java.io.IOException;
+import java.util.Optional;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
final Optional<XmlElement> filterElement = operationElement.getOnlyChildElementOptionally(FILTER);
if (filterElement.isPresent()) {
if (filterElement.get().getChildElements().size() == 0) {
- return Optional.absent();
+ return Optional.empty();
}
return Optional.of(getInstanceIdentifierFromFilter(filterElement.get()));
}
private static Optional<Datastore> parseSource(final XmlElement xml) throws DocumentedException {
final Optional<XmlElement> sourceElement = xml.getOnlyChildElementOptionally(XmlNetconfConstants.SOURCE_KEY,
XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0);
-
return sourceElement.isPresent()
? Optional.of(Datastore.valueOf(sourceElement.get().getOnlyChildElement().getName()))
- : Optional.absent();
+ : Optional.empty();
}
private static void validateInputRpc(final XmlElement xml, final String operationName) throws
import static org.opendaylight.yangtools.yang.data.util.ParserStreamUtils.findSchemaNodeByNameAndNamespace;
-import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import javax.xml.namespace.NamespaceContext;
import javax.xml.stream.XMLStreamWriter;
import org.opendaylight.netconf.api.DocumentedException;
*/
package org.opendaylight.netconf.mdsal.connector.ops.get;
-import com.google.common.base.Optional;
+import java.util.Optional;
import java.util.concurrent.ExecutionException;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.dom.api.DOMDataTreeReadWriteTransaction;
final Optional<YangInstanceIdentifier> dataRootOptional = getDataRootFromFilter(operationElement);
if (!dataRootOptional.isPresent()) {
- return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY);
}
final YangInstanceIdentifier dataRoot = dataRootOptional.get();
transactionProvider.abortRunningTransaction(rwTx);
if (!normalizedNodeOptional.isPresent()) {
- return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY);
}
return serializeNodeWithParentStructure(document, dataRoot, normalizedNodeOptional.get());
*/
package org.opendaylight.netconf.mdsal.connector.ops.get;
-import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
+import java.util.Optional;
import java.util.concurrent.ExecutionException;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.dom.api.DOMDataTreeReadWriteTransaction;
final Optional<YangInstanceIdentifier> dataRootOptional = getDataRootFromFilter(operationElement);
if (!dataRootOptional.isPresent()) {
- return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY);
}
final YangInstanceIdentifier dataRoot = dataRootOptional.get();
}
if (!normalizedNodeOptional.isPresent()) {
- return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY);
}
return serializeNodeWithParentStructure(document, dataRoot, normalizedNodeOptional.get());
* 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.netconf.messagebus.eventsources.netconf;
import static com.google.common.util.concurrent.Futures.immediateFuture;
-import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Maps;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.regex.Pattern;
* 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.netconf.api.messages;
-import com.google.common.base.Optional;
import com.google.common.collect.Sets;
+import java.util.Optional;
import java.util.Set;
import org.opendaylight.netconf.api.NetconfMessage;
import org.opendaylight.netconf.api.xml.XmlElement;
}
public Optional<NetconfHelloMessageAdditionalHeader> getAdditionalHeader() {
- return Optional.fromNullable(additionalHeader);
+ return Optional.ofNullable(additionalHeader);
}
private static void checkHelloMessage(final Document doc) {
public static NetconfHelloMessage createClientHello(final Iterable<String> capabilities,
final Optional<NetconfHelloMessageAdditionalHeader> additionalHeaderOptional) {
- return new NetconfHelloMessage(createHelloMessageDoc(capabilities), additionalHeaderOptional.orNull());
+ return new NetconfHelloMessage(createHelloMessageDoc(capabilities), additionalHeaderOptional.orElse(null));
}
private static Document createHelloMessageDoc(final Iterable<String> capabilities) {
*/
package org.opendaylight.netconf.api.monitoring;
-import com.google.common.base.Optional;
import java.util.Collection;
+import java.util.Optional;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Capabilities;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Schemas;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Sessions;
*/
package org.opendaylight.netconf.api.xml;
-import com.google.common.base.Optional;
import com.google.common.base.Strings;
import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import org.opendaylight.netconf.api.DocumentedException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public Optional<XmlElement> getOnlyChildElementOptionally(final String childName) {
List<XmlElement> nameElements = getChildElements(childName);
if (nameElements.size() != 1) {
- return Optional.absent();
+ return Optional.empty();
}
return Optional.of(nameElements.get(0));
}
children = Lists.newArrayList(Collections2.filter(children,
xmlElement -> xmlElement.getName().equals(childName)));
if (children.size() != 1) {
- return Optional.absent();
+ return Optional.empty();
}
return Optional.of(children.get(0));
}
public Optional<XmlElement> getOnlyChildElementOptionally() {
List<XmlElement> children = getChildElements();
if (children.size() != 1) {
- return Optional.absent();
+ return Optional.empty();
}
return Optional.of(children.get(0));
}
children = Lists.newArrayList(Collections2.filter(children,
xmlElement -> xmlElement.getName().equals(childName)));
if (children.size() != 1) {
- return Optional.absent();
+ return Optional.empty();
}
return Optional.of(children.get(0));
}
- return Optional.absent();
+ return Optional.empty();
}
public Optional<XmlElement> getOnlyChildElementWithSameNamespaceOptionally() {
&& getNamespaceOptionally().get().equals(child.get().getNamespaceOptionally().get())) {
return child;
}
- return Optional.absent();
+ return Optional.empty();
}
public XmlElement getOnlyChildElement(final String childName, final String namespace) throws DocumentedException {
return Optional.of(((Text) item).getWholeText());
}
}
- return Optional.absent();
+ return Optional.empty();
}
public String getNamespaceAttribute() throws MissingNameSpaceException {
public Optional<String> getNamespaceAttributeOptionally() {
String attribute = element.getAttribute(XmlUtil.XMLNS_ATTRIBUTE_KEY);
if (attribute.isEmpty() || attribute.equals(DEFAULT_NAMESPACE_PREFIX)) {
- return Optional.absent();
+ return Optional.empty();
}
return Optional.of(attribute);
}
public Optional<String> getNamespaceOptionally() {
String namespaceURI = element.getNamespaceURI();
if (Strings.isNullOrEmpty(namespaceURI)) {
- return Optional.absent();
+ return Optional.empty();
} else {
return Optional.of(namespaceURI);
}
* 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.netconf.api.xml;
-import com.google.common.base.Optional;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.StringWriter;
import java.nio.charset.StandardCharsets;
+import java.util.Optional;
import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilder;
return DEFAULT_DOM_BUILDER.get().newDocument();
}
- public static Element createElement(final Document document, final String qmame,
+ public static Element createElement(final Document document, final String qname) {
+ return createElement(document, qname, Optional.empty());
+ }
+
+ public static Element createElement(final Document document, final String qname,
final Optional<String> namespaceURI) {
if (namespaceURI.isPresent()) {
- final Element element = document.createElementNS(namespaceURI.get(), qmame);
+ final Element element = document.createElementNS(namespaceURI.get(), qname);
String name = XMLNS_ATTRIBUTE_KEY;
if (element.getPrefix() != null) {
name += ":" + element.getPrefix();
element.setAttributeNS(XMLNS_URI, name, namespaceURI.get());
return element;
}
- return document.createElement(qmame);
+ return document.createElement(qname);
}
public static Element createTextElement(final Document document, final String qname, final String content,
final String prefix, final String namespace, final String contentWithoutPrefix) {
return createTextElementWithNamespacedContent(document, qname, prefix, namespace, contentWithoutPrefix,
- Optional.absent());
+ Optional.empty());
}
public static Element createTextElementWithNamespacedContent(final Document document, final String qname,
* 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.netconf.api.messages;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import com.google.common.base.Optional;
+import java.util.Optional;
import java.util.Set;
import org.junit.Before;
import org.junit.Test;
* 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.netconf.api.xml;
import static org.hamcrest.CoreMatchers.both;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import com.google.common.base.Optional;
import java.util.Map;
+import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.netconf.api.DocumentedException;
final XmlElement inner = xmlElement.getOnlyChildElement("inner");
final XmlElement deepInner = inner.getOnlyChildElementWithSameNamespaceOptionally().get();
assertEquals(deepInner, inner.getOnlyChildElementWithSameNamespace());
- assertEquals(Optional.<XmlElement>absent(), xmlElement.getOnlyChildElementOptionally("unknown"));
+ assertEquals(Optional.empty(), xmlElement.getOnlyChildElementOptionally("unknown"));
assertEquals("deepValue", deepInner.getTextContent());
assertEquals("deepValue", deepInner.getOnlyTextContentOptionally().get());
assertEquals("deepValue", deepInner.getOnlyTextContentOptionally().get());
* 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.netconf.api.xml;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import com.google.common.base.Optional;
import java.io.ByteArrayInputStream;
+import java.util.Optional;
import org.custommonkey.xmlunit.Diff;
import org.custommonkey.xmlunit.XMLUnit;
import org.junit.Test;
import static java.util.Objects.requireNonNull;
-import com.google.common.base.Optional;
import com.google.common.collect.ImmutableSet;
import com.siemens.ct.exi.core.CodingMode;
import com.siemens.ct.exi.core.FidelityOptions;
import io.netty.channel.Channel;
import io.netty.util.Timer;
import io.netty.util.concurrent.Promise;
+import java.util.Optional;
import java.util.Set;
import org.opendaylight.netconf.api.NetconfClientSessionPreferences;
import org.opendaylight.netconf.api.NetconfMessage;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import java.net.InetSocketAddress;
import java.util.List;
+import java.util.Optional;
import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
import org.opendaylight.netconf.client.NetconfClientSessionListener;
import org.opendaylight.netconf.client.SslHandlerFactory;
}
public final Optional<NetconfHelloMessageAdditionalHeader> getAdditionalHeader() {
- return Optional.fromNullable(additionalHeader);
+ return Optional.ofNullable(additionalHeader);
}
public final NetconfClientSessionListener getSessionListener() {
package org.opendaylight.netconf.client;
-import com.google.common.base.Optional;
import java.net.InetSocketAddress;
+import java.util.Optional;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mockito;
.withAuthHandler(handler).build();
Assert.assertEquals(timeout, cfg.getConnectionTimeoutMillis());
- Assert.assertEquals(Optional.fromNullable(header), cfg.getAdditionalHeader());
+ Assert.assertEquals(Optional.of(header), cfg.getAdditionalHeader());
Assert.assertEquals(listener, cfg.getSessionListener());
Assert.assertEquals(handler, cfg.getAuthHandler());
Assert.assertEquals(strategy, cfg.getReconnectStrategy());
.withSslHandlerFactory(sslHandlerFactory).build();
Assert.assertEquals(timeout, cfg2.getConnectionTimeoutMillis());
- Assert.assertEquals(Optional.fromNullable(header), cfg2.getAdditionalHeader());
+ Assert.assertEquals(Optional.of(header), cfg2.getAdditionalHeader());
Assert.assertEquals(listener, cfg2.getSessionListener());
Assert.assertEquals(sslHandlerFactory, cfg2.getSslHandlerFactory());
Assert.assertEquals(strategy, cfg2.getReconnectStrategy());
* 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.netconf.client;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
-import com.google.common.base.Optional;
import io.netty.channel.Channel;
import io.netty.util.HashedWheelTimer;
import io.netty.util.Timer;
import io.netty.util.concurrent.Promise;
+import java.util.Optional;
import org.junit.Test;
import org.opendaylight.netconf.api.NetconfSessionListenerFactory;
Channel channel = mock(Channel.class);
Promise<NetconfClientSession> promise = mock(Promise.class);
NetconfClientSessionNegotiatorFactory negotiatorFactory = new NetconfClientSessionNegotiatorFactory(timer,
- Optional.absent(), 200L);
+ Optional.empty(), 200L);
NetconfClientSessionNegotiator sessionNegotiator = negotiatorFactory.getSessionNegotiator(listenerFactory,
channel, promise);
* 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.netconf.client;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import com.google.common.base.Optional;
import com.google.common.collect.ImmutableSet;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandler;
import io.netty.util.concurrent.GenericFutureListener;
import io.netty.util.concurrent.Promise;
import java.io.InputStream;
+import java.util.Optional;
import java.util.Set;
import org.junit.Before;
import org.junit.Test;
@Before
public void setUp() throws Exception {
- helloMessage = NetconfHelloMessage.createClientHello(Sets.newSet("exi:1.0"), Optional.absent());
+ helloMessage = NetconfHelloMessage.createClientHello(Sets.newSet("exi:1.0"), Optional.empty());
pipeline = mockChannelPipeline();
future = mockChannelFuture();
channel = mockChannel();
package org.opendaylight.netconf.client;
-import com.google.common.base.Optional;
import java.net.InetSocketAddress;
+import java.util.Optional;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mockito;
.withAuthHandler(handler).build();
Assert.assertEquals(timeout, cfg.getConnectionTimeoutMillis());
- Assert.assertEquals(Optional.fromNullable(header), cfg.getAdditionalHeader());
+ Assert.assertEquals(Optional.of(header), cfg.getAdditionalHeader());
Assert.assertEquals(listener, cfg.getSessionListener());
Assert.assertEquals(handler, cfg.getAuthHandler());
Assert.assertEquals(strategy, cfg.getConnectStrategyFactory());
.withSslHandlerFactory(sslHandlerFactory).build();
Assert.assertEquals(timeout, cfg2.getConnectionTimeoutMillis());
- Assert.assertEquals(Optional.fromNullable(header), cfg2.getAdditionalHeader());
+ Assert.assertEquals(Optional.of(header), cfg2.getAdditionalHeader());
Assert.assertEquals(listener, cfg2.getSessionListener());
Assert.assertEquals(sslHandlerFactory, cfg2.getSslHandlerFactory());
Assert.assertEquals(strategy, cfg2.getConnectStrategyFactory());
* 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.netconf.impl;
-import com.google.common.base.Optional;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.netty.channel.Channel;
import io.netty.channel.local.LocalAddress;
import java.net.SocketAddress;
import java.util.AbstractMap;
import java.util.Map;
+import java.util.Optional;
import org.opendaylight.netconf.api.NetconfDocumentedException;
import org.opendaylight.netconf.api.NetconfServerSessionPreferences;
import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
* 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.netconf.impl.mapping.operations;
-import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import java.util.Collections;
import org.opendaylight.netconf.api.DocumentedException;
DocumentedException.ErrorSeverity.ERROR, Collections.singletonMap(
DocumentedException.ErrorSeverity.ERROR.toString(), e.getMessage()));
}
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK);
}
@Override
import static org.opendaylight.netconf.api.xml.XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_CAPABILITY_URL_1_0;
import com.google.common.base.Function;
-import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.collect.Collections2;
import com.google.common.collect.ImmutableList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import java.util.Set;
import org.opendaylight.netconf.api.capability.BasicCapability;
import org.opendaylight.netconf.api.capability.Capability;
*/
package org.opendaylight.netconf.impl.osgi;
-import com.google.common.base.Optional;
+import java.util.Optional;
import org.opendaylight.controller.config.threadpool.ScheduledThreadPool;
import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
import org.opendaylight.netconf.api.monitoring.SessionListener;
private final NetconfSessionMonitoringService sessionMonitoring;
public NetconfMonitoringServiceImpl(NetconfOperationServiceFactory opProvider) {
- this(opProvider, Optional.absent(), 0);
+ this(opProvider, Optional.empty(), 0);
}
public NetconfMonitoringServiceImpl(NetconfOperationServiceFactory opProvider,
ScheduledThreadPool threadPool,
long updateInterval) {
- this(opProvider, Optional.fromNullable(threadPool), updateInterval);
+ this(opProvider, Optional.ofNullable(threadPool), updateInterval);
}
public NetconfMonitoringServiceImpl(NetconfOperationServiceFactory opProvider,
*/
package org.opendaylight.netconf.impl.osgi;
-import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.collect.Collections2;
import com.google.common.collect.ImmutableList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
+import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import static org.opendaylight.netconf.api.xml.XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_CAPABILITY_CANDIDATE_1_0;
import static org.opendaylight.netconf.api.xml.XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_CAPABILITY_URL_1_0;
-import com.google.common.base.Optional;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
+import java.util.Optional;
import java.util.Set;
import org.junit.Assert;
import org.junit.Before;
//remove one revision
monitoringService.onCapabilitiesChanged(Collections.emptySet(), Collections.singleton(moduleCapability1));
//only one revision present
- final String schema3 = monitoringService.getSchemaForModuleRevision(TEST_MODULE_NAME, Optional.absent());
+ final String schema3 = monitoringService.getSchemaForModuleRevision(TEST_MODULE_NAME, Optional.empty());
Assert.assertEquals(TEST_MODULE_CONTENT2, schema3);
}
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.verify;
-import com.google.common.base.Optional;
import java.util.Collection;
import java.util.HashSet;
+import java.util.Optional;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import org.junit.Assert;
doNothing().when(notificationPublisher).onSessionStarted(any());
doNothing().when(notificationPublisher).onSessionEnded(any());
- monitoringService = new NetconfSessionMonitoringService(Optional.absent(), 0);
+ monitoringService = new NetconfSessionMonitoringService(Optional.empty(), 0);
monitoringService.registerListener(listener);
}
*/
package org.opendaylight.netconf.monitoring;
-import com.google.common.base.Optional;
import java.util.HashMap;
import java.util.Map;
+import java.util.Optional;
import org.opendaylight.netconf.api.DocumentedException;
import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
import org.opendaylight.netconf.api.xml.XmlElement;
if (versionElement.isPresent()) {
version = Optional.of(versionElement.get().getTextContent());
} else {
- version = Optional.absent();
+ version = Optional.empty();
}
}
}
* 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.netconf.monitoring;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
-import com.google.common.base.Optional;
+import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.netconf.api.DocumentedException;
package org.opendaylight.netconf.nettyutil.handler;
import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
+import java.util.Optional;
import javax.xml.transform.TransformerException;
import org.opendaylight.netconf.api.NetconfMessage;
import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
* 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.netconf.nettyutil;
import static org.mockito.ArgumentMatchers.any;
import static org.opendaylight.netconf.nettyutil.AbstractChannelInitializer.NETCONF_MESSAGE_AGGREGATOR;
import static org.opendaylight.netconf.nettyutil.AbstractChannelInitializer.NETCONF_MESSAGE_FRAME_ENCODER;
-import com.google.common.base.Optional;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelInboundHandlerAdapter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.Optional;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
channel.pipeline().addLast(NETCONF_MESSAGE_FRAME_ENCODER,
FramingMechanismHandlerFactory.createHandler(FramingMechanism.EOM));
channel.pipeline().addLast(NETCONF_MESSAGE_AGGREGATOR, new NetconfEOMAggregator());
- hello = NetconfHelloMessage.createClientHello(Collections.emptySet(), Optional.absent());
+ hello = NetconfHelloMessage.createClientHello(Collections.emptySet(), Optional.empty());
helloBase11 = NetconfHelloMessage.createClientHello(Collections
- .singleton(XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_BASE_1_1), Optional.absent());
+ .singleton(XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_BASE_1_1), Optional.empty());
prefs = new NetconfSessionPreferences(helloBase11);
doReturn(promise).when(promise).setFailure(any());
doReturn(promise).when(promise).setSuccess(any());
* 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.netconf.nettyutil;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.verifyZeroInteractions;
-import com.google.common.base.Optional;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandler;
import io.netty.handler.codec.MessageToByteEncoder;
import io.netty.util.concurrent.GenericFutureListener;
import java.util.Collections;
+import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
return null;
}).when(eventLoop).execute(any(Runnable.class));
- clientHello = NetconfHelloMessage.createClientHello(Collections.emptySet(), Optional.absent());
+ clientHello = NetconfHelloMessage.createClientHello(Collections.emptySet(), Optional.empty());
}
@Test
public void testSendMessage() throws Exception {
final TestingNetconfSession testingNetconfSession = new TestingNetconfSession(listener, channel, 1L);
final NetconfHelloMessage hello = NetconfHelloMessage.createClientHello(Collections.emptySet(),
- Optional.absent());
+ Optional.empty());
testingNetconfSession.sendMessage(hello);
verify(channel).writeAndFlush(hello, writeFuture);
}
* 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.netconf.nettyutil;
import static org.mockito.ArgumentMatchers.any;
import static org.opendaylight.netconf.nettyutil.AbstractChannelInitializer.NETCONF_MESSAGE_AGGREGATOR;
import static org.opendaylight.netconf.nettyutil.AbstractChannelInitializer.NETCONF_MESSAGE_FRAME_ENCODER;
-import com.google.common.base.Optional;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.util.HashedWheelTimer;
import io.netty.util.concurrent.Promise;
import java.util.Collections;
+import java.util.Optional;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
FramingMechanismHandlerFactory.createHandler(FramingMechanism.EOM));
channel.pipeline().addLast(NETCONF_MESSAGE_AGGREGATOR, new NetconfEOMAggregator());
final NetconfHelloMessage serverHello = NetconfHelloMessage.createClientHello(Collections
- .singleton(XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_BASE_1_1), Optional.absent());
+ .singleton(XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_BASE_1_1), Optional.empty());
doReturn(promise).when(promise).setFailure(any());
doReturn(promise).when(promise).setSuccess(any());
negotiator = new TestSessionNegotiator(new NetconfSessionPreferences(serverHello), promise, channel,
*/
package org.opendaylight.netconf.notifications.impl.ops;
-import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import java.util.Optional;
import org.opendaylight.netconf.api.DocumentedException;
import org.opendaylight.netconf.api.NetconfSession;
import org.opendaylight.netconf.api.xml.XmlElement;
.registerNotificationListener(streamNameType, new NotificationSubscription(netconfSession, filter));
subscriptions.add(notificationListenerRegistration);
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK);
}
private static StreamNameType parseStreamIfPresent(final XmlElement operationElement) throws DocumentedException {
* 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.netconf.util.mapping;
-import com.google.common.base.Optional;
import java.util.Map;
+import java.util.Optional;
import org.opendaylight.netconf.api.DocumentedException;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
* 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.netconf.util.messages;
-import com.google.common.base.Optional;
import com.google.common.collect.Collections2;
import java.util.Collection;
import java.util.List;
+import java.util.Optional;
import javax.annotation.Nonnull;
import org.opendaylight.netconf.api.DocumentedException;
import org.opendaylight.netconf.api.NetconfDocumentedException;
XmlElement responseElement = XmlElement.fromDomDocument(doc);
// Extract child element <capabilities> from <hello> with or without(fallback) the same namespace
Optional<XmlElement> capabilitiesElement = responseElement
- .getOnlyChildElementWithSameNamespaceOptionally(XmlNetconfConstants.CAPABILITIES)
- .or(responseElement
- .getOnlyChildElementOptionally(XmlNetconfConstants.CAPABILITIES));
+ .getOnlyChildElementWithSameNamespaceOptionally(XmlNetconfConstants.CAPABILITIES);
+ if (!capabilitiesElement.isPresent()) {
+ capabilitiesElement = responseElement.getOnlyChildElementOptionally(XmlNetconfConstants.CAPABILITIES);
+ }
List<XmlElement> caps = capabilitiesElement.get().getChildElements(XmlNetconfConstants.CAPABILITY);
return Collections2.transform(caps, (@Nonnull final XmlElement input) -> {
* 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.netconf.util.messages;
-import com.google.common.base.Optional;
import java.util.Map;
+import java.util.Optional;
import org.opendaylight.netconf.api.DocumentedException;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
Document notification) throws DocumentedException {
removeEventTimeNode(notification);
if (isSupported(filter)) {
- return Optional.fromNullable(filteredNotification(filter, notification));
+ return Optional.ofNullable(filteredNotification(filter, notification));
}
return Optional.of(extractNotificationContent(notification));
}
* 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.netconf.util.messages;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import com.google.common.base.Optional;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.Optional;
import org.custommonkey.xmlunit.Diff;
import org.custommonkey.xmlunit.XMLUnit;
import org.junit.Before;
*/
package org.opendaylight.netconf.sal.connect.netconf.util;
-import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.Optional;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import javax.xml.transform.dom.DOMResult;
* 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.netconf.test.tool;
import com.google.common.base.Function;
-import com.google.common.base.Optional;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import java.util.Collections;
+import java.util.Optional;
import java.util.Set;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
* 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.netconf.test.tool.rpc;
-import com.google.common.base.Optional;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
import org.opendaylight.netconf.api.xml.XmlUtil;
import org.w3c.dom.Element;
public class SimulatedCommit extends AbstractLastNetconfOperation {
-
public SimulatedCommit(final String netconfSessionIdForReporting) {
super(netconfSessionIdForReporting);
}
@Override
protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK);
}
@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.netconf.test.tool.rpc;
import com.google.common.base.Optional;
}, delayAggregator, TimeUnit.SECONDS);
}
}
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK);
}
private static NetconfMessage parseNetconfNotification(String content) {
* 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.netconf.test.tool.rpc;
-import com.google.common.base.Optional;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
import org.opendaylight.netconf.api.xml.XmlUtil;
@Override
protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK);
}
@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.netconf.test.tool.rpc;
-import com.google.common.base.Optional;
import org.opendaylight.netconf.api.DocumentedException;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
storage.setConfigList(configElementData.getChildElements());
}
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK);
}
@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.netconf.test.tool.rpc;
-import com.google.common.base.Optional;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
import org.opendaylight.netconf.api.xml.XmlUtil;
@Override
protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
- final Element element = XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
+ final Element element = XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY);
for (final XmlElement e : storage.getConfigList()) {
final Element domElement = e.getDomElement();
* 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.netconf.test.tool.rpc;
import com.google.common.base.Optional;
@Override
protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
- final Element element = XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
+ final Element element = XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY);
for (final XmlElement e : storage.getConfigList()) {
final Element domElement = e.getDomElement();
* 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.netconf.test.tool.rpc;
-import com.google.common.base.Optional;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
import org.opendaylight.netconf.api.xml.XmlUtil;
@Override
protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK);
}
@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.netconf.test.tool.rpc;
-import com.google.common.base.Optional;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
import org.opendaylight.netconf.api.xml.XmlUtil;
@Override
protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
- return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
+ return XmlUtil.createElement(document, XmlNetconfConstants.OK);
}
@Override