Search in sources :

Example 51 with KeyValuePair

use of com.adaptris.util.KeyValuePair in project interlok by adaptris.

the class HttpsConnection method createSslContext.

SslContextFactory createSslContext() throws Exception {
    SslContextFactory.Server sslContextFactory = new SslContextFactory.Server();
    for (KeyValuePair kvp : getSslProperties().getKeyValuePairs()) {
        boolean matched = false;
        for (SslProperty sp : SslProperty.values()) {
            if (kvp.getKey().equalsIgnoreCase(sp.toString())) {
                sp.applyProperty(sslContextFactory, kvp.getValue());
                matched = true;
                break;
            }
        }
        if (!matched) {
            if (!SimpleBeanUtil.callSetter(sslContextFactory, "set" + kvp.getKey(), kvp.getValue())) {
                log.trace("Ignoring unsupported Property {}", kvp.getKey());
            }
        }
    }
    return sslContextFactory;
}
Also used : SslContextFactory(org.eclipse.jetty.util.ssl.SslContextFactory) KeyValuePair(com.adaptris.util.KeyValuePair)

Example 52 with KeyValuePair

use of com.adaptris.util.KeyValuePair in project interlok by adaptris.

the class ConfiguredRequestHeaders method addHeaders.

@Override
public HttpURLConnection addHeaders(AdaptrisMessage msg, HttpURLConnection target) {
    for (KeyValuePair k : getHeaders()) {
        log.trace("Adding Request Property [{}: {}]", k.getKey(), k.getValue());
        target.addRequestProperty(k.getKey(), k.getValue());
    }
    return target;
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair)

Example 53 with KeyValuePair

use of com.adaptris.util.KeyValuePair in project interlok by adaptris.

the class MetadataCollectionTest method testContructor_KVPS.

@Test
public void testContructor_KVPS() {
    KeyValuePairCollection elements = new KeyValuePairCollection();
    elements.add(new KeyValuePair("test", "value"));
    MetadataCollection c = new MetadataCollection(elements);
    assertTrue(c.containsKey("test"));
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) KeyValuePairCollection(com.adaptris.util.KeyValuePairCollection) Test(org.junit.Test)

Example 54 with KeyValuePair

use of com.adaptris.util.KeyValuePair in project interlok by adaptris.

the class LoggingContextWorkflowInterceptor method workflowEnd.

@Override
public synchronized void workflowEnd(AdaptrisMessage inputMsg, AdaptrisMessage outputMsg) {
    for (KeyValuePair pair : getValuesToSet()) {
        MDC.remove(pair.getKey());
    }
    if (useDefaultKeys()) {
        MDC.remove(CoreConstants.CHANNEL_ID_KEY);
        MDC.remove(CoreConstants.WORKFLOW_ID_KEY);
        MDC.remove(CoreConstants.MESSAGE_UNIQUE_ID_KEY);
    }
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair)

Example 55 with KeyValuePair

use of com.adaptris.util.KeyValuePair in project interlok by adaptris.

the class AddExtendedLoggingContext method doService.

@Override
public void doService(AdaptrisMessage msg) throws ServiceException {
    try {
        if (useDefaultKeys()) {
            addFromObjectHeader(msg, CoreConstants.CHANNEL_ID_KEY);
            addFromObjectHeader(msg, CoreConstants.WORKFLOW_ID_KEY);
            addFromObjectHeader(msg, CoreConstants.MESSAGE_UNIQUE_ID_KEY);
        }
        for (KeyValuePair pair : getValuesToSet()) {
            MDC.put(msg.resolve(pair.getKey()), msg.resolve(pair.getValue()));
        }
    } catch (IllegalArgumentException | IllegalStateException e) {
        throw ExceptionHelper.wrapServiceException(e);
    }
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair)

Aggregations

KeyValuePair (com.adaptris.util.KeyValuePair)143 Test (org.junit.Test)79 KeyValuePairSet (com.adaptris.util.KeyValuePairSet)55 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)26 KeyValuePairList (com.adaptris.util.KeyValuePairList)12 StandardJndiImplementation (com.adaptris.core.jms.jndi.StandardJndiImplementation)11 StandaloneProducer (com.adaptris.core.StandaloneProducer)10 Channel (com.adaptris.core.Channel)9 MockMessageProducer (com.adaptris.core.stubs.MockMessageProducer)9 TimeInterval (com.adaptris.util.TimeInterval)9 ServiceException (com.adaptris.core.ServiceException)7 JmsConnection (com.adaptris.core.jms.JmsConnection)6 ArrayList (java.util.ArrayList)6 CoreException (com.adaptris.core.CoreException)5 StandardWorkflow (com.adaptris.core.StandardWorkflow)5 PasProducer (com.adaptris.core.jms.PasProducer)5 MetadataCollection (com.adaptris.core.MetadataCollection)4 MetadataElement (com.adaptris.core.MetadataElement)4 StandaloneConsumer (com.adaptris.core.StandaloneConsumer)4 StandaloneRequestor (com.adaptris.core.StandaloneRequestor)3