list.add(adminObject.getJndiName());
}
for (Object c: connectorResources) {
ConnectorResource cr = (ConnectorResource) c;
ConnectorConnectionPool cp = (ConnectorConnectionPool) domain.getResources().getResourceByName(ConnectorConnectionPool.class, cr.getPoolName());
if (cp != null && JMSRA.equalsIgnoreCase(cp.getResourceAdapterName())){
list.add(cr.getJndiName());
}
//if(QUEUE_CF.equals(cp.getConnectionDefinitionName()) || TOPIC_CF.equals(cp.getConnectionDefinitionName())
// || UNIFIED_CF.equals(cp.getConnectionDefinitionName()))
}
if (list.isEmpty()) {
final ActionReport.MessagePart part = report.getTopMessagePart().addChild();
part.setMessage(localStrings.getLocalString("nothingToList",
"Nothing to list."));
extraProperties.put("jmsResources", list);
} else {
List <String> resourceList = null;
//if("domain".equalsIgnoreCase(target))
if(CommandTarget.DOMAIN.isValid(habitat, target))
resourceList=list;
else
resourceList = filterListForTarget(list);
if(resourceList == null)
resourceList = list;
for (String jndiName : resourceList) {
final ActionReport.MessagePart part = report.getTopMessagePart().addChild();
part.setMessage(jndiName);
}
extraProperties.put("jmsResources", resourceList);
}
report.setExtraProperties(extraProperties);
} catch (Exception e) {
report.setMessage(localStrings.getLocalString("list.jms.resources.fail",
"Unable to list JMS Resources") + " " + e.getLocalizedMessage());
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
report.setFailureCause(e);
return;
}
} else {
if(resourceType.equals(TOPIC_CF) || resourceType.equals(QUEUE_CF) || resourceType.equals(UNIFIED_CF)){
for (Object c : connectorResources) {
ConnectorResource cr = (ConnectorResource)c;
ConnectorConnectionPool cp = (ConnectorConnectionPool) domain.getResources().getResourceByName(ConnectorConnectionPool.class, cr.getPoolName());
if(cp != null && resourceType.equals(cp.getConnectionDefinitionName()) && JMSRA.equalsIgnoreCase(cp.getResourceAdapterName()))
list.add(cp.getName());
}
} else if (resourceType.equals(TOPIC) || resourceType.equals(QUEUE))
{
for (Object r : adminObjectResources) {
AdminObjectResource res = (AdminObjectResource)r;