Search in sources :

Example 1 with GenericSettingClient

use of org.jboss.pnc.client.GenericSettingClient in project bacon by project-ncl.

the class PncClientHelper method printBannerIfNecessary.

private static void printBannerIfNecessary(Configuration configuration) {
    if (!bannerChecked) {
        try (GenericSettingClient genericSettingClient = new GenericSettingClient(configuration)) {
            String banner = genericSettingClient.getAnnouncementBanner().getBanner();
            if (banner != null && !banner.isEmpty()) {
                log.warn("***********************");
                log.warn("Announcement: {}", banner);
                log.warn("***********************");
            }
        } catch (RemoteResourceException e) {
            log.error(e.getMessage());
        }
        bannerChecked = true;
    }
}
Also used : RemoteResourceException(org.jboss.pnc.client.RemoteResourceException) GenericSettingClient(org.jboss.pnc.client.GenericSettingClient)

Aggregations

GenericSettingClient (org.jboss.pnc.client.GenericSettingClient)1 RemoteResourceException (org.jboss.pnc.client.RemoteResourceException)1