Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ejercicio2-framework-back
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Josue
ejercicio2-framework-back
Commits
4e812b11
Commit
4e812b11
authored
Jan 10, 2022
by
Roberto Loayza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update parameter and channel agent
parent
f9d7499a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
11 deletions
+28
-11
ScheduleService.java
...com/bytesw/bytebot/etl/batch/service/ScheduleService.java
+14
-2
StatusConverter.java
.../com/bytesw/bytebot/model/converters/StatusConverter.java
+3
-0
AgentService.java
src/main/java/com/bytesw/bytebot/service/AgentService.java
+5
-2
application.yml
src/main/resources/application.yml
+6
-7
No files found.
src/main/java/com/bytesw/bytebot/etl/batch/service/ScheduleService.java
View file @
4e812b11
...
...
@@ -220,6 +220,18 @@ public class ScheduleService implements SchedulingConfigurer {
.
schedule
(()
->
processDeleteData
(
tenant
,
taskRegister
,
model
.
getCalendarID
().
trim
()),
trigger
));
}
public
void
cancelTaskDelete
(
Long
id
)
{
String
keyDataSens
=
String
.
format
(
"deleteSensible-%s-%s"
,
tenant
,
id
);
if
(
futureMap
.
containsKey
(
keyDataSens
))
{
ScheduledFuture
future
=
futureMap
.
get
(
keyDataSens
);
future
.
cancel
(
true
);
futureMap
.
remove
(
keyDataSens
);
if
(
keys
.
contains
(
keyDataSens
))
{
keys
.
remove
(
keyDataSens
);
}
}
}
public
void
cancelTask
(
SchedulerTask
model
)
{
String
key
=
String
.
format
(
"%s-%s-%s"
,
tenant
,
model
.
getCalendarID
().
trim
(),
model
.
getId
());
if
(
futureMap
.
containsKey
(
key
)){
...
...
@@ -268,8 +280,8 @@ public class ScheduleService implements SchedulingConfigurer {
String
keyDataSens
=
""
;
for
(
DeleteDataSensBean
data
:
deleteDataSensBeans
)
{
Agent
agent
=
agentRepository
.
findById
(
data
.
getAgenId
()).
get
();
Trigger
trigger
=
new
CronTrigger
(
cronExpression
,
timeZone
);
keyDataSens
=
String
.
format
(
"deleteSensible-%s-%s"
,
tenantIdentifier
,
data
.
get
Value
());
Trigger
trigger
=
new
CronTrigger
(
"0 0/1 * * * *"
,
timeZone
);
keyDataSens
=
String
.
format
(
"deleteSensible-%s-%s"
,
tenantIdentifier
,
data
.
get
AgenId
());
if
(!
futureMap
.
containsKey
(
keyDataSens
))
{
keys
.
add
(
keyDataSens
);
futureMap
.
put
(
keyDataSens
,
taskRegistrar
.
getScheduler
()
...
...
src/main/java/com/bytesw/bytebot/model/converters/StatusConverter.java
View file @
4e812b11
...
...
@@ -21,6 +21,9 @@ public class StatusConverter implements AttributeConverter<StatusEnum, String> {
@Override
public
String
convertToDatabaseColumn
(
StatusEnum
value
)
{
if
(
value
==
null
)
{
return
null
;
}
return
value
.
getName
();
}
...
...
src/main/java/com/bytesw/bytebot/service/AgentService.java
View file @
4e812b11
package
com
.
bytesw
.
bytebot
.
service
;
import
com.bytesw.bytebot.bean.*
;
import
com.bytesw.bytebot.etl.batch.service.ScheduleService
;
import
com.bytesw.bytebot.model.*
;
import
com.bytesw.bytebot.jdbc.AgentJDBCRepository
;
import
com.bytesw.bytebot.model.enums.*
;
...
...
@@ -60,6 +61,9 @@ public class AgentService extends CustomPaginationService<Agent> {
@Autowired
private
ProducerTemplate
producerTemplate
;
@Autowired
private
ScheduleService
scheduleService
;
public
List
<
DeploymentChannelParamValueBean
>
GetKeysFromAgents
(
AgentStatusEnum
status
){
List
<
DeploymentChannelParamValueBean
>
values
=
agentJDBCRepository
.
getCredentialsFromAgentStatus
(
status
.
getName
());
...
...
@@ -147,7 +151,6 @@ public class AgentService extends CustomPaginationService<Agent> {
if
(
agent
.
getCountryId
()
!=
null
)
{
Optional
<
Country
>
countryFound
=
countryRepository
.
findById
(
agent
.
getCountryId
());
if
(
countryFound
.
isPresent
())
{
agentBD
.
setCountry
(
countryFound
.
get
());
}
...
...
@@ -435,7 +438,7 @@ public class AgentService extends CustomPaginationService<Agent> {
if
(
agentFound
.
isPresent
())
{
Agent
agent
=
agentFound
.
get
();
agent
.
setStatus
(
AgentStatusEnum
.
DELETED
);
scheduleService
.
cancelTaskDelete
(
id
);
agentRepository
.
save
(
agent
);
}
}
...
...
src/main/resources/application.yml
View file @
4e812b11
...
...
@@ -5,8 +5,7 @@ server:
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-20/dist/bytebot-html/
#NOTA debe terminar con /
static-content-location
:
file:/home/mgutierrez/Descargas/dist/bytebot-html/
security
:
...
...
@@ -28,7 +27,7 @@ application:
byte-bot
:
batch
:
chunk
:
10
cron
:
0
/50 *
* * * *
cron
:
0
0/1
* * * *
show-side-bar
:
false
test
:
ENC(OEchnTXpIZnCVdPNthgCZBfQjMt1AUS1)
name
:
xdf-example
...
...
@@ -98,8 +97,8 @@ application:
zone
:
TimeZone
default
:
America/Mexico_City
bucket
:
deployment
:
De
spliegu
e
parameter
:
Bucket
deployment
:
De
ployMod
e
parameter
:
KnowledgeBase
Bucket
tenant
:
T186A1
region
:
us-east-1
fileBucket
:
KB_Files
...
...
@@ -118,7 +117,7 @@ spring:
datasource
:
database-type
:
postgres
schemaName
:
avb
url
:
jdbc:postgresql://192.168.0.119:5432/bytebot?useSSL=false¤tSchema=avb
url
:
jdbc:postgresql://192.168.0.119:5432/bytebot?useSSL=false¤tSchema=avb
_hdi
driverClassName
:
'
org.postgresql.Driver'
username
:
postgres
password
:
postgres
...
...
@@ -146,7 +145,7 @@ spring:
datasource
:
database-type
:
postgres
schemaName
:
avb
url
:
jdbc:postgresql://192.168.0.119:5432/bytebot?useSSL=false¤tSchema=avb
url
:
jdbc:postgresql://192.168.0.119:5432/bytebot?useSSL=false¤tSchema=avb
_hdi
driverClassName
:
'
org.postgresql.Driver'
username
:
postgres
password
:
postgres
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment