Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAYARA-1904 Add jndi to get set ordinal commands #1833

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
})
public class GetConfigOrdinal implements AdminCommand {

@Param(acceptableValues = "domain,config,server,application,module,cluster", defaultValue = "domain")
@Param(optional = true, acceptableValues = "domain,config,server,application,module,cluster,jndi", defaultValue = "domain")
String source;

@Param(optional = true, defaultValue = "server") // if no target is specified it will be the DAS
Expand Down Expand Up @@ -116,6 +116,9 @@ public void execute(AdminCommandContext context) {
case "cluster": {
result = serviceConfig.getClusterOrdinality();
break;
}case "jndi": {
result = serviceConfig.getJNDIOrdinality();
break;
}
}
context.getActionReport().setMessage(result.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
})
public class GetConfigProperty implements AdminCommand {

@Param(acceptableValues = "domain,config,server,application,module,cluster", defaultValue = "domain")
@Param(optional = true, acceptableValues = "domain,config,server,application,module,cluster", defaultValue = "domain")
String source;

@Param(optional = true, defaultValue = "server") // if no target is specified it will be the DAS
Expand Down Expand Up @@ -125,7 +125,7 @@ public void execute(AdminCommandContext context) {
}
case "module": {
if (sourceName == null || moduleName == null) {
context.getActionReport().failure(Logger.getLogger(SetConfigProperty.class.getName()), "sourceName and moduleName are required parameters module is the source");
context.getActionReport().failure(Logger.getLogger(SetConfigProperty.class.getName()), "sourceName and moduleName are required parameters if module is the source. The sourceName should be the name of the application where the module is deployed.");
} else {
result = service.getModuleProperty(sourceName, moduleName, propertyName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public class SetConfigOrdinal implements AdminCommand {
@Param()
int ordinal;

@Param(acceptableValues = "domain,config,server,application,module,cluster", defaultValue = "domain")
@Param(optional = true, acceptableValues = "domain,config,server,application,module,cluster,jndi", defaultValue = "domain")
String source;

@Param (optional = true, defaultValue = "server") // if no target is specified it will be the DAS
Expand Down Expand Up @@ -128,7 +128,10 @@ public Object run(MicroprofileConfigConfiguration config) {
config.setClusterOrdinality(ordinal);
break;
}

case "jndi": {
config.setJNDIOrdinality(ordinal);
break;
}
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
})
public class SetConfigProperty implements AdminCommand {

@Param(acceptableValues = "domain,config,server,application,module,cluster", defaultValue = "domain")
@Param(optional = true, acceptableValues = "domain,config,server,application,module,cluster", defaultValue = "domain")
String source;

@Param(optional = true, defaultValue = "server") // if no target is specified it will be the DAS
Expand Down Expand Up @@ -127,7 +127,7 @@ public void execute(AdminCommandContext context) {
}
case "module": {
if (sourceName == null || moduleName == null) {
context.getActionReport().failure(Logger.getLogger(SetConfigProperty.class.getName()), "sourceName and moduleName are required parameters module is the source");
context.getActionReport().failure(Logger.getLogger(SetConfigProperty.class.getName()), "sourceName and moduleName are required parameters if module is the source. The sourceName should be the name of the application where the module is deployed.");
} else {
service.setModuleProperty(sourceName, moduleName, propertyName, propertyValue);
}
Expand Down