You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2018/09/06 14:59:12 UTC
[accumulo] branch master updated: Restore deprecated instance
methods removed in 0ba6c49 (#635)
This is an automated email from the ASF dual-hosted git repository.
ctubbsii pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/master by this push:
new cb1a03e Restore deprecated instance methods removed in 0ba6c49 (#635)
cb1a03e is described below
commit cb1a03e54e2b9de26f8cde2c943f181bab1555bb
Author: Keith Turner <ke...@deenlo.com>
AuthorDate: Thu Sep 6 10:59:10 2018 -0400
Restore deprecated instance methods removed in 0ba6c49 (#635)
Restoring these for following reasons :
* Any project that implemented Instance still had to implement deprecated
methods.
* Multiple projects currently have code that call these methods.
* All of Instance is now deprecated.
* Use of Java 8 default methods makes restoration trivial with single line
implementations that have negligible maintenance burden.
---
.../org/apache/accumulo/core/client/Instance.java | 64 ++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/core/src/main/java/org/apache/accumulo/core/client/Instance.java b/core/src/main/java/org/apache/accumulo/core/client/Instance.java
index f05243c..80155e4 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/Instance.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/Instance.java
@@ -16,6 +16,7 @@
*/
package org.apache.accumulo.core.client;
+import java.nio.ByteBuffer;
import java.util.List;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
@@ -72,6 +73,69 @@ public interface Instance {
int getZooKeepersSessionTimeOut();
/**
+ * Returns a connection to accumulo.
+ *
+ * @param user
+ * a valid accumulo user
+ * @param pass
+ * A UTF-8 encoded password. The password may be cleared after making this call.
+ * @return the accumulo Connector
+ * @throws AccumuloException
+ * when a generic exception occurs
+ * @throws AccumuloSecurityException
+ * when a user's credentials are invalid
+ * @deprecated since 1.5, use {@link #getConnector(String, AuthenticationToken)} with
+ * {@link PasswordToken}
+ */
+ @Deprecated
+ default Connector getConnector(String user, byte[] pass)
+ throws AccumuloException, AccumuloSecurityException {
+ return getConnector(user, new PasswordToken(pass));
+ }
+
+ /**
+ * Returns a connection to accumulo.
+ *
+ * @param user
+ * a valid accumulo user
+ * @param pass
+ * A UTF-8 encoded password. The password may be cleared after making this call.
+ * @return the accumulo Connector
+ * @throws AccumuloException
+ * when a generic exception occurs
+ * @throws AccumuloSecurityException
+ * when a user's credentials are invalid
+ * @deprecated since 1.5, use {@link #getConnector(String, AuthenticationToken)} with
+ * {@link PasswordToken}
+ */
+ @Deprecated
+ default Connector getConnector(String user, ByteBuffer pass)
+ throws AccumuloException, AccumuloSecurityException {
+ return getConnector(user, new PasswordToken(pass));
+ }
+
+ /**
+ * Returns a connection to this instance of accumulo.
+ *
+ * @param user
+ * a valid accumulo user
+ * @param pass
+ * If a mutable CharSequence is passed in, it may be cleared after this call.
+ * @return the accumulo Connector
+ * @throws AccumuloException
+ * when a generic exception occurs
+ * @throws AccumuloSecurityException
+ * when a user's credentials are invalid
+ * @deprecated since 1.5, use {@link #getConnector(String, AuthenticationToken)} with
+ * {@link PasswordToken}
+ */
+ @Deprecated
+ default Connector getConnector(String user, CharSequence pass)
+ throws AccumuloException, AccumuloSecurityException {
+ return getConnector(user, new PasswordToken(pass));
+ }
+
+ /**
* Returns a connection to this instance of accumulo.
*
* @param principal