You can create a wrapper for the usermanager, as long as you implement all
of the bits. There is an example on www.orionsupport.com, but it uses an
internal class for the wrapper.

I would suggest not planning on using the console. Its extremely unreliable.
We implemented a ssl/web-based interface for managing our users, since the
ejbusermanager is just like anyother 'ol cmp ejb.

The code below has some debug stuff. You would have to use your own assert
code. This is an example of ejbusermanager with a user wrapper.

Regards,

the elephantwalker

public class MyEJBUserManager extends EJBUserManager {


    public MyEJBUserManager(){}

    public User getUser(String n){

           User u = super.getUser(n);

           User mu = new MyWrapperUser(u);

      return mu;

}


}

and the wrapper class:

public class MyWrapperUser extends Object implements User{
    private User ejbuser;
    /** Creates new MyWrapperUser */
    public MyWrapperUser(User u) {

        ejbuser = u;

    }

                public String getName() {

                       String n = ejbuser.getName();

                       Debug.println("getName() = "+n);
                        return n;
                }

                public boolean authenticate( String password ) {

                       boolean auth = ejbuser.authenticate(password);
                       String n = ejbuser.getName();
                       Debug.println("authenticate(), username = "+n+",
password = "+password+", authorization = "+auth);

                       return auth;
                }

                public boolean isMemberOf( Group group ) {
                       boolean auth = ejbuser.isMemberOf(group);
                       String n = ejbuser.getName();
                       String g = group.getName();
                       Set groups = ejbuser.getGroups();
                       Debug.println("isMemberOf(), username = "+n+", group
= " + g +", isMemberOf = "+auth);
                       for(Iterator i = groups.iterator();i.hasNext();){
                        Group gg = (Group)i.next();
                        Debug.println("groups name = "+gg.getName());
                    }
                      return auth;

                }
                public java.util.Set getGroups() { return ejbuser.getGroups(); }
                public java.lang.String getDescription() { return null; }
                public void setDescription(java.lang.String description) {}
                public java.util.Locale getLocale() { return null; }
                public boolean hasPermission(java.security.Permission permission) { 
return
false; }
                public void setPassword(java.lang.String password) {}
                public java.lang.String getPassword() { return null; }
                public java.math.BigInteger getCertificateSerial() { return null; }
                public java.lang.String getCertificateIssuerDN() { return null; }
                public void setCertificate(java.lang.String issuerDN, 
java.math.BigInteger
serial) throws java.lang.UnsupportedOperationException {}
                public void setCertificate(java.security.cert.X509Certificate cert) {}
                public void addToGroup(com.evermind.security.Group group) throws
java.lang.UnsupportedOperationException {}
                public void removeFromGroup(com.evermind.security.Group group) throws
java.lang.UnsupportedOperationException {}

}



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Roozbeh
Ghaffari
Sent: Monday, June 25, 2001 1:54 AM
To: Orion-Interest
Subject: Using EJBUserManager or DataSourceUserManager


Hi!

We're going to deploy a big site (with thousands of users) on Orion. In
order to have such a big number of users, we have to use some security
managers other than the default. I tried both EJBUserManager and
DataSourceUserManager but it seems that neither of them support
getUserCount() and thus the Orion console does not work with them. I decided
to write a subclass of DataSourceUserManager and develop not-supported
routines, but all internal parts of the class are private (not protected)
and I don't have access to the data-source specified in the deployment
descriptors.
First, did I do anything wrong?
Second, what's your idea?

Thanks,
Roozbeh/


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



Reply via email to