Package org.apache.wiki.auth

Examples of org.apache.wiki.auth.NoSuchPrincipalException


        UserProfile profile = findByAttribute( UID, uid );
        if ( profile != null )
        {
            return profile;
        }
        throw new NoSuchPrincipalException( "Not in database: " + uid );
    }
View Full Code Here


        UserProfile profile = findByAttribute( WIKI_NAME, index );
        if ( profile != null )
        {
            return profile;
        }
        throw new NoSuchPrincipalException( "Not in database: " + index );
    }
View Full Code Here

            }
            ps.close();
        }
        catch( SQLException e )
        {
            throw new NoSuchPrincipalException( e.getMessage() );
        }
        finally
        {
            try
            {
                if( conn != null ) conn.close();
            }
            catch( Exception e )
            {
            }
        }

        if( !found )
        {
            throw new NoSuchPrincipalException( "Could not find profile in database!" );
        }
        if( !unique )
        {
            throw new NoSuchPrincipalException( "More than one profile in database!" );
        }
        return profile;

    }
View Full Code Here

     */
    public void delete( Group group ) throws WikiSecurityException
    {
        if( !exists( group ) )
        {
            throw new NoSuchPrincipalException( "Not in database: " + group.getName() );
        }

        String groupName = group.getName();
        Connection conn = null;
        PreparedStatement ps = null;
View Full Code Here

            }
        }
        catch( SQLException e )
        {
          closeQuietly( conn, ps, rs );
            throw new NoSuchPrincipalException( e.getMessage() );
        }
        finally
        {
            closeQuietly( conn, ps, rs );
        }

        if( !found )
        {
            throw new NoSuchPrincipalException( "Could not find group in database!" );
        }
        if( !unique )
        {
            throw new NoSuchPrincipalException( "More than one group in database!" );
        }
        return group;
    }
View Full Code Here

        String index = group.getName();
        boolean exists = m_groups.containsKey( index );

        if ( !exists )
        {
            throw new NoSuchPrincipalException( "Not in database: " + group.getName() );
        }

        m_groups.remove( index );

        // Commit to disk
View Full Code Here

        Group group = m_groups.get( new GroupPrincipal( name ) );
        if ( group != null )
        {
            return group;
        }
        throw new NoSuchPrincipalException( "Group " + name + " not found." );
    }
View Full Code Here

        catch( NoSuchPrincipalException e )
        {
            // It's a new group.... throw error if we don't create new ones
            if ( !create )
            {
                throw new NoSuchPrincipalException( "Group '" + name + "' does not exist." );
            }
        }

        // If passed members not empty, overwrite
        String[] members = extractMembers( memberLine );
View Full Code Here

        }

        Group group = m_groups.get( new GroupPrincipal( index ) );
        if ( group == null )
        {
            throw new NoSuchPrincipalException( "Group " + index + " not found" );
        }

        // Delete the group
        // TODO: need rollback procedure
        synchronized( m_groups )
View Full Code Here

          if ( group.getName().equals( name ) )
          {
              return group;
          }
      }
      throw new NoSuchPrincipalException( "No group named " + name );
  }
View Full Code Here

TOP

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

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.