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
8cb5795d
Commit
8cb5795d
authored
Dec 24, 2016
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename copying factory method to 'copyOf
parent
c15b3bbc
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
6 deletions
+7
-6
ApplicationDiscoveryListener.java
...ic/boot/admin/discovery/ApplicationDiscoveryListener.java
+1
-1
Application.java
...ain/java/de/codecentric/boot/admin/model/Application.java
+1
-1
ApplicationRegistry.java
.../codecentric/boot/admin/registry/ApplicationRegistry.java
+1
-1
StatusUpdater.java
...ava/de/codecentric/boot/admin/registry/StatusUpdater.java
+1
-1
RegistryController.java
...decentric/boot/admin/registry/web/RegistryController.java
+1
-1
ApplicationTest.java
...java/de/codecentric/boot/admin/model/ApplicationTest.java
+2
-1
No files found.
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/discovery/ApplicationDiscoveryListener.java
View file @
8cb5795d
...
...
@@ -110,7 +110,7 @@ public class ApplicationDiscoveryListener {
protected
String
register
(
ServiceInstance
instance
)
{
try
{
Application
application
=
converter
.
convert
(
instance
);
application
=
Application
.
c
reate
(
application
).
withSource
(
SOURCE
).
build
();
application
=
Application
.
c
opyOf
(
application
).
withSource
(
SOURCE
).
build
();
if
(
application
!=
null
)
{
LOGGER
.
debug
(
"Registering discovered application {}"
,
application
);
return
registry
.
register
(
application
).
getId
();
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/model/Application.java
View file @
8cb5795d
...
...
@@ -72,7 +72,7 @@ public class Application implements Serializable {
return
new
Builder
(
name
);
}
public
static
Builder
c
reate
(
Application
application
)
{
public
static
Builder
c
opyOf
(
Application
application
)
{
return
new
Builder
(
application
);
}
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/registry/ApplicationRegistry.java
View file @
8cb5795d
...
...
@@ -72,7 +72,7 @@ public class ApplicationRegistry implements ApplicationEventPublisherAware {
StatusInfo
existingStatusInfo
=
getExistingStatusInfo
(
applicationId
);
Application
registering
=
Application
.
c
reate
(
application
).
withId
(
applicationId
)
Application
registering
=
Application
.
c
opyOf
(
application
).
withId
(
applicationId
)
.
withStatusInfo
(
existingStatusInfo
).
build
();
Application
replaced
=
store
.
save
(
registering
);
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/registry/StatusUpdater.java
View file @
8cb5795d
...
...
@@ -73,7 +73,7 @@ public class StatusUpdater implements ApplicationEventPublisherAware {
StatusInfo
oldStatus
=
application
.
getStatusInfo
();
StatusInfo
newStatus
=
queryStatus
(
application
);
Application
newState
=
Application
.
c
reate
(
application
).
withStatusInfo
(
newStatus
).
build
();
Application
newState
=
Application
.
c
opyOf
(
application
).
withStatusInfo
(
newStatus
).
build
();
store
.
save
(
newState
);
if
(!
newStatus
.
equals
(
oldStatus
))
{
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/registry/web/RegistryController.java
View file @
8cb5795d
...
...
@@ -56,7 +56,7 @@ public class RegistryController {
*/
@RequestMapping
(
method
=
RequestMethod
.
POST
)
public
ResponseEntity
<
Application
>
register
(
@RequestBody
Application
application
)
{
application
=
Application
.
c
reate
(
application
).
withSource
(
"http-api"
).
build
();
application
=
Application
.
c
opyOf
(
application
).
withSource
(
"http-api"
).
build
();
LOGGER
.
debug
(
"Register application {}"
,
application
.
toString
());
Application
registeredApp
=
registry
.
register
(
application
);
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
registeredApp
);
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/model/ApplicationTest.java
View file @
8cb5795d
...
...
@@ -110,7 +110,7 @@ public class ApplicationTest {
Application
app
=
Application
.
create
(
"App"
).
withId
(
"-id-"
).
withHealthUrl
(
"http://health"
)
.
withManagementUrl
(
"http://mgmgt"
).
withServiceUrl
(
"http://svc"
)
.
withStatusInfo
(
StatusInfo
.
ofUp
()).
build
();
Application
copy
=
Application
.
c
reate
(
app
).
build
();
Application
copy
=
Application
.
c
opyOf
(
app
).
build
();
assertThat
(
app
,
is
(
copy
));
}
}
\ No newline at end of file
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