Commit f9d7499a authored by Roberto Loayza's avatar Roberto Loayza

Update aplication.yml and update business parameter deploymente

parent 97cfff9b
......@@ -9,7 +9,7 @@
<packaging>jar</packaging>
<properties>
<xdf.version>3.3.0</xdf.version>
<xdf.version>3.4.0</xdf.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
......
package com.bytesw.bytebot.controller;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HealthController {
@GetMapping("/health")
public ResponseEntity<Void> health() {
return new ResponseEntity<>(HttpStatus.OK);
}
}
......@@ -229,7 +229,7 @@ public class ScheduleService implements SchedulingConfigurer {
}
if (!keys.isEmpty()) {
for (String keyTask: keys) {
if (!futureMap.get(keyTask).isCancelled()) {
if (futureMap.containsKey(keyTask)) {
ScheduledFuture future = futureMap.get(keyTask);
future.cancel(true);
futureMap.remove(keyTask);
......@@ -254,6 +254,8 @@ public class ScheduleService implements SchedulingConfigurer {
if (calendarException.isPresent()){
schedulerFlag = validateException(calendarException.get());
break;
} else {
schedulerFlag = true;
}
} else {
schedulerFlag = false;
......
......@@ -8,19 +8,19 @@ import org.springframework.stereotype.Component;
@Component
public class SFTPRoute extends RouteBuilder {
@Value("${application.bytebot-integration.ftp.username}")
@Value("${application.AVB-integration.ftp.username}")
private String username;
@Value("${application.bytebot-integration.ftp.password}")
@Value("${application.AVB-integration.ftp.password}")
private String password;
@Value("${application.bytebot-integration.ftp.directory:}")
@Value("${application.AVB-integration.ftp.directory:}")
private String directory;
@Value("${application.bytebot-integration.ftp.host}")
@Value("${application.AVB-integration.ftp.host}")
private String host;
@Value("${application.bytebot-integration.ftp.passiveMode:true}")
@Value("${application.AVB-integration.ftp.passiveMode:true}")
private boolean passiveMode;
@Value("${application.services.multi-tenant:false}")
......
......@@ -25,6 +25,7 @@ import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Optional;
......@@ -72,16 +73,16 @@ public class BucketService {
response.setMessage("NOT.FOUND.BUSINESS.PARAMETER");
throw new NotFoundException();
}
if (deployment.get().getDefaultValue() != null) {
bucketName = deployment.get().getDefaultValue();
} else {
List<BusinessParameterConfiguration> deploy = businessParameterConfigurationRepository
.findBusinessParameterConfigurationListByBusinessParameter(deployment.get().getId());
if (deploy.isEmpty()) {
response.setMessage("NOT.FOUND.BUSINESS.PARAMETER");
throw new NotFoundException();
}
List<BusinessParameterConfiguration> deploy = businessParameterConfigurationRepository
.findBusinessParameterConfigurationListByBusinessParameter(deployment.get().getId());
if (deploy.isEmpty()) {
response.setMessage("NOT.FOUND.BUSINESS.PARAMETER");
throw new NotFoundException();
}
if (deploy.get(0).getFrom().isAfter(OffsetDateTime.now())) {
bucketName = deploy.get(0).getValue();
} else if (deployment.get().getDefaultValue() != null) {
bucketName = deployment.get().getDefaultValue();
}
boolean result = false;
......
......@@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Optional;
......@@ -65,16 +66,16 @@ public class OrquestadorService {
response.setMessage("NOT.FOUND.BUSINESS.PARAMETER");
throw new NotFoundException();
}
if (deployment.get().getDefaultValue() != null) {
modeDeployment = deployment.get().getDefaultValue();
} else {
List<BusinessParameterConfiguration> deploy = businessParameterConfigurationRepository
.findBusinessParameterConfigurationListByBusinessParameter(deployment.get().getId());
if (deploy.isEmpty()) {
response.setMessage("NOT.FOUND.BUSINESS.PARAMETER");
throw new NotFoundException();
}
List<BusinessParameterConfiguration> deploy = businessParameterConfigurationRepository
.findBusinessParameterConfigurationListByBusinessParameter(deployment.get().getId());
if (deploy.isEmpty()) {
response.setMessage("NOT.FOUND.BUSINESS.PARAMETER");
throw new NotFoundException();
}
if (deploy.get(0).getFrom().isAfter(OffsetDateTime.now())) {
modeDeployment = deploy.get(0).getValue();
} else if (deployment.get().getDefaultValue() != null) {
modeDeployment = deployment.get().getDefaultValue();
}
//Valida y guarda en base de datos
response = fileManagementService.saveFile(uuid, file);
......@@ -138,16 +139,16 @@ public class OrquestadorService {
response.setMessage("NOT.FOUND.BUSINESS.PARAMETER");
throw new NotFoundException();
}
if (deployment.get().getDefaultValue() != null) {
modeDeployment = deployment.get().getDefaultValue();
} else {
List<BusinessParameterConfiguration> deploy = businessParameterConfigurationRepository
.findBusinessParameterConfigurationListByBusinessParameter(deployment.get().getId());
if (deploy.isEmpty()) {
response.setMessage("NOT.FOUND.BUSINESS.PARAMETER");
throw new NotFoundException();
}
List<BusinessParameterConfiguration> deploy = businessParameterConfigurationRepository
.findBusinessParameterConfigurationListByBusinessParameter(deployment.get().getId());
if (deploy.isEmpty()) {
response.setMessage("NOT.FOUND.BUSINESS.PARAMETER");
throw new NotFoundException();
}
if (deploy.get(0).getFrom().isAfter(OffsetDateTime.now())) {
modeDeployment = deploy.get(0).getValue();
} else if (deployment.get().getDefaultValue() != null) {
modeDeployment = deployment.get().getDefaultValue();
}
if (model.getStatus().equals(StatusBcdEnum.CARGADO.getName())) {
......
spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration
server:
servlet.context-path: ${APPLICATION_PATH:/bytebot}
servlet.context-path: ${APPLICATION_PATH:/AVB}
port: ${APPLICATION_PORT:9077}
web:
#static-content-location: file:/home/mgutierrez/Documentos/Bytesw/bytebot-workspace/dist/bytebot-html/
static-content-location: file:/home/mgutierrez/Descargas/dist/bytebot-html/
static-content-location: file:/home/mgutierrez/Descargas/dist-20/dist/bytebot-html/
#NOTA debe terminar con /
security:
......@@ -72,7 +72,7 @@ application:
messaging:
queue-test: action_queue.fifo
topic-test: topic-test
bytebot-integration:
AVB-integration:
ftp:
host: localhost
username: ftp
......@@ -129,7 +129,7 @@ spring:
hikari.registerMbeans: true
security:
basepath: http://localhost:9077/bytebot
basepath: http://localhost:9077/AVB
provider: byte # oracle, amazon
oauth2-client:
clientId: xdf-client
......@@ -156,7 +156,7 @@ spring:
testWhileIdle: true
hikari.registerMbeans: true
security:
basepath: http://localhost:9077/bytebot
basepath: http://localhost:9077/AVB
provider: byte # oracle, amazon
oauth2-client:
clientId: xdf-client
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment