final boolean forJMS = isJMS();
final EnumSet<OperationEntry.Flag> readOnly = EnumSet.of(OperationEntry.Flag.READ_ONLY, OperationEntry.Flag.RUNTIME_ONLY);
final EnumSet<OperationEntry.Flag> runtimeOnly = EnumSet.of(OperationEntry.Flag.RUNTIME_ONLY);
registry.registerOperationHandler(LIST_MESSAGES, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getListMessages(locale, forJMS, false);
}
}, false, OperationEntry.EntryType.PUBLIC, readOnly);
registry.registerOperationHandler(LIST_MESSAGES_AS_JSON, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getListMessages(locale, forJMS, true);
}
}, readOnly);
registry.registerOperationHandler(COUNT_MESSAGES, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getCountMessages(locale);
}
}, readOnly);
registry.registerOperationHandler(REMOVE_MESSAGE, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getRemoveMessage(locale, forJMS);
}
}, runtimeOnly);
registry.registerOperationHandler(REMOVE_MESSAGES, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getRemoveMessages(locale);
}
}, runtimeOnly);
registry.registerOperationHandler(EXPIRE_MESSAGES, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getExpireMessages(locale);
}
}, runtimeOnly);
registry.registerOperationHandler(EXPIRE_MESSAGE, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getExpireMessage(locale, forJMS);
}
}, runtimeOnly);
registry.registerOperationHandler(SEND_MESSAGE_TO_DEAD_LETTER_ADDRESS, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getSendMessageToDeadLetterAddress(locale, forJMS);
}
}, runtimeOnly);
registry.registerOperationHandler(SEND_MESSAGES_TO_DEAD_LETTER_ADDRESS, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getSendMessagesToDeadLetterAddress(locale);
}
}, runtimeOnly);
registry.registerOperationHandler(CHANGE_MESSAGE_PRIORITY, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getChangeMessagePriority(locale, forJMS);
}
}, runtimeOnly);
registry.registerOperationHandler(CHANGE_MESSAGES_PRIORITY, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getChangeMessagesPriority(locale);
}
}, runtimeOnly);
registry.registerOperationHandler(MOVE_MESSAGE, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getMoveMessage(locale, forJMS);
}
}, runtimeOnly);
registry.registerOperationHandler(MOVE_MESSAGES, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getMoveMessages(locale);
}
}, runtimeOnly);
// TODO dmr-based LIST_MESSAGE_COUNTER
registry.registerOperationHandler(LIST_MESSAGE_COUNTER_AS_JSON, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getNoArgSimpleReplyOperation(locale, LIST_MESSAGE_COUNTER_AS_JSON, "queue", ModelType.STRING, true);
}
}, readOnly);
registry.registerOperationHandler(LIST_MESSAGE_COUNTER_AS_HTML, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getNoArgSimpleReplyOperation(locale, LIST_MESSAGE_COUNTER_AS_HTML, "queue", ModelType.STRING, true);
}
}, readOnly);
registry.registerOperationHandler(RESET_MESSAGE_COUNTER, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getDescriptionOnlyOperation(locale, RESET_MESSAGE_COUNTER, "queue");
}
}, runtimeOnly);
// TODO dmr-based LIST_MESSAGE_COUNTER_HISTORY
registry.registerOperationHandler(LIST_MESSAGE_COUNTER_HISTORY_AS_JSON, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getNoArgSimpleReplyOperation(locale, LIST_MESSAGE_COUNTER_HISTORY_AS_JSON, "queue", ModelType.STRING, true);
}
}, readOnly);
registry.registerOperationHandler(LIST_MESSAGE_COUNTER_HISTORY_AS_HTML, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getNoArgSimpleReplyOperation(locale, LIST_MESSAGE_COUNTER_HISTORY_AS_HTML, "queue", ModelType.STRING, true);
}
}, readOnly);
registry.registerOperationHandler(PAUSE, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getDescriptionOnlyOperation(locale, PAUSE, "queue");
}
}, runtimeOnly);
registry.registerOperationHandler(RESUME, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getDescriptionOnlyOperation(locale, RESUME, "queue");
}
}, runtimeOnly);
// TODO LIST_CONSUMERS
registry.registerOperationHandler(LIST_CONSUMERS_AS_JSON, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getNoArgSimpleReplyOperation(locale, LIST_CONSUMERS_AS_JSON, "queue", ModelType.STRING, true);
}
}, readOnly);