New Instance type: Batch Manager
This commit is contained in:
committed by
Arnold Gálovics
parent
67850e3889
commit
ffb9147770
+3
-10
@@ -55,18 +55,11 @@ public class FineractProperties {
|
||||
|
||||
private boolean readEnabled;
|
||||
private boolean writeEnabled;
|
||||
private boolean batchEnabled;
|
||||
private boolean batchWorkerEnabled;
|
||||
private boolean batchManagerEnabled;
|
||||
|
||||
public boolean isReadOnlyMode() {
|
||||
return readEnabled && !writeEnabled && !batchEnabled;
|
||||
}
|
||||
|
||||
public boolean isWriteOnlyMode() {
|
||||
return !readEnabled && writeEnabled && !batchEnabled;
|
||||
}
|
||||
|
||||
public boolean isBatchOnlyMode() {
|
||||
return !readEnabled && !writeEnabled && batchEnabled;
|
||||
return readEnabled && !writeEnabled && !batchWorkerEnabled && !batchManagerEnabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -71,7 +71,8 @@ public class InstanceModeApiResource implements InitializingBean {
|
||||
log.warn("------------------------------------------------------------");
|
||||
fineractProperties.getMode().setReadEnabled(request.isReadEnabled());
|
||||
fineractProperties.getMode().setWriteEnabled(request.isWriteEnabled());
|
||||
fineractProperties.getMode().setBatchEnabled(request.isBatchEnabled());
|
||||
fineractProperties.getMode().setBatchWorkerEnabled(request.isBatchWorkerEnabled());
|
||||
fineractProperties.getMode().setBatchManagerEnabled(request.isBatchManagerEnabled());
|
||||
return Response.ok().build();
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -34,6 +34,8 @@ public class InstanceModeApiResourceSwagger {
|
||||
@Schema(required = true, example = "true")
|
||||
public boolean writeEnabled;
|
||||
@Schema(required = true, example = "true")
|
||||
public boolean batchEnabled;
|
||||
public boolean batchWorkerEnabled;
|
||||
@Schema(required = true, example = "true")
|
||||
public boolean batchManagerEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ import org.springframework.web.filter.OncePerRequestFilter;
|
||||
public class FineractInstanceModeApiFilter extends OncePerRequestFilter {
|
||||
|
||||
private static final List<ExceptionListItem> EXCEPTION_LIST = List.of(
|
||||
item(FineractProperties.FineractModeProperties::isBatchEnabled, pi -> pi.startsWith("/jobs")),
|
||||
item(FineractProperties.FineractModeProperties::isBatchManagerEnabled, pi -> pi.startsWith("/jobs")),
|
||||
item(p -> true, pi -> pi.startsWith("/instance-mode")));
|
||||
|
||||
private final FineractProperties fineractProperties;
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ public class SchedulerJobApiResource {
|
||||
@QueryParam(SchedulerJobApiConstants.COMMAND) @Parameter(description = "command") final String commandParam) {
|
||||
// check the logged in user have permissions to execute scheduler jobs
|
||||
Response response;
|
||||
if (fineractProperties.getMode().isBatchEnabled()) {
|
||||
if (fineractProperties.getMode().isBatchManagerEnabled()) {
|
||||
final boolean hasNotPermission = this.context.authenticatedUser().hasNotPermissionForAnyOf("ALL_FUNCTIONS",
|
||||
"EXECUTEJOB_SCHEDULER");
|
||||
if (hasNotPermission) {
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi
|
||||
@PostConstruct
|
||||
public void loadAllJobs() {
|
||||
// If the instance is not Batch Enabled will not load the Jobs
|
||||
if (!fineractProperties.getMode().isBatchEnabled()) {
|
||||
if (!fineractProperties.getMode().isBatchManagerEnabled()) {
|
||||
return;
|
||||
}
|
||||
final List<FineractPlatformTenant> allTenants = this.tenantDetailsService.findAllTenants();
|
||||
|
||||
Reference in New Issue
Block a user