james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [1/7] james-project git commit: JAMES-1948 define new columns for deleted message
Date Thu, 02 Mar 2017 13:44:43 GMT
Repository: james-project
Updated Branches:
  refs/heads/master 35cb47ae4 -> 290ada2bc


JAMES-1948 define new columns for deleted message


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/9deededf
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/9deededf
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/9deededf

Branch: refs/heads/master
Commit: 9deededf8075868ded50c2da12e9391ee500b115
Parents: afe1558
Author: Luc DUZAN <lduzan@linagora.com>
Authored: Wed Feb 22 16:55:57 2017 +0100
Committer: Luc DUZAN <lduzan@linagora.com>
Committed: Thu Mar 2 10:51:10 2017 +0100

----------------------------------------------------------------------
 .../modules/CassandraDeletedMessageModule.java  | 67 ++++++++++++++++++++
 .../table/CassandraDeletedMessageTable.java     | 38 +++++++++++
 2 files changed, 105 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/9deededf/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/modules/CassandraDeletedMessageModule.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/modules/CassandraDeletedMessageModule.java
b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/modules/CassandraDeletedMessageModule.java
new file mode 100644
index 0000000..100f248
--- /dev/null
+++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/modules/CassandraDeletedMessageModule.java
@@ -0,0 +1,67 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.cassandra.modules;
+
+import com.datastax.driver.core.DataType;
+import com.datastax.driver.core.schemabuilder.SchemaBuilder;
+import com.google.common.collect.ImmutableList;
+import org.apache.james.backends.cassandra.components.CassandraIndex;
+import org.apache.james.backends.cassandra.components.CassandraModule;
+import org.apache.james.backends.cassandra.components.CassandraTable;
+import org.apache.james.backends.cassandra.components.CassandraType;
+
+import java.util.List;
+
+import static org.apache.james.mailbox.cassandra.table.CassandraDeletedMessageTable.MAILBOX_ID;
+import static org.apache.james.mailbox.cassandra.table.CassandraDeletedMessageTable.TABLE_NAME;
+import static org.apache.james.mailbox.cassandra.table.CassandraDeletedMessageTable.UID;
+
+public class CassandraDeletedMessageModule implements CassandraModule {
+
+    private final List<CassandraTable> tables;
+    private final List<CassandraIndex> index;
+    private final List<CassandraType> types;
+
+    public CassandraDeletedMessageModule() {
+        tables = ImmutableList.of(new CassandraTable(TABLE_NAME,
+            SchemaBuilder.createTable(TABLE_NAME)
+                .ifNotExists()
+                .addPartitionKey(MAILBOX_ID, DataType.timeuuid())
+                .addClusteringColumn(UID, DataType.bigint())));
+        index = ImmutableList.of();
+        types = ImmutableList.of();
+    }
+
+    @Override
+    public List<CassandraTable> moduleTables() {
+        return tables;
+    }
+
+    @Override
+    public List<CassandraIndex> moduleIndex() {
+        return index;
+    }
+
+    @Override
+    public List<CassandraType> moduleTypes() {
+        return types;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/9deededf/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraDeletedMessageTable.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraDeletedMessageTable.java
b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraDeletedMessageTable.java
new file mode 100644
index 0000000..f5028d2
--- /dev/null
+++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/table/CassandraDeletedMessageTable.java
@@ -0,0 +1,38 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.cassandra.table;
+
+import java.util.List;
+
+import org.apache.james.backends.cassandra.components.CassandraIndex;
+import org.apache.james.backends.cassandra.components.CassandraModule;
+import org.apache.james.backends.cassandra.components.CassandraTable;
+import org.apache.james.backends.cassandra.components.CassandraType;
+
+import com.datastax.driver.core.DataType;
+import com.datastax.driver.core.schemabuilder.SchemaBuilder;
+import com.google.common.collect.ImmutableList;
+
+public interface CassandraDeletedMessageTable {
+    String TABLE_NAME = "messageDeleted";
+
+    String MAILBOX_ID = "mailboxId";
+    String UID = "uid";
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message