All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.wildfly.apigen.operations.ReadDescription Maven / Gradle / Ivy

There is a newer version: 0.3.4
Show newest version
package org.wildfly.apigen.operations;

import org.jboss.dmr.ModelNode;
import org.wildfly.apigen.model.AddressTemplate;
import org.wildfly.apigen.model.Operation;
import org.wildfly.apigen.model.ResourceAddress;
import org.wildfly.apigen.model.StatementContext;

import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;

/**
 * @author Heiko Braun
 * @since 29/07/15
 */
public class ReadDescription implements AddressTemplateSupport {
    private AddressTemplate address;

    public ReadDescription(AddressTemplate address) {
        this.address = address;
    }

    @Override
    public ModelNode resolve(StatementContext ctx) {

        ResourceAddress address = this.address.resolve(ctx);
        Operation op = new Operation.Builder(READ_RESOURCE_DESCRIPTION_OPERATION, address)
                .param(RECURSIVE, true)
                .build();

        return op;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy