use of fish.payara.nucleus.phonehome.PhoneHomeRuntimeConfiguration in project Payara by payara.
the class DisablePhoneHome method execute.
@Override
public void execute(AdminCommandContext context) {
final ActionReport report = context.getActionReport();
try {
ConfigSupport.apply(new SingleConfigCode<PhoneHomeRuntimeConfiguration>() {
@Override
public Object run(PhoneHomeRuntimeConfiguration configurationProxy) throws PropertyVetoException, TransactionFailure {
configurationProxy.setEnabled("false");
return configurationProxy;
}
}, configuration);
} catch (TransactionFailure ex) {
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
}
service.stop();
report.setMessage("Phone Home Service is disabled");
report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
}
use of fish.payara.nucleus.phonehome.PhoneHomeRuntimeConfiguration in project Payara by payara.
the class EnablePhoneHome method execute.
@Override
public void execute(AdminCommandContext context) {
final ActionReport report = context.getActionReport();
try {
ConfigSupport.apply(new SingleConfigCode<PhoneHomeRuntimeConfiguration>() {
@Override
public Object run(PhoneHomeRuntimeConfiguration configurationProxy) throws PropertyVetoException, TransactionFailure {
configurationProxy.setEnabled("true");
return configurationProxy;
}
}, configuration);
} catch (TransactionFailure ex) {
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
}
service.start();
report.setMessage("Phone Home Service is enabled");
report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
}
Aggregations