Package org.apache.wiki.auth

Examples of org.apache.wiki.auth.WikiSecurityException


                conn.commit();
            }
        }
        catch( SQLException e )
        {
            throw new WikiSecurityException( e.getMessage(), e );
        }
        finally
        {
            try
            {
View Full Code Here


            }
            ps.close();
        }
        catch( SQLException e )
        {
            throw new WikiSecurityException( e.getMessage(), e );
        }
        finally
        {
            try
            {
View Full Code Here

            ps.close();
        }
        catch( SQLException e )
        {
            log.error( "DB connectivity error: " + e.getMessage() );
            throw new WikiSecurityException("DB connectivity error: " + e.getMessage(), e );
        }
        finally
        {
            try
            {
View Full Code Here

                conn.commit();
            }
        }
        catch( SQLException e )
        {
            throw new WikiSecurityException( e.getMessage(), e );
        }
        finally
        {
            try
            {
View Full Code Here

                {
                    ps.setString( 8, Serializer.serializeToBase64( profile.getAttributes() ) );
                }
                catch ( IOException e )
                {
                    throw new WikiSecurityException( "Could not save user profile attribute. Reason: " + e.getMessage(), e );
                }
                ps.setTimestamp( 9, ts );
                ps.execute();
                ps.close();

                // Insert new role record
                ps = conn.prepareStatement( m_findRoles );
                ps.setString( 1, profile.getLoginName() );
                ResultSet rs = ps.executeQuery();
                int roles = 0;
                while ( rs.next() )
                {
                    roles++;
                }
                ps.close();
                if( roles == 0 )
                {
                    ps = conn.prepareStatement( m_insertRole );
                    ps.setString( 1, profile.getLoginName() );
                    ps.setString( 2, initialRole );
                    ps.execute();
                    ps.close();
                }

                // Set the profile creation time
                profile.setCreated( modDate );
            }
            else
            {
                // User exists: modify existing record
                ps = conn.prepareStatement( m_updateProfile );
                ps.setString( 1, profile.getUid() );
                ps.setString( 2, profile.getEmail() );
                ps.setString( 3, profile.getFullname() );
                ps.setString( 4, password );
                ps.setString( 5, profile.getWikiName() );
                ps.setTimestamp( 6, ts );
                ps.setString( 7, profile.getLoginName() );
                try
                {
                    ps.setString( 8, Serializer.serializeToBase64( profile.getAttributes() ) );
                }
                catch ( IOException e )
                {
                    throw new WikiSecurityException( "Could not save user profile attribute. Reason: " + e.getMessage(), e );
                }
                ps.setDate( 9, lockExpiry );
                ps.setString( 10, profile.getLoginName() );
                ps.execute();
                ps.close();
            }
            // Set the profile mod time
            profile.setLastModified( modDate );

            // Commit and close connection
            if( m_supportsCommits )
            {
                conn.commit();
            }
        }
        catch( SQLException e )
        {
            throw new WikiSecurityException( e.getMessage(), e );
        }
        finally
        {
            try
            {
View Full Code Here

            }
        }
        catch( SQLException e )
        {
          closeQuietly( conn, ps, null );
            throw new WikiSecurityException( "Could not delete group " + groupName + ": " + e.getMessage(), e );
        }
        finally
        {
            closeQuietly( conn, ps, null );
        }
View Full Code Here

            }
        }
        catch( SQLException e )
        {
          closeQuietly( conn, ps, rs );
            throw new WikiSecurityException( e.getMessage(), e );
        }
        finally
        {
            closeQuietly( conn, ps, rs );
        }
View Full Code Here

            }
        }
        catch( SQLException e )
        {
          closeQuietly(conn, ps, null );
            throw new WikiSecurityException( e.getMessage(), e );
        }
        finally
        {
            closeQuietly(conn, ps, null );
        }
View Full Code Here

        }
        catch( SQLException e )
        {
          closeQuietly( conn, ps, null );
            log.error( "DB connectivity error: " + e.getMessage() );
            throw new WikiSecurityException("DB connectivity error: " + e.getMessage(), e );
        }
        finally
        {
            closeQuietly( conn, ps, null );
        }
View Full Code Here

            cause = e;
        }

        if( dbInstantiationError != null )
        {
            throw new WikiSecurityException( dbInstantiationError + " Cause: " + (cause != null ? cause.getMessage() : ""), cause );
        }

        return m_groupDatabase;
    }
View Full Code Here

TOP

Related Classes of org.apache.wiki.auth.WikiSecurityException

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.