-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
45 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...ov/justice/services/healthcheck/healthchecks/artemis/DefaultDestinationNamesProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package uk.gov.justice.services.healthcheck.healthchecks.artemis; | ||
|
||
import javax.inject.Inject; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
public class DefaultDestinationNamesProvider implements DestinationNamesProvider { | ||
|
||
private static final List<String> DESTINATION_NAME_PATTERNS = List.of("%s.controller.command", "%s.handler.command", "%s.event"); | ||
|
||
@Inject | ||
private JndiContextNameProvider jndiContextNameProvider; | ||
|
||
public List<String> getDestinationNames() { | ||
return DESTINATION_NAME_PATTERNS.stream() | ||
.map(qp -> String.format(qp, getContextName())) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
protected final String getContextName() { | ||
return jndiContextNameProvider.getContextName(); | ||
} | ||
} |
17 changes: 2 additions & 15 deletions
17
...va/uk/gov/justice/services/healthcheck/healthchecks/artemis/DestinationNamesProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,7 @@ | ||
package uk.gov.justice.services.healthcheck.healthchecks.artemis; | ||
|
||
import javax.inject.Inject; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
public class DestinationNamesProvider { | ||
|
||
private static final List<String> DESTINATION_NAME_PATTERNS = List.of("%s.controller.command", "%s.handler.command", "%s.event"); | ||
|
||
@Inject | ||
private JndiContextNameProvider jndiContextNameProvider; | ||
|
||
public List<String> getDestinationNames() { | ||
var contextName = jndiContextNameProvider.getContextName(); | ||
return DESTINATION_NAME_PATTERNS.stream() | ||
.map(qp -> String.format(qp, contextName)) | ||
.collect(Collectors.toList()); | ||
} | ||
public interface DestinationNamesProvider { | ||
List<String> getDestinationNames(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters