Examples of NetworkProxy


Examples of org.apache.archiva.admin.model.beans.NetworkProxy

            if ( remoteRepository == null )
            {
                log.warn( "ignore scheduleDownloadRemote for repo with id {} as not exists", repositoryId );
                return;
            }
            NetworkProxy networkProxy = null;
            if ( StringUtils.isNotBlank( remoteRepository.getRemoteDownloadNetworkProxyId() ) )
            {
                networkProxy = networkProxyAdmin.getNetworkProxy( remoteRepository.getRemoteDownloadNetworkProxyId() );
                if ( networkProxy == null )
                {
View Full Code Here

Examples of org.apache.archiva.admin.model.beans.NetworkProxy

        {
            addActionError( "Unable to delete network proxy with blank id." );
            return SUCCESS;
        }

        NetworkProxy networkProxy = getNetworkProxyAdmin().getNetworkProxy( id );
        if ( networkProxy == null )
        {
            addActionError( "Unable to remove network proxy, proxy with id [" + id + "] not found." );
            return SUCCESS;
        }
View Full Code Here

Examples of org.apache.archiva.admin.model.beans.NetworkProxy

            proxy = findNetworkProxy( id );
        }

        if ( proxy == null )
        {
            proxy = new NetworkProxy();
        }
    }
View Full Code Here

Examples of org.apache.archiva.admin.model.beans.NetworkProxy

    }

    public void testStruts2ValidationFrameworkWithNullInputs() throws Exception
    {
        // prep
        NetworkProxy networkProxy = createNetworkProxy(null, null, null, null);
        configureNetworkProxyAction.setProxy(networkProxy);

        // test
        actionValidatorManager.validate(configureNetworkProxyAction, VALIDATION_CONTEXT);
View Full Code Here

Examples of org.apache.archiva.admin.model.beans.NetworkProxy

    }

    public void testStruts2ValidationFrameworkWithBlankInputs() throws Exception
    {
        // prep
        NetworkProxy networkProxy = createNetworkProxy(EMPTY_STRING, EMPTY_STRING, EMPTY_STRING, EMPTY_STRING);
        configureNetworkProxyAction.setProxy(networkProxy);

        // test
        actionValidatorManager.validate(configureNetworkProxyAction, VALIDATION_CONTEXT);
View Full Code Here

Examples of org.apache.archiva.admin.model.beans.NetworkProxy

    }

    public void testStruts2ValidationFrameworkWithInvalidInputs() throws Exception
    {
        // prep
        NetworkProxy networkProxy = createNetworkProxy( PROXY_ID_INVALID_INPUT, PROXY_HOST_INVALID_INPUT,
                                                        PROXY_PORT_INVALID_INPUT, PROXY_PROTOCOL_INVALID_INPUT,
                                                        PROXY_USERNAME_INVALID_INPUT );
        configureNetworkProxyAction.setProxy(networkProxy);

        // test
View Full Code Here

Examples of org.apache.archiva.admin.model.beans.NetworkProxy

    }

    public void testStruts2ValidationFrameworkWithValidInputs() throws Exception
    {
        // prep
        NetworkProxy networkProxy = createNetworkProxy(PROXY_ID_VALID_INPUT, PROXY_HOST_VALID_INPUT, PROXY_PORT_VALID_INPUT, PROXY_PROTOCOL_VALID_INPUT, PROXY_USERNAME_VALID_INPUT);
        configureNetworkProxyAction.setProxy(networkProxy);

        // test
        actionValidatorManager.validate(configureNetworkProxyAction, VALIDATION_CONTEXT);
View Full Code Here

Examples of org.apache.archiva.admin.model.beans.NetworkProxy

        assertFalse(configureNetworkProxyAction.hasFieldErrors());
    }

    private NetworkProxy createNetworkProxy(String id, String host, int port, String protocol, String username)
    {
        NetworkProxy networkProxy = new NetworkProxy();
        networkProxy.setId( id );
        networkProxy.setHost( host );
        networkProxy.setPort( port );
        networkProxy.setProtocol( protocol );
        networkProxy.setUsername( username );
        return networkProxy;
    }
View Full Code Here

Examples of org.apache.archiva.admin.model.beans.NetworkProxy

    // over-loaded
    // for simulating empty/null form purposes; excluding primitive data-typed values
    private NetworkProxy createNetworkProxy(String id, String host, String protocol, String username)
    {
        NetworkProxy networkProxy = new NetworkProxy();
        networkProxy.setId( id );
        networkProxy.setHost( host );
        networkProxy.setProtocol( protocol );
        networkProxy.setUsername( username );
        return networkProxy;
    }
View Full Code Here

Examples of org.apache.archiva.admin.model.beans.NetworkProxy

    public void deleteNetworkProxy( String networkProxyId, AuditInformation auditInformation )
        throws RepositoryAdminException
    {

        NetworkProxy networkProxy = getNetworkProxy( networkProxyId );
        if ( networkProxy == null )
        {
            throw new RepositoryAdminException(
                "cannot delete NetworkProxy with id " + networkProxyId + " as not exist" );
        }
        Configuration configuration = getArchivaConfiguration().getConfiguration();
        NetworkProxyConfiguration networkProxyConfiguration = getNetworkProxyConfiguration( networkProxy );
        configuration.removeNetworkProxy( networkProxyConfiguration );

        for ( RemoteRepositoryConfiguration rrc : configuration.getRemoteRepositories())
        {
            if (StringUtils.equals( rrc.getRemoteDownloadNetworkProxyId(), networkProxyId ))
            {
                rrc.setRemoteDownloadNetworkProxyId( null );
            }
        }

        triggerAuditEvent( networkProxy.getId(), null, AuditEvent.DELETE_NETWORK_PROXY, auditInformation );

        saveConfiguration( configuration );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.