summaryrefslogtreecommitdiff
path: root/src/connectors
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2014-10-23 12:31:09 +0200
committerLudovic Pouzenc <ludovic@pouzenc.fr>2015-04-14 07:44:59 +0200
commitbe6a717ea73730d023e8bcb50d96f4c73abaafa0 (patch)
treec55d3bb31484c18c54d2acd2327aa65601352848 /src/connectors
parent2c1f4b89818e018b8677d1d621ab98194b259509 (diff)
downloadsssync-be6a717ea73730d023e8bcb50d96f4c73abaafa0.tar.gz
sssync-be6a717ea73730d023e8bcb50d96f4c73abaafa0.tar.bz2
sssync-be6a717ea73730d023e8bcb50d96f4c73abaafa0.zip
Remove useless AbstractMVDataWriter,
Add a Pair type for Writers.
Diffstat (limited to 'src/connectors')
-rw-r--r--src/connectors/src/data/io/ldap/LDAPFlatDataWriter.java24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/connectors/src/data/io/ldap/LDAPFlatDataWriter.java b/src/connectors/src/data/io/ldap/LDAPFlatDataWriter.java
index d1b8918..ba0f2be 100644
--- a/src/connectors/src/data/io/ldap/LDAPFlatDataWriter.java
+++ b/src/connectors/src/data/io/ldap/LDAPFlatDataWriter.java
@@ -40,19 +40,24 @@ import com.unboundid.ldap.sdk.schema.EntryValidator;
import com.unboundid.ldif.LDIFException;
import data.MVDataEntry;
-import data.io.AbstractMVDataWriter;
+import data.io.MVDataWriter;
/**
* Stream-oriented LDAP writer from a particular LDAP Directory connection.
*
* @author lpouzenc
*/
-public class LDAPFlatDataWriter extends AbstractMVDataWriter {
+public class LDAPFlatDataWriter implements MVDataWriter {
private final LDAPConnection conn;
private final DN baseDN;
private final String keyAttr;
private final EntryValidator validator;
+
+ /**
+ * Dry-run mode flag (disabled by default)
+ */
+ protected boolean dryRun;
/**
* Construct a new writer that could insert/update/delete entries on a particular LDAP connection and baseDN.
@@ -67,6 +72,7 @@ public class LDAPFlatDataWriter extends AbstractMVDataWriter {
this.baseDN = new DN(baseDN);
this.keyAttr = keyAttr;
this.validator = new EntryValidator(conn.getSchema());
+ this.dryRun = false;
}
/**
@@ -195,4 +201,18 @@ public class LDAPFlatDataWriter extends AbstractMVDataWriter {
}
}
+ /* (non-Javadoc)
+ * @see data.io.MVDataWriter#isDryRun()
+ */
+ public boolean isDryRun() {
+ return dryRun;
+ }
+
+ /* (non-Javadoc)
+ * @see data.io.MVDataWriter#setDryRun(boolean)
+ */
+ public void setDryRun(boolean dryRun) {
+ this.dryRun = dryRun;
+ }
+
}