Package com.adito.core

Examples of com.adito.core.CoreServlet


     * @param lock account lock (if any)
     * @param session session
     * @throws Exception on any error
     */
    public static void setEnabled(User user, boolean enabled, AccountLock lock, SessionInfo session) throws Exception {
        CoreServlet servlet = CoreServlet.getServlet();
        try {
            servlet.fireCoreEvent(new CoreEvent(servlet, CoreEventConstants.ACCOUNT_LOCKED, lock, session));
            Property.setProperty(new UserAttributeKey(user, User.USER_ATTR_ENABLED), enabled, session);
            servlet.fireCoreEvent(new CoreEvent(CoreServlet.getServlet(), enabled ? CoreEventConstants.GRANT_ACCESS
                            : CoreEventConstants.REVOKE_ACCESS, null, session, CoreEvent.STATE_SUCCESSFUL).addAttribute(
                CoreAttributeConstants.EVENT_ATTR_PRINCIPAL_ID, user.getPrincipalName()));
        } catch (Exception e) {
            servlet.fireCoreEvent(new CoreEvent(servlet, enabled ? CoreEventConstants.GRANT_ACCESS
                            : CoreEventConstants.REVOKE_ACCESS, null, session, CoreEvent.STATE_UNSUCCESSFUL).addAttribute(
                CoreAttributeConstants.EVENT_ATTR_PRINCIPAL_ID, user.getPrincipalName()));
            throw e;
        }

View Full Code Here

TOP

Related Classes of com.adito.core.CoreServlet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.