Package org.apache.archiva.admin.model

Examples of org.apache.archiva.admin.model.RepositoryAdminException


            }
            return context;
        }
        catch ( MalformedURLException e )
        {
            throw new RepositoryAdminException( e.getMessage(), e );
        }
        catch ( IOException e )
        {
            throw new RepositoryAdminException( e.getMessage(), e );
        }
        catch ( UnsupportedExistingLuceneIndexException e )
        {
            throw new RepositoryAdminException( e.getMessage(), e );
        }
    }
View Full Code Here


            configuration.getRepositoryGroupsAsMap().get( repositoryGroupId );
        mergedRemoteIndexesScheduler.unschedule(
            new RepositoryGroup( repositoryGroupId, Collections.<String>emptyList() ) );
        if ( repositoryGroupConfiguration == null )
        {
            throw new RepositoryAdminException(
                "repositoryGroup with id " + repositoryGroupId + " doesn't not exists so cannot remove" );
        }
        configuration.removeRepositoryGroup( repositoryGroupConfiguration );
        triggerAuditEvent( repositoryGroupId, null, AuditEvent.DELETE_REPO_GROUP, auditInformation );
View Full Code Here

        throws RepositoryAdminException
    {
        RepositoryGroup repositoryGroup = getRepositoryGroup( repositoryGroupId );
        if ( repositoryGroup == null )
        {
            throw new RepositoryAdminException(
                "repositoryGroup with id " + repositoryGroupId + " doesn't not exists so cannot add repository to it" );
        }

        if ( repositoryGroup.getRepositories().contains( repositoryId ) )
        {
            throw new RepositoryAdminException(
                "repositoryGroup with id " + repositoryGroupId + " already contain repository with id" + repositoryId );
        }
        validateManagedRepositoriesExists( Arrays.asList( repositoryId ) );

        repositoryGroup.addRepository( repositoryId );
View Full Code Here

        throws RepositoryAdminException
    {
        RepositoryGroup repositoryGroup = getRepositoryGroup( repositoryGroupId );
        if ( repositoryGroup == null )
        {
            throw new RepositoryAdminException( "repositoryGroup with id " + repositoryGroupId
                                                    + " doesn't not exists so cannot remove repository from it" );
        }

        if ( !repositoryGroup.getRepositories().contains( repositoryId ) )
        {
            throw new RepositoryAdminException(
                "repositoryGroup with id " + repositoryGroupId + " doesn't not contains repository with id"
                    + repositoryId );
        }

        repositoryGroup.removeRepository( repositoryId );
View Full Code Here

        throws RepositoryAdminException
    {
        String repoGroupId = repositoryGroup.getId();
        if ( StringUtils.isBlank( repoGroupId ) )
        {
            throw new RepositoryAdminException( "repositoryGroup id cannot be empty" );
        }

        if ( repoGroupId.length() > 100 )
        {
            throw new RepositoryAdminException(
                "Identifier [" + repoGroupId + "] is over the maximum limit of 100 characters" );

        }

        Matcher matcher = REPO_GROUP_ID_PATTERN.matcher( repoGroupId );
        if ( !matcher.matches() )
        {
            throw new RepositoryAdminException(
                "Invalid character(s) found in identifier. Only the following characters are allowed: alphanumeric, '.', '-' and '_'" );
        }

        if ( repositoryGroup.getMergedIndexTtl() <= 0 )
        {
            throw new RepositoryAdminException( "Merged Index TTL must be greater than 0." );
        }

        Configuration configuration = getArchivaConfiguration().getConfiguration();

        if ( configuration.getRepositoryGroupsAsMap().containsKey( repoGroupId ) )
        {
            if ( !updateMode )
            {
                throw new RepositoryAdminException( "Unable to add new repository group with id [" + repoGroupId
                                                        + "], that id already exists as a repository group." );
            }
        }
        else if ( configuration.getManagedRepositoriesAsMap().containsKey( repoGroupId ) )
        {
            throw new RepositoryAdminException( "Unable to add new repository group with id [" + repoGroupId
                                                    + "], that id already exists as a managed repository." );
        }
        else if ( configuration.getRemoteRepositoriesAsMap().containsKey( repoGroupId ) )
        {
            throw new RepositoryAdminException( "Unable to add new repository group with id [" + repoGroupId
                                                    + "], that id already exists as a remote repository." );
        }

        return Boolean.TRUE;
    }
View Full Code Here

    {
        for ( String id : managedRepositoriesIds )
        {
            if ( getManagedRepositoryAdmin().getManagedRepository( id ) == null )
            {
                throw new RepositoryAdminException(
                    "managedRepository with id " + id + " not exists so cannot be used in a repositoryGroup" );
            }
        }
    }
View Full Code Here

        {
            archivaConfiguration.save( configuration );
        }
        catch ( RegistryException e )
        {
            throw new RepositoryAdminException( e.getMessage(), e );
        }
        catch ( IndeterminateConfigurationException e )
        {
            throw new RepositoryAdminException( e.getMessage(), e );
        }
    }
View Full Code Here

        {
            getArchivaConfiguration().save( config );
        }
        catch ( org.apache.archiva.redback.components.registry.RegistryException e )
        {
            throw new RepositoryAdminException( "Error occurred in the registry: " + e.getLocalizedMessage(), e );
        }
        catch ( IndeterminateConfigurationException e )
        {
            throw new RepositoryAdminException(
                "Error occurred while saving the configuration: " + e.getLocalizedMessage(), e );
        }
    }
View Full Code Here

            indexCreators = mavenIndexerUtils.getAllIndexCreators();
            indexer = plexusSisuBridge.lookup( NexusIndexer.class );
        }
        catch ( PlexusSisuBridgeException e )
        {
            throw new RepositoryAdminException( e.getMessage(), e );
        }
        for ( RemoteRepository remoteRepository : getRemoteRepositories() )
        {
            createIndexContext( remoteRepository );
        }
View Full Code Here

                }
            }
        }
        catch ( IOException e )
        {
            throw new RepositoryAdminException( e.getMessage(), e );
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.archiva.admin.model.RepositoryAdminException

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.