Package org.apache.archiva.common

Examples of org.apache.archiva.common.ArchivaException


        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 );
        }

        // TODO Cache the results to disk, in XML format, in the same place as the artifact is located.

        TreeListVisitor visitor = new TreeListVisitor();
        try
        {
            dependencyTreeBuilder.buildDependencyTree( userRepositories.getObservableRepositoryIds( getPrincipal() ),
                                                       groupId, artifactId, modelVersion, visitor );
        }
        catch ( DependencyTreeBuilderException e )
        {
            throw new ArchivaException( "Unable to build dependency tree: " + e.getMessage(), e );
        }

        return visitor.getList();
    }
View Full Code Here


                    {
                        scheduleRepositoryJobs( repoConfig );
                    }
                    catch ( SchedulerException e )
                    {
                        throw new ArchivaException( "Unable to start scheduler: " + e.getMessage(), e );
                    }

                    try
                    {
                        if ( !isPreviouslyScanned( repoConfig, metadataRepository ) )
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();
            List<String> v = new ArrayList<String>();
            check.validateEnvironment( v );
            log.info( "Environment Check: " + entry.getKey() + " -> " + v.size() + " violation(s)" );
            for ( String s : v )
            {
                violations.add( "[" + entry.getKey() + "] " + s );
            }
        }

        if ( CollectionUtils.isNotEmpty( violations ) )
        {
            StringBuilder msg = new StringBuilder();
            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( "======================================================================" );
            log.error( msg.toString() );

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

                    {
                        scheduleRepositoryJobs( repoConfig );
                    }
                    catch ( SchedulerException e )
                    {
                        throw new ArchivaException( "Unable to start scheduler: " + e.getMessage(), e );
                    }

                    try
                    {
                        if ( !isPreviouslyScanned( repoConfig, metadataRepository ) )
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." );
        }

        StopWatch stopWatch = new StopWatch();
        stopWatch.reset();
        stopWatch.start();

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

        for ( Entry<String, EnvironmentCheck> entry : checkers.entrySet() )
        {
            EnvironmentCheck check = entry.getValue();
            List<String> v = new ArrayList<>();
            check.validateEnvironment( v );
            log.info( "Environment Check: {} -> {} violation(s)", entry.getKey(), v.size() );
            for ( String s : v )
            {
                violations.add( "[" + entry.getKey() + "] " + s );
            }
        }

        if ( CollectionUtils.isNotEmpty( violations ) )
        {
            StringBuilder msg = new StringBuilder();
            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( "======================================================================" );
            log.error( msg.toString() );

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

        stopWatch.stop();
        log.info( "time to execute all EnvironmentCheck: {} ms", stopWatch.getTime() );
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." );
        }

        StopWatch stopWatch = new StopWatch();
        stopWatch.reset();
        stopWatch.start();

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

        for ( Entry<String, EnvironmentCheck> entry : checkers.entrySet() )
        {
            EnvironmentCheck check = entry.getValue();
            List<String> v = new ArrayList<String>();
            check.validateEnvironment( v );
            log.info( "Environment Check: {} -> {} violation(s)", entry.getKey(), v.size() );
            for ( String s : v )
            {
                violations.add( "[" + entry.getKey() + "] " + s );
            }
        }

        if ( CollectionUtils.isNotEmpty( violations ) )
        {
            StringBuilder msg = new StringBuilder();
            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( "======================================================================" );
            log.error( msg.toString() );

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

        stopWatch.stop();
        log.info( "time to execute all EnvironmentCheck: {} ms", stopWatch.getTime() );
View Full Code Here

                    {
                        scheduleRepositoryJobs( repoConfig );
                    }
                    catch ( SchedulerException e )
                    {
                        throw new ArchivaException( "Unable to start scheduler: " + e.getMessage(), e );
                    }

                    try
                    {
                        if ( !isPreviouslyScanned( repoConfig, metadataRepository ) )
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();
            List<String> v = new ArrayList<String>();
            check.validateEnvironment( v );
            log.info( "Environment Check: " + entry.getKey() + " -> " + v.size() + " violation(s)" );
            for ( String s : v )
            {
                violations.add( "[" + entry.getKey() + "] " + s );
            }
        }

        if ( CollectionUtils.isNotEmpty( violations ) )
        {
            StringBuilder msg = new StringBuilder();
            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( "======================================================================" );
            log.error( 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 );
        }

        // TODO Cache the results to disk, in XML format, in the same place as the artifact is located.

        TreeListVisitor visitor = new TreeListVisitor();
        try
        {
            dependencyTreeBuilder.buildDependencyTree( userRepositories.getObservableRepositoryIds( getPrincipal() ),
                                                       groupId, artifactId, modelVersion, visitor );
        }
        catch ( Exception e )
        {
            throw new ArchivaException( "Unable to build dependency tree: " + e.getMessage(), e );
        }

        return visitor.getList();
    }
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();
            List<String> v = new ArrayList<String>();
            check.validateEnvironment( v );
            log.info( "Environment Check: " + entry.getKey() + " -> " + v.size() + " violation(s)" );
            for ( String s : v )
            {
                violations.add( "[" + entry.getKey() + "] " + s );
            }
        }

        if ( CollectionUtils.isNotEmpty( violations ) )
        {
            StringBuilder msg = new StringBuilder();
            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( "======================================================================" );
            log.error( msg.toString() );

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

TOP

Related Classes of org.apache.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.