Examples of CandidatesProvider


Examples of org.jboss.as.cli.impl.DefaultCompleter.CandidatesProvider

        }
        this.idProperty = idProperty;

        this.excludeOps = excludeOperations;

        profile = new ArgumentWithValue(this, new DefaultCompleter(new CandidatesProvider(){
            @Override
            public List<String> getAllCandidates(CommandContext ctx) {
                return Util.getNodeNames(ctx.getModelControllerClient(), null, "profile");
            }}), "--profile") {
            @Override
            public boolean canAppearNext(CommandContext ctx) throws CommandFormatException {
                if(!isDependsOnProfile()) {
                    return false;
                }
                if(!ctx.isDomainMode()) {
                    return false;
                }
                return super.canAppearNext(ctx);
            }
        };
        //profile.addCantAppearAfter(helpArg);

        operation = new ArgumentWithValue(this, new DefaultCompleter(new CandidatesProvider(){
                @Override
                public Collection<String> getAllCandidates(CommandContext ctx) {
                    DefaultOperationRequestAddress address = new DefaultOperationRequestAddress();
                    if(isDependsOnProfile() && ctx.isDomainMode()) {
                        final String profileName = profile.getValue(ctx.getParsedCommandLine());
View Full Code Here

Examples of org.jboss.as.cli.impl.DefaultCompleter.CandidatesProvider

    public BaseDataSourceModifyHandler(CommandContext ctx, String commandName, final String dsType) {
        super(ctx, commandName, true);

        this.dsType = dsType;

        profile = new ArgumentWithValue(this, new DefaultCompleter(new CandidatesProvider(){
            @Override
            public List<String> getAllCandidates(CommandContext ctx) {
                return Util.getNodeNames(ctx.getModelControllerClient(), null, "profile");
            }}), "--profile") {
            @Override
            public boolean canAppearNext(CommandContext ctx) throws CommandFormatException {
                if(!ctx.isDomainMode()) {
                    return false;
                }
                return super.canAppearNext(ctx);
            }
        };

        //jndiName =  new RequiredRequestParamArg("jndi-name", this, "--jndi-name") {
        jndiName =  new ArgumentWithValue(this, new DefaultCompleter(new CandidatesProvider(){
            @Override
            public List<String> getAllCandidates(CommandContext ctx) {
                return Util.getDatasources(ctx.getModelControllerClient(), profile.getValue(ctx.getParsedCommandLine()), dsType);
            }}), "--jndi-name") {
            @Override
View Full Code Here

Examples of org.jboss.as.cli.impl.DefaultCompleter.CandidatesProvider

    }

    public class ValueCompleter extends DefaultCompleter {

        public ValueCompleter(final String attrName) {
            super(new CandidatesProvider() {
                @Override
                public List<String> getAllCandidates(CommandContext ctx) {
                    ModelControllerClient client = ctx.getModelControllerClient();
                    if(client == null) {
                        return Collections.emptyList();
View Full Code Here

Examples of org.jboss.as.cli.impl.DefaultCompleter.CandidatesProvider

    public NoArgDataSourceOperationHandler(CommandContext ctx, String command, final String dsType, String operationName) {
        super(ctx, command, true);
        this.dsType = dsType;
        this.operationName = operationName;

        profile = new ArgumentWithValue(this, new DefaultCompleter(new CandidatesProvider(){
            @Override
            public List<String> getAllCandidates(CommandContext ctx) {
                return Util.getNodeNames(ctx.getModelControllerClient(), null, "profile");
            }}), "--profile") {
            @Override
View Full Code Here

Examples of org.jboss.as.cli.impl.DefaultCompleter.CandidatesProvider

    public BaseDataSourceAddHandler(CommandContext ctx, String commandName, String dsType) {
        super(ctx, commandName, true);

        this.dsType = dsType;

        profile = new ArgumentWithValue(this, new DefaultCompleter(new CandidatesProvider(){
            @Override
            public List<String> getAllCandidates(CommandContext ctx) {
                return Util.getNodeNames(ctx.getModelControllerClient(), null, "profile");
            }}), "--profile") {
            @Override
View Full Code Here

Examples of org.jboss.as.cli.impl.DefaultCompleter.CandidatesProvider

        }
        };
        */

        RequestParamArgWithValue driverName = new RequiredRequestParamArg("driver-name", this,
                new DefaultCompleter(new CandidatesProvider() {
                    @Override
                    public List<String> getAllCandidates(CommandContext ctx) {
                        final String profileName;
                        if (ctx.isDomainMode()) {
                            profileName = profile.getValue(ctx.getParsedCommandLine());
View Full Code Here

Examples of org.jboss.as.cli.impl.DefaultCompleter.CandidatesProvider

            public boolean canAppearNext(CommandContext ctx) throws CommandFormatException {
                return "add".equals(action.getValue(ctx.getParsedCommandLine())) && super.canAppearNext(ctx);
            }
        };

        idProperty = new ArgumentWithValue(this, new DefaultCompleter(new CandidatesProvider(){
            @Override
            public List<String> getAllCandidates(CommandContext ctx) {
                List<Property> props;
                try {
                    props = getNodeProperties(ctx);
                } catch (CommandFormatException e) {
                    return Collections.emptyList();
                }

                final List<String> candidates = new ArrayList<String>();
                for(Property prop : props) {
                    final ModelNode value = prop.getValue();
                    if(value.has("access-type") && "read-only".equals(value.get("access-type").asString())) {
                        candidates.add(prop.getName());
                    }
                }
                return candidates;
            }}), "--property-id");
        idProperty.addRequiredPreceding(nodePath);

        commandName = new ArgumentWithValue(this, new DefaultCompleter(new CandidatesProvider(){

            private final DefaultCallbackHandler callback = new DefaultCallbackHandler();

            @Override
            public List<String> getAllCandidates(CommandContext ctx) {
View Full Code Here

Examples of org.jboss.as.cli.impl.DefaultCompleter.CandidatesProvider

    private List<String> addedServerGroups;
    private List<String> otherServerGroups;

    public DeploymentInfoHandler(CommandContext ctx) {
        super(ctx, "deployment-info", true);
        name = new ArgumentWithValue(this, new DefaultCompleter(new CandidatesProvider(){
            @Override
            public Collection<String> getAllCandidates(CommandContext ctx) {
                return Util.getDeployments(ctx.getModelControllerClient());
            }}), "--name");
    }
View Full Code Here

Examples of org.jboss.as.cli.impl.DefaultCompleter.CandidatesProvider

    private final ArgumentWithValue profile;

    public JmsTopicAddHandler(CommandContext ctx) {
        super(ctx, "jms-topic-add", true);

        profile = new ArgumentWithValue(this, new DefaultCompleter(new CandidatesProvider(){
            @Override
            public List<String> getAllCandidates(CommandContext ctx) {
                return Util.getNodeNames(ctx.getModelControllerClient(), null, "profile");
            }}), "--profile") {
            @Override
View Full Code Here

Examples of org.jboss.as.cli.impl.DefaultCompleter.CandidatesProvider

    private final ArgumentWithValue name;

    public JmsQueueRemoveHandler(CommandContext ctx) {
        super(ctx, "jms-queue-remove", true);

        profile = new ArgumentWithValue(this, new DefaultCompleter(new CandidatesProvider(){
            @Override
            public List<String> getAllCandidates(CommandContext ctx) {
                return Util.getNodeNames(ctx.getModelControllerClient(), null, "profile");
            }}), "--profile") {
            @Override
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.