public BaseDataSourceModifyHandler(String commandName, final String dsType) {
super(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.getParsedArguments()), dsType);
}}), "--jndi-name") {
@Override