Deprecate preliminary XPath/NormalizedNode interfaces
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / xpath / LazyXPathExpression.java
index e174bb4154eb7aefd1c82e6d9ba997df7364d7d3..1ce5256b8e754ccc8c133ecdb2f922e53cda3c11 100644 (file)
@@ -8,8 +8,8 @@
 package org.opendaylight.yangtools.yang.data.api.schema.xpath;
 
 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.ListenableFuture;
+import java.util.Optional;
 import java.util.concurrent.Future;
 import javax.annotation.Nonnull;
 import javax.xml.xpath.XPathExpressionException;
@@ -19,6 +19,7 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
  * Asynchronous interface to evaluation. It is functionally the same as an XPathExpression, but allows for asynchronous
  * execution of evaluation of the expression.
  *
+ * <p>
  * FIXME: Whether or not the resulting XPathResult can perform blocking calls is up for grabs, but implementations are
  *        definitely allowed to perform things like on-demand data transformation from foreign object and data models.
  *
@@ -26,24 +27,22 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
  *             APPLICATIONS WILLING TO USE THIS API PLEASE CONTACT
  *             <a href="mailto:yangtools-dev@lists.opendaylight.org">yangtools-dev</a>.
  */
-@Beta
 @Deprecated
+@Beta
 public interface LazyXPathExpression {
     /**
      * Evaluate this expression at the specified path in a document. If evaluation succeeds, it will return an
      * {@link XPathResult} at some point it the future. If it fails to match anything, it {@link Future#get()} will
-     * return {@link Optional#absent()}.
+     * return {@link Optional#empty()}.
      *
+     * <p>
      * FIXME: The amount of overhead an implementation can incur on the user as data from the resulting
      *        {@link XPathResult} is being accessed is left UNDEFINED.
-     *
      *        Specifically, the user is expected to store each result returned directly or indirectly in a local
      *        variable instead of repeated calls to the result's methods, as these may incur CPU processing overhead.
-     *
      *        Furthermore all method invocations can throw {@link LazyXPathExpressionException}, which the users are
      *        expected to handle gracefully. RESILIENT USERS ARE EXPECTED TO CATCH {@link LazyXPathExpressionException}
      *        AND RECOVER IN THE SAME MANNER THEY WOULD IF AN {@link XPathExpressionException} WOULD HAVE BEEN THROWN.
-     *
      *        [ FIXME: would it be appropriate to allow implementations to SneakyThrow {@link XPathExpressionException}
      *                 and not introduce a RuntimeExpcetion ? ]
      *
@@ -53,6 +52,6 @@ public interface LazyXPathExpression {
      * @throws NullPointerException if any of the arguments are null
      * @throws IllegalArgumentException if the path does not match the path at which this expression was compiled
      */
-    CheckedFuture<Optional<? extends XPathResult<?>>, XPathExpressionException> evaluateLazily(
-            @Nonnull XPathDocument document, @Nonnull YangInstanceIdentifier path);
+    ListenableFuture<Optional<? extends XPathResult<?>>> evaluateLazily(@Nonnull XPathDocument document,
+            @Nonnull YangInstanceIdentifier path);
 }