Martin Peřina has uploaded a new change for review. Change subject: tools: NotificationProperties code cleanup ......................................................................
tools: NotificationProperties code cleanup Fixes accessing static final attributes without class name prefix from inside the class Change-Id: Ibd8516f39b5500732faefd61989e2f036691f0df Signed-off-by: Martin Perina <[email protected]> --- M backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java 1 file changed, 20 insertions(+), 20 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/36/23136/1 diff --git a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java index 5142ab7..15dcdf9 100644 --- a/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java +++ b/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java @@ -120,14 +120,14 @@ public void validate() { // validate mandatory properties for (String property : new String[] { - NotificationProperties.DAYS_TO_KEEP_HISTORY, - NotificationProperties.ENGINE_INTERVAL_IN_SECONDS, - NotificationProperties.ENGINE_TIMEOUT_IN_SECONDS, - NotificationProperties.INTERVAL_IN_SECONDS, - NotificationProperties.IS_HTTPS_PROTOCOL, - NotificationProperties.MAIL_PORT, - NotificationProperties.MAIL_SERVER, - NotificationProperties.REPEAT_NON_RESPONSIVE_NOTIFICATION }) { + DAYS_TO_KEEP_HISTORY, + ENGINE_INTERVAL_IN_SECONDS, + ENGINE_TIMEOUT_IN_SECONDS, + INTERVAL_IN_SECONDS, + IS_HTTPS_PROTOCOL, + MAIL_PORT, + MAIL_SERVER, + REPEAT_NON_RESPONSIVE_NOTIFICATION }) { if (StringUtils.isEmpty(getProperty(property))) { throw new IllegalArgumentException( String.format( @@ -140,29 +140,29 @@ throw new IllegalArgumentException( String.format( "Check configuration file, '%s' value has to be one of: '%s', '%s', '%s'.", - NotificationProperties.MAIL_SMTP_ENCRYPTION, - NotificationProperties.MAIL_SMTP_ENCRYPTION_NONE, - NotificationProperties.MAIL_SMTP_ENCRYPTION_SSL, - NotificationProperties.MAIL_SMTP_ENCRYPTION_TLS + MAIL_SMTP_ENCRYPTION, + MAIL_SMTP_ENCRYPTION_NONE, + MAIL_SMTP_ENCRYPTION_SSL, + MAIL_SMTP_ENCRYPTION_TLS )); } // try to resolve MAIL_SERVER host try { - InetAddress.getAllByName(getProperty(NotificationProperties.MAIL_SERVER)); + InetAddress.getAllByName(getProperty(MAIL_SERVER)); } catch (Exception ex) { throw new IllegalArgumentException( String.format( "Check configuration file, cannot verify '%s' value", - NotificationProperties.MAIL_SERVER), + MAIL_SERVER), ex); } // validate email addresses for (String property : new String[] { - NotificationProperties.MAIL_USER, - NotificationProperties.MAIL_FROM, - NotificationProperties.MAIL_REPLY_TO }) { + MAIL_USER, + MAIL_FROM, + MAIL_REPLY_TO }) { String candidate = getProperty(property); if (!StringUtils.isEmpty(candidate)) { try { @@ -178,15 +178,15 @@ } // validate mail user value - String emailUser = getProperty(NotificationProperties.MAIL_USER, true); + String emailUser = getProperty(MAIL_USER, true); if (StringUtils.isEmpty(emailUser) && (MAIL_SMTP_ENCRYPTION_SSL.equals(getProperty(MAIL_SMTP_ENCRYPTION, true)) || MAIL_SMTP_ENCRYPTION_TLS.equals(getProperty(MAIL_SMTP_ENCRYPTION, true)) - || StringUtils.isNotEmpty(getProperty(NotificationProperties.MAIL_PASSWORD, true)))) { + || StringUtils.isNotEmpty(getProperty(MAIL_PASSWORD, true)))) { throw new IllegalArgumentException( String.format( "'%s' must be set when SSL or TLS is enabled or when password is set", - NotificationProperties.MAIL_USER)); + MAIL_USER)); } } -- To view, visit http://gerrit.ovirt.org/23136 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibd8516f39b5500732faefd61989e2f036691f0df Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Peřina <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
