Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-admin
Project
Overview
Details
Activity
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
openSource
spring-boot-admin
Commits
7f605ff0
Commit
7f605ff0
authored
Jan 25, 2017
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make methods in StatusUpdater protected.
For easier cusotmization. E.g. converting some of the data fechted from the /info endpoint or to filter it.
parent
ab1079f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
StatusUpdater.java
...ava/de/codecentric/boot/admin/registry/StatusUpdater.java
+13
-5
No files found.
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/registry/StatusUpdater.java
View file @
7f605ff0
...
...
@@ -80,12 +80,12 @@ public class StatusUpdater implements ApplicationEventPublisherAware {
}
}
pr
ivate
Info
queryInfo
(
Application
application
)
{
pr
otected
Info
queryInfo
(
Application
application
)
{
try
{
ResponseEntity
<
Map
<
String
,
Serializable
>>
response
=
applicationOps
.
getInfo
(
application
);
if
(
response
.
getStatusCode
().
is2xxSuccessful
()
&&
response
.
hasBody
())
{
return
Info
.
from
(
response
.
getBody
()
);
return
convertInfo
(
response
);
}
else
{
LOGGER
.
info
(
"Couldn't retrieve info for {}: {} - {}"
,
application
,
response
.
getStatusCode
(),
response
.
getBody
());
...
...
@@ -93,10 +93,18 @@ public class StatusUpdater implements ApplicationEventPublisherAware {
}
}
catch
(
Exception
ex
)
{
LOGGER
.
warn
(
"Couldn't retrieve info for {}"
,
application
,
ex
);
return
Info
.
empty
(
);
return
convertInfo
(
ex
);
}
}
protected
Info
convertInfo
(
ResponseEntity
<
Map
<
String
,
Serializable
>>
response
)
{
return
Info
.
from
(
response
.
getBody
());
}
protected
Info
convertInfo
(
Exception
ex
)
{
return
Info
.
empty
();
}
protected
StatusInfo
queryStatus
(
Application
application
)
{
LOGGER
.
trace
(
"Updating status for {}"
,
application
);
try
{
...
...
@@ -111,7 +119,7 @@ public class StatusUpdater implements ApplicationEventPublisherAware {
}
}
pr
ivate
StatusInfo
convertStatusInfo
(
ResponseEntity
<
Map
<
String
,
Serializable
>>
response
)
{
pr
otected
StatusInfo
convertStatusInfo
(
ResponseEntity
<
Map
<
String
,
Serializable
>>
response
)
{
if
(
response
.
hasBody
()
&&
response
.
getBody
().
get
(
"status"
)
instanceof
String
)
{
return
StatusInfo
.
valueOf
((
String
)
response
.
getBody
().
get
(
"status"
),
response
.
getBody
());
...
...
@@ -128,7 +136,7 @@ public class StatusUpdater implements ApplicationEventPublisherAware {
return
StatusInfo
.
ofDown
(
details
);
}
pr
ivate
StatusInfo
convertStatusInfo
(
Exception
ex
)
{
pr
otected
StatusInfo
convertStatusInfo
(
Exception
ex
)
{
Map
<
String
,
Serializable
>
details
=
new
HashMap
<>();
details
.
put
(
"message"
,
ex
.
getMessage
());
details
.
put
(
"exception"
,
ex
.
getClass
().
getName
());
...
...
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