james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [14/21] james-project git commit: JAMES-1902 create managedsieve module
Date Tue, 14 Mar 2017 11:14:55 GMT
JAMES-1902 create managedsieve module


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

Branch: refs/heads/master
Commit: dc0325198570bc62e14a8ed9536528183659410b
Parents: 1a986e1
Author: Matthieu Baechler <matthieu.baechler@gmail.com>
Authored: Tue Dec 27 14:32:55 2016 +0100
Committer: benwa <btellier@linagora.com>
Committed: Tue Mar 14 18:13:55 2017 +0700

----------------------------------------------------------------------
 server/container/guice/guice-common/pom.xml     |  12 +-
 .../protocols/ManageSieveServerModule.java      |  77 --------
 server/container/guice/pom.xml                  |   6 +
 .../guice/protocols/managedsieve/pom.xml        | 188 +++++++++++++++++++
 .../protocols/ManageSieveServerModule.java      |  77 ++++++++
 5 files changed, 275 insertions(+), 85 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/dc032519/server/container/guice/guice-common/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/pom.xml b/server/container/guice/guice-common/pom.xml
index 702fade..1576d90 100644
--- a/server/container/guice/guice-common/pom.xml
+++ b/server/container/guice/guice-common/pom.xml
@@ -197,6 +197,10 @@
                 </dependency>
                 <dependency>
                     <groupId>${project.groupId}</groupId>
+                    <artifactId>james-server-guice-managedsieve</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>${project.groupId}</groupId>
                     <artifactId>james-server-guice-smtp</artifactId>
                 </dependency>
                 <dependency>
@@ -237,10 +241,6 @@
                 </dependency>
                 <dependency>
                     <groupId>${project.groupId}</groupId>
-                    <artifactId>james-server-protocols-managesieve</artifactId>
-                </dependency>
-                <dependency>
-                    <groupId>${project.groupId}</groupId>
                     <artifactId>james-server-protocols-pop3</artifactId>
                 </dependency>
                 <dependency>
@@ -268,10 +268,6 @@
                     <artifactId>protocols-imap</artifactId>
                 </dependency>
                 <dependency>
-                    <groupId>org.apache.james.protocols</groupId>
-                    <artifactId>protocols-managesieve</artifactId>
-                </dependency>
-                <dependency>
                     <groupId>com.google.inject</groupId>
                     <artifactId>guice</artifactId>
                 </dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/dc032519/server/container/guice/guice-common/src/main/java/org/apache/james/modules/protocols/ManageSieveServerModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/protocols/ManageSieveServerModule.java
