use of org.jaffa.qm.apis.data.QueueMetaData in project jaffa-framework by jaffa-projects.
the class JmsQueueAdmin method createQueueMetaData.
/**
* Creates MetaData for the input Queue, based on the available fields in the PropertyFilter.
*/
private static QueueMetaData createQueueMetaData(String queueName, PropertyFilter pf) {
QueueMetaData qmd = null;
if (pf.isFieldIncluded("queueMetaData")) {
qmd = new QueueMetaData();
if (pf.isFieldIncluded("queueMetaData.queueSystemId"))
qmd.setQueueSystemId(QUEUE_SYSTEM_ID);
if (pf.isFieldIncluded("queueMetaData.type"))
qmd.setType(queueName);
if (pf.isFieldIncluded("queueMetaData.supportedMessageStatus"))
qmd.setSupportedMessageStatus(SUPPORTED_MESSAGE_STATUS);
if (pf.isFieldIncluded("queueMetaData.supportedApplicationFields")) {
QueueInfo queueInfo = ConfigurationService.getInstance().getQueueInfo(queueName);
if (queueInfo != null && queueInfo.getDisplayParam() != null) {
Collection<MessageFieldMetaData> supportedApplicationFields = new LinkedList<MessageFieldMetaData>();
for (DisplayParam displayParam : queueInfo.getDisplayParam()) {
// Ignore fields that are included in the main graph or are part of the technical-details
if (displayParam.getName().startsWith("JMS") || displayParam.getName().startsWith("jaffa_"))
continue;
MessageFieldMetaData supportedApplicationField = new MessageFieldMetaData();
if (pf.isFieldIncluded("queueMetaData.supportedApplicationFields.name"))
supportedApplicationField.setName(displayParam.getName());
if (pf.isFieldIncluded("queueMetaData.supportedApplicationFields.label"))
supportedApplicationField.setLabel(MessageHelper.replaceTokens(displayParam.getLabel()));
supportedApplicationFields.add(supportedApplicationField);
}
if (!supportedApplicationFields.isEmpty())
qmd.setSupportedApplicationFields(supportedApplicationFields.toArray(new MessageFieldMetaData[supportedApplicationFields.size()]));
}
}
if (pf.isFieldIncluded("queueMetaData.supportsTechnicalFields"))
qmd.setSupportsTechnicalFields(SUPPORTS_TECHNICAL_FIELDS);
if (pf.isFieldIncluded("queueMetaData.supportsBusinessEventLogs"))
qmd.setSupportsBusinessEventLogs(SUPPORTS_BUSINESS_EVENT_LOGS);
if (pf.isFieldIncluded("queueMetaData.supportsDependencies"))
qmd.setSupportsDependencies(SUPPORTS_DEPENDENCIES);
}
return qmd;
}
use of org.jaffa.qm.apis.data.QueueMetaData in project jaffa-framework by jaffa-projects.
the class TransactionAdmin method createQueueMetaData.
/**
* Creates MetaData for the input Type, based on the available fields in the PropertyFilter.
*/
private static QueueMetaData createQueueMetaData(String type, PropertyFilter pf) {
QueueMetaData qmd = null;
if (pf.isFieldIncluded("queueMetaData")) {
qmd = new QueueMetaData();
if (pf.isFieldIncluded("queueMetaData.queueSystemId")) {
qmd.setQueueSystemId(QUEUE_SYSTEM_ID);
}
if (pf.isFieldIncluded("queueMetaData.type")) {
qmd.setType(type);
}
if (pf.isFieldIncluded("queueMetaData.supportedMessageStatus")) {
qmd.setSupportedMessageStatus(SUPPORTED_MESSAGE_STATUS);
}
if (pf.isFieldIncluded("queueMetaData.supportedApplicationFields")) {
TypeInfo typeInfo = ConfigurationService.getInstance().getTypeInfo(type);
if (typeInfo != null && typeInfo.getDisplayParam() != null) {
Collection<MessageFieldMetaData> supportedApplicationFields = new LinkedList<MessageFieldMetaData>();
for (DisplayParam displayParam : typeInfo.getDisplayParam()) {
MessageFieldMetaData supportedApplicationField = new MessageFieldMetaData();
if (pf.isFieldIncluded("queueMetaData.supportedApplicationFields.name")) {
supportedApplicationField.setName(displayParam.getName());
}
if (pf.isFieldIncluded("queueMetaData.supportedApplicationFields.label")) {
supportedApplicationField.setLabel(MessageHelper.replaceTokens(displayParam.getLabel()));
}
supportedApplicationFields.add(supportedApplicationField);
}
if (!supportedApplicationFields.isEmpty()) {
qmd.setSupportedApplicationFields(supportedApplicationFields.toArray(new MessageFieldMetaData[supportedApplicationFields.size()]));
}
}
}
if (pf.isFieldIncluded("queueMetaData.supportsTechnicalFields")) {
qmd.setSupportsTechnicalFields(SUPPORTS_TECHNICAL_FIELDS);
}
if (pf.isFieldIncluded("queueMetaData.supportsBusinessEventLogs")) {
qmd.setSupportsBusinessEventLogs(SUPPORTS_BUSINESS_EVENT_LOGS);
}
if (pf.isFieldIncluded("queueMetaData.supportsDependencies")) {
qmd.setSupportsDependencies(SUPPORTS_DEPENDENCIES);
}
}
return qmd;
}
Aggregations