| | |
| | | import org.opends.server.core.ModifyDNOperation; |
| | | import org.opends.server.core.SearchOperation; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeBuilder; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.Attributes; |
| | | import org.opends.server.types.BackupConfig; |
| | | import org.opends.server.types.BackupDirectory; |
| | | import org.opends.server.types.BackupInfo; |
| | | import org.opends.server.types.ConditionResult; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.IndexType; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.LDIFExportConfig; |
| | | import org.opends.server.types.LDIFImportConfig; |
| | | import org.opends.server.types.LDIFImportResult; |
| | | import org.opends.server.types.ObjectClass; |
| | | import org.opends.server.types.RDN; |
| | | import org.opends.server.types.RestoreConfig; |
| | | import org.opends.server.types.ResultCode; |
| | | import org.opends.server.types.SearchFilter; |
| | | import org.opends.server.types.SearchScope; |
| | | import org.opends.server.types.*; |
| | | import org.opends.server.schema.BooleanSyntax; |
| | | import org.opends.server.schema.GeneralizedTimeSyntax; |
| | | import org.opends.server.util.Validator; |
| | |
| | | { |
| | | BackupDirectory backupDirectory = |
| | | BackupDirectory.readBackupDirectoryDescriptor( |
| | | v.getStringValue()); |
| | | v.getValue().toString()); |
| | | count += backupDirectory.getBackups().keySet().size(); |
| | | } |
| | | catch (Exception e) |
| | |
| | | try |
| | | { |
| | | backupDirectory = |
| | | BackupDirectory.readBackupDirectoryDescriptor(v.getStringValue()); |
| | | BackupDirectory.readBackupDirectoryDescriptor( |
| | | v.getValue().toString()); |
| | | } |
| | | catch (ConfigException ce) |
| | | { |
| | |
| | | |
| | | t = DirectoryServer.getAttributeType(ATTR_BACKUP_BACKEND_DN, true); |
| | | attrList = new ArrayList<Attribute>(1); |
| | | attrList.add(Attributes.create(t, new AttributeValue(t, |
| | | attrList.add(Attributes.create(t, AttributeValues.create(t, |
| | | backupDirectory.getConfigEntryDN().toString()))); |
| | | userAttrs.put(t, attrList); |
| | | |
| | |
| | | .valueOf(entryDN)); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message); |
| | | } |
| | | String backupID = idValue.getStringValue(); |
| | | String backupID = idValue.getValue().toString(); |
| | | |
| | | // Next, get the backup directory from the parent DN. |
| | | DN parentDN = entryDN.getParentDNInSuffix(); |
| | |
| | | BackupDirectory backupDirectory; |
| | | try { |
| | | backupDirectory = BackupDirectory.readBackupDirectoryDescriptor(v |
| | | .getStringValue()); |
| | | .getValue().toString()); |
| | | } catch (ConfigException ce) { |
| | | if (debugEnabled()) { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, ce); |
| | |
| | | if (backupDate != null) { |
| | | t = DirectoryServer.getAttributeType(ATTR_BACKUP_DATE, true); |
| | | attrList = new ArrayList<Attribute>(1); |
| | | attrList.add(Attributes.create(t, new AttributeValue(t, |
| | | attrList.add(Attributes.create(t, AttributeValues.create(t, |
| | | GeneralizedTimeSyntax.format(backupDate)))); |
| | | userAttrs.put(t, attrList); |
| | | } |
| | |
| | | t = DirectoryServer.getAttributeType(ATTR_BACKUP_DEPENDENCY, true); |
| | | AttributeBuilder builder = new AttributeBuilder(t); |
| | | for (String s : dependencies) { |
| | | builder.add(new AttributeValue(t, s)); |
| | | builder.add(AttributeValues.create(t, s)); |
| | | } |
| | | attrList = new ArrayList<Attribute>(1); |
| | | attrList.add(builder.toAttribute()); |
| | |
| | | if (signedHash != null) { |
| | | t = DirectoryServer.getAttributeType(ATTR_BACKUP_SIGNED_HASH, true); |
| | | attrList = new ArrayList<Attribute>(1); |
| | | attrList.add(Attributes.create(t, new AttributeValue(t, |
| | | new ASN1OctetString(signedHash)))); |
| | | attrList.add(Attributes.create(t, |
| | | AttributeValues.create(t, |
| | | ByteString.wrap(signedHash)))); |
| | | userAttrs.put(t, attrList); |
| | | } |
| | | |
| | |
| | | if (unsignedHash != null) { |
| | | t = DirectoryServer.getAttributeType(ATTR_BACKUP_UNSIGNED_HASH, true); |
| | | attrList = new ArrayList<Attribute>(1); |
| | | attrList.add(Attributes.create(t, new AttributeValue(t, |
| | | new ASN1OctetString(unsignedHash)))); |
| | | attrList.add(Attributes.create(t, |
| | | AttributeValues.create(t, |
| | | ByteString.wrap(unsignedHash)))); |
| | | userAttrs.put(t, attrList); |
| | | } |
| | | |
| | |
| | | for (Map.Entry<String, String> e : properties.entrySet()) { |
| | | t = DirectoryServer.getAttributeType(toLowerCase(e.getKey()), true); |
| | | attrList = new ArrayList<Attribute>(1); |
| | | attrList.add(Attributes.create(t, new AttributeValue( |
| | | attrList.add(Attributes.create(t, AttributeValues.create( |
| | | t, e.getValue()))); |
| | | userAttrs.put(t, attrList); |
| | | } |
| | |
| | | { |
| | | BackupDirectory backupDirectory = |
| | | BackupDirectory.readBackupDirectoryDescriptor( |
| | | v.getStringValue()); |
| | | v.getValue().toString()); |
| | | AttributeType idType = |
| | | DirectoryServer.getAttributeType(ATTR_BACKUP_ID, |
| | | true); |
| | |
| | | { |
| | | BackupDirectory backupDirectory = |
| | | BackupDirectory.readBackupDirectoryDescriptor( |
| | | v.getStringValue()); |
| | | v.getValue().toString()); |
| | | AttributeType idType = |
| | | DirectoryServer.getAttributeType(ATTR_BACKUP_ID, |
| | | true); |
| | |
| | | String rdnStringValue) |
| | | { |
| | | AttributeValue attrValue = |
| | | new AttributeValue(rdnAttrType, rdnStringValue); |
| | | AttributeValues.create(rdnAttrType, rdnStringValue); |
| | | return parentDN.concat(RDN.create(rdnAttrType, attrValue)); |
| | | } |
| | | |