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 2004/04/30 06:18:35 UTC
svn commit: rev 10442 - incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile
Author: akarasulu
Date: Thu Apr 29 21:18:34 2004
New Revision: 10442
Added:
incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileRoleLinkDAO.java (contents, props changed)
Log:
completed new profile role link data access object interface
Added: incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileRoleLinkDAO.java
==============================================================================
--- (empty file)
+++ incubator/directory/rms/trunk/je/src/java/org/apache/rms/je/profile/ProfileRoleLinkDAO.java Thu Apr 29 21:18:34 2004
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed 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.rms.je.profile ;
+
+
+import org.apache.rms.RmsException ;
+
+import java.util.Iterator ;
+
+
+/**
+ * Data access object interface for the profile to role link database.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface ProfileRoleLinkDAO
+{
+ /**
+ * Creates a link associating a user's application profile with a role.
+ *
+ * @param appName the name of the profile's application
+ * @param userName the name of the profile's user
+ * @param roleName the name of the profile's role
+ * @throws RmsException if there is a failure to access the
+ * underlying database, or the link to create already exists
+ */
+ void create( String appName, String userName, String roleName )
+ throws RmsException ;
+
+ /**
+ * Deletes a link associating a user's application profile with a role.
+ *
+ * @param appName the name of the profile's application
+ * @param userName the name of the profile's user
+ * @param roleName the name of the profile's role
+ * @throws RmsException if there is a failure to access the
+ * underlying database, or the link does not exist to delete
+ */
+ void delete( String appName, String userName, String roleName )
+ throws RmsException ;
+
+ /**
+ * Quick check to see if a user's application profile is associated with
+ * a specific role.
+ *
+ * @param appName the name of the profile's application
+ * @param userName the name of the profile's user
+ * @param roleName the name of the profile's role
+ * @return true if the profile contains the role, false otherwise
+ * @throws RmsException if there is a failure to access the
+ * underlying database
+ */
+ boolean has( String appName, String userName, String roleName )
+ throws RmsException ;
+
+ /**
+ * Quick check to see if an application role is in use.
+ *
+ * @param appName the name of the profile's application
+ * @param roleName the name of the profile's role
+ * @return true if the application role is in use, false otherwise
+ * @throws RmsException if there is a failure to access the
+ * underlying database
+ */
+ boolean has( String appName, String roleName ) throws RmsException ;
+
+ /**
+ * Gets an Iterator over the names of roles a user's application profile
+ * is associated with. This comes in handy when building the roles of a
+ * profile.
+ *
+ * @param appName the name of the profile's application
+ * @param userName the name of the profile's user
+ * @return an Iterator over the Strings of role names for a user profile
+ * @throws RmsException if there is a failure to access the
+ * underlying database
+ */
+ Iterator listRoleNames( String appName, String userName )
+ throws RmsException ;
+
+ /**
+ * Gets an Iterator over the set of user names who are in an application
+ * role. This method comes in handy when listing the user profiles
+ * holding a reference to an application's role.
+ *
+ * @param appName the name of the profile's application
+ * @param roleName the name of the profile's role
+ * @return an Iterator over the user names within this role
+ * @throws RmsException if there is a failure to access the
+ * underlying database
+ */
+ Iterator listUserNames( String appName, String roleName )
+ throws RmsException ;
+
+ /**
+ * Closes an Iterator which also exhausting the Iterator: subsequent calls
+ * to hasNext() returns false and calls to next() throw NoSuchElement
+ * exception.
+ *
+ * @param list an Iterator created by this DAO
+ */
+ void close( Iterator list ) ;
+}