Package org.apache.maven.archiva.common

Examples of org.apache.maven.archiva.common.ArchivaException


    private void executeEnvironmentChecks()
        throws ArchivaException
    {
        if ( ( checkers == null ) || CollectionUtils.isEmpty( checkers.values() ) )
        {
            throw new ArchivaException( "Unable to initialize the Redback Security Environment, "
                + "no Environment Check components found." );
        }

        List<String> violations = new ArrayList<String>();

        for ( Entry<String, EnvironmentCheck> entry : checkers.entrySet() )
        {
            EnvironmentCheck check = entry.getValue();
            getLogger().info( "Running Environment Check: " + entry.getKey() );
            check.validateEnvironment( violations );
        }

        if ( CollectionUtils.isNotEmpty( violations ) )
        {
            StringBuffer msg = new StringBuffer();
            msg.append( "EnvironmentCheck Failure.\n" );
            msg.append( "======================================================================\n" );
            msg.append( " ENVIRONMENT FAILURE !! \n" );
            msg.append( "\n" );

            for ( String violation : violations )
            {
                msg.append( violation ).append( "\n" );
            }

            msg.append( "\n" );
            msg.append( "======================================================================" );
            getLogger().fatalError( msg.toString() );

            throw new ArchivaException( "Unable to initialize Redback Security Environment, [" + violations.size()
                + "] violation(s) encountered, See log for details." );
        }
    }
View Full Code Here


        if ( StringUtils.isBlank( groupId ) )
        {
            String emsg = "Error generating dependency tree [" + Keys.toKey( groupId, artifactId, modelVersion )
                + "]: groupId is blank.";
            getLogger().error( emsg );
            throw new ArchivaException( emsg );
        }

        if ( StringUtils.isBlank( artifactId ) )
        {
            String emsg = "Error generating dependency tree [" + Keys.toKey( groupId, artifactId, modelVersion )
                + "]: artifactId is blank.";
            getLogger().error( emsg );
            throw new ArchivaException( emsg );
        }

        if ( StringUtils.isBlank( modelVersion ) )
        {
            String emsg = "Error generating dependency tree [" + Keys.toKey( groupId, artifactId, modelVersion )
                + "]: version is blank.";
            getLogger().error( emsg );
            throw new ArchivaException( emsg );
        }

        DependencyGraph graph = fetchGraph( groupId, artifactId, modelVersion );

        if ( graph == null )
        {
            throw new ArchivaException( "Graph is unexpectedly null." );
        }

        TreeListVisitor treeListVisitor = new TreeListVisitor();
        DependencyGraphWalker walker = new WalkDepthFirstSearch();
        walker.visit( graph, treeListVisitor );
View Full Code Here

        }
        catch ( GraphTaskException e )
        {
            String emsg = "Unable to generate graph for [" + Keys.toKey( projectRef ) + "] : " + e.getMessage();
            getLogger().warn( emsg, e );
            throw new ArchivaException( emsg, e );
        }
    }
View Full Code Here

    private void executeEnvironmentChecks()
        throws ArchivaException
    {
        if ( ( checkers == null ) || CollectionUtils.isEmpty( checkers.values() ) )
        {
            throw new ArchivaException( "Unable to initialize the Redback Security Environment, "
                + "no Environment Check components found." );
        }

        List<String> violations = new ArrayList<String>();

        for ( Entry<String, EnvironmentCheck> entry : checkers.entrySet() )
        {
            EnvironmentCheck check = entry.getValue();
            getLogger().info( "Running Environment Check: " + entry.getKey() );
            check.validateEnvironment( violations );
        }

        if ( CollectionUtils.isNotEmpty( violations ) )
        {
            StringBuffer msg = new StringBuffer();
            msg.append( "EnvironmentCheck Failure.\n" );
            msg.append( "======================================================================\n" );
            msg.append( " ENVIRONMENT FAILURE !! \n" );
            msg.append( "\n" );

            for ( String violation : violations )
            {
                msg.append( violation ).append( "\n" );
            }

            msg.append( "\n" );
            msg.append( "======================================================================" );
            getLogger().fatalError( msg.toString() );

            throw new ArchivaException( "Unable to initialize Redback Security Environment, [" + violations.size()
                + "] violation(s) encountered, See log for details." );
        }
    }
