AutoRefactor'ed Use diamond operator
| | |
| | | private String scmRepositoryUrl; |
| | | |
| | | /** The file extensions to test. */ |
| | | public static final List<String> CHECKED_EXTENSIONS = new LinkedList<String>(Arrays.asList( |
| | | public static final List<String> CHECKED_EXTENSIONS = new LinkedList<>(Arrays.asList( |
| | | "bat", "c", "h", "html", "java", "ldif", "Makefile", "mc", "sh", "txt", "xml", "xsd", "xsl")); |
| | | |
| | | private static final List<String> EXCLUDED_END_COMMENT_BLOCK_TOKEN = new LinkedList<String>(Arrays.asList( |
| | | private static final List<String> EXCLUDED_END_COMMENT_BLOCK_TOKEN = new LinkedList<>(Arrays.asList( |
| | | "*/", "-->")); |
| | | |
| | | private static final List<String> SUPPORTED_COMMENT_MIDDLE_BLOCK_TOKEN = new LinkedList<String>(Arrays.asList( |
| | | private static final List<String> SUPPORTED_COMMENT_MIDDLE_BLOCK_TOKEN = new LinkedList<>(Arrays.asList( |
| | | "*", "#", "rem", "!")); |
| | | |
| | | private static final List<String> SUPPORTED_START_BLOCK_COMMENT_TOKEN = new LinkedList<String>(Arrays.asList( |
| | | private static final List<String> SUPPORTED_START_BLOCK_COMMENT_TOKEN = new LinkedList<>(Arrays.asList( |
| | | "/*", "<!--")); |
| | | |
| | | /** The string representation of the current year. */ |
| | | Integer currentYear = Calendar.getInstance().get(Calendar.YEAR); |
| | | |
| | | private final List<String> incorrectCopyrightFilePaths = new LinkedList<String>(); |
| | | private final List<String> incorrectCopyrightFilePaths = new LinkedList<>(); |
| | | |
| | | /** The overall SCM Client Manager. */ |
| | | private ScmManager scmManager; |
| | |
| | | } |
| | | |
| | | List<ScmFile> scmFiles = statusResult.getChangedFiles(); |
| | | List<String> changedFilePaths = new LinkedList<String>(); |
| | | List<String> changedFilePaths = new LinkedList<>(); |
| | | for (ScmFile scmFile : scmFiles) { |
| | | if (scmFile.getStatus() != ScmFileStatus.UNKNOWN) { |
| | | changedFilePaths.add(scmFile.getPath()); |
| | |
| | | |
| | | private final class UpdateCopyrightFile { |
| | | private final String filePath; |
| | | private final List<String> bufferedLines = new LinkedList<String>(); |
| | | private final List<String> bufferedLines = new LinkedList<>(); |
| | | private boolean copyrightUpdated; |
| | | private boolean lineBeforeCopyrightReaded; |
| | | private boolean commentBlockEnded; |
| | |
| | | public void testUpdateCopyright(String testCaseFolderPath, String lineBeforeCopyrightToken, |
| | | int nbLinesToSkip, int numberSpacesIndentation, String newPortionCopyrightString, |
| | | String newCopyrightStartString, String copyrightEndToken, String newCopyrightOwnerStr) throws Exception { |
| | | List<String> testFilePaths = new LinkedList<String>(); |
| | | List<String> updatedTestFilePaths = new LinkedList<String>(); |
| | | List<String> testFilePaths = new LinkedList<>(); |
| | | List<String> updatedTestFilePaths = new LinkedList<>(); |
| | | |
| | | File[] changedFiles = new File(RESOURCE_DIR, testCaseFolderPath) |
| | | .listFiles(new FilenameExtensionFilter(".txt")); |
| | |
| | | /** |
| | | * One-line descriptions for log reference categories. |
| | | */ |
| | | private static final HashMap<String, LocalizableMessage> CATEGORY_DESCRIPTIONS = |
| | | new HashMap<String, LocalizableMessage>(); |
| | | |
| | | private static final HashMap<String, LocalizableMessage> CATEGORY_DESCRIPTIONS = new HashMap<>(); |
| | | static { |
| | | CATEGORY_DESCRIPTIONS.put("ACCESS_CONTROL", CATEGORY_ACCESS_CONTROL.get()); |
| | | CATEGORY_DESCRIPTIONS.put("ADMIN", CATEGORY_ADMIN.get()); |
| | |
| | | * @return A map of this log reference entry, suitable for use with FreeMarker. |
| | | */ |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | String id = (ordinal != null) ? ordinal.toString() : MESSAGE_NO_ORDINAL.get().toString(); |
| | | map.put("xmlId", "log-ref-" + xmlId); |
| | | map.put("id", MESSAGE_ORDINAL_ID.get(id)); |
| | |
| | | * @return A map of this log reference category, suitable for use with FreeMarker. |
| | | */ |
| | | public Map<String, Object> toMap() { |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", category); |
| | | map.put("category", MESSAGE_CATEGORY.get(category)); |
| | | List<Map<String, Object>> messageEntries = new LinkedList<Map<String, Object>>(); |
| | | List<Map<String, Object>> messageEntries = new LinkedList<>(); |
| | | for (MessageRefEntry entry : messages) { |
| | | messageEntries.add(entry.toMap()); |
| | | } |
| | |
| | | throw new MojoExecutionException(errorMsg); |
| | | } |
| | | |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("year", new SimpleDateFormat("yyyy").format(new Date())); |
| | | map.put("lang", locale); |
| | | map.put("title", LOG_REF_TITLE.get()); |
| | | map.put("indexterm", LOG_REF_INDEXTERM.get()); |
| | | map.put("intro", LOG_REF_INTRO.get()); |
| | | List<Map<String, Object>> categories = new LinkedList<Map<String, Object>>(); |
| | | List<Map<String, Object>> categories = new LinkedList<>(); |
| | | for (String category : messageFileNames) { |
| | | File source = new File(messagesDirectory, category + ".properties"); |
| | | categories.add(getCategoryMap(source, category.toUpperCase())); |
| | |
| | | try { |
| | | properties.load(new FileInputStream(source)); |
| | | Map<MessagePropertyKey, String> errorMessages = loadErrorProperties(properties); |
| | | TreeSet<MessageRefEntry> messageRefEntries = new TreeSet<MessageRefEntry>(); |
| | | Set<Integer> usedOrdinals = new HashSet<Integer>(); |
| | | TreeSet<MessageRefEntry> messageRefEntries = new TreeSet<>(); |
| | | Set<Integer> usedOrdinals = new HashSet<>(); |
| | | |
| | | for (MessagePropertyKey msgKey : errorMessages.keySet()) { |
| | | String formatString = errorMessages.get(msgKey).replaceAll("<", "<"); |
| | |
| | | } |
| | | |
| | | private Map<MessagePropertyKey, String> loadErrorProperties(Properties properties) throws Exception { |
| | | Map<MessagePropertyKey, String> errorMessage = new TreeMap<MessagePropertyKey, String>(); |
| | | Map<MessagePropertyKey, String> errorMessage = new TreeMap<>(); |
| | | for (Object propO : properties.keySet()) { |
| | | String propKey = propO.toString(); |
| | | try { |
| | |
| | | private URLClassLoader getBootToolsClassLoader() throws MojoFailureException { |
| | | try { |
| | | List<String> runtimeClasspathElements = project.getRuntimeClasspathElements(); |
| | | Set<URL> runtimeUrls = new LinkedHashSet<URL>(); |
| | | Set<URL> runtimeUrls = new LinkedHashSet<>(); |
| | | for (String element : runtimeClasspathElements) { |
| | | runtimeUrls.add(new File(element).toURI().toURL()); |
| | | } |
| | |
| | | final String toolScript = tool.getName(); |
| | | final String toolSects = pathsToXIncludes(tool.getTrailingSectionPaths()); |
| | | final String toolClass = tool.getApplication(); |
| | | List<String> commands = new LinkedList<String>(); |
| | | List<String> commands = new LinkedList<>(); |
| | | commands.add(getJavaCommand()); |
| | | commands.addAll(getJavaArgs(toolScript, toolSects)); |
| | | commands.add("-classpath"); |
| | |
| | | * @return The Java args for running a tool. |
| | | */ |
| | | private List<String> getJavaArgs(final String scriptName, final String trailingSections) { |
| | | List<String> args = new LinkedList<String>(); |
| | | List<String> args = new LinkedList<>(); |
| | | args.add("-Dorg.forgerock.opendj.gendoc=true"); |
| | | args.add("-Dorg.opends.server.ServerRoot=" + System.getProperty("java.io.tmpdir")); |
| | | args.add("-Dcom.forgerock.opendj.ldap.tools.scriptName=" + scriptName); |
| | |
| | | * @return A DocBook XML Section element documenting supported locales and language subtypes. |
| | | */ |
| | | private String getLocalesAndSubTypesDocumentation(final Locale currentLocale) { |
| | | final Map<String, Object> map = new HashMap<String, Object>(); |
| | | final Map<String, Object> map = new HashMap<>(); |
| | | map.put("year", new SimpleDateFormat("yyyy").format(new Date())); |
| | | map.put("lang", getTagFromLocale(currentLocale)); |
| | | map.put("title", DOC_LOCALE_SECTION_TITLE.get()); |
| | |
| | | * @return A map of languages to Locale documentation containers. |
| | | */ |
| | | private Map<String, LocaleDoc> getLanguagesToLocalesMap(final Locale currentLocale) { |
| | | Map<String, LocaleDoc> locales = new TreeMap<String, LocaleDoc>(); |
| | | Map<String, LocaleDoc> locales = new TreeMap<>(); |
| | | for (String tag : localeTagsToOids.keySet()) { |
| | | final Locale locale = getLocaleFromTag(tag); |
| | | if (locale == null) { |
| | |
| | | * @return A map of information for documenting supported locales. |
| | | */ |
| | | private Map<String, Object> getLocalesDocMap(final Locale currentLocale) { |
| | | final Map<String, Object> result = new HashMap<String, Object>(); |
| | | final Map<String, Object> result = new HashMap<>(); |
| | | result.put("title", DOC_SUPPORTED_LOCALES_TITLE.get()); |
| | | result.put("indexTerm", DOC_SUPPORTED_LOCALES_INDEXTERM.get()); |
| | | final Map<String, LocaleDoc> localesMap = getLanguagesToLocalesMap(currentLocale); |
| | | final Set<String> sortedLanguages = localesMap.keySet(); |
| | | final List<Map<String, Object>> locales = new LinkedList<Map<String, Object>>(); |
| | | final List<Map<String, Object>> locales = new LinkedList<>(); |
| | | for (final String language : sortedLanguages) { |
| | | final LocaleDoc locale = localesMap.get(language); |
| | | final Map<String, Object> map = new HashMap<String, Object>(); |
| | | final Map<String, Object> map = new HashMap<>(); |
| | | map.put("language", locale.language); |
| | | map.put("tag", DOC_LOCALE_TAG.get(locale.tag)); |
| | | map.put("oid", DOC_LOCALE_OID.get(locale.oid)); |
| | |
| | | * @return A map of information for documenting supported language subtypes. |
| | | */ |
| | | private Map<String, Object> getSubTypesDocMap(final Locale currentLocale) { |
| | | final Map<String, Object> result = new HashMap<String, Object>(); |
| | | final Map<String, Object> result = new HashMap<>(); |
| | | result.put("title", DOC_SUPPORTED_SUBTYPES_TITLE.get()); |
| | | result.put("indexTerm", DOC_SUPPORTED_SUBTYPES_INDEXTERM.get()); |
| | | final List<Map<String, Object>> locales = new LinkedList<Map<String, Object>>(); |
| | | final List<Map<String, Object>> locales = new LinkedList<>(); |
| | | for (final String tag : localeTagsToOids.keySet()) { |
| | | final Map<String, Object> map = new HashMap<String, Object>(); |
| | | final Map<String, Object> map = new HashMap<>(); |
| | | int idx = tag.indexOf('-'); |
| | | if (idx == -1) { |
| | | final Locale locale = getLocaleFromTag(tag); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012-2014 ForgeRock AS. |
| | | * Portions Copyright 2012-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.dsml.protocol; |
| | | |
| | |
| | | addResponse.setRequestID(addRequest.getRequestID()); |
| | | |
| | | ByteString dnStr = ByteString.valueOf(addRequest.getDn()); |
| | | ArrayList<RawAttribute> attributes = new ArrayList<RawAttribute>(); |
| | | ArrayList<RawAttribute> attributes = new ArrayList<>(); |
| | | |
| | | List<DsmlAttr> addList = addRequest.getAttr(); |
| | | for(DsmlAttr attr : addList) |
| | | { |
| | | ArrayList<ByteString> values = new ArrayList<ByteString>(); |
| | | ArrayList<ByteString> values = new ArrayList<>(); |
| | | List<Object> vals = attr.getValue(); |
| | | for(Object val : vals) |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012-2014 ForgeRock AS. |
| | | * Portions Copyright 2012-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.dsml.protocol; |
| | | |
| | |
| | | LDAPResult modResponse = objFactory.createLDAPResult(); |
| | | modResponse.setRequestID(modifyRequest.getRequestID()); |
| | | |
| | | ArrayList<RawModification> modifications = |
| | | new ArrayList<RawModification> (); |
| | | ArrayList<RawModification> modifications = new ArrayList<>(); |
| | | |
| | | // Read the modification type from the DSML request. |
| | | List<DsmlModification> mods = modifyRequest.getModification(); |
| | |
| | | |
| | | // Read the attribute name and values. |
| | | String attrType = attr.getName(); |
| | | ArrayList<ByteString> values = new ArrayList<ByteString> (); |
| | | ArrayList<ByteString> values = new ArrayList<>(); |
| | | |
| | | List<Object> vals = attr.getValue(); |
| | | for(Object val : vals) |
| | | for (Object val : attr.getValue()) |
| | | { |
| | | values.add(ByteStringUtility.convertValue(val)); |
| | | } |
| | |
| | | throws LDAPException, IOException |
| | | { |
| | | List<JAXBElement<?>> list = filterSet.getFilterGroup(); |
| | | ArrayList<RawFilter> filters = new ArrayList<RawFilter>(list.size()); |
| | | ArrayList<RawFilter> filters = new ArrayList<>(list.size()); |
| | | |
| | | for (JAXBElement<?> filter : list) |
| | | { |
| | |
| | | throws LDAPException, IOException |
| | | { |
| | | List<JAXBElement<?>> list = filterSet.getFilterGroup(); |
| | | ArrayList<RawFilter> filters = new ArrayList<RawFilter>(list.size()); |
| | | ArrayList<RawFilter> filters = new ArrayList<>(list.size()); |
| | | |
| | | for (JAXBElement<?> filter : list) |
| | | { |
| | |
| | | throws LDAPException, IOException |
| | | { |
| | | List<Object> anyo = sf.getAny(); |
| | | ArrayList<ByteString> subAnyElements = new ArrayList<ByteString>(anyo |
| | | .size()); |
| | | ArrayList<ByteString> subAnyElements = new ArrayList<>(anyo.size()); |
| | | |
| | | for (Object o : anyo) |
| | | { |
| | |
| | | scope = SearchScope.BASE_OBJECT; |
| | | } |
| | | |
| | | LinkedHashSet<String> attributes = new LinkedHashSet<String>(); |
| | | LinkedHashSet<String> attributes = new LinkedHashSet<>(); |
| | | // Get the list of attributes. |
| | | AttributeDescriptions attrDescriptions = searchRequest.getAttributes(); |
| | | if (attrDescriptions != null) |
| | |
| | | private String trustStorePasswordValue; |
| | | private Boolean trustAll; |
| | | private Boolean useHTTPAuthzID; |
| | | private HashSet<String> exopStrings = new HashSet<String>(); |
| | | private HashSet<String> exopStrings = new HashSet<>(); |
| | | |
| | | /** |
| | | * This method will be called by the Servlet Container when |
| | |
| | | LDAPConnection connection, String authorizationID) |
| | | throws LDAPConnectionException |
| | | { |
| | | LinkedHashSet<String>attributes = new LinkedHashSet<String>(1); |
| | | LinkedHashSet<String>attributes = new LinkedHashSet<>(1); |
| | | attributes.add(SchemaConstants.NO_ATTRIBUTES); |
| | | ArrayList<org.opends.server.types.Control> controls = |
| | | new ArrayList<org.opends.server.types.Control>(1); |
| | | ArrayList<org.opends.server.types.Control> controls = new ArrayList<>(1); |
| | | org.opends.server.types.Control proxyAuthzControl = |
| | | new ProxiedAuthV2Control(true, ByteString.valueOf(authorizationID)); |
| | | controls.add(proxyAuthzControl); |
| | |
| | | ObjectFactory objFactory, |
| | | org.opends.server.types.Control proxyAuthzControl, |
| | | DsmlMessage request) { |
| | | ArrayList<org.opends.server.types.Control> controls = |
| | | new ArrayList<org.opends.server.types.Control>(1); |
| | | ArrayList<org.opends.server.types.Control> controls = new ArrayList<>(1); |
| | | if (proxyAuthzControl != null) |
| | | { |
| | | controls.add(proxyAuthzControl); |
| | |
| | | */ |
| | | public class ResultCodeFactory |
| | | { |
| | | static HashMap<Integer,LDAPResultCode> codeToDescr = |
| | | new HashMap<Integer,LDAPResultCode>(); |
| | | static HashMap<Integer,LDAPResultCode> codeToDescr = new HashMap<>(); |
| | | static |
| | | { |
| | | codeToDescr.put(0, LDAPResultCode.SUCCESS); |
| | |
| | | codeToDescr.put(8, LDAPResultCode.STRONG_AUTH_REQUIRED); |
| | | codeToDescr.put(10, LDAPResultCode.REFERRAL); |
| | | codeToDescr.put(11, LDAPResultCode.ADMIN_LIMIT_EXCEEDED); |
| | | codeToDescr.put(12, |
| | | LDAPResultCode.UNAVAILABLE_CRITICAL_EXTENSION); |
| | | codeToDescr.put(12, LDAPResultCode.UNAVAILABLE_CRITICAL_EXTENSION); |
| | | codeToDescr.put(13, LDAPResultCode.CONFIDENTIALITY_REQUIRED); |
| | | codeToDescr.put(14, LDAPResultCode.SASL_BIND_IN_PROGRESS); |
| | | codeToDescr.put(16, LDAPResultCode.NO_SUCH_ATTRIBUTE); |
| | |
| | | if (sdkEntry != null) { |
| | | org.opends.server.types.Entry entry = |
| | | new org.opends.server.types.Entry(to(sdkEntry.getName()), null, null, null); |
| | | List<ByteString> duplicateValues = new ArrayList<ByteString>(); |
| | | List<ByteString> duplicateValues = new ArrayList<>(); |
| | | for (org.opends.server.types.Attribute attribute : toAttributes(sdkEntry.getAllAttributes())) { |
| | | entry.addAttribute(attribute, duplicateValues); |
| | | } |
| | |
| | | new org.opends.server.types.Entry(to(value.getName()), null, null, null); |
| | | org.opends.server.types.SearchResultEntry searchResultEntry = |
| | | new org.opends.server.types.SearchResultEntry(entry, to(value.getControls())); |
| | | List<ByteString> duplicateValues = new ArrayList<ByteString>(); |
| | | List<ByteString> duplicateValues = new ArrayList<>(); |
| | | for (org.opends.server.types.Attribute attribute : toAttributes(value.getAllAttributes())) { |
| | | searchResultEntry.addAttribute(attribute, duplicateValues); |
| | | } |
| | |
| | | */ |
| | | public static SortedSet<org.opends.server.types.DN> to(final SortedSet<DN> dnSet) { |
| | | try { |
| | | SortedSet<org.opends.server.types.DN> newSet = new TreeSet<org.opends.server.types.DN>(); |
| | | SortedSet<org.opends.server.types.DN> newSet = new TreeSet<>(); |
| | | for (DN dn : dnSet) { |
| | | newSet.add(org.opends.server.types.DN.valueOf(dn.toString())); |
| | | } |
| | |
| | | */ |
| | | public static List<org.opends.server.types.Control> to( |
| | | final List<org.forgerock.opendj.ldap.controls.Control> listOfControl) { |
| | | List<org.opends.server.types.Control> toListOfControl = |
| | | new ArrayList<org.opends.server.types.Control>(listOfControl.size()); |
| | | List<org.opends.server.types.Control> toListOfControl = new ArrayList<>(listOfControl.size()); |
| | | for (org.forgerock.opendj.ldap.controls.Control c : listOfControl) { |
| | | toListOfControl.add(to(c)); |
| | | } |
| | |
| | | */ |
| | | public static org.opends.server.types.RawAttribute to( |
| | | final org.forgerock.opendj.ldap.Attribute attribute) { |
| | | ArrayList<ByteString> listAttributeValues = |
| | | new ArrayList<ByteString>(attribute.size()); |
| | | ArrayList<ByteString> listAttributeValues = new ArrayList<>(attribute.size()); |
| | | Collections.addAll(listAttributeValues, attribute.toArray()); |
| | | return new LDAPAttribute(attribute.getAttributeDescriptionAsString(), listAttributeValues); |
| | | } |
| | |
| | | public static List<org.opends.server.types.RawAttribute> to( |
| | | final Iterable<org.forgerock.opendj.ldap.Attribute> listOfAttributes) { |
| | | List<org.opends.server.types.RawAttribute> toListOfAttributes = |
| | | new ArrayList<org.opends.server.types.RawAttribute>( |
| | | ((Collection<org.forgerock.opendj.ldap.Attribute>) listOfAttributes).size()); |
| | | new ArrayList<>(((Collection<?>) listOfAttributes).size()); |
| | | for (org.forgerock.opendj.ldap.Attribute a : listOfAttributes) { |
| | | toListOfAttributes.add(to(a)); |
| | | } |
| | |
| | | public static List<org.opends.server.types.RawModification> toRawModifications( |
| | | final List<org.forgerock.opendj.ldap.Modification> listOfModifications) { |
| | | List<org.opends.server.types.RawModification> toListOfModifications = |
| | | new ArrayList<org.opends.server.types.RawModification>(listOfModifications.size()); |
| | | new ArrayList<>(listOfModifications.size()); |
| | | for (org.forgerock.opendj.ldap.Modification m : listOfModifications) { |
| | | toListOfModifications.add(to(m)); |
| | | } |
| | |
| | | public static List<org.opends.server.types.Attribute> toAttributes( |
| | | final Iterable<org.forgerock.opendj.ldap.Attribute> listOfAttributes) { |
| | | List<org.opends.server.types.Attribute> toListOfAttributes = |
| | | new ArrayList<org.opends.server.types.Attribute>( |
| | | ((Collection<org.forgerock.opendj.ldap.Attribute>) listOfAttributes).size()); |
| | | new ArrayList<>(((Collection<?>) listOfAttributes).size()); |
| | | for (org.forgerock.opendj.ldap.Attribute a : listOfAttributes) { |
| | | toListOfAttributes.add(toAttribute(a)); |
| | | } |
| | |
| | | */ |
| | | public static List<org.opends.server.types.Modification> toModifications( |
| | | final List<org.forgerock.opendj.ldap.Modification> listOfModifications) { |
| | | List<org.opends.server.types.Modification> toListOfModifications = |
| | | new ArrayList<org.opends.server.types.Modification>( |
| | | listOfModifications.size()); |
| | | List<org.opends.server.types.Modification> toListOfModifications = new ArrayList<>(listOfModifications.size()); |
| | | for (org.forgerock.opendj.ldap.Modification m : listOfModifications) { |
| | | toListOfModifications.add(toModification(m)); |
| | | } |
| | |
| | | */ |
| | | public static List<org.forgerock.opendj.ldap.controls.Control> from( |
| | | final List<org.opends.server.types.Control> listOfControl) { |
| | | List<org.forgerock.opendj.ldap.controls.Control> fromListofControl = |
| | | new ArrayList<org.forgerock.opendj.ldap.controls.Control>(listOfControl.size()); |
| | | List<org.forgerock.opendj.ldap.controls.Control> fromListofControl = new ArrayList<>(listOfControl.size()); |
| | | for (org.opends.server.types.Control c : listOfControl) { |
| | | fromListofControl.add(from(c)); |
| | | } |
| | |
| | | public static List<org.forgerock.opendj.ldap.Attribute> from( |
| | | final Iterable<org.opends.server.types.Attribute> listOfAttributes) { |
| | | List<org.forgerock.opendj.ldap.Attribute> fromListofAttributes = |
| | | new ArrayList<org.forgerock.opendj.ldap.Attribute>( |
| | | ((Collection<org.opends.server.types.Attribute>) listOfAttributes).size()); |
| | | new ArrayList<>(((Collection<?>) listOfAttributes).size()); |
| | | for (org.opends.server.types.Attribute a : listOfAttributes) { |
| | | fromListofAttributes.add(from(a)); |
| | | } |
| | |
| | | private SuffixDescriptor suffix; |
| | | private int entries = -1; |
| | | private ServerDescriptor server; |
| | | private Set<String> replicationServers = new HashSet<String>(); |
| | | private Set<String> replicationServers = new HashSet<>(); |
| | | private int replicationId = -1; |
| | | private int missingChanges = -1; |
| | | private long ageOfOldestMissingChange = -1; |
| | |
| | | */ |
| | | public Set<String> getReplicationServers() |
| | | { |
| | | return new HashSet<String>(replicationServers); |
| | | return new HashSet<>(replicationServers); |
| | | } |
| | | |
| | | /** |
| | |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | private static final String TRUSTSTORE_DN = "cn=ads-truststore"; |
| | | |
| | | private final Map<ADSContext.ServerProperty, Object> adsProperties = |
| | | new HashMap<ADSContext.ServerProperty, Object>(); |
| | | private final Set<ReplicaDescriptor> replicas = |
| | | new HashSet<ReplicaDescriptor>(); |
| | | private final Map<ServerProperty, Object> serverProperties = |
| | | new HashMap<ServerProperty, Object>(); |
| | | private final Map<ADSContext.ServerProperty, Object> adsProperties = new HashMap<>(); |
| | | private final Set<ReplicaDescriptor> replicas = new HashSet<>(); |
| | | private final Map<ServerProperty, Object> serverProperties = new HashMap<>(); |
| | | private TopologyCacheException lastException; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public Set<ReplicaDescriptor> getReplicas() |
| | | { |
| | | return new HashSet<ReplicaDescriptor>(replicas); |
| | | return new HashSet<>(replicas); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public List<Integer> getEnabledAdministrationPorts() |
| | | { |
| | | List<Integer> ports = new ArrayList<Integer>(1); |
| | | ArrayList<?> s = (ArrayList<?>)serverProperties.get( |
| | | ServerProperty.ADMIN_ENABLED); |
| | | ArrayList<?> p = (ArrayList<?>)serverProperties.get( |
| | | ServerProperty.ADMIN_PORT); |
| | | List<Integer> ports = new ArrayList<>(1); |
| | | ArrayList<?> s = (ArrayList<?>)serverProperties.get(ServerProperty.ADMIN_ENABLED); |
| | | ArrayList<?> p = (ArrayList<?>)serverProperties.get(ServerProperty.ADMIN_PORT); |
| | | if (s != null) |
| | | { |
| | | for (int i=0; i<s.size(); i++) |
| | |
| | | } |
| | | else |
| | | { |
| | | ArrayList<ADSContext.ServerProperty> enabledAttrs = |
| | | new ArrayList<ADSContext.ServerProperty>(); |
| | | ArrayList<ADSContext.ServerProperty> enabledAttrs = new ArrayList<>(); |
| | | |
| | | if (securePreferred) |
| | | { |
| | |
| | | |
| | | try |
| | | { |
| | | ArrayList<Integer> ldapPorts = new ArrayList<Integer>(); |
| | | ArrayList<Integer> ldapsPorts = new ArrayList<Integer>(); |
| | | ArrayList<Boolean> ldapEnabled = new ArrayList<Boolean>(); |
| | | ArrayList<Boolean> ldapsEnabled = new ArrayList<Boolean>(); |
| | | ArrayList<Boolean> startTLSEnabled = new ArrayList<Boolean>(); |
| | | ArrayList<Integer> ldapPorts = new ArrayList<>(); |
| | | ArrayList<Integer> ldapsPorts = new ArrayList<>(); |
| | | ArrayList<Boolean> ldapEnabled = new ArrayList<>(); |
| | | ArrayList<Boolean> ldapsEnabled = new ArrayList<>(); |
| | | ArrayList<Boolean> startTLSEnabled = new ArrayList<>(); |
| | | |
| | | desc.serverProperties.put(ServerProperty.LDAP_PORT, ldapPorts); |
| | | desc.serverProperties.put(ServerProperty.LDAPS_PORT, ldapsPorts); |
| | |
| | | |
| | | // Even if we have a single port, use an array to be consistent with |
| | | // other protocols. |
| | | ArrayList<Integer> adminPorts = new ArrayList<Integer>(); |
| | | ArrayList<Boolean> adminEnabled = new ArrayList<Boolean>(); |
| | | ArrayList<Integer> adminPorts = new ArrayList<>(); |
| | | ArrayList<Boolean> adminEnabled = new ArrayList<>(); |
| | | if (adminConnectorPort != null) |
| | | { |
| | | adminPorts.add(adminConnectorPort); |
| | |
| | | NamingEnumeration<SearchResult> listeners = |
| | | ctx.search(jndiName, filter, ctls); |
| | | |
| | | ArrayList<Integer> jmxPorts = new ArrayList<Integer>(); |
| | | ArrayList<Integer> jmxsPorts = new ArrayList<Integer>(); |
| | | ArrayList<Boolean> jmxEnabled = new ArrayList<Boolean>(); |
| | | ArrayList<Boolean> jmxsEnabled = new ArrayList<Boolean>(); |
| | | ArrayList<Integer> jmxPorts = new ArrayList<>(); |
| | | ArrayList<Integer> jmxsPorts = new ArrayList<>(); |
| | | ArrayList<Boolean> jmxEnabled = new ArrayList<>(); |
| | | ArrayList<Boolean> jmxsEnabled = new ArrayList<>(); |
| | | |
| | | desc.serverProperties.put(ServerProperty.JMX_PORT, jmxPorts); |
| | | desc.serverProperties.put(ServerProperty.JMXS_PORT, jmxsPorts); |
| | |
| | | } |
| | | else |
| | | { |
| | | entries = new HashSet<String>(); |
| | | entries = new HashSet<>(); |
| | | } |
| | | |
| | | Set<ReplicaDescriptor> replicas = desc.getReplicas(); |
| | |
| | | replica.setServer(desc); |
| | | replica.setBackendName(id); |
| | | replicas.add(replica); |
| | | HashSet<ReplicaDescriptor> r = new HashSet<ReplicaDescriptor>(); |
| | | HashSet<ReplicaDescriptor> r = new HashSet<>(); |
| | | r.add(replica); |
| | | suffix.setReplicas(r); |
| | | replica.setSuffix(suffix); |
| | |
| | | desc.serverProperties.put(ServerProperty.IS_REPLICATION_ENABLED, |
| | | Boolean.valueOf(replicationEnabled)); |
| | | |
| | | Set<String> allReplicationServers = new LinkedHashSet<String>(); |
| | | Set<String> allReplicationServers = new LinkedHashSet<>(); |
| | | |
| | | if (cacheFilter.searchBaseDNInformation()) |
| | | { |
| | |
| | | replica.setReplicationId(id); |
| | | // Keep the values of the replication servers in lower case |
| | | // to make use of Sets as String simpler. |
| | | LinkedHashSet<String> repServers = new LinkedHashSet<String>(); |
| | | LinkedHashSet<String> repServers = new LinkedHashSet<>(); |
| | | for (String s: replicationServers) |
| | | { |
| | | repServers.add(s.toLowerCase()); |
| | |
| | | Set<String> values = getValues(sr, "ds-cfg-replication-server"); |
| | | // Keep the values of the replication servers in lower case |
| | | // to make use of Sets as String simpler. |
| | | LinkedHashSet<String> repServers = new LinkedHashSet<String>(); |
| | | LinkedHashSet<String> repServers = new LinkedHashSet<>(); |
| | | for (String s: values) |
| | | { |
| | | repServers.add(s.toLowerCase()); |
| | |
| | | sc.setReturningAttributes(new String[] { SchemaConstants.NO_ATTRIBUTES }); |
| | | NamingEnumeration<SearchResult> ne = ctx.search(TRUSTSTORE_DN, |
| | | "(objectclass=ds-cfg-instance-key)", sc); |
| | | ArrayList<String> dnsToDelete = new ArrayList<String>(); |
| | | ArrayList<String> dnsToDelete = new ArrayList<>(); |
| | | try |
| | | { |
| | | while (ne.hasMore()) |
| | |
| | | private static Set<String> getBaseDNEntryCount(InitialLdapContext ctx, |
| | | String backendID) throws NamingException |
| | | { |
| | | LinkedHashSet<String> v = new LinkedHashSet<String>(); |
| | | LinkedHashSet<String> v = new LinkedHashSet<>(); |
| | | SearchControls ctls = new SearchControls(); |
| | | ctls.setSearchScope(SearchControls.ONELEVEL_SCOPE); |
| | | ctls.setReturningAttributes( |
| | |
| | | public class SuffixDescriptor |
| | | { |
| | | private String suffixDN; |
| | | private Set<ReplicaDescriptor> replicas = new HashSet<ReplicaDescriptor>(); |
| | | private Set<ReplicaDescriptor> replicas = new HashSet<>(); |
| | | |
| | | /** |
| | | * Returns the DN associated with this suffix descriptor. |
| | |
| | | */ |
| | | public Set<ReplicaDescriptor> getReplicas() |
| | | { |
| | | return new HashSet<ReplicaDescriptor>(replicas); |
| | | return new HashSet<>(replicas); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public Set<String> getReplicationServers() |
| | | { |
| | | Set<String> replicationServers = new HashSet<String>(); |
| | | Set<String> replicationServers = new HashSet<>(); |
| | | for (ReplicaDescriptor replica : getReplicas()) |
| | | { |
| | | replicationServers.addAll(replica.getReplicationServers()); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.admin.ads; |
| | | |
| | |
| | | private final int timeout; |
| | | private final String bindDN; |
| | | private final String bindPwd; |
| | | private final Set<ServerDescriptor> servers = |
| | | new HashSet<ServerDescriptor>(); |
| | | private final Set<SuffixDescriptor> suffixes = |
| | | new HashSet<SuffixDescriptor>(); |
| | | private final Set<PreferredConnection> preferredConnections = |
| | | new LinkedHashSet<PreferredConnection>(); |
| | | private final Set<ServerDescriptor> servers = new HashSet<>(); |
| | | private final Set<SuffixDescriptor> suffixes = new HashSet<>(); |
| | | private final Set<PreferredConnection> preferredConnections = new LinkedHashSet<>(); |
| | | private final TopologyCacheFilter filter = new TopologyCacheFilter(); |
| | | private static final int MULTITHREAD_TIMEOUT = 90 * 1000; |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | |
| | | Set<Map<ServerProperty, Object>> adsServers = |
| | | adsContext.readServerRegistry(); |
| | | |
| | | Set<ServerLoader> threadSet = new HashSet<ServerLoader>(); |
| | | Set<ServerLoader> threadSet = new HashSet<>(); |
| | | for (Map<ServerProperty, Object> serverProperties : adsServers) |
| | | { |
| | | ServerLoader t = getServerLoader(serverProperties); |
| | |
| | | * Try to consolidate things (even if the data is not complete). |
| | | */ |
| | | |
| | | HashMap<LdapName, Set<SuffixDescriptor>> hmSuffixes = |
| | | new HashMap<LdapName, Set<SuffixDescriptor>>(); |
| | | HashMap<LdapName, Set<SuffixDescriptor>> hmSuffixes = new HashMap<>(); |
| | | for (ServerLoader loader : threadSet) |
| | | { |
| | | ServerDescriptor descriptor = loader.getServerDescriptor(); |
| | |
| | | { |
| | | if (sufs == null) |
| | | { |
| | | sufs = new HashSet<SuffixDescriptor>(); |
| | | sufs = new HashSet<>(); |
| | | hmSuffixes.put(dn, sufs); |
| | | } |
| | | sufs.add(replica.getSuffix()); |
| | |
| | | Set<ReplicaDescriptor> candidateReplicas = getCandidateReplicas(server); |
| | | if (!candidateReplicas.isEmpty()) |
| | | { |
| | | Set<ReplicaDescriptor> updatedReplicas = new HashSet<ReplicaDescriptor>(); |
| | | Set<ReplicaDescriptor> updatedReplicas = new HashSet<>(); |
| | | try |
| | | { |
| | | updateReplicas(server, candidateReplicas, updatedReplicas); |
| | |
| | | |
| | | private Set<ReplicaDescriptor> getReplicasToUpdate() |
| | | { |
| | | Set<ReplicaDescriptor> replicasToUpdate = new HashSet<ReplicaDescriptor>(); |
| | | Set<ReplicaDescriptor> replicasToUpdate = new HashSet<>(); |
| | | for (ServerDescriptor server : getServers()) |
| | | { |
| | | for (ReplicaDescriptor replica : server.getReplicas()) |
| | |
| | | |
| | | private Set<ReplicaDescriptor> getCandidateReplicas(ServerDescriptor server) |
| | | { |
| | | Set<ReplicaDescriptor> candidateReplicas = new HashSet<ReplicaDescriptor>(); |
| | | Set<ReplicaDescriptor> candidateReplicas = new HashSet<>(); |
| | | // It contains replication information: analyze it. |
| | | String repServer = server.getReplicationServerHostPort(); |
| | | for (SuffixDescriptor suffix : getSuffixes()) |
| | |
| | | */ |
| | | public LinkedHashSet<PreferredConnection> getPreferredConnections() |
| | | { |
| | | return new LinkedHashSet<PreferredConnection>(preferredConnections); |
| | | return new LinkedHashSet<>(preferredConnections); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public Set<ServerDescriptor> getServers() |
| | | { |
| | | return new HashSet<ServerDescriptor>(servers); |
| | | return new HashSet<>(servers); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public Set<SuffixDescriptor> getSuffixes() |
| | | { |
| | | return new HashSet<SuffixDescriptor>(suffixes); |
| | | return new HashSet<>(suffixes); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public Set<LocalizableMessage> getErrorMessages() |
| | | { |
| | | Set<TopologyCacheException> exceptions = |
| | | new HashSet<TopologyCacheException>(); |
| | | Set<TopologyCacheException> exceptions = new HashSet<>(); |
| | | Set<ServerDescriptor> theServers = getServers(); |
| | | Set<LocalizableMessage> exceptionMsgs = new LinkedHashSet<LocalizableMessage>(); |
| | | Set<LocalizableMessage> exceptionMsgs = new LinkedHashSet<>(); |
| | | for (ServerDescriptor server : theServers) |
| | | { |
| | | TopologyCacheException e = server.getLastException(); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.admin.ads; |
| | | |
| | |
| | | */ |
| | | public class TopologyCacheFilter |
| | | { |
| | | private Set<String> baseDNs = new HashSet<String>(); |
| | | private Set<String> baseDNs = new HashSet<>(); |
| | | private boolean searchMonitoringInformation = true; |
| | | private boolean searchBaseDNInformation = true; |
| | | |
| | |
| | | */ |
| | | public Set<String> getBaseDNsToSearch() |
| | | { |
| | | return new HashSet<String>(baseDNs); |
| | | return new HashSet<>(baseDNs); |
| | | } |
| | | |
| | | /** |
| | |
| | | * The following ArrayList contain information about the certificates |
| | | * explicitly accepted by the user. |
| | | */ |
| | | private ArrayList<X509Certificate[]> acceptedChains = |
| | | new ArrayList<X509Certificate[]>(); |
| | | private ArrayList<String> acceptedAuthTypes = new ArrayList<String>(); |
| | | private ArrayList<String> acceptedHosts = new ArrayList<String>(); |
| | | private ArrayList<X509Certificate[]> acceptedChains = new ArrayList<>(); |
| | | private ArrayList<String> acceptedAuthTypes = new ArrayList<>(); |
| | | private ArrayList<String> acceptedHosts = new ArrayList<>(); |
| | | |
| | | private String host; |
| | | |
| | |
| | | String pwd, int timeout, Hashtable<String, String> env) |
| | | throws NamingException |
| | | { |
| | | if (env != null) |
| | | { // We clone 'env' so that we can modify it freely |
| | | env = new Hashtable<String, String>(env); |
| | | } else |
| | | { |
| | | env = new Hashtable<String, String>(); |
| | | } |
| | | env = copy(env); |
| | | env.put(Context.INITIAL_CONTEXT_FACTORY, |
| | | "com.sun.jndi.ldap.LdapCtxFactory"); |
| | | env.put("java.naming.ldap.attributes.binary", |
| | |
| | | public static InitialLdapContext createLdapsContext(String ldapsURL, |
| | | String dn, String pwd, int timeout, Hashtable<String, String> env, |
| | | TrustManager trustManager, KeyManager keyManager) throws NamingException { |
| | | if (env != null) |
| | | { // We clone 'env' so that we can modify it freely |
| | | env = new Hashtable<String, String>(env); |
| | | } else |
| | | { |
| | | env = new Hashtable<String, String>(); |
| | | } |
| | | env = copy(env); |
| | | env.put(Context.INITIAL_CONTEXT_FACTORY, |
| | | "com.sun.jndi.ldap.LdapCtxFactory"); |
| | | env.put("java.naming.ldap.attributes.binary", |
| | |
| | | verifier = new BlindHostnameVerifier(); |
| | | } |
| | | |
| | | if (env != null) |
| | | { // We clone 'env' to modify it freely |
| | | env = new Hashtable<String, String>(env); |
| | | } |
| | | else |
| | | { |
| | | env = new Hashtable<String, String>(); |
| | | } |
| | | env = copy(env); |
| | | env.put(Context.INITIAL_CONTEXT_FACTORY, |
| | | "com.sun.jndi.ldap.LdapCtxFactory"); |
| | | env.put("java.naming.ldap.attributes.binary", |
| | |
| | | return getInitialLdapContext(t, pair, timeout); |
| | | } |
| | | |
| | | private static Hashtable<String, String> copy(Hashtable<String, String> env) { |
| | | return env != null ? new Hashtable<>(env) : new Hashtable<String, String>(); |
| | | } |
| | | |
| | | /** |
| | | * Returns the LDAP URL used in the provided InitialLdapContext. |
| | | * @param ctx the context to analyze. |
| | |
| | | public static Set<String> getValues(SearchResult entry, String attrName) |
| | | throws NamingException |
| | | { |
| | | Set<String> values = new HashSet<String>(); |
| | | Set<String> values = new HashSet<>(); |
| | | Attributes attrs = entry.getAttributes(); |
| | | if (attrs != null) |
| | | { |
| | |
| | | InitialLdapContext ctx) |
| | | { |
| | | PreferredConnection cnx = PreferredConnection.getPreferredConnection(ctx); |
| | | Set<PreferredConnection> returnValue = |
| | | new LinkedHashSet<PreferredConnection>(); |
| | | Set<PreferredConnection> returnValue = new LinkedHashSet<>(); |
| | | returnValue.add(cnx); |
| | | return returnValue; |
| | | } |
| | |
| | | this.pwd = pwd; |
| | | this.trustManager = trustManager; |
| | | this.timeout = timeout; |
| | | this.preferredLDAPURLs = |
| | | new LinkedHashSet<PreferredConnection>(preferredLDAPURLs); |
| | | this.preferredLDAPURLs = new LinkedHashSet<>(preferredLDAPURLs); |
| | | this.filter = filter; |
| | | } |
| | | |
| | |
| | | */ |
| | | private LinkedHashSet<PreferredConnection> getLDAPURLsByPreference() |
| | | { |
| | | LinkedHashSet<PreferredConnection> ldapUrls = |
| | | new LinkedHashSet<PreferredConnection>(); |
| | | LinkedHashSet<PreferredConnection> ldapUrls = new LinkedHashSet<>(); |
| | | |
| | | String adminConnectorUrl = getAdminConnectorUrl(serverProperties); |
| | | String ldapsUrl = getLdapsUrl(serverProperties); |
| | |
| | | */ |
| | | public class TrustedSocketFactory extends SSLSocketFactory |
| | | { |
| | | private static Map<Thread, TrustManager> hmTrustManager = |
| | | new HashMap<Thread, TrustManager>(); |
| | | private static Map<Thread, KeyManager> hmKeyManager = |
| | | new HashMap<Thread, KeyManager>(); |
| | | private static Map<Thread, TrustManager> hmTrustManager = new HashMap<>(); |
| | | private static Map<Thread, KeyManager> hmKeyManager = new HashMap<>(); |
| | | |
| | | private static Map<TrustManager, SocketFactory> hmDefaultFactoryTm = |
| | | new HashMap<TrustManager, SocketFactory>(); |
| | | private static Map<KeyManager, SocketFactory> hmDefaultFactoryKm = |
| | | new HashMap<KeyManager, SocketFactory>(); |
| | | private static Map<TrustManager, SocketFactory> hmDefaultFactoryTm = new HashMap<>(); |
| | | private static Map<KeyManager, SocketFactory> hmDefaultFactoryKm = new HashMap<>(); |
| | | |
| | | private SSLSocketFactory innerFactory; |
| | | private TrustManager trustManager; |
| | |
| | | @Override |
| | | public void parseArguments(String[] args) throws ArgumentException |
| | | { |
| | | LinkedHashSet<LocalizableMessage> errorMessages = new LinkedHashSet<LocalizableMessage>(); |
| | | LinkedHashSet<LocalizableMessage> errorMessages = new LinkedHashSet<>(); |
| | | try |
| | | { |
| | | super.parseArguments(args); |
| | |
| | | private NumSubordinateHacker numSubordinateHacker; |
| | | private int queueTotalSize; |
| | | private int maxChildren; |
| | | private final Collection<BrowserEventListener> listeners = |
| | | new ArrayList<BrowserEventListener>(); |
| | | private final Collection<BrowserEventListener> listeners = new ArrayList<>(); |
| | | private final LDAPConnectionPool connectionPool; |
| | | private final IconPool iconPool; |
| | | |
| | |
| | | * @return the list of attributes for the red search. |
| | | */ |
| | | String[] getAttrsForRedSearch() { |
| | | ArrayList<String> v = new ArrayList<String>(); |
| | | ArrayList<String> v = new ArrayList<>(); |
| | | |
| | | v.add(OBJECTCLASS_ATTRIBUTE_TYPE_NAME); |
| | | v.add(NUMSUBORDINATES_ATTR); |
| | |
| | | */ |
| | | private void updateChildNodes(NodeRefresher task) throws NamingException { |
| | | BasicNode parent = task.getNode(); |
| | | ArrayList<Integer> insertIndex = new ArrayList<Integer>(); |
| | | ArrayList<Integer> changedIndex = new ArrayList<Integer>(); |
| | | ArrayList<Integer> insertIndex = new ArrayList<>(); |
| | | ArrayList<Integer> changedIndex = new ArrayList<>(); |
| | | boolean differential = canDoDifferentialUpdate(task); |
| | | |
| | | // NUMSUBORDINATE HACK |
| | |
| | | modifiers |= IconPool.MODIFIER_ERROR; |
| | | } |
| | | |
| | | SortedSet<String> objectClasses = new TreeSet<String>(); |
| | | SortedSet<String> objectClasses = new TreeSet<>(); |
| | | if (entry != null) { |
| | | Set<String> ocs = ConnectionUtils.getValues(entry, "objectClass"); |
| | | if (ocs != null) |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.guitools.controlpanel.browser; |
| | | |
| | |
| | | */ |
| | | public static final int MODIFIER_ERROR = 0x04; |
| | | |
| | | private final HashMap<String, ImageIcon> iconTable = |
| | | new HashMap<String, ImageIcon>(); |
| | | private final HashMap<String, String> pathTable = |
| | | new HashMap<String, String>(); |
| | | private final HashMap<String, String> descriptionTable = |
| | | new HashMap<String, String>(); |
| | | private final HashMap<String, ImageIcon> iconTable = new HashMap<>(); |
| | | private final HashMap<String, String> pathTable = new HashMap<>(); |
| | | private final HashMap<String, String> descriptionTable = new HashMap<>(); |
| | | private ImageIcon defaultLeafIcon; |
| | | private ImageIcon suffixIcon; |
| | | private ImageIcon defaultContainerIcon; |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.guitools.controlpanel.browser; |
| | | |
| | |
| | | */ |
| | | public class LDAPConnectionPool { |
| | | |
| | | private final HashMap<String, AuthRecord> authTable = |
| | | new HashMap<String, AuthRecord>(); |
| | | private final HashMap<String, ConnectionRecord> connectionTable = |
| | | new HashMap<String, ConnectionRecord>(); |
| | | private final HashMap<String, AuthRecord> authTable = new HashMap<>(); |
| | | private final HashMap<String, ConnectionRecord> connectionTable = new HashMap<>(); |
| | | |
| | | private ArrayList<ReferralAuthenticationListener> listeners; |
| | | |
| | |
| | | public void addReferralAuthenticationListener( |
| | | ReferralAuthenticationListener listener) { |
| | | if (listeners == null) { |
| | | listeners = new ArrayList<ReferralAuthenticationListener>(); |
| | | listeners = new ArrayList<>(); |
| | | } |
| | | listeners.add(listener); |
| | | } |
| | |
| | | class NodeSearcherQueue implements Runnable { |
| | | |
| | | private String name; |
| | | private ArrayList<AbstractNodeTask> waitingQueue = |
| | | new ArrayList<AbstractNodeTask>(); |
| | | private HashMap<BasicNode, AbstractNodeTask> workingList = |
| | | new HashMap<BasicNode, AbstractNodeTask>(); |
| | | private HashMap<BasicNode, BasicNode> cancelList = |
| | | new HashMap<BasicNode, BasicNode>(); |
| | | private ArrayList<AbstractNodeTask> waitingQueue = new ArrayList<>(); |
| | | private HashMap<BasicNode, AbstractNodeTask> workingList = new HashMap<>(); |
| | | private HashMap<BasicNode, BasicNode> cancelList = new HashMap<>(); |
| | | private ThreadGroup threadGroup; |
| | | |
| | | |
| | |
| | | implements Comparator<AbstractIndexDescriptor> |
| | | { |
| | | private static final long serialVersionUID = -5131878622200568636L; |
| | | private Set<AbstractIndexDescriptor> data = |
| | | new HashSet<AbstractIndexDescriptor>(); |
| | | private ArrayList<String[]> dataArray = |
| | | new ArrayList<String[]>(); |
| | | private ArrayList<AbstractIndexDescriptor> indexArray = |
| | | new ArrayList<AbstractIndexDescriptor>(); |
| | | private Set<AbstractIndexDescriptor> data = new HashSet<>(); |
| | | private ArrayList<String[]> dataArray = new ArrayList<>(); |
| | | private ArrayList<AbstractIndexDescriptor> indexArray = new ArrayList<>(); |
| | | private final String[] COLUMN_NAMES = getColumnNames(); |
| | | /** |
| | | * The sort column of the table. |
| | |
| | | */ |
| | | private void updateDataArray() |
| | | { |
| | | TreeSet<AbstractIndexDescriptor> sortedSet = |
| | | new TreeSet<AbstractIndexDescriptor>(this); |
| | | TreeSet<AbstractIndexDescriptor> sortedSet = new TreeSet<>(this); |
| | | sortedSet.addAll(data); |
| | | dataArray.clear(); |
| | | indexArray.clear(); |
| | |
| | | { |
| | | baseDN.setBackend(this); |
| | | } |
| | | this.baseDns = new TreeSet<BaseDNDescriptor>(baseDns); |
| | | this.baseDns = new TreeSet<>(baseDns); |
| | | for (IndexDescriptor index : indexes) |
| | | { |
| | | index.setBackend(this); |
| | | } |
| | | this.indexes = new TreeSet<IndexDescriptor>(indexes); |
| | | this.indexes = new TreeSet<>(indexes); |
| | | for (VLVIndexDescriptor index : vlvIndexes) |
| | | { |
| | | index.setBackend(this); |
| | | } |
| | | this.vlvIndexes = new TreeSet<VLVIndexDescriptor>(vlvIndexes); |
| | | this.vlvIndexes = new TreeSet<>(vlvIndexes); |
| | | } |
| | | |
| | | /** |
| | |
| | | public class BackupTableModel extends AbstractTableModel |
| | | { |
| | | private static final long serialVersionUID = -3511425157550147124L; |
| | | private ArrayList<BackupDescriptor> backups = |
| | | new ArrayList<BackupDescriptor>(); |
| | | private ArrayList<BackupDescriptor> backups = new ArrayList<>(); |
| | | |
| | | /** |
| | | * Clears the contents ot the table model. |
| | | * |
| | | */ |
| | | /** Clears the contents of the table model. */ |
| | | public void clear() |
| | | { |
| | | backups.clear(); |
| | |
| | | implements Comparator<BaseDNDescriptor> |
| | | { |
| | | private static final long serialVersionUID = -5650762484071136983L; |
| | | private HashSet<BaseDNDescriptor> data = new HashSet<BaseDNDescriptor>(); |
| | | private HashSet<BaseDNDescriptor> data = new HashSet<>(); |
| | | private ServerDescriptor.ServerStatus serverStatus; |
| | | private boolean isAuthenticated; |
| | | |
| | | private ArrayList<String[]> dataArray = |
| | | new ArrayList<String[]>(); |
| | | private ArrayList<String[]> dataArray = new ArrayList<>(); |
| | | private String[] COLUMN_NAMES; |
| | | private int sortColumn; |
| | | private boolean sortAscending = true; |
| | |
| | | /** Updates the array data. This includes resorting it. */ |
| | | private void updateDataArray() |
| | | { |
| | | TreeSet<BaseDNDescriptor> sortedSet = new TreeSet<BaseDNDescriptor>(this); |
| | | TreeSet<BaseDNDescriptor> sortedSet = new TreeSet<>(this); |
| | | sortedSet.addAll(data); |
| | | dataArray.clear(); |
| | | for (BaseDNDescriptor desc : sortedSet) |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.datamodel; |
| | |
| | | public class Category |
| | | { |
| | | private LocalizableMessage name; |
| | | private ArrayList<Action> actions = new ArrayList<Action>(); |
| | | private ArrayList<Action> actions = new ArrayList<>(); |
| | | |
| | | /** |
| | | * Returns the name of the category. |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.datamodel; |
| | |
| | | */ |
| | | private static LocalizableMessage getMessage(List<LocalizableMessage> errors) |
| | | { |
| | | ArrayList<String> s = new ArrayList<String>(); |
| | | ArrayList<String> s = new ArrayList<>(); |
| | | for (LocalizableMessage error : errors) |
| | | { |
| | | s.add(error.toString()); |
| | |
| | | } |
| | | |
| | | private State state; |
| | | private SortedSet<InetAddress> addresses = new TreeSet<InetAddress>( |
| | | private SortedSet<InetAddress> addresses = new TreeSet<>( |
| | | AdministrationConnectorCfgDefn.getInstance(). |
| | | getListenAddressPropertyDefinition()); |
| | | private int port; |
| | |
| | | implements Comparator<ConnectionHandlerDescriptor> |
| | | { |
| | | private static final long serialVersionUID = -1121308303480078376L; |
| | | private Set<ConnectionHandlerDescriptor> data = |
| | | new HashSet<ConnectionHandlerDescriptor>(); |
| | | private ArrayList<String[]> dataArray = |
| | | new ArrayList<String[]>(); |
| | | private Set<ConnectionHandlerDescriptor> data = new HashSet<>(); |
| | | private ArrayList<String[]> dataArray = new ArrayList<>(); |
| | | private String[] COLUMN_NAMES; |
| | | private int sortColumn; |
| | | private boolean sortAscending = true; |
| | |
| | | |
| | | private void updateDataArray() |
| | | { |
| | | TreeSet<ConnectionHandlerDescriptor> sortedSet = |
| | | new TreeSet<ConnectionHandlerDescriptor>(this); |
| | | TreeSet<ConnectionHandlerDescriptor> sortedSet = new TreeSet<>(this); |
| | | sortedSet.addAll(data); |
| | | dataArray.clear(); |
| | | for (ConnectionHandlerDescriptor desc : sortedSet) |
| | |
| | | protected Set<AddressConnectionHandlerDescriptor> convertToInternalData( |
| | | Set<ConnectionHandlerDescriptor> newData) |
| | | { |
| | | Set<AddressConnectionHandlerDescriptor> newAddresses = |
| | | new HashSet<AddressConnectionHandlerDescriptor>(); |
| | | Set<AddressConnectionHandlerDescriptor> newAddresses = new HashSet<>(); |
| | | for (ConnectionHandlerDescriptor ch : newData) |
| | | { |
| | | if (ch.getAddresses().isEmpty()) |
| | |
| | | public int compare(AddressConnectionHandlerDescriptor desc1, |
| | | AddressConnectionHandlerDescriptor desc2) |
| | | { |
| | | ArrayList<Integer> possibleResults = new ArrayList<Integer>(); |
| | | ArrayList<Integer> possibleResults = new ArrayList<>(); |
| | | |
| | | possibleResults.add(compareNames(desc1, desc2)); |
| | | possibleResults.addAll(getMonitoringPossibleResults( |
| | |
| | | private long poolingPeriod = 20000; |
| | | |
| | | private ServerDescriptor serverDesc; |
| | | private Set<Task> tasks = new HashSet<Task>(); |
| | | private Set<Task> tasks = new HashSet<>(); |
| | | private InitialLdapContext ctx; |
| | | private InitialLdapContext userDataCtx; |
| | | private final LDAPConnectionPool connectionPool = new LDAPConnectionPool(); |
| | |
| | | |
| | | private boolean isLocal = true; |
| | | |
| | | private Set<AbstractIndexDescriptor> modifiedIndexes = |
| | | new HashSet<AbstractIndexDescriptor>(); |
| | | |
| | | private LinkedHashSet<ConfigChangeListener> configListeners = |
| | | new LinkedHashSet<ConfigChangeListener>(); |
| | | |
| | | private LinkedHashSet<BackupCreatedListener> backupListeners = |
| | | new LinkedHashSet<BackupCreatedListener>(); |
| | | |
| | | private LinkedHashSet<BackendPopulatedListener> backendPopulatedListeners = |
| | | new LinkedHashSet<BackendPopulatedListener>(); |
| | | |
| | | private LinkedHashSet<IndexModifiedListener> indexListeners = |
| | | new LinkedHashSet<IndexModifiedListener>(); |
| | | private Set<AbstractIndexDescriptor> modifiedIndexes = new HashSet<>(); |
| | | private LinkedHashSet<ConfigChangeListener> configListeners = new LinkedHashSet<>(); |
| | | private LinkedHashSet<BackupCreatedListener> backupListeners = new LinkedHashSet<>(); |
| | | private LinkedHashSet<BackendPopulatedListener> backendPopulatedListeners = new LinkedHashSet<>(); |
| | | private LinkedHashSet<IndexModifiedListener> indexListeners = new LinkedHashSet<>(); |
| | | |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | private static ControlPanelInfo instance; |
| | | |
| | | /** |
| | | * Default constructor. |
| | | * |
| | | */ |
| | | /** Default constructor. */ |
| | | protected ControlPanelInfo() |
| | | { |
| | | } |
| | |
| | | // We might have stored indexes whose configuration has changed, just remove |
| | | // them if they have the same name, are of the same type and are defined in |
| | | // the same backend. |
| | | Set<AbstractIndexDescriptor> toRemove = |
| | | new HashSet<AbstractIndexDescriptor>(); |
| | | Set<AbstractIndexDescriptor> toRemove = new HashSet<>(); |
| | | for (AbstractIndexDescriptor i : modifiedIndexes) |
| | | { |
| | | if (i.getName().equalsIgnoreCase(index.getName()) && |
| | |
| | | */ |
| | | public void unregisterModifiedIndexesInBackend(String backendName) |
| | | { |
| | | HashSet<AbstractIndexDescriptor> toDelete = |
| | | new HashSet<AbstractIndexDescriptor>(); |
| | | HashSet<AbstractIndexDescriptor> toDelete = new HashSet<>(); |
| | | for (AbstractIndexDescriptor index : modifiedIndexes) |
| | | { |
| | | // Compare only the Backend ID, since the backend object attached to |
| | |
| | | */ |
| | | private void cleanupTasks() |
| | | { |
| | | Set<Task> toClean = new HashSet<Task>(); |
| | | Set<Task> toClean = new HashSet<>(); |
| | | for (Task task : tasks) |
| | | { |
| | | if (task.getState() == Task.State.FINISHED_SUCCESSFULLY || |
| | |
| | | public CustomSearchResult(String dn) |
| | | { |
| | | this.dn = dn; |
| | | attributes = new HashMap<String, List<Object>>(); |
| | | attrNames = new TreeSet<String>(); |
| | | attributes = new HashMap<>(); |
| | | attrNames = new TreeSet<>(); |
| | | toString = calculateToString(); |
| | | hashCode = calculateHashCode(); |
| | | } |
| | |
| | | } |
| | | dn = buf.toString(); |
| | | |
| | | attributes = new HashMap<String, List<Object>>(); |
| | | attrNames = new TreeSet<String>(); |
| | | attributes = new HashMap<>(); |
| | | attrNames = new TreeSet<>(); |
| | | Attributes attrs = sr.getAttributes(); |
| | | if (attrs != null) |
| | | { |
| | |
| | | Attribute attr = (Attribute)en.next(); |
| | | String attrName = attr.getID(); |
| | | attrNames.add(attrName); |
| | | List<Object> values = new ArrayList<Object>(); |
| | | List<Object> values = new ArrayList<>(); |
| | | for (int i=0; i<attr.size(); i++) |
| | | { |
| | | Object v = attr.get(i); |
| | |
| | | public CustomSearchResult duplicate() |
| | | { |
| | | CustomSearchResult sr = new CustomSearchResult(dn); |
| | | sr.attributes = new HashMap<String, List<Object>>(attributes); |
| | | sr.attrNames = new TreeSet<String>(attrNames); |
| | | sr.attributes = new HashMap<>(attributes); |
| | | sr.attrNames = new TreeSet<>(attrNames); |
| | | sr.toString = toString; |
| | | sr.hashCode = hashCode; |
| | | return sr; |
| | |
| | | public Entry getEntry() throws OpenDsException |
| | | { |
| | | DN dn = DN.valueOf(getDN()); |
| | | Map<ObjectClass,String> objectClasses = new HashMap<ObjectClass,String>(); |
| | | Map<AttributeType,List<org.opends.server.types.Attribute>> userAttributes = |
| | | new HashMap<AttributeType,List<org.opends.server.types.Attribute>>(); |
| | | Map<AttributeType,List<org.opends.server.types.Attribute>> |
| | | operationalAttributes = |
| | | new HashMap<AttributeType,List<org.opends.server.types.Attribute>>(); |
| | | Map<ObjectClass,String> objectClasses = new HashMap<>(); |
| | | Map<AttributeType,List<org.opends.server.types.Attribute>> userAttributes = new HashMap<>(); |
| | | Map<AttributeType,List<org.opends.server.types.Attribute>> operationalAttributes = new HashMap<>(); |
| | | |
| | | for (String wholeName : getAttributeNames()) |
| | | { |
| | |
| | | } |
| | | builder.add(bs); |
| | | } |
| | | List<org.opends.server.types.Attribute> attrList = |
| | | new ArrayList<org.opends.server.types.Attribute>(1); |
| | | List<org.opends.server.types.Attribute> attrList = new ArrayList<>(1); |
| | | attrList.add(builder.toAttribute()); |
| | | |
| | | if (attrType.isOperational()) |
| | |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.guitools.controlpanel.datamodel; |
| | | |
| | |
| | | implements Comparator<BackendDescriptor> |
| | | { |
| | | private static final long serialVersionUID = 548035716525600536L; |
| | | private Set<BackendDescriptor> data = new HashSet<BackendDescriptor>(); |
| | | private ArrayList<String[]> dataArray = new ArrayList<String[]>(); |
| | | private ArrayList<BackendDescriptor> dataSourceArray = new ArrayList<BackendDescriptor>(); |
| | | private Set<BackendDescriptor> data = new HashSet<>(); |
| | | private ArrayList<String[]> dataArray = new ArrayList<>(); |
| | | private ArrayList<BackendDescriptor> dataSourceArray = new ArrayList<>(); |
| | | |
| | | private String[] columnNames = {}; |
| | | private LocalizableMessage NO_VALUE_SET = INFO_CTRL_PANEL_NO_MONITORING_VALUE.get(); |
| | | private LocalizableMessage NOT_IMPLEMENTED = INFO_CTRL_PANEL_NOT_IMPLEMENTED.get(); |
| | | |
| | | /** The operations to be displayed. */ |
| | | private LinkedHashSet<String> attributes = new LinkedHashSet<String>(); |
| | | private LinkedHashSet<String> attributes = new LinkedHashSet<>(); |
| | | /** The sort column of the table. */ |
| | | private int sortColumn; |
| | | /** Whether the sorting is ascending or descending. */ |
| | |
| | | CustomSearchResult monitor1 = desc1.getMonitoringEntry(); |
| | | CustomSearchResult monitor2 = desc2.getMonitoringEntry(); |
| | | |
| | | ArrayList<Integer> possibleResults = new ArrayList<Integer>(); |
| | | ArrayList<Integer> possibleResults = new ArrayList<>(); |
| | | possibleResults.add(getName(desc1).compareTo(getName(desc2))); |
| | | computeMonitoringPossibleResults(monitor1, monitor2, possibleResults, attributes); |
| | | |
| | |
| | | */ |
| | | private void updateDataArray() |
| | | { |
| | | TreeSet<BackendDescriptor> sortedSet = new TreeSet<BackendDescriptor>(this); |
| | | TreeSet<BackendDescriptor> sortedSet = new TreeSet<>(this); |
| | | sortedSet.addAll(data); |
| | | dataArray.clear(); |
| | | dataSourceArray.clear(); |
| | |
| | | private static final String[] DATABASE_INDEXES = new String[] { |
| | | DN2ID_INDEX_NAME, ID2CHILDREN_COUNT_NAME, ID2CHILDREN_INDEX_NAME, ID2SUBTREE_INDEX_NAME }; |
| | | |
| | | private final SortedSet<IndexTypeDescriptor> types = new TreeSet<IndexTypeDescriptor>(); |
| | | private final SortedSet<IndexTypeDescriptor> types = new TreeSet<>(); |
| | | private final boolean isDatabaseIndex; |
| | | private final int entryLimit; |
| | | private final AttributeType attr; |
| | |
| | | */ |
| | | public SortedSet<IndexTypeDescriptor> getTypes() |
| | | { |
| | | return new TreeSet<IndexTypeDescriptor>(types); |
| | | return new TreeSet<>(types); |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.guitools.controlpanel.datamodel; |
| | | |
| | |
| | | abstract class MonitoringTableModel<T, P> extends SortableTableModel implements Comparator<P> |
| | | { |
| | | private static final long serialVersionUID = -3974562860632179025L; |
| | | private final Set<P> data = new HashSet<P>(); |
| | | private final ArrayList<String[]> dataArray = new ArrayList<String[]>(); |
| | | private final ArrayList<P> dataSourceArray = new ArrayList<P>(); |
| | | private final Set<P> data = new HashSet<>(); |
| | | private final ArrayList<String[]> dataArray = new ArrayList<>(); |
| | | private final ArrayList<P> dataSourceArray = new ArrayList<>(); |
| | | private boolean showAverages; |
| | | private long runningTime; |
| | | |
| | |
| | | private final LocalizableMessage NOT_IMPLEMENTED = INFO_CTRL_PANEL_NOT_IMPLEMENTED.get(); |
| | | |
| | | /** The attributes to be displayed. */ |
| | | private final LinkedHashSet<MonitoringAttributes> attributes = new LinkedHashSet<MonitoringAttributes>(); |
| | | private final LinkedHashSet<MonitoringAttributes> attributes = new LinkedHashSet<>(); |
| | | /** The sort column of the table. */ |
| | | private int sortColumn; |
| | | /** Whether the sorting is ascending or descending. */ |
| | |
| | | */ |
| | | private void updateDataArray() |
| | | { |
| | | TreeSet<P> sortedSet = new TreeSet<P>(this); |
| | | TreeSet<P> sortedSet = new TreeSet<>(this); |
| | | sortedSet.addAll(data); |
| | | dataArray.clear(); |
| | | dataSourceArray.clear(); |
| | |
| | | protected ArrayList<Integer> getMonitoringPossibleResults( |
| | | CustomSearchResult monitor1, CustomSearchResult monitor2) |
| | | { |
| | | final List<String> attrs = new ArrayList<String>(); |
| | | final List<String> attrs = new ArrayList<>(); |
| | | for (MonitoringAttributes operation : getAttributes()) |
| | | { |
| | | attrs.add(operation.getAttributeName()); |
| | | } |
| | | final ArrayList<Integer> possibleResults = new ArrayList<Integer>(); |
| | | final ArrayList<Integer> possibleResults = new ArrayList<>(); |
| | | computeMonitoringPossibleResults(monitor1, monitor2, possibleResults, attrs); |
| | | return possibleResults; |
| | | } |
| | |
| | | public class ObjectClassValue |
| | | { |
| | | private String structural; |
| | | private SortedSet<String> auxiliary = new TreeSet<String>(); |
| | | private SortedSet<String> auxiliary = new TreeSet<>(); |
| | | private int hashCode; |
| | | |
| | | /** |
| | |
| | | |
| | | private ServerStatus status; |
| | | private int openConnections; |
| | | private Set<BackendDescriptor> backends = new HashSet<BackendDescriptor>(); |
| | | private Set<ConnectionHandlerDescriptor> listeners = new HashSet<ConnectionHandlerDescriptor>(); |
| | | private Set<BackendDescriptor> backends = new HashSet<>(); |
| | | private Set<ConnectionHandlerDescriptor> listeners = new HashSet<>(); |
| | | private ConnectionHandlerDescriptor adminConnector; |
| | | private Set<DN> administrativeUsers = new HashSet<DN>(); |
| | | private Set<DN> administrativeUsers = new HashSet<>(); |
| | | private String installPath; |
| | | private String instancePath; |
| | | private String openDSVersion; |
| | | private String javaVersion; |
| | | private ArrayList<OpenDsException> exceptions = new ArrayList<OpenDsException>(); |
| | | private ArrayList<OpenDsException> exceptions = new ArrayList<>(); |
| | | private boolean isWindowsServiceEnabled; |
| | | private boolean isSchemaEnabled; |
| | | private Schema schema; |
| | |
| | | private CustomSearchResult entryCaches; |
| | | private CustomSearchResult workQueue; |
| | | |
| | | private Set<TaskEntry> taskEntries = new HashSet<TaskEntry>(); |
| | | private Set<TaskEntry> taskEntries = new HashSet<>(); |
| | | |
| | | private long runningTime = -1; |
| | | private boolean isAuthenticated; |
| | |
| | | |
| | | private static Set<Object> toSet(Iterable<?> iterable) |
| | | { |
| | | Set<Object> s = new HashSet<Object>(); |
| | | Set<Object> s = new HashSet<>(); |
| | | for (Object o : iterable) |
| | | { |
| | | s.add(o); |
| | |
| | | public class SortableListModel<T> extends AbstractListModel |
| | | { |
| | | private static final long serialVersionUID = 3241258779190228463L; |
| | | private SortedSet<T> data = new TreeSet<T>(); |
| | | private SortedSet<T> data = new TreeSet<>(); |
| | | |
| | | /** |
| | | * Returns the size of the list model. |
| | |
| | | public void setComparator(Comparator<T> comp) |
| | | { |
| | | SortedSet<T> copy = data; |
| | | data = new TreeSet<T>(comp); |
| | | data = new TreeSet<>(comp); |
| | | data.addAll(copy); |
| | | } |
| | | |
| | |
| | | */ |
| | | public SortedSet<T> getData() |
| | | { |
| | | return new TreeSet<T>(data); |
| | | return new TreeSet<>(data); |
| | | } |
| | | } |
| | |
| | | implements Comparator<TaskEntry> |
| | | { |
| | | private static final long serialVersionUID = -351142550147124L; |
| | | private Set<TaskEntry> data = new HashSet<TaskEntry>(); |
| | | private ArrayList<TaskEntry> dataSourceArray = new ArrayList<TaskEntry>(); |
| | | private Set<TaskEntry> data = new HashSet<>(); |
| | | private ArrayList<TaskEntry> dataSourceArray = new ArrayList<>(); |
| | | |
| | | LinkedHashSet<LocalizableMessage> displayedAttributes = new LinkedHashSet<LocalizableMessage>(); |
| | | final LinkedHashSet<LocalizableMessage> defaultAttributes = new LinkedHashSet<LocalizableMessage>(); |
| | | LinkedHashSet<LocalizableMessage> displayedAttributes = new LinkedHashSet<>(); |
| | | final LinkedHashSet<LocalizableMessage> defaultAttributes = new LinkedHashSet<>(); |
| | | { |
| | | defaultAttributes.add(INFO_TASKINFO_FIELD_ID.get()); |
| | | defaultAttributes.add(INFO_TASKINFO_FIELD_TYPE.get()); |
| | | defaultAttributes.add(INFO_TASKINFO_FIELD_STATUS.get()); |
| | | defaultAttributes.add(INFO_CTRL_PANEL_TASK_CANCELABLE.get()); |
| | | } |
| | | LinkedHashSet<LocalizableMessage> allAttributes = new LinkedHashSet<LocalizableMessage>(); |
| | | LinkedHashSet<LocalizableMessage> allAttributes = new LinkedHashSet<>(); |
| | | { |
| | | allAttributes.addAll(defaultAttributes); |
| | | allAttributes.add(INFO_TASKINFO_FIELD_SCHEDULED_START.get()); |
| | |
| | | */ |
| | | private void updateDataArray() |
| | | { |
| | | TreeSet<TaskEntry> sortedSet = new TreeSet<TaskEntry>(this); |
| | | TreeSet<TaskEntry> sortedSet = new TreeSet<>(this); |
| | | sortedSet.addAll(data); |
| | | dataSourceArray.clear(); |
| | | dataSourceArray.addAll(sortedSet); |
| | |
| | | public int compare(TaskEntry desc1, TaskEntry desc2) |
| | | { |
| | | int result; |
| | | ArrayList<Integer> possibleResults = new ArrayList<Integer>(); |
| | | ArrayList<Integer> possibleResults = new ArrayList<>(); |
| | | |
| | | possibleResults.add(desc1.getId().compareTo(desc2.getId())); |
| | | possibleResults.add(desc1.getType().compareTo(desc2.getType())); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.event; |
| | |
| | | */ |
| | | public class IndexModifiedEvent |
| | | { |
| | | private Set<AbstractIndexDescriptor> modifiedIndexes = |
| | | new HashSet<AbstractIndexDescriptor>(); |
| | | private Set<AbstractIndexDescriptor> modifiedIndexes = new HashSet<>(); |
| | | |
| | | /** |
| | | * The constructor of the event. |
| | |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.event; |
| | |
| | | public class SuperiorObjectClassesChangedEvent |
| | | { |
| | | private Object source; |
| | | private Set<ObjectClass> newObjectClasses = new HashSet<ObjectClass>(); |
| | | private Set<ObjectClass> newObjectClasses = new HashSet<>(); |
| | | |
| | | /** |
| | | * Constructor of the event. |
| | |
| | | public class AddToGroupTask extends Task |
| | | { |
| | | private Set<String> backendSet; |
| | | private LinkedHashSet<DN> dns = new LinkedHashSet<DN>(); |
| | | private LinkedHashSet<DN> groupDns = new LinkedHashSet<DN>(); |
| | | private LinkedHashSet<DN> dns = new LinkedHashSet<>(); |
| | | private LinkedHashSet<DN> groupDns = new LinkedHashSet<>(); |
| | | |
| | | /** |
| | | * Constructor of the task. |
| | |
| | | Set<DN> dns, Set<DN> groupDns) |
| | | { |
| | | super(info, dlg); |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | this.dns.addAll(dns); |
| | | this.groupDns.addAll(groupDns); |
| | | for (DN groupDn : groupDns) |
| | |
| | | /** {@inheritDoc} */ |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | return new ArrayList<String>(); |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | |
| | | // All the operations are incompatible if they apply to this |
| | | // backend for safety. This is a short operation so the limitation |
| | | // has not a lot of impact. |
| | | Set<String> backends = new TreeSet<String>(taskToBeLaunched.getBackends()); |
| | | Set<String> backends = new TreeSet<>(taskToBeLaunched.getBackends()); |
| | | backends.retainAll(getBackends()); |
| | | if (!backends.isEmpty()) |
| | | { |
| | |
| | | private Collection<ModificationItem> getModifications(DN groupDn, |
| | | Set<DN> dns) throws NamingException |
| | | { |
| | | ArrayList<ModificationItem> modifications = |
| | | new ArrayList<ModificationItem>(); |
| | | // Search for the group entry |
| | | ArrayList<ModificationItem> modifications = new ArrayList<>(); |
| | | |
| | | // Search for the group entry |
| | | SearchControls ctls = new SearchControls(); |
| | | ctls.setSearchScope(SearchControls.OBJECT_SCOPE); |
| | | ctls.setReturningAttributes( |
| | |
| | | { |
| | | memberAttr = ServerConstants.ATTR_UNIQUE_MEMBER; |
| | | } |
| | | Set<String> values = |
| | | ConnectionUtils.getValues(sr, memberAttr); |
| | | Set<String> dnsToAdd = new LinkedHashSet<String>(); |
| | | Set<String> values = ConnectionUtils.getValues(sr, memberAttr); |
| | | Set<String> dnsToAdd = new LinkedHashSet<>(); |
| | | if (values != null) |
| | | { |
| | | for (DN newDn : dns) |
| | |
| | | List<TaskEntry> tasks) |
| | | { |
| | | super(info, dlg); |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | for (BackendDescriptor backend : info.getServerDescriptor().getBackends()) |
| | | { |
| | | backendSet.add(backend.getBackendID()); |
| | | } |
| | | this.tasks = new ArrayList<TaskEntry>(tasks); |
| | | this.tasks = new ArrayList<>(tasks); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | |
| | | /** {@inheritDoc} */ |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | return new ArrayList<String>(); |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | private ArrayList<String> getCommandLineArguments(TaskEntry task) |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(); |
| | | ArrayList<String> args = new ArrayList<>(); |
| | | args.add("--cancel"); |
| | | args.add(task.getId()); |
| | | args.addAll(getConnectionCommandLineArguments()); |
| | |
| | | // All the operations are incompatible if they apply to this |
| | | // backend for safety. This is a short operation so the limitation |
| | | // has not a lot of impact. |
| | | Set<String> backends = new TreeSet<String>(taskToBeLaunched.getBackends()); |
| | | Set<String> backends = new TreeSet<>(taskToBeLaunched.getBackends()); |
| | | backends.retainAll(getBackends()); |
| | | if (!backends.isEmpty()) |
| | | { |
| | |
| | | { |
| | | getProgressDialog().appendProgressHtml("<br><br>"); |
| | | } |
| | | ArrayList<String> args = new ArrayList<String>(getObfuscatedCommandLineArguments(arguments)); |
| | | ArrayList<String> args = new ArrayList<>(getObfuscatedCommandLineArguments(arguments)); |
| | | printEquivalentCommandLine(getCommandLinePath("manage-tasks"), |
| | | args, INFO_CTRL_PANEL_EQUIVALENT_CMD_TO_CANCEL_TASK.get( |
| | | task.getId())); |
| | |
| | | public class DeleteBaseDNAndBackendTask extends Task |
| | | { |
| | | private Set<String> backendSet; |
| | | private Map<String, Set<BaseDNDescriptor>> baseDNsToDelete = |
| | | new HashMap<String, Set<BaseDNDescriptor>>(); |
| | | private ArrayList<BackendDescriptor> backendsToDelete = |
| | | new ArrayList<BackendDescriptor>(); |
| | | private Map<String, Set<BaseDNDescriptor>> baseDNsToDelete = new HashMap<>(); |
| | | private ArrayList<BackendDescriptor> backendsToDelete = new ArrayList<>(); |
| | | |
| | | /** |
| | | * Constructor of the task. |
| | |
| | | Collection<BaseDNDescriptor> baseDNsToDelete) |
| | | { |
| | | super(info, dlg); |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | for (BackendDescriptor backend : backendsToDelete) |
| | | { |
| | | backendSet.add(backend.getBackendID()); |
| | |
| | | Set<BaseDNDescriptor> set = this.baseDNsToDelete.get(backendID); |
| | | if (set == null) |
| | | { |
| | | set = new HashSet<BaseDNDescriptor>(); |
| | | set = new HashSet<>(); |
| | | this.baseDNsToDelete.put(backendID, set); |
| | | } |
| | | set.add(baseDN); |
| | | } |
| | | ArrayList<String> indirectBackendsToDelete = new ArrayList<String>(); |
| | | ArrayList<String> indirectBackendsToDelete = new ArrayList<>(); |
| | | for (Set<BaseDNDescriptor> set : this.baseDNsToDelete.values()) |
| | | { |
| | | BackendDescriptor backend = set.iterator().next().getBackend(); |
| | |
| | | |
| | | if (baseDNsToDelete.size() > 0) |
| | | { |
| | | ArrayList<String> dns = new ArrayList<String>(); |
| | | ArrayList<String> dns = new ArrayList<>(); |
| | | for (Set<BaseDNDescriptor> set : baseDNsToDelete.values()) |
| | | { |
| | | for (BaseDNDescriptor baseDN : set) |
| | |
| | | } |
| | | else |
| | | { |
| | | ArrayList<String> quotedDns = new ArrayList<String>(); |
| | | ArrayList<String> quotedDns = new ArrayList<>(); |
| | | for (String dn : dns) |
| | | { |
| | | quotedDns.add("'"+dn+"'"); |
| | |
| | | } |
| | | else |
| | | { |
| | | ArrayList<String> ids = new ArrayList<String>(); |
| | | ArrayList<String> ids = new ArrayList<>(); |
| | | for (BackendDescriptor backend : backendsToDelete) |
| | | { |
| | | ids.add(backend.getBackendID()); |
| | |
| | | } |
| | | else |
| | | { |
| | | ArrayList<String> dns = new ArrayList<String>(); |
| | | ArrayList<String> dns = new ArrayList<>(); |
| | | for (BaseDNDescriptor baseDN : baseDNs) |
| | | { |
| | | dns.add("'" + baseDN.getDn() + "'"); |
| | |
| | | { |
| | | BackendDescriptor backend = baseDNs.iterator().next().getBackend(); |
| | | |
| | | SortedSet<DN> oldBaseDNs = new TreeSet<DN>(); |
| | | SortedSet<DN> oldBaseDNs = new TreeSet<>(); |
| | | for (BaseDNDescriptor baseDN : backend.getBaseDns()) |
| | | { |
| | | oldBaseDNs.add(baseDN.getDn()); |
| | | } |
| | | LinkedList<DN> newBaseDNs = new LinkedList<DN>(oldBaseDNs); |
| | | ArrayList<DN> dnsToRemove = new ArrayList<DN>(); |
| | | LinkedList<DN> newBaseDNs = new LinkedList<>(oldBaseDNs); |
| | | ArrayList<DN> dnsToRemove = new ArrayList<>(); |
| | | for (BaseDNDescriptor baseDN : baseDNs) |
| | | { |
| | | dnsToRemove.add(baseDN.getDn()); |
| | |
| | | (LocalDBBackendCfgClient)root.getBackend( |
| | | baseDNs.iterator().next().getBackend().getBackendID()); |
| | | SortedSet<DN> oldBaseDNs = backend.getBaseDN(); |
| | | SortedSet<DN> newBaseDNs = new TreeSet<DN>(oldBaseDNs); |
| | | ArrayList<DN> dnsToRemove = new ArrayList<DN>(); |
| | | SortedSet<DN> newBaseDNs = new TreeSet<>(oldBaseDNs); |
| | | ArrayList<DN> dnsToRemove = new ArrayList<>(); |
| | | for (BaseDNDescriptor baseDN : baseDNs) |
| | | { |
| | | dnsToRemove.add(baseDN.getDn()); |
| | |
| | | /** {@inheritDoc} */ |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | return new ArrayList<String>(); |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | /** |
| | |
| | | private ArrayList<String> getDSConfigCommandLineArguments( |
| | | Set<BaseDNDescriptor> baseDNs) |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(); |
| | | ArrayList<String> args = new ArrayList<>(); |
| | | if (isServerRunning()) |
| | | { |
| | | args.add("set-backend-prop"); |
| | |
| | | private ArrayList<String> getDSConfigCommandLineArguments( |
| | | BackendDescriptor backend) |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(); |
| | | ArrayList<String> args = new ArrayList<>(); |
| | | args.add("delete-backend"); |
| | | args.add("--backend-name"); |
| | | args.add(backend.getBackendID()); |
| | |
| | | private ArrayList<String> getCommandLineArgumentsToDisableReplication( |
| | | String domainName) |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(); |
| | | ArrayList<String> args = new ArrayList<>(); |
| | | args.add("delete-replication-domain"); |
| | | args.add("--provider-name"); |
| | | args.add("Multimaster Synchronization"); |
| | |
| | | TreePath[] paths, BrowserController controller) |
| | | { |
| | | super(info, dlg); |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | this.controller = controller; |
| | | this.paths = paths; |
| | | SortedSet<DN> entries = new TreeSet<DN>(); |
| | | SortedSet<DN> entries = new TreeSet<>(); |
| | | boolean canPrecalculateNumberOfEntries = true; |
| | | nToDelete = paths.length; |
| | | for (TreePath path : paths) |
| | |
| | | /** {@inheritDoc} */ |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | return new ArrayList<String>(); |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | |
| | | { |
| | | // All the operations are incompatible if they apply to this |
| | | // backend for safety. |
| | | Set<String> backends = |
| | | new TreeSet<String>(taskToBeLaunched.getBackends()); |
| | | Set<String> backends = new TreeSet<>(taskToBeLaunched.getBackends()); |
| | | backends.retainAll(getBackends()); |
| | | if (!backends.isEmpty()) |
| | | { |
| | |
| | | state = State.RUNNING; |
| | | lastException = null; |
| | | |
| | | ArrayList<DN> alreadyDeleted = new ArrayList<DN>(); |
| | | ArrayList<BrowserNodeInfo> toNotify = new ArrayList<BrowserNodeInfo>(); |
| | | ArrayList<DN> alreadyDeleted = new ArrayList<>(); |
| | | ArrayList<BrowserNodeInfo> toNotify = new ArrayList<>(); |
| | | try |
| | | { |
| | | for (TreePath path : paths) |
| | |
| | | */ |
| | | private void printEquivalentCommandToDelete(DN dn, boolean usingControl) |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(getObfuscatedCommandLineArguments( |
| | | ArrayList<String> args = new ArrayList<>(getObfuscatedCommandLineArguments( |
| | | getConnectionCommandLineArguments(useAdminCtx, true))); |
| | | args.add(getNoPropertiesFileArgument()); |
| | | if (usingControl) |
| | |
| | | public class DeleteIndexTask extends Task |
| | | { |
| | | private final Set<String> backendSet; |
| | | private final List<AbstractIndexDescriptor> indexesToDelete = new ArrayList<AbstractIndexDescriptor>(); |
| | | private final List<AbstractIndexDescriptor> deletedIndexes = new ArrayList<AbstractIndexDescriptor>(); |
| | | private final List<AbstractIndexDescriptor> indexesToDelete = new ArrayList<>(); |
| | | private final List<AbstractIndexDescriptor> deletedIndexes = new ArrayList<>(); |
| | | |
| | | /** |
| | | * Constructor of the task. |
| | |
| | | public DeleteIndexTask(ControlPanelInfo info, ProgressDialog dlg, List<AbstractIndexDescriptor> indexesToDelete) |
| | | { |
| | | super(info, dlg); |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | for (final AbstractIndexDescriptor index : indexesToDelete) |
| | | { |
| | | backendSet.add(index.getBackend().getBackendID()); |
| | |
| | | // All the operations are incompatible if they apply to this |
| | | // backend for safety. This is a short operation so the limitation |
| | | // has not a lot of impact. |
| | | final Set<String> backends = new TreeSet<String>(taskToBeLaunched.getBackends()); |
| | | final Set<String> backends = new TreeSet<>(taskToBeLaunched.getBackends()); |
| | | backends.retainAll(getBackends()); |
| | | if (!backends.isEmpty()) |
| | | { |
| | |
| | | @Override |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | return new ArrayList<String>(); |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | private List<String> getDSConfigCommandLineArguments(AbstractIndexDescriptor index) |
| | | { |
| | | final List<String> args = new ArrayList<String>(); |
| | | final List<String> args = new ArrayList<>(); |
| | | if (isVLVIndex(index)) |
| | | { |
| | | args.add("delete-local-db-vlv-index"); |
| | |
| | | public class DeleteSchemaElementsTask extends Task |
| | | { |
| | | /** The list of object classes that the user asked to delete. */ |
| | | private LinkedHashSet<ObjectClass> providedOcsToDelete = new LinkedHashSet<ObjectClass>(); |
| | | private LinkedHashSet<ObjectClass> providedOcsToDelete = new LinkedHashSet<>(); |
| | | /** The list of attributes that the user asked to delete. */ |
| | | private LinkedHashSet<AttributeType> providedAttrsToDelete = new LinkedHashSet<AttributeType>(); |
| | | private LinkedHashSet<AttributeType> providedAttrsToDelete = new LinkedHashSet<>(); |
| | | /** The list of object classes that will be actually deleted (some might be recreated). */ |
| | | private LinkedHashSet<ObjectClass> ocsToDelete = new LinkedHashSet<ObjectClass>(); |
| | | private LinkedHashSet<ObjectClass> ocsToDelete = new LinkedHashSet<>(); |
| | | /** The list of attributes that will be actually deleted (some might be recreated). */ |
| | | private LinkedHashSet<AttributeType> attrsToDelete = new LinkedHashSet<AttributeType>(); |
| | | private LinkedHashSet<AttributeType> attrsToDelete = new LinkedHashSet<>(); |
| | | /** The list of object classes that will be recreated. */ |
| | | private LinkedHashSet<ObjectClass> ocsToAdd = new LinkedHashSet<ObjectClass>(); |
| | | private LinkedHashSet<ObjectClass> ocsToAdd = new LinkedHashSet<>(); |
| | | /** The list of attributes that will be recreated. */ |
| | | private LinkedHashSet<AttributeType> attrsToAdd = new LinkedHashSet<AttributeType>(); |
| | | private LinkedHashSet<AttributeType> attrsToAdd = new LinkedHashSet<>(); |
| | | |
| | | /** |
| | | * Constructor of the task. |
| | |
| | | ocsToDelete, schema)); |
| | | } |
| | | } |
| | | ArrayList<AttributeType> lAttrsToDelete = |
| | | new ArrayList<AttributeType>(allAttrsToDelete); |
| | | ArrayList<AttributeType> lAttrsToDelete = new ArrayList<>(allAttrsToDelete); |
| | | for (int i = lAttrsToDelete.size() - 1; i >= 0; i--) |
| | | { |
| | | AttributeType attrToDelete = lAttrsToDelete.get(i); |
| | |
| | | } |
| | | |
| | | assert allOcsToDelete != null; |
| | | ArrayList<ObjectClass> lOcsToDelete = |
| | | new ArrayList<ObjectClass>(allOcsToDelete); |
| | | ArrayList<ObjectClass> lOcsToDelete = new ArrayList<>(allOcsToDelete); |
| | | for (int i = lOcsToDelete.size() - 1; i >= 0; i--) |
| | | { |
| | | ObjectClass ocToDelete = lOcsToDelete.get(i); |
| | |
| | | } |
| | | else |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(); |
| | | ArrayList<String> args = new ArrayList<>(); |
| | | args.add("-a"); |
| | | args.addAll(getObfuscatedCommandLineArguments( |
| | | getConnectionCommandLineArguments(true, true))); |
| | |
| | | } |
| | | if (isSuperior) |
| | | { |
| | | ArrayList<String> allNames = new ArrayList<String>(); |
| | | ArrayList<String> allNames = new ArrayList<>(); |
| | | for (String str : attrToDelete.getNormalizedNames()) |
| | | { |
| | | allNames.add(str); |
| | |
| | | } |
| | | } |
| | | boolean hasSuperior = false; |
| | | Set<ObjectClass> newSuperiors = new LinkedHashSet<ObjectClass>(); |
| | | Set<ObjectClass> newSuperiors = new LinkedHashSet<>(); |
| | | for (ObjectClass sup : ocToDelete.getSuperiorClasses()) |
| | | { |
| | | boolean isFound = false; |
| | |
| | | |
| | | if (containsAttribute || hasSuperior) |
| | | { |
| | | ArrayList<String> allNames = new ArrayList<String>(); |
| | | ArrayList<String> allNames = new ArrayList<>(); |
| | | for (String str : ocToDelete.getNormalizedNames()) |
| | | { |
| | | allNames.add(str); |
| | |
| | | Set<AttributeType> optional; |
| | | if (containsAttribute) |
| | | { |
| | | required = new HashSet<AttributeType>( |
| | | ocToDelete.getRequiredAttributes()); |
| | | optional = new HashSet<AttributeType>( |
| | | ocToDelete.getOptionalAttributes()); |
| | | required = new HashSet<>(ocToDelete.getRequiredAttributes()); |
| | | optional = new HashSet<>(ocToDelete.getOptionalAttributes()); |
| | | required.removeAll(providedAttrsToDelete); |
| | | optional.removeAll(providedAttrsToDelete); |
| | | } |
| | |
| | | |
| | | private Set<ObjectClass> getNewSuperiors(ObjectClass currentSup) |
| | | { |
| | | Set<ObjectClass> newSuperiors = new LinkedHashSet<ObjectClass>(); |
| | | Set<ObjectClass> newSuperiors = new LinkedHashSet<>(); |
| | | if (currentSup.getSuperiorClasses() != null && |
| | | !currentSup.getSuperiorClasses().isEmpty()) |
| | | { |
| | |
| | | public static LinkedHashSet<AttributeType> getOrderedAttributesToDelete( |
| | | Collection<AttributeType> attrsToDelete, Schema schema) |
| | | { |
| | | LinkedHashSet<AttributeType> orderedAttributes = |
| | | new LinkedHashSet<AttributeType>(); |
| | | LinkedHashSet<AttributeType> orderedAttributes = new LinkedHashSet<>(); |
| | | for (AttributeType attribute : attrsToDelete) |
| | | { |
| | | orderedAttributes.addAll(getOrderedChildrenToDelete(attribute, schema)); |
| | |
| | | public static LinkedHashSet<ObjectClass> getOrderedObjectClassesToDelete( |
| | | Collection<ObjectClass> ocsToDelete, Schema schema) |
| | | { |
| | | LinkedHashSet<ObjectClass> orderedOcs = new LinkedHashSet<ObjectClass>(); |
| | | LinkedHashSet<ObjectClass> orderedOcs = new LinkedHashSet<>(); |
| | | for (ObjectClass oc : ocsToDelete) |
| | | { |
| | | orderedOcs.addAll(getOrderedChildrenToDelete(oc, schema)); |
| | |
| | | getOrderedObjectClassesToDeleteFromAttrs( |
| | | Collection<AttributeType> attrsToDelete, Schema schema) |
| | | { |
| | | LinkedHashSet<ObjectClass> orderedOcs = new LinkedHashSet<ObjectClass>(); |
| | | ArrayList<ObjectClass> dependentClasses = new ArrayList<ObjectClass>(); |
| | | LinkedHashSet<ObjectClass> orderedOcs = new LinkedHashSet<>(); |
| | | ArrayList<ObjectClass> dependentClasses = new ArrayList<>(); |
| | | for (AttributeType attr : attrsToDelete) |
| | | { |
| | | for (ObjectClass oc : schema.getObjectClasses().values()) |
| | |
| | | public static Map<String, List<String>> cloneExtraProperties( |
| | | CommonSchemaElements element) |
| | | { |
| | | Map<String, List<String>> extraProperties = |
| | | new HashMap<String, List<String>>(); |
| | | Map<String, List<String>> extraProperties = new HashMap<>(); |
| | | Map<String, List<String>> props = element.getExtraProperties(); |
| | | for (String name : props.keySet()) |
| | | { |
| | | List<String> values = new ArrayList<String>(props.get(name)); |
| | | List<String> values = new ArrayList<>(props.get(name)); |
| | | extraProperties.put(name, values); |
| | | } |
| | | return extraProperties; |
| | |
| | | private static LinkedHashSet<AttributeType> getOrderedChildrenToDelete( |
| | | AttributeType attribute, Schema schema) |
| | | { |
| | | LinkedHashSet<AttributeType> children = new LinkedHashSet<AttributeType>(); |
| | | LinkedHashSet<AttributeType> children = new LinkedHashSet<>(); |
| | | for (AttributeType attr : schema.getAttributeTypes().values()) |
| | | { |
| | | if (attribute.equals(attr.getSuperiorType())) |
| | |
| | | private static LinkedHashSet<ObjectClass> getOrderedChildrenToDelete( |
| | | ObjectClass objectClass, Schema schema) |
| | | { |
| | | LinkedHashSet<ObjectClass> children = new LinkedHashSet<ObjectClass>(); |
| | | LinkedHashSet<ObjectClass> children = new LinkedHashSet<>(); |
| | | for (ObjectClass oc : schema.getObjectClasses().values()) |
| | | { |
| | | if (oc.getSuperiorClasses().contains(objectClass)) |
| | |
| | | String baseDN) |
| | | { |
| | | super(info, dlg); |
| | | baseDNs = new HashSet<String>(); |
| | | baseDNs = new HashSet<>(); |
| | | baseDNs.add(baseDN); |
| | | initializeBackendSet(); |
| | | } |
| | |
| | | Collection<String> baseDNs) |
| | | { |
| | | super(info, dlg); |
| | | backendSet = new HashSet<String>(); |
| | | this.baseDNs = new TreeSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | this.baseDNs = new TreeSet<>(); |
| | | this.baseDNs.addAll(baseDNs); |
| | | initializeBackendSet(); |
| | | } |
| | |
| | | { |
| | | if (oldAttribute.equals(attrToDelete.getSuperiorType())) |
| | | { |
| | | ArrayList<String> allNames = new ArrayList<String>(); |
| | | ArrayList<String> allNames = new ArrayList<>(); |
| | | for (String str : attrToDelete.getNormalizedNames()) |
| | | { |
| | | allNames.add(str); |
| | |
| | | ocToDelete.getOptionalAttributeChain().contains(oldAttribute); |
| | | if (containsAttribute) |
| | | { |
| | | ArrayList<String> allNames = new ArrayList<String>(); |
| | | ArrayList<String> allNames = new ArrayList<>(); |
| | | for (String str : ocToDelete.getNormalizedNames()) |
| | | { |
| | | allNames.add(str); |
| | | } |
| | | Map<String, List<String>> extraProperties = |
| | | DeleteSchemaElementsTask.cloneExtraProperties(ocToDelete); |
| | | Set<AttributeType> required = new HashSet<AttributeType>( |
| | | ocToDelete.getRequiredAttributes()); |
| | | Set<AttributeType> optional = new HashSet<AttributeType>( |
| | | ocToDelete.getOptionalAttributes()); |
| | | Set<AttributeType> required = new HashSet<>(ocToDelete.getRequiredAttributes()); |
| | | Set<AttributeType> optional = new HashSet<>(ocToDelete.getOptionalAttributes()); |
| | | if (required.contains(oldAttribute)) |
| | | { |
| | | required.remove(oldAttribute); |
| | |
| | | private void updateSchema() throws OpenDsException |
| | | { |
| | | Schema schema = getInfo().getServerDescriptor().getSchema(); |
| | | ArrayList<AttributeType> attrs = new ArrayList<AttributeType>(); |
| | | ArrayList<AttributeType> attrs = new ArrayList<>(); |
| | | attrs.add(oldAttribute); |
| | | LinkedHashSet<AttributeType> attrsToDelete = |
| | | DeleteSchemaElementsTask.getOrderedAttributesToDelete(attrs, schema); |
| | |
| | | DeleteSchemaElementsTask.getOrderedObjectClassesToDeleteFromAttrs( |
| | | attrsToDelete, schema); |
| | | |
| | | LinkedHashSet<AttributeType> attrsToAdd = |
| | | new LinkedHashSet<AttributeType>(); |
| | | ArrayList<AttributeType> lAttrsToDelete = |
| | | new ArrayList<AttributeType>(attrsToDelete); |
| | | LinkedHashSet<AttributeType> attrsToAdd = new LinkedHashSet<>(); |
| | | ArrayList<AttributeType> lAttrsToDelete = new ArrayList<>(attrsToDelete); |
| | | for (int i = lAttrsToDelete.size() - 1; i >= 0; i--) |
| | | { |
| | | AttributeType attrToAdd = getAttributeToAdd(lAttrsToDelete.get(i)); |
| | |
| | | } |
| | | } |
| | | |
| | | ArrayList<ObjectClass> lOcsToDelete = |
| | | new ArrayList<ObjectClass>(ocsToDelete); |
| | | LinkedHashSet<ObjectClass> ocsToAdd = new LinkedHashSet<ObjectClass>(); |
| | | ArrayList<ObjectClass> lOcsToDelete = new ArrayList<>(ocsToDelete); |
| | | LinkedHashSet<ObjectClass> ocsToAdd = new LinkedHashSet<>(); |
| | | for (int i = lOcsToDelete.size() - 1; i >= 0; i--) |
| | | { |
| | | ocsToAdd.add(getObjectClassToAdd(lOcsToDelete.get(i))); |
| | |
| | | BrowserController controller, TreePath path) |
| | | { |
| | | super(info, dlg); |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | this.oldEntry = oldEntry; |
| | | this.newEntry = newEntry; |
| | | this.controller = controller; |
| | |
| | | /** {@inheritDoc} */ |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | return new ArrayList<String>(); |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | |
| | | */ |
| | | public static ArrayList<ModificationItem> getModifications(Entry newEntry, |
| | | CustomSearchResult oldEntry, ControlPanelInfo info) { |
| | | ArrayList<ModificationItem> modifications = |
| | | new ArrayList<ModificationItem>(); |
| | | ArrayList<ModificationItem> modifications = new ArrayList<>(); |
| | | Schema schema = info.getServerDescriptor().getSchema(); |
| | | |
| | | List<org.opends.server.types.Attribute> newAttrs = newEntry.getAttributes(); |
| | |
| | | attrType = DirectoryServer.getDefaultAttributeType( |
| | | attr.getName().toLowerCase()); |
| | | } |
| | | List<ByteString> newValues = new ArrayList<ByteString>(); |
| | | List<ByteString> newValues = new ArrayList<>(); |
| | | Iterator<ByteString> it = attr.iterator(); |
| | | while (it.hasNext()) |
| | | { |
| | |
| | | } |
| | | if (oldValues == null) |
| | | { |
| | | Set<ByteString> vs = new HashSet<ByteString>(newValues); |
| | | Set<ByteString> vs = new HashSet<>(newValues); |
| | | if (rdnValue != null) |
| | | { |
| | | vs.remove(rdnValue); |
| | |
| | | } |
| | | if (!toAdd.isEmpty()) |
| | | { |
| | | List<ByteString> vs = new ArrayList<ByteString>(toAdd); |
| | | List<ByteString> vs = new ArrayList<>(toAdd); |
| | | if (rdnValue != null) |
| | | { |
| | | vs.remove(rdnValue); |
| | |
| | | private static List<ByteString> getValuesToDelete(List<Object> oldValues, |
| | | List<ByteString> newValues) |
| | | { |
| | | List<ByteString> valuesToDelete = new ArrayList<ByteString>(); |
| | | List<ByteString> valuesToDelete = new ArrayList<>(); |
| | | for (Object o : oldValues) |
| | | { |
| | | ByteString oldValue = createAttributeValue(o); |
| | |
| | | private static List<ByteString> getValuesToAdd(List<Object> oldValues, |
| | | List<ByteString> newValues) |
| | | { |
| | | List<ByteString> valuesToAdd = new ArrayList<ByteString>(); |
| | | List<ByteString> valuesToAdd = new ArrayList<>(); |
| | | for (ByteString newValue : newValues) |
| | | { |
| | | if (!contains(oldValues, newValue)) |
| | |
| | | } |
| | | else if (currentSups.contains(oldObjectClass)) |
| | | { |
| | | ArrayList<String> allNames = new ArrayList<String>(); |
| | | ArrayList<String> allNames = new ArrayList<>(); |
| | | for (String str : ocToDelete.getNormalizedNames()) |
| | | { |
| | | allNames.add(str); |
| | | } |
| | | Map<String, List<String>> extraProperties = |
| | | DeleteSchemaElementsTask.cloneExtraProperties(ocToDelete); |
| | | Set<ObjectClass> newSups = new LinkedHashSet<ObjectClass>(); |
| | | Set<ObjectClass> newSups = new LinkedHashSet<>(); |
| | | for(ObjectClass oc: currentSups) |
| | | { |
| | | if(oc.equals(oldObjectClass)) |
| | |
| | | private void updateSchema() throws OpenDsException |
| | | { |
| | | Schema schema = getInfo().getServerDescriptor().getSchema(); |
| | | ArrayList<ObjectClass> ocs = new ArrayList<ObjectClass>(); |
| | | ArrayList<ObjectClass> ocs = new ArrayList<>(); |
| | | ocs.add(oldObjectClass); |
| | | LinkedHashSet<ObjectClass> ocsToDelete = |
| | | DeleteSchemaElementsTask.getOrderedObjectClassesToDelete(ocs, schema); |
| | | |
| | | ArrayList<ObjectClass> lOcsToDelete = |
| | | new ArrayList<ObjectClass>(ocsToDelete); |
| | | LinkedHashSet<ObjectClass> ocsToAdd = new LinkedHashSet<ObjectClass>(); |
| | | ArrayList<ObjectClass> lOcsToDelete = new ArrayList<>(ocsToDelete); |
| | | LinkedHashSet<ObjectClass> ocsToAdd = new LinkedHashSet<>(); |
| | | for (int i = lOcsToDelete.size() - 1; i >= 0; i--) |
| | | { |
| | | ocsToAdd.add(getObjectClassToAdd(lOcsToDelete.get(i))); |
| | |
| | | BasicNode parentNode, BrowserController controller) |
| | | { |
| | | super(info, dlg); |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | this.newEntry = newEntry; |
| | | this.ldif = ldif; |
| | | this.parentNode = parentNode; |
| | |
| | | /** {@inheritDoc} */ |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | return new ArrayList<String>(); |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | |
| | | for (org.opends.server.types.Attribute attr : newEntry.getAttributes()) |
| | | { |
| | | String attrName = attr.getNameWithOptions(); |
| | | Set<ByteString> values = new LinkedHashSet<ByteString>(); |
| | | Set<ByteString> values = new LinkedHashSet<>(); |
| | | Iterator<ByteString> it = attr.iterator(); |
| | | while (it.hasNext()) |
| | | { |
| | |
| | | */ |
| | | private void printEquivalentCommand() |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(getObfuscatedCommandLineArguments( |
| | | ArrayList<String> args = new ArrayList<>(getObfuscatedCommandLineArguments( |
| | | getConnectionCommandLineArguments(useAdminCtx, true))); |
| | | args.add(getNoPropertiesFileArgument()); |
| | | args.add("--defaultAdd"); |
| | |
| | | */ |
| | | public class NewSchemaElementsTask extends Task |
| | | { |
| | | LinkedHashSet<ObjectClass> ocsToAdd = new LinkedHashSet<ObjectClass>(); |
| | | LinkedHashSet<AttributeType> attrsToAdd = new LinkedHashSet<AttributeType>(); |
| | | LinkedHashSet<ObjectClass> ocsToAdd = new LinkedHashSet<>(); |
| | | LinkedHashSet<AttributeType> attrsToAdd = new LinkedHashSet<>(); |
| | | |
| | | /** |
| | | * Constructor of the task. |
| | |
| | | } |
| | | else |
| | | { |
| | | ArrayList<String> attrNames = new ArrayList<String>(); |
| | | ArrayList<String> attrNames = new ArrayList<>(); |
| | | for (AttributeType attribute : attrsToAdd) |
| | | { |
| | | attrNames.add(attribute.getNameOrOID()); |
| | | } |
| | | ArrayList<String> ocNames = new ArrayList<String>(); |
| | | ArrayList<String> ocNames = new ArrayList<>(); |
| | | for (ObjectClass oc : ocsToAdd) |
| | | { |
| | | ocNames.add(oc.getNameOrOID()); |
| | |
| | | LinkedHashMap<String, List<AttributeType>> hmAttrs = copy(attrsToAdd); |
| | | LinkedHashMap<String, List<ObjectClass>> hmOcs = copy(ocsToAdd); |
| | | |
| | | LinkedHashSet<String> allFileNames = new LinkedHashSet<String>(); |
| | | LinkedHashSet<String> allFileNames = new LinkedHashSet<>(); |
| | | allFileNames.addAll(hmAttrs.keySet()); |
| | | allFileNames.addAll(hmOcs.keySet()); |
| | | for (String fileName : allFileNames) |
| | |
| | | private <T extends SchemaFileElement> LinkedHashMap<String, List<T>> copy( |
| | | LinkedHashSet<T> elemsToAdd) |
| | | { |
| | | LinkedHashMap<String, List<T>> hmElems = |
| | | new LinkedHashMap<String, List<T>>(); |
| | | LinkedHashMap<String, List<T>> hmElems = new LinkedHashMap<>(); |
| | | for (T elem : elemsToAdd) |
| | | { |
| | | String fileName = CommonSchemaElements.getSchemaFile(elem); |
| | |
| | | List<T> elems = hmElems.get(fileName); |
| | | if (elems == null) |
| | | { |
| | | elems = new ArrayList<T>(); |
| | | elems = new ArrayList<>(); |
| | | hmElems.put(fileName, elems); |
| | | } |
| | | elems.add(elem); |
| | |
| | | |
| | | if (previousValues != null && !previousValues.isEmpty()) |
| | | { |
| | | ArrayList<String> vs = new ArrayList<String>(previousValues); |
| | | ArrayList<String> vs = new ArrayList<>(previousValues); |
| | | element.setExtraProperty(ServerConstants.SCHEMA_PROPERTY_FILENAME, vs); |
| | | } |
| | | return attributeWithoutFileDefinition; |
| | |
| | | private void printEquivalentCommandLineToAddOnline( |
| | | CommonSchemaElements element) |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(); |
| | | ArrayList<String> args = new ArrayList<>(); |
| | | args.add("-a"); |
| | | args.addAll(getObfuscatedCommandLineArguments( |
| | | getConnectionCommandLineArguments(true, true))); |
| | |
| | | List<AttributeType> attributes, |
| | | List<ObjectClass> objectClasses) |
| | | { |
| | | ArrayList<String> names = new ArrayList<String>(); |
| | | ArrayList<String> names = new ArrayList<>(); |
| | | for (AttributeType attr : attributes) |
| | | { |
| | | names.add(attr.getNameOrOID()); |
| | |
| | | */ |
| | | private ArrayList<String> getSchemaEntryLines() |
| | | { |
| | | ArrayList<String> lines = new ArrayList<String>(); |
| | | ArrayList<String> lines = new ArrayList<>(); |
| | | lines.add("dn: cn=schema"); |
| | | lines.add("objectClass: top"); |
| | | lines.add("objectClass: ldapSubentry"); |
| | |
| | | BasicNode node, BrowserController controller, char[] pwd) |
| | | { |
| | | super(info, dlg); |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | this.node = node; |
| | | this.newPassword = pwd; |
| | | try |
| | |
| | | /** {@inheritDoc} */ |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(); |
| | | ArrayList<String> args = new ArrayList<>(); |
| | | if (currentPassword == null) |
| | | { |
| | | args.add("--authzID"); |
| | |
| | | /** {@inheritDoc} */ |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(); |
| | | ArrayList<String> args = new ArrayList<>(); |
| | | args.add("--timeout"); |
| | | args.add("0"); |
| | | return args; |
| | |
| | | protected StartStopTask(ControlPanelInfo info, ProgressDialog progressDialog) |
| | | { |
| | | super(info, progressDialog); |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | for (BackendDescriptor backend : |
| | | info.getServerDescriptor().getBackends()) |
| | | { |
| | |
| | | /** {@inheritDoc} */ |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | return new ArrayList<String>(); |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | private ProgressDialog progressDialog; |
| | | |
| | | private ArrayList<ConfigurationElementCreatedListener> confListeners = |
| | | new ArrayList<ConfigurationElementCreatedListener>(); |
| | | private ArrayList<ConfigurationElementCreatedListener> confListeners = new ArrayList<>(); |
| | | |
| | | private static int MAX_BINARY_LENGTH_TO_DISPLAY = 1024; |
| | | |
| | |
| | | { |
| | | String[] toObfuscate = {"--bindPassword", "--currentPassword", |
| | | "--newPassword"}; |
| | | ArrayList<String> args = new ArrayList<String>(clearArgs); |
| | | ArrayList<String> args = new ArrayList<>(clearArgs); |
| | | for (int i=1; i<args.size(); i++) |
| | | { |
| | | for (String argName : toObfuscate) |
| | |
| | | */ |
| | | protected List<String> getConfigCommandLineArguments() |
| | | { |
| | | List<String> args = new ArrayList<String>(); |
| | | List<String> args = new ArrayList<>(); |
| | | args.add("--configClass"); |
| | | args.add(org.opends.server.extensions.ConfigFileHandler.class.getName()); |
| | | args.add("--configFile"); |
| | |
| | | protected List<String> getConnectionCommandLineArguments( |
| | | boolean useAdminConnector, boolean addConnectionTypeParameters) |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(); |
| | | ArrayList<String> args = new ArrayList<>(); |
| | | InitialLdapContext ctx; |
| | | |
| | | if (useAdminConnector) |
| | |
| | | protected void printEquivalentCommandToModify(String dn, |
| | | Collection<ModificationItem> mods, boolean useAdminCtx) |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(getObfuscatedCommandLineArguments( |
| | | ArrayList<String> args = new ArrayList<>(getObfuscatedCommandLineArguments( |
| | | getConnectionCommandLineArguments(useAdminCtx, true))); |
| | | args.add(getNoPropertiesFileArgument()); |
| | | String equiv = getEquivalentCommandLine(getCommandLinePath("ldapmodify"), |
| | |
| | | protected void printEquivalentRenameCommand(DN oldDN, DN newDN, |
| | | boolean useAdminCtx) |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(getObfuscatedCommandLineArguments( |
| | | ArrayList<String> args = new ArrayList<>(getObfuscatedCommandLineArguments( |
| | | getConnectionCommandLineArguments(useAdminCtx, true))); |
| | | args.add(getNoPropertiesFileArgument()); |
| | | String equiv = getEquivalentCommandLine(getCommandLinePath("ldapmodify"), |
| | |
| | | * The scroll pane that contains the table. |
| | | */ |
| | | protected JScrollPane tableScroll; |
| | | private Set<IndexSelectionListener> indexListeners = |
| | | new HashSet<IndexSelectionListener>(); |
| | | private Set<IndexSelectionListener> indexListeners = new HashSet<>(); |
| | | private int lastRowMouseOver = -1; |
| | | |
| | | /** |
| | | * Default constructor. |
| | | * |
| | | */ |
| | | /** Default constructor. */ |
| | | protected AbstractBackendIndexesPanel() |
| | | { |
| | | super(); |
| | | createLayout(); |
| | | } |
| | | |
| | |
| | | /** {@inheritDoc} */ |
| | | public void okClicked() |
| | | { |
| | | final ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | final ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | |
| | | if (checkSyntaxBackground()) |
| | | { |
| | |
| | | private final LocalizableMessage STANDARD_ATTRIBUTES = INFO_CTRL_PANEL_STANDARD_ATTRIBUTES_LABEL.get(); |
| | | |
| | | /** The list of standard attribute names. */ |
| | | private final TreeSet<String> standardAttrNames = new TreeSet<String>(new LowerCaseComparator()); |
| | | private final TreeSet<String> standardAttrNames = new TreeSet<>(new LowerCaseComparator()); |
| | | /** The list of configuration attribute names. */ |
| | | private final TreeSet<String> configurationAttrNames = new TreeSet<String>(new LowerCaseComparator()); |
| | | private final TreeSet<String> configurationAttrNames = new TreeSet<>(new LowerCaseComparator()); |
| | | /** The list of custom attribute names. */ |
| | | private final TreeSet<String> customAttrNames = new TreeSet<String>(new LowerCaseComparator()); |
| | | private final TreeSet<String> customAttrNames = new TreeSet<>(new LowerCaseComparator()); |
| | | |
| | | /** |
| | | * Constructor. |
| | |
| | | */ |
| | | protected List<VLVSortOrder> getSortOrder() |
| | | { |
| | | List<VLVSortOrder> sortOrder = new ArrayList<VLVSortOrder>(); |
| | | List<VLVSortOrder> sortOrder = new ArrayList<>(); |
| | | for (int i = 0; i < sortOrderModel.getSize(); i++) |
| | | { |
| | | sortOrder.add((VLVSortOrder) sortOrderModel.get(i)); |
| | | } |
| | | |
| | | return sortOrder; |
| | | } |
| | | |
| | |
| | | if (schema != null) |
| | | { |
| | | repack[0] = attributes.getItemCount() == 0; |
| | | LinkedHashSet<CategorizedComboBoxElement> newElements = new LinkedHashSet<CategorizedComboBoxElement>(); |
| | | LinkedHashSet<CategorizedComboBoxElement> newElements = new LinkedHashSet<>(); |
| | | |
| | | synchronized (standardAttrNames) |
| | | { |
| | |
| | | try |
| | | { |
| | | LDAPFilter ldapFilter = LDAPFilter.decode(f); |
| | | ArrayList<LocalizableMessage> msgs = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> msgs = new ArrayList<>(); |
| | | updateIndexRequiredMessages(ldapFilter, msgs); |
| | | if (!msgs.isEmpty()) |
| | | { |
| | |
| | | */ |
| | | protected void updateBaseDNCombo(BackendDescriptor backend) |
| | | { |
| | | List<Object> newElements = new ArrayList<Object>(); |
| | | List<Object> newElements = new ArrayList<>(); |
| | | for (BaseDNDescriptor baseDN : backend.getBaseDns()) |
| | | { |
| | | String dn = null; |
| | |
| | | |
| | | BackendDescriptor backend = getBackend(); |
| | | |
| | | List<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | List<LocalizableMessage> errors = new ArrayList<>(); |
| | | if (checkName) |
| | | { |
| | | String n = name.getText(); |
| | |
| | | private JScrollPane scrollEntries; |
| | | private JLabel lEntries = Utilities.createDefaultLabel(); |
| | | private JLabel lGroups = Utilities.createDefaultLabel(); |
| | | private LinkedHashSet<DN> dns = new LinkedHashSet<DN>(); |
| | | private LinkedHashSet<DN> dns = new LinkedHashSet<>(); |
| | | |
| | | private GenericDialog browseGroupDlg; |
| | | private LDAPEntrySelectionPanel browseGroupPanel; |
| | |
| | | */ |
| | | public void setEntriesToAdd(Set<DN> dns) |
| | | { |
| | | ArrayList<String> sDns = new ArrayList<String>(); |
| | | ArrayList<String> sDns = new ArrayList<>(); |
| | | for (DN dn : dns) |
| | | { |
| | | sDns.add(dn.toString()); |
| | |
| | | /** {@inheritDoc} */ |
| | | public void okClicked() |
| | | { |
| | | final ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | final ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | BackgroundTask<Void> worker = new BackgroundTask<Void>() |
| | | { |
| | | /** {@inheritDoc} */ |
| | |
| | | Utilities.createFrame(), |
| | | Utilities.getParentDialog(this), |
| | | INFO_CTRL_PANEL_ADD_TO_GROUP_TITLE.get(), getInfo()); |
| | | LinkedHashSet<DN> groupDns = new LinkedHashSet<DN>(); |
| | | LinkedHashSet<DN> groupDns = new LinkedHashSet<>(); |
| | | String[] grs = groups.getText().split("\n"); |
| | | try |
| | | { |
| | |
| | | description.setText(n); |
| | | |
| | | Comparator<String> lowerCaseComparator = new LowerCaseComparator(); |
| | | TreeSet<String> attributes = new TreeSet<String>(lowerCaseComparator); |
| | | TreeSet<String> attributes = new TreeSet<>(lowerCaseComparator); |
| | | for (AttributeType attr : schema.getAttributeTypes().values()) |
| | | { |
| | | if (syntax == attr.getSyntax()) |
| | |
| | | setPrimaryValid(lBackupOptions); |
| | | backupIDInitialized = false; |
| | | |
| | | final LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<LocalizableMessage>(); |
| | | final LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<>(); |
| | | |
| | | if (!allBackends.isSelected()) |
| | | { |
| | |
| | | public Void processBackgroundTask() throws Throwable |
| | | { |
| | | // Open the backup directory and make sure it is valid. |
| | | LinkedHashSet<BackupInfo> backups = new LinkedHashSet<BackupInfo>(); |
| | | LinkedHashSet<BackupInfo> backups = new LinkedHashSet<>(); |
| | | try |
| | | { |
| | | BackupDirectory backupDir = |
| | |
| | | public BackupTask(ControlPanelInfo info, ProgressDialog dlg) |
| | | { |
| | | super(info, dlg); |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | if (!allBackends.isSelected()) |
| | | { |
| | | backendSet.add((String)backends.getSelectedItem()); |
| | |
| | | /** {@inheritDoc} */ |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(); |
| | | ArrayList<String> args = new ArrayList<>(); |
| | | |
| | | args.add("--backupDirectory"); |
| | | args.add(dir); |
| | |
| | | private void refresh(final boolean closeAndUpdateValue, |
| | | final boolean updateImage) |
| | | { |
| | | final ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | final ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | |
| | | setPrimaryValid(useFile); |
| | | setPrimaryValid(useBase64); |
| | |
| | | |
| | | private void deleteClicked() |
| | | { |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | TreePath[] paths = treePane.getTree().getSelectionPaths(); |
| | | |
| | | if ((paths != null) && (paths.length > 0)) |
| | |
| | | TreePath[] paths = treePane.getTree().getSelectionPaths(); |
| | | if (paths != null) |
| | | { |
| | | LinkedHashSet<DN> dns = new LinkedHashSet<DN>(); |
| | | LinkedHashSet<DN> dns = new LinkedHashSet<>(); |
| | | for (TreePath path : paths) |
| | | { |
| | | BasicNode node = (BasicNode)path.getLastPathComponent(); |
| | |
| | | return changed; |
| | | } |
| | | |
| | | private HashMap<Object, ImageIcon> hmImages = |
| | | new HashMap<Object, ImageIcon>(); |
| | | private HashMap<Object, ImageIcon> hmImages = new HashMap<>(); |
| | | { |
| | | NodeType[] identifiers = { |
| | | NodeType.ROOT, |
| | |
| | | } |
| | | } |
| | | |
| | | ArrayList<ArrayList<? extends AbstractIndexTreeNode>> nodes = |
| | | new ArrayList<ArrayList<? extends AbstractIndexTreeNode>>(); |
| | | ArrayList<IndexTreeNode> standardIndexNodes = |
| | | new ArrayList<IndexTreeNode>(); |
| | | ArrayList<VLVIndexTreeNode> vlvIndexNodes = |
| | | new ArrayList<VLVIndexTreeNode>(); |
| | | ArrayList<ArrayList<? extends AbstractIndexTreeNode>> nodes = new ArrayList<>(); |
| | | ArrayList<IndexTreeNode> standardIndexNodes = new ArrayList<>(); |
| | | ArrayList<VLVIndexTreeNode> vlvIndexNodes = new ArrayList<>(); |
| | | nodes.add(standardIndexNodes); |
| | | nodes.add(vlvIndexNodes); |
| | | |
| | |
| | | |
| | | private void deleteClicked() |
| | | { |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | TreePath[] paths = treePane.getTree().getSelectionPaths(); |
| | | ArrayList<AbstractIndexDescriptor> indexesToDelete = |
| | | new ArrayList<AbstractIndexDescriptor>(); |
| | | ArrayList<String> indexesNames = new ArrayList<String>(); |
| | | ArrayList<AbstractIndexDescriptor> indexesToDelete = new ArrayList<>(); |
| | | ArrayList<String> indexesNames = new ArrayList<>(); |
| | | if (paths != null) |
| | | { |
| | | for (TreePath path : paths) |
| | |
| | | } |
| | | } |
| | | |
| | | private HashMap<Object, ImageIcon> hmCategoryImages = |
| | | new HashMap<Object, ImageIcon>(); |
| | | private HashMap<Class<?>, ImageIcon> hmImages = |
| | | new HashMap<Class<?>, ImageIcon>(); |
| | | private HashMap<Object, ImageIcon> hmCategoryImages = new HashMap<>(); |
| | | private HashMap<Class<?>, ImageIcon> hmImages = new HashMap<>(); |
| | | { |
| | | Object[] nodes = {standardIndexes, vlvIndexes}; |
| | | String[] paths = {"ds-idx-folder.png", "ds-vlv-idx-folder.png"}; |
| | |
| | | |
| | | Comparator<String> lowerCaseComparator = new LowerCaseComparator(); |
| | | |
| | | TreeSet<String> standardOcNames = new TreeSet<String>(lowerCaseComparator); |
| | | HashMap<String, StandardObjectClassTreeNode> hmStandardOcs = |
| | | new HashMap<String, StandardObjectClassTreeNode>(); |
| | | TreeSet<String> configurationOcNames = |
| | | new TreeSet<String>(lowerCaseComparator); |
| | | HashMap<String, ConfigurationObjectClassTreeNode> hmConfigurationOcs = |
| | | new HashMap<String, ConfigurationObjectClassTreeNode>(); |
| | | TreeSet<String> customOcNames = new TreeSet<String>(lowerCaseComparator); |
| | | HashMap<String, CustomObjectClassTreeNode> hmCustomOcs = |
| | | new HashMap<String, CustomObjectClassTreeNode>(); |
| | | TreeSet<String> standardOcNames = new TreeSet<>(lowerCaseComparator); |
| | | HashMap<String, StandardObjectClassTreeNode> hmStandardOcs = new HashMap<>(); |
| | | TreeSet<String> configurationOcNames = new TreeSet<>(lowerCaseComparator); |
| | | HashMap<String, ConfigurationObjectClassTreeNode> hmConfigurationOcs = new HashMap<>(); |
| | | TreeSet<String> customOcNames = new TreeSet<>(lowerCaseComparator); |
| | | HashMap<String, CustomObjectClassTreeNode> hmCustomOcs = new HashMap<>(); |
| | | for (ObjectClass oc : lastSchema.getObjectClasses().values()) |
| | | { |
| | | if (mustAdd(oc)) |
| | |
| | | } |
| | | |
| | | |
| | | TreeSet<String> standardAttrNames = |
| | | new TreeSet<String>(lowerCaseComparator); |
| | | HashMap<String, StandardAttributeTreeNode> hmStandardAttrs = |
| | | new HashMap<String, StandardAttributeTreeNode>(); |
| | | TreeSet<String> configurationAttrNames = |
| | | new TreeSet<String>(lowerCaseComparator); |
| | | HashMap<String, ConfigurationAttributeTreeNode> hmConfigurationAttrs = |
| | | new HashMap<String, ConfigurationAttributeTreeNode>(); |
| | | TreeSet<String> customAttrNames = new TreeSet<String>(lowerCaseComparator); |
| | | HashMap<String, CustomAttributeTreeNode> hmCustomAttrs = |
| | | new HashMap<String, CustomAttributeTreeNode>(); |
| | | TreeSet<String> standardAttrNames = new TreeSet<>(lowerCaseComparator); |
| | | HashMap<String, StandardAttributeTreeNode> hmStandardAttrs = new HashMap<>(); |
| | | TreeSet<String> configurationAttrNames = new TreeSet<>(lowerCaseComparator); |
| | | HashMap<String, ConfigurationAttributeTreeNode> hmConfigurationAttrs = new HashMap<>(); |
| | | TreeSet<String> customAttrNames = new TreeSet<>(lowerCaseComparator); |
| | | HashMap<String, CustomAttributeTreeNode> hmCustomAttrs = new HashMap<>(); |
| | | for (AttributeType attr : lastSchema.getAttributeTypes().values()) |
| | | { |
| | | if (mustAdd(attr)) |
| | |
| | | } |
| | | } |
| | | |
| | | TreeSet<String> matchingRuleNames = |
| | | new TreeSet<String>(lowerCaseComparator); |
| | | HashMap<String, MatchingRuleTreeNode> hmMatchingRules = |
| | | new HashMap<String, MatchingRuleTreeNode>(); |
| | | TreeSet<String> matchingRuleNames = new TreeSet<>(lowerCaseComparator); |
| | | HashMap<String, MatchingRuleTreeNode> hmMatchingRules = new HashMap<>(); |
| | | for (MatchingRule matchingRule : lastSchema.getMatchingRules().values()) |
| | | { |
| | | if (mustAdd(matchingRule)) |
| | |
| | | } |
| | | } |
| | | |
| | | TreeSet<String> syntaxNames = new TreeSet<String>(lowerCaseComparator); |
| | | HashMap<String, AttributeSyntaxTreeNode> hmSyntaxes = |
| | | new HashMap<String, AttributeSyntaxTreeNode>(); |
| | | TreeSet<String> syntaxNames = new TreeSet<>(lowerCaseComparator); |
| | | HashMap<String, AttributeSyntaxTreeNode> hmSyntaxes = new HashMap<>(); |
| | | for (AttributeSyntax<?> syntax : lastSchema.getSyntaxes().values()) |
| | | { |
| | | if (mustAdd(syntax)) |
| | |
| | | } |
| | | |
| | | |
| | | ArrayList<TreeSet<String>> names = new ArrayList<TreeSet<String>>(); |
| | | ArrayList<TreeSet<String>> names = new ArrayList<>(); |
| | | names.add(standardOcNames); |
| | | names.add(standardAttrNames); |
| | | names.add(customOcNames); |
| | |
| | | names.add(matchingRuleNames); |
| | | names.add(syntaxNames); |
| | | |
| | | ArrayList<HashMap<String, ? extends DefaultMutableTreeNode>> nodes = |
| | | new ArrayList<HashMap<String, ? extends DefaultMutableTreeNode>>(); |
| | | ArrayList<HashMap<String, ? extends DefaultMutableTreeNode>> nodes = new ArrayList<>(); |
| | | nodes.add(hmStandardOcs); |
| | | nodes.add(hmStandardAttrs); |
| | | nodes.add(hmCustomOcs); |
| | |
| | | String f = filter.getText().trim(); |
| | | boolean filterProvided = f.length() > 0; |
| | | |
| | | ArrayList<TreePath> toExpand = new ArrayList<TreePath>(); |
| | | ArrayList<TreePath> toExpand = new ArrayList<>(); |
| | | |
| | | int i = 0; |
| | | int positionUnderRoot = 0; |
| | |
| | | |
| | | private void deleteClicked() |
| | | { |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | TreePath[] paths = treePane.getTree().getSelectionPaths(); |
| | | ArrayList<ObjectClass> ocsToDelete = new ArrayList<ObjectClass>(); |
| | | ArrayList<AttributeType> attrsToDelete = new ArrayList<AttributeType>(); |
| | | ArrayList<ObjectClass> ocsToDelete = new ArrayList<>(); |
| | | ArrayList<AttributeType> attrsToDelete = new ArrayList<>(); |
| | | if (paths != null) |
| | | { |
| | | for (TreePath path : paths) |
| | |
| | | } |
| | | if (errors.isEmpty()) |
| | | { |
| | | ArrayList<String> allNames = new ArrayList<String>(); |
| | | ArrayList<String> allNames = new ArrayList<>(); |
| | | if (displayConfirmationDialog( |
| | | INFO_CTRL_PANEL_CONFIRMATION_REQUIRED_SUMMARY.get(), |
| | | confirmationMessage)) |
| | |
| | | |
| | | private boolean mustAdd(String name, String oid, String primaryName, Iterable<String> names) |
| | | { |
| | | ArrayList<String> values = new ArrayList<String>(); |
| | | ArrayList<String> values = new ArrayList<>(); |
| | | values.add(oid); |
| | | if (primaryName != null) |
| | | { |
| | |
| | | |
| | | private boolean mustAdd(String f, String oid, String name) |
| | | { |
| | | ArrayList<String> values = new ArrayList<String>(2); |
| | | ArrayList<String> values = new ArrayList<>(2); |
| | | values.add(oid); |
| | | if (name != null) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | private HashMap<Object, ImageIcon> hmCategoryImages = |
| | | new HashMap<Object, ImageIcon>(); |
| | | private HashMap<Class<?>, ImageIcon> hmImages = |
| | | new HashMap<Class<?>, ImageIcon>(); |
| | | private HashMap<Object, ImageIcon> hmCategoryImages = new HashMap<>(); |
| | | private HashMap<Class<?>, ImageIcon> hmImages = new HashMap<>(); |
| | | { |
| | | Object[] nodes = {attributes, objectClasses, standardObjectClasses, |
| | | standardAttributes, configurationObjectClasses, configurationAttributes, |
| | |
| | | private LinkedHashSet<ObjectClass> getOrderedObjectClassesToDelete( |
| | | Collection<ObjectClass> ocsToDelete) |
| | | { |
| | | ArrayList<ObjectClass> lOrderedOcs = new ArrayList<ObjectClass>(); |
| | | // Reorder objectClasses and attributes to delete them in the proper |
| | | // order. |
| | | ArrayList<ObjectClass> lOrderedOcs = new ArrayList<>(); |
| | | // Reorder objectClasses and attributes to delete them in the proper order. |
| | | for (ObjectClass oc : ocsToDelete) |
| | | { |
| | | int index = -1; |
| | |
| | | lOrderedOcs.add(index, oc); |
| | | } |
| | | } |
| | | return new LinkedHashSet<ObjectClass>(lOrderedOcs); |
| | | return new LinkedHashSet<>(lOrderedOcs); |
| | | } |
| | | |
| | | private LinkedHashSet<AttributeType> getOrderedAttributesToDelete( |
| | | Collection<AttributeType> attrsToDelete) |
| | | { |
| | | ArrayList<AttributeType> lOrderedAttributes = |
| | | new ArrayList<AttributeType>(); |
| | | ArrayList<AttributeType> lOrderedAttributes = new ArrayList<>(); |
| | | for (AttributeType attr : attrsToDelete) |
| | | { |
| | | int index = -1; |
| | |
| | | lOrderedAttributes.add(index, attr); |
| | | } |
| | | } |
| | | return new LinkedHashSet<AttributeType>(lOrderedAttributes); |
| | | return new LinkedHashSet<>(lOrderedAttributes); |
| | | } |
| | | |
| | | private LocalizableMessage getConfirmationMessage( |
| | |
| | | Collection<AttributeType> attrsToDelete, |
| | | Schema schema) |
| | | { |
| | | ArrayList<ObjectClass> childClasses = new ArrayList<ObjectClass>(); |
| | | ArrayList<ObjectClass> childClasses = new ArrayList<>(); |
| | | // Analyze objectClasses |
| | | for (ObjectClass objectClass : ocsToDelete) |
| | | { |
| | |
| | | childClasses.removeAll(ocsToDelete); |
| | | } |
| | | |
| | | ArrayList<AttributeType> childAttributes = new ArrayList<AttributeType>(); |
| | | TreeSet<String> dependentClasses = new TreeSet<String>(); |
| | | ArrayList<AttributeType> childAttributes = new ArrayList<>(); |
| | | TreeSet<String> dependentClasses = new TreeSet<>(); |
| | | // Analyze attributes |
| | | for (AttributeType attribute : attrsToDelete) |
| | | { |
| | |
| | | LocalizableMessageBuilder mb = new LocalizableMessageBuilder(); |
| | | if (!childClasses.isEmpty()) |
| | | { |
| | | TreeSet<String> childNames = new TreeSet<String>(); |
| | | TreeSet<String> childNames = new TreeSet<>(); |
| | | for (ObjectClass oc : childClasses) |
| | | { |
| | | childNames.add(oc.getNameOrOID()); |
| | |
| | | } |
| | | if (!childAttributes.isEmpty()) |
| | | { |
| | | TreeSet<String> childNames = new TreeSet<String>(); |
| | | TreeSet<String> childNames = new TreeSet<>(); |
| | | for (AttributeType attr : childAttributes) |
| | | { |
| | | childNames.add(attr.getNameOrOID()); |
| | |
| | | mb.append("<br>"); |
| | | } |
| | | |
| | | ArrayList<String> allNames = new ArrayList<String>(); |
| | | ArrayList<String> allNames = new ArrayList<>(); |
| | | for (ObjectClass ocToDelete : ocsToDelete) |
| | | { |
| | | allNames.add(ocToDelete.getNameOrOID()); |
| | |
| | | |
| | | private ConnectionHandlerMonitoringMenuBar menuBar; |
| | | |
| | | private LinkedHashSet<MonitoringAttributes> chOperations = |
| | | new LinkedHashSet<MonitoringAttributes>(); |
| | | private LinkedHashSet<MonitoringAttributes> chOperations = new LinkedHashSet<>(); |
| | | { |
| | | chOperations.add(BasicMonitoringAttributes.ADD_REQUESTS); |
| | | chOperations.add(BasicMonitoringAttributes.BIND_REQUESTS); |
| | |
| | | chOperations.add(BasicMonitoringAttributes.MOD_DN_REQUESTS); |
| | | chOperations.add(BasicMonitoringAttributes.SEARCH_REQUESTS); |
| | | } |
| | | private LinkedHashSet<MonitoringAttributes> allowedChOperations = |
| | | new LinkedHashSet<MonitoringAttributes>(); |
| | | private LinkedHashSet<MonitoringAttributes> allowedChOperations = new LinkedHashSet<>(); |
| | | { |
| | | allowedChOperations.addAll(chOperations); |
| | | allowedChOperations.add(BasicMonitoringAttributes.ADD_RESPONSES); |
| | |
| | | "Third Connection Handler", "Fourth Connection Handler", |
| | | "Fifth Connection Handler", "Connection Handler with a long name"}; |
| | | |
| | | Set<ConnectionHandlerDescriptor> fakeData = |
| | | new HashSet<ConnectionHandlerDescriptor>(); |
| | | Set<ConnectionHandlerDescriptor> fakeData = new HashSet<>(); |
| | | connectionHandlersTableModel.setAttributes(chOperations, false); |
| | | try |
| | | { |
| | | Set<InetAddress> addresses = new HashSet<InetAddress>(); |
| | | Set<InetAddress> addresses = new HashSet<>(); |
| | | addresses.add(InetAddress.getLocalHost()); |
| | | Set<CustomSearchResult> emptySet = Collections.emptySet(); |
| | | for (String name : names) |
| | |
| | | public void configurationChanged(ConfigurationChangeEvent ev) |
| | | { |
| | | final ServerDescriptor server = ev.getNewDescriptor(); |
| | | LinkedHashSet<Object> newElements = new LinkedHashSet<Object>(); |
| | | LinkedHashSet<Object> newElements = new LinkedHashSet<>(); |
| | | |
| | | newElements.add(new CategorizedComboBoxElement(ALL_CONNECTION_HANDLERS, |
| | | CategorizedComboBoxElement.Type.REGULAR)); |
| | | Set<ConnectionHandlerDescriptor> chs = server.getConnectionHandlers(); |
| | | |
| | | SortedSet<ConnectionHandlerDescriptor> sortedChs = |
| | | new TreeSet<ConnectionHandlerDescriptor>( |
| | | new TreeSet<>( |
| | | new Comparator<ConnectionHandlerDescriptor>() |
| | | { |
| | | public int compare(ConnectionHandlerDescriptor desc1, |
| | |
| | | private Set<ConnectionHandlerDescriptor> getFilteredConnectionHandlers( |
| | | ServerDescriptor server) |
| | | { |
| | | Set<ConnectionHandlerDescriptor> cchs = |
| | | new HashSet<ConnectionHandlerDescriptor>(); |
| | | Set<ConnectionHandlerDescriptor> cchs = new HashSet<>(); |
| | | if (server != null) |
| | | { |
| | | Object o = connectionHandlers.getSelectedItem(); |
| | |
| | | private JList requiredBy = new JList(new DefaultListModel()); |
| | | private JList optionalBy = new JList(new DefaultListModel()); |
| | | |
| | | private Set<String> lastAliases = new LinkedHashSet<String>(); |
| | | private Set<String> lastAliases = new LinkedHashSet<>(); |
| | | |
| | | private LocalizableMessage NO_PARENT = INFO_CTRL_PANEL_NO_PARENT_FOR_ATTRIBUTE.get(); |
| | | private LocalizableMessage NO_MATCHING_RULE = |
| | |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | saveChanges(false, errors); |
| | | } |
| | | }); |
| | |
| | | result = unsavedChangesDlg.getResult(); |
| | | if (result == UnsavedChangesDialog.Result.SAVE) |
| | | { |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | saveChanges(true, errors); |
| | | if (!errors.isEmpty()) |
| | | { |
| | |
| | | } |
| | | |
| | | Comparator<String> lowerCaseComparator = new LowerCaseComparator(); |
| | | SortedSet<String> requiredByOcs = new TreeSet<String>(lowerCaseComparator); |
| | | SortedSet<String> requiredByOcs = new TreeSet<>(lowerCaseComparator); |
| | | for (ObjectClass oc : schema.getObjectClasses().values()) |
| | | { |
| | | if (oc.getRequiredAttributeChain().contains(attr)) |
| | |
| | | model.addElement(oc); |
| | | } |
| | | |
| | | SortedSet<String> optionalByOcs = new TreeSet<String>(lowerCaseComparator); |
| | | SortedSet<String> optionalByOcs = new TreeSet<>(lowerCaseComparator); |
| | | for (ObjectClass oc : schema.getObjectClasses().values()) |
| | | { |
| | | if (oc.getOptionalAttributeChain().contains(attr)) |
| | |
| | | @Override |
| | | public void configurationChanged(ConfigurationChangeEvent ev) |
| | | { |
| | | ArrayList<AttributeSyntax<?>> newSyntaxes = |
| | | new ArrayList<AttributeSyntax<?>>(); |
| | | ArrayList<AttributeSyntax<?>> newSyntaxes = new ArrayList<>(); |
| | | |
| | | final ServerDescriptor desc = ev.getNewDescriptor(); |
| | | Schema s = desc.getSchema(); |
| | |
| | | if (schemaChanged) |
| | | { |
| | | schema = s; |
| | | HashMap<String, AttributeSyntax<?>> syntaxNameMap = new HashMap<String, |
| | | AttributeSyntax<?>>(); |
| | | HashMap<String, AttributeSyntax<?>> syntaxNameMap = new HashMap<>(); |
| | | for (String key : schema.getSyntaxes().keySet()) |
| | | { |
| | | AttributeSyntax<?> syntax = schema.getSyntax(key); |
| | |
| | | syntaxNameMap.put(name, syntax); |
| | | } |
| | | |
| | | SortedSet<String> orderedKeys = |
| | | new TreeSet<String>(new LowerCaseComparator()); |
| | | SortedSet<String> orderedKeys = new TreeSet<>(new LowerCaseComparator()); |
| | | orderedKeys.addAll(syntaxNameMap.keySet()); |
| | | for (String key : orderedKeys) |
| | | { |
| | |
| | | updateComboBoxModel(newSyntaxes, |
| | | ((DefaultComboBoxModel)syntax.getModel())); |
| | | |
| | | HashMap<String, AttributeType> attributeNameMap = new HashMap<String, |
| | | AttributeType>(); |
| | | HashMap<String, AttributeType> attributeNameMap = new HashMap<>(); |
| | | for (String key : schema.getAttributeTypes().keySet()) |
| | | { |
| | | AttributeType attr = schema.getAttributeType(key); |
| | |
| | | } |
| | | orderedKeys.clear(); |
| | | orderedKeys.addAll(attributeNameMap.keySet()); |
| | | ArrayList<Object> newParents = new ArrayList<Object>(); |
| | | ArrayList<Object> newParents = new ArrayList<>(); |
| | | for (String key : orderedKeys) |
| | | { |
| | | newParents.add(attributeNameMap.get(key)); |
| | |
| | | updateComboBoxModel(newParents, |
| | | ((DefaultComboBoxModel)parent.getModel())); |
| | | |
| | | ArrayList<MatchingRule> approximateElements = |
| | | new ArrayList<MatchingRule>(); |
| | | ArrayList<MatchingRule> equalityElements = new ArrayList<MatchingRule>(); |
| | | ArrayList<MatchingRule> orderingElements = new ArrayList<MatchingRule>(); |
| | | ArrayList<MatchingRule> substringElements = new ArrayList<MatchingRule>(); |
| | | ArrayList<MatchingRule> approximateElements = new ArrayList<>(); |
| | | ArrayList<MatchingRule> equalityElements = new ArrayList<>(); |
| | | ArrayList<MatchingRule> orderingElements = new ArrayList<>(); |
| | | ArrayList<MatchingRule> substringElements = new ArrayList<>(); |
| | | |
| | | HashMap<String, MatchingRule> matchingRuleNameMap = new HashMap<String, |
| | | MatchingRule>(); |
| | | HashMap<String, MatchingRule> matchingRuleNameMap = new HashMap<>(); |
| | | for (String key : schema.getMatchingRules().keySet()) |
| | | { |
| | | MatchingRule rule = schema.getMatchingRule(key); |
| | |
| | | } |
| | | } |
| | | JComboBox[] combos = {approximate, equality, ordering, substring}; |
| | | ArrayList<ArrayList<MatchingRule>> ruleNames = |
| | | new ArrayList<ArrayList<MatchingRule>>(); |
| | | ArrayList<ArrayList<MatchingRule>> ruleNames = new ArrayList<>(); |
| | | ruleNames.add(approximateElements); |
| | | ruleNames.add(equalityElements); |
| | | ruleNames.add(orderingElements); |
| | |
| | | |
| | | private void deleteAttribute() |
| | | { |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | Schema schema = getInfo().getServerDescriptor().getSchema(); |
| | | ProgressDialog dlg = new ProgressDialog( |
| | | Utilities.createFrame(), |
| | | Utilities.getParentDialog(this), |
| | | INFO_CTRL_PANEL_DELETE_ATTRIBUTE_TITLE.get(), getInfo()); |
| | | |
| | | LinkedHashSet<AttributeType> attrsToDelete = |
| | | new LinkedHashSet<AttributeType>(1); |
| | | LinkedHashSet<AttributeType> attrsToDelete = new LinkedHashSet<>(1); |
| | | attrsToDelete.add(attribute); |
| | | |
| | | Task newTask = new DeleteSchemaElementsTask(getInfo(), dlg, |
| | |
| | | { |
| | | task.canLaunch(newTask, errors); |
| | | } |
| | | TreeSet<String> childAttributes = new TreeSet<String>(); |
| | | TreeSet<String> dependentClasses = new TreeSet<String>(); |
| | | TreeSet<String> childAttributes = new TreeSet<>(); |
| | | TreeSet<String> dependentClasses = new TreeSet<>(); |
| | | if (schema != null) |
| | | { |
| | | for (AttributeType attr : schema.getAttributeTypes().values()) |
| | |
| | | |
| | | private ArrayList<String> getAliases() |
| | | { |
| | | ArrayList<String> al = new ArrayList<String>(); |
| | | ArrayList<String> al = new ArrayList<>(); |
| | | String s = aliases.getText().trim(); |
| | | if (s.length() > 0) |
| | | { |
| | |
| | | |
| | | private ArrayList<String> getAllNames() |
| | | { |
| | | ArrayList<String> al = new ArrayList<String>(); |
| | | ArrayList<String> al = new ArrayList<>(); |
| | | al.add(getAttributeName()); |
| | | al.addAll(getAliases()); |
| | | return al; |
| | |
| | | |
| | | private Map<String, List<String>> getExtraProperties() |
| | | { |
| | | Map<String, List<String>> map = new HashMap<String, List<String>>(); |
| | | Map<String, List<String>> map = new HashMap<>(); |
| | | String f = file.getText().trim(); |
| | | if (f.length() > 0) |
| | | { |
| | | ArrayList<String> list = new ArrayList<String>(); |
| | | ArrayList<String> list = new ArrayList<>(); |
| | | list.add(f); |
| | | map.put(ServerConstants.SCHEMA_PROPERTY_FILENAME, list); |
| | | } |
| | | String or = origin.getText().trim(); |
| | | if (or.length() > 0) |
| | | { |
| | | ArrayList<String> list = new ArrayList<String>(); |
| | | ArrayList<String> list = new ArrayList<>(); |
| | | list.add(or); |
| | | map.put(ServerConstants.SCHEMA_PROPERTY_ORIGIN, list); |
| | | } |
| | |
| | | private JLabel lAttributes = Utilities.createPrimaryLabel( |
| | | INFO_CTRL_PANEL_OBJECTCLASS_ATTRIBUTES_LABEL.get()); |
| | | |
| | | private Set<AttributeType> inheritedOptionalAttributes = |
| | | new HashSet<AttributeType>(); |
| | | private Set<AttributeType> inheritedRequiredAttributes = |
| | | new HashSet<AttributeType>(); |
| | | private Set<AttributeType> inheritedOptionalAttributes = new HashSet<>(); |
| | | private Set<AttributeType> inheritedRequiredAttributes = new HashSet<>(); |
| | | |
| | | private JLabel[] labels = {lName, lSuperior, lOID, lAliases, lOrigin, lFile, |
| | | lDescription, lType, lAttributes |
| | |
| | | private DoubleAddRemovePanel<AttributeType> attributes; |
| | | |
| | | private Schema schema; |
| | | private Set<String> lastAliases = new LinkedHashSet<String>(); |
| | | private Set<String> lastAliases = new LinkedHashSet<>(); |
| | | |
| | | private boolean ignoreChangeEvents; |
| | | |
| | |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | saveChanges(false, errors); |
| | | } |
| | | }); |
| | |
| | | SchemaElementComboBoxCellRenderer(type); |
| | | type.setRenderer(renderer); |
| | | |
| | | attributes = |
| | | new DoubleAddRemovePanel<AttributeType>(0, AttributeType.class); |
| | | attributes = new DoubleAddRemovePanel<>(0, AttributeType.class); |
| | | Comparator<AttributeType> comparator = new Comparator<AttributeType>() |
| | | { |
| | | /** {@inheritDoc} */ |
| | |
| | | result = unsavedChangesDlg.getResult(); |
| | | if (result == UnsavedChangesDialog.Result.SAVE) |
| | | { |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | saveChanges(true, errors); |
| | | if (!errors.isEmpty()) |
| | | { |
| | |
| | | |
| | | private void deleteObjectclass() |
| | | { |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | ProgressDialog dlg = new ProgressDialog( |
| | | Utilities.createFrame(), |
| | | Utilities.getParentDialog(this), |
| | | INFO_CTRL_PANEL_DELETE_OBJECTCLASS_TITLE.get(), getInfo()); |
| | | LinkedHashSet<ObjectClass> ocsToDelete = new LinkedHashSet<ObjectClass>(); |
| | | LinkedHashSet<ObjectClass> ocsToDelete = new LinkedHashSet<>(); |
| | | ocsToDelete.add(objectClass); |
| | | LinkedHashSet<AttributeType> attrsToDelete = |
| | | new LinkedHashSet<AttributeType>(0); |
| | | LinkedHashSet<AttributeType> attrsToDelete = new LinkedHashSet<>(0); |
| | | |
| | | DeleteSchemaElementsTask newTask = new DeleteSchemaElementsTask(getInfo(), |
| | | dlg, ocsToDelete, attrsToDelete); |
| | |
| | | task.canLaunch(newTask, errors); |
| | | } |
| | | Schema schema = getInfo().getServerDescriptor().getSchema(); |
| | | ArrayList<String> childClasses = new ArrayList<String>(); |
| | | ArrayList<String> childClasses = new ArrayList<>(); |
| | | if (schema != null) |
| | | { |
| | | for (ObjectClass o : schema.getObjectClasses().values()) |
| | |
| | | |
| | | private Set<String> getAliases() |
| | | { |
| | | Set<String> al = new LinkedHashSet<String>(); |
| | | Set<String> al = new LinkedHashSet<>(); |
| | | String s = aliases.getText().trim(); |
| | | if (s.length() > 0) |
| | | { |
| | |
| | | |
| | | private Map<String, List<String>> getExtraProperties() |
| | | { |
| | | Map<String, List<String>> map = new HashMap<String, List<String>>(); |
| | | Map<String, List<String>> map = new HashMap<>(); |
| | | String f = file.getText().trim(); |
| | | if (f.length() > 0) |
| | | { |
| | | ArrayList<String> list = new ArrayList<String>(); |
| | | ArrayList<String> list = new ArrayList<>(); |
| | | list.add(f); |
| | | map.put(ServerConstants.SCHEMA_PROPERTY_FILENAME, list); |
| | | } |
| | | String or = origin.getText().trim(); |
| | | if (or.length() > 0) |
| | | { |
| | | ArrayList<String> list = new ArrayList<String>(); |
| | | ArrayList<String> list = new ArrayList<>(); |
| | | list.add(or); |
| | | map.put(ServerConstants.SCHEMA_PROPERTY_ORIGIN, list); |
| | | } |
| | |
| | | |
| | | private ArrayList<String> getAllNames() |
| | | { |
| | | ArrayList<String> al = new ArrayList<String>(); |
| | | ArrayList<String> al = new ArrayList<>(); |
| | | al.add(getObjectClassName()); |
| | | al.addAll(getAliases()); |
| | | return al; |
| | |
| | | |
| | | private Set<AttributeType> intersect(Set<AttributeType> set1, Set<AttributeType> set2) |
| | | { |
| | | HashSet<AttributeType> attrs = new HashSet<AttributeType>(set1); |
| | | HashSet<AttributeType> attrs = new HashSet<>(set1); |
| | | attrs.removeAll(set2); |
| | | return attrs; |
| | | } |
| | |
| | | attributes.getAvailableListModel().addAll(allAttrs); |
| | | |
| | | |
| | | HashSet<AttributeType> toDelete = new HashSet<AttributeType>(); |
| | | HashSet<AttributeType> toDelete = new HashSet<>(); |
| | | for (AttributeType attr : attributes.getSelectedListModel1().getData()) |
| | | { |
| | | if (!allAttrs.contains(attr)) |
| | |
| | | attributes.getSelectedListModel1().remove(attr); |
| | | } |
| | | |
| | | toDelete = new HashSet<AttributeType>(); |
| | | toDelete = new HashSet<>(); |
| | | for (AttributeType attr : attributes.getSelectedListModel2().getData()) |
| | | { |
| | | if (!allAttrs.contains(attr)) |
| | |
| | | { |
| | | if (sel != null) |
| | | { |
| | | ArrayList<Integer> indexes = new ArrayList<Integer>(); |
| | | ArrayList<Integer> indexes = new ArrayList<>(); |
| | | for (int element : sel) |
| | | { |
| | | if (element < lists[i].getModel().getSize()) |
| | |
| | | attributes.getSelectedListModel2().add(attr); |
| | | } |
| | | |
| | | Collection<AttributeType> unmovableItems = |
| | | new ArrayList<AttributeType>(inheritedRequiredAttributes); |
| | | Collection<AttributeType> unmovableItems = new ArrayList<>(inheritedRequiredAttributes); |
| | | unmovableItems.addAll(inheritedOptionalAttributes); |
| | | attributes.setUnmovableItems(unmovableItems); |
| | | |
| | |
| | | private JLabel noMonitoringFound; |
| | | private JButton showOperations; |
| | | |
| | | private LinkedHashSet<String> attributes = new LinkedHashSet<String>(); |
| | | private LinkedHashSet<String> allAttributes = new LinkedHashSet<String>(); |
| | | private LinkedHashSet<String> attributes = new LinkedHashSet<>(); |
| | | private LinkedHashSet<String> allAttributes = new LinkedHashSet<>(); |
| | | |
| | | private MonitoringAttributesViewPanel<String> operationViewPanel; |
| | | private GenericDialog operationViewDlg; |
| | |
| | | { |
| | | server = getInfo().getServerDescriptor(); |
| | | } |
| | | Set<BackendDescriptor> dbBackends = new HashSet<BackendDescriptor>(); |
| | | Set<BackendDescriptor> dbBackends = new HashSet<>(); |
| | | boolean updateAttributes = allAttributes.isEmpty(); |
| | | SortedSet<String> sortedAttrNames = new TreeSet<String>(); |
| | | SortedSet<String> sortedAttrNames = new TreeSet<>(); |
| | | if (server != null) |
| | | { |
| | | for (BackendDescriptor backend : server.getBackends()) |
| | |
| | | |
| | | private Set<String> getMonitoringAttributes(BackendDescriptor backend) |
| | | { |
| | | Set<String> attrNames = new HashSet<String>(); |
| | | Set<String> attrNames = new HashSet<>(); |
| | | if (backend.getMonitoringEntry() != null) |
| | | { |
| | | Set<String> allNames = backend.getMonitoringEntry().getAttributeNames(); |
| | |
| | | public void configurationChanged(ConfigurationChangeEvent ev) |
| | | { |
| | | ServerDescriptor desc = ev.getNewDescriptor(); |
| | | final SortedSet<String> newElements = new TreeSet<String>(); |
| | | final SortedSet<String> newElements = new TreeSet<>(); |
| | | for (BackendDescriptor backend : desc.getBackends()) |
| | | { |
| | | if (!backend.isConfigBackend()) |
| | |
| | | /** {@inheritDoc} */ |
| | | public void okClicked() |
| | | { |
| | | final LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<LocalizableMessage>(); |
| | | final LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<>(); |
| | | ProgressDialog progressDialog = new ProgressDialog( |
| | | Utilities.createFrame(), |
| | | Utilities.getParentDialog(this), getTitle(), getInfo()); |
| | | @SuppressWarnings("deprecation") |
| | | Object[] backends = list.getSelectedValues(); |
| | | ArrayList<BackendDescriptor> backendsToDelete = |
| | | new ArrayList<BackendDescriptor>(); |
| | | ArrayList<BackendDescriptor> backendsToDelete = new ArrayList<>(); |
| | | for (Object o : backends) |
| | | { |
| | | String id = (String)o; |
| | |
| | | { |
| | | @SuppressWarnings("deprecation") |
| | | Object[] s = list.getSelectedValues(); |
| | | Set<Object> selected = new HashSet<Object>(); |
| | | Set<Object> selected = new HashSet<>(); |
| | | if (s != null) |
| | | { |
| | | for (Object o : s) |
| | |
| | | } |
| | | final DefaultListModel model = (DefaultListModel)list.getModel(); |
| | | model.clear(); |
| | | SortedSet<Integer> indices = new TreeSet<Integer>(); |
| | | SortedSet<Integer> indices = new TreeSet<>(); |
| | | int i = 0; |
| | | for (Object newElement : newElements) |
| | | { |
| | |
| | | public void configurationChanged(ConfigurationChangeEvent ev) |
| | | { |
| | | ServerDescriptor desc = ev.getNewDescriptor(); |
| | | final SortedSet<DN> newElements = new TreeSet<DN>(); |
| | | final SortedSet<DN> newElements = new TreeSet<>(); |
| | | for (BackendDescriptor backend : desc.getBackends()) |
| | | { |
| | | if (!backend.isConfigBackend()) |
| | |
| | | /** {@inheritDoc} */ |
| | | public void okClicked() |
| | | { |
| | | final LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<LocalizableMessage>(); |
| | | final LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<>(); |
| | | ProgressDialog progressDialog = new ProgressDialog( |
| | | Utilities.createFrame(), |
| | | Utilities.getParentDialog(this), getTitle(), getInfo()); |
| | | @SuppressWarnings("deprecation") |
| | | Object[] dns = list.getSelectedValues(); |
| | | ArrayList<BaseDNDescriptor> baseDNsToDelete = |
| | | new ArrayList<BaseDNDescriptor>(); |
| | | ArrayList<BaseDNDescriptor> baseDNsToDelete = new ArrayList<>(); |
| | | for (Object o : dns) |
| | | { |
| | | DN dn = (DN)o; |
| | |
| | | Collection<BaseDNDescriptor> baseDNsToDelete) |
| | | { |
| | | LocalizableMessageBuilder mb = new LocalizableMessageBuilder(); |
| | | Map<String, Set<BaseDNDescriptor>> hmBackends = |
| | | new HashMap<String, Set<BaseDNDescriptor>>(); |
| | | Map<String, Set<BaseDNDescriptor>> hmBackends = new HashMap<>(); |
| | | for (BaseDNDescriptor baseDN : baseDNsToDelete) |
| | | { |
| | | String backendID = baseDN.getBackend().getBackendID(); |
| | | Set<BaseDNDescriptor> set = hmBackends.get(backendID); |
| | | if (set == null) |
| | | { |
| | | set = new HashSet<BaseDNDescriptor>(); |
| | | set = new HashSet<>(); |
| | | hmBackends.put(backendID, set); |
| | | } |
| | | set.add(baseDN); |
| | | } |
| | | ArrayList<String> indirectBackendsToDelete = new ArrayList<String>(); |
| | | ArrayList<String> indirectBackendsToDelete = new ArrayList<>(); |
| | | for (Set<BaseDNDescriptor> set : hmBackends.values()) |
| | | { |
| | | BackendDescriptor backend = set.iterator().next().getBackend(); |
| | |
| | | ENTRY_CACHE_TRIES, ENTRY_CACHE_HITS, ENTRY_CACHE_HIT_RATIO, CURRENT_ENTRY_CACHE_SIZE, MAX_ENTRY_CACHE_SIZE, |
| | | CURRENT_ENTRY_CACHE_COUNT, MAX_ENTRY_CACHE_COUNT)); |
| | | |
| | | private ArrayList<JLabel> monitoringLabels = new ArrayList<JLabel>(); |
| | | private ArrayList<JLabel> monitoringLabels = new ArrayList<>(); |
| | | { |
| | | for (int i=0; i<ngOperations.size(); i++) |
| | | { |
| | | monitoringLabels.add(Utilities.createDefaultLabel()); |
| | | } |
| | | } |
| | | private ArrayList<JLabel> labels = new ArrayList<JLabel>(); |
| | | private ArrayList<JLabel> labels = new ArrayList<>(); |
| | | { |
| | | for (int i=0; i<ngOperations.size(); i++) |
| | | { |
| | |
| | | setPrimaryValid(lBackend); |
| | | setPrimaryValid(lFile); |
| | | setPrimaryValid(lExportOptions); |
| | | final LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<LocalizableMessage>(); |
| | | final LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<>(); |
| | | |
| | | String backendName = (String)backends.getSelectedItem(); |
| | | if (backendName == null) |
| | |
| | | public ExportTask(ControlPanelInfo info, ProgressDialog dlg) |
| | | { |
| | | super(info, dlg); |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | backendSet.add((String)backends.getSelectedItem()); |
| | | fileName = file.getText(); |
| | | } |
| | |
| | | /** {@inheritDoc} */ |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(); |
| | | ArrayList<String> args = new ArrayList<>(); |
| | | args.add("--ldifFile"); |
| | | args.add(fileName); |
| | | args.add("--backendID"); |
| | |
| | | setPrimaryValid(lRejectsFile); |
| | | setPrimaryValid(lSkipsFile); |
| | | setPrimaryValid(lThreads); |
| | | final LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<LocalizableMessage>(); |
| | | final LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<>(); |
| | | |
| | | String backendName = (String)backends.getSelectedItem(); |
| | | if (backendName == null) |
| | |
| | | } |
| | | else if (!overwrite.isSelected() && canInitialize) |
| | | { |
| | | ArrayList<String> dns = new ArrayList<String>(); |
| | | ArrayList<String> dns = new ArrayList<>(); |
| | | for (DN dn : replicatedBaseDNs) |
| | | { |
| | | dns.add(dn.toString()); |
| | |
| | | } |
| | | else if (overwrite.isSelected() && canInitialize) |
| | | { |
| | | ArrayList<String> dns = new ArrayList<String>(); |
| | | ArrayList<String> dns = new ArrayList<>(); |
| | | for (DN dn : replicatedBaseDNs) |
| | | { |
| | | dns.add(dn.toString()); |
| | |
| | | |
| | | private Set<DN> getReplicatedBaseDNs() |
| | | { |
| | | Set<DN> baseDNs = new TreeSet<DN>(); |
| | | Set<DN> baseDNs = new TreeSet<>(); |
| | | String backendID = (String)backends.getSelectedItem(); |
| | | if (backendID != null) |
| | | { |
| | |
| | | public ImportTask(ControlPanelInfo info, ProgressDialog dlg) |
| | | { |
| | | super(info, dlg); |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | backendSet.add((String)backends.getSelectedItem()); |
| | | fileName = file.getText(); |
| | | replicatedBaseDNs = getReplicatedBaseDNs(); |
| | |
| | | @Override |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(); |
| | | ArrayList<String> args = new ArrayList<>(); |
| | | args.add("--ldifFile"); |
| | | args.add(fileName); |
| | | args.add("--backendID"); |
| | |
| | | lastException = t; |
| | | state = State.FINISHED_WITH_ERROR; |
| | | } |
| | | HashSet<BackendDescriptor> backends = new HashSet<BackendDescriptor>(); |
| | | HashSet<BackendDescriptor> backends = new HashSet<>(); |
| | | for (BackendDescriptor backend : |
| | | getInfo().getServerDescriptor().getBackends()) |
| | | { |
| | |
| | | private String getCommandLineToInitializeAll() |
| | | { |
| | | String cmdLineName = getCommandLinePath("dsreplication"); |
| | | ArrayList<String> args = new ArrayList<String>(); |
| | | ArrayList<String> args = new ArrayList<>(); |
| | | args.add( |
| | | ReplicationCliArgumentParser.INITIALIZE_ALL_REPLICATION_SUBCMD_NAME); |
| | | args.add("--hostName"); |
| | |
| | | */ |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(); |
| | | ArrayList<String> args = new ArrayList<>(); |
| | | String s = dnsToInclude.getText(); |
| | | if (s.trim().length() > 0) |
| | | { |
| | |
| | | |
| | | private void deleteIndex() |
| | | { |
| | | List<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | List<LocalizableMessage> errors = new ArrayList<>(); |
| | | ProgressDialog dlg = new ProgressDialog( |
| | | Utilities.createFrame(), |
| | | Utilities.getParentDialog(this), |
| | | INFO_CTRL_PANEL_DELETE_INDEX_TITLE.get(), getInfo()); |
| | | ArrayList<AbstractIndexDescriptor> indexesToDelete = new ArrayList<AbstractIndexDescriptor>(); |
| | | ArrayList<AbstractIndexDescriptor> indexesToDelete = new ArrayList<>(); |
| | | indexesToDelete.add(index); |
| | | DeleteIndexTask newTask = new DeleteIndexTask(getInfo(), dlg, indexesToDelete); |
| | | for (Task task : getInfo().getTasks()) |
| | |
| | | private String backendName; |
| | | private int entryLimitValue; |
| | | private IndexDescriptor indexToModify; |
| | | private SortedSet<IndexTypeDescriptor> indexTypes = new TreeSet<IndexTypeDescriptor>(); |
| | | private SortedSet<IndexTypeDescriptor> indexTypes = new TreeSet<>(); |
| | | private IndexDescriptor modifiedIndex; |
| | | |
| | | /** |
| | |
| | | { |
| | | super(info, dlg); |
| | | backendName = index.getBackend().getBackendID(); |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | backendSet.add(backendName); |
| | | attributeName = index.getName(); |
| | | entryLimitValue = Integer.parseInt(entryLimit.getText()); |
| | |
| | | /** {@inheritDoc} */ |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | return new ArrayList<String>(); |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | private List<String> getDSConfigCommandLineArguments() |
| | | { |
| | | List<String> args = new ArrayList<String>(); |
| | | List<String> args = new ArrayList<>(); |
| | | args.add("set-local-db-index-prop"); |
| | | args.add("--backend-name"); |
| | | args.add(backendName); |
| | |
| | | if (!indexTypes.equals(indexToModify.getTypes())) |
| | | { |
| | | // To add |
| | | Set<IndexTypeDescriptor> toAdd = new TreeSet<IndexTypeDescriptor>(); |
| | | Set<IndexTypeDescriptor> toAdd = new TreeSet<>(); |
| | | for (IndexTypeDescriptor newType : indexTypes) |
| | | { |
| | | if (!indexToModify.getTypes().contains(newType)) |
| | |
| | | } |
| | | } |
| | | // To delete |
| | | Set<IndexTypeDescriptor> toDelete = new TreeSet<IndexTypeDescriptor>(); |
| | | Set<IndexTypeDescriptor> toDelete = new TreeSet<>(); |
| | | for (IndexTypeDescriptor oldType : indexToModify.getTypes()) |
| | | { |
| | | if (!indexTypes.contains(oldType)) |
| | |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.guitools.controlpanel.ui; |
| | | |
| | |
| | | public class JavaInformationMonitoringPanel extends GeneralMonitoringPanel |
| | | { |
| | | private static final long serialVersionUID = 9031734563799969830L; |
| | | private List<BasicMonitoringAttributes> generalAttributes = |
| | | new ArrayList<BasicMonitoringAttributes>(); |
| | | private List<BasicMonitoringAttributes> generalAttributes = new ArrayList<>(); |
| | | { |
| | | generalAttributes.add(BasicMonitoringAttributes.JVM_VERSION); |
| | | generalAttributes.add(BasicMonitoringAttributes.JVM_VENDOR); |
| | |
| | | generalAttributes.add(BasicMonitoringAttributes.JAVA_VERSION); |
| | | generalAttributes.add(BasicMonitoringAttributes.JAVA_VENDOR); |
| | | } |
| | | private List<BasicMonitoringAttributes> extraAttributes = |
| | | new ArrayList<BasicMonitoringAttributes>(); |
| | | private List<BasicMonitoringAttributes> extraAttributes = new ArrayList<>(); |
| | | { |
| | | extraAttributes.add(BasicMonitoringAttributes.CLASS_PATH); |
| | | extraAttributes.add(BasicMonitoringAttributes.JAVA_VERSION); |
| | | extraAttributes.add(BasicMonitoringAttributes.JAVA_VENDOR); |
| | | } |
| | | private ArrayList<JComponent> generalMonitoringComps = |
| | | new ArrayList<JComponent>(); |
| | | private ArrayList<JComponent> generalMonitoringComps = new ArrayList<>(); |
| | | { |
| | | for (int i=0; i<generalAttributes.size(); i++) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | private List<String> memoryAttributes = new ArrayList<String>(); |
| | | private List<JLabel> memoryLabels = new ArrayList<JLabel>(); |
| | | private List<String> memoryAttributes = new ArrayList<>(); |
| | | private List<JLabel> memoryLabels = new ArrayList<>(); |
| | | private JPanel memoryPanel; |
| | | |
| | | /** |
| | |
| | | if (memoryAttributes.isEmpty()) |
| | | { |
| | | Set<String> allNames = csrMemory.getAttributeNames(); |
| | | SortedSet<String> sortedNames = new TreeSet<String>(); |
| | | SortedSet<String> sortedNames = new TreeSet<>(); |
| | | for (String attrName : allNames) |
| | | { |
| | | if (!OBJECTCLASS_ATTRIBUTE_TYPE_NAME.equalsIgnoreCase(attrName) |
| | |
| | | |
| | | private JCheckBox showAll; |
| | | |
| | | private Set<JavaArgumentsDescriptor> readJavaArguments = |
| | | new HashSet<JavaArgumentsDescriptor>(); |
| | | |
| | | private Set<JavaArgumentsDescriptor> currentJavaArguments = |
| | | new HashSet<JavaArgumentsDescriptor>(); |
| | | |
| | | private Set<String> allScriptNames = |
| | | new HashSet<String>(); |
| | | private Set<JavaArgumentsDescriptor> readJavaArguments = new HashSet<>(); |
| | | private Set<JavaArgumentsDescriptor> currentJavaArguments = new HashSet<>(); |
| | | private Set<String> allScriptNames = new HashSet<>(); |
| | | { |
| | | String[] names = |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | private Set<String> relevantScriptNames = |
| | | new HashSet<String>(); |
| | | |
| | | private Set<String> relevantScriptNames = new HashSet<>(); |
| | | { |
| | | String[] relevantNames = |
| | | { |
| | |
| | | p.add(inlineHelp, gbc); |
| | | |
| | | // Just to create space. |
| | | Set<JavaArgumentsDescriptor> fakeArguments = |
| | | new HashSet<JavaArgumentsDescriptor>(); |
| | | Set<JavaArgumentsDescriptor> fakeArguments = new HashSet<>(); |
| | | fakeArguments.add( |
| | | new JavaArgumentsDescriptor("start-ds", "-server -XM256j")); |
| | | fakeArguments.add( |
| | |
| | | */ |
| | | private Set<JavaArgumentsDescriptor> getCurrentJavaArguments() |
| | | { |
| | | HashSet<JavaArgumentsDescriptor> args = |
| | | new HashSet<JavaArgumentsDescriptor>(currentJavaArguments); |
| | | HashSet<JavaArgumentsDescriptor> args = new HashSet<>(currentJavaArguments); |
| | | |
| | | HashSet<JavaArgumentsDescriptor> tableArgs = |
| | | new HashSet<JavaArgumentsDescriptor>(); |
| | | HashSet<JavaArgumentsDescriptor> tableArgs = new HashSet<>(); |
| | | for (int i=0; i<argumentsTableModel.getRowCount(); i++) |
| | | { |
| | | tableArgs.add(argumentsTableModel.getJavaArguments(i)); |
| | |
| | | } |
| | | else |
| | | { |
| | | Set<JavaArgumentsDescriptor> filteredArgs = |
| | | new HashSet<JavaArgumentsDescriptor>(); |
| | | Set<JavaArgumentsDescriptor> filteredArgs = new HashSet<>(); |
| | | for (String relevantName : getRelevantCommandLineNames()) |
| | | { |
| | | for (JavaArgumentsDescriptor arg : args) |
| | |
| | | { |
| | | editor.stopCellEditing(); |
| | | |
| | | final ArrayList<LocalizableMessage> javaHomeErrors = new ArrayList<LocalizableMessage>(); |
| | | final ArrayList<LocalizableMessage> javaHomeErrors = new ArrayList<>(); |
| | | String f = javaHome.getText().trim(); |
| | | if (f.length() > 0) |
| | | { |
| | |
| | | } |
| | | if (javaHomeErrors.isEmpty()) |
| | | { |
| | | final Set<String> providedArguments = new HashSet<String>(); |
| | | final Set<String> providedArguments = new HashSet<>(); |
| | | for (JavaArgumentsDescriptor cmd : getCurrentJavaArguments()) |
| | | { |
| | | String args = cmd.getJavaArguments().trim(); |
| | |
| | | { |
| | | String[] jvms; |
| | | String userJVM = javaHome.getText(); |
| | | ArrayList<LocalizableMessage> errorMessages = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> confirmationMessages = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errorMessages = new ArrayList<>(); |
| | | ArrayList<LocalizableMessage> confirmationMessages = new ArrayList<>(); |
| | | String defaultJVM = System.getenv(SetupUtils.OPENDJ_JAVA_HOME); |
| | | if (defaultJVM == null) |
| | | { |
| | |
| | | } |
| | | for (String jvm : jvms) |
| | | { |
| | | Set<String> notWorkingArgs = new HashSet<String>(); |
| | | Set<String> notWorkingArgs = new HashSet<>(); |
| | | |
| | | String installPath = getInfo().getServerDescriptor(). |
| | | getInstallPath(); |
| | |
| | | } |
| | | else |
| | | { |
| | | ArrayList<String> s = new ArrayList<String>(); |
| | | ArrayList<String> s = new ArrayList<>(); |
| | | for (LocalizableMessage msg : javaHomeErrors) |
| | | { |
| | | s.add(msg.toString()); |
| | | } |
| | | ArrayList<LocalizableMessage> msgs = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> msgs = new ArrayList<>(); |
| | | LocalizableMessage msg = ERR_CTRL_PANEL_GENERIC_ERROR_FALLBACK_JAVAHOME.get( |
| | | f, Utilities.getStringFromCollection(s, "<br>-")); |
| | | msgs.add(msg); |
| | |
| | | |
| | | private void launchTask() |
| | | { |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | ProgressDialog dlg = new ProgressDialog( |
| | | Utilities.createFrame(), |
| | | Utilities.getParentDialog(this), |
| | |
| | | implements Comparator<JavaArgumentsDescriptor> |
| | | { |
| | | private static final long serialVersionUID = 8288418995255677560L; |
| | | private Set<JavaArgumentsDescriptor> data = |
| | | new HashSet<JavaArgumentsDescriptor>(); |
| | | private ArrayList<String[]> dataArray = |
| | | new ArrayList<String[]>(); |
| | | private ArrayList<JavaArgumentsDescriptor> argsArray = |
| | | new ArrayList<JavaArgumentsDescriptor>(); |
| | | private Set<JavaArgumentsDescriptor> data = new HashSet<>(); |
| | | private ArrayList<String[]> dataArray = new ArrayList<>(); |
| | | private ArrayList<JavaArgumentsDescriptor> argsArray = new ArrayList<>(); |
| | | private final String[] COLUMN_NAMES = new String[] { |
| | | getHeader(INFO_CTRL_PANEL_COMMAND_LINE_NAME_COLUMN.get(), 40), |
| | | getHeader(INFO_CTRL_PANEL_JAVA_ARGUMENTS_COLUMN.get(), 40)}; |
| | |
| | | |
| | | private void updateDataArray() |
| | | { |
| | | TreeSet<JavaArgumentsDescriptor> sortedSet = |
| | | new TreeSet<JavaArgumentsDescriptor>(this); |
| | | TreeSet<JavaArgumentsDescriptor> sortedSet = new TreeSet<>(this); |
| | | sortedSet.addAll(data); |
| | | dataArray.clear(); |
| | | argsArray.clear(); |
| | |
| | | private String defaultJavaHome; |
| | | private boolean overwriteOpenDSJavaHome; |
| | | private boolean overwriteOpenDSJavaArgs; |
| | | Set<JavaArgumentsDescriptor> arguments = |
| | | new HashSet<JavaArgumentsDescriptor>(); |
| | | Set<JavaArgumentsDescriptor> arguments = new HashSet<>(); |
| | | |
| | | /** |
| | | * The constructor of the task. |
| | |
| | | public JavaPropertiesTask(ControlPanelInfo info, ProgressDialog dlg) |
| | | { |
| | | super(info, dlg); |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | defaultJavaHome = javaHome.getText().trim(); |
| | | overwriteOpenDSJavaHome = useSpecifiedJavaHome.isSelected(); |
| | | overwriteOpenDSJavaArgs = useSpecifiedJavaArgs.isSelected(); |
| | |
| | | @Override |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | return new ArrayList<String>(); |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | |
| | | private int updateJavaSettings() throws IOException |
| | | { |
| | | final String propertiesFile = getPropertiesFile(); |
| | | ArrayList<String> commentLines = new ArrayList<String>(); |
| | | ArrayList<String> commentLines = new ArrayList<>(); |
| | | BufferedReader reader = null; |
| | | try |
| | | { |
| | |
| | | private void saveChanges(boolean modal) |
| | | { |
| | | newTask = null; |
| | | final ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | final ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | // Check that the entry is correct. |
| | | try |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | setPrimaryValid(portLabel); |
| | | setPrimaryValid(dnLabel); |
| | | setPrimaryValid(pwdLabel); |
| | | final LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<LocalizableMessage>(); |
| | | final LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<>(); |
| | | |
| | | boolean dnInvalid = false; |
| | | boolean pwdInvalid = false; |
| | |
| | | } |
| | | else |
| | | { |
| | | ArrayList<String> stringErrors = new ArrayList<String>(); |
| | | ArrayList<String> stringErrors = new ArrayList<>(); |
| | | for (LocalizableMessage err : errors) |
| | | { |
| | | stringErrors.add(err.toString()); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | { |
| | | setPrimaryValid(dnLabel); |
| | | setPrimaryValid(pwdLabel); |
| | | final LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<LocalizableMessage>(); |
| | | final LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<>(); |
| | | |
| | | boolean dnInvalid = false; |
| | | boolean pwdInvalid = false; |
| | |
| | | ArrayList<Category> categories = createCategories(); |
| | | ButtonGroup group = new ButtonGroup(); |
| | | int maxWidth = 0; |
| | | final Map<Action, GenericFrame> frames = |
| | | new HashMap<Action, GenericFrame>(); |
| | | ArrayList<ActionButton> actions = new ArrayList<ActionButton>(); |
| | | final Map<Action, GenericFrame> frames = new HashMap<>(); |
| | | ArrayList<ActionButton> actions = new ArrayList<>(); |
| | | for(Category category: categories) |
| | | { |
| | | JPanel categoryPanel = new JPanel(new GridBagLayout()); |
| | |
| | | */ |
| | | protected ArrayList<Category> createCategories() |
| | | { |
| | | ArrayList<Category> categories = new ArrayList<Category>(); |
| | | ArrayList<Category> categories = new ArrayList<>(); |
| | | LocalizableMessage[][] labels; |
| | | if (isWindows()) |
| | | { |
| | |
| | | } |
| | | }; |
| | | } |
| | | ArrayList<Class<? extends StatusGenericPanel>> classes = |
| | | new ArrayList<Class<? extends StatusGenericPanel>>(); |
| | | ArrayList<Class<? extends StatusGenericPanel>> classes = new ArrayList<>(); |
| | | classes.add(BrowseEntriesPanel.class); |
| | | classes.add(NewBaseDNPanel.class); |
| | | classes.add(ImportLDIFPanel.class); |
| | |
| | | */ |
| | | public void quitClicked() |
| | | { |
| | | Set<String> runningTasks = new HashSet<String>(); |
| | | Set<String> runningTasks = new HashSet<>(); |
| | | for (Task task : getInfo().getTasks()) |
| | | { |
| | | if (task.getState() == Task.State.RUNNING) |
| | |
| | | */ |
| | | protected void connectToServerClicked() |
| | | { |
| | | Set<String> runningTasks = new HashSet<String>(); |
| | | Set<String> runningTasks = new HashSet<>(); |
| | | for (Task task : getInfo().getTasks()) |
| | | { |
| | | if (task.getState() == Task.State.RUNNING) |
| | |
| | | */ |
| | | private List<TaskEntry> getSelectedTasks(boolean onlyCancelable) |
| | | { |
| | | ArrayList<TaskEntry> tasks = new ArrayList<TaskEntry>(); |
| | | ArrayList<TaskEntry> tasks = new ArrayList<>(); |
| | | int[] rows = taskTable.getSelectedRows(); |
| | | for (int row : rows) |
| | | { |
| | |
| | | */ |
| | | private Set<TaskEntry> createRandomTasksList() |
| | | { |
| | | Set<TaskEntry> list = new HashSet<TaskEntry>(); |
| | | Set<TaskEntry> list = new HashSet<>(); |
| | | Random r = new Random(); |
| | | int numberTasks = r.nextInt(10); |
| | | for (int i= 0; i<numberTasks; i++) |
| | |
| | | }; |
| | | for (int j=0; j < attrNames.length; j++) |
| | | { |
| | | List<Object> attrValues = new ArrayList<Object>(1); |
| | | List<Object> attrValues = new ArrayList<>(1); |
| | | attrValues.add(values[j] + r.nextInt()); |
| | | csr.set(attrNames[j], attrValues); |
| | | } |
| | |
| | | */ |
| | | private Set<TaskEntry> createDummyTaskList() |
| | | { |
| | | Set<TaskEntry> list = new HashSet<TaskEntry>(); |
| | | Set<TaskEntry> list = new HashSet<>(); |
| | | for (int i= 0; i<10; i++) |
| | | { |
| | | CustomSearchResult csr = |
| | |
| | | }; |
| | | for (int j=0; j < attrNames.length; j++) |
| | | { |
| | | List<Object> attrValues = new ArrayList<Object>(1); |
| | | List<Object> attrValues = new ArrayList<>(1); |
| | | attrValues.add(values[j]); |
| | | csr.set(attrNames[j], attrValues); |
| | | } |
| | |
| | | |
| | | private void cancelTaskClicked() |
| | | { |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | ProgressDialog dlg = new ProgressDialog( |
| | | Utilities.createFrame(), |
| | | Utilities.getParentDialog(this), |
| | |
| | | public static Entry getEntry(CustomSearchResult csr) throws OpenDsException |
| | | { |
| | | DN dn = DN.valueOf(csr.getDN()); |
| | | Map<ObjectClass,String> objectClasses = new HashMap<ObjectClass,String>(); |
| | | Map<AttributeType,List<Attribute>> userAttributes = |
| | | new HashMap<AttributeType,List<Attribute>>(); |
| | | Map<AttributeType,List<Attribute>> operationalAttributes = |
| | | new HashMap<AttributeType,List<Attribute>>(); |
| | | Map<ObjectClass,String> objectClasses = new HashMap<>(); |
| | | Map<AttributeType,List<Attribute>> userAttributes = new HashMap<>(); |
| | | Map<AttributeType,List<Attribute>> operationalAttributes = new HashMap<>(); |
| | | |
| | | for (String wholeName : csr.getAttributeNames()) |
| | | { |
| | |
| | | } |
| | | builder.add(bs); |
| | | } |
| | | List<Attribute> attrList = new ArrayList<Attribute>(1); |
| | | List<Attribute> attrList = new ArrayList<>(1); |
| | | attrList.add(builder.toAttribute()); |
| | | |
| | | if (attrType.isOperational()) |
| | |
| | | |
| | | private Set<String> getSelectedIds() |
| | | { |
| | | Set<String> selectedIds = new HashSet<String>(); |
| | | Set<String> selectedIds = new HashSet<>(); |
| | | int[] indexes = taskTable.getSelectedRows(); |
| | | if (indexes != null) |
| | | { |
| | |
| | | type.setText(getTypeValue(matchingRule).toString()); |
| | | |
| | | Comparator<String> lowerCaseComparator = new LowerCaseComparator(); |
| | | TreeSet<String> attributes = new TreeSet<String>(lowerCaseComparator); |
| | | TreeSet<String> attributes = new TreeSet<>(lowerCaseComparator); |
| | | for (AttributeType attr : schema.getAttributeTypes().values()) |
| | | { |
| | | if (matchingRule.equals(attr.getApproximateMatchingRule()) || |
| | |
| | | { |
| | | private static final long serialVersionUID = 6462932163745559L; |
| | | |
| | | private LinkedHashSet<T> selectedAttributes = new LinkedHashSet<T>(); |
| | | |
| | | private LinkedHashSet<T> selectedAttributes = new LinkedHashSet<>(); |
| | | private LinkedHashSet<T> monitoringAttributes; |
| | | |
| | | private boolean isCanceled = true; |
| | | |
| | | /** |
| | |
| | | public static MonitoringAttributesViewPanel<String> |
| | | createStringInstance(LinkedHashSet<String> attributes) |
| | | { |
| | | return new MonitoringAttributesViewPanel<String>(attributes); |
| | | return new MonitoringAttributesViewPanel<>(attributes); |
| | | } |
| | | |
| | | /** |
| | |
| | | createMonitoringAttributesInstance( |
| | | LinkedHashSet<MonitoringAttributes> attributes) |
| | | { |
| | | return new MonitoringAttributesViewPanel<MonitoringAttributes>(attributes); |
| | | return new MonitoringAttributesViewPanel<>(attributes); |
| | | } |
| | | |
| | | /** |
| | |
| | | public static MonitoringAttributesViewPanel<LocalizableMessage> |
| | | createMessageInstance(LinkedHashSet<LocalizableMessage> attributes) |
| | | { |
| | | return new MonitoringAttributesViewPanel<LocalizableMessage>(attributes); |
| | | return new MonitoringAttributesViewPanel<>(attributes); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | |
| | | */ |
| | | protected MonitoringAttributesViewPanel(LinkedHashSet<T> attributes) |
| | | { |
| | | monitoringAttributes = new LinkedHashSet<T>(attributes); |
| | | monitoringAttributes = new LinkedHashSet<>(attributes); |
| | | createLayout(); |
| | | } |
| | | |
| | |
| | | } |
| | | if (selectedAttributes.isEmpty()) |
| | | { |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | errors.add(INFO_CTRL_PANEL_NO_OPERATION_SELECTED.get()); |
| | | super.displayErrorDialog(errors); |
| | | } |
| | |
| | | @Override |
| | | public void configurationChanged(ConfigurationChangeEvent ev) |
| | | { |
| | | ArrayList<AttributeSyntax<?>> newSyntaxes = |
| | | new ArrayList<AttributeSyntax<?>>(); |
| | | ArrayList<AttributeSyntax<?>> newSyntaxes = new ArrayList<>(); |
| | | |
| | | final ServerDescriptor desc = ev.getNewDescriptor(); |
| | | Schema s = desc.getSchema(); |
| | |
| | | { |
| | | schema = s; |
| | | |
| | | HashMap<String, AttributeSyntax<?>> syntaxNameMap = new HashMap<String, |
| | | AttributeSyntax<?>>(); |
| | | HashMap<String, AttributeSyntax<?>> syntaxNameMap = new HashMap<>(); |
| | | for (String key : schema.getSyntaxes().keySet()) |
| | | { |
| | | AttributeSyntax<?> syntax = schema.getSyntax(key); |
| | |
| | | syntaxNameMap.put(name, syntax); |
| | | } |
| | | |
| | | SortedSet<String> orderedKeys = |
| | | new TreeSet<String>(new LowerCaseComparator()); |
| | | SortedSet<String> orderedKeys = new TreeSet<>(new LowerCaseComparator()); |
| | | orderedKeys.addAll(syntaxNameMap.keySet()); |
| | | for (String key : orderedKeys) |
| | | { |
| | |
| | | } |
| | | updateComboBoxModel(newSyntaxes, (DefaultComboBoxModel) syntax.getModel()); |
| | | |
| | | HashMap<String, AttributeType> attributeNameMap = new HashMap<String, |
| | | AttributeType>(); |
| | | HashMap<String, AttributeType> attributeNameMap = new HashMap<>(); |
| | | for (String key : schema.getAttributeTypes().keySet()) |
| | | { |
| | | AttributeType attr = schema.getAttributeType(key); |
| | |
| | | } |
| | | orderedKeys.clear(); |
| | | orderedKeys.addAll(attributeNameMap.keySet()); |
| | | ArrayList<Object> newParents = new ArrayList<Object>(); |
| | | ArrayList<Object> newParents = new ArrayList<>(); |
| | | for (String key : orderedKeys) |
| | | { |
| | | newParents.add(attributeNameMap.get(key)); |
| | |
| | | newParents.add(0, NO_PARENT); |
| | | updateComboBoxModel(newParents, (DefaultComboBoxModel) parent.getModel()); |
| | | |
| | | ArrayList<MatchingRule> approximateElements = |
| | | new ArrayList<MatchingRule>(); |
| | | ArrayList<MatchingRule> equalityElements = new ArrayList<MatchingRule>(); |
| | | ArrayList<MatchingRule> orderingElements = new ArrayList<MatchingRule>(); |
| | | ArrayList<MatchingRule> substringElements = new ArrayList<MatchingRule>(); |
| | | ArrayList<MatchingRule> approximateElements = new ArrayList<>(); |
| | | ArrayList<MatchingRule> equalityElements = new ArrayList<>(); |
| | | ArrayList<MatchingRule> orderingElements = new ArrayList<>(); |
| | | ArrayList<MatchingRule> substringElements = new ArrayList<>(); |
| | | |
| | | HashMap<String, MatchingRule> matchingRuleNameMap = new HashMap<String, |
| | | MatchingRule>(); |
| | | HashMap<String, MatchingRule> matchingRuleNameMap = new HashMap<>(); |
| | | for (String key : schema.getMatchingRules().keySet()) |
| | | { |
| | | MatchingRule rule = schema.getMatchingRule(key); |
| | |
| | | } |
| | | } |
| | | JComboBox[] combos = {approximate, equality, ordering, substring}; |
| | | ArrayList<ArrayList<MatchingRule>> ruleNames = |
| | | new ArrayList<ArrayList<MatchingRule>>(); |
| | | ArrayList<ArrayList<MatchingRule>> ruleNames = new ArrayList<>(); |
| | | ruleNames.add(approximateElements); |
| | | ruleNames.add(equalityElements); |
| | | ruleNames.add(orderingElements); |
| | |
| | | @Override |
| | | public void okClicked() |
| | | { |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | for (JLabel label : labels) |
| | | { |
| | | setPrimaryValid(label); |
| | |
| | | |
| | | private ArrayList<String> getAliases() |
| | | { |
| | | ArrayList<String> al = new ArrayList<String>(); |
| | | ArrayList<String> al = new ArrayList<>(); |
| | | String s = aliases.getText().trim(); |
| | | if (s.length() > 0) |
| | | { |
| | |
| | | |
| | | private ArrayList<String> getAllNames() |
| | | { |
| | | ArrayList<String> al = new ArrayList<String>(); |
| | | ArrayList<String> al = new ArrayList<>(); |
| | | al.add(getAttributeName()); |
| | | al.addAll(getAliases()); |
| | | return al; |
| | |
| | | |
| | | private Map<String, List<String>> getExtraProperties() |
| | | { |
| | | Map<String, List<String>> map = new HashMap<String, List<String>>(); |
| | | Map<String, List<String>> map = new HashMap<>(); |
| | | String f = file.getText().trim(); |
| | | if (f.length() > 0) |
| | | { |
| | | ArrayList<String> list = new ArrayList<String>(); |
| | | ArrayList<String> list = new ArrayList<>(); |
| | | list.add(f); |
| | | map.put(ServerConstants.SCHEMA_PROPERTY_FILENAME, list); |
| | | } |
| | | String or = origin.getText().trim(); |
| | | if (or.length() > 0) |
| | | { |
| | | ArrayList<String> list = new ArrayList<String>(); |
| | | ArrayList<String> list = new ArrayList<>(); |
| | | list.add(or); |
| | | map.put(ServerConstants.SCHEMA_PROPERTY_ORIGIN, list); |
| | | } |
| | |
| | | /** {@inheritDoc} */ |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | checkSyntax(errors); |
| | | if (!errors.isEmpty()) |
| | | { |
| | |
| | | { |
| | | sb.append("objectClass: ").append(ServerConstants.OC_GROUP_OF_NAMES); |
| | | String[] members = staticMembers.getText().split("\n"); |
| | | LinkedHashSet<DN> dns = new LinkedHashSet<DN>(); |
| | | LinkedHashSet<DN> dns = new LinkedHashSet<>(); |
| | | for (String member : members) |
| | | { |
| | | member = member.trim(); |
| | |
| | | private JLabel lAttributes = Utilities.createPrimaryLabel( |
| | | INFO_CTRL_PANEL_OBJECTCLASS_ATTRIBUTES_LABEL.get()); |
| | | |
| | | private Set<AttributeType> inheritedOptionalAttributes = |
| | | new HashSet<AttributeType>(); |
| | | private Set<AttributeType> inheritedRequiredAttributes = |
| | | new HashSet<AttributeType>(); |
| | | private Set<AttributeType> inheritedOptionalAttributes = new HashSet<>(); |
| | | private Set<AttributeType> inheritedRequiredAttributes = new HashSet<>(); |
| | | |
| | | private JLabel[] labels = {lName, lSuperior, lOID, lAliases, lOrigin, lFile, |
| | | lDescription, lType, lAttributes |
| | |
| | | /** {@inheritDoc} */ |
| | | public void okClicked() |
| | | { |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | for (JLabel label : labels) |
| | | { |
| | | setPrimaryValid(label); |
| | |
| | | attributes.getAvailableListModel().addAll(allAttrs); |
| | | |
| | | |
| | | HashSet<AttributeType> toDelete = new HashSet<AttributeType>(); |
| | | HashSet<AttributeType> toDelete = new HashSet<>(); |
| | | for (AttributeType attr : attributes.getSelectedListModel1().getData()) |
| | | { |
| | | if (!allAttrs.contains(attr)) |
| | |
| | | attributes.getSelectedListModel1().remove(attr); |
| | | } |
| | | |
| | | toDelete = new HashSet<AttributeType>(); |
| | | toDelete = new HashSet<>(); |
| | | for (AttributeType attr : attributes.getSelectedListModel2().getData()) |
| | | { |
| | | if (!allAttrs.contains(attr)) |
| | |
| | | { |
| | | if (sel != null) |
| | | { |
| | | ArrayList<Integer> indexes = new ArrayList<Integer>(); |
| | | ArrayList<Integer> indexes = new ArrayList<>(); |
| | | for (int j=0; j<sel.length; j++) |
| | | { |
| | | if (sel[j] < lists[i].getModel().getSize()) |
| | |
| | | attributes.getSelectedList2(), 0, |
| | | attributes.getSelectedList2().getModel().getSize() - 1); |
| | | |
| | | Collection<AttributeType> unmovableItems = |
| | | new ArrayList<AttributeType>(inheritedRequiredAttributes); |
| | | Collection<AttributeType> unmovableItems = new ArrayList<>(inheritedRequiredAttributes); |
| | | unmovableItems.addAll(inheritedOptionalAttributes); |
| | | attributes.setUnmovableItems(unmovableItems); |
| | | |
| | |
| | | SchemaElementComboBoxCellRenderer(type); |
| | | type.setRenderer(renderer); |
| | | |
| | | attributes = |
| | | new DoubleAddRemovePanel<AttributeType>(0, AttributeType.class); |
| | | attributes = new DoubleAddRemovePanel<>(0, AttributeType.class); |
| | | Comparator<AttributeType> comparator = new Comparator<AttributeType>() |
| | | { |
| | | /** {@inheritDoc} */ |
| | |
| | | |
| | | private Map<String, List<String>> getExtraProperties() |
| | | { |
| | | Map<String, List<String>> map = new HashMap<String, List<String>>(); |
| | | Map<String, List<String>> map = new HashMap<>(); |
| | | String f = file.getText().trim(); |
| | | if (f.length() > 0) |
| | | { |
| | | ArrayList<String> list = new ArrayList<String>(); |
| | | ArrayList<String> list = new ArrayList<>(); |
| | | list.add(f); |
| | | map.put(ServerConstants.SCHEMA_PROPERTY_FILENAME, list); |
| | | } |
| | | String or = origin.getText().trim(); |
| | | if (or.length() > 0) |
| | | { |
| | | ArrayList<String> list = new ArrayList<String>(); |
| | | ArrayList<String> list = new ArrayList<>(); |
| | | list.add(or); |
| | | map.put(ServerConstants.SCHEMA_PROPERTY_ORIGIN, list); |
| | | } |
| | |
| | | |
| | | private ArrayList<String> getAliases() |
| | | { |
| | | ArrayList<String> al = new ArrayList<String>(); |
| | | ArrayList<String> al = new ArrayList<>(); |
| | | String s = aliases.getText().trim(); |
| | | if (s.length() > 0) |
| | | { |
| | |
| | | |
| | | private ArrayList<String> getAllNames() |
| | | { |
| | | ArrayList<String> al = new ArrayList<String>(); |
| | | ArrayList<String> al = new ArrayList<>(); |
| | | al.add(getObjectClassName()); |
| | | al.addAll(getAliases()); |
| | | return al; |
| | |
| | | |
| | | private Set<AttributeType> intersect(Set<AttributeType> set1, Set<AttributeType> set2) |
| | | { |
| | | HashSet<AttributeType> attrs = new HashSet<AttributeType>(set1); |
| | | HashSet<AttributeType> attrs = new HashSet<>(set1); |
| | | attrs.removeAll(set2); |
| | | return attrs; |
| | | } |
| | |
| | | private NewVLVIndexTask(ControlPanelInfo info, ProgressDialog dlg) |
| | | { |
| | | super(info, dlg); |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | backendSet.add(backendName.getText()); |
| | | indexName = name.getText().trim(); |
| | | sortOrder = getSortOrder(); |
| | |
| | | @Override |
| | | protected List<String> getCommandLineArguments() |
| | | { |
| | | return new ArrayList<String>(); |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | private String getConfigCommandLineName() |
| | |
| | | |
| | | private List<String> getDSConfigCommandLineArguments() |
| | | { |
| | | final List<String> args = new ArrayList<String>(); |
| | | final List<String> args = new ArrayList<>(); |
| | | args.add("create-local-db-vlv-index"); |
| | | args.add("--backend-name"); |
| | | args.add(backendID); |
| | |
| | | public void okClicked() |
| | | { |
| | | String struct = (String) structural.getSelectedItem(); |
| | | TreeSet<String> aux = new TreeSet<String>(auxiliary.getSelectedListModel().getData()); |
| | | TreeSet<String> aux = new TreeSet<>(auxiliary.getSelectedListModel().getData()); |
| | | aux.add("top"); |
| | | ObjectClassValue newValue = new ObjectClassValue(struct, aux); |
| | | valueChanged = !newValue.equals(value); |
| | |
| | | final Schema schema = ev.getNewDescriptor().getSchema(); |
| | | if (schema != null) |
| | | { |
| | | final SortedSet<String> auxiliaryOcs = new TreeSet<String>(); |
| | | final SortedSet<String> structuralOcs = new TreeSet<String>(); |
| | | final SortedSet<String> auxiliaryOcs = new TreeSet<>(); |
| | | final SortedSet<String> structuralOcs = new TreeSet<>(); |
| | | for (ObjectClass oc : schema.getObjectClasses().values()) |
| | | { |
| | | if (oc.getObjectClassType() == ObjectClassType.AUXILIARY) |
| | |
| | | } |
| | | else |
| | | { |
| | | currentAux = new TreeSet<String>(); |
| | | currentAux = new TreeSet<>(); |
| | | } |
| | | SortableListModel<String> availableListModel = |
| | | auxiliary.getAvailableListModel(); |
| | |
| | | gbc.weightx = 1.0; |
| | | gbc.weighty = 1.0; |
| | | gbc.fill = GridBagConstraints.BOTH; |
| | | auxiliary = new AddRemovePanel<String>(String.class); |
| | | auxiliary = new AddRemovePanel<>(String.class); |
| | | gbc.insets.left = 30; |
| | | add(auxiliary, gbc); |
| | | } |
| | |
| | | private JLabel lIndexes; |
| | | private JLabel lNoBaseDNsFound; |
| | | |
| | | private final Map<String, SortedSet<AbstractIndexDescriptor>> hmIndexes = |
| | | new HashMap<String, SortedSet<AbstractIndexDescriptor>>(); |
| | | private final Map<String, SortedSet<AbstractIndexDescriptor>> hmIndexes = new HashMap<>(); |
| | | |
| | | /** Constructor of the panel. */ |
| | | public RebuildIndexPanel() |
| | |
| | | gbc.anchor = GridBagConstraints.NORTHWEST; |
| | | add(lIndexes, gbc); |
| | | |
| | | addRemove = new AddRemovePanel<AbstractIndexDescriptor>(AbstractIndexDescriptor.class); |
| | | addRemove = new AddRemovePanel<>(AbstractIndexDescriptor.class); |
| | | addRemove.getAvailableLabel().setText(INFO_CTRL_PANEL_AVAILABLE_INDEXES_LABEL.get().toString()); |
| | | addRemove.getSelectedLabel().setText(INFO_CTRL_PANEL_SELECTED_INDEXES_LABEL.get().toString()); |
| | | |
| | |
| | | setPrimaryValid(lBaseDN); |
| | | setSecondaryValid(addRemove.getSelectedLabel()); |
| | | |
| | | final Set<LocalizableMessage> errors = new LinkedHashSet<LocalizableMessage>(); |
| | | final Set<LocalizableMessage> errors = new LinkedHashSet<>(); |
| | | String baseDN = getSelectedBaseDN(); |
| | | |
| | | if (baseDN == null) |
| | |
| | | { |
| | | ProgressDialog progressDialog = |
| | | new ProgressDialog(Utilities.createFrame(), Utilities.getParentDialog(this), getTitle(), getInfo()); |
| | | Set<String> baseDNs = new HashSet<String>(); |
| | | Set<String> baseDNs = new HashSet<>(); |
| | | baseDNs.add(getSelectedBaseDN()); |
| | | RebuildIndexTask newTask = |
| | | new RebuildIndexTask(getInfo(), progressDialog, baseDNs, addRemove.getSelectedListModel().getData()); |
| | |
| | | isCanceled = true; |
| | | |
| | | setPrimaryValid(lPeriod); |
| | | LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<LocalizableMessage>(); |
| | | LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<>(); |
| | | long t = -1; |
| | | try |
| | | { |
| | |
| | | /** {@inheritDoc} */ |
| | | public void okClicked() |
| | | { |
| | | final ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | final ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | |
| | | setPrimaryValid(lPassword); |
| | | setPrimaryValid(lConfirmPassword); |
| | |
| | | /** {@inheritDoc} */ |
| | | protected void verifyBackupClicked() |
| | | { |
| | | LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<LocalizableMessage>(); |
| | | LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<>(); |
| | | // Launch the task in another progress dialog. |
| | | ProgressDialog dlg = new ProgressDialog( |
| | | Utilities.createFrame(), |
| | |
| | | setPrimaryValid(lAvailableBackups); |
| | | setPrimaryValid(lBackupID); |
| | | |
| | | final LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<LocalizableMessage>(); |
| | | final LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<>(); |
| | | |
| | | BackupDescriptor backup = getSelectedBackup(); |
| | | |
| | |
| | | dir = parentDirectory.getText(); |
| | | backupID = RestorePanel.this.backupID.getText(); |
| | | } |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | for (BackendDescriptor backend : info.getServerDescriptor().getBackends()) |
| | | { |
| | | if (!backend.isConfigBackend()) |
| | |
| | | lastException = t; |
| | | state = State.FINISHED_WITH_ERROR; |
| | | } |
| | | HashSet<BackendDescriptor> backends = new HashSet<BackendDescriptor>(); |
| | | HashSet<BackendDescriptor> backends = new HashSet<>(); |
| | | for (BackendDescriptor backend : |
| | | getInfo().getServerDescriptor().getBackends()) |
| | | { |
| | |
| | | /** {@inheritDoc} */ |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(); |
| | | ArrayList<String> args = new ArrayList<>(); |
| | | |
| | | args.add("--backupDirectory"); |
| | | args.add(dir); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | { |
| | | private static final long serialVersionUID = -8556383593966382604L; |
| | | |
| | | private Set<SchemaElementSelectionListener> listeners = |
| | | new HashSet<SchemaElementSelectionListener>(); |
| | | private Set<SchemaElementSelectionListener> listeners = new HashSet<>(); |
| | | |
| | | /** |
| | | * The empty border shared by all the schema element panels. |
| | |
| | | */ |
| | | protected Set<String> getAliases(AttributeType attr) |
| | | { |
| | | Set<String> aliases = new LinkedHashSet<String>(); |
| | | Set<String> aliases = new LinkedHashSet<>(); |
| | | Iterable<String> ocNames = attr.getNormalizedNames(); |
| | | String primaryName = attr.getPrimaryName(); |
| | | if (primaryName == null) |
| | |
| | | */ |
| | | protected Set<String> getAliases(ObjectClass oc) |
| | | { |
| | | Set<String> aliases = new LinkedHashSet<String>(); |
| | | Set<String> aliases = new LinkedHashSet<>(); |
| | | Iterable<String> ocNames = oc.getNormalizedNames(); |
| | | String primaryName = oc.getPrimaryName(); |
| | | if (primaryName == null) |
| | |
| | | public class SelectObjectClassesPanel extends StatusGenericPanel |
| | | { |
| | | private static final long serialVersionUID = 1230982500028334L; |
| | | private AddRemovePanel<ObjectClass> addRemove = |
| | | new AddRemovePanel<ObjectClass>(ObjectClass.class); |
| | | private Set<ObjectClass> toExclude = new HashSet<ObjectClass>(); |
| | | private AddRemovePanel<ObjectClass> addRemove = new AddRemovePanel<>(ObjectClass.class); |
| | | private Set<ObjectClass> toExclude = new HashSet<>(); |
| | | private Schema schema; |
| | | private boolean isCanceled = true; |
| | | |
| | |
| | | */ |
| | | public void setSelectedObjectClasses(Set<ObjectClass> selectedObjectClasses) |
| | | { |
| | | Set<ObjectClass> toAdd = new HashSet<ObjectClass>(); |
| | | Set<ObjectClass> toAdd = new HashSet<>(); |
| | | Set<ObjectClass> previouslySelected = |
| | | addRemove.getSelectedListModel().getData(); |
| | | for (ObjectClass oc : previouslySelected) |
| | |
| | | |
| | | private void updateWithSchema(Schema schema) |
| | | { |
| | | ArrayList<ObjectClass> allOcs = new ArrayList<ObjectClass>(); |
| | | ArrayList<ObjectClass> allOcs = new ArrayList<>(); |
| | | for (String key : schema.getObjectClasses().keySet()) |
| | | { |
| | | ObjectClass oc = schema.getObjectClass(key); |
| | |
| | | private GenericDialog browseEntriesDlg; |
| | | private LDAPEntrySelectionPanel browseEntriesPanel; |
| | | |
| | | private Map<String, List<String>> lastUserPasswords = |
| | | new HashMap<String,List<String>>(); |
| | | private Map<String, List<String>> lastUserPasswords = new HashMap<>(); |
| | | |
| | | private CustomSearchResult searchResult; |
| | | private boolean isReadOnly; |
| | | private TreePath treePath; |
| | | private JScrollPane scrollAttributes; |
| | | |
| | | private LinkedHashMap<String, List<EditorComponent>> hmEditors = |
| | | new LinkedHashMap<String, List<EditorComponent>>(); |
| | | private LinkedHashMap<String, List<EditorComponent>> hmEditors = new LinkedHashMap<>(); |
| | | |
| | | private Set<String> requiredAttrs = new HashSet<String>(); |
| | | private Map<String, JComponent> hmLabels = new HashMap<String, JComponent>(); |
| | | private Map<String, String> hmDisplayedNames = new HashMap<String, String>(); |
| | | private Map<String, JComponent> hmComponents = |
| | | new HashMap<String, JComponent>(); |
| | | private Set<String> requiredAttrs = new HashSet<>(); |
| | | private Map<String, JComponent> hmLabels = new HashMap<>(); |
| | | private Map<String, String> hmDisplayedNames = new HashMap<>(); |
| | | private Map<String, JComponent> hmComponents = new HashMap<>(); |
| | | |
| | | private final String CONFIRM_PASSWORD = "confirm password"; |
| | | |
| | | /** Map containing as key the attribute name and as value a localizable message. */ |
| | | static Map<String, LocalizableMessage> hmFriendlyAttrNames = |
| | | new HashMap<String, LocalizableMessage>(); |
| | | static Map<String, LocalizableMessage> hmFriendlyAttrNames = new HashMap<>(); |
| | | /** |
| | | * Map containing as key an object class and as value the preferred naming |
| | | * attribute for the objectclass. |
| | | */ |
| | | static Map<String, String> hmNameAttrNames = new HashMap<String, String>(); |
| | | static Map<String, String[]> hmOrdereredAttrNames = |
| | | new HashMap<String, String[]>(); |
| | | static Map<String, String> hmNameAttrNames = new HashMap<>(); |
| | | static Map<String, String[]> hmOrdereredAttrNames = new HashMap<>(); |
| | | static |
| | | { |
| | | hmFriendlyAttrNames.put(ServerConstants.OBJECTCLASS_ATTRIBUTE_TYPE_NAME, |
| | |
| | | List<Object> values = sr.getAttributeValues(attr); |
| | | if (values.isEmpty()) |
| | | { |
| | | values = new ArrayList<Object>(1); |
| | | values = new ArrayList<>(1); |
| | | if (isBinary(attr)) |
| | | { |
| | | values.add(new byte[]{}); |
| | |
| | | |
| | | if (isPassword(attr)) |
| | | { |
| | | List<String> pwds = new ArrayList<String>(); |
| | | List<String> pwds = new ArrayList<>(); |
| | | for (Object o : values) |
| | | { |
| | | pwds.add(getPasswordStringValue(o)); |
| | |
| | | private Collection<String> getSortedAttributes(CustomSearchResult sr, |
| | | boolean isReadOnly) |
| | | { |
| | | LinkedHashSet<String> attrNames = new LinkedHashSet<String>(); |
| | | LinkedHashSet<String> attrNames = new LinkedHashSet<>(); |
| | | |
| | | // Get all attributes that the entry can have |
| | | Set<String> attributes = new LinkedHashSet<String>(); |
| | | ArrayList<String> entryAttrs = new ArrayList<String>(sr.getAttributeNames()); |
| | | ArrayList<String> attrsWithNoOptions = new ArrayList<String>(); |
| | | Set<String> attributes = new LinkedHashSet<>(); |
| | | ArrayList<String> entryAttrs = new ArrayList<>(sr.getAttributeNames()); |
| | | ArrayList<String> attrsWithNoOptions = new ArrayList<>(); |
| | | for (String attr : entryAttrs) |
| | | { |
| | | attrsWithNoOptions.add( |
| | |
| | | // alphabetical order) the attributes with no friendly name. Finally |
| | | // do the same with the other attributes. |
| | | |
| | | SortedSet<String> requiredAttributes = new TreeSet<String>(); |
| | | SortedSet<String> allowedAttributes = new TreeSet<String>(); |
| | | SortedSet<String> requiredAttributes = new TreeSet<>(); |
| | | SortedSet<String> allowedAttributes = new TreeSet<>(); |
| | | |
| | | if (schema != null) |
| | | { |
| | |
| | | |
| | | private Set<String> toStrings(Collection<Object> objects) |
| | | { |
| | | Set<String> results = new TreeSet<String>(); |
| | | Set<String> results = new TreeSet<>(); |
| | | for (Object o : objects) |
| | | { |
| | | results.add(String.valueOf(o)); |
| | |
| | | GridBagConstraints gbc = new GridBagConstraints(); |
| | | gbc.gridy = 0; |
| | | |
| | | List<EditorComponent> components = new ArrayList<EditorComponent>(); |
| | | List<EditorComponent> components = new ArrayList<>(); |
| | | hmEditors.put(attrName.toLowerCase(), components); |
| | | |
| | | boolean isBinary = hasBinaryValue(values); |
| | |
| | | { |
| | | Entry entry = null; |
| | | |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | |
| | | try |
| | | { |
| | |
| | | |
| | | private List<String> getDisplayedStringValues(String attrName) |
| | | { |
| | | List<String> values = new ArrayList<String>(); |
| | | List<String> values = new ArrayList<>(); |
| | | List<EditorComponent> comps = |
| | | hmEditors.get(attrName.toLowerCase()); |
| | | if (comps != null) |
| | |
| | | if (oldDN.size() > 0) |
| | | { |
| | | RDN rdn = oldDN.rdn(); |
| | | List<AttributeType> attributeTypes = new ArrayList<AttributeType>(); |
| | | List<String> attributeNames = new ArrayList<String>(); |
| | | List<ByteString> attributeValues = new ArrayList<ByteString>(); |
| | | List<AttributeType> attributeTypes = new ArrayList<>(); |
| | | List<String> attributeNames = new ArrayList<>(); |
| | | List<ByteString> attributeValues = new ArrayList<>(); |
| | | for (int i=0; i<rdn.getNumValues(); i++) |
| | | { |
| | | String attrName = rdn.getAttributeName(i); |
| | |
| | | Schema schema = getInfo().getServerDescriptor().getSchema(); |
| | | if (schema != null) |
| | | { |
| | | ArrayList<String> attributes = new ArrayList<String>(); |
| | | ArrayList<String> ocs = new ArrayList<String>(); |
| | | ArrayList<String> attributes = new ArrayList<>(); |
| | | ArrayList<String> ocs = new ArrayList<>(); |
| | | if (newValue.getStructural() != null) |
| | | { |
| | | ocs.add(newValue.getStructural().toLowerCase()); |
| | |
| | | if (comp instanceof ObjectClassCellPanel) |
| | | { |
| | | ObjectClassValue ocDesc = ((ObjectClassCellPanel)comp).getValue(); |
| | | LinkedHashSet<String> values = new LinkedHashSet<String>(); |
| | | LinkedHashSet<String> values = new LinkedHashSet<>(); |
| | | String structural = ocDesc.getStructural(); |
| | | if (structural != null) |
| | | { |
| | |
| | | returnValue = values; |
| | | } else if (comp instanceof JTextArea) |
| | | { |
| | | LinkedHashSet<String> values = new LinkedHashSet<String>(); |
| | | LinkedHashSet<String> values = new LinkedHashSet<>(); |
| | | String value = ((JTextArea)comp).getText(); |
| | | String[] lines = value.split("\n"); |
| | | for (String line : lines) |
| | |
| | | type.setText(getTypeValue(attr).toString()); |
| | | |
| | | Comparator<String> lowerCaseComparator = new LowerCaseComparator(); |
| | | SortedSet<String> requiredByOcs = new TreeSet<String>(lowerCaseComparator); |
| | | SortedSet<String> requiredByOcs = new TreeSet<>(lowerCaseComparator); |
| | | for (ObjectClass oc : schema.getObjectClasses().values()) |
| | | { |
| | | if (oc.getRequiredAttributeChain().contains(attr)) |
| | |
| | | model.addElement(oc); |
| | | } |
| | | |
| | | SortedSet<String> optionalByOcs = new TreeSet<String>(lowerCaseComparator); |
| | | SortedSet<String> optionalByOcs = new TreeSet<>(lowerCaseComparator); |
| | | for (ObjectClass oc : schema.getObjectClasses().values()) |
| | | { |
| | | if (oc.getOptionalAttributeChain().contains(attr)) |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | private static LocalizableMessage OBSOLETE_VALUE = |
| | | INFO_CTRL_PANEL_OBJECTCLASS_OBSOLETE_LABEL.get(); |
| | | |
| | | private Map<String, AttributeType> hmAttrs = |
| | | new HashMap<String, AttributeType>(); |
| | | private Map<String, AttributeType> hmAttrs = new HashMap<>(); |
| | | |
| | | /** |
| | | * Default constructor of the panel. |
| | | * |
| | | */ |
| | | /** Default constructor of the panel. */ |
| | | public StandardObjectClassPanel() |
| | | { |
| | | super(); |
| | | createLayout(); |
| | | } |
| | | |
| | |
| | | n = NOT_APPLICABLE.toString(); |
| | | } |
| | | description.setText(n); |
| | | ArrayList<String> otherNames = new ArrayList<String>(); |
| | | ArrayList<String> otherNames = new ArrayList<>(); |
| | | Iterable<String> ocNames = oc.getNormalizedNames(); |
| | | String primaryName = oc.getPrimaryName(); |
| | | if (primaryName == null) |
| | |
| | | type.setText(getTypeValue(oc).toString()); |
| | | |
| | | Comparator<String> lowerCaseComparator = new LowerCaseComparator(); |
| | | SortedSet<String> requiredAttrs = new TreeSet<String>(lowerCaseComparator); |
| | | Set<String> inheritedAttrs = new HashSet<String>(); |
| | | SortedSet<String> requiredAttrs = new TreeSet<>(lowerCaseComparator); |
| | | Set<String> inheritedAttrs = new HashSet<>(); |
| | | for (AttributeType attr : oc.getRequiredAttributeChain()) |
| | | { |
| | | requiredAttrs.add(attr.getNameOrOID()); |
| | |
| | | hmAttrs.put(v, schema.getAttributeType(attr.toLowerCase())); |
| | | } |
| | | |
| | | SortedSet<String> optionalAttrs = new TreeSet<String>(lowerCaseComparator); |
| | | inheritedAttrs = new HashSet<String>(); |
| | | SortedSet<String> optionalAttrs = new TreeSet<>(lowerCaseComparator); |
| | | inheritedAttrs = new HashSet<>(); |
| | | for (AttributeType attr : oc.getOptionalAttributeChain()) |
| | | { |
| | | optionalAttrs.add(attr.getNameOrOID()); |
| | |
| | | } |
| | | else |
| | | { |
| | | SortedSet<String> names = new TreeSet<String>(); |
| | | SortedSet<String> names = new TreeSet<>(); |
| | | for (ObjectClass superior : superiors) |
| | | { |
| | | names.add(superior.getPrimaryName()); |
| | |
| | | /** The last displayed message in the error pane. */ |
| | | private String lastDisplayedError; |
| | | |
| | | private final List<ConfigurationElementCreatedListener> confListeners = |
| | | new ArrayList<ConfigurationElementCreatedListener>(); |
| | | private final List<ConfigurationElementCreatedListener> confListeners = new ArrayList<>(); |
| | | |
| | | private boolean sizeSet; |
| | | private boolean focusSet; |
| | |
| | | } |
| | | if (rebuildIndexes) |
| | | { |
| | | SortedSet<AbstractIndexDescriptor> indexes = new TreeSet<AbstractIndexDescriptor>(); |
| | | SortedSet<AbstractIndexDescriptor> indexes = new TreeSet<>(); |
| | | indexes.add(index); |
| | | SortedSet<String> baseDNs = new TreeSet<String>(); |
| | | SortedSet<String> baseDNs = new TreeSet<>(); |
| | | for (BaseDNDescriptor b : index.getBackend().getBaseDns()) |
| | | { |
| | | baseDNs.add(Utilities.unescapeUtf8(b.getDn().toString())); |
| | | } |
| | | |
| | | RebuildIndexTask newTask = new RebuildIndexTask(getInfo(), progressDialog, baseDNs, indexes); |
| | | List<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | List<LocalizableMessage> errors = new ArrayList<>(); |
| | | for (Task task : getInfo().getTasks()) |
| | | { |
| | | task.canLaunch(newTask, errors); |
| | |
| | | protected void updateSimpleBackendComboBoxModel(final JComboBox combo, final JLabel lNoBackendsFound, |
| | | final ServerDescriptor desc) |
| | | { |
| | | final SortedSet<String> newElements = new TreeSet<String>(new LowerCaseComparator()); |
| | | final SortedSet<String> newElements = new TreeSet<>(new LowerCaseComparator()); |
| | | for (BackendDescriptor backend : desc.getBackends()) |
| | | { |
| | | if (!backend.isConfigBackend()) |
| | |
| | | */ |
| | | protected void updateBaseDNComboBoxModel(final DefaultComboBoxModel model, final ServerDescriptor desc) |
| | | { |
| | | Set<CategorizedComboBoxElement> newElements = new LinkedHashSet<CategorizedComboBoxElement>(); |
| | | SortedSet<String> backendIDs = new TreeSet<String>(new LowerCaseComparator()); |
| | | Map<String, SortedSet<String>> hmBaseDNs = new HashMap<String, SortedSet<String>>(); |
| | | Set<CategorizedComboBoxElement> newElements = new LinkedHashSet<>(); |
| | | SortedSet<String> backendIDs = new TreeSet<>(new LowerCaseComparator()); |
| | | Map<String, SortedSet<String>> hmBaseDNs = new HashMap<>(); |
| | | |
| | | for (BackendDescriptor backend : desc.getBackends()) |
| | | { |
| | |
| | | { |
| | | String backendID = backend.getBackendID(); |
| | | backendIDs.add(backendID); |
| | | SortedSet<String> baseDNs = new TreeSet<String>(new LowerCaseComparator()); |
| | | SortedSet<String> baseDNs = new TreeSet<>(new LowerCaseComparator()); |
| | | for (BaseDNDescriptor baseDN : backend.getBaseDns()) |
| | | { |
| | | try |
| | |
| | | { |
| | | synchronized (hmIndexes) |
| | | { |
| | | Set<String> dns = new HashSet<String>(); |
| | | Set<String> dns = new HashSet<>(); |
| | | for (BackendDescriptor backend : desc.getBackends()) |
| | | { |
| | | if (backend.getType() == BackendDescriptor.Type.LOCAL_DB |
| | |
| | | */ |
| | | protected void startServer() |
| | | { |
| | | Set<LocalizableMessage> errors = new LinkedHashSet<LocalizableMessage>(); |
| | | Set<LocalizableMessage> errors = new LinkedHashSet<>(); |
| | | ProgressDialog progressDialog = new ProgressDialog(Utilities.createFrame(), Utilities.getParentDialog(this), |
| | | INFO_CTRL_PANEL_START_SERVER_PROGRESS_DLG_TITLE.get(), getInfo()); |
| | | StartServerTask newTask = new StartServerTask(getInfo(), progressDialog); |
| | |
| | | */ |
| | | protected void stopServer() |
| | | { |
| | | Set<LocalizableMessage> errors = new LinkedHashSet<LocalizableMessage>(); |
| | | Set<LocalizableMessage> errors = new LinkedHashSet<>(); |
| | | ProgressDialog progressDialog = new ProgressDialog(Utilities.createFrame(), Utilities.getParentDialog(this), |
| | | INFO_CTRL_PANEL_STOP_SERVER_PROGRESS_DLG_TITLE.get(), getInfo()); |
| | | StopServerTask newTask = new StopServerTask(getInfo(), progressDialog); |
| | |
| | | */ |
| | | protected void restartServer() |
| | | { |
| | | Set<LocalizableMessage> errors = new LinkedHashSet<LocalizableMessage>(); |
| | | Set<LocalizableMessage> errors = new LinkedHashSet<>(); |
| | | ProgressDialog progressDialog = new ProgressDialog(Utilities.createFrame(), Utilities.getParentDialog(this), |
| | | INFO_CTRL_PANEL_RESTART_SERVER_PROGRESS_DLG_TITLE.get(), getInfo()); |
| | | RestartServerTask newTask = new RestartServerTask(getInfo(), progressDialog); |
| | |
| | | */ |
| | | protected List<String> getScheduleArgs(final ScheduleType schedule) |
| | | { |
| | | List<String> args = new ArrayList<String>(2); |
| | | List<String> args = new ArrayList<>(2); |
| | | switch (schedule.getType()) |
| | | { |
| | | case LAUNCH_LATER: |
| | |
| | | protected void checkCompatibleSuperiors(final Set<ObjectClass> objectClassSuperiors, |
| | | final ObjectClassType objectClassType, final List<LocalizableMessage> errors) |
| | | { |
| | | SortedSet<String> notCompatibleClasses = new TreeSet<String>(new LowerCaseComparator()); |
| | | SortedSet<String> notCompatibleClasses = new TreeSet<>(new LowerCaseComparator()); |
| | | for (ObjectClass oc : objectClassSuperiors) |
| | | { |
| | | if (oc.getObjectClassType() == ObjectClassType.ABSTRACT) |
| | |
| | | } |
| | | else |
| | | { |
| | | ArrayList<LocalizableMessage> msgs = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> msgs = new ArrayList<>(); |
| | | for (OpenDsException oe : exceptions) |
| | | { |
| | | msgs.add(oe.getMessageObject()); |
| | |
| | | |
| | | Set<DN> rootUsers = desc.getAdministrativeUsers(); |
| | | |
| | | SortedSet<String> sortedRootUsers = new TreeSet<String>(); |
| | | SortedSet<String> sortedRootUsers = new TreeSet<>(); |
| | | for (DN dn : rootUsers) |
| | | { |
| | | try |
| | |
| | | setText(adminConnector, |
| | | getAdminConnectorStringValue(desc.getAdminConnector())); |
| | | |
| | | Set<BaseDNDescriptor> baseDNs = new HashSet<BaseDNDescriptor>(); |
| | | Set<BaseDNDescriptor> baseDNs = new HashSet<>(); |
| | | |
| | | for (BackendDescriptor backend : desc.getBackends()) |
| | | { |
| | |
| | | public class SystemInformationMonitoringPanel extends GeneralMonitoringPanel |
| | | { |
| | | private static final long serialVersionUID = 9031734563298069830L; |
| | | static List<MonitoringAttributes> operations = |
| | | new ArrayList<MonitoringAttributes>(); |
| | | static List<MonitoringAttributes> operations = new ArrayList<>(); |
| | | { |
| | | operations.add(BasicMonitoringAttributes.SYSTEM_NAME); |
| | | operations.add(BasicMonitoringAttributes.OPERATING_SYSTEM); |
| | |
| | | operations.add(BasicMonitoringAttributes.FREE_USED_MEMORY); |
| | | operations.add(BasicMonitoringAttributes.MAX_MEMORY); |
| | | } |
| | | private ArrayList<JLabel> monitoringLabels = |
| | | new ArrayList<JLabel>(); |
| | | private ArrayList<JLabel> monitoringLabels = new ArrayList<>(); |
| | | { |
| | | for (int i=0; i<operations.size(); i++) |
| | | { |
| | |
| | | if (oldDN.size() > 0) |
| | | { |
| | | RDN rdn = oldDN.rdn(); |
| | | List<AttributeType> attributeTypes = new ArrayList<AttributeType>(); |
| | | List<String> attributeNames = new ArrayList<String>(); |
| | | List<ByteString> attributeValues = new ArrayList<ByteString>(); |
| | | List<AttributeType> attributeTypes = new ArrayList<>(); |
| | | List<String> attributeNames = new ArrayList<>(); |
| | | List<ByteString> attributeValues = new ArrayList<>(); |
| | | for (int i=0; i<rdn.getNumValues(); i++) |
| | | { |
| | | String attrName = rdn.getAttributeName(i); |
| | |
| | | |
| | | private Set<String> getDisplayedStringValues(String attrName) |
| | | { |
| | | Set<String> values = new LinkedHashSet<String>(); |
| | | Set<String> values = new LinkedHashSet<>(); |
| | | for (int i=0; i<table.getRowCount(); i++) |
| | | { |
| | | if (attrName.equalsIgnoreCase((String)table.getValueAt(i, 0))) |
| | |
| | | implements Comparator<AttributeValuePair> |
| | | { |
| | | private static final long serialVersionUID = -1240282431326505113L; |
| | | private ArrayList<AttributeValuePair> dataArray = |
| | | new ArrayList<AttributeValuePair>(); |
| | | private SortedSet<AttributeValuePair> allSortedValues = |
| | | new TreeSet<AttributeValuePair>(this); |
| | | private Set<String> requiredAttrs = new HashSet<String>(); |
| | | private ArrayList<AttributeValuePair> dataArray = new ArrayList<>(); |
| | | private SortedSet<AttributeValuePair> allSortedValues = new TreeSet<>(this); |
| | | private Set<String> requiredAttrs = new HashSet<>(); |
| | | private final String[] COLUMN_NAMES = new String[] { |
| | | getHeader(LocalizableMessage.raw("Attribute"), 40), |
| | | getHeader(LocalizableMessage.raw("Value", 40))}; |
| | |
| | | { |
| | | allSortedValues.clear(); |
| | | requiredAttrs.clear(); |
| | | List<String> addedAttrs = new ArrayList<String>(); |
| | | List<String> addedAttrs = new ArrayList<>(); |
| | | Schema schema = getInfo().getServerDescriptor().getSchema(); |
| | | List<Object> ocs = null; |
| | | for (String attrName : searchResult.getAttributeNames()) |
| | |
| | | */ |
| | | public List<Object> getValues(String attrName) |
| | | { |
| | | List<Object> values = new ArrayList<Object>(); |
| | | List<Object> values = new ArrayList<>(); |
| | | for (AttributeValuePair valuePair : dataArray) |
| | | { |
| | | if (valuePair.attrName.equalsIgnoreCase(attrName) |
| | |
| | | Schema schema = getInfo().getServerDescriptor().getSchema(); |
| | | if (schema != null) |
| | | { |
| | | ArrayList<String> attributes = new ArrayList<String>(); |
| | | ArrayList<String> ocs = new ArrayList<String>(); |
| | | ArrayList<String> attributes = new ArrayList<>(); |
| | | ArrayList<String> ocs = new ArrayList<>(); |
| | | if (newValue.getStructural() != null) |
| | | { |
| | | ocs.add(newValue.getStructural().toLowerCase()); |
| | |
| | | scheduleType = Utilities.createComboBox(); |
| | | scheduleType.setModel(new DefaultComboBoxModel()); |
| | | |
| | | ArrayList<Object> newElements = new ArrayList<Object>(); |
| | | ArrayList<Object> newElements = new ArrayList<>(); |
| | | newElements.add(new CategorizedComboBoxElement(LAUNCH_NOW, |
| | | CategorizedComboBoxElement.Type.REGULAR)); |
| | | newElements.add(COMBO_SEPARATOR); |
| | |
| | | public void okClicked() |
| | | { |
| | | schedule = null; |
| | | ArrayList<LocalizableMessage> errorMessages = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errorMessages = new ArrayList<>(); |
| | | |
| | | updateErrorMessages(errorMessages); |
| | | |
| | |
| | | |
| | | private void deleteIndex() |
| | | { |
| | | final List<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | final List<LocalizableMessage> errors = new ArrayList<>(); |
| | | final ProgressDialog dlg = new ProgressDialog( |
| | | createFrame(), getParentDialog(this), INFO_CTRL_PANEL_DELETE_VLV_INDEX_TITLE.get(), getInfo()); |
| | | final List<AbstractIndexDescriptor> indexesToDelete = new ArrayList<AbstractIndexDescriptor>(); |
| | | final List<AbstractIndexDescriptor> indexesToDelete = new ArrayList<>(); |
| | | indexesToDelete.add(index); |
| | | final DeleteIndexTask newTask = new DeleteIndexTask(getInfo(), dlg, indexesToDelete); |
| | | for (final Task task : getInfo().getTasks()) |
| | |
| | | { |
| | | super(info, dlg); |
| | | backendID = index.getBackend().getBackendID(); |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | backendSet.add(backendID); |
| | | indexName = index.getName(); |
| | | sortOrder = getSortOrder(); |
| | |
| | | @Override |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | return new ArrayList<String>(); |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | private String getConfigCommandLineName() |
| | |
| | | |
| | | private List<String> getDSConfigCommandLineArguments() |
| | | { |
| | | final List<String> args = new ArrayList<String>(); |
| | | final List<String> args = new ArrayList<>(); |
| | | args.add("set-local-db-vlv-index-prop"); |
| | | args.add("--backend-name"); |
| | | args.add(backendID); |
| | |
| | | /** |
| | | * The read-only attributes as they appear on the schema. |
| | | */ |
| | | protected SortedSet<String> schemaReadOnlyAttributes = new TreeSet<String>(); |
| | | protected SortedSet<String> schemaReadOnlyAttributes = new TreeSet<>(); |
| | | /** |
| | | * The read-only attributes in lower case. |
| | | */ |
| | | protected SortedSet<String> schemaReadOnlyAttributesLowerCase = |
| | | new TreeSet<String>(); |
| | | protected SortedSet<String> schemaReadOnlyAttributesLowerCase = new TreeSet<>(); |
| | | /** |
| | | * The editable operational attributes. |
| | | */ |
| | | protected SortedSet<String> editableOperationalAttrNames = |
| | | new TreeSet<String>(); |
| | | protected SortedSet<String> editableOperationalAttrNames = new TreeSet<>(); |
| | | private JLabel title= Utilities.createDefaultLabel(); |
| | | |
| | | private Set<LDAPEntryChangedListener> listeners = |
| | | new LinkedHashSet<LDAPEntryChangedListener>(); |
| | | private Set<LDAPEntryChangedListener> listeners = new LinkedHashSet<>(); |
| | | |
| | | /** |
| | | * Whether the entry change events should be ignored or not. |
| | |
| | | Schema schema) |
| | | { |
| | | ObjectClass structuralObjectClass = null; |
| | | SortedSet<String> auxiliaryClasses = new TreeSet<String>(); |
| | | SortedSet<String> auxiliaryClasses = new TreeSet<>(); |
| | | for (Object o : ocValues) |
| | | { |
| | | ObjectClass objectClass = |
| | |
| | | { |
| | | if (attr.getNameWithOptions().equals(attrName)) |
| | | { |
| | | ArrayList<ByteString> newValues = new ArrayList<ByteString>(); |
| | | ArrayList<ByteString> newValues = new ArrayList<>(); |
| | | Iterator<ByteString> it = attr.iterator(); |
| | | while (it.hasNext()) |
| | | { |
| | |
| | | { |
| | | org.opends.server.types.Attribute attr = |
| | | Attributes.create(rdn.getAttributeType(i), value); |
| | | ArrayList<ByteString> newValues = new ArrayList<ByteString>(); |
| | | ArrayList<ByteString> newValues = new ArrayList<>(); |
| | | newValues.add(value); |
| | | entry.addAttribute(attr, newValues); |
| | | } |
| | |
| | | protected void setValues(CustomSearchResult sr, String attrName) |
| | | { |
| | | List<Object> values = getValues(attrName); |
| | | List<Object> valuesToSet = new ArrayList<Object>(); |
| | | List<Object> valuesToSet = new ArrayList<>(); |
| | | for (Object value : values) |
| | | { |
| | | if (value instanceof ObjectClassValue) |
| | |
| | | protected Set<String> getObjectClassSuperiorValues( |
| | | ObjectClass oc) |
| | | { |
| | | Set<String> names = new LinkedHashSet<String>(); |
| | | Set<String> names = new LinkedHashSet<>(); |
| | | Set<ObjectClass> parents = oc.getSuperiorClasses(); |
| | | if (parents != null && !parents.isEmpty()) |
| | | { |
| | |
| | | |
| | | private void updateWindowsService() |
| | | { |
| | | LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<LocalizableMessage>(); |
| | | LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<>(); |
| | | ProgressDialog progressDialog = new ProgressDialog( |
| | | Utilities.createFrame(), Utilities.getParentDialog(this), getTitle(), |
| | | getInfo()); |
| | |
| | | { |
| | | super(info, dlg); |
| | | this.enableService = enableService; |
| | | backendSet = new HashSet<String>(); |
| | | backendSet = new HashSet<>(); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | |
| | | /** {@inheritDoc} */ |
| | | protected ArrayList<String> getCommandLineArguments() |
| | | { |
| | | ArrayList<String> args = new ArrayList<String>(); |
| | | ArrayList<String> args = new ArrayList<>(); |
| | | |
| | | if (enableService) |
| | | { |
| | |
| | | public class WorkQueueMonitoringPanel extends GeneralMonitoringPanel |
| | | { |
| | | private static final long serialVersionUID = 9031734563700069830L; |
| | | static List<MonitoringAttributes> attributes = |
| | | new ArrayList<MonitoringAttributes>(); |
| | | static List<MonitoringAttributes> attributes = new ArrayList<>(); |
| | | { |
| | | attributes.add(BasicMonitoringAttributes.AVERAGE_REQUEST_BACKLOG); |
| | | attributes.add(BasicMonitoringAttributes.MAX_REQUEST_BACKLOG); |
| | |
| | | attributes.add(BasicMonitoringAttributes.REQUESTS_SUBMITTED); |
| | | attributes.add(BasicMonitoringAttributes.REQUESTS_REJECTED); |
| | | } |
| | | private ArrayList<JLabel> monitoringLabels = |
| | | new ArrayList<JLabel>(); |
| | | private ArrayList<JLabel> monitoringLabels = new ArrayList<>(); |
| | | { |
| | | for (int i=0; i<attributes.size(); i++) |
| | | { |
| | |
| | | }; |
| | | |
| | | |
| | | availableListModel = new SortableListModel<T>(); |
| | | availableListModel = new SortableListModel<>(); |
| | | availableListModel.addListDataListener(listDataListener); |
| | | availableList = new JList(); |
| | | availableList.setModel(availableListModel); |
| | | availableList.setVisibleRowCount(15); |
| | | availableList.addMouseListener(doubleClickListener); |
| | | |
| | | selectedListModel = new SortableListModel<T>(); |
| | | selectedListModel = new SortableListModel<>(); |
| | | selectedListModel.addListDataListener(listDataListener); |
| | | selectedList = new JList(); |
| | | selectedList.setModel(selectedListModel); |
| | |
| | | super.addMouseListener(mouseListener); |
| | | if (mouseListeners == null) |
| | | { |
| | | mouseListeners = new HashSet<MouseListener>(); |
| | | mouseListeners = new HashSet<>(); |
| | | } |
| | | mouseListeners.add(mouseListener); |
| | | } |
| | |
| | | private JList selectedList1; |
| | | private JList selectedList2; |
| | | private Class<T> theClass; |
| | | private Collection<T> unmovableItems = new ArrayList<T>(); |
| | | private Collection<T> unmovableItems = new ArrayList<>(); |
| | | private boolean ignoreListEvents; |
| | | |
| | | /** |
| | |
| | | }; |
| | | |
| | | |
| | | availableListModel = new SortableListModel<T>(); |
| | | availableListModel = new SortableListModel<>(); |
| | | availableListModel.addListDataListener(listDataListener); |
| | | availableList = new JList(); |
| | | availableList.setModel(availableListModel); |
| | | availableList.setVisibleRowCount(15); |
| | | availableList.addMouseListener(doubleClickListener); |
| | | |
| | | selectedListModel1 = new SortableListModel<T>(); |
| | | selectedListModel1 = new SortableListModel<>(); |
| | | selectedListModel1.addListDataListener(listDataListener); |
| | | selectedList1 = new JList(); |
| | | selectedList1.setModel(selectedListModel1); |
| | | selectedList1.setVisibleRowCount(7); |
| | | selectedList1.addMouseListener(doubleClickListener); |
| | | |
| | | selectedListModel2 = new SortableListModel<T>(); |
| | | selectedListModel2 = new SortableListModel<>(); |
| | | selectedListModel2.addListDataListener(listDataListener); |
| | | selectedList2 = new JList(); |
| | | selectedList2.setModel(selectedListModel2); |
| | |
| | | */ |
| | | public static long DEFAULT_REFRESH_ICON_TIME = 750; |
| | | |
| | | private LinkedHashSet<ActionListener> listeners = |
| | | new LinkedHashSet<ActionListener>(); |
| | | |
| | | private LinkedHashSet<ActionListener> listeners = new LinkedHashSet<>(); |
| | | private boolean constructorBorderSet; |
| | | |
| | | /** |
| | | * Default constructor. |
| | | * |
| | | */ |
| | | /** Default constructor. */ |
| | | public FilterTextField() |
| | | { |
| | | super(15); |
| | |
| | | LocalizableMessageBuilder sb = new LocalizableMessageBuilder(); |
| | | if (value != null) |
| | | { |
| | | Set<String> aux = new TreeSet<String>(value.getAuxiliary()); |
| | | Set<String> aux = new TreeSet<>(value.getAuxiliary()); |
| | | aux.remove("top"); |
| | | if (value.getStructural() != null) |
| | | { |
| | |
| | | { |
| | | private static final long serialVersionUID = 123123973933568L; |
| | | |
| | | private Set<ObjectClass> toExclude = new HashSet<ObjectClass>(); |
| | | private Set<ObjectClass> toExclude = new HashSet<>(); |
| | | private JComboBox singleSuperior = Utilities.createComboBox(); |
| | | private JLabel multipleSuperiors = Utilities.createDefaultLabel(); |
| | | private JButton bSpecifyMultiple = Utilities.createButton( |
| | |
| | | |
| | | private boolean isMultiple; |
| | | |
| | | private Set<ObjectClass> selectedMultipleSuperiors = |
| | | new HashSet<ObjectClass>(); |
| | | |
| | | private Set<SuperiorObjectClassesChangedListener> listeners = |
| | | new HashSet<SuperiorObjectClassesChangedListener>(); |
| | | private Set<ObjectClass> selectedMultipleSuperiors = new HashSet<>(); |
| | | private Set<SuperiorObjectClassesChangedListener> listeners = new HashSet<>(); |
| | | |
| | | private Schema schema; |
| | | |
| | |
| | | private void updateMultipleSuperiorsLabel( |
| | | Set<ObjectClass> superiors) |
| | | { |
| | | SortedSet<String> orderedOcs = |
| | | new TreeSet<String>(new LowerCaseComparator()); |
| | | SortedSet<String> orderedOcs = new TreeSet<>(new LowerCaseComparator()); |
| | | for (ObjectClass oc : superiors) |
| | | { |
| | | orderedOcs.add(oc.getNameOrOID()); |
| | |
| | | |
| | | private void updateWithSchema(Schema schema) |
| | | { |
| | | HashMap<String, ObjectClass> objectClassNameMap = new HashMap<String, |
| | | ObjectClass>(); |
| | | HashMap<String, ObjectClass> objectClassNameMap = new HashMap<>(); |
| | | for (String key : schema.getObjectClasses().keySet()) |
| | | { |
| | | ObjectClass oc = schema.getObjectClass(key); |
| | |
| | | objectClassNameMap.put(oc.getNameOrOID(), oc); |
| | | } |
| | | } |
| | | SortedSet<String> orderedKeys = |
| | | new TreeSet<String>(new LowerCaseComparator()); |
| | | SortedSet<String> orderedKeys = new TreeSet<>(new LowerCaseComparator()); |
| | | orderedKeys.addAll(objectClassNameMap.keySet()); |
| | | ArrayList<Object> newParents = new ArrayList<Object>(); |
| | | ArrayList<Object> newParents = new ArrayList<>(); |
| | | for (String key : orderedKeys) |
| | | { |
| | | newParents.add(objectClassNameMap.get(key)); |
| | |
| | | private ImageIcon lockIcon = |
| | | Utilities.createImageIcon(IconPool.IMAGE_PATH+"/field-locked.png"); |
| | | private Schema schema; |
| | | private Collection<String> requiredAttrs = new ArrayList<String>(); |
| | | private Collection<String> requiredAttrs = new ArrayList<>(); |
| | | |
| | | /** |
| | | * Constructor of the cell renderer. |