use of nl.nn.adapterframework.encryption.HasKeystore in project iaf by ibissource.
the class ShowConfigurationStatus method mapAdapterPipes.
private ArrayList<Object> mapAdapterPipes(Adapter adapter) {
if (!adapter.configurationSucceeded())
return null;
PipeLine pipeline = adapter.getPipeLine();
int totalPipes = pipeline.getPipes().size();
ArrayList<Object> pipes = new ArrayList<>(totalPipes);
for (int i = 0; i < totalPipes; i++) {
Map<String, Object> pipesInfo = new HashMap<>();
IPipe pipe = pipeline.getPipe(i);
Map<String, PipeForward> pipeForwards = pipe.getForwards();
String pipename = pipe.getName();
Map<String, String> forwards = new HashMap<>();
for (PipeForward fwrd : pipeForwards.values()) {
forwards.put(fwrd.getName(), fwrd.getPath());
}
pipesInfo.put("name", pipename);
pipesInfo.put("forwards", forwards);
if (pipe instanceof HasKeystore) {
HasKeystore s = (HasKeystore) pipe;
Map<String, Object> certInfo = addCertificateInfo(s);
if (certInfo != null)
pipesInfo.put("certificate", certInfo);
}
if (pipe instanceof MessageSendingPipe) {
MessageSendingPipe msp = (MessageSendingPipe) pipe;
ISender sender = msp.getSender();
pipesInfo.put("sender", ClassUtils.nameOf(sender));
if (sender instanceof HasKeystore) {
HasKeystore s = (HasKeystore) sender;
Map<String, Object> certInfo = addCertificateInfo(s);
if (certInfo != null)
pipesInfo.put("certificate", certInfo);
}
if (sender instanceof HasPhysicalDestination) {
pipesInfo.put("destination", ((HasPhysicalDestination) sender).getPhysicalDestinationName());
}
if (sender instanceof JdbcSenderBase) {
pipesInfo.put("isJdbcSender", true);
}
IListener<?> listener = msp.getListener();
if (listener != null) {
pipesInfo.put("listenerName", listener.getName());
pipesInfo.put("listenerClass", ClassUtils.nameOf(listener));
if (listener instanceof HasPhysicalDestination) {
String pd = ((HasPhysicalDestination) listener).getPhysicalDestinationName();
pipesInfo.put("listenerDestination", pd);
}
}
ITransactionalStorage<?> messageLog = msp.getMessageLog();
if (messageLog != null) {
mapPipeMessageLog(messageLog, pipesInfo);
} else if (sender instanceof ITransactionalStorage) {
// in case no message log specified
ITransactionalStorage<?> store = (ITransactionalStorage<?>) sender;
mapPipeMessageLog(store, pipesInfo);
pipesInfo.put("isSenderTransactionalStorage", true);
}
}
pipes.add(pipesInfo);
}
return pipes;
}
Aggregations