* @param session session to connect to FirebirdUserManager
* @return list with all firebird users
*/
@SuppressWarnings("unchecked")
public static List<FBUser> getFirebirdUserList(ISession session) {
FBUserManager fbUserManager = new FBUserManager();
fbUserManager.setHost(FirebirdManagerHelper.getHost(session.getAlias().getUrl()));
fbUserManager.setPort(FirebirdManagerHelper.getPort(session.getAlias().getUrl()));
fbUserManager.setUser(session.getAlias().getUserName());
fbUserManager.setPassword(session.getAlias().getPassword());
ArrayList<FBUser> listFBUser = new ArrayList<FBUser>();
try {
IscSvcHandle iscSvcHandle = fbUserManager.attachServiceManager(fbUserManager.getGds());
Map<String,FBUser> mapUsers = null;
try {
mapUsers = fbUserManager.getUsers();
} catch (Exception e) {
log.error(e.getLocalizedMessage());
}
Collection<FBUser> listUsers = mapUsers.values();
for (Iterator iter = listUsers.iterator(); iter.hasNext();) {
listFBUser.add((FBUser) iter.next());
}
fbUserManager.detachServiceManager(fbUserManager.getGds(), iscSvcHandle);
iscSvcHandle = null;
} catch (GDSException e) {
log.error(e.getLocalizedMessage());
}