b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/protocols/ManageSieveServerModule.java
deleted file mode 100644
index 539dba6..0000000
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/protocols/ManageSieveServerModule.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************
- * 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.modules.protocols;
-
-import java.util.List;
-
-import org.apache.james.lifecycle.api.Configurable;
-import org.apache.james.managesieve.api.commands.CoreCommands;
-import org.apache.james.managesieve.core.CoreProcessor;
-import org.apache.james.managesieveserver.netty.ManageSieveServerFactory;
-import org.apache.james.utils.ConfigurationPerformer;
-import org.apache.james.utils.ConfigurationProvider;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Throwables;
-import com.google.common.collect.ImmutableList;
-import com.google.inject.AbstractModule;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import com.google.inject.multibindings.Multibinder;
-
-public class ManageSieveServerModule extends AbstractModule {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(ManageSieveServerModule.class);
-
-    @Override
-    protected void configure() {
-        bind(CoreCommands.class).to(CoreProcessor.class);
-        Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(ManageSieveModuleConfigurationPerformer.class);
-    }
-
-    @Singleton
-    public static class ManageSieveModuleConfigurationPerformer implements ConfigurationPerformer
{
-
-        private final ConfigurationProvider configurationProvider;
-        private final ManageSieveServerFactory manageSieveServerFactory;
-
-        @Inject
-        public ManageSieveModuleConfigurationPerformer(ConfigurationProvider configurationProvider,
ManageSieveServerFactory manageSieveServerFactory) {
-            this.configurationProvider = configurationProvider;
-            this.manageSieveServerFactory = manageSieveServerFactory;
-        }
-
-        @Override
-        public void initModule() {
-            try {
-                manageSieveServerFactory.setLog(LOGGER);
-                manageSieveServerFactory.configure(configurationProvider.getConfiguration("managesieveserver"));
-                manageSieveServerFactory.init();
-            } catch (Exception e) {
-                Throwables.propagate(e);
-            }
-        }
-
-        @Override
-        public List<Class<? extends Configurable>> forClasses() {
-            return ImmutableList.of(ManageSieveServerFactory.class);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/dc032519/server/container/guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/pom.xml b/server/container/guice/pom.xml
index 9cd80d5..7c712cd 100644
--- a/server/container/guice/pom.xml
+++ b/server/container/guice/pom.xml
@@ -56,6 +56,11 @@
             </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
+                <artifactId>james-server-guice-managedsieve</artifactId>
+                <version>3.0.0-beta6-SNAPSHOT</version>
+            </dependency>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
                 <artifactId>james-server-guice-pop</artifactId>
                 <version>3.0.0-beta6-SNAPSHOT</version>
             </dependency>
@@ -78,6 +83,7 @@
         <module>onami</module>
         <module>protocols/imap</module>
         <module>protocols/lmtp</module>
+        <module>protocols/managedsieve</module>
         <module>protocols/pop</module>
         <module>protocols/smtp</module>
     </modules>

http://git-wip-us.apache.org/repos/asf/james-project/blob/dc032519/server/container/guice/protocols/managedsieve/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/protocols/managedsieve/pom.xml b/server/container/guice/protocols/managedsieve/pom.xml
new file mode 100644
index 0000000..6f97529
--- /dev/null
+++ b/server/container/guice/protocols/managedsieve/pom.xml
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>james-server-guice</artifactId>
+        <groupId>org.apache.james</groupId>
+        <version>3.0.0-beta6-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>james-server-guice-managedsieve</artifactId>
+
+    <name>Apache James :: Server :: Guice :: Managedsieve</name>
+    <description>Managedsieve modules for Guice implementation of James server</description>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>disable-build-for-older-jdk</id>
+            <activation>
+                <jdk>(,1.8)</jdk>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-jar-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>default-jar</id>
+                                <phase>none</phase>
+                            </execution>
+                            <execution>
+                                <id>jar</id>
+                                <phase>none</phase>
+                            </execution>
+                            <execution>
+                                <id>test-jar</id>
+                                <phase>none</phase>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-compiler-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>default-compile</id>
+                                <phase>none</phase>
+                            </execution>
+                            <execution>
+                                <id>default-testCompile</id>
+                                <phase>none</phase>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>default-test</id>
+                                <phase>none</phase>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-source-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>attach-sources</id>
+                                <phase>none</phase>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-install-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>default-install</id>
+                                <phase>none</phase>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-resources-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>default-resources</id>
+                                <phase>none</phase>
+                            </execution>
+                            <execution>
+                                <id>default-testResources</id>
+                                <phase>none</phase>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-site-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>attach-descriptor</id>
+                                <phase>none</phase>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>build-for-jdk-8</id>
+            <activation>
+                <jdk>[1.8,)</jdk>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-compiler-plugin</artifactId>
+                        <configuration>
+                            <source>1.8</source>
+                            <target>1.8</target>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+            <dependencies>
+                <dependency>
+                    <groupId>${project.groupId}</groupId>
+                    <artifactId>james-server-guice-configuration</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>${project.groupId}</groupId>
+                    <artifactId>james-server-protocols-managesieve</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>org.apache.james.protocols</groupId>
+                    <artifactId>protocols-managesieve</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>com.google.inject</groupId>
+                    <artifactId>guice</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>com.google.inject.extensions</groupId>
+                    <artifactId>guice-multibindings</artifactId>
+                </dependency>
+            </dependencies>
+        </profile>
+        <profile>
+            <id>animal-sniffer-java-8</id>
+            <activation>
+                <jdk>[1.8,)</jdk>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>animal-sniffer-maven-plugin</artifactId>
+                        <configuration>
+                            <signature>
+                                <groupId>org.codehaus.mojo.signature</groupId>
+                                <artifactId>java18</artifactId>
+                                <version>1.0</version>
+                            </signature>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>check_java_8</id>
+                                <phase>test</phase>
+                                <goals>
+                                    <goal>check</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+</project>

http://git-wip-us.apache.org/repos/asf/james-project/blob/dc032519/server/container/guice/protocols/managedsieve/src/main/java/org/apache/james/modules/protocols/ManageSieveServerModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/protocols/managedsieve/src/main/java/org/apache/james/modules/protocols/ManageSieveServerModule.java
b/server/container/guice/protocols/managedsieve/src/main/java/org/apache/james/modules/protocols/ManageSieveServerModule.java
new file mode 100644
index 0000000..539dba6
--- /dev/null
+++ b/server/container/guice/protocols/managedsieve/src/main/java/org/apache/james/modules/protocols/ManageSieveServerModule.java
@@ -0,0 +1,77 @@
+/****************************************************************
+ * 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.modules.protocols;
+
+import java.util.List;
+
+import org.apache.james.lifecycle.api.Configurable;
+import org.apache.james.managesieve.api.commands.CoreCommands;
+import org.apache.james.managesieve.core.CoreProcessor;
+import org.apache.james.managesieveserver.netty.ManageSieveServerFactory;
+import org.apache.james.utils.ConfigurationPerformer;
+import org.apache.james.utils.ConfigurationProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Throwables;
+import com.google.common.collect.ImmutableList;
+import com.google.inject.AbstractModule;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import com.google.inject.multibindings.Multibinder;
+
+public class ManageSieveServerModule extends AbstractModule {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(ManageSieveServerModule.class);
+
+    @Override
+    protected void configure() {
+        bind(CoreCommands.class).to(CoreProcessor.class);
+        Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(ManageSieveModuleConfigurationPerformer.class);
+    }
+
+    @Singleton
+    public static class ManageSieveModuleConfigurationPerformer implements ConfigurationPerformer
{
+
+        private final ConfigurationProvider configurationProvider;
+        private final ManageSieveServerFactory manageSieveServerFactory;
+
+        @Inject
+        public ManageSieveModuleConfigurationPerformer(ConfigurationProvider configurationProvider,
ManageSieveServerFactory manageSieveServerFactory) {
+            this.configurationProvider = configurationProvider;
+            this.manageSieveServerFactory = manageSieveServerFactory;
+        }
+
+        @Override
+        public void initModule() {
+            try {
+                manageSieveServerFactory.setLog(LOGGER);
+                manageSieveServerFactory.configure(configurationProvider.getConfiguration("managesieveserver"));
+                manageSieveServerFactory.init();
+            } catch (Exception e) {
+                Throwables.propagate(e);
+            }
+        }
+
+        @Override
+        public List<Class<? extends Configurable>> forClasses() {
+            return ImmutableList.of(ManageSieveServerFactory.class);
+        }
+    }
+}
\ No newline at end of file


---------------------------------------------------------------------
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