| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.LinkedHashSet; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.AttributeUsage; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.Attributes; |
| | | import org.opends.server.types.ByteStringFactory; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DirectoryConfig; |
| | |
| | | byte[] dnBytes = getBytes(entry.getDN().toNormalizedString()); |
| | | UUID uuid = UUID.nameUUIDFromBytes(dnBytes); |
| | | |
| | | LinkedHashSet<AttributeValue> values = new LinkedHashSet<AttributeValue>(1); |
| | | values.add(new AttributeValue(entryUUIDType, |
| | | ByteStringFactory.create(uuid.toString()))); |
| | | |
| | | Attribute uuidAttr = Attributes.create(entryUUIDType, |
| | | new AttributeValue(entryUUIDType, ByteStringFactory.create(uuid |
| | | .toString()))); |
| | | uuidList = new ArrayList<Attribute>(1); |
| | | Attribute uuidAttr = new Attribute(entryUUIDType, "entryUUID", values); |
| | | uuidList.add(uuidAttr); |
| | | entry.putAttribute(entryUUIDType, uuidList); |
| | | |
| | |
| | | |
| | | // Construct a new random UUID. |
| | | UUID uuid = UUID.randomUUID(); |
| | | |
| | | LinkedHashSet<AttributeValue> values = new LinkedHashSet<AttributeValue>(1); |
| | | values.add(new AttributeValue(entryUUIDType, |
| | | ByteStringFactory.create(uuid.toString()))); |
| | | |
| | | Attribute uuidAttr = Attributes.create(entryUUIDType, |
| | | new AttributeValue(entryUUIDType, ByteStringFactory.create(uuid |
| | | .toString()))); |
| | | uuidList = new ArrayList<Attribute>(1); |
| | | Attribute uuidAttr = new Attribute(entryUUIDType, "entryUUID", values); |
| | | uuidList.add(uuidAttr); |
| | | |
| | | |