public StatusResourceResponse get(Context context, Request request, Response response, Variant variant)
throws ResourceException
{
final SystemStatus status = systemStatusProvider.get();
final StatusResource resource = new StatusResource();
resource.setAppName(status.getAppName());
resource.setFormattedAppName(status.getFormattedAppName());
resource.setVersion(status.getVersion());
resource.setApiVersion(status.getApiVersion());
resource.setEditionLong(status.getEditionLong());
resource.setEditionShort(status.getEditionShort());
resource.setAttributionsURL(status.getAttributionsURL());
resource.setPurchaseURL(status.getPurchaseURL());
resource.setUserLicenseURL(status.getUserLicenseURL());
resource.setState(status.getState().toString());
resource.setInitializedAt(status.getInitializedAt());
resource.setStartedAt(status.getStartedAt());
resource.setLastConfigChange(status.getLastConfigChange());
resource.setFirstStart(status.isFirstStart());
resource.setInstanceUpgraded(status.isInstanceUpgraded());
resource.setConfigurationUpgraded(status.isConfigurationUpgraded());
resource.setErrorCause(spit(status.getErrorCause()));
// if ( status.getConfigurationValidationResponse() != null )
// {
// resource.setConfigurationValidationResponse( new StatusConfigurationValidationResponse() );
//
// resource.getConfigurationValidationResponse().setValid(
// status.getConfigurationValidationResponse().isValid() );
//
// resource.getConfigurationValidationResponse().setModified(
// status.getConfigurationValidationResponse().isModified() );
//
// for ( ValidationMessage msg : status.getConfigurationValidationResponse().getValidationErrors() )
// {
// resource.getConfigurationValidationResponse().addValidationError( msg.toString() );
// }
// for ( ValidationMessage msg : status.getConfigurationValidationResponse().getValidationWarnings() )
// {
// resource.getConfigurationValidationResponse().addValidationWarning( msg.toString() );
// }
// }
final Form form = request.getResourceRef().getQueryAsForm();
if (form.getFirst("perms") != null) {
resource.setClientPermissions(getClientPermissions(request));
}
resource.setBaseUrl(BaseUrlHolder.get());
resource.setLicenseInstalled(status.isLicenseInstalled());
resource.setLicenseExpired(status.isLicenseExpired());
resource.setTrialLicense(status.isTrialLicense());
StatusResourceResponse result = new StatusResourceResponse();
result.setData(resource);