| | |
| | | import org.forgerock.i18n.LocalizableMessageDescriptor.Arg1; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.opends.server.admin.std.server.BackendCfg; |
| | | import org.opends.server.api.Backend; |
| | | import org.opends.server.api.Backend.BackendOperation; |
| | |
| | | // Required attributes |
| | | addLdapAttribute(attributes, ATTR_REBUILD_BASE_DN, baseDNString.getValue()); |
| | | |
| | | final List<String> indexes = indexList.getValues(); |
| | | final ArrayList<ByteString> values = new ArrayList<>(indexes.size()); |
| | | for (final String s : indexes) |
| | | { |
| | | values.add(ByteString.valueOf(s)); |
| | | } |
| | | attributes.add(new LDAPAttribute(ATTR_REBUILD_INDEX, values)); |
| | | attributes.add(new LDAPAttribute(ATTR_REBUILD_INDEX, indexList.getValues())); |
| | | |
| | | if (hasNonDefaultValue(tmpDirectory)) |
| | | { |
| | |
| | | |
| | | private void addLdapAttribute(List<RawAttribute> attributes, String attrType, String attrValue) |
| | | { |
| | | attributes.add(new LDAPAttribute(attrType, toByteStrings(attrValue))); |
| | | attributes.add(new LDAPAttribute(attrType, attrValue)); |
| | | } |
| | | |
| | | private boolean hasNonDefaultValue(BooleanArgument arg) |
| | |
| | | && !arg.getValue().equals(arg.getDefaultValue()); |
| | | } |
| | | |
| | | private ArrayList<ByteString> toByteStrings(String value) |
| | | { |
| | | final ArrayList<ByteString> values = new ArrayList<>(1); |
| | | values.add(ByteString.valueOf(value)); |
| | | return values; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getTaskObjectclass() |