View Full Code Here

        {
            start();
        }
        catch ( StartingException e )
        {
            throw new ArchivaException( e.getMessage(), e );
        }
    }
View Full Code Here

        {
            queue = repositoryScanningQueue.getQueueSnapshot();
        }
        catch ( TaskQueueException e )
        {
            throw new ArchivaException( "Unable to get repository scanning queue:" + e.getMessage(), e );
        }

        return !queue.isEmpty();
    }
View Full Code Here

        {
            queue = repositoryScanningQueue.getQueueSnapshot();
        }
        catch ( TaskQueueException e )
        {
            throw new ArchivaException( "Unable to get repository scanning queue:" + e.getMessage(), e );
        }

        return CollectionUtils.exists( queue, new RepositoryTaskSelectionPredicate( repositoryId ) );
    }
View Full Code Here

        {
            queue = databaseUpdateQueue.getQueueSnapshot();
        }
        catch ( TaskQueueException e )
        {
            throw new ArchivaException( "Unable to get database update queue:" + e.getMessage(), e );
        }

        return !queue.isEmpty();
    }
View Full Code Here

    public void executeEnvironmentChecks()
        throws ArchivaException
    {
        if ( ( checkers == null ) || CollectionUtils.isEmpty( checkers.values() ) )
        {
            throw new ArchivaException( "Unable to initialize the Redback Security Environment, "
                + "no Environment Check components found." );
        }

        List<String> violations = new ArrayList<String>();

        for ( Entry<String, EnvironmentCheck> entry : checkers.entrySet() )
        {
            EnvironmentCheck check = entry.getValue();
            getLogger().info( "Running Environment Check: " + entry.getKey() );
            check.validateEnvironment( violations );
        }

        if ( CollectionUtils.isNotEmpty( violations ) )
        {
            StringBuffer msg = new StringBuffer();
            msg.append( "EnvironmentCheck Failure.\n" );
            msg.append( "======================================================================\n" );
            msg.append( " ENVIRONMENT FAILURE !! \n" );
            msg.append( "\n" );

            for ( String violation : violations )
            {
                msg.append( violation ).append( "\n" );
            }

            msg.append( "\n" );
            msg.append( "======================================================================" );
            getLogger().fatalError( msg.toString() );

            throw new ArchivaException( "Unable to initialize Redback Security Environment, [" + violations.size()
                + "] violation(s) encountered, See log for details." );
        }
    }
View Full Code Here

        if ( StringUtils.isBlank( groupId ) )
        {
            String emsg = "Error generating dependency tree [" + Keys.toKey( groupId, artifactId, modelVersion )
                + "]: groupId is blank.";
            log.error( emsg );
            throw new ArchivaException( emsg );
        }

        if ( StringUtils.isBlank( artifactId ) )
        {
            String emsg = "Error generating dependency tree [" + Keys.toKey( groupId, artifactId, modelVersion )
                + "]: artifactId is blank.";
            log.error( emsg );
            throw new ArchivaException( emsg );
        }

        if ( StringUtils.isBlank( modelVersion ) )
        {
            String emsg = "Error generating dependency tree [" + Keys.toKey( groupId, artifactId, modelVersion )
                + "]: version is blank.";
            log.error( emsg );
            throw new ArchivaException( emsg );
        }

        DependencyGraph graph = fetchGraph( groupId, artifactId, modelVersion );

        if ( graph == null )
        {
            throw new ArchivaException( "Graph is unexpectedly null." );
        }

        TreeListVisitor treeListVisitor = new TreeListVisitor();
        DependencyGraphWalker walker = new WalkDepthFirstSearch();
        walker.visit( graph, treeListVisitor );
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.common.ArchivaException

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.