public void registerOperations(final ManagementResourceRegistration registry) {
final EnumSet<OperationEntry.Flag> readOnly = EnumSet.of(OperationEntry.Flag.READ_ONLY, OperationEntry.Flag.RUNTIME_ONLY);
registry.registerOperationHandler(LIST_ALL_SUBSCRIPTIONS, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getListSubscriptionsOperation(locale, LIST_ALL_SUBSCRIPTIONS);
}
}, readOnly);
registry.registerOperationHandler(LIST_ALL_SUBSCRIPTIONS_AS_JSON, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getNoArgSimpleReplyOperation(locale, LIST_ALL_SUBSCRIPTIONS_AS_JSON,
TOPIC, ModelType.STRING, false);
}
}, readOnly);
registry.registerOperationHandler(LIST_DURABLE_SUBSCRIPTIONS, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getListSubscriptionsOperation(locale, LIST_DURABLE_SUBSCRIPTIONS);
}
}, readOnly);
registry.registerOperationHandler(LIST_DURABLE_SUBSCRIPTIONS_AS_JSON, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getNoArgSimpleReplyOperation(locale, LIST_DURABLE_SUBSCRIPTIONS_AS_JSON,
TOPIC, ModelType.STRING, false);
}
}, readOnly);
registry.registerOperationHandler(LIST_NON_DURABLE_SUBSCRIPTIONS, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getListSubscriptionsOperation(locale, LIST_NON_DURABLE_SUBSCRIPTIONS);
}
}, readOnly);
registry.registerOperationHandler(LIST_NON_DURABLE_SUBSCRIPTIONS_AS_JSON, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getNoArgSimpleReplyOperation(locale, LIST_NON_DURABLE_SUBSCRIPTIONS_AS_JSON,
TOPIC, ModelType.STRING, false);
}
}, readOnly);
registry.registerOperationHandler(LIST_MESSAGES_FOR_SUBSCRIPTION, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getListMessagesForSubscription(locale);
}
}, readOnly);
registry.registerOperationHandler(LIST_MESSAGES_FOR_SUBSCRIPTION_AS_JSON, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getListMessagesForSubscriptionAsJSON(locale);
}
}, readOnly);
registry.registerOperationHandler(COUNT_MESSAGES_FOR_SUBSCRIPTION, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getCountMessagesForSubscription(locale);
}
}, readOnly);
registry.registerOperationHandler(DROP_DURABLE_SUBSCRIPTION, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getDropDurableSubscription(locale);
}
});
registry.registerOperationHandler(DROP_ALL_SUBSCRIPTIONS, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getDescriptionOnlyOperation(locale, DROP_ALL_SUBSCRIPTIONS, TOPIC);
}
});
registry.registerOperationHandler(REMOVE_MESSAGES, this, new DescriptionProvider() {
@Override
public ModelNode getModelDescription(Locale locale) {
return MessagingDescriptions.getRemoveMessages(locale);
}
});