diff --git a/src/helma/framework/core/Application.java b/src/helma/framework/core/Application.java index d7c31964..3356377b 100644 --- a/src/helma/framework/core/Application.java +++ b/src/helma/framework/core/Application.java @@ -646,6 +646,28 @@ public class Application extends UnicastRemoteObject implements IRemoteApp, IPat return list; } + + /** + * Return a list of Helma nodes (HopObjects - the database object representing the user, + * not the session object) representing registered users of this application. + */ + public List getRegisteredUsers () { + ArrayList list = new ArrayList (); + INode users = getUserRoot (); + // first try to get them from subnodes (db) + for (Enumeration e=users.getSubnodes(); e.hasMoreElements(); ) { + list.add ((INode)e.nextElement ()); + } + // if none, try to get them from properties (internal db) + if (list.size()==0) { + for (Enumeration e=users.properties(); e.hasMoreElements(); ) { + list.add (users.getNode ((String)e.nextElement (),false)); + } + } + return list; + } + + /** * Return an array of SessionBean objects currently associated with a given * Helma user. diff --git a/src/helma/framework/core/ApplicationBean.java b/src/helma/framework/core/ApplicationBean.java index 99b28fac..bfa93832 100644 --- a/src/helma/framework/core/ApplicationBean.java +++ b/src/helma/framework/core/ApplicationBean.java @@ -93,6 +93,11 @@ public class ApplicationBean implements Serializable { return (INode[]) activeUsers.toArray (new INode[0]); } + public INode[] getRegisteredUsers () { + List registeredUsers = app.getRegisteredUsers (); + return (INode[]) registeredUsers.toArray (new INode[0]); + } + public SessionBean[] getSessionsForUser (INode usernode) { if (usernode==null) return new SessionBean[0];