| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.browser; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | */ |
| | | public synchronized boolean isWorking(BasicNode node) |
| | | { |
| | | boolean isWorking = workingList.get(node) != null; |
| | | return isWorking; |
| | | return workingList.get(node) != null; |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.guitools.controlpanel.task; |
| | | |
| | |
| | | DirectoryServer.getEnvironmentConfig().getSchemaDirectory(), |
| | | schemaFile); |
| | | } |
| | | schemaFile = f.getAbsolutePath(); |
| | | return schemaFile; |
| | | return f.getAbsolutePath(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.task; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | /** |
| | | * An abstract class used to re-factor some code between the start, stop and |
| | | * restart tasks. |
| | | * |
| | | */ |
| | | public abstract class StartStopTask extends Task |
| | | { |
| | |
| | | */ |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(); |
| | | return args; |
| | | return new ArrayList<String>(); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | private AttributeType getNewAttribute() |
| | | { |
| | | AttributeType attr = new AttributeType("", getAttributeName(), |
| | | return new AttributeType("", getAttributeName(), |
| | | getAllNames(), |
| | | getOID(), |
| | | getDescription(), |
| | |
| | | collective.isSelected(), nonModifiable.isSelected(), |
| | | obsolete.isSelected(), singleValued.isSelected(), |
| | | getExtraProperties()); |
| | | |
| | | return attr; |
| | | } |
| | | |
| | | private void updateDefaultMatchingRuleNames() |
| | |
| | | */ |
| | | private boolean updatedByUser() |
| | | { |
| | | boolean updatedByUser = !javaHome.getText().equals(readJavaHome) || |
| | | useOpenDSJavaHome.isSelected() != readUseOpenDSJavaHome || |
| | | useOpenDSJavaArgs.isSelected() != readUseOpenDSJavaArgs || |
| | | !readJavaArguments.equals(getCurrentJavaArguments()); |
| | | |
| | | return updatedByUser; |
| | | return !javaHome.getText().equals(readJavaHome) |
| | | || useOpenDSJavaHome.isSelected() != readUseOpenDSJavaHome |
| | | || useOpenDSJavaArgs.isSelected() != readUseOpenDSJavaArgs |
| | | || !readJavaArguments.equals(getCurrentJavaArguments()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | private String getPropertiesFile() |
| | | { |
| | | String installPath = getInfo().getServerDescriptor(). |
| | | getInstancePath(); |
| | | String propertiesFile = Utils.getPath( |
| | | String installPath = getInfo().getServerDescriptor().getInstancePath(); |
| | | return Utils.getPath( |
| | | Utilities.getInstanceRootDirectory(installPath).getAbsolutePath(), |
| | | Installation.RELATIVE_JAVA_PROPERTIES_FILE); |
| | | return propertiesFile; |
| | | } |
| | | |
| | | private void updateContentsOfPanelWithReadValues() |
| | |
| | | |
| | | private AttributeType getAttribute() |
| | | { |
| | | AttributeType attr = new AttributeType("", getAttributeName(), |
| | | return new AttributeType("", getAttributeName(), |
| | | getAllNames(), |
| | | getOID(), |
| | | getDescription(), |
| | |
| | | collective.isSelected(), nonModifiable.isSelected(), |
| | | obsolete.isSelected(), singleValued.isSelected(), |
| | | getExtraProperties()); |
| | | |
| | | return attr; |
| | | } |
| | | } |
| | |
| | | { |
| | | String dn = Utilities.getRDNString("ds-cfg-backend-id", backendName)+ |
| | | ",cn=Backends,cn=config"; |
| | | String ldif = Utilities.makeLdif( |
| | | return Utilities.makeLdif( |
| | | "dn: "+dn, |
| | | "objectClass: top", |
| | | "objectClass: ds-cfg-backend", |
| | |
| | | "ds-cfg-attribute: objectClass", |
| | | "ds-cfg-index-type: equality" |
| | | ); |
| | | return ldif; |
| | | } |
| | | |
| | | private String getAdditionalIndexLdif(String backendName) |
| | | { |
| | | String dn = "ds-cfg-backend-id="+backendName+",cn=Backends,cn=config"; |
| | | String ldif = Utilities.makeLdif( |
| | | return Utilities.makeLdif( |
| | | "dn: ds-cfg-attribute=cn,cn=Index,"+dn, |
| | | "objectClass: ds-cfg-local-db-index", |
| | | "objectClass: top", |
| | |
| | | "ds-cfg-attribute: uniqueMember", |
| | | "ds-cfg-index-type: equality" |
| | | ); |
| | | return ldif; |
| | | } |
| | | |
| | | private void createBackend(String backendName, String baseDN) |
| | |
| | | |
| | | private ObjectClass getObjectClass() |
| | | { |
| | | ObjectClass oc = new ObjectClass("", getObjectClassName(), getAllNames(), |
| | | return new ObjectClass("", getObjectClassName(), getAllNames(), |
| | | getOID(), |
| | | getDescription(), |
| | | getObjectClassSuperiors(), |
| | |
| | | getObjectClassType(), |
| | | obsolete.isSelected(), |
| | | getExtraProperties()); |
| | | |
| | | return oc; |
| | | } |
| | | |
| | | private ObjectClassType getObjectClassType() |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | */ |
| | | protected boolean isBinary(String attrName) |
| | | { |
| | | boolean isBinary = false; |
| | | Schema schema = getInfo().getServerDescriptor().getSchema(); |
| | | isBinary = Utilities.hasBinarySyntax(attrName, schema); |
| | | return isBinary; |
| | | return Utilities.hasBinarySyntax(attrName, schema); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | protected boolean isPassword(String attrName) |
| | | { |
| | | boolean isPassword = false; |
| | | Schema schema = getInfo().getServerDescriptor().getSchema(); |
| | | isPassword = Utilities.hasPasswordSyntax(attrName, schema); |
| | | return isPassword; |
| | | return Utilities.hasPasswordSyntax(attrName, schema); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | private int getMargin(Component c, ImageIcon icon) |
| | | { |
| | | int margin = (c.getHeight() - icon.getIconHeight()) / 2; |
| | | return margin; |
| | | return (c.getHeight() - icon.getIconHeight()) / 2; |
| | | } |
| | | |
| | | private ImageIcon getClearIcon() |
| | | { |
| | | ImageIcon icon = mousePressed ? clearIconPressed : clearIcon; |
| | | return icon; |
| | | return mousePressed ? clearIconPressed : clearIcon; |
| | | } |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui.renderer; |
| | |
| | | |
| | | private String getAttributeName(JTable table, int row) |
| | | { |
| | | Object o = table.getValueAt(row, 0); |
| | | String attrName = String.valueOf(o); |
| | | return attrName; |
| | | return String.valueOf(table.getValueAt(row, 0)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui.renderer; |
| | |
| | | Utilities.getVLVNameInCellRenderer((VLVIndexDescriptor)value); |
| | | value = mustReindex ? name + " (*)" : name; |
| | | } |
| | | Component comp = super.getListCellRendererComponent(list, value, index, |
| | | isSelected, cellHasFocus); |
| | | return comp; |
| | | return super.getListCellRendererComponent( |
| | | list, value, index, isSelected, cellHasFocus); |
| | | } |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.guitools.controlpanel.ui.renderer; |
| | | |
| | |
| | | break; |
| | | } |
| | | } |
| | | Component comp = super.getListCellRendererComponent(list, value, index, |
| | | isSelected, cellHasFocus); |
| | | |
| | | return comp; |
| | | return super.getListCellRendererComponent( |
| | | list, value, index, isSelected, cellHasFocus); |
| | | } |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui.renderer; |
| | |
| | | import javax.swing.JList; |
| | | import javax.swing.ListCellRenderer; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessageDescriptor.Arg1; |
| | | import org.opends.guitools.controlpanel.datamodel.VLVSortOrder; |
| | | |
| | | /** |
| | |
| | | if (value instanceof VLVSortOrder) |
| | | { |
| | | VLVSortOrder v = (VLVSortOrder)value; |
| | | if (v.isAscending()) |
| | | { |
| | | value = INFO_CTRL_PANEL_VLV_ASCENDING_VLV_INDEX.get( |
| | | v.getAttributeName()).toString(); |
| | | } |
| | | else |
| | | { |
| | | value = INFO_CTRL_PANEL_VLV_DESCENDING_VLV_INDEX.get( |
| | | v.getAttributeName()).toString(); |
| | | } |
| | | Arg1<Object> arg = v.isAscending() |
| | | ? INFO_CTRL_PANEL_VLV_ASCENDING_VLV_INDEX |
| | | : INFO_CTRL_PANEL_VLV_DESCENDING_VLV_INDEX; |
| | | value = arg.get(v.getAttributeName()).toString(); |
| | | } |
| | | Component comp = defaultRenderer.getListCellRendererComponent( |
| | | return defaultRenderer.getListCellRendererComponent( |
| | | list, value, index, isSelected, cellHasFocus); |
| | | |
| | | return comp; |
| | | } |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.guitools.uninstaller; |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | protected LocalizableMessage getFrameTitle() { |
| | | LocalizableMessage title = Utils.getCustomizedObject("INFO_FRAME_UNINSTALL_TITLE", |
| | | INFO_FRAME_UNINSTALL_TITLE.get( |
| | | DynamicConstants.PRODUCT_NAME), LocalizableMessage.class); |
| | | return title; |
| | | return Utils.getCustomizedObject("INFO_FRAME_UNINSTALL_TITLE", |
| | | INFO_FRAME_UNINSTALL_TITLE.get(DynamicConstants.PRODUCT_NAME), |
| | | LocalizableMessage.class); |
| | | } |
| | | |
| | | /** |
| | |
| | | ) |
| | | { |
| | | // returned status -- all is fine by default |
| | | boolean status = true; |
| | | |
| | | // Check if there is another entry cache installed at the same level. |
| | | if (!cacheOrderMap.isEmpty()) { |
| | | if (cacheOrderMap.containsKey(configuration.getCacheLevel())) { |
| | | unacceptableReasons.add( |
| | | ERR_CONFIG_ENTRYCACHE_CONFIG_LEVEL_NOT_ACCEPTABLE.get( |
| | | configuration.dn(), configuration.getCacheLevel())); |
| | | status = false; |
| | | return status; |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | catch (InitializationException ie) |
| | | { |
| | | unacceptableReasons.add (ie.getMessageObject()); |
| | | status = false; |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | return status; |
| | | return true; |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | ArrayList<LocalizableMessage> errorMessages |
| | | ) |
| | | { |
| | | ConfigErrorHandler errorHandler = null; |
| | | |
| | | EntryCacheCommon ec = new EntryCacheCommon(); |
| | | |
| | | errorHandler = ec.new ConfigErrorHandler ( |
| | | configPhase, unacceptableReasons, errorMessages |
| | | ); |
| | | return errorHandler; |
| | | return ec.new ConfigErrorHandler( |
| | | configPhase, unacceptableReasons, errorMessages); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ErrorLogAccountStatusNotificationHandlerCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons |
| | | ) |
| | | List<LocalizableMessage> unacceptableReasons) |
| | | { |
| | | // Make sure that we can process the defined notification handler. |
| | | // If so, then we'll accept the new configuration. |
| | | boolean applyChanges = false; |
| | | boolean isAcceptable = processNotificationHandlerConfig ( |
| | | configuration, applyChanges |
| | | ); |
| | | |
| | | return isAcceptable; |
| | | return processNotificationHandlerConfig ( |
| | | configuration, applyChanges); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange ( |
| | | ErrorLogAccountStatusNotificationHandlerCfg configuration, |
| | | boolean detailedResults |
| | | ) |
| | | boolean detailedResults) |
| | | { |
| | | ConfigChangeResult changeResult = applyConfigurationChange (configuration); |
| | | return changeResult; |
| | | return applyConfigurationChange(configuration); |
| | | } |
| | | |
| | | |
| | |
| | | FingerprintCertificateMapperCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | |
| | | return configAcceptable; |
| | | return true; |
| | | } |
| | | |
| | | |
| | |
| | | configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | return configAcceptable; |
| | | return true; |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | public Socket createSocket(String host, int port) throws IOException |
| | | { |
| | | // |
| | | // gets ssl socket factory |
| | | SSLSocketFactory sslSocketFactory = getSSLSocketFactory(); |
| | | String realhost = getRealServerHostname(host); |
| | | |
| | | final SSLSocket sslSocket = (SSLSocket) sslSocketFactory.createSocket( |
| | | realhost, |
| | | port); |
| | | |
| | | return sslSocket; |
| | | return (SSLSocket) sslSocketFactory.createSocket(realhost, port); |
| | | } |
| | | |
| | | /** |
| | |
| | | // associated with the provided message ID. The persistent |
| | | // search will ensure that all other related persistent |
| | | // searches are cancelled. |
| | | CancelResult cancelResult = ps.cancel(); |
| | | |
| | | return cancelResult; |
| | | return ps.cancel(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | CancelResult cancelResult = op.cancel(cancelRequest); |
| | | |
| | | return cancelResult; |
| | | return op.cancel(cancelRequest); |
| | | } |
| | | } |
| | | |
| | |
| | | le.getResultCode(), |
| | | le.getErrorMessage(), |
| | | le.getMatchedDN()); |
| | | int code = le.getResultCode(); |
| | | return code; |
| | | return le.getResultCode(); |
| | | } catch(LDAPConnectionException lce) |
| | | { |
| | | logger.traceException(lce); |
| | |
| | | lce.getResultCode(), |
| | | lce.getErrorMessage(), |
| | | lce.getMatchedDN()); |
| | | int code = lce.getResultCode(); |
| | | return code; |
| | | return lce.getResultCode(); |
| | | } catch(Exception e) |
| | | { |
| | | logger.traceException(e); |
| | |
| | | LDAPToolUtils.printErrorMessage(err, le.getMessageObject(), |
| | | le.getResultCode(), |
| | | le.getErrorMessage(), le.getMatchedDN()); |
| | | int code = le.getResultCode(); |
| | | return code; |
| | | return le.getResultCode(); |
| | | } catch(LDAPConnectionException lce) |
| | | { |
| | | logger.traceException(lce); |
| | |
| | | lce.getResultCode(), |
| | | lce.getErrorMessage(), |
| | | lce.getMatchedDN()); |
| | | int code = lce.getResultCode(); |
| | | return code; |
| | | return lce.getResultCode(); |
| | | } catch (FileNotFoundException fe) |
| | | { |
| | | logger.traceException(fe); |
| | |
| | | lce.getResultCode(), |
| | | lce.getErrorMessage(), |
| | | lce.getMatchedDN()); |
| | | int code = lce.getResultCode(); |
| | | return code; |
| | | return lce.getResultCode(); |
| | | } catch(Exception e) |
| | | { |
| | | logger.traceException(e); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.tools; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | err.println("Invalid format for criticality value:" + remainder); |
| | | return null; |
| | | } |
| | | control = new LDAPControl(controlOID, controlCriticality); |
| | | return control; |
| | | |
| | | return new LDAPControl(controlOID, controlCriticality); |
| | | } |
| | | |
| | | String critical = remainder.substring(0, idx); |
| | |
| | | String valString = remainder.substring(idx+1, remainder.length()); |
| | | if (valString.length() == 0) |
| | | { |
| | | control = new LDAPControl(controlOID, controlCriticality); |
| | | return control; |
| | | return new LDAPControl(controlOID, controlCriticality); |
| | | } |
| | | if(valString.charAt(0) == ':') |
| | | { |
| | |
| | | controlValue = ByteString.valueOf(valString); |
| | | } |
| | | |
| | | control = new LDAPControl(controlOID, controlCriticality, controlValue); |
| | | return control; |
| | | |
| | | return new LDAPControl(controlOID, controlCriticality, controlValue); |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.tools.dsreplication; |
| | |
| | | new PurgeHistoricalScheduleInformation(uData); |
| | | ArrayList<RawAttribute> rawAttrs = |
| | | TaskClient.getTaskAttributes(information); |
| | | BasicAttributes attrs = getAttributes(rawAttrs); |
| | | return attrs; |
| | | return getAttributes(rawAttrs); |
| | | } |
| | | |
| | | private static BasicAttributes getAttributes(ArrayList<RawAttribute> rawAttrs) |
| | |
| | | public Certificate getCertificate(String alias) |
| | | throws KeyStoreException { |
| | | ensureValid(alias, CERT_ALIAS_MSG); |
| | | Certificate cert = null; |
| | | KeyStore ks = getKeyStore(); |
| | | if (ks == null) { |
| | | LocalizableMessage msg = ERR_CERTMGR_KEYSTORE_NONEXISTANT.get(); |
| | | throw new KeyStoreException(msg.toString()); |
| | | } |
| | | cert = ks.getCertificate(alias); |
| | | return cert; |
| | | return ks.getCertificate(alias); |
| | | } |
| | | |
| | | |