⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jahiausermanagerroutingservice.java

📁 java 写的一个新闻发布系统
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
        Object result = null;        try {            result = routeCall("getUniqueKey",                               null,                               null,                               ROUTE_CALL_ALL_UNTIL_SUCCESS,                               null,                               false,                               null,                               null);        } catch (Throwable t) {            t.printStackTrace();            return null;        }        return (String) result;    }    public Vector getUserList() {        Vector userList = new Vector();        Object result = null;        try {            result = routeCall("getUserList",                               null,                               null,                               ROUTE_CALL_ALL,                               null,                               false,                               null,                               null);        } catch (Throwable t) {            t.printStackTrace();            return userList;        }        Vector resultVector = (Vector) result;        Enumeration resultEnum = resultVector.elements();        while (resultEnum.hasMoreElements()) {            Vector curResult = (Vector) resultEnum.nextElement();            userList.addAll(curResult);        }        return userList;    }    public Vector getUserList(int siteID) {        Vector userList = new Vector();        Class[] parameterTypes = new Class[1];        parameterTypes[0] = Integer.TYPE;        Object[] args = new Object[1];        args[0] = new Integer(siteID);        Object result = null;        try {            result = routeCall("getUserList",                               parameterTypes,                               null,                               ROUTE_CALL_ALL,                               null,                               false,                               null,                               args);        } catch (Throwable t) {            t.printStackTrace();            return userList;        }        Vector resultVector = (Vector) result;        Enumeration resultEnum = resultVector.elements();        while (resultEnum.hasMoreElements()) {            Vector curResult = (Vector) resultEnum.nextElement();            if (curResult != null) {                userList.addAll(curResult);            }        }        return userList;    }    public Vector getUsernameList(int siteID) {        Vector userNameList = new Vector();        Class[] parameterTypes = new Class[1];        parameterTypes[0] = Integer.TYPE;        Object[] args = new Object[1];        args[0] = new Integer(siteID);        Object result = null;        try {            result = routeCall("getUsernameList",                               parameterTypes,                               null,                               ROUTE_CALL_ALL,                               null,                               false,                               null,                               args);        } catch (Throwable t) {            t.printStackTrace();            return userNameList;        }        Vector resultVector = (Vector) result;        Enumeration resultEnum = resultVector.elements();        while (resultEnum.hasMoreElements()) {            Vector curResult = (Vector) resultEnum.nextElement();            userNameList.addAll(curResult);        }        return userNameList;    }    public JahiaDOMObject getUsersAsDOM(String providerName, int siteID)    throws org.jahia.exceptions.JahiaException {        Class[] parameterTypes = new Class[1];        parameterTypes[0] = Integer.TYPE;        Object[] args = new Object[1];        args[0] = new Integer(siteID);        Object result = null;        Vector providerList = new Vector();        providerList.add(providerName);        try {            result = routeCall("getUsersAsDOM",                               parameterTypes,                               null,                               ROUTE_CALL_ONE,                               providerList,                               false,                               null,                               args);        } catch (Throwable t) {            t.printStackTrace();            return null;        }        return (JahiaDOMObject) result;    }    public JahiaDOMObject getUserPropsAsDOM(String providerName, int siteID)    throws org.jahia.exceptions.JahiaException {        Class[] parameterTypes = new Class[1];        parameterTypes[0] = Integer.TYPE;        Object[] args = new Object[1];        args[0] = new Integer(siteID);        Object result = null;        Vector providerList = new Vector();        providerList.add(providerName);        try {            result = routeCall("getUsersPropsAsDOM",                               parameterTypes,                               null,                               ROUTE_CALL_ONE,                               providerList,                               false,                               null,                               args);        } catch (Throwable t) {            t.printStackTrace();            return null;        }        return (JahiaDOMObject) result;    }    /**     * Performs a login of the specified user.     *     * @param userKey the user identifier defined in this service properties     * @param userPassword the password of the user     *     * @return boolean true if the login succeeded, false otherwise     */    public boolean login(String userKey, String userPassword) {        Class[] parameterTypes = new Class[2];        parameterTypes[0] = stringClass;        parameterTypes[1] = stringClass;        Object[] args = new Object[2];        args[0] = userKey;        args[1] = userPassword;        Properties userProperties = new Properties();        userProperties.setProperty("user.key", userKey);        userProperties.setProperty("user.password", userPassword);        Object result = null;        try {            result = routeCall("login",                               parameterTypes,                               userProperties,                               ROUTE_CALL_ONE,                               null,                               false,                               null,                               args);        } catch (Throwable t) {            t.printStackTrace();            return false;        }        Boolean resultBool = (Boolean) result;        return resultBool.booleanValue();    }    public JahiaUser lookupUser(String userKey) {        Class[] parameterTypes = new Class[1];        parameterTypes[0] = stringClass;        Object[] args = new Object[1];        args[0] = userKey;        Properties userProperties = new Properties();        userProperties.setProperty("user.key", userKey);        Object result = null;        try {            result = routeCall("lookupUser",                               parameterTypes,                               userProperties,                               ROUTE_CALL_ALL_UNTIL_SUCCESS,                               null,                               false,                               null,                               args);        } catch (Throwable t) {            t.printStackTrace();            return null;        }        return (JahiaUser) result;    }    public JahiaUser lookupUser(int siteID, String name) {        Class[] parameterTypes = new Class[2];        parameterTypes[0] = Integer.TYPE;        parameterTypes[1] = stringClass;        Object[] args = new Object[2];        args[0] = new Integer(siteID);        args[1] = name;        Properties userProperties = new Properties();        userProperties.setProperty("user.name", name);        Object result = null;        try {            result = routeCall("lookupUser",                               parameterTypes,                               userProperties,                               ROUTE_CALL_ALL_UNTIL_SUCCESS,                               null,                               false,                               null,                               args);        } catch (Throwable t) {            t.printStackTrace();            return null;        }        return (JahiaUser) result;    }    public boolean userExists(int siteID, String name) {        Class[] parameterTypes = new Class[2];        parameterTypes[0] = Integer.TYPE;        parameterTypes[1] = stringClass;        Object[] args = new Object[2];        args[0] = new Integer(siteID);        args[1] = name;        Properties userProperties = new Properties();        userProperties.setProperty("user.name", name);        Object result = null;        try {            result = routeCall("userExists",                               parameterTypes,                               userProperties,                               ROUTE_CALL_ALL_UNTIL_SUCCESS,                               null,                               false,                               null,                               args);        } catch (Throwable t) {            t.printStackTrace();            return false;        }        Boolean resultBool = (Boolean) result;        return resultBool.booleanValue();    }    /**     * Find users according to a table of name=value properties. If the left     * side value is "*" for a property then it will be tested against all the     * properties. ie *=test* will match every property that starts with "test"     *     * @param siteID site identifier     * @param searchCriterias a Properties object that contains search criterias     * in the format name,value (for example "*"="*" or "username"="*test*")     *     * @return Set a set of JahiaUser elements that correspond to those     * search criterias     */    public Set searchUsers(int siteID, Properties searchCriterias) {        Set userList = new HashSet();        Class[] parameterTypes = new Class[2];        parameterTypes[0] = Integer.TYPE;        parameterTypes[1] = propertiesClass;        Object[] args = new Object[2];        args[0] = new Integer(siteID);        args[1] = searchCriterias;        Object result = null;        try {            result = routeCall("searchUsers",                               parameterTypes,                               null,                               ROUTE_CALL_ALL,                               null,                               false,                               null,                               args);        } catch (Throwable t) {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -