de.otto.edison.configuration.EdisonApplicationProperties Java Examples

The following examples show how to use de.otto.edison.configuration.EdisonApplicationProperties. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JobsController.java    From edison-microservice with Apache License 2.0 5 votes vote down vote up
@Autowired
JobsController(final JobService jobService,
               final JobMetaService jobMetaService,
               final NavBar rightNavBar,
               final EdisonApplicationProperties applicationProperties) {
    this.jobService = jobService;
    this.jobMetaService = jobMetaService;
    this.applicationProperties = applicationProperties;
    rightNavBar.register(navBarItem(10, "Job Overview", applicationProperties.getManagement().getBasePath() + "/jobs"));
}
 
Example #2
Source File: StatusRepresentationTest.java    From edison-microservice with Apache License 2.0 5 votes vote down vote up
@Test
public void shouldCreateStatusRepresentationWithoutDetails() {
    // given
    EdisonApplicationProperties edisonApplicationProperties = edisonApplicationProperties("Some Title", "group", "local-env", "desc");
    final StatusRepresentation json = statusRepresentationOf(
            applicationStatus(applicationInfo("app-name", edisonApplicationProperties), mock(ClusterInfo.class), mock(SystemInfo.class), mock(VersionInfo.class), mock(TeamInfo.class), emptyList())
    );
    // then
    assertThat(json.application.name, is("app-name"));
    assertThat(json.application.title, is("Some Title"));
    assertThat(json.application.status, is(OK));
    assertThat(json.application.statusDetails.size(), is(0));
}
 
Example #3
Source File: AsyncHttpRegistryClient.java    From edison-microservice with Apache License 2.0 5 votes vote down vote up
@Autowired
public AsyncHttpRegistryClient(final ApplicationInfo applicationInfo,
                               final AsyncHttpClient httpClient,
                               final ServiceRegistryProperties serviceRegistryProperties,
                               final EdisonApplicationProperties edisonApplicationProperties) {
    this.applicationInfo = applicationInfo;
    this.httpClient = httpClient;
    this.serviceRegistryProperties = serviceRegistryProperties;
    this.edisonApplicationProperties = edisonApplicationProperties;
}
 
Example #4
Source File: NavBarConfiguration.java    From edison-microservice with Apache License 2.0 5 votes vote down vote up
@Bean
public NavBar rightNavBar(final EdisonApplicationProperties properties) {
    final String href = properties.getManagement().getBasePath() + "/status";
    return navBar(asList(
            navBarItem(top(), "Status", href)
    ));
}
 
Example #5
Source File: LoggersConfiguration.java    From edison-microservice with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnProperty(prefix = "edison.logging.ui", name = "enabled", matchIfMissing = true)
public LoggersHtmlEndpoint loggersHtmlEndpoint(final LoggersEndpoint loggersEndpoint,
                                               final NavBar rightNavBar,
                                               final EdisonApplicationProperties properties) {
    return new LoggersHtmlEndpoint(loggersEndpoint, rightNavBar, properties);
}
 
Example #6
Source File: LoggersHtmlEndpoint.java    From edison-microservice with Apache License 2.0 5 votes vote down vote up
public LoggersHtmlEndpoint(final LoggersEndpoint loggersEndpoint,
                           final NavBar rightNavBar,
                           final EdisonApplicationProperties applicationProperties) {
    this.loggersEndpoint = loggersEndpoint;
    this.applicationProperties = applicationProperties;
    rightNavBar.register(navBarItem(1, "Loggers", String.format("%s/loggers", applicationProperties.getManagement().getBasePath())));
}
 
Example #7
Source File: ApplicationInfo.java    From edison-microservice with Apache License 2.0 5 votes vote down vote up
private ApplicationInfo(final String name,
                        final EdisonApplicationProperties applicationInfoProperties) {
    if (name.isEmpty()) throw new IllegalArgumentException("name must not be empty");
    this.name = name;
    this.title = applicationInfoProperties.getTitle();
    this.description = applicationInfoProperties.getDescription();
    this.group = applicationInfoProperties.getGroup();
    this.environment = applicationInfoProperties.getEnvironment();
}
 
Example #8
Source File: NavigationConfiguration.java    From edison-microservice with Apache License 2.0 5 votes vote down vote up
@Autowired
public NavigationConfiguration(final NavBar mainNavBar,
                               final TogglzProperties togglzProperties,
                               final EdisonApplicationProperties properties) {
    mainNavBar.register(navBarItem(0, "Home", "/"));
    if (togglzProperties.getConsole().isEnabled()) {
        mainNavBar.register(navBarItem(1, "Feature Toggles", String.format("%s/toggles/console/index", properties.getManagement().getBasePath())));
    }
}
 
Example #9
Source File: NavigationConfiguration.java    From edison-microservice with Apache License 2.0 5 votes vote down vote up
@Autowired
public NavigationConfiguration(final NavBar mainNavBar,
                               final EdisonApplicationProperties  properties) {
    mainNavBar.register(navBarItem(0, "Home", "/"));
    mainNavBar.register(navBarItem(1, "Status", String.format("%s/status", properties.getManagement().getBasePath())));
    mainNavBar.register(navBarItem(2, "Job Overview", String.format("%s/jobs", properties.getManagement().getBasePath())));
    mainNavBar.register(navBarItem(3, "Job Definitions", String.format("%s/jobdefinitions", properties.getManagement().getBasePath())));
}
 
Example #10
Source File: JobsConfiguration.java    From edison-microservice with Apache License 2.0 5 votes vote down vote up
@Autowired
public JobsConfiguration(final JobsProperties jobsProperties,
                         final EdisonApplicationProperties  applicationProperties) {
    this.jobsProperties = jobsProperties;
    this.edisonManagementBasePath = applicationProperties.getManagement().getBasePath();
    final Map<String, String> calculator = this.jobsProperties.getStatus().getCalculator();
    if (!calculator.containsKey("default")) {
        this.jobsProperties.getStatus().setCalculator(
                new HashMap<String,String>() {{
                    putAll(calculator);
                    put("default", "warningOnLastJobFailed");
                }}
        );
    }
}
 
Example #11
Source File: JobDefinitionsController.java    From edison-microservice with Apache License 2.0 5 votes vote down vote up
@Autowired
public JobDefinitionsController(final JobDefinitionService definitionService,
                                final JobMetaService jobMetaService,
                                final NavBar rightNavBar,
                                final EdisonApplicationProperties applicationProperties) {
    this.jobDefinitionService = definitionService;
    this.jobMetaService = jobMetaService;
    this.applicationProperties = applicationProperties;
    jobDefinitionsUri = String.format("%s/jobdefinitions", applicationProperties.getManagement().getBasePath());
    rightNavBar.register(navBarItem(10, "Job Definitions", jobDefinitionsUri));
}
 
Example #12
Source File: NavigationConfiguration.java    From edison-microservice with Apache License 2.0 4 votes vote down vote up
@Autowired
public NavigationConfiguration(final NavBar mainNavBar,
                               final EdisonApplicationProperties properties) {
    mainNavBar.register(navBarItem(top(), "Status", String.format("%s/status", properties.getManagement().getBasePath())));
}
 
Example #13
Source File: InternalController.java    From edison-microservice with Apache License 2.0 4 votes vote down vote up
public InternalController(final EdisonApplicationProperties properties,
                          final ServerProperties serverProperties) {
    this.properties = properties;
    this.serverProperties = serverProperties;
}
 
Example #14
Source File: GlobalModelAttributes.java    From edison-microservice with Apache License 2.0 4 votes vote down vote up
@Autowired
public GlobalModelAttributes(final WebEndpointProperties  webEndpointProperties,
                             final EdisonApplicationProperties edisonApplicationProperties) {
    this.webEndpointProperties = webEndpointProperties;
    this.edisonApplicationProperties = edisonApplicationProperties;
}
 
Example #15
Source File: ApplicationInfoConfiguration.java    From edison-microservice with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean(ApplicationInfo.class)
public ApplicationInfo applicationInfo(EdisonApplicationProperties edisonApplicationProperties) {
    return ApplicationInfo.applicationInfo(serviceName, edisonApplicationProperties);
}
 
Example #16
Source File: ApplicationInfo.java    From edison-microservice with Apache License 2.0 4 votes vote down vote up
public static ApplicationInfo applicationInfo(final String serviceName, final EdisonApplicationProperties statusProps) {
    return new ApplicationInfo(serviceName, statusProps);
}
 
Example #17
Source File: NavigationConfiguration.java    From edison-microservice with Apache License 2.0 4 votes vote down vote up
@Autowired
public NavigationConfiguration(final NavBar mainNavBar,
                               final EdisonApplicationProperties properties) {
    mainNavBar.register(navBarItem(0, "Home", "/"));
    mainNavBar.register(navBarItem(1, "Feature Toggles", format("%s/toggles/console/index", properties.getManagement().getBasePath())));
}
 
Example #18
Source File: JobsConfigurationTest.java    From edison-microservice with Apache License 2.0 4 votes vote down vote up
@BeforeEach
public void setUp() throws Exception {
    properties = new EdisonApplicationProperties();
    testee = new JobsConfiguration(new JobsProperties(), properties);
}
 
Example #19
Source File: NavigationConfiguration.java    From jlineup with Apache License 2.0 4 votes vote down vote up
@Autowired
public NavigationConfiguration(final NavBar mainNavBar,
                               final EdisonApplicationProperties  properties) {
    mainNavBar.register(navBarItem(0, "Status", String.format("%s/status", properties.getManagement().getBasePath())));
    mainNavBar.register(navBarItem(1, "Reports", String.format("%s/reports", properties.getManagement().getBasePath())));
}