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
f75f9b64
Commit
f75f9b64
authored
Jan 24, 2017
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add getters so that config metadata is generated
Apparently we need some getters so that the metadata for the configuration properties is generated. fixes #391
parent
0fe2d989
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
132 additions
and
33 deletions
+132
-33
ApplicationDiscoveryListener.java
...ic/boot/admin/discovery/ApplicationDiscoveryListener.java
+4
-0
DefaultServiceInstanceConverter.java
...boot/admin/discovery/DefaultServiceInstanceConverter.java
+17
-11
AbstractEventNotifier.java
.../codecentric/boot/admin/notify/AbstractEventNotifier.java
+5
-0
AbstractStatusChangeNotifier.java
...ntric/boot/admin/notify/AbstractStatusChangeNotifier.java
+3
-0
HipchatNotifier.java
...ava/de/codecentric/boot/admin/notify/HipchatNotifier.java
+20
-0
MailNotifier.java
...n/java/de/codecentric/boot/admin/notify/MailNotifier.java
+20
-0
PagerdutyNotifier.java
...a/de/codecentric/boot/admin/notify/PagerdutyNotifier.java
+23
-2
SlackNotifier.java
.../java/de/codecentric/boot/admin/notify/SlackNotifier.java
+40
-20
No files found.
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/discovery/ApplicationDiscoveryListener.java
View file @
f75f9b64
...
...
@@ -141,4 +141,8 @@ public class ApplicationDiscoveryListener {
public
void
setIgnoredServices
(
Set
<
String
>
ignoredServices
)
{
this
.
ignoredServices
=
ignoredServices
;
}
public
Set
<
String
>
getIgnoredServices
()
{
return
ignoredServices
;
}
}
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/discovery/DefaultServiceInstanceConverter.java
View file @
f75f9b64
...
...
@@ -43,7 +43,15 @@ public class DefaultServiceInstanceConverter implements ServiceInstanceConverter
private
static
final
String
KEY_MANAGEMENT_PORT
=
"management.port"
;
private
static
final
String
KEY_MANAGEMENT_PATH
=
"management.context-path"
;
private
static
final
String
KEY_HEALTH_PATH
=
"health.path"
;
/**
* Default context-path to be appended to the url of the discovered service for the
* managment-url.
*/
private
String
managementContextPath
=
""
;
/**
* Default path of the health-endpoint to be used for the health-url of the discovered service.
*/
private
String
healthEndpointPath
=
"health"
;
@Override
...
...
@@ -106,22 +114,20 @@ public class DefaultServiceInstanceConverter implements ServiceInstanceConverter
return
instance
.
getMetadata
();
}
/**
* Default <code>management.context-path</code> to be appended to the url of the discovered
* service for the managment-url.
*
* @param managementContextPath the management context-path.
*/
public
void
setManagementContextPath
(
String
managementContextPath
)
{
this
.
managementContextPath
=
managementContextPath
;
}
/**
* Default path of the health-endpoint to be used for the health-url of the discovered service.
*
* @param healthEndpointPath the path for the health-endpoint.
*/
public
String
getManagementContextPath
()
{
return
managementContextPath
;
}
public
void
setHealthEndpointPath
(
String
healthEndpointPath
)
{
this
.
healthEndpointPath
=
healthEndpointPath
;
}
public
String
getHealthEndpointPath
()
{
return
healthEndpointPath
;
}
}
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/notify/AbstractEventNotifier.java
View file @
f75f9b64
...
...
@@ -55,4 +55,8 @@ public abstract class AbstractEventNotifier implements Notifier {
public
void
setEnabled
(
boolean
enabled
)
{
this
.
enabled
=
enabled
;
}
public
boolean
isEnabled
()
{
return
enabled
;
}
}
\ No newline at end of file
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/notify/AbstractStatusChangeNotifier.java
View file @
f75f9b64
...
...
@@ -52,4 +52,7 @@ public abstract class AbstractStatusChangeNotifier extends AbstractEventNotifier
this
.
ignoreChanges
=
copy
;
}
public
String
[]
getIgnoreChanges
()
{
return
ignoreChanges
;
}
}
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/notify/HipchatNotifier.java
View file @
f75f9b64
...
...
@@ -115,22 +115,42 @@ public class HipchatNotifier extends AbstractStatusChangeNotifier {
this
.
url
=
url
;
}
public
URI
getUrl
()
{
return
url
;
}
public
void
setAuthToken
(
String
authToken
)
{
this
.
authToken
=
authToken
;
}
public
String
getAuthToken
()
{
return
authToken
;
}
public
void
setRoomId
(
String
roomId
)
{
this
.
roomId
=
roomId
;
}
public
String
getRoomId
()
{
return
roomId
;
}
public
void
setNotify
(
boolean
notify
)
{
this
.
notify
=
notify
;
}
public
boolean
isNotify
()
{
return
notify
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
parser
.
parseExpression
(
description
,
ParserContext
.
TEMPLATE_EXPRESSION
);
}
public
String
getDescription
()
{
return
description
.
getExpressionString
();
}
public
void
setRestTemplate
(
RestTemplate
restTemplate
)
{
this
.
restTemplate
=
restTemplate
;
}
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/notify/MailNotifier.java
View file @
f75f9b64
...
...
@@ -88,20 +88,40 @@ public class MailNotifier extends AbstractStatusChangeNotifier {
this
.
to
=
Arrays
.
copyOf
(
to
,
to
.
length
);
}
public
String
[]
getTo
()
{
return
Arrays
.
copyOf
(
to
,
to
.
length
);
}
public
void
setCc
(
String
[]
cc
)
{
this
.
cc
=
Arrays
.
copyOf
(
cc
,
cc
.
length
);
}
public
String
[]
getCc
()
{
return
Arrays
.
copyOf
(
cc
,
cc
.
length
);
}
public
void
setFrom
(
String
from
)
{
this
.
from
=
from
;
}
public
String
getFrom
()
{
return
from
;
}
public
void
setSubject
(
String
subject
)
{
this
.
subject
=
parser
.
parseExpression
(
subject
,
ParserContext
.
TEMPLATE_EXPRESSION
);
}
public
String
getSubject
()
{
return
subject
.
getExpressionString
();
}
public
void
setText
(
String
text
)
{
this
.
text
=
parser
.
parseExpression
(
text
,
ParserContext
.
TEMPLATE_EXPRESSION
);
}
public
String
getText
()
{
return
text
.
getExpressionString
();
}
}
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/notify/PagerdutyNotifier.java
View file @
f75f9b64
...
...
@@ -15,8 +15,9 @@
*/
package
de
.
codecentric
.
boot
.
admin
.
notify
;
import
static
java
.
util
.
Collections
.
singletonList
;
import
java.net.URI
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -103,7 +104,7 @@ public class PagerdutyNotifier extends AbstractStatusChangeNotifier {
context
.
put
(
"type"
,
"link"
);
context
.
put
(
"href"
,
event
.
getApplication
().
getHealthUrl
());
context
.
put
(
"text"
,
"Application health-endpoint"
);
result
.
put
(
"contexts"
,
Arrays
.
as
List
(
context
));
result
.
put
(
"contexts"
,
singleton
List
(
context
));
}
}
...
...
@@ -127,22 +128,42 @@ public class PagerdutyNotifier extends AbstractStatusChangeNotifier {
this
.
url
=
url
;
}
public
URI
getUrl
()
{
return
url
;
}
public
void
setClient
(
String
client
)
{
this
.
client
=
client
;
}
public
String
getClient
()
{
return
client
;
}
public
void
setClientUrl
(
URI
clientUrl
)
{
this
.
clientUrl
=
clientUrl
;
}
public
URI
getClientUrl
()
{
return
clientUrl
;
}
public
void
setServiceKey
(
String
serviceKey
)
{
this
.
serviceKey
=
serviceKey
;
}
public
String
getServiceKey
()
{
return
serviceKey
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
parser
.
parseExpression
(
description
,
ParserContext
.
TEMPLATE_EXPRESSION
);
}
public
String
getDescription
()
{
return
description
.
getExpressionString
();
}
public
void
setRestTemplate
(
RestTemplate
restTemplate
)
{
this
.
restTemplate
=
restTemplate
;
}
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/notify/SlackNotifier.java
View file @
f75f9b64
...
...
@@ -62,26 +62,6 @@ public class SlackNotifier extends AbstractStatusChangeNotifier {
this
.
restTemplate
=
restTemplate
;
}
public
void
setWebhookUrl
(
URI
webhookUrl
)
{
this
.
webhookUrl
=
webhookUrl
;
}
public
void
setChannel
(
String
channel
)
{
this
.
channel
=
channel
;
}
public
void
setIcon
(
String
icon
)
{
this
.
icon
=
icon
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
parser
.
parseExpression
(
message
,
ParserContext
.
TEMPLATE_EXPRESSION
);
}
protected
Object
createMessage
(
ClientApplicationEvent
event
)
{
Map
<
String
,
Object
>
messageJson
=
new
HashMap
<>();
messageJson
.
put
(
"username"
,
username
);
...
...
@@ -111,4 +91,44 @@ public class SlackNotifier extends AbstractStatusChangeNotifier {
return
"#439FE0"
;
}
}
public
URI
getWebhookUrl
()
{
return
webhookUrl
;
}
public
void
setWebhookUrl
(
URI
webhookUrl
)
{
this
.
webhookUrl
=
webhookUrl
;
}
public
String
getChannel
()
{
return
channel
;
}
public
void
setChannel
(
String
channel
)
{
this
.
channel
=
channel
;
}
public
String
getIcon
()
{
return
icon
;
}
public
void
setIcon
(
String
icon
)
{
this
.
icon
=
icon
;
}
public
String
getUsername
()
{
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
String
getMessage
()
{
return
message
.
getExpressionString
();
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
parser
.
parseExpression
(
message
,
ParserContext
.
TEMPLATE_EXPRESSION
);
}
}
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