You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by dr...@apache.org on 2015/09/26 00:41:32 UTC

directory-kerby git commit: XTrans changed to be BatchTrans to better reflect its purpose

Repository: directory-kerby
Updated Branches:
  refs/heads/master 705775a15 -> f49e9f79e


XTrans changed to be BatchTrans to better reflect its purpose


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/f49e9f79
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/f49e9f79
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/f49e9f79

Branch: refs/heads/master
Commit: f49e9f79e14223567d5b8938b326f3eea7d6edf2
Parents: 705775a
Author: Kai Zheng <ka...@intel.com>
Authored: Sat Sep 26 06:40:50 2015 +0800
Committer: Kai Zheng <ka...@intel.com>
Committed: Sat Sep 26 06:40:50 2015 +0800

----------------------------------------------------------------------
 .../kerberos/kerb/identity/BatchTrans.java      | 65 ++++++++++++++++++++
 .../kerb/identity/CacheableIdentityService.java |  4 +-
 .../kerberos/kerb/identity/IdentityService.java |  4 +-
 .../kerby/kerberos/kerb/identity/XTrans.java    | 65 --------------------
 .../backend/AbstractIdentityBackend.java        |  6 +-
 5 files changed, 72 insertions(+), 72 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/f49e9f79/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/BatchTrans.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/BatchTrans.java b/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/BatchTrans.java
new file mode 100644
index 0000000..b85cc2e
--- /dev/null
+++ b/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/BatchTrans.java
@@ -0,0 +1,65 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.kerby.kerberos.kerb.identity;
+
+import org.apache.kerby.kerberos.kerb.KrbException;
+
+/**
+ * Batch operations support to create/update/delete principal accounts
+ * in a transaction.
+ */
+public interface BatchTrans {
+
+    /**
+     * Commit this transaction, releasing any associated resources.
+     * @throws KrbException
+     */
+    void commit() throws KrbException;
+
+    /**
+     * Give up this transaction, releasing any associated resources.
+     * @throws KrbException
+     */
+    void rollback() throws KrbException;
+
+    /**
+     * Add an identity, and return the newly created result.
+     * @param identity The identity
+     * @return BatchTrans
+     * @throws KrbException e
+     */
+    BatchTrans addIdentity(KrbIdentity identity) throws KrbException;
+
+    /**
+     * Update an identity, and return the updated result.
+     * @param identity The identity
+     * @return BatchTrans
+     * @throws KrbException e
+     */
+    BatchTrans updateIdentity(KrbIdentity identity) throws KrbException;
+
+    /**
+     * Delete the identity specified by principal name
+     * @param principalName The principal name
+     * @return BatchTrans
+     * @throws KrbException e
+     */
+    BatchTrans deleteIdentity(String principalName) throws KrbException;
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/f49e9f79/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/CacheableIdentityService.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/CacheableIdentityService.java b/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/CacheableIdentityService.java
index ac00ebf..0e8fe4b 100644
--- a/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/CacheableIdentityService.java
+++ b/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/CacheableIdentityService.java
@@ -54,7 +54,7 @@ public class CacheableIdentityService
      * {@inheritDoc}
      */
     @Override
-    public boolean supportXtrans() {
+    public boolean supportBatchTrans() {
         return false;
     }
 
@@ -62,7 +62,7 @@ public class CacheableIdentityService
      * {@inheritDoc}
      */
     @Override
-    public XTrans startXtrans() throws KrbException {
+    public BatchTrans startBatchTrans() throws KrbException {
         throw new KrbException("Transaction isn't supported");
     }
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/f49e9f79/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/IdentityService.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/IdentityService.java b/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/IdentityService.java
index ee6b3f6..2f0ca2e 100644
--- a/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/IdentityService.java
+++ b/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/IdentityService.java
@@ -30,13 +30,13 @@ public interface IdentityService {
      * Query to know if xtrans is supported or not.
      * @return true if supported, false otherwise
      */
-    boolean supportXtrans();
+    boolean supportBatchTrans();
 
     /**
      * Start a transaction.
      * @return xtrans
      */
-    XTrans startXtrans() throws KrbException;
+    BatchTrans startBatchTrans() throws KrbException;
 
     /**
      * Get all of the identity principal names.

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/f49e9f79/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/XTrans.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/XTrans.java b/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/XTrans.java
deleted file mode 100644
index b5dcb6b..0000000
--- a/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/XTrans.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.kerby.kerberos.kerb.identity;
-
-import org.apache.kerby.kerberos.kerb.KrbException;
-
-/**
- * Batch operations support to create/update/delete principal accounts
- * in a transaction.
- */
-public interface XTrans {
-
-    /**
-     * Commit this transaction, releasing any associated resources.
-     * @throws KrbException
-     */
-    void commit() throws KrbException;
-
-    /**
-     * Give up this transaction, releasing any associated resources.
-     * @throws KrbException
-     */
-    void rollback() throws KrbException;
-
-    /**
-     * Add an identity, and return the newly created result.
-     * @param identity The identity
-     * @return XTrans
-     * @throws KrbException e
-     */
-    XTrans addIdentity(KrbIdentity identity) throws KrbException;
-
-    /**
-     * Update an identity, and return the updated result.
-     * @param identity The identity
-     * @return XTrans
-     * @throws KrbException e
-     */
-    XTrans updateIdentity(KrbIdentity identity) throws KrbException;
-
-    /**
-     * Delete the identity specified by principal name
-     * @param principalName The principal name
-     * @return XTrans
-     * @throws KrbException e
-     */
-    XTrans deleteIdentity(String principalName) throws KrbException;
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/f49e9f79/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/backend/AbstractIdentityBackend.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/backend/AbstractIdentityBackend.java b/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/backend/AbstractIdentityBackend.java
index 991fce0..7c0e6b3 100644
--- a/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/backend/AbstractIdentityBackend.java
+++ b/kerby-kerb/kerb-identity/src/main/java/org/apache/kerby/kerberos/kerb/identity/backend/AbstractIdentityBackend.java
@@ -21,7 +21,7 @@ package org.apache.kerby.kerberos.kerb.identity.backend;
 
 import org.apache.kerby.config.Configured;
 import org.apache.kerby.kerberos.kerb.KrbException;
-import org.apache.kerby.kerberos.kerb.identity.XTrans;
+import org.apache.kerby.kerberos.kerb.identity.BatchTrans;
 import org.apache.kerby.kerberos.kerb.identity.KrbIdentity;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -60,7 +60,7 @@ public abstract class AbstractIdentityBackend
      * {@inheritDoc}
      */
     @Override
-    public boolean supportXtrans() {
+    public boolean supportBatchTrans() {
         return false;
     }
 
@@ -68,7 +68,7 @@ public abstract class AbstractIdentityBackend
      * {@inheritDoc}
      */
     @Override
-    public XTrans startXtrans() throws KrbException {
+    public BatchTrans startBatchTrans() throws KrbException {
         throw new KrbException("Transaction isn't supported");
     }