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