| | |
| | | recalculateHashCode(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public int compareTo(AbstractIndexDescriptor o) |
| | | { |
| | | return getName().toLowerCase().compareTo(o.getName().toLowerCase()); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public int hashCode() |
| | | { |
| | | return hashCode; |
| | |
| | | return sortOrder; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean equals(Object o) |
| | | { |
| | | if (o == this) |
| | |
| | | && getBackend().getBackendID().equals(index.getBackend().getBackendID()); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected void recalculateHashCode() |
| | | { |
| | | StringBuilder sb = new StringBuilder(); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.quicksetup; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | |
| | | * @see org.opends.quicksetup.installer.Installer |
| | | * @see org.opends.quicksetup.installer.webstart.WebStartInstaller |
| | | * @see org.opends.quicksetup.installer.offline.OfflineInstaller |
| | | * |
| | | */ |
| | | public class ApplicationException extends OpenDsException { |
| | | |
| | |
| | | return type; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public String toString() |
| | | { |
| | | return getMessage(); |
| | |
| | | return Integer.valueOf(values.get(REVISION_NUMBER)); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() { |
| | | StringBuilder sb = new StringBuilder(); |
| | |
| | | return sb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int compareTo(BuildInformation bi) { |
| | | if (getMajorVersion().equals(bi.getMajorVersion())) { |
| | |
| | | return 1; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean equals(Object o) { |
| | | if (this == o) { |
| | |
| | | && compareTo((BuildInformation)o) == 0; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int hashCode() { |
| | | int hc = 11; |
| | |
| | | isForceOnError = ud != null && ud.isForceOnError(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Object confirm(LocalizableMessage summary, LocalizableMessage details, |
| | | LocalizableMessage title, MessageType type, LocalizableMessage[] options, |
| | | LocalizableMessage def) { |
| | | return confirm(summary, details, null, title, type, options, def, null); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Object confirm(LocalizableMessage summary, LocalizableMessage details, LocalizableMessage fineDetails, |
| | | LocalizableMessage title, MessageType type, LocalizableMessage[] options, |
| | | LocalizableMessage def, LocalizableMessage viewDetailsOption) { |
| | |
| | | return returnValue; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public String createUnorderedList(List<?> list) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | if (list != null) { |
| | |
| | | getErrorStream().println(text); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isAdvancedMode() { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isInteractive() { |
| | | return isInteractive; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isMenuDrivenMode() { |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isQuiet() { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isScriptFriendly() { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isVerbose() { |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isCLI() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isForceOnError() { |
| | | return isForceOnError; |
| | | } |
| | |
| | | "set-java-home.bat"; |
| | | |
| | | /** |
| | | * script utils file for UNIX systems. |
| | | * Script utils file for UNIX systems. |
| | | */ |
| | | public static final String SCRIPT_UTIL_FILE_UNIX = "_script-util.sh"; |
| | | |
| | | /** |
| | | * script utils file for Windows. |
| | | * Script utils file for Windows. |
| | | */ |
| | | public static final String SCRIPT_UTIL_FILE_WINDOWS = "_script-util.bat"; |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.quicksetup; |
| | | |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | |
| | | |
| | | private Class<?> quickSetupClass; |
| | | |
| | | // Constant for the display of the splash screen |
| | | /** Constant for the display of the splash screen. */ |
| | | private static final int MIN_SPLASH_DISPLAY = 3000; |
| | | |
| | | /** |
| | |
| | | screen.display(args); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void update(Graphics g) |
| | | { |
| | | paint(g); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void paint(Graphics g) |
| | | { |
| | | g.drawImage(image, 0, 0, this); |
| | | } |
| | | |
| | | /** |
| | | * Protected constructor to force to use the main method. |
| | | * |
| | | */ |
| | | /** Protected constructor to force to use the main method. */ |
| | | protected SplashScreen() |
| | | { |
| | | super(new Frame()); |
| | |
| | | setPreferredSize(new Dimension(width, height)); |
| | | setSize(width, height); |
| | | Utilities.centerOnScreen(this); |
| | | |
| | | } catch (Exception ex) |
| | | { |
| | | ex.printStackTrace(); // Bug |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.quicksetup; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | /** |
| | | * This enumeration just represents the different steps that we can have in |
| | | * the installation and uninstallation wizards. |
| | | * |
| | | */ |
| | | public enum Step implements WizardStep |
| | | |
| | | { |
| | | /** |
| | | * Welcome step for the installation. |
| | | */ |
| | | /** Welcome step for the installation. */ |
| | | WELCOME(INFO_WELCOME_STEP.get()), |
| | | |
| | | /** |
| | | * License approval step for the installation. |
| | | */ |
| | | /** License approval step for the installation. */ |
| | | LICENSE(INFO_LICENSE_STEP.get()), |
| | | |
| | | /** |
| | | * Confirmation panel for the uninstallation. |
| | | */ |
| | | /** Confirmation panel for the uninstallation. */ |
| | | CONFIRM_UNINSTALL(INFO_CONFIRM_UNINSTALL_STEP.get()), |
| | | |
| | | /** |
| | | * Server Settings step (path, port, etc.). |
| | | */ |
| | | /** Server Settings step (path, port, etc.). */ |
| | | SERVER_SETTINGS(INFO_SERVER_SETTINGS_STEP.get()), |
| | | |
| | | /** |
| | | * Data Replication panel (standalone or replicated). |
| | | */ |
| | | /** Data Replication panel (standalone or replicated). */ |
| | | REPLICATION_OPTIONS(INFO_DATA_REPLICATION_STEP.get()), |
| | | /** |
| | | * Global Administrator creation panel. |
| | | */ |
| | | /** Global Administrator creation panel. */ |
| | | CREATE_GLOBAL_ADMINISTRATOR(INFO_CREATE_GLOBAL_ADMINISTRATOR_STEP.get()), |
| | | /** |
| | | * Suffixes to Replicate. |
| | | */ |
| | | /** Suffixes to Replicate. */ |
| | | SUFFIXES_OPTIONS(INFO_SUFFIXES_STEP.get()), |
| | | /** |
| | | * Panel when the user specifies the replication ports of the remote servers |
| | | * that have not defined it. |
| | | */ |
| | | REMOTE_REPLICATION_PORTS(INFO_REMOTE_REPLICATION_PORTS_STEP.get()), |
| | | /** |
| | | * Data Options panel (suffix dn, LDIF path, etc.). |
| | | */ |
| | | /** Data Options panel (suffix dn, LDIF path, etc.). */ |
| | | NEW_SUFFIX_OPTIONS(INFO_DATA_OPTIONS_STEP.get()), |
| | | |
| | | /** |
| | | * Runtime options panel for the install. |
| | | */ |
| | | /** Runtime options panel for the install. */ |
| | | RUNTIME_OPTIONS(INFO_JAVA_RUNTIME_OPTIONS_PANEL_STEP.get()), |
| | | |
| | | /** |
| | | * Review panel for the install. |
| | | */ |
| | | /** Review panel for the install. */ |
| | | REVIEW(INFO_REVIEW_STEP.get()), |
| | | |
| | | /** |
| | | * Progress panel. |
| | | */ |
| | | /** Progress panel. */ |
| | | PROGRESS(INFO_PROGRESS_STEP.get()), |
| | | |
| | | /** |
| | | * Finished panel. |
| | | */ |
| | | /** Finished panel. */ |
| | | FINISHED(INFO_FINISHED_STEP.get()); |
| | | |
| | | private LocalizableMessage msg; |
| | |
| | | /** |
| | | * Creates a step. |
| | | * @param msg the message key used to access a message catalog to |
| | | * retreive this step's display name |
| | | * retrieve this step's display name |
| | | */ |
| | | Step(LocalizableMessage msg) { |
| | | this.msg = msg; |
| | |
| | | /** |
| | | * Gets this steps message key. |
| | | * @return String message key used to access a message catalog to |
| | | * retreive this step's display name |
| | | * retrieve this step's display name |
| | | */ |
| | | public LocalizableMessage getDisplayMessage() { |
| | | return msg; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isProgressStep() { |
| | | return this == PROGRESS; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isFinishedStep() { |
| | | return this == FINISHED; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isLicenseStep() { |
| | | return this == LICENSE; |
| | | } |
| | |
| | | final CountDownLatch latch = new CountDownLatch(1); |
| | | Thread t = new Thread(new Runnable() |
| | | { |
| | | // Search for a host name of the form host.example.com on each |
| | | // interface, except the loop back. Prefer interfaces of the form ethX. |
| | | /** |
| | | * Search for a host name of the form host.example.com on each |
| | | * interface, except the loop back. Prefer interfaces of the form ethX. |
| | | */ |
| | | public void run() |
| | | { |
| | | try |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.installer; |
| | | |
| | | import org.opends.quicksetup.ProgressStep; |
| | |
| | | */ |
| | | FINISHED_WITH_ERROR; |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isLast() { |
| | | return this == FINISHED_SUCCESSFULLY || |
| | | this == FINISHED_CANCELED || |
| | | this == FINISHED_WITH_ERROR; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isError() { |
| | | return this.equals(FINISHED_WITH_ERROR); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.quicksetup.installer; |
| | | |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void launch() { |
| | | try |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ArgumentParser getArgumentParser() { |
| | | return this.argParser; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected void guiLaunchFailed(String logFileName) { |
| | | if (logFileName != null) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected void willLaunchGui() { |
| | | System.out.println(INFO_SETUP_LAUNCHER_LAUNCHING_GUI.get()); |
| | | System.setProperty("org.opends.quicksetup.Application.class", |
| | | OfflineInstaller.class.getName()); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getFrameTitle() { |
| | | return Utils.getCustomizedObject("INFO_FRAME_INSTALL_TITLE", |
| | | INFO_FRAME_INSTALL_TITLE.get(DynamicConstants.PRODUCT_NAME), |
| | | LocalizableMessage.class); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected CliApplication createCliApplication() { |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected boolean isCli() { |
| | | return argParser.isCli(); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.quicksetup.installer.offline; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | import static com.forgerock.opendj.util.OperatingSystem.isWindows; |
| | | import static com.forgerock.opendj.cli.Utils.getThrowableMsg; |
| | | |
| | | |
| | | import java.io.PrintStream; |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | |
| | | */ |
| | | public class OfflineInstaller extends Installer |
| | | { |
| | | /* This map contains the ratio associated with each step */ |
| | | /** This map contains the ratio associated with each step. */ |
| | | private final Map<ProgressStep, Integer> hmRatio = |
| | | new HashMap<ProgressStep, Integer>(); |
| | | |
| | | /* This map contains the summary associated with each step */ |
| | | /** This map contains the summary associated with each step. */ |
| | | private final Map<ProgressStep, LocalizableMessage> hmSummary = |
| | | new HashMap<ProgressStep, LocalizableMessage>(); |
| | | |
| | |
| | | |
| | | /** |
| | | * Actually performs the install in this thread. The thread is blocked. |
| | | * |
| | | */ |
| | | @Override |
| | | public void run() |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Integer getRatio(ProgressStep status) |
| | | { |
| | | return hmRatio.get(status); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage getSummary(ProgressStep status) |
| | | { |
| | |
| | | hmRatio.put(InstallProgressStep.FINISHED_CANCELED, 100); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getInstallationPath() |
| | | { |
| | | return Utils.getInstallPathFromClasspath(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getInstancePath() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.quicksetup.installer.ui; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | addActionListeners(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Object getFieldValue(FieldName fieldName) |
| | | { |
| | | Object value = null; |
| | |
| | | return value; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void displayFieldInvalid(FieldName fieldName, boolean invalid) |
| | | { |
| | | JLabel label = getLabel(fieldName); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected Component createInputPanel() |
| | | { |
| | | JPanel panel = new JPanel(new GridBagLayout()); |
| | |
| | | browseButton); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getInstructions() |
| | | { |
| | | return INFO_DATA_OPTIONS_PANEL_INSTRUCTIONS.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getTitle() |
| | | { |
| | | return INFO_DATA_OPTIONS_PANEL_TITLE.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void endDisplay() |
| | | { |
| | | if (lastFocusComponent != null) |
| | |
| | | addActionListeners(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Object getFieldValue(FieldName fieldName) |
| | | { |
| | | Object value = null; |
| | |
| | | return value; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void displayFieldInvalid(FieldName fieldName, boolean invalid) |
| | | { |
| | | JLabel label = getLabel(fieldName); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected Component createInputPanel() |
| | | { |
| | | JPanel panel = new JPanel(new GridBagLayout()); |
| | |
| | | return panel; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getInstructions() |
| | | { |
| | | return INFO_DATA_REPLICATION_OPTIONS_PANEL_INSTRUCTIONS.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getTitle() |
| | | { |
| | | return INFO_DATA_REPLICATION_OPTIONS_PANEL_TITLE.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void endDisplay() |
| | | { |
| | | if (lastFocusComponent != null) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getTextForIcon(UIFactory.IconType iconType) |
| | | { |
| | | LocalizableMessage text; |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.installer.ui; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | addFocusListeners(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Object getFieldValue(FieldName fieldName) |
| | | { |
| | | Object value = null; |
| | |
| | | { |
| | | value = field.getText(); |
| | | } |
| | | |
| | | return value; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void displayFieldInvalid(FieldName fieldName, boolean invalid) |
| | | { |
| | | JLabel label = getLabel(fieldName); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected Component createInputPanel() |
| | | { |
| | | JPanel panel = new JPanel(new GridBagLayout()); |
| | |
| | | return panel; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getInstructions() |
| | | { |
| | | return INFO_GLOBAL_ADMINISTRATOR_PANEL_INSTRUCTIONS.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getTitle() |
| | | { |
| | | return INFO_GLOBAL_ADMINISTRATOR_PANEL_TITLE.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void endDisplay() |
| | | { |
| | | if (lastFocusComponent != null) |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.installer.ui; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | super(app); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getTitle() |
| | | { |
| | | return INFO_LICENSE_PANEL_TITLE.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getInstructions() |
| | | { |
| | | return null; |
| | |
| | | |
| | | private JCheckBox acceptCheck; |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected Component createInputPanel() |
| | | { |
| | | // No input in this panel |
| | |
| | | return panel; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected boolean requiresScroll() |
| | | { |
| | | return false; |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.installer.ui; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | populateLabelAndFieldsMap(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void beginDisplay(UserData userData) |
| | | { |
| | | if (displayServerLocation) |
| | |
| | | return instructionsPanel; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected boolean requiresScroll() |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected Component createInputPanel() |
| | | { |
| | | JPanel panel = UIFactory.makeJPanel(); |
| | |
| | | return panel; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Object getFieldValue(FieldName fieldName) |
| | | { |
| | | Object value = null; |
| | |
| | | return value; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getInstructions() |
| | | { |
| | | return INFO_REVIEW_PANEL_INSTRUCTIONS.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getTitle() |
| | | { |
| | | return INFO_REVIEW_PANEL_TITLE.get(); |
| | |
| | | return equivalentCommandPane; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected JComponent getBottomComponent() |
| | | { |
| | | if (bottomComponent == null) |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.quicksetup.installer.ui; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | |
| | | /** |
| | | * This panel is used to show a welcome message. |
| | | * |
| | | */ |
| | | public class InstallWelcomePanel extends QuickSetupStepPanel |
| | | { |
| | |
| | | super(app); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getTitle() |
| | | { |
| | | return INFO_WELCOME_PANEL_TITLE.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getInstructions() |
| | | { |
| | | /* |
| | |
| | | LocalizableMessage.class); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected Component createInputPanel() |
| | | { |
| | | // No input in this panel |
| | |
| | | private JPanel fieldsPanel; |
| | | private TreeSet<ServerDescriptor> orderedServers = |
| | | new TreeSet<ServerDescriptor>(this); |
| | | //The display of the server the user provided in the replication options |
| | | // panel |
| | | /** |
| | | *The display of the server the user provided in the replication options |
| | | * panel. |
| | | */ |
| | | private String serverToConnectDisplay; |
| | | |
| | | /** |
| | |
| | | super(application); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Object getFieldValue(FieldName fieldName) |
| | | { |
| | | Object value = null; |
| | |
| | | return value; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void displayFieldInvalid(FieldName fieldName, boolean invalid) |
| | | { |
| | | if (fieldName == FieldName.REMOTE_REPLICATION_PORT) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected boolean requiresScroll() |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public int compare(ServerDescriptor desc1, ServerDescriptor desc2) |
| | | { |
| | | return desc1.getHostPort(true).compareTo(desc2.getHostPort(true)); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected Component createInputPanel() |
| | | { |
| | | JPanel panel = new JPanel(new GridBagLayout()); |
| | |
| | | return panel; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getInstructions() |
| | | { |
| | | return INFO_REMOTE_REPLICATION_PORT_INSTRUCTIONS.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getTitle() |
| | | { |
| | | return INFO_REMOTE_REPLICATION_PORT_TITLE.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void beginDisplay(UserData data) |
| | | { |
| | | TreeSet<ServerDescriptor> array = orderServers( |
| | |
| | | !newServerDisplay.equals(serverToConnectDisplay)) |
| | | { |
| | | serverToConnectDisplay = newServerDisplay; |
| | | /** |
| | | * Adds the required focus listeners to the fields. |
| | | */ |
| | | // Adds the required focus listeners to the fields. |
| | | final FocusListener l = new FocusListener() |
| | | { |
| | | public void focusGained(FocusEvent e) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void endDisplay() |
| | | { |
| | | if (lastFocusComponent != null) |
| | |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.quicksetup.installer.ui; |
| | | |
| | |
| | | private JavaArguments defaultServerJavaArgs; |
| | | private JavaArguments defaultImportJavaArgs; |
| | | |
| | | // The size of the LDIF file to be imported used as threshold to display |
| | | // a warning message, telling the user to update the import runtime |
| | | // settings. |
| | | /** |
| | | * The size of the LDIF file to be imported used as threshold to display |
| | | * a warning message, telling the user to update the import runtime settings. |
| | | */ |
| | | private static final long WARNING_THRESOLD_FOR_IMPORT = 200 * 1024 * 1024; |
| | | private static final int WARNING_THRESOLD_AUTOMATICALLY_GENERATED_IMPORT |
| | | = 100000; |
| | |
| | | addFocusListeners(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected Component createInputPanel() |
| | | { |
| | | JPanel panel = new JPanel(new GridBagLayout()); |
| | |
| | | return panel; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getInstructions() |
| | | { |
| | | return INFO_JAVA_RUNTIME_OPTIONS_PANEL_INSTRUCTIONS.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getTitle() |
| | | { |
| | | return INFO_JAVA_RUNTIME_OPTIONS_PANEL_TITLE.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Object getFieldValue(FieldName fieldName) |
| | | { |
| | |
| | | return value; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void beginDisplay(UserData uData) |
| | | { |
| | |
| | | updateWarningMessage(uData); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void endDisplay() |
| | | { |
| | | if (lastFocusComponent != null) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean requiresScroll() |
| | | { |
| | | return false; |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.quicksetup.installer.ui; |
| | | |
| | | import java.awt.Component; |
| | |
| | | addFocusListeners(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Object getFieldValue(FieldName fieldName) |
| | | { |
| | | Object value = null; |
| | |
| | | return value; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void displayFieldInvalid(FieldName fieldName, boolean invalid) |
| | | { |
| | | JLabel label = getLabel(fieldName); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected Component createInputPanel() |
| | | { |
| | | JPanel panel = new JPanel(new GridBagLayout()); |
| | |
| | | return panel; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getInstructions() |
| | | { |
| | | if (Utils.isWebStart()) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getTitle() |
| | | { |
| | | return INFO_SERVER_SETTINGS_PANEL_TITLE.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void endDisplay() |
| | | { |
| | | if (lastFocusComponent != null) |
| | |
| | | new TreeSet<SuffixDescriptor>(this); |
| | | private HashMap<String, JCheckBox> hmCheckBoxes = |
| | | new HashMap<String, JCheckBox>(); |
| | | // The display of the server the user provided in the replication options |
| | | // panel |
| | | /** |
| | | * The display of the server the user provided in the replication options |
| | | * panel. |
| | | */ |
| | | private String serverToConnectDisplay; |
| | | |
| | | private JLabel noSuffixLabel; |
| | |
| | | createComponents(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Object getFieldValue(FieldName fieldName) |
| | | { |
| | | Object value = null; |
| | |
| | | return value; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public int compare(SuffixDescriptor desc1, SuffixDescriptor desc2) |
| | | { |
| | | int result = compareSuffixDN(desc1, desc2); |
| | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected Component createInputPanel() |
| | | { |
| | | JPanel panel = new JPanel(new GridBagLayout()); |
| | |
| | | return panel; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected boolean requiresScroll() |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getInstructions() |
| | | { |
| | | return INFO_SUFFIXES_TO_REPLICATE_PANEL_INSTRUCTIONS.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getTitle() |
| | | { |
| | | return INFO_SUFFIXES_TO_REPLICATE_PANEL_TITLE.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void beginDisplay(UserData data) |
| | | { |
| | | TreeSet<SuffixDescriptor> array = orderSuffixes( |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.quicksetup.installer.webstart; |
| | | |
| | | import java.io.File; |
| | |
| | | System.setOut(origOut); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Integer getRatio(ProgressStep status) |
| | | { |
| | | return hmRatio.get(status); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage getSummary(ProgressStep status) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getInstallationPath() |
| | | { |
| | | return getUserData().getServerLocation(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getInstancePath() |
| | | { |
| | | // TODO |
| | | return getUserData().getServerLocation(); |
| | | |
| | | } |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.quicksetup.ui; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | return b; |
| | | } |
| | | |
| | | /* |
| | | * Create the buttons. |
| | | */ |
| | | private void createButtons() |
| | | { |
| | | GuiApplication application = getApplication(); |
| | |
| | | super(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ViewFactory getViewFactory() |
| | | { |
| | | return new MyHTMLFactory(); |
| | |
| | | */ |
| | | class MyHTMLFactory extends HTMLFactory |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public View create(Element elem) |
| | | { |
| | | View v = super.create(elem); |
| | |
| | | super(elem); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | if (ev != null && ev.getWhen() != lastActionWhen) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected Component createComponent() |
| | | { |
| | | Component comp = super.createComponent(); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.quicksetup.ui; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | |
| | | /** |
| | | * This panel is used to show the application is finished. |
| | | * |
| | | */ |
| | | public class FinishedPanel extends ProgressPanel |
| | | { |
| | |
| | | super(application); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getTitle() |
| | | { |
| | | return INFO_FINISHED_PANEL_TITLE.get(); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.ui; |
| | | |
| | | import java.awt.Component; |
| | |
| | | super(application); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected Component createInputPanel() |
| | | { |
| | | JPanel panel = new JPanel(new GridBagLayout()); |
| | |
| | | return panel; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getInstructions() |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected LocalizableMessage getTitle() |
| | | { |
| | | return INFO_PROGRESS_PANEL_TITLE.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected boolean requiresScroll() |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void endDisplay() |
| | | { |
| | | if (lastFocusComponent != null) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void displayProgress(ProgressDescriptor descriptor) |
| | | { |
| | | ProgressStep status = descriptor.getProgressStep(); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.quicksetup.ui; |
| | | |
| | | import org.opends.quicksetup.event.ButtonActionListener; |
| | |
| | | |
| | | private ProgressDescriptor descriptorToDisplay; |
| | | |
| | | // Update period of the dialogs. |
| | | /** Update period of the dialogs. */ |
| | | private static final int UPDATE_PERIOD = 500; |
| | | |
| | | // The full pathname of the MacOS X LaunchServices OPEN(1) helper. |
| | | /** The full pathname of the MacOS X LaunchServices OPEN(1) helper. */ |
| | | private static final String MAC_APPLICATIONS_OPENER = "/usr/bin/open"; |
| | | |
| | | /** |
| | |
| | | setCurrentStep(Step.WELCOME); |
| | | } |
| | | |
| | | /** |
| | | * Method called when user clicks 'Close' button of the wizard. |
| | | * |
| | | */ |
| | | /** Method called when user clicks 'Close' button of the wizard. */ |
| | | private void closeClicked() |
| | | { |
| | | WizardStep cStep = getCurrentStep(); |
| | |
| | | Map<String, String> env = pb.environment(); |
| | | env.put(SetupUtils.OPENDJ_JAVA_HOME, System.getProperty("java.home")); |
| | | Process process = pb.start(); |
| | | /** |
| | | /* |
| | | * Wait for 3 seconds. Assume that if the process has not exited |
| | | * everything went fine. |
| | | */ |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.ui; |
| | | |
| | | import java.awt.CardLayout; |
| | |
| | | |
| | | private boolean isCheckingVisible; |
| | | |
| | | /* We can use a HashMap (not multi-thread safe) because all |
| | | the calls to this object are done in the event-thread. |
| | | /** |
| | | * We can use a HashMap (not multi-thread safe) because all |
| | | * the calls to this object are done in the event-thread. |
| | | */ |
| | | private HashMap<String, URLWorker> hmURLWorkers = |
| | | new HashMap<String, URLWorker>(); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.ui; |
| | | |
| | | import javax.swing.*; |
| | |
| | | */ |
| | | protected abstract JPanel createFieldsPanel(); |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | protected Component createInputPanel() |
| | | { |
| | | JPanel panel = UIFactory.makeJPanel(); |
| | |
| | | setBorder(new EmptyBorder(3, 3, 3, 3)); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setText(String text) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void scrollRectToVisible(Rectangle rect) |
| | | { |
| | |
| | | { |
| | | this.tf = tf; |
| | | } |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void focusGained(FocusEvent e) |
| | | { |
| | | if ((tf.getText() == null) || "".equals(tf.getText())) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void focusLost(FocusEvent e) |
| | | { |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.quicksetup.util; |
| | | |
| | | import javax.swing.SwingUtilities; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class defines a thread that will be used to actually perform the |
| | | * processing for a background task. |
| | | * @param <T> type of object returned by the background task fed to this |
| | | * object |
| | | * @param <T> type of object returned by the background task fed to this object |
| | | */ |
| | | class BackgroundTaskThread<T> |
| | | extends Thread |
| | | { |
| | | // The background task that is to be processed. |
| | | /** The background task that is to be processed. */ |
| | | private final BackgroundTask<T> backgroundTask; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.quicksetup.util; |
| | | |
| | | import java.io.File; |
| | |
| | | /** |
| | | * This is a class used to be able to filter on certain type of files |
| | | * in the File Browser dialog. |
| | | * |
| | | */ |
| | | public class ExtensionFileFilter extends FileFilter |
| | | { |
| | |
| | | this.description = description; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean accept(File f) |
| | | { |
| | | boolean accept = false; |
| | |
| | | return accept; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public String getDescription() |
| | | { |
| | | return description; |
| | |
| | | this.overwrite = overwrite; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public FileOperation copyForChild(File child) { |
| | | return new CopyOperation(child, destination, overwrite); |
| | |
| | | return this.destination; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void apply() throws ApplicationException { |
| | | File objectFile = getObjectFile(); |
| | |
| | | this.deletionPolicy = deletionPolicy; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public FileOperation copyForChild(File child) { |
| | | return new DeleteOperation(child, deletionPolicy); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void apply() throws ApplicationException { |
| | | File file = getObjectFile(); |
| | |
| | | this.destination = new File(newParent, objectFile.getName()); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public FileOperation copyForChild(File child) { |
| | | return new MoveOperation(child, destination); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void apply() throws ApplicationException { |
| | | File objectFile = getObjectFile(); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.quicksetup.util; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | |
| | | |
| | | import org.opends.quicksetup.Constants; |
| | | |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | |
| | | /** |
| | | * This is an implementation of the ProgressMessageFormatter class that |
| | | * provides format in plain text. |
| | | * |
| | | */ |
| | | public class PlainTextProgressMessageFormatter |
| | | implements ProgressMessageFormatter |
| | |
| | | Constants.LINE_SEPARATOR+Constants.LINE_SEPARATOR); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public LocalizableMessage getFormattedAfterUrlClick(String url, LocalizableMessage lastText) |
| | | { |
| | | throw new IllegalStateException( |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.quicksetup.util; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | |
| | | this.url = url; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Object processBackgroundTask() throws WebBrowserException |
| | | { |
| | | try |
| | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void backgroundTaskCompleted(Object returnValue, |
| | | Throwable throwable) |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin; |
| | |
| | | public static class Builder extends |
| | | AbstractBuilder<Aci, ACIPropertyDefinition> { |
| | | |
| | | // Private constructor |
| | | /** Private constructor. */ |
| | | private Builder( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName) { |
| | | super(d, propertyName); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected ACIPropertyDefinition buildInstance( |
| | | AbstractManagedObjectDefinition<?, ?> d, |
| | |
| | | } |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private ACIPropertyDefinition( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | | EnumSet<PropertyOption> options, |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void validateValue(Aci value) |
| | | throws PropertyException { |
| | |
| | | // No additional validation required. |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Aci decodeValue(String value) |
| | | throws PropertyException { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitACI(this, p); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyValueVisitor<R, P> v, Aci value, P p) { |
| | | return v.visitACI(this, value, p); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int compare(Aci o1, Aci o2) { |
| | | return o1.toString().compareTo(o2.toString()); |
| | |
| | | public final class AbsoluteInheritedDefaultBehaviorProvider<T> extends |
| | | DefaultBehaviorProvider<T> { |
| | | |
| | | // The absolute path to the managed object containing the property. |
| | | /** The absolute path to the managed object containing the property. */ |
| | | private ManagedObjectPath<?, ?> path; |
| | | |
| | | // The string representation of the managed object path specifying |
| | | // the absolute location of the managed object. |
| | | /** |
| | | * The string representation of the managed object path specifying |
| | | * the absolute location of the managed object. |
| | | */ |
| | | private final String pathString; |
| | | |
| | | // The name of the property containing the inherited default values. |
| | | /** The name of the property containing the inherited default values. */ |
| | | private final String propertyName; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <R, P> R accept(DefaultBehaviorProviderVisitor<T, R, P> v, P p) { |
| | | return v.visitAbsoluteInherited(this, p); |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void initialize() throws Exception { |
| | | // Decode the path. |
| | |
| | | * |
| | | * |
| | | * Copyright 2007-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin; |
| | |
| | | public abstract class AbstractManagedObjectDefinition |
| | | <C extends ConfigurationClient, S extends Configuration> { |
| | | |
| | | // The name of the definition. |
| | | /** The name of the definition. */ |
| | | private final String name; |
| | | |
| | | // The parent managed object definition if applicable. |
| | | /** The parent managed object definition if applicable. */ |
| | | private final AbstractManagedObjectDefinition<? super C, ? super S> parent; |
| | | |
| | | // The set of constraints associated with this managed object |
| | | // definition. |
| | | /** |
| | | * The set of constraints associated with this managed object |
| | | * definition. |
| | | */ |
| | | private final Collection<Constraint> constraints; |
| | | |
| | | // The set of property definitions applicable to this managed object |
| | | // definition. |
| | | /** |
| | | * The set of property definitions applicable to this managed object |
| | | * definition. |
| | | */ |
| | | private final Map<String, PropertyDefinition<?>> propertyDefinitions; |
| | | |
| | | // The set of relation definitions applicable to this managed object |
| | | // definition. |
| | | /** |
| | | * The set of relation definitions applicable to this managed object |
| | | * definition. |
| | | */ |
| | | private final Map<String, RelationDefinition<?, ?>> relationDefinitions; |
| | | |
| | | // The set of relation definitions directly referencing this managed |
| | | // object definition. |
| | | /** |
| | | * The set of relation definitions directly referencing this managed |
| | | * object definition. |
| | | */ |
| | | private final Set<RelationDefinition<C, S>> reverseRelationDefinitions; |
| | | |
| | | // The set of all property definitions associated with this managed |
| | | // object definition including inherited property definitions. |
| | | /** |
| | | * The set of all property definitions associated with this managed |
| | | * object definition including inherited property definitions. |
| | | */ |
| | | private final Map<String, PropertyDefinition<?>> allPropertyDefinitions; |
| | | |
| | | // The set of all relation definitions associated with this managed |
| | | // object definition including inherited relation definitions. |
| | | /** |
| | | * The set of all relation definitions associated with this managed |
| | | * object definition including inherited relation definitions. |
| | | */ |
| | | private final Map<String, RelationDefinition<?, ?>> allRelationDefinitions; |
| | | |
| | | // The set of aggregation property definitions applicable to this |
| | | // managed object definition. |
| | | /** |
| | | * The set of aggregation property definitions applicable to this |
| | | * managed object definition. |
| | | */ |
| | | private final Map<String, AggregationPropertyDefinition<?, ?>> |
| | | aggregationPropertyDefinitions; |
| | | |
| | | // The set of aggregation property definitions directly referencing this |
| | | // managed object definition. |
| | | /** |
| | | * The set of aggregation property definitions directly referencing this |
| | | * managed object definition. |
| | | */ |
| | | private final Vector<AggregationPropertyDefinition<?, ?>> |
| | | reverseAggregationPropertyDefinitions; |
| | | |
| | | // The set of all aggregation property definitions associated with this |
| | | // managed object definition including inherited relation definitions. |
| | | /** |
| | | * The set of all aggregation property definitions associated with this |
| | | * managed object definition including inherited relation definitions. |
| | | */ |
| | | private final Map<String, AggregationPropertyDefinition<?, ?>> |
| | | allAggregationPropertyDefinitions; |
| | | |
| | | // The set of tags associated with this managed object. |
| | | /** The set of tags associated with this managed object. */ |
| | | private final Set<Tag> allTags; |
| | | |
| | | // Options applicable to this definition. |
| | | /** Options applicable to this definition. */ |
| | | private final Set<ManagedObjectOption> options; |
| | | |
| | | // The set of managed object definitions which inherit from this definition. |
| | | /** The set of managed object definitions which inherit from this definition. */ |
| | | private final Map<String, |
| | | AbstractManagedObjectDefinition<? extends C, ? extends S>> children; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final String toString() { |
| | | StringBuilder builder = new StringBuilder(); |
| | |
| | | |
| | | |
| | | |
| | | // Register a relation definition in the referenced managed object |
| | | // definition's reverse lookup table. |
| | | /** |
| | | * Register a relation definition in the referenced managed object |
| | | * definition's reverse lookup table. |
| | | */ |
| | | private <CC extends ConfigurationClient, SS extends Configuration> |
| | | void registerReverseRelationDefinition(RelationDefinition<CC, SS> rd) { |
| | | rd.getChildDefinition().reverseRelationDefinitions.add(rd); |
| | |
| | | |
| | | |
| | | |
| | | // Register a aggregation property definition in the referenced managed object |
| | | // definition's reverse lookup table. |
| | | /** |
| | | * Register a aggregation property definition in the referenced managed object |
| | | * definition's reverse lookup table. |
| | | */ |
| | | private void registerReverseAggregationPropertyDefinition( |
| | | AggregationPropertyDefinition<?, ?> apd) { |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // Recursively descend definition hierarchy to find the best match definition. |
| | | /** Recursively descend definition hierarchy to find the best match definition. */ |
| | | private AbstractManagedObjectDefinition<? extends C, ? extends S> |
| | | resolveManagedObjectDefinitionAux( |
| | | AbstractManagedObjectDefinition<? extends C, ? extends S> d, |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | */ |
| | | SERVER_RESTART("server-restart"); |
| | | |
| | | // The user-friendly name of the type. |
| | | /** The user-friendly name of the type. */ |
| | | private final String name; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private Type(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() { |
| | | return name; |
| | |
| | | |
| | | } |
| | | |
| | | // The managed object definition associated with this administrator |
| | | // action. |
| | | /** |
| | | * The managed object definition associated with this administrator |
| | | * action. |
| | | */ |
| | | private final AbstractManagedObjectDefinition<?, ?> definition; |
| | | |
| | | // The name of the property definition associated with this |
| | | // administrator action. |
| | | /** |
| | | * The name of the property definition associated with this |
| | | * administrator action. |
| | | */ |
| | | private final String propertyName; |
| | | |
| | | // The type of administration action. |
| | | /** The type of administration action. */ |
| | | private final Type type; |
| | | |
| | | |
| | |
| | | <C extends ConfigurationClient, S extends Configuration> |
| | | extends AbstractBuilder<String, AggregationPropertyDefinition<C, S>> { |
| | | |
| | | // The string representation of the managed object path specifying |
| | | // the parent of the aggregated managed objects. |
| | | /** |
| | | * The string representation of the managed object path specifying |
| | | * the parent of the aggregated managed objects. |
| | | */ |
| | | private String parentPathString; |
| | | |
| | | // The name of a relation in the parent managed object which |
| | | // contains the aggregated managed objects. |
| | | /** |
| | | * The name of a relation in the parent managed object which |
| | | * contains the aggregated managed objects. |
| | | */ |
| | | private String rdName; |
| | | |
| | | // The condition which is used to determine if a referenced |
| | | // managed object is enabled. |
| | | /** |
| | | * The condition which is used to determine if a referenced |
| | | * managed object is enabled. |
| | | */ |
| | | private Condition targetIsEnabledCondition = Conditions.TRUE; |
| | | |
| | | // The condition which is used to determine whether or not |
| | | // referenced managed objects need to be enabled. |
| | | /** |
| | | * The condition which is used to determine whether or not |
| | | * referenced managed objects need to be enabled. |
| | | */ |
| | | private Condition targetNeedsEnablingCondition = Conditions.TRUE; |
| | | |
| | | |
| | | |
| | | // Private constructor |
| | | /** Private constructor. */ |
| | | private Builder(AbstractManagedObjectDefinition<?, ?> d, |
| | | String propertyName) { |
| | | super(d, propertyName); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected AggregationPropertyDefinition<C, S> buildInstance( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | |
| | | private class ReferentialIntegrityChangeListener implements |
| | | ServerManagedObjectChangeListener<S> { |
| | | |
| | | // The error message which should be returned if an attempt is |
| | | // made to disable the referenced component. |
| | | /** |
| | | * The error message which should be returned if an attempt is |
| | | * made to disable the referenced component. |
| | | */ |
| | | private final LocalizableMessage message; |
| | | |
| | | // The path of the referenced component. |
| | | /** The path of the referenced component. */ |
| | | private final ManagedObjectPath<C, S> path; |
| | | |
| | | |
| | | |
| | | // Creates a new referential integrity delete listener. |
| | | /** Creates a new referential integrity delete listener. */ |
| | | private ReferentialIntegrityChangeListener(ManagedObjectPath<C, S> path, |
| | | LocalizableMessage message) { |
| | | this.path = path; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | ServerManagedObject<? extends S> mo) { |
| | | try { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ServerManagedObject<? extends S> mo, |
| | | List<LocalizableMessage> unacceptableReasons) { |
| | |
| | | |
| | | |
| | | |
| | | // Gets the path associated with this listener. |
| | | /** Gets the path associated with this listener. */ |
| | | private ManagedObjectPath<C, S> getManagedObjectPath() { |
| | | return path; |
| | | } |
| | |
| | | private class ReferentialIntegrityDeleteListener implements |
| | | ConfigurationDeleteListener<S> { |
| | | |
| | | // The DN of the referenced configuration entry. |
| | | /** The DN of the referenced configuration entry. */ |
| | | private final DN dn; |
| | | |
| | | // The error message which should be returned if an attempt is |
| | | // made to delete the referenced component. |
| | | /** |
| | | * The error message which should be returned if an attempt is |
| | | * made to delete the referenced component. |
| | | */ |
| | | private final LocalizableMessage message; |
| | | |
| | | |
| | | |
| | | // Creates a new referential integrity delete listener. |
| | | /** Creates a new referential integrity delete listener. */ |
| | | private ReferentialIntegrityDeleteListener(DN dn, LocalizableMessage message) { |
| | | this.dn = dn; |
| | | this.message = message; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationDelete(S configuration) { |
| | | // This should not happen - the |
| | | // isConfigurationDeleteAcceptable() call-back should have |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationDeleteAcceptable(S configuration, |
| | | List<LocalizableMessage> unacceptableReasons) { |
| | | if (configuration.dn().equals(dn)) { |
| | |
| | | */ |
| | | private class ServerHandler extends ServerConstraintHandler { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isUsable(ServerManagedObject<?> managedObject, |
| | | Collection<LocalizableMessage> unacceptableReasons) throws ConfigException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void performPostAdd(ServerManagedObject<?> managedObject) |
| | | throws ConfigException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void performPostDelete(ServerManagedObject<?> managedObject) |
| | | throws ConfigException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void performPostModify(ServerManagedObject<?> managedObject) |
| | | throws ConfigException { |
| | |
| | | */ |
| | | private class SourceClientHandler extends ClientConstraintHandler { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAddAcceptable(ManagementContext context, |
| | | ManagedObject<?> managedObject, Collection<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isModifyAcceptable(ManagementContext context, |
| | | ManagedObject<?> managedObject, Collection<LocalizableMessage> unacceptableReasons) |
| | |
| | | */ |
| | | private class TargetClientHandler extends ClientConstraintHandler { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isDeleteAcceptable(ManagementContext context, |
| | | ManagedObjectPath<?, ?> path, Collection<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isModifyAcceptable(ManagementContext context, |
| | | ManagedObject<?> managedObject, Collection<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | // Find all managed objects which reference the named managed |
| | | // object using this property. |
| | | /** |
| | | * Find all managed objects which reference the named managed |
| | | * object using this property. |
| | | */ |
| | | private <CC extends ConfigurationClient> |
| | | List<ManagedObject<? extends CC>> findReferences( |
| | | ManagementContext context, AbstractManagedObjectDefinition<CC, ?> mod, |
| | |
| | | |
| | | |
| | | |
| | | // Find all instances of a specific type of managed object. |
| | | /** Find all instances of a specific type of managed object. */ |
| | | @SuppressWarnings("unchecked") |
| | | private <CC extends ConfigurationClient> |
| | | List<ManagedObject<? extends CC>> findInstances( |
| | |
| | | return new Builder<C, S>(d, propertyName); |
| | | } |
| | | |
| | | // The active server-side referential integrity change listeners |
| | | // associated with this property. |
| | | /** |
| | | * The active server-side referential integrity change listeners |
| | | * associated with this property. |
| | | */ |
| | | private final Map<DN, List<ReferentialIntegrityChangeListener>> |
| | | changeListeners = new HashMap<DN, |
| | | List<ReferentialIntegrityChangeListener>>(); |
| | | |
| | | // The active server-side referential integrity delete listeners |
| | | // associated with this property. |
| | | /** |
| | | * The active server-side referential integrity delete listeners |
| | | * associated with this property. |
| | | */ |
| | | private final Map<DN, List<ReferentialIntegrityDeleteListener>> |
| | | deleteListeners = new HashMap<DN, |
| | | List<ReferentialIntegrityDeleteListener>>(); |
| | | |
| | | // The name of the managed object which is the parent of the |
| | | // aggregated managed objects. |
| | | /** |
| | | * The name of the managed object which is the parent of the |
| | | * aggregated managed objects. |
| | | */ |
| | | private ManagedObjectPath<?, ?> parentPath; |
| | | |
| | | // The string representation of the managed object path specifying |
| | | // the parent of the aggregated managed objects. |
| | | /** |
| | | * The string representation of the managed object path specifying |
| | | * the parent of the aggregated managed objects. |
| | | */ |
| | | private final String parentPathString; |
| | | |
| | | // The name of a relation in the parent managed object which |
| | | // contains the aggregated managed objects. |
| | | /** |
| | | * The name of a relation in the parent managed object which |
| | | * contains the aggregated managed objects. |
| | | */ |
| | | private final String rdName; |
| | | |
| | | // The relation in the parent managed object which contains the |
| | | // aggregated managed objects. |
| | | /** |
| | | * The relation in the parent managed object which contains the |
| | | * aggregated managed objects. |
| | | */ |
| | | private InstantiableRelationDefinition<C, S> relationDefinition; |
| | | |
| | | // The source constraint. |
| | | /** The source constraint. */ |
| | | private final Constraint sourceConstraint; |
| | | |
| | | // The condition which is used to determine if a referenced managed |
| | | // object is enabled. |
| | | /** |
| | | * The condition which is used to determine if a referenced managed |
| | | * object is enabled. |
| | | */ |
| | | private final Condition targetIsEnabledCondition; |
| | | |
| | | // The condition which is used to determine whether or not |
| | | // referenced managed objects need to be enabled. |
| | | /** |
| | | * The condition which is used to determine whether or not |
| | | * referenced managed objects need to be enabled. |
| | | */ |
| | | private final Condition targetNeedsEnablingCondition; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private AggregationPropertyDefinition( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | | EnumSet<PropertyOption> options, AdministratorAction adminAction, |
| | |
| | | this.targetIsEnabledCondition = targetIsEnabledCondition; |
| | | this.sourceConstraint = new Constraint() { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<ClientConstraintHandler> getClientConstraintHandlers() { |
| | | ClientConstraintHandler handler = new SourceClientHandler(); |
| | | return Collections.singleton(handler); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<ServerConstraintHandler> getServerConstraintHandlers() { |
| | | ServerConstraintHandler handler = new ServerHandler(); |
| | | return Collections.singleton(handler); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitAggregation(this, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyValueVisitor<R, P> v, String value, P p) { |
| | | return v.visitAggregation(this, value, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String decodeValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String normalizeValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void toString(StringBuilder builder) { |
| | | super.toString(builder); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void validateValue(String value) throws PropertyException { |
| | | try { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | public void initialize() throws Exception { |
| | |
| | | // for actions performed against referenced managed objects. |
| | | Constraint constraint = new Constraint() { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<ClientConstraintHandler> getClientConstraintHandlers() { |
| | | ClientConstraintHandler handler = new TargetClientHandler(); |
| | | return Collections.singleton(handler); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<ServerConstraintHandler> getServerConstraintHandlers() { |
| | | return Collections.emptyList(); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | public final class AliasDefaultBehaviorProvider<T> extends |
| | | DefaultBehaviorProvider<T> { |
| | | |
| | | // The managed object definition associated with this default |
| | | // behavior. |
| | | /** |
| | | * The managed object definition associated with this default |
| | | * behavior. |
| | | */ |
| | | private final AbstractManagedObjectDefinition<?, ?> definition; |
| | | |
| | | // The name of the property definition associated with this default |
| | | // behavior. |
| | | /** |
| | | * The name of the property definition associated with this default |
| | | * behavior. |
| | | */ |
| | | private final String propertyName; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <R, P> R accept(DefaultBehaviorProviderVisitor<T, R, P> v, P p) { |
| | | return v.visitAlias(this, p); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin; |
| | |
| | | public static class Builder extends |
| | | AbstractBuilder<AttributeType, AttributeTypePropertyDefinition> { |
| | | |
| | | // Private constructor |
| | | /** Private constructor. */ |
| | | private Builder(AbstractManagedObjectDefinition<?, ?> d, |
| | | String propertyName) { |
| | | super(d, propertyName); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected AttributeTypePropertyDefinition buildInstance( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | |
| | | } |
| | | } |
| | | |
| | | // Flag indicating whether or not attribute type names should be |
| | | // validated against the schema. |
| | | /** |
| | | * Flag indicating whether or not attribute type names should be |
| | | * validated against the schema. |
| | | */ |
| | | private static boolean isCheckSchema = true; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private AttributeTypePropertyDefinition( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | | EnumSet<PropertyOption> options, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitAttributeType(this, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyValueVisitor<R, P> v, |
| | | AttributeType value, P p) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int compare(AttributeType o1, AttributeType o2) { |
| | | return o1.getNameOrOID().compareToIgnoreCase(o2.getNameOrOID()); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public AttributeType decodeValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String encodeValue(AttributeType value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void validateValue(AttributeType value) |
| | | throws PropertyException { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin; |
| | |
| | | public static class Builder extends |
| | | AbstractBuilder<Boolean, BooleanPropertyDefinition> { |
| | | |
| | | // Private constructor |
| | | /** Private constructor. */ |
| | | private Builder( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName) { |
| | | super(d, propertyName); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected BooleanPropertyDefinition buildInstance( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private BooleanPropertyDefinition( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | | EnumSet<PropertyOption> options, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void validateValue(Boolean value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Boolean decodeValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitBoolean(this, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyValueVisitor<R, P> v, Boolean value, P p) { |
| | | return v.visitBoolean(this, value, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int compare(Boolean o1, Boolean o2) { |
| | | return o1.compareTo(o2); |
| | |
| | | |
| | | } |
| | | |
| | | // The name of the manifest file listing the core configuration |
| | | // definition classes. |
| | | /** |
| | | * The name of the manifest file listing the core configuration |
| | | * definition classes. |
| | | */ |
| | | private static final String CORE_MANIFEST = "core.manifest"; |
| | | |
| | | // The name of the manifest file listing a extension's configuration |
| | | // definition classes. |
| | | /** |
| | | * The name of the manifest file listing a extension's configuration |
| | | * definition classes. |
| | | */ |
| | | private static final String EXTENSION_MANIFEST = "extension.manifest"; |
| | | |
| | | // The name of the lib directory. |
| | | /** The name of the lib directory. */ |
| | | private static final String LIB_DIR = "lib"; |
| | | |
| | | // The name of the extensions directory. |
| | | /** The name of the extensions directory. */ |
| | | private static final String EXTENSIONS_DIR = "extensions"; |
| | | |
| | | // The singleton instance. |
| | | /** The singleton instance. */ |
| | | private static final ClassLoaderProvider INSTANCE = new ClassLoaderProvider(); |
| | | |
| | | // Attribute name in jar's MANIFEST corresponding to the revision number. |
| | | /** Attribute name in jar's MANIFEST corresponding to the revision number. */ |
| | | private static final String REVISION_NUMBER = "Revision-Number"; |
| | | |
| | | // The attribute names for build information is name, version and revision |
| | | // number |
| | | /** |
| | | * The attribute names for build information is name, version and revision |
| | | * number. |
| | | */ |
| | | private static final String[] BUILD_INFORMATION_ATTRIBUTE_NAMES = |
| | | new String[]{Attributes.Name.EXTENSION_NAME.toString(), |
| | | Attributes.Name.IMPLEMENTATION_VERSION.toString(), |
| | |
| | | return INSTANCE; |
| | | } |
| | | |
| | | // Set of registered Jar files. |
| | | /** Set of registered Jar files. */ |
| | | private Set<File> jarFiles = new HashSet<File>(); |
| | | |
| | | // Underlying class loader used to load classes and resources (null |
| | | // if disabled). |
| | | // |
| | | // We contain a reference to the URLClassLoader rather than |
| | | // sub-class it so that it is possible to replace the loader at |
| | | // run-time. For example, when removing or replacing extension Jar |
| | | // files (the URLClassLoader only supports adding new |
| | | // URLs, not removal). |
| | | /** |
| | | * Underlying class loader used to load classes and resources (null |
| | | * if disabled).<br> |
| | | * We contain a reference to the URLClassLoader rather than |
| | | * sub-class it so that it is possible to replace the loader at run-time. |
| | | * For example, when removing or replacing extension Jar files |
| | | * (the URLClassLoader only supports adding new URLs, not removal). |
| | | */ |
| | | private MyURLClassLoader loader; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private ClassLoaderProvider() { |
| | | // No implementation required. |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.server.admin; |
| | |
| | | public static class Builder extends |
| | | AbstractBuilder<String, ClassPropertyDefinition> { |
| | | |
| | | // List of interfaces which property values must implement. |
| | | /** List of interfaces which property values must implement. */ |
| | | private List<String> instanceOfInterfaces; |
| | | |
| | | |
| | | |
| | | // Private constructor |
| | | /** Private constructor. */ |
| | | private Builder( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName) { |
| | | super(d, propertyName); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected ClassPropertyDefinition buildInstance( |
| | | AbstractManagedObjectDefinition<?, ?> d, |
| | |
| | | |
| | | } |
| | | |
| | | // Regular expression for validating class names. |
| | | /** Regular expression for validating class names. */ |
| | | private static final String CLASS_RE = |
| | | "^([A-Za-z][A-Za-z0-9_]*\\.)*[A-Za-z][A-Za-z0-9_]*(\\$[A-Za-z0-9_]+)*$"; |
| | | |
| | | /* |
| | | /** |
| | | * Flag indicating whether class property values should be validated. |
| | | */ |
| | | private static boolean allowClassValidation = true; |
| | |
| | | |
| | | |
| | | |
| | | // Load a named class. |
| | | /** Load a named class. */ |
| | | private static Class<?> loadClass(String className, boolean initialize) |
| | | throws ClassNotFoundException, LinkageError { |
| | | return Class.forName(className, initialize, ClassLoaderProvider |
| | | .getInstance().getClassLoader()); |
| | | } |
| | | |
| | | // List of interfaces which property values must implement. |
| | | /** List of interfaces which property values must implement. */ |
| | | private final List<String> instanceOfInterfaces; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private ClassPropertyDefinition( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | | EnumSet<PropertyOption> options, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitClass(this, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyValueVisitor<R, P> v, String value, P p) { |
| | | return v.visitClass(this, value, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String decodeValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String normalizeValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void validateValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /* |
| | | /** |
| | | * Make sure that named class implements the interfaces named by this |
| | | * definition. |
| | | */ |
| | |
| | | |
| | | |
| | | |
| | | /* |
| | | /** |
| | | * Do some basic checks to make sure the string representation is valid. |
| | | */ |
| | | private void validateClassName(String className) |
| | |
| | | */ |
| | | public final class DNPropertyDefinition extends PropertyDefinition<DN> { |
| | | |
| | | // Optional base DN which all valid values must be immediately |
| | | // subordinate to. |
| | | /** |
| | | * Optional base DN which all valid values must be immediately |
| | | * subordinate to. |
| | | */ |
| | | private final DN baseDN; |
| | | |
| | | |
| | |
| | | public static class Builder extends |
| | | AbstractBuilder<DN, DNPropertyDefinition> { |
| | | |
| | | // Optional base DN which all valid values must be immediately |
| | | // subordinate to. |
| | | /** |
| | | * Optional base DN which all valid values must be immediately |
| | | * subordinate to. |
| | | */ |
| | | private DN baseDN; |
| | | |
| | | |
| | | |
| | | // Private constructor |
| | | /** Private constructor. */ |
| | | private Builder( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName) { |
| | | super(d, propertyName); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected DNPropertyDefinition buildInstance( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private DNPropertyDefinition( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | | EnumSet<PropertyOption> options, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void validateValue(DN value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN decodeValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitDN(this, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyValueVisitor<R, P> v, DN value, P p) { |
| | | return v.visitDN(this, value, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int compare(DN o1, DN o2) { |
| | | return o1.compareTo(o2); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.admin; |
| | | |
| | |
| | | public static final class Builder |
| | | <C extends ConfigurationClient, S extends Configuration> { |
| | | |
| | | // The default managed object's definition. |
| | | /** The default managed object's definition. */ |
| | | private final ManagedObjectDefinition<C, S> definition; |
| | | |
| | | // The string encoded default managed object's properties. |
| | | /** The string encoded default managed object's properties. */ |
| | | private final Map<String, List<String>> propertyStringValues = |
| | | new HashMap<String, List<String>>(); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | // The default managed object's definition. |
| | | /** The default managed object's definition. */ |
| | | private final ManagedObjectDefinition<C, S> definition; |
| | | |
| | | // The string encoded default managed object's properties. |
| | | /** The string encoded default managed object's properties. */ |
| | | private final Map<String, List<String>> propertyStringValues; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private DefaultManagedObject(ManagedObjectDefinition<C, S> definition, |
| | | Map<String, List<String>> propertyStringValues) { |
| | | this.definition = definition; |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.admin; |
| | | |
| | |
| | | public final class DefinedDefaultBehaviorProvider<T> extends |
| | | DefaultBehaviorProvider<T> { |
| | | |
| | | // The collection of default values. |
| | | /** The collection of default values. */ |
| | | private final Collection<String> values; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <R, P> R accept(DefaultBehaviorProviderVisitor<T, R, P> v, P p) { |
| | | return v.visitDefined(this, p); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin; |
| | |
| | | |
| | | |
| | | |
| | | // Create the message. |
| | | /** Create the message. */ |
| | | private static LocalizableMessage createMessage(AbstractManagedObjectDefinition<?, ?> d, |
| | | Reason reason) { |
| | | LocalizableMessage ufn = d.getUserFriendlyName(); |
| | |
| | | } |
| | | } |
| | | |
| | | // The expected type of managed object. |
| | | /** The expected type of managed object. */ |
| | | private final AbstractManagedObjectDefinition<?, ?> d; |
| | | |
| | | // The reason why the definition could not be determined. |
| | | /** The reason why the definition could not be determined. */ |
| | | private final Reason reason; |
| | | |
| | | |
| | |
| | | */ |
| | | public final class DurationPropertyDefinition extends PropertyDefinition<Long> { |
| | | |
| | | // String used to represent unlimited durations. |
| | | /** String used to represent unlimited durations. */ |
| | | private static final String UNLIMITED = "unlimited"; |
| | | |
| | | // The base unit for this property definition. |
| | | /** The base unit for this property definition. */ |
| | | private final DurationUnit baseUnit; |
| | | |
| | | // The optional maximum unit for this property definition. |
| | | /** The optional maximum unit for this property definition. */ |
| | | private final DurationUnit maximumUnit; |
| | | |
| | | // The lower limit of the property value in milli-seconds. |
| | | /** The lower limit of the property value in milli-seconds. */ |
| | | private final long lowerLimit; |
| | | |
| | | // The optional upper limit of the property value in milli-seconds. |
| | | /** The optional upper limit of the property value in milli-seconds. */ |
| | | private final Long upperLimit; |
| | | |
| | | // Indicates whether this property allows the use of the "unlimited" |
| | | // duration value (represented using a -1L or the string |
| | | // "unlimited"). |
| | | /** |
| | | * Indicates whether this property allows the use of the "unlimited" |
| | | * duration value (represented using a -1L or the string |
| | | * "unlimited"). |
| | | */ |
| | | private final boolean allowUnlimited; |
| | | |
| | | |
| | |
| | | public static class Builder extends |
| | | AbstractBuilder<Long, DurationPropertyDefinition> { |
| | | |
| | | // The base unit for this property definition. |
| | | /** The base unit for this property definition. */ |
| | | private DurationUnit baseUnit = DurationUnit.SECONDS; |
| | | |
| | | // The optional maximum unit for this property definition. |
| | | /** The optional maximum unit for this property definition. */ |
| | | private DurationUnit maximumUnit; |
| | | |
| | | // The lower limit of the property value in milli-seconds. |
| | | /** The lower limit of the property value in milli-seconds. */ |
| | | private long lowerLimit; |
| | | |
| | | // The optional upper limit of the property value in |
| | | // milli-seconds. |
| | | /** |
| | | * The optional upper limit of the property value in |
| | | * milli-seconds. |
| | | */ |
| | | private Long upperLimit; |
| | | |
| | | // Indicates whether this property allows the use of the |
| | | // "unlimited" duration value (represented using a -1L or the |
| | | // string "unlimited"). |
| | | /** |
| | | * Indicates whether this property allows the use of the |
| | | * "unlimited" duration value (represented using a -1L or the |
| | | * string "unlimited"). |
| | | */ |
| | | private boolean allowUnlimited; |
| | | |
| | | |
| | | |
| | | // Private constructor |
| | | /** Private constructor. */ |
| | | private Builder(AbstractManagedObjectDefinition<?, ?> d, |
| | | String propertyName) { |
| | | super(d, propertyName); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected DurationPropertyDefinition buildInstance( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private DurationPropertyDefinition(AbstractManagedObjectDefinition<?, ?> d, |
| | | String propertyName, EnumSet<PropertyOption> options, |
| | | AdministratorAction adminAction, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void validateValue(Long value) throws PropertyException { |
| | | ifNull(value); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String encodeValue(Long value) throws PropertyException { |
| | | ifNull(value); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Long decodeValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitDuration(this, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyValueVisitor<R, P> v, Long value, P p) { |
| | | return v.visitDuration(this, value, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void toString(StringBuilder builder) { |
| | | super.toString(builder); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int compare(Long o1, Long o2) { |
| | | return o1.compareTo(o2); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin; |
| | |
| | | public static class Builder<E extends Enum<E>> extends |
| | | AbstractBuilder<E, EnumPropertyDefinition<E>> { |
| | | |
| | | // The enumeration class. |
| | | /** The enumeration class. */ |
| | | private Class<E> enumClass; |
| | | |
| | | |
| | | |
| | | // Private constructor |
| | | /** Private constructor. */ |
| | | private Builder( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName) { |
| | | super(d, propertyName); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected EnumPropertyDefinition<E> buildInstance( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | |
| | | return new Builder<E>(d, propertyName); |
| | | } |
| | | |
| | | // The enumeration class. |
| | | /** The enumeration class. */ |
| | | private final Class<E> enumClass; |
| | | |
| | | // Map used for decoding values. |
| | | /** Map used for decoding values. */ |
| | | private final Map<String, E> decodeMap; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private EnumPropertyDefinition(AbstractManagedObjectDefinition<?, ?> d, |
| | | String propertyName, EnumSet<PropertyOption> options, |
| | | AdministratorAction adminAction, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitEnum(this, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyValueVisitor<R, P> v, E value, P p) { |
| | | return v.visitEnum(this, value, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public E decodeValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String normalizeValue(E value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void validateValue(E value) |
| | | throws PropertyException { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin; |
| | | |
| | |
| | | */ |
| | | private class ClientHandler extends ClientConstraintHandler { |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private ClientHandler() { |
| | | // No implementation required. |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAddAcceptable(ManagementContext context, |
| | | ManagedObject<?> managedObject, Collection<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isModifyAcceptable(ManagementContext context, |
| | | ManagedObject<?> managedObject, Collection<LocalizableMessage> unacceptableReasons) |
| | |
| | | */ |
| | | private class ServerHandler extends ServerConstraintHandler { |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private ServerHandler() { |
| | | // No implementation required. |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isUsable(ServerManagedObject<?> managedObject, |
| | | Collection<LocalizableMessage> unacceptableReasons) throws ConfigException { |
| | |
| | | |
| | | }; |
| | | |
| | | // The client-side constraint handler. |
| | | /** The client-side constraint handler. */ |
| | | private final ClientConstraintHandler clientHandler = new ClientHandler(); |
| | | |
| | | // The condition associated with this constraint. |
| | | /** The condition associated with this constraint. */ |
| | | private final Condition condition; |
| | | |
| | | // The managed object definition associated with this constraint. |
| | | /** The managed object definition associated with this constraint. */ |
| | | private final AbstractManagedObjectDefinition<?, ?> definition; |
| | | |
| | | // The constraint ID. |
| | | /** The constraint ID. */ |
| | | private final int id; |
| | | |
| | | // The server-side constraint handler. |
| | | /** The server-side constraint handler. */ |
| | | private final ServerConstraintHandler serverHandler = new ServerHandler(); |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<ClientConstraintHandler> getClientConstraintHandlers() { |
| | | return Collections.singleton(clientHandler); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<ServerConstraintHandler> getServerConstraintHandlers() { |
| | | return Collections.singleton(serverHandler); |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void initialize() throws Exception { |
| | | condition.initialize(definition); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin; |
| | |
| | | public static class Builder extends |
| | | AbstractBuilder<AddressMask, IPAddressMaskPropertyDefinition> { |
| | | |
| | | // Private constructor |
| | | /** Private constructor. */ |
| | | private Builder( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName) { |
| | | super(d, propertyName); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected IPAddressMaskPropertyDefinition buildInstance( |
| | | AbstractManagedObjectDefinition<?, ?> d, |
| | |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private IPAddressMaskPropertyDefinition( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | | EnumSet<PropertyOption> options, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void validateValue(AddressMask value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public AddressMask decodeValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitIPAddressMask(this, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyValueVisitor<R, P> v, AddressMask value, P p) { |
| | | return v.visitIPAddressMask(this, value, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int compare(AddressMask o1, AddressMask o2) { |
| | | return o1.toString().compareTo(o2.toString()); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin; |
| | |
| | | public static class Builder extends |
| | | AbstractBuilder<InetAddress, IPAddressPropertyDefinition> { |
| | | |
| | | // Private constructor |
| | | /** Private constructor. */ |
| | | private Builder( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName) { |
| | | super(d, propertyName); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected IPAddressPropertyDefinition buildInstance( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private IPAddressPropertyDefinition( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | | EnumSet<PropertyOption> options, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void validateValue(InetAddress value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public InetAddress decodeValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String encodeValue(InetAddress value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitIPAddress(this, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyValueVisitor<R, P> v, InetAddress value, P p) { |
| | | return v.visitIPAddress(this, value, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int compare(InetAddress o1, InetAddress o2) { |
| | | return o1.getHostAddress().compareTo(o2.getHostAddress()); |
| | |
| | | <C extends ConfigurationClient, S extends Configuration> |
| | | extends AbstractBuilder<C, S, InstantiableRelationDefinition<C, S>> { |
| | | |
| | | // The optional naming property definition. |
| | | /** The optional naming property definition. */ |
| | | private PropertyDefinition<?> namingPropertyDefinition; |
| | | |
| | | // The plural name of the relation. |
| | | /** The plural name of the relation. */ |
| | | private final String pluralName; |
| | | |
| | | // The optional default managed objects associated with this |
| | | // instantiable relation definition. |
| | | /** |
| | | * The optional default managed objects associated with this |
| | | * instantiable relation definition. |
| | | */ |
| | | private final Map<String, DefaultManagedObject<? extends C, ? extends S>> |
| | | defaultManagedObjects = new HashMap<String, |
| | | DefaultManagedObject<? extends C, ? extends S>>(); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected InstantiableRelationDefinition<C, S> buildInstance( |
| | | Common<C, S> common) { |
| | |
| | | |
| | | } |
| | | |
| | | // The optional naming property definition. |
| | | /** The optional naming property definition. */ |
| | | private final PropertyDefinition<?> namingPropertyDefinition; |
| | | |
| | | // The plural name of the relation. |
| | | /** The plural name of the relation. */ |
| | | private final String pluralName; |
| | | |
| | | // The optional default managed objects associated with this |
| | | // instantiable relation definition. |
| | | /** |
| | | * The optional default managed objects associated with this |
| | | * instantiable relation definition. |
| | | */ |
| | | private final Map<String, DefaultManagedObject<? extends C, ? extends S>> |
| | | defaultManagedObjects; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private InstantiableRelationDefinition(Common<C, S> common, |
| | | String pluralName, |
| | | PropertyDefinition<?> namingPropertyDefinition, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(RelationDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitInstantiable(this, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void toString(StringBuilder builder) { |
| | | builder.append("name="); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void initialize() throws Exception { |
| | | for (DefaultManagedObject<?, ?> dmo : defaultManagedObjects.values()) { |
| | |
| | | public final class IntegerPropertyDefinition extends |
| | | PropertyDefinition<Integer> { |
| | | |
| | | // String used to represent unlimited. |
| | | /** String used to represent unlimited. */ |
| | | private static final String UNLIMITED = "unlimited"; |
| | | |
| | | // The lower limit of the property value. |
| | | /** The lower limit of the property value. */ |
| | | private final int lowerLimit; |
| | | |
| | | // The optional upper limit of the property value. |
| | | /** The optional upper limit of the property value. */ |
| | | private final Integer upperLimit; |
| | | |
| | | // Indicates whether this property allows the use of the "unlimited" value |
| | | // (represented using a -1 or the string "unlimited"). |
| | | /** |
| | | * Indicates whether this property allows the use of the "unlimited" value |
| | | * (represented using a -1 or the string "unlimited"). |
| | | */ |
| | | private final boolean allowUnlimited; |
| | | |
| | | |
| | |
| | | public static class Builder extends |
| | | AbstractBuilder<Integer, IntegerPropertyDefinition> { |
| | | |
| | | // The lower limit of the property value. |
| | | /** The lower limit of the property value. */ |
| | | private int lowerLimit; |
| | | |
| | | // The optional upper limit of the property value. |
| | | /** The optional upper limit of the property value. */ |
| | | private Integer upperLimit; |
| | | |
| | | // Indicates whether this property allows the use of the "unlimited" value |
| | | // (represented using a -1 or the string "unlimited"). |
| | | /** |
| | | * Indicates whether this property allows the use of the "unlimited" value |
| | | * (represented using a -1 or the string "unlimited"). |
| | | */ |
| | | private boolean allowUnlimited; |
| | | |
| | | |
| | | |
| | | // Private constructor |
| | | /** Private constructor. */ |
| | | private Builder( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName) { |
| | | super(d, propertyName); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected IntegerPropertyDefinition buildInstance( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private IntegerPropertyDefinition( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | | EnumSet<PropertyOption> options, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void validateValue(Integer value) |
| | | throws PropertyException { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String encodeValue(Integer value) |
| | | throws PropertyException { |
| | |
| | | return value.toString(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Integer decodeValue(String value) throws PropertyException { |
| | | ifNull(value); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitInteger(this, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyValueVisitor<R, P> v, Integer value, P p) { |
| | | return v.visitInteger(this, value, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void toString(StringBuilder builder) { |
| | | super.toString(builder); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int compare(Integer o1, Integer o2) { |
| | | return o1.compareTo(o2); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.server.admin; |
| | |
| | | } |
| | | } |
| | | |
| | | // The singleton instance. |
| | | /** The singleton instance. */ |
| | | private static final LDAPProfile INSTANCE = new LDAPProfile(); |
| | | |
| | | |
| | |
| | | return INSTANCE; |
| | | } |
| | | |
| | | // The list of profile wrappers. |
| | | /** The list of profile wrappers. */ |
| | | private final LinkedList<Wrapper> profiles = new LinkedList<Wrapper>();; |
| | | |
| | | // The LDAP profile property table. |
| | | /** The LDAP profile property table. */ |
| | | private final ManagedObjectDefinitionResource resource = |
| | | ManagedObjectDefinitionResource.createForProfile("ldap"); |
| | | |
| | | |
| | | |
| | | // Prevent construction. |
| | | /** Prevent construction. */ |
| | | private LDAPProfile() { |
| | | // No implementation required. |
| | | } |
| | |
| | | */ |
| | | public final class ManagedObjectDefinitionI18NResource { |
| | | |
| | | // Application-wide set of instances. |
| | | /** Application-wide set of instances. */ |
| | | private static final Map<String, ManagedObjectDefinitionI18NResource> |
| | | INSTANCES = new HashMap<String, ManagedObjectDefinitionI18NResource>(); |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // Get a resource instance creating it if necessary. |
| | | /** Get a resource instance creating it if necessary. */ |
| | | private static synchronized ManagedObjectDefinitionI18NResource getInstance( |
| | | String prefix) { |
| | | ManagedObjectDefinitionI18NResource instance = INSTANCES.get(prefix); |
| | |
| | | |
| | | |
| | | |
| | | // Mapping from definition to locale-based resource bundle. |
| | | /** Mapping from definition to locale-based resource bundle. */ |
| | | private final Map<AbstractManagedObjectDefinition<?, ?>, |
| | | Map<Locale, ResourceBundle>> resources; |
| | | |
| | | |
| | | |
| | | // The resource name prefix. |
| | | /** The resource name prefix. */ |
| | | private final String prefix; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private ManagedObjectDefinitionI18NResource(String prefix) { |
| | | this.resources = new HashMap<AbstractManagedObjectDefinition<?, ?>, |
| | | Map<Locale, ResourceBundle>>(); |
| | |
| | | |
| | | |
| | | |
| | | // Retrieve the resource bundle associated with a managed object and |
| | | // locale, lazily loading it if necessary. |
| | | /** |
| | | * Retrieve the resource bundle associated with a managed object and |
| | | * locale, lazily loading it if necessary. |
| | | */ |
| | | private synchronized ResourceBundle getResourceBundle( |
| | | AbstractManagedObjectDefinition<?, ?> d, Locale locale) |
| | | throws MissingResourceException, UnsupportedOperationException { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.server.admin; |
| | |
| | | */ |
| | | public final class ManagedObjectDefinitionResource { |
| | | |
| | | // Mapping from definition to property tables. |
| | | /** Mapping from definition to property tables. */ |
| | | private final Map<AbstractManagedObjectDefinition<?, ?>, |
| | | Properties> properties; |
| | | |
| | | // The resource name prefix. |
| | | /** The resource name prefix. */ |
| | | private final String prefix; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private ManagedObjectDefinitionResource(String prefix) { |
| | | this.properties = |
| | | new HashMap<AbstractManagedObjectDefinition<?, ?>, Properties>(); |
| | |
| | | |
| | | |
| | | |
| | | // Retrieve the properties table associated with a managed object, |
| | | // lazily loading it if necessary. |
| | | /** |
| | | * Retrieve the properties table associated with a managed object, |
| | | * lazily loading it if necessary. |
| | | */ |
| | | private synchronized Properties getProperties( |
| | | AbstractManagedObjectDefinition<?, ?> d) |
| | | throws MissingResourceException { |
| | |
| | | private static final class DNSerializer implements |
| | | ManagedObjectPathSerializer { |
| | | |
| | | // The current DN. |
| | | /** The current DN. */ |
| | | private DN dn; |
| | | |
| | | // The LDAP profile. |
| | | /** The LDAP profile. */ |
| | | private final LDAPProfile profile; |
| | | |
| | | |
| | | |
| | | // Create a new DN builder. |
| | | /** Create a new DN builder. */ |
| | | private DNSerializer() { |
| | | this.dn = DN.rootDN(); |
| | | this.profile = LDAPProfile.getInstance(); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | void appendManagedObjectPathElement( |
| | | InstantiableRelationDefinition<? super C, ? super S> r, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | void appendManagedObjectPathElement( |
| | | SetRelationDefinition<? super C, ? super S> r, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | void appendManagedObjectPathElement( |
| | | OptionalRelationDefinition<? super C, ? super S> r, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | void appendManagedObjectPathElement( |
| | | SingletonRelationDefinition<? super C, ? super S> r, |
| | |
| | | |
| | | |
| | | |
| | | // Appends the RDN sequence representing the provided relation. |
| | | /** Appends the RDN sequence representing the provided relation. */ |
| | | private void appendManagedObjectPathElement(RelationDefinition<?, ?> r) { |
| | | // Add the RDN sequence representing the relation. |
| | | try { |
| | |
| | | |
| | | |
| | | |
| | | // Gets the serialized DN value. |
| | | /** Gets the serialized DN value. */ |
| | | private DN toDN() { |
| | | return dn; |
| | | } |
| | |
| | | private static abstract class Element<C extends ConfigurationClient, |
| | | S extends Configuration> { |
| | | |
| | | // The type of managed object referenced by this element. |
| | | /** The type of managed object referenced by this element. */ |
| | | private final AbstractManagedObjectDefinition<C, S> definition; |
| | | |
| | | |
| | |
| | | <C extends ConfigurationClient, S extends Configuration> |
| | | extends Element<C, S> { |
| | | |
| | | // Factory method. |
| | | /** Factory method. */ |
| | | private static <C extends ConfigurationClient, |
| | | S extends Configuration> |
| | | InstantiableElement<C, S> create( |
| | |
| | | return new InstantiableElement<C, S>(r, d, name); |
| | | } |
| | | |
| | | // The name of the managed object. |
| | | /** The name of the managed object. */ |
| | | private final String name; |
| | | |
| | | // The instantiable relation. |
| | | /** The instantiable relation. */ |
| | | private final InstantiableRelationDefinition<? super C, ? super S> r; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private InstantiableElement( |
| | | InstantiableRelationDefinition<? super C, ? super S> r, |
| | | AbstractManagedObjectDefinition<C, S> d, String name) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getName() { |
| | | return name; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public InstantiableRelationDefinition<? super C, ? super S> |
| | | getRelationDefinition() { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void serialize(ManagedObjectPathSerializer serializer) { |
| | | serializer.appendManagedObjectPathElement(r, |
| | |
| | | <C extends ConfigurationClient, S extends Configuration> |
| | | extends Element<C, S> { |
| | | |
| | | // Factory method. |
| | | /** Factory method. */ |
| | | private static <C extends ConfigurationClient, |
| | | S extends Configuration> OptionalElement<C, S> create( |
| | | OptionalRelationDefinition<? super C, ? super S> r, |
| | |
| | | return new OptionalElement<C, S>(r, d); |
| | | } |
| | | |
| | | // The optional relation. |
| | | /** The optional relation. */ |
| | | private final OptionalRelationDefinition<? super C, ? super S> r; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private OptionalElement(OptionalRelationDefinition<? super C, ? super S> r, |
| | | AbstractManagedObjectDefinition<C, S> d) { |
| | | super(d); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public OptionalRelationDefinition<? super C, ? super S> |
| | | getRelationDefinition() { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void serialize(ManagedObjectPathSerializer serializer) { |
| | | serializer |
| | |
| | | <C extends ConfigurationClient, S extends Configuration> |
| | | extends Element<C, S> { |
| | | |
| | | // Factory method. |
| | | /** Factory method. */ |
| | | private static <C extends ConfigurationClient, |
| | | S extends Configuration> |
| | | SetElement<C, S> create( |
| | |
| | | return new SetElement<C, S>(r, d); |
| | | } |
| | | |
| | | // The set relation. |
| | | /** The set relation. */ |
| | | private final SetRelationDefinition<? super C, ? super S> r; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private SetElement( |
| | | SetRelationDefinition<? super C, ? super S> r, |
| | | AbstractManagedObjectDefinition<C, S> d) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public SetRelationDefinition<? super C, ? super S> |
| | | getRelationDefinition() { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void serialize(ManagedObjectPathSerializer serializer) { |
| | | serializer.appendManagedObjectPathElement(r, |
| | |
| | | <C extends ConfigurationClient, S extends Configuration> |
| | | extends Element<C, S> { |
| | | |
| | | // Factory method. |
| | | /** Factory method. */ |
| | | private static <C extends ConfigurationClient, |
| | | S extends Configuration> SingletonElement<C, S> create( |
| | | SingletonRelationDefinition<? super C, ? super S> r, |
| | |
| | | return new SingletonElement<C, S>(r, d); |
| | | } |
| | | |
| | | // The singleton relation. |
| | | /** The singleton relation. */ |
| | | private final SingletonRelationDefinition<? super C, ? super S> r; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private SingletonElement( |
| | | SingletonRelationDefinition<? super C, ? super S> r, |
| | | AbstractManagedObjectDefinition<C, S> d) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public SingletonRelationDefinition<? super C, ? super S> |
| | | getRelationDefinition() { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void serialize(ManagedObjectPathSerializer serializer) { |
| | | serializer |
| | |
| | | private static final class StringSerializer implements |
| | | ManagedObjectPathSerializer { |
| | | |
| | | // Serialize to this string builder. |
| | | /** Serialize to this string builder. */ |
| | | private final StringBuilder builder; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private StringSerializer(StringBuilder builder) { |
| | | this.builder = builder; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <M extends ConfigurationClient, N extends Configuration> |
| | | void appendManagedObjectPathElement( |
| | | InstantiableRelationDefinition<? super M, ? super N> r, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <M extends ConfigurationClient, N extends Configuration> |
| | | void appendManagedObjectPathElement( |
| | | OptionalRelationDefinition<? super M, ? super N> r, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <M extends ConfigurationClient, N extends Configuration> |
| | | void appendManagedObjectPathElement( |
| | | SingletonRelationDefinition<? super M, ? super N> r, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <M extends ConfigurationClient, N extends Configuration> |
| | | void appendManagedObjectPathElement( |
| | | SetRelationDefinition<? super M, ? super N> r, |
| | |
| | | |
| | | |
| | | |
| | | // Common element serialization. |
| | | /** Common element serialization. */ |
| | | private <M, N> void serializeElement(RelationDefinition<?, ?> r, |
| | | AbstractManagedObjectDefinition<?, ?> d) { |
| | | // Always specify the relation name. |
| | |
| | | } |
| | | } |
| | | |
| | | // Single instance of a root path. |
| | | /** Single instance of a root path. */ |
| | | private static final ManagedObjectPath<RootCfgClient, RootCfg> EMPTY_PATH = |
| | | new ManagedObjectPath<RootCfgClient, RootCfg>( |
| | | new LinkedList<Element<?, ?>>(), null, RootCfgDefn.getInstance()); |
| | | |
| | | // A regular expression used to parse path elements. |
| | | /** A regular expression used to parse path elements. */ |
| | | private static final Pattern PE_REGEXP = Pattern |
| | | .compile("^\\s*relation=\\s*([^+]+)\\s*" |
| | | + "(\\+\\s*type=\\s*([^+]+)\\s*)?" |
| | |
| | | |
| | | |
| | | |
| | | // Factory method required in order to allow generic wild-card |
| | | // construction of new paths. |
| | | /** |
| | | * Factory method required in order to allow generic wild-card |
| | | * construction of new paths. |
| | | */ |
| | | private static <C extends ConfigurationClient, S extends Configuration> |
| | | ManagedObjectPath<C, S> create( |
| | | LinkedList<Element<?, ?>> elements, Element<C, S> lastElement) { |
| | |
| | | |
| | | |
| | | |
| | | // Decode an element. |
| | | /** Decode an element. */ |
| | | private static <C extends ConfigurationClient, S extends Configuration> |
| | | Element<? extends C, ? extends S> createElement( |
| | | RelationDefinition<C, S> r, String path, String element, String type, |
| | |
| | | } |
| | | } |
| | | |
| | | // The managed object definition in this path. |
| | | /** The managed object definition in this path. */ |
| | | private final AbstractManagedObjectDefinition<C, S> d; |
| | | |
| | | // The list of path elements in this path. |
| | | /** The list of path elements in this path. */ |
| | | private final List<Element<?, ?>> elements; |
| | | |
| | | // The last relation definition in this path. |
| | | /** The last relation definition in this path. */ |
| | | private final RelationDefinition<? super C, ? super S> r; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private ManagedObjectPath(LinkedList<Element<?, ?>> elements, |
| | | RelationDefinition<? super C, ? super S> r, |
| | | AbstractManagedObjectDefinition<C, S> d) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean equals(Object obj) { |
| | | if (obj == this) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int hashCode() { |
| | | return toString().hashCode(); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() { |
| | | StringBuilder builder = new StringBuilder(); |
| | |
| | | <C extends ConfigurationClient, S extends Configuration> |
| | | extends AbstractBuilder<C, S, OptionalRelationDefinition<C, S>> { |
| | | |
| | | // The optional default managed object associated with this |
| | | // optional relation. |
| | | /** |
| | | * The optional default managed object associated with this |
| | | * optional relation. |
| | | */ |
| | | private DefaultManagedObject<? extends C, ? extends S> defaultManagedObject; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected OptionalRelationDefinition<C, S> buildInstance( |
| | | Common<C, S> common) { |
| | |
| | | |
| | | |
| | | |
| | | // The optional default managed object associated with this |
| | | // optional relation. |
| | | /** |
| | | * The optional default managed object associated with this |
| | | * optional relation. |
| | | */ |
| | | private final DefaultManagedObject<? extends C, ? extends S> |
| | | defaultManagedObject; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private OptionalRelationDefinition(Common<C, S> common, |
| | | DefaultManagedObject<? extends C, ? extends S> defaultManagedObject) { |
| | | super(common); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(RelationDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitOptional(this, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void toString(StringBuilder builder) { |
| | | builder.append("name="); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void initialize() throws Exception { |
| | | if (defaultManagedObject != null) { |
| | |
| | | protected static abstract class AbstractBuilder |
| | | <T, D extends PropertyDefinition<T>> { |
| | | |
| | | // The administrator action. |
| | | /** The administrator action. */ |
| | | private AdministratorAction adminAction; |
| | | |
| | | // The default behavior provider. |
| | | /** The default behavior provider. */ |
| | | private DefaultBehaviorProvider<T> defaultBehavior; |
| | | |
| | | // The abstract managed object |
| | | /** The abstract managed object. */ |
| | | private final AbstractManagedObjectDefinition<?, ?> definition; |
| | | |
| | | // The options applicable to this definition. |
| | | /** The options applicable to this definition. */ |
| | | private final EnumSet<PropertyOption> options; |
| | | |
| | | // The name of this property definition. |
| | | /** The name of this property definition. */ |
| | | private final String propertyName; |
| | | |
| | | |
| | |
| | | DefaultBehaviorProvider<T> defaultBehavior); |
| | | } |
| | | |
| | | // The administrator action. |
| | | /** The administrator action. */ |
| | | private final AdministratorAction adminAction; |
| | | |
| | | // The default behavior provider. |
| | | /** The default behavior provider. */ |
| | | private final DefaultBehaviorProvider<T> defaultBehavior; |
| | | |
| | | // The abstract managed object |
| | | /** The abstract managed object. */ |
| | | private final AbstractManagedObjectDefinition<?, ?> definition; |
| | | |
| | | // Options applicable to this definition. |
| | | /** Options applicable to this definition. */ |
| | | private final Set<PropertyOption> options; |
| | | |
| | | // The property name. |
| | | /** The property name. */ |
| | | private final String propertyName; |
| | | |
| | | // The property value class. |
| | | /** The property value class. */ |
| | | private final Class<T> theClass; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin; |
| | | |
| | |
| | | private class MyPropertyDefinitionVisitor extends |
| | | PropertyDefinitionVisitor<LocalizableMessage, Void> { |
| | | |
| | | // Flag indicating whether detailed syntax information will be |
| | | // generated. |
| | | /** |
| | | * Flag indicating whether detailed syntax information will be |
| | | * generated. |
| | | */ |
| | | private final boolean isDetailed; |
| | | |
| | | // The formatter to use for numeric values. |
| | | /** The formatter to use for numeric values. */ |
| | | private final NumberFormat numberFormat; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private MyPropertyDefinitionVisitor(boolean isDetailed) { |
| | | this.isDetailed = isDetailed; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | LocalizableMessage visitAggregation(AggregationPropertyDefinition<C, S> d, Void p) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage visitAttributeType(AttributeTypePropertyDefinition d, |
| | | Void p) { |
| | | return LocalizableMessage.raw("OID"); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage visitACI(ACIPropertyDefinition d, |
| | | Void p) { |
| | | public LocalizableMessage visitACI(ACIPropertyDefinition d, Void p) { |
| | | return LocalizableMessage.raw("ACI"); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage visitBoolean(BooleanPropertyDefinition d, Void p) { |
| | | if (isDetailed) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage visitClass(ClassPropertyDefinition d, Void p) { |
| | | if (isDetailed && !d.getInstanceOfInterface().isEmpty()) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage visitDN(DNPropertyDefinition d, Void p) { |
| | | if (isDetailed && d.getBaseDN() != null) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage visitDuration(DurationPropertyDefinition d, Void p) { |
| | | LocalizableMessageBuilder builder = new LocalizableMessageBuilder(); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <E extends Enum<E>> LocalizableMessage visitEnum(EnumPropertyDefinition<E> d, |
| | | Void p) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage visitInteger(IntegerPropertyDefinition d, Void p) { |
| | | LocalizableMessageBuilder builder = new LocalizableMessageBuilder(); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage visitIPAddress(IPAddressPropertyDefinition d, Void p) { |
| | | return LocalizableMessage.raw("HOST_NAME"); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage visitIPAddressMask(IPAddressMaskPropertyDefinition d, |
| | | Void p) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage visitSize(SizePropertyDefinition d, Void p) { |
| | | LocalizableMessageBuilder builder = new LocalizableMessageBuilder(); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage visitString(StringPropertyDefinition d, Void p) { |
| | | if (d.getPattern() != null) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <T> LocalizableMessage visitUnknown(PropertyDefinition<T> d, Void p) |
| | | throws PropertyException { |
| | |
| | | } |
| | | } |
| | | |
| | | // Underlying implementation. |
| | | /** Underlying implementation. */ |
| | | private final MyPropertyDefinitionVisitor pimpl; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions copyright 2014 ForgeRock AS. |
| | | * Portions copyright 2014-2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.server.admin; |
| | |
| | | |
| | | |
| | | |
| | | // Create the message. |
| | | /** Create the message. */ |
| | | private static LocalizableMessage createMessage(PropertyDefinition<?> pd, Object value) |
| | | { |
| | | PropertyDefinitionUsageBuilder builder = new PropertyDefinitionUsageBuilder(true); |
| | |
| | | |
| | | |
| | | |
| | | // LocalizableMessage that explains the problem. |
| | | /** LocalizableMessage that explains the problem. */ |
| | | private final LocalizableMessage message; |
| | | |
| | | /* |
| | | /** |
| | | * The property definition associated with the property that caused the |
| | | * exception. |
| | | */ |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.server.admin; |
| | |
| | | */ |
| | | private static final long serialVersionUID = -895548482881819610L; |
| | | |
| | | // The name of the property that could not be found. |
| | | /** The name of the property that could not be found. */ |
| | | private final String propertyName; |
| | | |
| | | |
| | |
| | | PropertyProvider DEFAULT_PROVIDER = |
| | | new PropertyProvider() { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <T> Collection<T> getPropertyValues(PropertyDefinition<T> d) |
| | | throws IllegalArgumentException { |
| | | return Collections.<T> emptySet(); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin; |
| | | |
| | |
| | | return new Reference<C, S>(p, rd, s); |
| | | } |
| | | |
| | | // The name of the referenced managed object. |
| | | /** The name of the referenced managed object. */ |
| | | private final String name; |
| | | |
| | | // The path of the referenced managed object. |
| | | /** The path of the referenced managed object. */ |
| | | private final ManagedObjectPath<C, S> path; |
| | | |
| | | // The instantiable relation in the parent which contains the |
| | | // referenced managed object. |
| | | /** |
| | | * The instantiable relation in the parent which contains the |
| | | * referenced managed object. |
| | | */ |
| | | private final InstantiableRelationDefinition<C, S> relation; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private Reference(ManagedObjectPath<?, ?> parent, |
| | | InstantiableRelationDefinition<C, S> relation, String name) |
| | | throws IllegalArgumentException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public String toString() { |
| | | return name; |
| | | } |
| | | |
| | | |
| | | |
| | | // Normalize a value using the specified naming property definition |
| | | // if defined. |
| | | /** |
| | | * Normalize a value using the specified naming property definition |
| | | * if defined. |
| | | */ |
| | | private <T> String normalizeName(PropertyDefinition<T> pd) { |
| | | if (pd != null) { |
| | | try { |
| | |
| | | <C extends ConfigurationClient, S extends Configuration, |
| | | D extends RelationDefinition<C, S>> { |
| | | |
| | | // Common fields. |
| | | /** Common fields. */ |
| | | private final Common<C, S> common; |
| | | |
| | | |
| | |
| | | protected static final class Common |
| | | <C extends ConfigurationClient, S extends Configuration> { |
| | | |
| | | // The definition of the child managed object. |
| | | /** The definition of the child managed object. */ |
| | | private final AbstractManagedObjectDefinition<C, S> cd; |
| | | |
| | | // The name of the relation. |
| | | /** The name of the relation. */ |
| | | private final String name; |
| | | |
| | | // Options applicable to this definition. |
| | | /** Options applicable to this definition. */ |
| | | private final Set<RelationOption> options; |
| | | |
| | | // The definition of the parent managed object. |
| | | /** The definition of the parent managed object. */ |
| | | private final AbstractManagedObjectDefinition<?, ?> pd; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private Common(AbstractManagedObjectDefinition<?, ?> pd, String name, |
| | | AbstractManagedObjectDefinition<C, S> cd) { |
| | | this.name = name; |
| | |
| | | } |
| | | } |
| | | |
| | | // Common fields. |
| | | /** Common fields. */ |
| | | private final Common<C, S> common; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final String toString() { |
| | | StringBuilder builder = new StringBuilder(); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.admin; |
| | | |
| | |
| | | public final class RelativeInheritedDefaultBehaviorProvider<T> extends |
| | | DefaultBehaviorProvider<T> { |
| | | |
| | | // The type of managed object expected at the relative offset. |
| | | /** The type of managed object expected at the relative offset. */ |
| | | private final AbstractManagedObjectDefinition<?, ?> d; |
| | | |
| | | // The relative offset (where 1 = parent, 2 = grandparent) of the |
| | | // managed object containing the property. |
| | | /** |
| | | * The relative offset (where 1 = parent, 2 = grandparent) of the |
| | | * managed object containing the property. |
| | | */ |
| | | private final int offset; |
| | | |
| | | // The name of the property containing the inherited default values. |
| | | /** The name of the property containing the inherited default values. */ |
| | | private final String propertyName; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <R, P> R accept(DefaultBehaviorProviderVisitor<T, R, P> v, P p) { |
| | | return v.visitRelativeInherited(this, p); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin; |
| | |
| | | extends AbstractBuilder<C, S, SetRelationDefinition<C, S>> |
| | | { |
| | | |
| | | // The plural name of the relation. |
| | | /** The plural name of the relation. */ |
| | | private final String pluralName; |
| | | |
| | | // The optional default managed objects associated with this |
| | | // set relation definition. |
| | | /** |
| | | * The optional default managed objects associated with this |
| | | * set relation definition. |
| | | */ |
| | | private final Map<String, |
| | | DefaultManagedObject<? extends C, ? extends S>> |
| | | defaultManagedObjects = |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected SetRelationDefinition<C, S> buildInstance( |
| | | Common<C, S> common) |
| | |
| | | |
| | | |
| | | |
| | | // The plural name of the relation. |
| | | /** The plural name of the relation. */ |
| | | private final String pluralName; |
| | | |
| | | // The optional default managed objects associated with this |
| | | // set relation definition. |
| | | /** |
| | | * The optional default managed objects associated with this |
| | | * set relation definition. |
| | | */ |
| | | private final Map<String, |
| | | DefaultManagedObject<? extends C, ? extends S>> |
| | | defaultManagedObjects; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private SetRelationDefinition( |
| | | Common<C, S> common, |
| | | String pluralName, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(RelationDefinitionVisitor<R, P> v, P p) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void toString(StringBuilder builder) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void initialize() throws Exception |
| | | { |
| | |
| | | <C extends ConfigurationClient, S extends Configuration> |
| | | extends AbstractBuilder<C, S, SingletonRelationDefinition<C, S>> { |
| | | |
| | | // The optional default managed object associated with this |
| | | // singleton relation. |
| | | /** |
| | | * The optional default managed object associated with this |
| | | * singleton relation. |
| | | */ |
| | | private DefaultManagedObject<? extends C, ? extends S> defaultManagedObject; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected SingletonRelationDefinition<C, S> buildInstance( |
| | | Common<C, S> common) { |
| | |
| | | |
| | | |
| | | |
| | | // The optional default managed object associated with this |
| | | // singleton relation. |
| | | /** |
| | | * The optional default managed object associated with this |
| | | * singleton relation. |
| | | */ |
| | | private final DefaultManagedObject<? extends C, ? extends S> |
| | | defaultManagedObject; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private SingletonRelationDefinition(Common<C, S> common, |
| | | DefaultManagedObject<? extends C, ? extends S> defaultManagedObject) { |
| | | super(common); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(RelationDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitSingleton(this, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void toString(StringBuilder builder) { |
| | | builder.append("name="); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void initialize() throws Exception { |
| | | if (defaultManagedObject != null) { |
| | |
| | | */ |
| | | public final class SizePropertyDefinition extends PropertyDefinition<Long> { |
| | | |
| | | // String used to represent unlimited memory sizes. |
| | | /** String used to represent unlimited memory sizes. */ |
| | | private static final String UNLIMITED = "unlimited"; |
| | | |
| | | // The lower limit of the property value in bytes. |
| | | /** The lower limit of the property value in bytes. */ |
| | | private final long lowerLimit; |
| | | |
| | | // The optional upper limit of the property value in bytes. |
| | | /** The optional upper limit of the property value in bytes. */ |
| | | private final Long upperLimit; |
| | | |
| | | // Indicates whether this property allows the use of the "unlimited" memory |
| | | // size value (represented using a -1L or the string "unlimited"). |
| | | /** |
| | | * Indicates whether this property allows the use of the "unlimited" memory |
| | | * size value (represented using a -1L or the string "unlimited"). |
| | | */ |
| | | private final boolean allowUnlimited; |
| | | |
| | | |
| | |
| | | public static class Builder extends |
| | | AbstractBuilder<Long, SizePropertyDefinition> { |
| | | |
| | | // The lower limit of the property value in bytes. |
| | | /** The lower limit of the property value in bytes. */ |
| | | private long lowerLimit; |
| | | |
| | | // The optional upper limit of the property value in bytes. |
| | | /** The optional upper limit of the property value in bytes. */ |
| | | private Long upperLimit; |
| | | |
| | | // Indicates whether this property allows the use of the "unlimited" memory |
| | | // size value (represented using a -1L or the string "unlimited"). |
| | | /** |
| | | * Indicates whether this property allows the use of the "unlimited" memory |
| | | * size value (represented using a -1L or the string "unlimited"). |
| | | */ |
| | | private boolean allowUnlimited; |
| | | |
| | | |
| | | |
| | | // Private constructor |
| | | /** Private constructor. */ |
| | | private Builder( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName) { |
| | | super(d, propertyName); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected SizePropertyDefinition buildInstance( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private SizePropertyDefinition( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | | EnumSet<PropertyOption> options, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void validateValue(Long value) throws PropertyException { |
| | | ifNull(value); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String encodeValue(Long value) throws PropertyException { |
| | | ifNull(value); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Long decodeValue(String value) throws PropertyException { |
| | | ifNull(value); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitSize(this, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyValueVisitor<R, P> v, Long value, P p) { |
| | | return v.visitSize(this, value, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void toString(StringBuilder builder) { |
| | | super.toString(builder); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int compare(Long o1, Long o2) { |
| | | return o1.compareTo(o2); |
| | |
| | | public static class Builder extends |
| | | AbstractBuilder<String, StringPropertyDefinition> { |
| | | |
| | | // Flag indicating whether values of this property are |
| | | // case-insensitive. |
| | | /** |
| | | * Flag indicating whether values of this property are |
| | | * case-insensitive. |
| | | */ |
| | | private boolean isCaseInsensitive = true; |
| | | |
| | | // Optional pattern which values of this property must match. |
| | | /** Optional pattern which values of this property must match. */ |
| | | private Pattern pattern; |
| | | |
| | | // Pattern usage which provides a user-friendly summary of the |
| | | // pattern if present. |
| | | /** |
| | | * Pattern usage which provides a user-friendly summary of the |
| | | * pattern if present. |
| | | */ |
| | | private String patternUsage; |
| | | |
| | | |
| | | |
| | | // Private constructor |
| | | /** Private constructor. */ |
| | | private Builder(AbstractManagedObjectDefinition<?, ?> d, |
| | | String propertyName) { |
| | | super(d, propertyName); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected StringPropertyDefinition buildInstance( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | |
| | | return new Builder(d, propertyName); |
| | | } |
| | | |
| | | // Flag indicating whether values of this property are |
| | | // case-insensitive. |
| | | /** |
| | | * Flag indicating whether values of this property are |
| | | * case-insensitive. |
| | | */ |
| | | private final boolean isCaseInsensitive; |
| | | |
| | | // Optional pattern which values of this property must match. |
| | | /** Optional pattern which values of this property must match. */ |
| | | private final Pattern pattern; |
| | | |
| | | // Pattern usage which provides a user-friendly summary of the |
| | | // pattern if present. |
| | | /** |
| | | * Pattern usage which provides a user-friendly summary of the |
| | | * pattern if present. |
| | | */ |
| | | private final String patternUsage; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private StringPropertyDefinition(AbstractManagedObjectDefinition<?, ?> d, |
| | | String propertyName, EnumSet<PropertyOption> options, |
| | | AdministratorAction adminAction, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitString(this, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyValueVisitor<R, P> v, String value, P p) { |
| | | return v.visitString(this, value, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String decodeValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String normalizeValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void validateValue(String value) throws PropertyException { |
| | | ifNull(value); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | | |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | |
| | | */ |
| | | public final class Tag implements Comparable<Tag> { |
| | | |
| | | // All the tags. |
| | | /** All the tags. */ |
| | | private static final Map<String, Tag> tags = new HashMap<String, Tag>(); |
| | | |
| | | |
| | |
| | | return Collections.unmodifiableCollection(tags.values()); |
| | | } |
| | | |
| | | // The name of the tag. |
| | | /** The name of the tag. */ |
| | | private final String name; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private Tag(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final int compareTo(Tag o) { |
| | | return name.compareTo(o.name); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final boolean equals(Object obj) { |
| | | if (this == obj) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final int hashCode() { |
| | | return name.hashCode(); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final String toString() { |
| | | return name; |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.admin; |
| | | |
| | |
| | | public final class TopCfgDefn extends |
| | | AbstractManagedObjectDefinition<ConfigurationClient, Configuration> { |
| | | |
| | | // The singleton configuration definition instance. |
| | | /** The singleton configuration definition instance. */ |
| | | private static final TopCfgDefn INSTANCE = new TopCfgDefn(); |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.admin; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <R, P> R accept(DefaultBehaviorProviderVisitor<T, R, P> v, P p) { |
| | | return v.visitUndefined(this, p); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin.client; |
| | |
| | | |
| | | |
| | | |
| | | // Create the message |
| | | /** Create the message. */ |
| | | private static LocalizableMessage createMessage(String illegalName, |
| | | PropertyDefinition<?> namingPropertyDefinition) { |
| | | if (illegalName.length() == 0) { |
| | |
| | | return ERR_ILLEGAL_MANAGED_OBJECT_NAME_EXCEPTION_OTHER.get(illegalName); |
| | | } |
| | | |
| | | // The illegal name. |
| | | /** The illegal name. */ |
| | | private final String illegalName; |
| | | |
| | | // The naming property definition if applicable. |
| | | /** The naming property definition if applicable. */ |
| | | private final PropertyDefinition<?> namingPropertyDefinition; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin.client; |
| | |
| | | |
| | | |
| | | |
| | | // Create the message. |
| | | /** Create the message. */ |
| | | private static LocalizableMessage createMessage(ManagedObject<?> partialManagedObject, |
| | | Collection<PropertyException> causes) { |
| | | Reject.ifNull(causes); |
| | |
| | | } |
| | | } |
| | | |
| | | // The exception(s) that caused this decoding exception. |
| | | /** The exception(s) that caused this decoding exception. */ |
| | | private final Collection<PropertyException> causes; |
| | | |
| | | // The partially created managed object. |
| | | /** The partially created managed object. */ |
| | | private final ManagedObject<?> partialManagedObject; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin.client; |
| | |
| | | |
| | | |
| | | |
| | | // Create the message. |
| | | /** Create the message. */ |
| | | private static LocalizableMessage createMessage(Collection<PropertyException> causes) |
| | | { |
| | | Reject.ifNull(causes); |
| | |
| | | } |
| | | } |
| | | |
| | | // The causes of this exception. |
| | | /** The causes of this exception. */ |
| | | private final Collection<PropertyException> causes; |
| | | |
| | | // Indicates whether the exception occurred during managed object |
| | | // creation. |
| | | /** Indicates whether the exception occurred during managed object creation. */ |
| | | private final boolean isCreate; |
| | | |
| | | // The user friendly name of the component that caused this |
| | | // exception. |
| | | /** The user friendly name of the component that caused this exception. */ |
| | | private final LocalizableMessage ufn; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin.client; |
| | |
| | | |
| | | |
| | | |
| | | // Gets the default message. |
| | | /** Gets the default message. */ |
| | | private static LocalizableMessage getDefaultMessage(Collection<LocalizableMessage> messages) { |
| | | Reject.ifNull(messages); |
| | | Reject.ifFalse(!messages.isEmpty()); |
| | |
| | | |
| | | |
| | | |
| | | // Merge the messages into a single message. |
| | | /** Merge the messages into a single message. */ |
| | | private static LocalizableMessage getSingleMessage(Collection<LocalizableMessage> messages) { |
| | | if (messages.size() == 1) { |
| | | return messages.iterator().next(); |
| | |
| | | } |
| | | } |
| | | |
| | | // The messages describing the constraint violations that occurred. |
| | | /** The messages describing the constraint violations that occurred. */ |
| | | private final Collection<LocalizableMessage> messages; |
| | | |
| | | // The type of operation that caused this exception. |
| | | /** The type of operation that caused this exception. */ |
| | | private final OperationType type; |
| | | |
| | | // The user friendly name of the component that caused this |
| | | // exception. |
| | | /** The user friendly name of the component that caused this exception. */ |
| | | private final LocalizableMessage ufn; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // Prevent instantiation. |
| | | /** Prevent instantiation. */ |
| | | private ValueDecoder() { |
| | | // No implementation required. |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | Object visitAggregation(AggregationPropertyDefinition<C, S> d, String p) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <T> Object visitUnknown(PropertyDefinition<T> d, String p) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | // The LDAP connection. |
| | | /** The LDAP connection. */ |
| | | private final LDAPConnection connection; |
| | | |
| | | // The LDAP management context. |
| | | /** The LDAP management context. */ |
| | | private final LDAPManagementContext context; |
| | | |
| | | // The LDAP profile which should be used to construct LDAP |
| | | // requests and decode LDAP responses. |
| | | /** |
| | | * The LDAP profile which should be used to construct LDAP |
| | | * requests and decode LDAP responses. |
| | | */ |
| | | private final LDAPProfile profile; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void close() { |
| | | connection.unbind(); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | ManagedObject<? extends C> getManagedObject( |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | public <C extends ConfigurationClient, S extends Configuration, PD> |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ManagedObject<RootCfgClient> getRootConfigurationManagedObject() { |
| | | return new LDAPManagedObject<RootCfgClient>(this, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | String[] listManagedObjects( |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | String[] listManagedObjects( |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean managedObjectExists(ManagedObjectPath<?, ?> path) |
| | | throws ManagedObjectNotFoundException, AuthorizationException, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected <C extends ConfigurationClient, S extends Configuration> |
| | | void deleteManagedObject( |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected LDAPManagementContext getManagementContext() { |
| | | return context; |
| | |
| | | |
| | | |
| | | |
| | | // Create a managed object which already exists on the server. |
| | | /** Create a managed object which already exists on the server. */ |
| | | private <M extends ConfigurationClient, N extends Configuration> |
| | | ManagedObject<M> createExistingManagedObject( |
| | | ManagedObjectDefinition<M, N> d, |
| | |
| | | (InstantiableRelationDefinition<?, ?>) rd; |
| | | pd = ird.getNamingPropertyDefinition(); |
| | | } |
| | | return new LDAPManagedObject<M>(this, d, p.asSubType(d), properties, true, |
| | | pd); |
| | | return new LDAPManagedObject<M>(this, d, p.asSubType(d), properties, true, pd); |
| | | } |
| | | |
| | | |
| | | |
| | | // Create a property using the provided string values. |
| | | /** Create a property using the provided string values. */ |
| | | private <PD> void decodeProperty(PropertySet newProperties, |
| | | ManagedObjectPath<?, ?> p, PropertyDefinition<PD> pd, |
| | | Attribute attribute) throws PropertyException, |
| | |
| | | |
| | | |
| | | |
| | | // Determine the type of managed object associated with the named |
| | | // entry. |
| | | /** Determine the type of managed object associated with the named entry. */ |
| | | private <C extends ConfigurationClient, S extends Configuration> |
| | | ManagedObjectDefinition<? extends C, ? extends S> getEntryDefinition( |
| | | AbstractManagedObjectDefinition<C, S> d, LdapName dn) |
| | |
| | | * |
| | | * |
| | | * Copyright 2007-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin.client.ldap; |
| | |
| | | private static final class ValueEncoder extends |
| | | PropertyValueVisitor<Object, Void> { |
| | | |
| | | // Prevent instantiation. |
| | | /** Prevent instantiation. */ |
| | | private ValueEncoder() { |
| | | // No implementation required. |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | Object visitAggregation( |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <PD> Object visitUnknown(PropertyDefinition<PD> pd, PD v, Void p) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | // The LDAP management driver associated with this managed object. |
| | | /** The LDAP management driver associated with this managed object. */ |
| | | private final LDAPDriver driver; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void addNewManagedObject() throws AuthorizationException, |
| | | CommunicationException, OperationRejectedException, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected Driver getDriver() { |
| | | return driver; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void modifyExistingManagedObject() |
| | | throws ConcurrentModificationException, OperationRejectedException, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected <M extends ConfigurationClient> ManagedObject<M> newInstance( |
| | | ManagedObjectDefinition<M, ?> d, ManagedObjectPath<M, ?> path, |
| | |
| | | |
| | | |
| | | |
| | | // Encode a property into LDAP string values. |
| | | /** Encode a property into LDAP string values. */ |
| | | private <PD> void encodeProperty(Attribute attribute, |
| | | PropertyDefinition<PD> pd) { |
| | | PropertyValueVisitor<Object, Void> visitor = new ValueEncoder(); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isModified() { |
| | | ManagedObjectDefinition<?, ?> d = getManagedObjectDefinition(); |
| | | for (PropertyDefinition<?> pd : d.getAllPropertyDefinitions()) { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin.client.ldap; |
| | |
| | | return new LDAPManagementContext(connection, LDAPProfile.getInstance()); |
| | | } |
| | | |
| | | // The LDAP management context driver. |
| | | /** The LDAP management context driver. */ |
| | | private final LDAPDriver driver; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private LDAPManagementContext(LDAPConnection connection, |
| | | LDAPProfile profile) { |
| | | this.driver = new LDAPDriver(this, connection, profile); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected Driver getDriver() { |
| | | return driver; |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.server.admin.client.ldap; |
| | |
| | | return builder.getInstance(); |
| | | } |
| | | |
| | | // The list of RDNs in big-endian order. |
| | | /** The list of RDNs in big-endian order. */ |
| | | private final LinkedList<Rdn> rdns; |
| | | |
| | | // The LDAP profile. |
| | | /** The LDAP profile. */ |
| | | private final LDAPProfile profile; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | void appendManagedObjectPathElement( |
| | | InstantiableRelationDefinition<? super C, ? super S> r, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | void appendManagedObjectPathElement( |
| | | OptionalRelationDefinition<? super C, ? super S> r, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | void appendManagedObjectPathElement( |
| | | SingletonRelationDefinition<? super C, ? super S> r, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | void appendManagedObjectPathElement( |
| | | SetRelationDefinition<? super C, ? super S> r, |
| | |
| | | private final class DefaultManagedObjectFactory implements |
| | | RelationDefinitionVisitor<Void, Void> { |
| | | |
| | | // Possible exceptions. |
| | | /** Possible exceptions. */ |
| | | private AuthorizationException ae; |
| | | private ManagedObjectAlreadyExistsException moaee; |
| | | private MissingMandatoryPropertiesException mmpe; |
| | |
| | | private OperationRejectedException ore; |
| | | private CommunicationException ce; |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | Void visitInstantiable( |
| | | InstantiableRelationDefinition<C, S> rd, Void p) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | Void visitOptional( |
| | | OptionalRelationDefinition<C, S> rd, Void p) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | Void visitSingleton( |
| | | SingletonRelationDefinition<C, S> rd, Void p) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | Void visitSet( |
| | | SetRelationDefinition<C, S> rd, Void p) { |
| | |
| | | |
| | | |
| | | |
| | | // Create the child managed object. |
| | | /** Create the child managed object. */ |
| | | private void createDefaultManagedObject(ManagedObjectDefinition<?, ?> d, |
| | | ManagedObject<?> child, DefaultManagedObject<?, ?> dmo) { |
| | | for (PropertyDefinition<?> pd : d.getAllPropertyDefinitions()) { |
| | |
| | | |
| | | |
| | | |
| | | // Set property values. |
| | | /** Set property values. */ |
| | | private <PD> void setPropertyValues(ManagedObject<?> mo, |
| | | PropertyDefinition<PD> pd, DefaultManagedObject<?, ?> dmo) { |
| | | mo.setPropertyValues(pd, dmo.getPropertyValues(pd)); |
| | |
| | | |
| | | |
| | | |
| | | // The managed object definition associated with this managed |
| | | // object. |
| | | /** The managed object definition associated with this managed object. */ |
| | | private final ManagedObjectDefinition<T, ? extends Configuration> definition; |
| | | |
| | | // Indicates whether or not this managed object exists on the server |
| | | // (false means the managed object is new and has not been |
| | | // committed). |
| | | /** |
| | | * Indicates whether or not this managed object exists on the server |
| | | * (false means the managed object is new and has not been committed). |
| | | */ |
| | | private boolean existsOnServer; |
| | | |
| | | // Optional naming property definition. |
| | | /** Optional naming property definition. */ |
| | | private final PropertyDefinition<?> namingPropertyDefinition; |
| | | |
| | | // The path associated with this managed object. |
| | | /** The path associated with this managed object. */ |
| | | private ManagedObjectPath<T, ? extends Configuration> path; |
| | | |
| | | // The managed object's properties. |
| | | /** The managed object's properties. */ |
| | | private final PropertySet properties; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final void commit() throws ManagedObjectAlreadyExistsException, |
| | | MissingMandatoryPropertiesException, ConcurrentModificationException, |
| | | OperationRejectedException, AuthorizationException, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <C extends ConfigurationClient, S extends Configuration, |
| | | CC extends C> |
| | | ManagedObject<CC> createChild( |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <C extends ConfigurationClient, |
| | | S extends Configuration, CC extends C> |
| | | ManagedObject<CC> createChild( |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <C extends ConfigurationClient, S extends Configuration, |
| | | CC extends C> |
| | | ManagedObject<CC> createChild( |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <C extends ConfigurationClient, S extends Configuration> |
| | | ManagedObject<? extends C> getChild( |
| | | InstantiableRelationDefinition<C, S> r, String name) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <C extends ConfigurationClient, S extends Configuration> |
| | | ManagedObject<? extends C> getChild( |
| | | OptionalRelationDefinition<C, S> r) throws IllegalArgumentException, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <C extends ConfigurationClient, S extends Configuration> |
| | | ManagedObject<? extends C> getChild( |
| | | SingletonRelationDefinition<C, S> r) throws IllegalArgumentException, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <C extends ConfigurationClient, S extends Configuration> |
| | | ManagedObject<? extends C> getChild( |
| | | SetRelationDefinition<C, S> r, String name) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final T getConfiguration() { |
| | | return definition.createClientConfiguration(this); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final ManagedObjectDefinition<T, ? extends Configuration> |
| | | getManagedObjectDefinition() { |
| | | return definition; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final ManagedObjectPath<T, ? extends Configuration> |
| | | getManagedObjectPath() { |
| | | return path; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <PD> SortedSet<PD> getPropertyDefaultValues( |
| | | PropertyDefinition<PD> pd) throws IllegalArgumentException { |
| | | return new TreeSet<PD>(getProperty(pd).getDefaultValues()); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <PD> PD getPropertyValue(PropertyDefinition<PD> pd) |
| | | throws IllegalArgumentException { |
| | | Set<PD> values = getProperty(pd).getEffectiveValues(); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <PD> SortedSet<PD> getPropertyValues(PropertyDefinition<PD> pd) |
| | | throws IllegalArgumentException { |
| | | return new TreeSet<PD>(getProperty(pd).getEffectiveValues()); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <C extends ConfigurationClient, S extends Configuration> |
| | | boolean hasChild( |
| | | OptionalRelationDefinition<C, S> r) throws IllegalArgumentException, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final boolean isPropertyPresent(PropertyDefinition<?> pd) |
| | | throws IllegalArgumentException { |
| | | return !getProperty(pd).isEmpty(); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <C extends ConfigurationClient, S extends Configuration> |
| | | String[] listChildren( |
| | | InstantiableRelationDefinition<C, S> r) throws IllegalArgumentException, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <C extends ConfigurationClient, S extends Configuration> |
| | | String[] listChildren( |
| | | InstantiableRelationDefinition<C, S> r, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <C extends ConfigurationClient, S extends Configuration> |
| | | String[] listChildren( |
| | | SetRelationDefinition<C, S> r) throws IllegalArgumentException, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <C extends ConfigurationClient, S extends Configuration> |
| | | String[] listChildren( |
| | | SetRelationDefinition<C, S> r, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <C extends ConfigurationClient, S extends Configuration> |
| | | void removeChild( |
| | | InstantiableRelationDefinition<C, S> r, String name) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <C extends ConfigurationClient, S extends Configuration> |
| | | void removeChild( |
| | | OptionalRelationDefinition<C, S> r) throws IllegalArgumentException, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <C extends ConfigurationClient, S extends Configuration> |
| | | void removeChild( |
| | | SetRelationDefinition<C, S> r, String name) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <PD> void setPropertyValue(PropertyDefinition<PD> pd, PD value) |
| | | throws PropertyException, PropertyException, |
| | | PropertyException, IllegalArgumentException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final <PD> void setPropertyValues(PropertyDefinition<PD> pd, |
| | | Collection<PD> values) throws PropertyException, |
| | | PropertyException, PropertyException, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() { |
| | | StringBuilder builder = new StringBuilder(); |
| | |
| | | |
| | | |
| | | |
| | | // Creates a new managed object with no active values, just default |
| | | // values. |
| | | /** |
| | | * Creates a new managed object with no active values, just default |
| | | * values. |
| | | */ |
| | | private <M extends ConfigurationClient, PD> ManagedObject<M> |
| | | createNewManagedObject( |
| | | ManagedObjectDefinition<M, ?> d, ManagedObjectPath<M, ?> p, |
| | |
| | | |
| | | |
| | | |
| | | // Create an empty property. |
| | | /** Create an empty property. */ |
| | | private <PD> void createProperty(PropertySet properties, |
| | | ManagedObjectPath<?, ?> p, PropertyDefinition<PD> pd) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | // Makes sure that this managed object exists. |
| | | /** Makes sure that this managed object exists. */ |
| | | private void ensureThisManagedObjectExists() |
| | | throws ConcurrentModificationException, CommunicationException, |
| | | AuthorizationException { |
| | |
| | | |
| | | |
| | | |
| | | // Validate that a relation definition belongs to this managed |
| | | // object. |
| | | /** Validate that a relation definition belongs to this managed object. */ |
| | | private void validateRelationDefinition(RelationDefinition<?, ?> rd) |
| | | throws IllegalArgumentException { |
| | | ManagedObjectDefinition<T, ?> d = getManagedObjectDefinition(); |
| | |
| | | private class DefaultValueFinder<T> implements |
| | | DefaultBehaviorProviderVisitor<T, Collection<T>, Void> { |
| | | |
| | | // Any exception that occurred whilst retrieving inherited default |
| | | // values. |
| | | /** Any exception that occurred whilst retrieving inherited default values. */ |
| | | private PropertyException exception; |
| | | |
| | | // The path of the managed object containing the first property. |
| | | /** The path of the managed object containing the first property. */ |
| | | private final ManagedObjectPath<?, ?> firstPath; |
| | | |
| | | // Indicates whether the managed object has been created yet. |
| | | /** Indicates whether the managed object has been created yet. */ |
| | | private final boolean isCreate; |
| | | |
| | | // The path of the managed object containing the next property. |
| | | /** The path of the managed object containing the next property. */ |
| | | private ManagedObjectPath<?, ?> nextPath; |
| | | |
| | | // The next property whose default values were required. |
| | | /** The next property whose default values were required. */ |
| | | private PropertyDefinition<T> nextProperty; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private DefaultValueFinder(ManagedObjectPath<?, ?> p, boolean isCreate) { |
| | | this.firstPath = p; |
| | | this.isCreate = isCreate; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<T> visitAbsoluteInherited( |
| | | AbsoluteInheritedDefaultBehaviorProvider<T> d, Void p) { |
| | | try { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<T> visitAlias(AliasDefaultBehaviorProvider<T> d, Void p) { |
| | | return Collections.emptySet(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<T> visitDefined(DefinedDefaultBehaviorProvider<T> d, |
| | | Void p) { |
| | | Collection<String> stringValues = d.getDefaultValues(); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<T> visitRelativeInherited( |
| | | RelativeInheritedDefaultBehaviorProvider<T> d, Void p) { |
| | | try { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<T> visitUndefined(UndefinedDefaultBehaviorProvider<T> d, |
| | | Void p) { |
| | | return Collections.emptySet(); |
| | |
| | | |
| | | |
| | | |
| | | // Find the default values for the next path/property. |
| | | /** Find the default values for the next path/property. */ |
| | | private Collection<T> find(ManagedObjectPath<?, ?> p, |
| | | PropertyDefinition<T> pd) throws PropertyException { |
| | | this.nextPath = p; |
| | |
| | | |
| | | |
| | | |
| | | // Get an inherited property value. |
| | | /** Get an inherited property value. */ |
| | | @SuppressWarnings("unchecked") |
| | | private Collection<T> getInheritedProperty(ManagedObjectPath target, |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName) |
| | |
| | | |
| | | |
| | | |
| | | // Remove a managed object, first ensuring that the parent exists, |
| | | // then ensuring that the child exists, before ensuring that any |
| | | // constraints are satisfied. |
| | | /** |
| | | * Remove a managed object, first ensuring that the parent exists, |
| | | * then ensuring that the child exists, before ensuring that any |
| | | * constraints are satisfied. |
| | | */ |
| | | private <C extends ConfigurationClient, S extends Configuration> |
| | | boolean doDeleteManagedObject( |
| | | ManagedObjectPath<C, S> path) throws ManagedObjectNotFoundException, |
| | |
| | | */ |
| | | private static final class MyProperty<T> implements Property<T> { |
| | | |
| | | // The active set of values. |
| | | /** The active set of values. */ |
| | | private final SortedSet<T> activeValues; |
| | | |
| | | // The definition associated with this property. |
| | | /** The definition associated with this property. */ |
| | | private final PropertyDefinition<T> d; |
| | | |
| | | // The default set of values (read-only). |
| | | /** The default set of values (read-only). */ |
| | | private final SortedSet<T> defaultValues; |
| | | |
| | | // The pending set of values. |
| | | /** The pending set of values. */ |
| | | private final SortedSet<T> pendingValues; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public SortedSet<T> getActiveValues() { |
| | | return Collections.unmodifiableSortedSet(activeValues); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public SortedSet<T> getDefaultValues() { |
| | | return defaultValues; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public SortedSet<T> getEffectiveValues() { |
| | | SortedSet<T> values = getPendingValues(); |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public SortedSet<T> getPendingValues() { |
| | | return Collections.unmodifiableSortedSet(pendingValues); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public PropertyDefinition<T> getPropertyDefinition() { |
| | | return d; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isEmpty() { |
| | | return pendingValues.isEmpty(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isModified() { |
| | | return activeValues.size() != pendingValues.size() |
| | | || !activeValues.containsAll(pendingValues); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() { |
| | | return getEffectiveValues().toString(); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean wasEmpty() { |
| | | return activeValues.isEmpty(); |
| | | } |
| | | } |
| | | |
| | | // The properties. |
| | | /** The properties. */ |
| | | private final Map<PropertyDefinition<?>, MyProperty<?>> properties; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() { |
| | | StringBuilder builder = new StringBuilder(); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin.condition; |
| | | |
| | |
| | | */ |
| | | public final class ANDCondition implements Condition { |
| | | |
| | | // The list of sub-conditions. |
| | | /** The list of sub-conditions. */ |
| | | private final List<Condition> conditions; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ManagementContext context, |
| | | ManagedObject<?> managedObject) throws AuthorizationException, |
| | | CommunicationException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ServerManagedObject<?> managedObject) |
| | | throws ConfigException { |
| | | for (Condition condition : conditions) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initialize(AbstractManagedObjectDefinition<?, ?> d) |
| | | throws Exception { |
| | | for (Condition condition : conditions) { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin.condition; |
| | | |
| | |
| | | */ |
| | | public static final Condition FALSE = new Condition() { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ManagementContext context, |
| | | ManagedObject<?> managedObject) throws AuthorizationException, |
| | | CommunicationException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ServerManagedObject<?> managedObject) |
| | | throws ConfigException { |
| | | return false; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initialize(AbstractManagedObjectDefinition<?, ?> d) |
| | | throws Exception { |
| | | // No implementation required. |
| | |
| | | */ |
| | | public static final Condition TRUE = new Condition() { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ManagementContext context, |
| | | ManagedObject<?> managedObject) throws AuthorizationException, |
| | | CommunicationException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ServerManagedObject<?> managedObject) |
| | | throws ConfigException { |
| | | return true; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initialize(AbstractManagedObjectDefinition<?, ?> d) |
| | | throws Exception { |
| | | // No implementation required. |
| | |
| | | |
| | | |
| | | |
| | | // Prevent instantiation. |
| | | /** Prevent instantiation. */ |
| | | private Conditions() { |
| | | // No implementation required. |
| | | } |
| | |
| | | */ |
| | | private static final class Impl<T> implements Condition { |
| | | |
| | | // The property. |
| | | /** The property. */ |
| | | final PropertyDefinition<T> pd; |
| | | |
| | | // The required property value. |
| | | /** The required property value. */ |
| | | final T value; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private Impl(PropertyDefinition<T> pd, T value) |
| | | throws PropertyException { |
| | | this.pd = pd; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ManagementContext context, |
| | | ManagedObject<?> managedObject) throws AuthorizationException, |
| | | CommunicationException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ServerManagedObject<?> managedObject) |
| | | throws ConfigException { |
| | | SortedSet<T> values = managedObject.getPropertyValues(pd); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initialize(AbstractManagedObjectDefinition<?, ?> d) |
| | | throws Exception { |
| | | // Not used. |
| | |
| | | |
| | | |
| | | |
| | | // Private implementation of fix() method. |
| | | /** Private implementation of fix() method. */ |
| | | private void setPropertyValue(ManagedObject<?> managedObject) { |
| | | managedObject.setPropertyValue(pd, value); |
| | | } |
| | | |
| | | } |
| | | |
| | | // The strongly typed private implementation. |
| | | /** The strongly typed private implementation. */ |
| | | private Impl<?> impl; |
| | | |
| | | // The property name. |
| | | /** The property name. */ |
| | | private final String propertyName; |
| | | |
| | | // The string representation of the required property value. |
| | | /** The string representation of the required property value. */ |
| | | private final String propertyStringValue; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ManagementContext context, |
| | | ManagedObject<?> managedObject) throws AuthorizationException, |
| | | CommunicationException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ServerManagedObject<?> managedObject) |
| | | throws ConfigException { |
| | | return impl.evaluate(managedObject); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initialize(AbstractManagedObjectDefinition<?, ?> d) |
| | | throws Exception { |
| | | // Decode the property. |
| | |
| | | |
| | | |
| | | |
| | | // Creates the new private implementation. |
| | | /** Creates the new private implementation. */ |
| | | private <T> void buildImpl(PropertyDefinition<T> pd) |
| | | throws PropertyException { |
| | | T value = pd.decodeValue(propertyStringValue); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin.condition; |
| | | |
| | |
| | | */ |
| | | public final class IsPresentCondition implements Condition { |
| | | |
| | | // The property name. |
| | | /** The property name. */ |
| | | private final String propertyName; |
| | | |
| | | // The property definition. |
| | | /** The property definition. */ |
| | | private PropertyDefinition<?> pd; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ManagementContext context, |
| | | ManagedObject<?> managedObject) throws AuthorizationException, |
| | | CommunicationException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ServerManagedObject<?> managedObject) |
| | | throws ConfigException { |
| | | SortedSet<?> values = managedObject.getPropertyValues(pd); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initialize(AbstractManagedObjectDefinition<?, ?> d) |
| | | throws Exception { |
| | | // Decode the property. |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin.condition; |
| | | |
| | |
| | | */ |
| | | public final class NOTCondition implements Condition { |
| | | |
| | | // The single sub-condition. |
| | | /** The single sub-condition. */ |
| | | private final Condition condition; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ManagementContext context, |
| | | ManagedObject<?> managedObject) throws AuthorizationException, |
| | | CommunicationException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ServerManagedObject<?> managedObject) |
| | | throws ConfigException { |
| | | return !condition.evaluate(managedObject); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initialize(AbstractManagedObjectDefinition<?, ?> d) |
| | | throws Exception { |
| | | condition.initialize(d); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin.condition; |
| | | |
| | |
| | | */ |
| | | public final class ORCondition implements Condition { |
| | | |
| | | // The list of sub-conditions. |
| | | /** The list of sub-conditions. */ |
| | | private final List<Condition> conditions; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ManagementContext context, |
| | | ManagedObject<?> managedObject) throws AuthorizationException, |
| | | CommunicationException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ServerManagedObject<?> managedObject) |
| | | throws ConfigException { |
| | | for (Condition condition : conditions) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initialize(AbstractManagedObjectDefinition<?, ?> d) |
| | | throws Exception { |
| | | for (Condition condition : conditions) { |
| | |
| | | "</head>\n"); |
| | | } |
| | | |
| | | // Add a Tab Menu, the active tab is the one given as parameter |
| | | /** Add a Tab Menu, the active tab is the one given as parameter. */ |
| | | private void tabMenu(String activeTab) { |
| | | htmlBuff.append( |
| | | "<div class=\"tabmenu\"> " + |
| | |
| | | htmlBuff.append("<tbody>\n"); |
| | | } |
| | | |
| | | /* |
| | | /** |
| | | * Generate a "friendly" name from a string : |
| | | * '-' and '_' replaced by space |
| | | * first letter of a word in uppercase |
| | |
| | | htmlBuff = new StringBuffer(); |
| | | } |
| | | |
| | | // Relation List from RootConfiguration |
| | | /** Relation List from RootConfiguration. */ |
| | | private final TreeMap<String, RelationDefinition> topRelList = |
| | | new TreeMap<String, RelationDefinition>(); |
| | | private final TreeMap<String, RelationDefinition> relList = |
| | | new TreeMap<String, RelationDefinition>(); |
| | | private final TreeMap<String, TreeMap<String, RelationDefinition>> |
| | | catTopRelList = new TreeMap<String, TreeMap<String, RelationDefinition>>(); |
| | | // managed object list |
| | | /** Managed object list. */ |
| | | private final TreeMap<String, AbstractManagedObjectDefinition> moList = |
| | | new TreeMap<String, AbstractManagedObjectDefinition>(); |
| | | private final TreeMap<String, AbstractManagedObjectDefinition> topMoList = |
| | |
| | | AbstractConfigListenerAdaptor implements ConfigAddListener { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // Cached managed object between accept/apply callbacks. |
| | | /** Cached managed object between accept/apply callbacks. */ |
| | | private ServerManagedObject<? extends S> cachedManagedObject; |
| | | |
| | | // The instantiable relation. |
| | | /** The instantiable relation. */ |
| | | private final InstantiableRelationDefinition<?, S> instantiableRelation; |
| | | |
| | | // The set relation. |
| | | /** The set relation. */ |
| | | private final SetRelationDefinition<?, S> setRelation; |
| | | |
| | | // The underlying add listener. |
| | | /** The underlying add listener. */ |
| | | private final ServerManagedObjectAddListener<S> listener; |
| | | |
| | | // The optional relation. |
| | | /** The optional relation. */ |
| | | private final OptionalRelationDefinition<?, S> optionalRelation; |
| | | |
| | | // The managed object path of the parent. |
| | | /** The managed object path of the parent. */ |
| | | private final ManagedObjectPath<?, ?> path; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) { |
| | | if (optionalRelation != null) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | LocalizableMessageBuilder unacceptableReason) { |
| | |
| | | db.accept(v, path); |
| | | } |
| | | |
| | | // The names of entries that this change listener depends on. |
| | | /** The names of entries that this change listener depends on. */ |
| | | private final Collection<DN> dependencies; |
| | | |
| | | |
| | | |
| | | // Prevent instantiation. |
| | | /** Prevent instantiation. */ |
| | | private Visitor(Collection<DN> dependencies) { |
| | | this.dependencies = dependencies; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Void visitAbsoluteInherited( |
| | | AbsoluteInheritedDefaultBehaviorProvider<T> d, |
| | | ManagedObjectPath<?, ?> p) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Void visitAlias(AliasDefaultBehaviorProvider<T> d, |
| | | ManagedObjectPath<?, ?> p) { |
| | | return null; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Void visitDefined(DefinedDefaultBehaviorProvider<T> d, |
| | | ManagedObjectPath<?, ?> p) { |
| | | return null; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Void visitRelativeInherited( |
| | | RelativeInheritedDefaultBehaviorProvider<T> d, |
| | | ManagedObjectPath<?, ?> p) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Void visitUndefined(UndefinedDefaultBehaviorProvider<T> d, |
| | | ManagedObjectPath<?, ?> p) { |
| | | return null; |
| | |
| | | } |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // Cached managed object between accept/apply call-backs. |
| | | /** Cached managed object between accept/apply call-backs. */ |
| | | private ServerManagedObject<? extends S> cachedManagedObject; |
| | | |
| | | // The delete listener which is used to remove this listener and any |
| | | // dependencies. |
| | | /** |
| | | * The delete listener which is used to remove this listener and any |
| | | * dependencies. |
| | | */ |
| | | private final ConfigDeleteListener cleanerListener; |
| | | |
| | | // The names of entries that this change listener depends on. |
| | | /** The names of entries that this change listener depends on. */ |
| | | private final Set<DN> dependencies; |
| | | |
| | | // The listener used to notify this listener when dependency entries |
| | | // are modified. |
| | | /** |
| | | * The listener used to notify this listener when dependency entries |
| | | * are modified. |
| | | */ |
| | | private final ConfigChangeListener dependencyListener; |
| | | |
| | | // The DN associated with this listener. |
| | | /** The DN associated with this listener. */ |
| | | private final DN dn; |
| | | |
| | | // The underlying change listener. |
| | | /** The underlying change listener. */ |
| | | private final ServerManagedObjectChangeListener<? super S> listener; |
| | | |
| | | // The managed object path. |
| | | /** The managed object path. */ |
| | | private final ManagedObjectPath<?, S> path; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) { |
| | | // Looking at the ConfigFileHandler implementation reveals |
| | | // that this ConfigEntry will actually be a different object to |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | LocalizableMessageBuilder unacceptableReason) { |
| | | return configChangeIsAcceptable(configEntry, unacceptableReason, |
| | |
| | | |
| | | |
| | | |
| | | // Returns the named configuration entry or null if it could not be |
| | | // retrieved. |
| | | /** |
| | | * Returns the named configuration entry or null if it could not be retrieved. |
| | | */ |
| | | private ConfigEntry getConfigEntry(DN dn) { |
| | | try { |
| | | ConfigEntry configEntry = DirectoryServer.getConfigEntry(dn); |
| | |
| | | AbstractConfigListenerAdaptor implements ConfigDeleteListener { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // Cached managed object between accept/apply callbacks. |
| | | /** Cached managed object between accept/apply callbacks. */ |
| | | private ServerManagedObject<? extends S> cachedManagedObject; |
| | | |
| | | // The instantiable relation. |
| | | /** The instantiable relation. */ |
| | | private final InstantiableRelationDefinition<?, S> instantiableRelation; |
| | | |
| | | // The set relation. |
| | | /** The set relation. */ |
| | | private final SetRelationDefinition<?, S> setRelation; |
| | | |
| | | // The underlying delete listener. |
| | | /** The underlying delete listener. */ |
| | | private final ServerManagedObjectDeleteListener<S> listener; |
| | | |
| | | // The optional relation. |
| | | /** The optional relation. */ |
| | | private final OptionalRelationDefinition<?, S> optionalRelation; |
| | | |
| | | // The managed object path of the parent. |
| | | /** The managed object path of the parent. */ |
| | | private final ManagedObjectPath<?, ?> path; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) { |
| | | if (optionalRelation != null) { |
| | | // Optional managed objects are located directly beneath the |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | LocalizableMessageBuilder unacceptableReason) { |
| | | DN dn = configEntry.getDN(); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin.server; |
| | | |
| | |
| | | */ |
| | | final class ConfigExceptionFactory { |
| | | |
| | | // The singleton instance. |
| | | /** The singleton instance. */ |
| | | private static final ConfigExceptionFactory INSTANCE = |
| | | new ConfigExceptionFactory(); |
| | | |
| | | |
| | | |
| | | // Prevent instantiation. |
| | | /** Prevent instantiation. */ |
| | | private ConfigExceptionFactory() { |
| | | // Do nothing. |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin.server; |
| | |
| | | */ |
| | | private static final long serialVersionUID = -4902443848460011875L; |
| | | |
| | | // The server managed object. |
| | | /** The server managed object. */ |
| | | private final ServerManagedObject<?> managedObject; |
| | | |
| | | |
| | | |
| | | // Gets the default message. |
| | | /** Gets the default message. */ |
| | | private static LocalizableMessage getDefaultMessage(Collection<LocalizableMessage> messages) { |
| | | Reject.ifNull(messages); |
| | | Reject.ifFalse(!messages.isEmpty()); |
| | |
| | | |
| | | |
| | | |
| | | // Merge the messages into a single message. |
| | | /** Merge the messages into a single message. */ |
| | | private static LocalizableMessage getSingleMessage(Collection<LocalizableMessage> messages) { |
| | | if (messages.size() == 1) { |
| | | return messages.iterator().next(); |
| | |
| | | } |
| | | } |
| | | |
| | | // The messages describing the constraint violations that occurred. |
| | | /** The messages describing the constraint violations that occurred. */ |
| | | private final Collection<LocalizableMessage> messages; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin.server; |
| | |
| | | |
| | | |
| | | |
| | | // Prevent instantiation. |
| | | /** Prevent instantiation. */ |
| | | private DNBuilder() { |
| | | // No implementation required. |
| | | } |
| | |
| | | final class DelayedConfigAddListener implements ConfigAddListener { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The name of the parent entry. |
| | | /** The name of the parent entry. */ |
| | | private final DN parent; |
| | | |
| | | // The name of the subordinate entry which should have an add or |
| | | // delete listener registered with it when it is created. |
| | | /** |
| | | * The name of the subordinate entry which should have an add or |
| | | * delete listener registered with it when it is created. |
| | | */ |
| | | private final DN child; |
| | | |
| | | // The add listener to be registered with the subordinate entry when |
| | | // it is added (or null if a delete listener should be registered). |
| | | /** |
| | | * The add listener to be registered with the subordinate entry when |
| | | * it is added (or null if a delete listener should be registered). |
| | | */ |
| | | private final ConfigAddListener delayedAddListener; |
| | | |
| | | // The delete listener to be registered with the subordinate entry |
| | | // when it is added (or null if an add listener should be |
| | | // registered). |
| | | /** |
| | | * The delete listener to be registered with the subordinate entry |
| | | * when it is added (or null if an add listener should be registered). |
| | | */ |
| | | private final ConfigDeleteListener delayedDeleteListener; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) { |
| | | if (configEntry.getDN().equals(child)) { |
| | | // The subordinate entry matched our criteria so register the |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | LocalizableMessageBuilder unacceptableReason) { |
| | | // Always acceptable. |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin.server; |
| | |
| | | PropertyProvider { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The configuration entry associated with this server managed |
| | | // object (null if root). |
| | | /** |
| | | * The configuration entry associated with this server managed |
| | | * object (null if root). |
| | | */ |
| | | private ConfigEntry configEntry; |
| | | |
| | | // The management context. |
| | | /** The management context. */ |
| | | private final ServerManagementContext context = ServerManagementContext |
| | | .getInstance(); |
| | | |
| | | // The managed object's definition. |
| | | /** The managed object's definition. */ |
| | | private final ManagedObjectDefinition<?, S> definition; |
| | | |
| | | // The managed object path identifying this managed object's |
| | | // location. |
| | | /** The managed object path identifying this managed object's location. */ |
| | | private final ManagedObjectPath<?, S> path; |
| | | |
| | | // The managed object's properties. |
| | | /** The managed object's properties. */ |
| | | private final Map<PropertyDefinition<?>, SortedSet<?>> properties; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() { |
| | | StringBuilder builder = new StringBuilder(); |
| | |
| | | |
| | | |
| | | |
| | | // Deregister an add listener. |
| | | /** Deregister an add listener. */ |
| | | private <M extends Configuration> void deregisterAddListener(DN baseDN, |
| | | ConfigurationAddListener<M> listener) { |
| | | try { |
| | |
| | | |
| | | |
| | | |
| | | // Deregister an add listener. |
| | | /** Deregister an add listener. */ |
| | | private <M extends Configuration> void deregisterAddListener(DN baseDN, |
| | | ServerManagedObjectAddListener<M> listener) { |
| | | try { |
| | |
| | | |
| | | |
| | | |
| | | // Deregister a delete listener. |
| | | /** Deregister a delete listener. */ |
| | | private <M extends Configuration> void deregisterDeleteListener(DN baseDN, |
| | | ConfigurationDeleteListener<M> listener) { |
| | | try { |
| | |
| | | |
| | | |
| | | |
| | | // Deregister a delete listener. |
| | | /** Deregister a delete listener. */ |
| | | private <M extends Configuration> void deregisterDeleteListener(DN baseDN, |
| | | ServerManagedObjectDeleteListener<M> listener) { |
| | | try { |
| | |
| | | |
| | | |
| | | |
| | | // Gets a config entry required for a listener and throws a config |
| | | // exception on failure or returns null if the entry does not exist. |
| | | /** |
| | | * Gets a config entry required for a listener and throws a config |
| | | * exception on failure or returns null if the entry does not exist. |
| | | */ |
| | | private ConfigEntry getListenerConfigEntry(DN dn) throws ConfigException { |
| | | // Attempt to retrieve the listener base entry. |
| | | ConfigEntry configEntry; |
| | |
| | | |
| | | |
| | | |
| | | // Register an instantiable or optional relation add listener. |
| | | /** Register an instantiable or optional relation add listener. */ |
| | | private void registerAddListener(DN baseDN, ConfigAddListener adaptor) |
| | | throws IllegalArgumentException, ConfigException { |
| | | ConfigEntry relationEntry = getListenerConfigEntry(baseDN); |
| | |
| | | |
| | | |
| | | |
| | | // Register a delayed listener with the nearest existing parent |
| | | // entry to the provided base DN. |
| | | /** |
| | | * Register a delayed listener with the nearest existing parent |
| | | * entry to the provided base DN. |
| | | */ |
| | | private void registerDelayedListener(DN baseDN, |
| | | ConfigAddListener delayedListener) throws ConfigException { |
| | | DN parentDN = baseDN.parent(); |
| | |
| | | throw new ConfigException(message); |
| | | } |
| | | |
| | | // Deregister a delayed listener with the nearest existing parent |
| | | // entry to the provided base DN. |
| | | /** |
| | | * Deregister a delayed listener with the nearest existing parent |
| | | * entry to the provided base DN. |
| | | */ |
| | | private <M extends Configuration> void deregisterDelayedAddListener(DN baseDN, |
| | | ConfigurationAddListener<M> listener) throws ConfigException { |
| | | DN parentDN = baseDN.parent(); |
| | |
| | | } |
| | | |
| | | |
| | | // Deregister a delayed listener with the nearest existing parent |
| | | // entry to the provided base DN. |
| | | /** |
| | | * Deregister a delayed listener with the nearest existing parent |
| | | * entry to the provided base DN. |
| | | */ |
| | | private <M extends Configuration> void deregisterDelayedDeleteListener( |
| | | DN baseDN, ConfigurationDeleteListener<M> listener) |
| | | throws ConfigException { |
| | |
| | | } |
| | | } |
| | | |
| | | // Deregister a delayed listener with the nearest existing parent |
| | | // entry to the provided base DN. |
| | | /** |
| | | * Deregister a delayed listener with the nearest existing parent |
| | | * entry to the provided base DN. |
| | | */ |
| | | private <M extends Configuration> void deregisterDelayedAddListener(DN baseDN, |
| | | ServerManagedObjectAddListener<M> listener) throws ConfigException { |
| | | DN parentDN = baseDN.parent(); |
| | |
| | | } |
| | | |
| | | |
| | | // Deregister a delayed listener with the nearest existing parent |
| | | // entry to the provided base DN. |
| | | /** |
| | | * Deregister a delayed listener with the nearest existing parent |
| | | * entry to the provided base DN. |
| | | */ |
| | | private <M extends Configuration> void deregisterDelayedDeleteListener( |
| | | DN baseDN, ServerManagedObjectDeleteListener<M> listener) |
| | | throws ConfigException { |
| | |
| | | } |
| | | |
| | | |
| | | // Register an instantiable or optional relation delete listener. |
| | | /** Register an instantiable or optional relation delete listener. */ |
| | | private void registerDeleteListener(DN baseDN, ConfigDeleteListener adaptor) |
| | | throws ConfigException { |
| | | ConfigEntry relationEntry = getListenerConfigEntry(baseDN); |
| | |
| | | |
| | | |
| | | |
| | | // Validate that a relation definition belongs to this managed |
| | | // object. |
| | | /** Validate that a relation definition belongs to this managed object. */ |
| | | private void validateRelationDefinition(RelationDefinition<?, ?> rd) |
| | | throws IllegalArgumentException { |
| | | RelationDefinition<?, ?> tmp = definition.getRelationDefinition(rd |
| | |
| | | final class ServerManagedObjectAddListenerAdaptor<T extends Configuration> |
| | | implements ServerManagedObjectAddListener<T> { |
| | | |
| | | // The underlying add listener. |
| | | /** The underlying add listener. */ |
| | | private final ConfigurationAddListener<T> listener; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd( |
| | | ServerManagedObject<? extends T> mo) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | ServerManagedObject<? extends T> mo, List<LocalizableMessage> unacceptableReasons) { |
| | |
| | | final class ServerManagedObjectChangeListenerAdaptor<T extends Configuration> |
| | | implements ServerManagedObjectChangeListener<T> { |
| | | |
| | | // The underlying change listener. |
| | | /** The underlying change listener. */ |
| | | private final ConfigurationChangeListener<? super T> listener; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ServerManagedObject<? extends T> mo, List<LocalizableMessage> unacceptableReasons) { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.admin.server; |
| | |
| | | |
| | | |
| | | |
| | | // Create the message. |
| | | /** Create the message. */ |
| | | private static LocalizableMessage createMessage( |
| | | ServerManagedObject<?> partialManagedObject, |
| | | Collection<PropertyException> causes) { |
| | |
| | | } |
| | | } |
| | | |
| | | // The exception(s) that caused this decoding exception. |
| | | /** The exception(s) that caused this decoding exception. */ |
| | | private final Collection<PropertyException> causes; |
| | | |
| | | // The partially created server managed object. |
| | | /** The partially created server managed object. */ |
| | | private final ServerManagedObject<?> partialManagedObject; |
| | | |
| | | |
| | |
| | | final class ServerManagedObjectDeleteListenerAdaptor<T extends Configuration> |
| | | implements ServerManagedObjectDeleteListener<T> { |
| | | |
| | | // The underlying delete listener. |
| | | /** The underlying delete listener. */ |
| | | private final ConfigurationDeleteListener<T> listener; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | ServerManagedObject<? extends T> mo) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | ServerManagedObject<? extends T> mo, List<LocalizableMessage> unacceptableReasons) { |
| | |
| | | private class DefaultValueFinder<T> implements |
| | | DefaultBehaviorProviderVisitor<T, Collection<T>, Void> { |
| | | |
| | | // Any exception that occurred whilst retrieving inherited default |
| | | // values. |
| | | /** |
| | | * Any exception that occurred whilst retrieving inherited default values. |
| | | */ |
| | | private PropertyException exception; |
| | | |
| | | // Optional new configuration entry which does not yet exist in |
| | | // the configuration back-end. |
| | | /** |
| | | * Optional new configuration entry which does not yet exist in |
| | | * the configuration back-end. |
| | | */ |
| | | private final ConfigEntry newConfigEntry; |
| | | |
| | | // The path of the managed object containing the next property. |
| | | /** The path of the managed object containing the next property. */ |
| | | private ManagedObjectPath<?, ?> nextPath; |
| | | |
| | | // The next property whose default values were required. |
| | | /** The next property whose default values were required. */ |
| | | private PropertyDefinition<T> nextProperty; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private DefaultValueFinder(ConfigEntry newConfigEntry) { |
| | | this.newConfigEntry = newConfigEntry; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Collection<T> visitAbsoluteInherited( |
| | | AbsoluteInheritedDefaultBehaviorProvider<T> d, Void p) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Collection<T> visitAlias(AliasDefaultBehaviorProvider<T> d, Void p) { |
| | | return Collections.emptySet(); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Collection<T> visitDefined(DefinedDefaultBehaviorProvider<T> d, |
| | | Void p) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Collection<T> visitRelativeInherited( |
| | | RelativeInheritedDefaultBehaviorProvider<T> d, Void p) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Collection<T> visitUndefined(UndefinedDefaultBehaviorProvider<T> d, |
| | | Void p) { |
| | |
| | | |
| | | |
| | | |
| | | // Find the default values for the next path/property. |
| | | /** Find the default values for the next path/property. */ |
| | | private Collection<T> find(ManagedObjectPath<?, ?> p, |
| | | PropertyDefinition<T> pd) throws PropertyException { |
| | | nextPath = p; |
| | |
| | | |
| | | |
| | | |
| | | // Get an inherited property value. |
| | | /** Get an inherited property value. */ |
| | | @SuppressWarnings("unchecked") |
| | | private Collection<T> getInheritedProperty(ManagedObjectPath target, |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName) |
| | |
| | | */ |
| | | private class MyDefinitionResolver implements DefinitionResolver { |
| | | |
| | | // The config entry. |
| | | /** The config entry. */ |
| | | private final ConfigEntry entry; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private MyDefinitionResolver(ConfigEntry entry) { |
| | | this.entry = entry; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean matches(AbstractManagedObjectDefinition<?, ?> d) { |
| | | String oc = LDAPProfile.getInstance().getObjectClass(d); |
| | |
| | | |
| | | |
| | | |
| | | // Prevent instantiation. |
| | | /** Prevent instantiation. */ |
| | | private ValueDecoder() { |
| | | // No implementation required. |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | Object visitAggregation(AggregationPropertyDefinition<C, S> d, String p) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <T> Object visitUnknown(PropertyDefinition<T> d, String p) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | // Singleton instance. |
| | | /** Singleton instance. */ |
| | | private static final ServerManagementContext INSTANCE = |
| | | new ServerManagementContext(); |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private ServerManagementContext() { |
| | | // No implementation required. |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | // Decode helper method required to avoid generics warning. |
| | | /** Decode helper method required to avoid generics warning. */ |
| | | private <C extends ConfigurationClient, S extends Configuration> |
| | | ServerManagedObject<S> decodeAux( |
| | | ManagedObjectPath<? super C, ? super S> path, |
| | |
| | | |
| | | |
| | | |
| | | // Create a property using the provided string values. |
| | | /** Create a property using the provided string values. */ |
| | | private <T> SortedSet<T> decodeProperty(ManagedObjectPath<?, ?> path, |
| | | PropertyDefinition<T> pd, List<ByteString> values, |
| | | ConfigEntry newConfigEntry) throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | // Gets the attribute associated with a property from a ConfigEntry. |
| | | /** Gets the attribute associated with a property from a ConfigEntry. */ |
| | | private List<ByteString> getAttribute(ManagedObjectDefinition<?, ?> d, |
| | | PropertyDefinition<?> pd, ConfigEntry configEntry) { |
| | | // TODO: we create a default attribute type if it is |
| | |
| | | |
| | | |
| | | |
| | | // Get the default values for the specified property. |
| | | /** Get the default values for the specified property. */ |
| | | private <T> Collection<T> getDefaultValues(ManagedObjectPath<?, ?> p, |
| | | PropertyDefinition<T> pd, ConfigEntry newConfigEntry) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | // Gets a config entry required for a managed object and throws a |
| | | // config exception on failure. |
| | | /** |
| | | * Gets a config entry required for a managed object and throws a |
| | | * config exception on failure. |
| | | */ |
| | | private ConfigEntry getManagedObjectConfigEntry( |
| | | DN dn) throws ConfigException { |
| | | ConfigEntry configEntry; |
| | |
| | | |
| | | |
| | | |
| | | // Validate that a relation definition belongs to the path. |
| | | /** Validate that a relation definition belongs to the path. */ |
| | | private void validateRelationDefinition(ManagedObjectPath<?, ?> path, |
| | | RelationDefinition<?, ?> rd) throws IllegalArgumentException { |
| | | AbstractManagedObjectDefinition<?, ?> d = path.getManagedObjectDefinition(); |
| | |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.api; |
| | | |
| | |
| | | mayInvoke = false) |
| | | public class CompressedSchema |
| | | { |
| | | // Maps attribute description to ID. |
| | | /** Maps attribute description to ID. */ |
| | | private final List<Entry<AttributeType, Set<String>>> adDecodeMap; |
| | | |
| | | // Maps ID to attribute description. |
| | | /** Maps ID to attribute description. */ |
| | | private final Map<Entry<AttributeType, Set<String>>, Integer> adEncodeMap; |
| | | |
| | | // The map between encoded representations and object class sets. |
| | | /** The map between encoded representations and object class sets. */ |
| | | private final List<Map<ObjectClass, String>> ocDecodeMap; |
| | | |
| | | // The map between object class sets and encoded representations. |
| | | /** The map between object class sets and encoded representations. */ |
| | | private final Map<Map<ObjectClass, String>, Integer> ocEncodeMap; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | * Portions Copyright 2013-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.api; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Thread newThread(Runnable r) |
| | | { |
| | |
| | | ALERT_DESCRIPTION_UNCAUGHT_EXCEPTION); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getComponentEntryDN() { |
| | | return DN.NULL_DN; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getClassName() { |
| | | return DirectoryThread.class.getName(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Map<String, String> getAlerts() { |
| | | return alerts; |
| | |
| | | |
| | | |
| | | /** |
| | | * private method used to factorize constructor initialization. |
| | | * Private method used to factorize constructor initialization. |
| | | */ |
| | | private void init() |
| | | { |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The set of filters that define the entries that should be |
| | | // excluded from the cache. |
| | | /** |
| | | * The set of filters that define the entries that should be |
| | | * excluded from the cache. |
| | | */ |
| | | private Set<SearchFilter> excludeFilters = |
| | | new HashSet<SearchFilter>(0); |
| | | |
| | | // The set of filters that define the entries that should be |
| | | // included in the cache. |
| | | /** |
| | | * The set of filters that define the entries that should be |
| | | * included in the cache. |
| | | */ |
| | | private Set<SearchFilter> includeFilters = |
| | | new HashSet<SearchFilter>(0); |
| | | |
| | |
| | | */ |
| | | protected AtomicLong cacheMisses = new AtomicLong(0); |
| | | |
| | | // The monitor associated with this entry cache. |
| | | /** The monitor associated with this entry cache. */ |
| | | private EntryCacheMonitorProvider entryCacheMonitor; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.api; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.concurrent.*; |
| | | |
| | | import org.opends.server.admin.std.server.MonitorProviderCfg; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.admin.std.server.MonitorProviderCfg; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.DirectoryConfig; |
| | | import org.opends.server.types.InitializationException; |
| | |
| | | |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class defines the set of methods and structures that must be |
| | | * implemented by a Directory Server module that can provide usage, |
| | |
| | | mayInvoke=false) |
| | | public abstract class MonitorProvider<T extends MonitorProviderCfg> |
| | | { |
| | | // The scheduler. |
| | | /** The scheduler. */ |
| | | private static final ScheduledExecutorService SCHEDULER = |
| | | Executors.newSingleThreadScheduledExecutor( |
| | | new MonitorThreadFactory()); |
| | |
| | | ThreadFactory |
| | | { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Thread newThread(Runnable r) |
| | | { |
| | | Thread t = |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.api.plugin; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | |
| | | public abstract class DirectoryServerPlugin |
| | | <T extends PluginCfg> |
| | | { |
| | | // Indicates whether this plugin should be invoked for internal |
| | | // operations. |
| | | /** Indicates whether this plugin should be invoked for internal operations. */ |
| | | private boolean invokeForInternalOps; |
| | | |
| | | // The DN of the configuration entry for this plugin. |
| | | /** The DN of the configuration entry for this plugin. */ |
| | | private DN pluginDN; |
| | | |
| | | // The plugin types for which this plugin is registered. |
| | | /** The plugin types for which this plugin is registered. */ |
| | | private Set<PluginType> pluginTypes; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.api.plugin; |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * An internal directory server plugin which can be registered with |
| | | * the server without requiring any associated configuration. |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final void initializePlugin(Set<PluginType> pluginTypes, |
| | | PluginCfg configuration) throws ConfigException, |
| | | InitializationException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public final boolean isConfigurationAcceptable( |
| | | PluginCfg configuration, List<LocalizableMessage> unacceptableReasons) |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.api.plugin; |
| | | |
| | |
| | | */ |
| | | public static final class Startup |
| | | { |
| | | // Whether to continue startup. |
| | | /** Whether to continue startup. */ |
| | | private final boolean continueProcessing; |
| | | |
| | | // Whether to invoke the rest of the plugins. |
| | | /** Whether to invoke the rest of the plugins. */ |
| | | private final boolean continuePluginProcessing; |
| | | |
| | | // An message explaining why startup should stop. |
| | | /** An message explaining why startup should stop. */ |
| | | private final LocalizableMessage errorMessage; |
| | | |
| | | private static Startup DEFAULT_RESULT = |
| | |
| | | */ |
| | | public static final class PreParse |
| | | { |
| | | // Whether to continue operation processing. |
| | | /** Whether to continue operation processing. */ |
| | | private final boolean continueProcessing; |
| | | |
| | | // Whether to invoke the rest of the plugins. |
| | | /** Whether to invoke the rest of the plugins. */ |
| | | private final boolean continuePluginProcessing; |
| | | |
| | | // An message explaining why processing should stop. |
| | | /** An message explaining why processing should stop. */ |
| | | private final LocalizableMessage errorMessage; |
| | | |
| | | // The matched DN for this result. |
| | | /** The matched DN for this result. */ |
| | | private final DN matchedDN; |
| | | |
| | | // The set of referral URLs for this result. |
| | | /** The set of referral URLs for this result. */ |
| | | private final List<String> referralURLs; |
| | | |
| | | // The result code for this result. |
| | | /** The result code for this result. */ |
| | | private final ResultCode resultCode; |
| | | |
| | | private static PreParse DEFAULT_RESULT = |
| | |
| | | */ |
| | | public static final class PreOperation |
| | | { |
| | | // Whether to continue operation processing. |
| | | /** Whether to continue operation processing. */ |
| | | private final boolean continueProcessing; |
| | | |
| | | // Whether to invoke the rest of the plugins. |
| | | /** Whether to invoke the rest of the plugins. */ |
| | | private final boolean continuePluginProcessing; |
| | | |
| | | // An message explaining why processing should stop. |
| | | /** An message explaining why processing should stop. */ |
| | | private final LocalizableMessage errorMessage; |
| | | |
| | | // The matched DN for this result. |
| | | /** The matched DN for this result. */ |
| | | private final DN matchedDN; |
| | | |
| | | // The set of referral URLs for this result. |
| | | /** The set of referral URLs for this result. */ |
| | | private final List<String> referralURLs; |
| | | |
| | | // The result code for this result. |
| | | /** The result code for this result. */ |
| | | private final ResultCode resultCode; |
| | | |
| | | private static PreOperation DEFAULT_RESULT = |
| | |
| | | */ |
| | | public static final class PostOperation |
| | | { |
| | | // Whether to continue operation processing. |
| | | /** Whether to continue operation processing. */ |
| | | private final boolean continueProcessing; |
| | | |
| | | // An message explaining why processing should stop. |
| | | /** An message explaining why processing should stop. */ |
| | | private final LocalizableMessage errorMessage; |
| | | |
| | | // The matched DN for this result. |
| | | /** The matched DN for this result. */ |
| | | private final DN matchedDN; |
| | | |
| | | // The set of referral URLs for this result. |
| | | /** The set of referral URLs for this result. */ |
| | | private final List<String> referralURLs; |
| | | |
| | | // The result code for this result. |
| | | /** The result code for this result. */ |
| | | private final ResultCode resultCode; |
| | | |
| | | private static PostOperation DEFAULT_RESULT = |
| | |
| | | */ |
| | | public static final class PostResponse |
| | | { |
| | | // Whether to invoke the rest of the plugins. |
| | | /** Whether to invoke the rest of the plugins. */ |
| | | private final boolean continuePluginProcessing; |
| | | |
| | | private static PostResponse DEFAULT_RESULT = |
| | |
| | | */ |
| | | public static final class ImportLDIF |
| | | { |
| | | // Whether to continue operation processing. |
| | | /** Whether to continue operation processing. */ |
| | | private final boolean continueProcessing; |
| | | |
| | | // Whether to invoke the rest of the plugins. |
| | | /** Whether to invoke the rest of the plugins. */ |
| | | private final boolean continuePluginProcessing; |
| | | |
| | | // An message explaining why processing should stop. |
| | | /** An message explaining why processing should stop. */ |
| | | private final LocalizableMessage errorMessage; |
| | | |
| | | private static ImportLDIF DEFAULT_RESULT = |
| | |
| | | */ |
| | | public static final class SubordinateModifyDN |
| | | { |
| | | // Whether to continue operation processing. |
| | | /** Whether to continue operation processing. */ |
| | | private final boolean continueProcessing; |
| | | |
| | | // Whether to invoke the rest of the plugins. |
| | | /** Whether to invoke the rest of the plugins. */ |
| | | private final boolean continuePluginProcessing; |
| | | |
| | | // An message explaining why processing should stop. |
| | | /** An message explaining why processing should stop. */ |
| | | private final LocalizableMessage errorMessage; |
| | | |
| | | // The matched DN for this result. |
| | | /** The matched DN for this result. */ |
| | | private final DN matchedDN; |
| | | |
| | | // The set of referral URLs for this result. |
| | | /** The set of referral URLs for this result. */ |
| | | private final List<String> referralURLs; |
| | | |
| | | // The result code for this result. |
| | | /** The result code for this result. */ |
| | | private final ResultCode resultCode; |
| | | |
| | | private static SubordinateModifyDN DEFAULT_RESULT = |
| | |
| | | */ |
| | | public static final class SubordinateDelete |
| | | { |
| | | // Whether to continue operation processing. |
| | | /** Whether to continue operation processing. */ |
| | | private final boolean continueProcessing; |
| | | |
| | | // Whether to invoke the rest of the plugins. |
| | | /** Whether to invoke the rest of the plugins. */ |
| | | private final boolean continuePluginProcessing; |
| | | |
| | | // An message explaining why processing should stop. |
| | | /** An message explaining why processing should stop. */ |
| | | private final LocalizableMessage errorMessage; |
| | | |
| | | // The matched DN for this result. |
| | | /** The matched DN for this result. */ |
| | | private final DN matchedDN; |
| | | |
| | | // The set of referral URLs for this result. |
| | | /** The set of referral URLs for this result. */ |
| | | private final List<String> referralURLs; |
| | | |
| | | // The result code for this result. |
| | | /** The result code for this result. */ |
| | | private final ResultCode resultCode; |
| | | |
| | | private static SubordinateDelete DEFAULT_RESULT = |
| | |
| | | */ |
| | | public static final class IntermediateResponse |
| | | { |
| | | // Whether to continue operation processing. |
| | | /** Whether to continue operation processing. */ |
| | | private final boolean continueProcessing; |
| | | |
| | | // Whether to invoke the rest of the plugins. |
| | | /** Whether to invoke the rest of the plugins. */ |
| | | private final boolean continuePluginProcessing; |
| | | |
| | | // Whether to send the intermediate response to the client. |
| | | /** Whether to send the intermediate response to the client. */ |
| | | private final boolean sendResponse; |
| | | |
| | | // An message explaining why processing should stop. |
| | | /** An message explaining why processing should stop. */ |
| | | private final LocalizableMessage errorMessage; |
| | | |
| | | // The matched DN for this result. |
| | | /** The matched DN for this result. */ |
| | | private final DN matchedDN; |
| | | |
| | | // The set of referral URLs for this result. |
| | | /** The set of referral URLs for this result. */ |
| | | private final List<String> referralURLs; |
| | | |
| | | // The result code for this result. |
| | | /** The result code for this result. */ |
| | | private final ResultCode resultCode; |
| | | |
| | | private static IntermediateResponse DEFAULT_RESULT = |
| | |
| | | */ |
| | | public static final class PostConnect |
| | | { |
| | | // Whether to continue connection processing. |
| | | /** Whether to continue connection processing. */ |
| | | private final boolean continueProcessing; |
| | | |
| | | // Whether to invoke the rest of the plugins. |
| | | /** Whether to invoke the rest of the plugins. */ |
| | | private final boolean continuePluginProcessing; |
| | | |
| | | // An message explaining why processing should stop. |
| | | /** An message explaining why processing should stop. */ |
| | | private final LocalizableMessage errorMessage; |
| | | |
| | | // The disconnect reason that provides the generic cause for the |
| | | // disconnect. |
| | | /** The disconnect reason that provides the generic cause for the disconnect. */ |
| | | private final DisconnectReason disconnectReason; |
| | | |
| | | // Whether to send a disconnect notification to the client. |
| | | /** Whether to send a disconnect notification to the client. */ |
| | | private final boolean sendDisconnectNotification; |
| | | |
| | | private static PostConnect DEFAULT_RESULT = |
| | |
| | | */ |
| | | public static final class PostDisconnect |
| | | { |
| | | // Whether to invoke the rest of the plugins. |
| | | /** Whether to invoke the rest of the plugins. */ |
| | | private final boolean continuePluginProcessing; |
| | | |
| | | private static PostDisconnect DEFAULT_RESULT = |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.api.plugin; |
| | | |
| | | |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class defines an enumeration containing the types of plugins |
| | | * that are supported for use in the Directory Server. |
| | |
| | | |
| | | |
| | | |
| | | // A hash map that relates the plugin type names to the |
| | | // corresponding plugin type. |
| | | /** |
| | | * A hash map that relates the plugin type names to the |
| | | * corresponding plugin type. |
| | | */ |
| | | private static final Map<String, PluginType> PLUGIN_TYPE_MAP; |
| | | static |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // The name for this plugin type. |
| | | /** The name for this plugin type. */ |
| | | private String name; |
| | | |
| | | |
| | |
| | | this.seenEntry=val; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isProxiedAuthorization() { |
| | | return this.proxiedAuthorization; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isGetEffectiveRightsEval() { |
| | | return this.isGetEffectiveRightsEval; |
| | |
| | | return this.specificAttrs; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void addTargAttrFiltersMatchAci(Aci aci) { |
| | | this.targAttrFilterAcis.put(aci, aci); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean hasTargAttrFiltersMatchAci(Aci aci) { |
| | | return this.targAttrFilterAcis.containsKey(aci); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isTargAttrFilterMatchAciEmpty() { |
| | | return this.targAttrFilterAcis.isEmpty(); |
| | |
| | | this.targAttrMatch=0; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setTargAttrFiltersAciName(String name) { |
| | | this.targAttrFiltersAciName=name; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getTargAttrFiltersAciName() { |
| | | return this.targAttrFiltersAciName; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setTargAttrFiltersMatchOp(int flag) { |
| | | this.targAttrMatch |= flag; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean hasTargAttrFiltersMatchOp(int flag) { |
| | | return (this.targAttrMatch & flag) != 0; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getDecidingAciName() { |
| | | if(this.decidingAci != null) |
| | |
| | | this.decidingAci = decidingAci; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public EnumEvalReason getEvalReason() { |
| | | return this.evalReason; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setEvalSummary(String summary) { |
| | | this.summaryString=summary; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getEvalSummary() { |
| | | return this.summaryString; |
| | | } |
| | |
| | | authorizationEntry=saveAuthorizationEntry; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setDenyList(List<Aci> denys) { |
| | | denyList=denys; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setAllowList(List<Aci> allows) { |
| | | allowList=allows; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public AttributeType getCurrentAttributeType() { |
| | | return attributeType; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getCurrentAttributeValue() { |
| | | return attributeValue; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setCurrentAttributeType(AttributeType type) { |
| | | attributeType=type; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setCurrentAttributeValue(ByteString value) { |
| | | attributeValue=value; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isFirstAttribute() { |
| | | return isFirst; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setIsFirstAttribute(boolean val) { |
| | | isFirst=val; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean hasEntryTestRule() { |
| | | return isEntryTestRule; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void setEntryTestRule(boolean val) { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setEntryTestRule(boolean val) { |
| | | isEntryTestRule=val; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Entry getResourceEntry() { |
| | | return resourceEntry; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Entry getClientEntry() { |
| | | return this.authorizationEntry; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public List<Aci> getDenyList() { |
| | | return denyList; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public List<Aci> getAllowList() { |
| | | return allowList; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isDenyEval() { |
| | | return EnumEvalReason.NO_ALLOW_ACIS.equals(evalReason) |
| | | || EnumEvalReason.EVALUATED_DENY_ACI.equals(evalReason); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAnonymousUser() { |
| | | return !authInfo.isAuthenticated(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getClientDN() { |
| | | if(this.useAuthzid) |
| | |
| | | return DN.rootDN(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getResourceDN() { |
| | | return resourceEntry.getName(); |
| | |
| | | return (this.rightsMask & rights) != 0; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int getRights() { |
| | | return this.rightsMask; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setRights(int rights) { |
| | | this.rightsMask=rights; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getHostName() { |
| | | return clientConnection.getRemoteAddress().getCanonicalHostName(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public InetAddress getRemoteAddress() { |
| | | return clientConnection.getRemoteAddress(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAddOperation() { |
| | | return operation instanceof AddOperation; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setTargAttrFiltersMatch(boolean v) { |
| | | this.targAttrFiltersMatch=v; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean getTargAttrFiltersMatch() { |
| | | return targAttrFiltersMatch; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getControlOID() { |
| | | return controlOID; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getExtOpOID() { |
| | | return extOpOID; |
| | |
| | | this.extOpOID=oid; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public EnumEvalResult hasAuthenticationMethod(EnumAuthMethod authMethod, |
| | | String saslMech) { |
| | | EnumEvalResult matched=EnumEvalResult.FALSE; |
| | | |
| | | if(authMethod==EnumAuthMethod.AUTHMETHOD_NONE) { |
| | | /** |
| | | /* |
| | | * None actually means any, in that we don't care what method was used. |
| | | * This doesn't seem very intuitive or useful, but that's the way it is. |
| | | */ |
| | | matched = EnumEvalResult.TRUE; |
| | | } else { |
| | | /* |
| | | * Some kind of authentication is required. |
| | | */ |
| | | // Some kind of authentication is required. |
| | | if(authInfo.isAuthenticated()) { |
| | | if(authMethod==EnumAuthMethod.AUTHMETHOD_SIMPLE) { |
| | | if(authInfo.hasAuthenticationType(AuthenticationType.SIMPLE)) { |
| | |
| | | return matched; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isMemberOf(Group<?> group) { |
| | | try { |
| | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setEvalUserAttributes(int v) { |
| | | if(operation instanceof SearchOperation && (rightsMask == ACI_READ)) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setEvalOpAttributes(int v) { |
| | | if(operation instanceof SearchOperation && (rightsMask == ACI_READ)) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean hasEvalUserAttributes() { |
| | | return hasAttribute(ACI_FOUND_USER_ATTR_RULE); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean hasEvalOpAttributes() { |
| | | return hasAttribute(ACI_FOUND_OP_ATTR_RULE); |
| | |
| | | return (evalAllAttributes & aciAttribute) == aciAttribute; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void clearEvalAttributes(int v) { |
| | | if(v == 0) |
| | |
| | | evalAllAttributes &= ~v; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int getCurrentSSF() { |
| | | return clientConnection.getSSF(); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void doPostSynchronization( |
| | | PostSynchronizationAddOperation addOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void doPostSynchronization( |
| | | PostSynchronizationDeleteOperation deleteOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void doPostSynchronization( |
| | | PostSynchronizationModifyDNOperation modifyDNOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void doPostSynchronization( |
| | | PostSynchronizationModifyOperation modifyOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PostOperation doPostOperation( |
| | | PostOperationAddOperation addOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PostOperation doPostOperation( |
| | | PostOperationDeleteOperation deleteOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PostOperation doPostOperation( |
| | | PostOperationModifyDNOperation modifyDNOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PostOperation doPostOperation( |
| | | PostOperationModifyOperation modifyOperation) |
| | |
| | | |
| | | |
| | | |
| | | /* |
| | | * The configuration DN. |
| | | */ |
| | | /** The configuration DN. */ |
| | | private DN configurationDN; |
| | | |
| | | /* |
| | | * True if the server is in lockdown mode. |
| | | */ |
| | | /** True if the server is in lockdown mode. */ |
| | | private boolean inLockDownMode; |
| | | |
| | | /* |
| | | * The AciList caches the ACIs. |
| | | */ |
| | | /** The AciList caches the ACIs. */ |
| | | private AciList aciList; |
| | | |
| | | /* |
| | | * Search filter used in context search for "aci" attribute types. |
| | | */ |
| | | /** Search filter used in context search for "aci" attribute types. */ |
| | | private static SearchFilter aciFilter; |
| | | |
| | | /* |
| | | /** |
| | | * Internal plugin used for updating the cache before a response is |
| | | * sent to the client. |
| | | */ |
| | | private final AciChangeListenerPlugin plugin; |
| | | |
| | | /* |
| | | /** |
| | | * The aci attribute type is operational so we need to specify it to |
| | | * be returned. |
| | | */ |
| | |
| | | return false; |
| | | break; |
| | | case SINGLE_LEVEL: |
| | | /** |
| | | /* |
| | | * We use the standard definition of single level to mean the |
| | | * immediate children only -- not the target entry itself. |
| | | * Sun CR 6535035 has been raised on DSEE: |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.server.authorization.dseecompat; |
| | | |
| | | /** |
| | | * This class provides an enumeration of the two access |
| | | * types (allow, deny). |
| | | * This class provides an enumeration of the two access types (allow, deny). |
| | | */ |
| | | public enum EnumAccessType { |
| | | |
| | | /** |
| | | * Allow access type. |
| | | */ |
| | | /** Allow access type. */ |
| | | ALLOW ("allow"), |
| | | /** |
| | | * Deny access type. |
| | | */ |
| | | /** Deny access type. */ |
| | | DENY ("deny"); |
| | | |
| | | /* |
| | | * The access type string. |
| | | */ |
| | | /** The access type string. */ |
| | | private final String accessType; |
| | | |
| | | /** |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.server.authorization.dseecompat; |
| | | |
| | | /** |
| | |
| | | */ |
| | | AUTHMETHOD_SASL ("sasl"); |
| | | |
| | | /* |
| | | * The name of the authmethod. |
| | | */ |
| | | private String authmethod = null; |
| | | |
| | | /** |
| | | * Creates a new enumeration type for this authmethod. |
| | | * @param authmethod The authemethod name. |
| | | */ |
| | | EnumAuthMethod (String authmethod){ |
| | | this.authmethod = authmethod; |
| | | } |
| | | |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.server.authorization.dseecompat; |
| | |
| | | * authmethod. |
| | | */ |
| | | AUTHMETHOD ("authmethod"), |
| | | /** |
| | | * The enumeration type when the bind rule has specified keyword of |
| | | * ssf. |
| | | */ |
| | | /** The enumeration type when the bind rule has specified keyword of ssf. */ |
| | | SSF("ssf"); |
| | | |
| | | /* |
| | | * The keyword name. |
| | | */ |
| | | /** The keyword name. */ |
| | | private final String keyword; |
| | | |
| | | /** |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.server.authorization.dseecompat; |
| | | |
| | | /** |
| | | * This class provides an enumeration of the allowed bind rule booelan types. |
| | | * This class provides an enumeration of the allowed bind rule boolean types. |
| | | */ |
| | | public enum EnumBooleanTypes { |
| | | |
| | |
| | | */ |
| | | NOT_BOOLEAN_TYPE ("not"); |
| | | |
| | | /* |
| | | * The bind rule boolean type name. |
| | | */ |
| | | /** The bind rule boolean type name. */ |
| | | private final String booleanType; |
| | | |
| | | /** |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.server.authorization.dseecompat; |
| | | |
| | | import java.util.Calendar; |
| | |
| | | */ |
| | | DAY_SUNDAY ("sun"); |
| | | |
| | | /* |
| | | * The bind rule dayofweek type name. |
| | | */ |
| | | /** The bind rule dayofweek type name. */ |
| | | private String day = null; |
| | | |
| | | /** |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.server.authorization.dseecompat; |
| | |
| | | */ |
| | | KEYWORD_EXTOP ("extop"); |
| | | |
| | | /* |
| | | * The target keyword name. |
| | | */ |
| | | /** The target keyword name. */ |
| | | private final String keyword; |
| | | |
| | | /** |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.server.authorization.dseecompat; |
| | |
| | | */ |
| | | NOT_EQUALITY ("!="); |
| | | |
| | | /* |
| | | * The target operator name. |
| | | */ |
| | | /** The target operator name. */ |
| | | private final String operator; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public class ParentInheritance { |
| | | |
| | | /* |
| | | * The maximum number of parent inheritance levels supported. |
| | | */ |
| | | /** The maximum number of parent inheritance levels supported. */ |
| | | private static final int MAX_LEVELS=10; |
| | | |
| | | /* |
| | | * Pattern to match for parent inheritance. |
| | | */ |
| | | /** Pattern to match for parent inheritance. */ |
| | | private final String parentPat="parent["; |
| | | |
| | | /* |
| | | /** |
| | | * Array used to hold the level information. Each slot corresponds to a |
| | | * level parsed from the rule. |
| | | */ |
| | | private final int[] levels=new int[MAX_LEVELS]; |
| | | |
| | | /* |
| | | * The number of levels parsed. |
| | | */ |
| | | /** The number of levels parsed. */ |
| | | private int numLevels; |
| | | |
| | | /* |
| | | /** |
| | | * The attribute type string parsed from the rule. Only used in |
| | | * inheritance search. |
| | | */ |
| | | private String attrTypeStr; |
| | | |
| | | /* |
| | | /** |
| | | * The base DN of a URL parsed from the rule. Used to make sure groupdn |
| | | * are under this suffix. Originally a way to search all nested groups |
| | | * under this suffix, so the behavior is slightly different. |
| | |
| | | */ |
| | | private void parse (String pattern) throws AciException { |
| | | pattern=pattern.trim(); |
| | | /** |
| | | * Check if we have a "parent[" string. |
| | | */ |
| | | // Check if we have a "parent[" string. |
| | | if(pattern.startsWith(parentPat)) { |
| | | numLevels=0; |
| | | levels[0]=0; |
| | | String p=pattern.substring(parentPat.length()); |
| | | /** |
| | | /* |
| | | * Format needs to be parent[XX].attribute -- everything after the |
| | | * '.' is the attribute type. |
| | | */ |
| | |
| | | StringTokenizer tok=new StringTokenizer(toks[0],"],",false); |
| | | while(tok.hasMoreTokens()) { |
| | | String v=tok.nextToken(); |
| | | /** |
| | | /* |
| | | * Everything between the brackets must be an integer or it's |
| | | * an error. |
| | | */ |
| | |
| | | IPv4, IPv6 |
| | | } |
| | | |
| | | /* |
| | | The IP address type (v6 or v4). |
| | | */ |
| | | /** The IP address type (v6 or v4). */ |
| | | private IPType ipType; |
| | | |
| | | /* |
| | | IPv4 sizes of addresses and prefixes. |
| | | */ |
| | | /** IPv4 sizes of addresses and prefixes. */ |
| | | private static int IN4ADDRSZ = 4; |
| | | private static int IPV4MAXPREFIX = 32; |
| | | |
| | | /* |
| | | IPv6 sizes of addresses and prefixes. |
| | | */ |
| | | /** IPv6 sizes of addresses and prefixes. */ |
| | | private static int IN6ADDRSZ = 16; |
| | | private static int IPV6MAXPREFIX = 128; |
| | | |
| | | /* |
| | | /** |
| | | Byte arrays used to match the remote IP address. The ruleAddrByte array |
| | | contains the bytes of the address from the ACI IP bind rule. The |
| | | rulePrefixBytes array contains the bytes of the cidr prefix or netmask |
| | |
| | | */ |
| | | private byte[] ruleAddrBytes, rulePrefixBytes; |
| | | |
| | | /* |
| | | /** |
| | | Bit set that holds the wild-card information of processed IPv4 addresses. |
| | | */ |
| | | private BitSet wildCardBitSet; |
| | | |
| | | /* |
| | | /** |
| | | Hash map of valid netmask strings. Used in parsing netmask values. |
| | | */ |
| | | private static HashMap<String,String> validNetMasks = |
| | | new HashMap<String, String>(); |
| | | |
| | | /* |
| | | Initialize valid netmask hash map. |
| | | */ |
| | | /** Initialize valid netmask hash map. */ |
| | | static { |
| | | initNetMask( |
| | | "255.255.255.255", |
| | |
| | | firstOp + ZERO_OR_MORE_WHITESPACE + EQUAL_SIGN + |
| | | ZERO_OR_MORE_WHITESPACE; |
| | | String[] temp=subExpression.split(opPattern); |
| | | /** |
| | | /* |
| | | * Check that the initial list operation is not equal to the second. |
| | | * For example: Matcher find |
| | | * |
| | |
| | | get(expression); |
| | | throw new AciException(message); |
| | | } |
| | | /** |
| | | /* |
| | | * Check that there are not too many filter lists. There can only |
| | | * be either one or two. |
| | | */ |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.authorization.dseecompat; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | |
| | | |
| | | /** |
| | | * This class represents a targetfilter keyword of an aci. |
| | | * |
| | | */ |
| | | public class TargetFilter { |
| | | |
| | | /* |
| | | * Enumeration representing the targetfilter operation. |
| | | */ |
| | | /** Enumeration representing the targetfilter operation. */ |
| | | private EnumTargetOperator op = EnumTargetOperator.EQUALITY; |
| | | |
| | | /* |
| | | * Filter parsed from the ACI used to match the resource entry. |
| | | */ |
| | | /** Filter parsed from the ACI used to match the resource entry. */ |
| | | private SearchFilter filter; |
| | | |
| | | /* |
| | | /** |
| | | * Class representing a targetfilter keyword. |
| | | * @param op The operation of the targetfilter expression (=, !=) |
| | | * @param filter The filter itself. |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.authorization.dseecompat; |
| | | |
| | |
| | | */ |
| | | public class UserDNTypeURL { |
| | | |
| | | /* |
| | | * The DN type of the URL. |
| | | */ |
| | | /** The DN type of the URL. */ |
| | | private EnumUserDNType dnType; |
| | | |
| | | /* |
| | | * The URL value. Maybe a dummy value for types such as ANYONE or SELF. |
| | | */ |
| | | /** The URL value. Maybe a dummy value for types such as ANYONE or SELF. */ |
| | | private LDAPURL url; |
| | | |
| | | /** |
| | |
| | | /** The 'backup.info' file. */ |
| | | private final File backupInfo; |
| | | |
| | | /** The last modify time of the backupInfo file */ |
| | | /** The last modify time of the backupInfo file. */ |
| | | private long lastModified; |
| | | |
| | | /** The BackupDirectory parsed at lastModified time. */ |
| | |
| | | // Start with an empty schema entry. |
| | | Entry schemaEntry = createEmptySchemaEntry(); |
| | | |
| | | /** |
| | | /* |
| | | * Add all of the ldap syntax descriptions to the schema entry. We do |
| | | * this only for the real part of the ldapsyntaxes attribute. The real part |
| | | * is read and write to/from the schema files. |
| | |
| | | { |
| | | //Get the Matching Rule OID of the filter. |
| | | String matchRuleOID = filter.getMatchingRuleID(); |
| | | /** |
| | | /* |
| | | * Use the default equality index in two conditions: |
| | | * 1. There is no matching rule provided |
| | | * 2. The matching rule specified is actually the default equality. |
| | |
| | | return ccr; |
| | | } |
| | | |
| | | /** |
| | | * @param newCfg |
| | | */ |
| | | private void updateDiskMonitor(DiskSpaceMonitor dm, LocalDBBackendCfg newCfg) |
| | | { |
| | | dm.setFullThreshold(newCfg.getDiskFullThreshold()); |
| | |
| | | new HashMap<String, PropertyDefinition>(); |
| | | |
| | | |
| | | // Pulled from resource/admin/ABBREVIATIONS.xsl. db is mose common. |
| | | /** Pulled from resource/admin/ABBREVIATIONS.xsl. db is mose common. */ |
| | | private static final List<String> ABBREVIATIONS = Arrays.asList(new String[] |
| | | {"aci", "ip", "ssl", "dn", "rdn", "jmx", "smtp", "http", |
| | | "https", "ldap", "ldaps", "ldif", "jdbc", "tcp", "tls", |
| | |
| | | "vlv", "uuid", "md5", "sha1", "sha256", "sha384", "sha512", |
| | | "tls", "db"}); |
| | | |
| | | /* |
| | | * e.g. db-cache-percent -> DBCachePercent |
| | | */ |
| | | /** E.g. db-cache-percent -> DBCachePercent */ |
| | | private static String propNametoCamlCase(String hyphenated) |
| | | { |
| | | String[] components = hyphenated.split("\\-"); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends.jeb; |
| | | |
| | |
| | | // Progress report timer task. |
| | | Timer timer = new Timer(); |
| | | TimerTask progressTask = new TimerTask() { |
| | | // Persistent state restore progress report. |
| | | /** Persistent state restore progress report. */ |
| | | @Override |
| | | public void run() { |
| | | if (processedEntries.get() > 0) { |
| | |
| | | */ |
| | | private class PreloadEntry { |
| | | |
| | | // Encoded Entry. |
| | | /** Encoded Entry. */ |
| | | public byte[] entryBytes; |
| | | |
| | | // Encoded EntryID. |
| | | /** Encoded EntryID. */ |
| | | public byte[] entryIDBytes; |
| | | |
| | | /** |
| | |
| | | if(sortRequest != null && !sortRequest.containsSortKeys() |
| | | && sortRequest.isCritical()) |
| | | { |
| | | /** |
| | | /* |
| | | If the control's criticality field is true then the server SHOULD do |
| | | the following: return unavailableCriticalExtension as a return code |
| | | in the searchResultDone message; include the sortKeyResponseControl in |
| | |
| | | // in the import so we don't want to copy the branch to the |
| | | // new entry container. |
| | | |
| | | /** |
| | | /* |
| | | * Advance the cursor to next entry at the same level in the DIT |
| | | * skipping all the entries in this branch. Set the next |
| | | * starting value to a value of equal length but slightly |
| | |
| | | private long offset; |
| | | private final ByteBuffer cache; |
| | | |
| | | // Next fields are the fetched record data |
| | | /** Next fields are the fetched record data. */ |
| | | private Integer indexID; |
| | | private ByteBuffer keyBuf = ByteBuffer.allocate(128); |
| | | private RecordState recordState = RecordState.START; |
| | |
| | | } |
| | | |
| | | /** |
| | | * Sets files permissions on the backend directory |
| | | * Sets files permissions on the backend directory. |
| | | * |
| | | * @param backendDir the directory to setup |
| | | * @param curCfg a backend configuration |
| | |
| | | { |
| | | //Get the Matching Rule OID of the filter. |
| | | String matchRuleOID = filter.getMatchingRuleID(); |
| | | /** |
| | | /* |
| | | * Use the default equality index in two conditions: |
| | | * 1. There is no matching rule provided |
| | | * 2. The matching rule specified is actually the default equality. |
| | |
| | | // Progress report timer task. |
| | | Timer timer = new Timer(); |
| | | TimerTask progressTask = new TimerTask() { |
| | | // Persistent state restore progress report. |
| | | /** Persistent state restore progress report. */ |
| | | @Override |
| | | public void run() { |
| | | if (processedEntries.get() > 0) { |
| | |
| | | return sortByGreaterThanOrEqualAssertion(searchOperation, vlvRequest, sortMap); |
| | | } |
| | | |
| | | // FIXME: Might be moved into a util.Longs class |
| | | /** FIXME: Might be moved into a util.Longs class */ |
| | | private static final long[] toArray(Collection<? extends Number> collection) |
| | | { |
| | | checkNotNull(collection, "collection must not be null"); |
| | |
| | | private static final long[] EMPTY_LONG_ARRAY = new long[0]; |
| | | private static final long[] NO_ENTRY_IDS_RANGE = new long[] { 0, 0 }; |
| | | |
| | | /** |
| | | * Interface for EntryIDSet concrete implementations |
| | | */ |
| | | /** Interface for EntryIDSet concrete implementations. */ |
| | | private interface EntryIDSetImplementor extends Iterable<EntryID> |
| | | { |
| | | long size(); |
| | |
| | | // in the import so we don't want to copy the branch to the |
| | | // new entry container. |
| | | |
| | | /** |
| | | /* |
| | | * Advance the cursor to next entry at the same level in the DIT |
| | | * skipping all the entries in this branch. Set the next |
| | | * starting value to a value of equal length but slightly |
| | |
| | | private long offset; |
| | | private final ByteBuffer cache; |
| | | |
| | | // Next fields are the fetched record data |
| | | /** Next fields are the fetched record data. */ |
| | | private Integer indexID; |
| | | private final ByteStringBuilder keyBuffer = new ByteStringBuilder(128); |
| | | private RecordState recordState = RecordState.START; |
| | |
| | | } |
| | | } |
| | | |
| | | // Matches encoding from SortValuesSet. |
| | | /** Matches encoding from SortValuesSet. */ |
| | | private int getEncodedSize(ByteString bytes) |
| | | { |
| | | return bytes.toInt(); |
| | |
| | | |
| | | |
| | | |
| | | // The DN for the task entry. |
| | | /** The DN for the task entry. */ |
| | | private DN taskEntryDN; |
| | | |
| | | // The entry that actually defines this task. |
| | | /** The entry that actually defines this task. */ |
| | | private Entry taskEntry; |
| | | |
| | | // The action to take if one of the dependencies for this task does not |
| | | // complete successfully. |
| | | /** |
| | | * The action to take if one of the dependencies for this task does not |
| | | * complete successfully. |
| | | */ |
| | | private FailedDependencyAction failedDependencyAction; |
| | | |
| | | // The counter used for log messages associated with this task. |
| | | /** The counter used for log messages associated with this task. */ |
| | | private int logMessageCounter; |
| | | |
| | | // The task IDs of other tasks on which this task is dependent. |
| | | /** The task IDs of other tasks on which this task is dependent. */ |
| | | private LinkedList<String> dependencyIDs; |
| | | |
| | | // A set of log messages generated by this task. |
| | | // TODO: convert from String to LocalizableMessage objects. |
| | | // Since these are stored in an entry we would need |
| | | // to adopt some way for writing message to string in such |
| | | // a way that the information could be reparsed from its |
| | | // string value. |
| | | /** |
| | | * A set of log messages generated by this task. |
| | | * TODO: convert from String to LocalizableMessage objects. |
| | | * Since these are stored in an entry we would need |
| | | * to adopt some way for writing message to string in such |
| | | * a way that the information could be reparsed from its |
| | | * string value. |
| | | */ |
| | | private LinkedList<String> logMessages; |
| | | |
| | | // The set of e-mail addresses of the users to notify when the task is done |
| | | // running, regardless of whether it completes successfully. |
| | | /** |
| | | * The set of e-mail addresses of the users to notify when the task is done |
| | | * running, regardless of whether it completes successfully. |
| | | */ |
| | | private LinkedList<String> notifyOnCompletion; |
| | | |
| | | // The set of e-mail addresses of the users to notify if the task does not |
| | | // complete successfully for some reason. |
| | | /** |
| | | * The set of e-mail addresses of the users to notify if the task does not |
| | | * complete successfully for some reason. |
| | | */ |
| | | private LinkedList<String> notifyOnError; |
| | | |
| | | // The time that processing actually started for this task. |
| | | /** The time that processing actually started for this task. */ |
| | | private long actualStartTime; |
| | | |
| | | // The time that actual processing ended for this task. |
| | | /** The time that actual processing ended for this task. */ |
| | | private long completionTime; |
| | | |
| | | // The time that this task was scheduled to start processing. |
| | | /** The time that this task was scheduled to start processing. */ |
| | | private long scheduledStartTime; |
| | | |
| | | // The operation used to create this task in the server. |
| | | /** The operation used to create this task in the server. */ |
| | | private Operation operation; |
| | | |
| | | // The ID of the recurring task with which this task is associated. |
| | | /** The ID of the recurring task with which this task is associated. */ |
| | | private String recurringTaskID; |
| | | |
| | | // The unique ID assigned to this task. |
| | | /** The unique ID assigned to this task. */ |
| | | private String taskID; |
| | | |
| | | // The task backend with which this task is associated. |
| | | /** The task backend with which this task is associated. */ |
| | | private TaskBackend taskBackend; |
| | | |
| | | // The current state of this task. |
| | | /** The current state of this task. */ |
| | | private TaskState taskState; |
| | | |
| | | // The task state that may be set when the task is interrupted. |
| | | /** The task state that may be set when the task is interrupted. */ |
| | | private TaskState taskInterruptState; |
| | | |
| | | // The scheduler with which this task is associated. |
| | | /** The scheduler with which this task is associated. */ |
| | | private TaskScheduler taskScheduler; |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | |
| | | // Indicates whether the scheduler is currently running. |
| | | /** Indicates whether the scheduler is currently running. */ |
| | | private boolean isRunning; |
| | | |
| | | // Indicates whether a request has been received to stop the scheduler. |
| | | /** Indicates whether a request has been received to stop the scheduler. */ |
| | | private boolean stopRequested; |
| | | |
| | | // The entry that serves as the immediate parent for recurring tasks. |
| | | /** The entry that serves as the immediate parent for recurring tasks. */ |
| | | private Entry recurringTaskParentEntry; |
| | | |
| | | // The entry that serves as the immediate parent for scheduled tasks. |
| | | /** The entry that serves as the immediate parent for scheduled tasks. */ |
| | | private Entry scheduledTaskParentEntry; |
| | | |
| | | // The top-level entry at the root of the task tree. |
| | | /** The top-level entry at the root of the task tree. */ |
| | | private Entry taskRootEntry; |
| | | |
| | | // The set of recurring tasks defined in the server. |
| | | /** The set of recurring tasks defined in the server. */ |
| | | private HashMap<String,RecurringTask> recurringTasks; |
| | | |
| | | // The set of tasks associated with this scheduler. |
| | | /** The set of tasks associated with this scheduler. */ |
| | | private HashMap<String,Task> tasks; |
| | | |
| | | // The set of worker threads that are actively busy processing tasks. |
| | | /** The set of worker threads that are actively busy processing tasks. */ |
| | | private HashMap<String,TaskThread> activeThreads; |
| | | |
| | | // The thread ID for the next task thread to be created; |
| | | /** The thread ID for the next task thread to be created;. */ |
| | | private int nextThreadID; |
| | | |
| | | // The set of worker threads that may be used to process tasks. |
| | | /** The set of worker threads that may be used to process tasks. */ |
| | | private LinkedList<TaskThread> idleThreads; |
| | | |
| | | // The lock used to provide threadsafe access to the scheduler. |
| | | /** The lock used to provide threadsafe access to the scheduler. */ |
| | | private final ReentrantLock schedulerLock; |
| | | |
| | | // The task backend with which this scheduler is associated. |
| | | /** The task backend with which this scheduler is associated. */ |
| | | private TaskBackend taskBackend; |
| | | |
| | | // The thread being used to actually run the scheduler. |
| | | /** The thread being used to actually run the scheduler. */ |
| | | private Thread schedulerThread; |
| | | |
| | | // The set of recently-completed tasks that need to be retained. |
| | | /** The set of recently-completed tasks that need to be retained. */ |
| | | private TreeSet<Task> completedTasks; |
| | | |
| | | // The set of tasks that have been scheduled but not yet arrived. |
| | | /** The set of tasks that have been scheduled but not yet arrived. */ |
| | | private TreeSet<Task> pendingTasks; |
| | | |
| | | // The set of tasks that are currently running. |
| | | /** The set of tasks that are currently running. */ |
| | | private TreeSet<Task> runningTasks; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.config; |
| | | |
| | |
| | | public final class BooleanConfigAttribute |
| | | extends ConfigAttribute |
| | | { |
| | | // The active value for this attribute. |
| | | /** The active value for this attribute. */ |
| | | private boolean activeValue; |
| | | |
| | | // The pending value for this attribute. |
| | | /** The pending value for this attribute. */ |
| | | private boolean pendingValue; |
| | | |
| | | |
| | |
| | | mayInvoke=true) |
| | | public abstract class ConfigAttribute |
| | | { |
| | | // Indicates whether this configuration attribute has pending changes that |
| | | // will be applied after appropriate administrative action has been performed. |
| | | /** |
| | | * Indicates whether this configuration attribute has pending changes that |
| | | * will be applied after appropriate administrative action has been performed. |
| | | */ |
| | | private boolean hasPendingValues; |
| | | |
| | | // Indicates whether this configuration attribute may have multiple values. |
| | | /** Indicates whether this configuration attribute may have multiple values. */ |
| | | private boolean isMultiValued; |
| | | |
| | | // Indicates whether this configuration attribute is required to have a value. |
| | | /** Indicates whether this configuration attribute is required to have a value. */ |
| | | private boolean isRequired; |
| | | |
| | | // Indicates whether changes to this attribute require administrative action |
| | | // before they will take effect. |
| | | /** |
| | | * Indicates whether changes to this attribute require administrative action |
| | | * before they will take effect. |
| | | */ |
| | | private boolean requiresAdminAction; |
| | | |
| | | // The value or set of values that are currently in effect for this |
| | | // configuration attribute. |
| | | /** |
| | | * The value or set of values that are currently in effect for this |
| | | * configuration attribute. |
| | | */ |
| | | private LinkedHashSet<ByteString> activeValues; |
| | | |
| | | // The value or set of values that will be in effect once the appropriate |
| | | // administrative action has been taken. |
| | | /** |
| | | * The value or set of values that will be in effect once the appropriate |
| | | * administrative action has been taken. |
| | | */ |
| | | private LinkedHashSet<ByteString> pendingValues; |
| | | |
| | | // The description for this configuration attribute. |
| | | /** The description for this configuration attribute. */ |
| | | private LocalizableMessage description; |
| | | |
| | | // The name for this configuration attribute. |
| | | /** The name for this configuration attribute. */ |
| | | private String name; |
| | | |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The set of active values for this attribute. |
| | | /** The set of active values for this attribute. */ |
| | | private List<DN> activeValues; |
| | | |
| | | // The set of pending values for this attribute. |
| | | /** The set of pending values for this attribute. */ |
| | | private List<DN> pendingValues; |
| | | |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The set of active values for this attribute. |
| | | /** The set of active values for this attribute. */ |
| | | private List<Long> activeValues; |
| | | |
| | | // The set of pending values for this attribute. |
| | | /** The set of pending values for this attribute. */ |
| | | private List<Long> pendingValues; |
| | | |
| | | // Indicates whether this attribute will impose a lower bound for its values. |
| | | /** Indicates whether this attribute will impose a lower bound for its values. */ |
| | | private boolean hasLowerBound; |
| | | |
| | | // Indicates whether this attribute will impose an upper bound for its values. |
| | | /** Indicates whether this attribute will impose an upper bound for its values. */ |
| | | private boolean hasUpperBound; |
| | | |
| | | // The lower bound for values of this attribute. |
| | | /** The lower bound for values of this attribute. */ |
| | | private long lowerBound; |
| | | |
| | | // The upper bound for values of this attribute. |
| | | /** The upper bound for values of this attribute. */ |
| | | private long upperBound; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.config; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | |
| | | |
| | | |
| | | // Indicates whether this configuration attribute should impose a lower bound |
| | | // for the calculated value. |
| | | /** |
| | | * Indicates whether this configuration attribute should impose a lower bound |
| | | * for the calculated value. |
| | | */ |
| | | private boolean hasLowerBound; |
| | | |
| | | // Indicates whether this configuration attribute should impose an upper bound |
| | | // for the calculated value. |
| | | /** |
| | | * Indicates whether this configuration attribute should impose an upper bound |
| | | * for the calculated value. |
| | | */ |
| | | private boolean hasUpperBound; |
| | | |
| | | // The set of unit names and associated multipliers. |
| | | /** The set of unit names and associated multipliers. */ |
| | | private HashMap<String,Double> units; |
| | | |
| | | // The active calculated value for this attribute. |
| | | /** The active calculated value for this attribute. */ |
| | | private long activeCalculatedValue; |
| | | |
| | | // The active value for this attribute. |
| | | /** The active value for this attribute. */ |
| | | private long activeIntValue; |
| | | |
| | | // The lower bound for the calculated value. |
| | | /** The lower bound for the calculated value. */ |
| | | private long lowerBound; |
| | | |
| | | // The pending calculated value for this attribute. |
| | | /** The pending calculated value for this attribute. */ |
| | | private long pendingCalculatedValue; |
| | | |
| | | // The the pending value for this attribute. |
| | | /** The the pending value for this attribute. */ |
| | | private long pendingIntValue; |
| | | |
| | | // The upper bound for the calculated value. |
| | | /** The upper bound for the calculated value. */ |
| | | private long upperBound; |
| | | |
| | | // The active unit for this attribute. |
| | | /** The active unit for this attribute. */ |
| | | private String activeUnit; |
| | | |
| | | // The pending unit for this attribute. |
| | | /** The pending unit for this attribute. */ |
| | | private String pendingUnit; |
| | | |
| | | |
| | |
| | | public Attribute getAttribute(String attributeName) |
| | | throws AttributeNotFoundException |
| | | { |
| | | // |
| | | // Get the jmx Client connection |
| | | ClientConnection clientConnection = getClientConnection(); |
| | | if (clientConnection == null) |
| | |
| | | return null; |
| | | } |
| | | |
| | | // |
| | | // prepare the ldap search |
| | | |
| | | try |
| | | { |
| | | // |
| | | // Perform the Ldap operation for |
| | | // - ACI Check |
| | | // - Loggin purpose |
| | |
| | | @Override |
| | | public AttributeList getAttributes(String[] attributes) |
| | | { |
| | | // |
| | | // Get the jmx Client connection |
| | | ClientConnection clientConnection = getClientConnection(); |
| | | if (clientConnection == null) |
| | |
| | | return null; |
| | | } |
| | | |
| | | // |
| | | // Perform the Ldap operation for |
| | | // - ACI Check |
| | | // - Loggin purpose |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The set of active values for this attribute. |
| | | /** The set of active values for this attribute. */ |
| | | private List<String> activeValues; |
| | | |
| | | // The set of pending values for this attribute. |
| | | /** The set of pending values for this attribute. */ |
| | | private List<String> pendingValues; |
| | | |
| | | // The set of allowed values for this attribute. |
| | | /** The set of allowed values for this attribute. */ |
| | | private Set<String> allowedValues; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.config; |
| | | |
| | |
| | | public final class ReadOnlyConfigAttribute |
| | | extends ConfigAttribute |
| | | { |
| | | // The set of values for this attribute. |
| | | /** The set of values for this attribute. */ |
| | | private List<String> values; |
| | | |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The set of active values for this attribute. |
| | | /** The set of active values for this attribute. */ |
| | | private List<String> activeValues; |
| | | |
| | | // The set of pending values for this attribute. |
| | | /** The set of pending values for this attribute. */ |
| | | private List<String> pendingValues; |
| | | |
| | | |