JAMES-1717 Add methods skeleton to Guice
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/847a81ea Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/847a81ea Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/847a81ea Branch: refs/heads/master Commit: 847a81ea905bcfeac43e6bc4940ed779d7a5c597 Parents: 8aaaab0 Author: Benoit Tellier <[email protected]> Authored: Tue Apr 5 16:14:45 2016 +0700 Committer: Benoit Tellier <[email protected]> Committed: Fri Apr 22 15:28:59 2016 +0700 ---------------------------------------------------------------------- .../org/apache/james/jmap/MethodsModule.java | 4 ++ .../jmap/methods/GetVacationResponseMethod.java | 47 ++++++++++++++++++++ .../jmap/methods/SetVacationResponseMethod.java | 47 ++++++++++++++++++++ .../methods/GetVacationResponseMethodTest.java | 32 +++++++++++++ .../methods/SetVacationResponseMethodTest.java | 32 +++++++++++++ 5 files changed, 162 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/847a81ea/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/MethodsModule.java ---------------------------------------------------------------------- diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/MethodsModule.java b/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/MethodsModule.java index 2b14c94..d1422ff 100644 --- a/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/MethodsModule.java +++ b/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/MethodsModule.java @@ -23,6 +23,7 @@ import org.apache.james.jmap.json.ObjectMapperFactory; import org.apache.james.jmap.methods.GetMailboxesMethod; import org.apache.james.jmap.methods.GetMessageListMethod; import org.apache.james.jmap.methods.GetMessagesMethod; +import org.apache.james.jmap.methods.GetVacationResponseMethod; import org.apache.james.jmap.methods.JmapRequestParser; import org.apache.james.jmap.methods.JmapRequestParserImpl; import org.apache.james.jmap.methods.JmapResponseWriter; @@ -38,6 +39,7 @@ import org.apache.james.jmap.methods.SetMessagesDestructionProcessor; import org.apache.james.jmap.methods.SetMessagesMethod; import org.apache.james.jmap.methods.SetMessagesProcessor; import org.apache.james.jmap.methods.SetMessagesUpdateProcessor; +import org.apache.james.jmap.methods.SetVacationResponseMethod; import org.apache.james.mailbox.store.mail.model.MailboxId; import org.apache.james.utils.GuiceGenericType; @@ -69,6 +71,8 @@ public class MethodsModule<Id extends MailboxId> extends AbstractModule { methods.addBinding().to(guiceGenericType.newGenericType(GetMessagesMethod.class)); methods.addBinding().to(guiceGenericType.newGenericType(SetMessagesMethod.class)); methods.addBinding().to(guiceGenericType.newGenericType(SetMailboxesMethod.class)); + methods.addBinding().to(guiceGenericType.newGenericType(GetVacationResponseMethod.class)); + methods.addBinding().to(guiceGenericType.newGenericType(SetVacationResponseMethod.class)); Multibinder<SetMailboxesProcessor<Id>> setMailboxesProcessor = Multibinder.newSetBinder(binder(), guiceGenericType.newGenericType(SetMailboxesProcessor.class)); http://git-wip-us.apache.org/repos/asf/james-project/blob/847a81ea/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetVacationResponseMethod.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetVacationResponseMethod.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetVacationResponseMethod.java new file mode 100644 index 0000000..964af0e --- /dev/null +++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/GetVacationResponseMethod.java @@ -0,0 +1,47 @@ +/**************************************************************** + * 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.jmap.methods; + +import java.util.stream.Stream; + +import org.apache.commons.lang.NotImplementedException; +import org.apache.james.jmap.model.ClientId; +import org.apache.james.jmap.model.GetVacationRequest; +import org.apache.james.mailbox.MailboxSession; + +public class GetVacationResponseMethod implements Method { + + public static final Request.Name METHOD_NAME = Request.name("getVacationResponse"); + + @Override + public Request.Name requestHandled() { + return METHOD_NAME; + } + + @Override + public Class<? extends JmapRequest> requestType() { + return GetVacationRequest.class; + } + + @Override + public Stream<JmapResponse> process(JmapRequest request, ClientId clientId, MailboxSession mailboxSession) { + throw new NotImplementedException(); + } +} http://git-wip-us.apache.org/repos/asf/james-project/blob/847a81ea/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetVacationResponseMethod.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetVacationResponseMethod.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetVacationResponseMethod.java new file mode 100644 index 0000000..fde83d2 --- /dev/null +++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/methods/SetVacationResponseMethod.java @@ -0,0 +1,47 @@ +/**************************************************************** + * 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.jmap.methods; + +import java.util.stream.Stream; + +import org.apache.commons.lang.NotImplementedException; +import org.apache.james.jmap.model.ClientId; +import org.apache.james.jmap.model.SetVacationRequest; +import org.apache.james.mailbox.MailboxSession; + +public class SetVacationResponseMethod implements Method { + + public static final Request.Name METHOD_NAME = Request.name("setVacationResponse"); + + @Override + public Request.Name requestHandled() { + return METHOD_NAME; + } + + @Override + public Class<? extends JmapRequest> requestType() { + return SetVacationRequest.class; + } + + @Override + public Stream<JmapResponse> process(JmapRequest request, ClientId clientId, MailboxSession mailboxSession) { + throw new NotImplementedException(); + } +} http://git-wip-us.apache.org/repos/asf/james-project/blob/847a81ea/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetVacationResponseMethodTest.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetVacationResponseMethodTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetVacationResponseMethodTest.java new file mode 100644 index 0000000..d8ec531 --- /dev/null +++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetVacationResponseMethodTest.java @@ -0,0 +1,32 @@ +/**************************************************************** + * 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.jmap.methods; + +import org.apache.commons.lang.NotImplementedException; +import org.junit.Test; + +public class GetVacationResponseMethodTest { + + @Test(expected = NotImplementedException.class) + public void setVacationResponseMethodIsNotImplemented() { + new GetVacationResponseMethod().process(null, null, null); + } + +} http://git-wip-us.apache.org/repos/asf/james-project/blob/847a81ea/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetVacationResponseMethodTest.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetVacationResponseMethodTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetVacationResponseMethodTest.java new file mode 100644 index 0000000..61c4237 --- /dev/null +++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetVacationResponseMethodTest.java @@ -0,0 +1,32 @@ +/**************************************************************** + * 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.jmap.methods; + +import org.apache.commons.lang.NotImplementedException; +import org.junit.Test; + +public class SetVacationResponseMethodTest { + + @Test(expected = NotImplementedException.class) + public void setVacationResponseMethodIsNotImplemented() { + new SetVacationResponseMethod().process(null, null, null); + } + +} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
