Package org.apache.turbine.om.security

Examples of org.apache.turbine.om.security.User


            throws TurbineException
    {
        Object obj = null;

        // Authenticate the user and get the object.
        User user = null;
        user = TurbineSecurity.getAuthenticatedUser(username, password);

        if (user != null)
        {
            if (method.equals("send"))
View Full Code Here


            // Pre-allocate a list which won't need expansion more
            // than once.
            users = new ArrayList((int) (activeSessions.size() * 0.7));
            for (Iterator i = activeSessions.values().iterator(); i.hasNext();)
            {
                User u = getUserFromSession((HttpSession) i.next());
                if (u != null && u.hasLoggedIn())
                {
                    users.add(u);
                }
            }
        }
View Full Code Here

        synchronized (activeSessions)
        {
            for (Iterator i = activeSessions.values().iterator(); i.hasNext();)
            {
                HttpSession session = (HttpSession) i.next();
                User u = this.getUserFromSession(session);
                if (user.equals(u))
                {
                    sessions.add(session);
                }
            }
View Full Code Here

     */
    public User retrieve(String userName, String password)
            throws PasswordMismatchException, UnknownEntityException,
            DataBackendException
    {
        User user = retrieve(userName);
        authenticate(user, password);
        return user;
    }
View Full Code Here

        // Get the PoolService to fetch object instances from
        PoolService pool = (PoolService)
            TurbineServices.getInstance().getService(PoolService.SERVICE_NAME);

        // Get the current user
        User user = data.getUser();
       
        // Iterate the tools
        Iterator it = tools.iterator();
        while (it.hasNext())
        {
            ToolData toolData = (ToolData)it.next();
            try
            {
                // ensure that tool is created only once for a user
                // by synchronizing against the user object
                synchronized (user)
                {
                    // first try and fetch the tool from the user's
                    // hashtable
                    Object tool = usePerm
                        ? user.getPerm(toolData.toolClassName)
                        : user.getTemp(toolData.toolClassName);
                   
                    if (tool == null)
                    {
                        // if not there, an instance must be fetched from
                        // the pool
                        tool = pool.getInstance(toolData.toolClass);
                        if (tool instanceof ApplicationTool)
                        {
                            // session tools are init'd with the User object
                            ((ApplicationTool)tool).init(user);
                        }
                        // store the newly created tool in the user's hashtable
                        if (usePerm)
                        {
                            user.setPerm(toolData.toolClassName, tool);
                        }
                        else
                        {
                            user.setTemp(toolData.toolClassName, tool);
                        }
                    }
                    else if (refreshToolsPerRequest
                            && tool instanceof ApplicationTool)
                    {
View Full Code Here

     * @throws UnknownEntityException if the object could not be instantiated.
     */
    public User getUserInstance()
        throws UnknownEntityException
    {
        User user;
        try
        {
            user = (User)getUserClass().newInstance();
        }
        catch(Exception e)
View Full Code Here

     *         could not be determined, or does not exist.
     */
    public User getAnonymousUser()
        throws UnknownEntityException
    {
        User user = getUserInstance();
        user.setUserName("");
        return user;
    }
View Full Code Here

     * as Users need to go through TurbineSecurity
     */
    public static User row2Object (Record row, int offset, Class cls)
        throws Exception
    {
        User obj = TurbineSecurity.getUserInstance();
        populateObject(row, offset, obj);
        ((Persistent)obj).setNew(false);
        ((Persistent)obj).setModified(false);
        return obj;
    }
View Full Code Here

     */
    public User retrieve( String username, String password )
         throws PasswordMismatchException, UnknownEntityException,
                DataBackendException
    {
        User user = retrieve(username);
        authenticate(user, password);
        return user;
    }
View Full Code Here

     * @throws UnknownEntityException if the object could not be instantiated.
     */
    public User getUserInstance()
            throws UnknownEntityException
    {
        User user;
        try
        {
            user = (User) getUserClass().newInstance();
        }
        catch (Exception e)
View Full Code Here

TOP

Related Classes of org.apache.turbine.om.security.User

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.