Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8366: Jolokia - Display warning when enabling Jolokia discovery about only using the discovery feature in a trusted environment. #631

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.util.Map;
import java.util.WeakHashMap;

import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
Expand Down Expand Up @@ -65,15 +66,20 @@ public void createFieldEditors() {
protected void valueChanged(boolean oldValue, boolean newValue) {
super.valueChanged(oldValue, newValue);
enableDependantFields(newValue);
if (newValue) {
MessageDialog.openWarning(getShell(), Messages.JolokiaPreferencePage_WarningTitle,
Messages.JolokiaPreferencePage_WarningText);
}
}
};
addField(mainEnabler);
this.addTextField(new StringFieldEditor(P_MULTICAST_GROUP, Messages.JolokiaPreferencePage_MulticastGroupLabel,
getFieldEditorParent()), Messages.JolokiaPreferencePage_MulticastGroupTooltip);
this.addTextField(new IntegerFieldEditor(P_MULTICAST_PORT, Messages.JolokiaPreferencePage_MulticastPortLabel,
getFieldEditorParent()), Messages.JolokiaPreferencePage_MulticastPortTooltip);
this.addDependantField(new IntegerFieldEditor(P_DISCOVER_TIMEOUT,
Messages.JolokiaPreferencePage_DiscoverTimeoutLabel, getFieldEditorParent()), getControl());
IntegerFieldEditor timeoutField = new IntegerFieldEditor(P_DISCOVER_TIMEOUT,
Messages.JolokiaPreferencePage_DiscoverTimeoutLabel, getFieldEditorParent());
this.addDependantField(timeoutField, timeoutField.getTextControl(getFieldEditorParent()));
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public class Messages extends NLS {
public static String JolokiaPreferencePage_MulticastGroupTooltip;
public static String JolokiaPreferencePage_MulticastPortLabel;
public static String JolokiaPreferencePage_MulticastPortTooltip;
public static String JolokiaPreferencePage_WarningText;
public static String JolokiaPreferencePage_WarningTitle;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ JolokiaPreferencePage_MulticastGroupLabel=Multicast Group
JolokiaPreferencePage_MulticastGroupTooltip=Multicast group used by Jolokia discovery to detect instances.
JolokiaPreferencePage_MulticastPortLabel=Multicast Port
JolokiaPreferencePage_MulticastPortTooltip=Port number used by Jolokia discovery to detect instances.
JolokiaPreferencePage_WarningText=Only enable Jolokia discovery in a safe environment
JolokiaPreferencePage_WarningTitle=Enabling auto discovery
JolokiaPreferencePage.MulticastAddressLabel=Jolokia Discovery Multicast Address.
JolokiaPreferencePage.MulticastAddressTooltip=Address used for broadcast messages that available Jolokia agents should respond to.
JolokiaPreferencePage.MulticastPortLabel=Jolokia Discovery Multicast Address.
Expand Down