You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2005/05/01 17:51:28 UTC
svn commit: r165520 - in
/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store:
ContextOperation.java PrincipalStoreImpl.java
Author: akarasulu
Date: Sun May 1 08:51:27 2005
New Revision: 165520
URL: http://svn.apache.org/viewcvs?rev=165520&view=rev
Log:
changes ...
o added some doco or tried
o made members private in store impl but added protected accessors
o changed names of args and doco so it is understood that the search base
is a relative name not a distinguished name
o formatted code
Modified:
directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/ContextOperation.java
directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/PrincipalStoreImpl.java
Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/ContextOperation.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/ContextOperation.java?rev=165520&r1=165519&r2=165520&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/ContextOperation.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/ContextOperation.java Sun May 1 08:51:27 2005
@@ -14,17 +14,31 @@
* limitations under the License.
*
*/
-
package org.apache.kerberos.store;
+
import java.io.Serializable;
import javax.naming.Name;
import javax.naming.directory.DirContext;
+/**
+ * Doc me.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
public interface ContextOperation extends Serializable
{
+ /**
+ * Doc me.
+ *
+ * @param ctx
+ * @param searchBaseDn
+ * @return
+ * @throws Exception
+ */
public Object execute( DirContext ctx, Name searchBaseDn ) throws Exception;
}
Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/PrincipalStoreImpl.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/PrincipalStoreImpl.java?rev=165520&r1=165519&r2=165520&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/PrincipalStoreImpl.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/PrincipalStoreImpl.java Sun May 1 08:51:27 2005
@@ -14,32 +14,69 @@
* limitations under the License.
*
*/
-
package org.apache.kerberos.store;
+
import javax.naming.Name;
import javax.naming.ldap.LdapContext;
+/**
+ * A simple implementation of the PrincipalStore interface using a JNDI
+ * based store.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
public class PrincipalStoreImpl implements PrincipalStore
{
/** a handle on the provider context */
- protected LdapContext ctx;
- /** the search base relative to provider URL to use for reading entries */
- protected Name searchBaseDn;
-
+ private LdapContext ctx;
+
+ /** the search searchBase relative to the DN of the context supplied */
+ private Name searchBase;
+
+
/**
- * Creates the action to be used against the embedded ApacheDS DIT.
+ * Creates the action to be used against the embedded ApacheDS DIT. Note
+ * the searchBase is a relative name to the context and not a DN.
+ *
+ * @param ctx the JNDI context to the store
+ * @param searchBase the name relative to the context to use as the search base
*/
- public PrincipalStoreImpl( LdapContext ctx, Name searchBaseDn )
+ public PrincipalStoreImpl( LdapContext ctx, Name searchBase )
{
this.ctx = ctx;
- this.searchBaseDn = searchBaseDn;
+
+ this.searchBase = searchBase;
}
-
+
+
public Object execute( ContextOperation operation ) throws Exception
{
- return operation.execute( ctx, searchBaseDn );
+ return operation.execute( ctx, searchBase );
+ }
+
+
+ /**
+ * Gets the LdapContext used to search for principals in the JNDI store.
+ *
+ * @return the context for the search searchBase
+ */
+ protected LdapContext getContext()
+ {
+ return ctx;
+ }
+
+
+ /**
+ * Gets the search base use for finding principals in the the store.
+ *
+ * @return search base relative to the supplied context
+ */
+ protected Name getSearchBase()
+ {
+ return searchBase;
}
}