use of org.gluu.oxtrust.model.GluuConfiguration in project oxTrust by GluuFederation.
the class StatusCheckerDaily method processInt.
/**
* Gather periodically site and server status
*
* @param when
* Date
* @param interval
* Interval
*/
private void processInt() {
log.debug("Starting daily status checker");
AppConfiguration appConfiguration = configurationFactory.getAppConfiguration();
if (!appConfiguration.isUpdateStatus()) {
return;
}
log.debug("Getting data from ldap");
GluuConfiguration configuration = configurationService.getConfiguration();
GluuOxTrustStat oxTrustStat = configurationService.getOxtrustStat();
oxTrustStat.setGroupCount(String.valueOf(groupService.countGroups()));
oxTrustStat.setPersonCount(String.valueOf(personService.countPersons()));
Date currentDateTime = new Date();
configuration.setLastUpdate(currentDateTime);
configurationService.updateConfiguration(configuration);
configurationService.updateOxtrustStat(oxTrustStat);
log.debug("Daily Configuration status update finished");
}
use of org.gluu.oxtrust.model.GluuConfiguration in project oxTrust by GluuFederation.
the class AuthenticationMethodWebResource method getCurrentAuthentication.
@GET
@Operation(summary = "Get current authentication methods", description = "Get current authentication methods")
@ApiResponses(value = { @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = AuthenticationMethod.class)), description = Constants.RESULT_SUCCESS), @ApiResponse(responseCode = "500", description = "Server error") })
@ProtectedApi(scopes = { READ_ACCESS })
public Response getCurrentAuthentication() {
log(logger, "Processing getCurrentAuthentication()");
try {
GluuConfiguration configuration = configurationService.getConfiguration();
AuthenticationMethod method = new AuthenticationMethod();
method.setDefaultAcr(configuration.getAuthenticationMode());
method.setOxtrustAcr(configuration.getOxTrustAuthenticationMode());
return Response.ok(method).build();
} catch (Exception e) {
log(logger, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
}
}
use of org.gluu.oxtrust.model.GluuConfiguration in project oxTrust by GluuFederation.
the class OxtrustSettingWebResource method updateOxtrustSetting.
@PUT
@Operation(summary = "Update oxtrust settings", description = "Update oxtrust settings")
@ApiResponses(value = { @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = OxtrustSetting.class)), description = Constants.RESULT_SUCCESS), @ApiResponse(responseCode = "404", description = "Not found"), @ApiResponse(responseCode = "500", description = "Server error") })
@ProtectedApi(scopes = { WRITE_ACCESS })
public Response updateOxtrustSetting(OxtrustSetting oxtrustSetting) {
try {
log(logger, "Processing oxtrust settings update request");
Preconditions.checkNotNull(oxtrustSetting, "Attempt to update null oxtrust settings");
GluuConfiguration configurationUpdate = configurationService.getConfiguration();
configurationUpdate.setScimEnabled(Boolean.valueOf(oxtrustSetting.getEnableScim()));
configurationUpdate.setPassportEnabled(Boolean.valueOf(oxtrustSetting.getEnablePassport()));
configurationUpdate.setPasswordResetAllowed(Boolean.valueOf(oxtrustSetting.getAllowPasswordReset()));
configurationUpdate.setProfileManagment(Boolean.valueOf(oxtrustSetting.getAllowProfileManagement()));
configurationService.updateConfiguration(configurationUpdate);
return Response.ok(Constants.RESULT_SUCCESS).build();
} catch (Exception e) {
log(logger, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
}
}
use of org.gluu.oxtrust.model.GluuConfiguration in project oxTrust by GluuFederation.
the class OxtrustSettingWebResource method getOxtrustSettings.
@GET
@Operation(summary = "Get oxtrust settings", description = "Get oxtrust settings")
@ApiResponses(value = { @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = OxtrustSetting.class)), description = Constants.RESULT_SUCCESS), @ApiResponse(responseCode = "500", description = "Server error") })
@ProtectedApi(scopes = { READ_ACCESS })
public Response getOxtrustSettings() {
try {
log(logger, "Processing oxtrust settings retrieval request");
GluuConfiguration configurationUpdate = configurationService.getConfiguration();
OxtrustSetting setting = new OxtrustSetting();
setting.setAllowPasswordReset(String.valueOf(configurationUpdate.isPasswordResetAllowed()));
setting.setAllowProfileManagement(String.valueOf(configurationUpdate.isProfileManagment()));
setting.setEnablePassport(String.valueOf(configurationUpdate.isPassportEnabled()));
setting.setEnableScim(String.valueOf(configurationUpdate.isScimEnabled()));
return Response.ok(setting).build();
} catch (Exception e) {
log(logger, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
}
}
use of org.gluu.oxtrust.model.GluuConfiguration in project oxTrust by GluuFederation.
the class JsonConfigurationService method saveOxMemCacheConfiguration.
public boolean saveOxMemCacheConfiguration(CacheConfiguration cachedConfiguration) {
encrypPassword(cachedConfiguration.getRedisConfiguration());
GluuConfiguration gluuConfiguration = configurationService.getConfiguration();
gluuConfiguration.setCacheConfiguration(cachedConfiguration);
configurationService.updateConfiguration(gluuConfiguration);
return true;
}
Aggregations