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
912d4f73
Commit
912d4f73
authored
Mar 04, 2015
by
Johannes Stelzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove conflict detection (what is it really good for?)
parent
8e2ce75d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
38 deletions
+20
-38
RegistryController.java
...codecentric/boot/admin/controller/RegistryController.java
+0
-5
ApplicationIdGenerator.java
...decentric/boot/admin/registry/ApplicationIdGenerator.java
+1
-1
ApplicationRegistry.java
.../codecentric/boot/admin/registry/ApplicationRegistry.java
+1
-2
ApplicationRegistryConflictException.java
.../admin/registry/ApplicationRegistryConflictException.java
+0
-27
HazelcastApplicationStore.java
.../boot/admin/registry/store/HazelcastApplicationStore.java
+16
-1
SimpleApplicationStore.java
...ric/boot/admin/registry/store/SimpleApplicationStore.java
+1
-1
RegistryControllerTest.java
...centric/boot/admin/controller/RegistryControllerTest.java
+1
-1
No files found.
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/controller/RegistryController.java
View file @
912d4f73
...
@@ -30,7 +30,6 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -30,7 +30,6 @@ import org.springframework.web.bind.annotation.RestController;
import
de.codecentric.boot.admin.model.Application
;
import
de.codecentric.boot.admin.model.Application
;
import
de.codecentric.boot.admin.registry.ApplicationRegistry
;
import
de.codecentric.boot.admin.registry.ApplicationRegistry
;
import
de.codecentric.boot.admin.registry.ApplicationRegistryConflictException
;
/**
/**
* REST controller for controlling registration of managed applications.
* REST controller for controlling registration of managed applications.
...
@@ -57,12 +56,8 @@ public class RegistryController {
...
@@ -57,12 +56,8 @@ public class RegistryController {
@RequestMapping
(
method
=
RequestMethod
.
POST
)
@RequestMapping
(
method
=
RequestMethod
.
POST
)
public
ResponseEntity
<
Application
>
register
(
@RequestBody
Application
app
)
{
public
ResponseEntity
<
Application
>
register
(
@RequestBody
Application
app
)
{
LOGGER
.
debug
(
"Register application {}"
,
app
.
toString
());
LOGGER
.
debug
(
"Register application {}"
,
app
.
toString
());
try
{
Application
registeredApp
=
registry
.
register
(
app
);
Application
registeredApp
=
registry
.
register
(
app
);
return
new
ResponseEntity
<
Application
>(
registeredApp
,
HttpStatus
.
CREATED
);
return
new
ResponseEntity
<
Application
>(
registeredApp
,
HttpStatus
.
CREATED
);
}
catch
(
ApplicationRegistryConflictException
ex
)
{
return
new
ResponseEntity
<
Application
>(
HttpStatus
.
CONFLICT
);
}
}
}
/**
/**
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/registry/ApplicationIdGenerator.java
View file @
912d4f73
...
@@ -21,7 +21,7 @@ public interface ApplicationIdGenerator {
...
@@ -21,7 +21,7 @@ public interface ApplicationIdGenerator {
/**
/**
* Generate an id based on the given Application
* Generate an id based on the given Application
*
*
* @param a the application the id is computed for.
* @param a the application the id is computed for.
* @return the application id
* @return the application id
*/
*/
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/registry/ApplicationRegistry.java
View file @
912d4f73
...
@@ -69,8 +69,7 @@ public class ApplicationRegistry implements ApplicationContextAware {
...
@@ -69,8 +69,7 @@ public class ApplicationRegistry implements ApplicationContextAware {
if
((
app
.
getUrl
().
equals
(
oldApp
.
getUrl
())
&&
app
.
getName
().
equals
(
oldApp
.
getName
())))
{
if
((
app
.
getUrl
().
equals
(
oldApp
.
getUrl
())
&&
app
.
getName
().
equals
(
oldApp
.
getName
())))
{
LOGGER
.
debug
(
"Application {} refreshed"
,
newApp
);
LOGGER
.
debug
(
"Application {} refreshed"
,
newApp
);
}
else
{
}
else
{
LOGGER
.
warn
(
"Application {} not registered because of conflict with {}"
,
newApp
,
oldApp
);
LOGGER
.
warn
(
"Application {} replaced by Application {}"
,
newApp
,
oldApp
);
throw
new
ApplicationRegistryConflictException
(
oldApp
,
app
);
}
}
}
}
return
newApp
;
return
newApp
;
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/registry/ApplicationRegistryConflictException.java
deleted
100644 → 0
View file @
8e2ce75d
/*
* Copyright 2013-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
de
.
codecentric
.
boot
.
admin
.
registry
;
import
de.codecentric.boot.admin.model.Application
;
public
class
ApplicationRegistryConflictException
extends
RuntimeException
{
private
static
final
long
serialVersionUID
=
1L
;
public
ApplicationRegistryConflictException
(
Application
oldApp
,
Application
newApp
)
{
super
(
"Conflict in ApplicationRegistry: "
+
oldApp
.
toString
()
+
" vs. "
+
newApp
.
toString
());
}
}
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/registry/store/HazelcastApplicationStore.java
View file @
912d4f73
/*
* Copyright 2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
de
.
codecentric
.
boot
.
admin
.
registry
.
store
;
package
de
.
codecentric
.
boot
.
admin
.
registry
.
store
;
import
java.util.Collection
;
import
java.util.Collection
;
...
@@ -17,7 +32,7 @@ public class HazelcastApplicationStore implements ApplicationStore {
...
@@ -17,7 +32,7 @@ public class HazelcastApplicationStore implements ApplicationStore {
@Override
@Override
public
Application
save
(
Application
app
)
{
public
Application
save
(
Application
app
)
{
return
store
.
put
IfAbsent
(
app
.
getId
(),
app
);
return
store
.
put
(
app
.
getId
(),
app
);
}
}
@Override
@Override
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/registry/store/SimpleApplicationStore.java
View file @
912d4f73
...
@@ -31,7 +31,7 @@ public class SimpleApplicationStore implements ApplicationStore {
...
@@ -31,7 +31,7 @@ public class SimpleApplicationStore implements ApplicationStore {
@Override
@Override
public
Application
save
(
Application
app
)
{
public
Application
save
(
Application
app
)
{
return
map
.
put
IfAbsent
(
app
.
getId
(),
app
);
return
map
.
put
(
app
.
getId
(),
app
);
}
}
@Override
@Override
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/controller/RegistryControllerTest.java
View file @
912d4f73
...
@@ -69,7 +69,7 @@ public class RegistryControllerTest {
...
@@ -69,7 +69,7 @@ public class RegistryControllerTest {
public
void
register_sameUrl
()
{
public
void
register_sameUrl
()
{
controller
.
register
(
new
Application
(
"http://localhost"
,
"FOO"
));
controller
.
register
(
new
Application
(
"http://localhost"
,
"FOO"
));
ResponseEntity
<?>
response
=
controller
.
register
(
new
Application
(
"http://localhost"
,
"BAR"
));
ResponseEntity
<?>
response
=
controller
.
register
(
new
Application
(
"http://localhost"
,
"BAR"
));
assertEquals
(
HttpStatus
.
C
ONFLICT
,
response
.
getStatusCode
());
assertEquals
(
HttpStatus
.
C
REATED
,
response
.
getStatusCode
());
}
}
@Test
@Test
...
...
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