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
b0406450
Commit
b0406450
authored
Oct 31, 2015
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.2.x'
parents
215f2a1d
6967ddd5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
StatusUpdater.java
...ava/de/codecentric/boot/admin/registry/StatusUpdater.java
+8
-9
No files found.
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/registry/StatusUpdater.java
View file @
b0406450
...
...
@@ -22,7 +22,6 @@ import org.slf4j.LoggerFactory;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.context.ApplicationEventPublisherAware
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.client.RestClientException
;
import
org.springframework.web.client.RestTemplate
;
import
de.codecentric.boot.admin.event.ClientApplicationStatusChangedEvent
;
...
...
@@ -34,7 +33,7 @@ import de.codecentric.boot.admin.registry.store.ApplicationStore;
* The StatusUpdater is responsible for updatig the status of all or a single application querying
* the healthUrl.
*
* @author Johannes
Stelz
er
* @author Johannes
Edmei
er
*/
public
class
StatusUpdater
implements
ApplicationEventPublisherAware
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
StatusUpdater
.
class
);
...
...
@@ -70,8 +69,8 @@ public class StatusUpdater implements ApplicationEventPublisherAware {
store
.
save
(
newState
);
if
(!
newStatus
.
equals
(
oldStatus
))
{
publisher
.
publishEvent
(
new
ClientApplicationStatusChangedEvent
(
newState
,
oldStatus
,
newStatus
));
publisher
.
publishEvent
(
new
ClientApplicationStatusChangedEvent
(
newState
,
oldStatus
,
new
Status
));
}
}
...
...
@@ -80,19 +79,19 @@ public class StatusUpdater implements ApplicationEventPublisherAware {
try
{
@SuppressWarnings
(
"unchecked"
)
ResponseEntity
<
Map
<
String
,
String
>>
response
=
restTemplate
.
getForEntity
(
application
.
getHealthUrl
(),
(
Class
<
Map
<
String
,
String
>>)
(
Class
<?>)
Map
.
class
);
ResponseEntity
<
Map
<
String
,
Object
>>
response
=
restTemplate
.
getForEntity
(
application
.
getHealthUrl
(),
(
Class
<
Map
<
String
,
Object
>>)
(
Class
<?>)
Map
.
class
);
LOGGER
.
debug
(
"/health for {} responded with {}"
,
application
,
response
);
if
(
response
.
hasBody
()
&&
response
.
getBody
().
get
(
"status"
)
!=
null
)
{
return
StatusInfo
.
valueOf
(
response
.
getBody
().
get
(
"status"
));
if
(
response
.
hasBody
()
&&
response
.
getBody
().
get
(
"status"
)
instanceof
String
)
{
return
StatusInfo
.
valueOf
(
(
String
)
response
.
getBody
().
get
(
"status"
));
}
else
if
(
response
.
getStatusCode
().
is2xxSuccessful
())
{
return
StatusInfo
.
ofUp
();
}
else
{
return
StatusInfo
.
ofDown
();
}
}
catch
(
RestClient
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
LOGGER
.
warn
(
"Couldn't retrieve status for {}"
,
application
,
ex
);
return
StatusInfo
.
ofOffline
();
}
...
...
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