Search in sources :

Example 6 with UsernameAuthenticationMethod

use of com.redhat.jenkins.plugins.ci.authentication.activemq.UsernameAuthenticationMethod in project jms-messaging-plugin by jenkinsci.

the class ActiveMqMessagingProvider method readResolve.

protected Object readResolve() {
    if (user != null) {
        log.info("Legacy Message Provider username value is not null.");
        authenticationMethod = new UsernameAuthenticationMethod(user, password);
        log.info("Added default username/password authentication method using deprecated configuration.");
        setMigrationInProgress(true);
    }
    if (topicProvider == null) {
        topicProvider = new DefaultTopicProvider();
        setMigrationInProgress(true);
    }
    return this;
}
Also used : DefaultTopicProvider(com.redhat.jenkins.plugins.ci.messaging.topics.DefaultTopicProvider) UsernameAuthenticationMethod(com.redhat.jenkins.plugins.ci.authentication.activemq.UsernameAuthenticationMethod)

Example 7 with UsernameAuthenticationMethod

use of com.redhat.jenkins.plugins.ci.authentication.activemq.UsernameAuthenticationMethod in project jms-messaging-plugin by jenkinsci.

the class GlobalCIConfiguration method readResolve.

protected Object readResolve() {
    if (broker != null) {
        log.info("Legacy Message Provider Broker value is not null.");
        if (configs.size() == 0) {
            log.info("Current Message Provider size is 0.");
            if (getProvider(DEFAULT_PROVIDER) == null) {
                log.info("There is no default Message Provider.");
                configs.add(new ActiveMqMessagingProvider(DEFAULT_PROVIDER, broker, false, topic, new DefaultTopicProvider(), new UsernameAuthenticationMethod(user, password)));
                log.info("Added default Message Provider using deprecated configuration.");
                setMigrationInProgress(true);
            } else {
                log.info("Default (" + DEFAULT_PROVIDER + ") Message Provider already exists.");
            }
        }
    }
    // Examine providers
    if (configs != null) {
        for (JMSMessagingProvider config : configs) {
            if (config instanceof ActiveMqMessagingProvider) {
                ActiveMqMessagingProvider aconfig = (ActiveMqMessagingProvider) config;
                if (aconfig.IsMigrationInProgress()) {
                    log.info("Migration in progress for ActiveMqMessagingProvider " + aconfig.getName());
                    setMigrationInProgress(true);
                }
            }
        }
    }
    return this;
}
Also used : ActiveMqMessagingProvider(com.redhat.jenkins.plugins.ci.messaging.ActiveMqMessagingProvider) JMSMessagingProvider(com.redhat.jenkins.plugins.ci.messaging.JMSMessagingProvider) DefaultTopicProvider(com.redhat.jenkins.plugins.ci.messaging.topics.DefaultTopicProvider) UsernameAuthenticationMethod(com.redhat.jenkins.plugins.ci.authentication.activemq.UsernameAuthenticationMethod)

Aggregations

UsernameAuthenticationMethod (com.redhat.jenkins.plugins.ci.authentication.activemq.UsernameAuthenticationMethod)7 ActiveMqMessagingProvider (com.redhat.jenkins.plugins.ci.messaging.ActiveMqMessagingProvider)6 DefaultTopicProvider (com.redhat.jenkins.plugins.ci.messaging.topics.DefaultTopicProvider)4 GlobalCIConfiguration (com.redhat.jenkins.plugins.ci.GlobalCIConfiguration)3 Before (org.junit.Before)3 JMSMessagingProvider (com.redhat.jenkins.plugins.ci.messaging.JMSMessagingProvider)2 Test (org.junit.Test)2 SSLCertificateAuthenticationMethod (com.redhat.jenkins.plugins.ci.authentication.rabbitmq.SSLCertificateAuthenticationMethod)1 ActiveMQContainer (com.redhat.jenkins.plugins.ci.integration.fixtures.ActiveMQContainer)1 FedMsgMessagingProvider (com.redhat.jenkins.plugins.ci.messaging.FedMsgMessagingProvider)1 RabbitMQMessagingProvider (com.redhat.jenkins.plugins.ci.messaging.RabbitMQMessagingProvider)1 ConfiguredWithCode (io.jenkins.plugins.casc.misc.ConfiguredWithCode)1 LocalData (org.jvnet.hudson.test.recipes.LocalData)1