You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by li...@apache.org on 2009/08/13 21:52:47 UTC

svn commit: r804010 - in /incubator/shindig/trunk/java/social-api/src: main/java/org/apache/shindig/social/opensocial/spi/ main/java/org/apache/shindig/social/sample/ test/java/org/apache/shindig/social/

Author: lindner
Date: Thu Aug 13 19:52:46 2009
New Revision: 804010

URL: http://svn.apache.org/viewvc?rev=804010&view=rev
Log:
SHINDIG-1150 | Unbind messageservice from JsonDbOpensocialService

Modified:
    incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/spi/MessageService.java
    incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/sample/SampleModule.java
    incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/SocialApiTestsGuiceModule.java

Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/spi/MessageService.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/spi/MessageService.java?rev=804010&r1=804009&r2=804010&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/spi/MessageService.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/spi/MessageService.java Thu Aug 13 19:52:46 2009
@@ -30,14 +30,15 @@
 import java.util.List;
 import java.util.concurrent.Future;
 
+import javax.servlet.http.HttpServletResponse;
+
 /**
  * The MessageService interface defines the service provider interface to post messages to
  * the underlying SNS.
  */
-@ImplementedBy(JsonDbOpensocialService.class)
+@ImplementedBy(MessageService.NotImplementedMessageService.class)
 public interface MessageService {
 
-
   /**
    * Returns a list of message collections corresponding to the given user
    *
@@ -147,4 +148,42 @@
   Future<Void> modifyMessage(UserId userId, String msgCollId, String messageId, Message message, SecurityToken token)
       throws ProtocolException;
 
+  public static class NotImplementedMessageService implements MessageService {
+    public Future<RestfulCollection<MessageCollection>> getMessageCollections(UserId userId,
+       Set<String> fields, CollectionOptions options, SecurityToken token) throws ProtocolException {
+      throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "Not Implemented");
+    }
+
+    public Future<MessageCollection> createMessageCollection(UserId userId, MessageCollection msgCollection, SecurityToken token)  throws ProtocolException {
+      throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "Not Implemented");
+    }
+
+    public Future<Void> modifyMessageCollection(UserId userId, MessageCollection msgCollection, SecurityToken token) throws ProtocolException {
+      throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "Not Implemented");
+    }
+
+    public Future<Void> deleteMessageCollection(UserId userId, String msgCollId, SecurityToken token) throws ProtocolException {
+      throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "Not Implemented");
+    }
+
+    public Future<RestfulCollection<Message>> getMessages(UserId userId, String msgCollId,
+        Set<String> fields, List<String> msgIds, CollectionOptions options, SecurityToken token) throws ProtocolException {
+      throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "Not Implemented");
+    }
+
+    public Future<Void> createMessage(UserId userId, String appId, String msgCollId, Message message,
+                               SecurityToken token) throws ProtocolException {
+      throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "Not Implemented");
+    }
+
+    public Future<Void> deleteMessages(UserId userId, String msgCollId, List<String> ids,
+        SecurityToken token) throws ProtocolException {
+      throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "Not Implemented");
+    }
+
+    public Future<Void> modifyMessage(UserId userId, String msgCollId, String messageId, Message message, SecurityToken token)
+        throws ProtocolException {
+      throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "Not Implemented");
+    }
+  }
 }

Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/sample/SampleModule.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/sample/SampleModule.java?rev=804010&r1=804009&r2=804010&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/sample/SampleModule.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/sample/SampleModule.java Thu Aug 13 19:52:46 2009
@@ -21,6 +21,7 @@
 import org.apache.shindig.social.opensocial.oauth.OAuthDataStore;
 import org.apache.shindig.social.opensocial.spi.ActivityService;
 import org.apache.shindig.social.opensocial.spi.AppDataService;
+import org.apache.shindig.social.opensocial.spi.MessageService;
 import org.apache.shindig.social.opensocial.spi.PersonService;
 import org.apache.shindig.social.sample.oauth.SampleOAuthDataStore;
 import org.apache.shindig.social.sample.oauth.SampleRealm;
@@ -49,6 +50,7 @@
     bind(ActivityService.class).to(JsonDbOpensocialService.class);
     bind(AppDataService.class).to(JsonDbOpensocialService.class);
     bind(PersonService.class).to(JsonDbOpensocialService.class);
+    bind(MessageService.class).to(JsonDbOpensocialService.class);
     
     bind(OAuthDataStore.class).to(SampleOAuthDataStore.class);
 

Modified: incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/SocialApiTestsGuiceModule.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/SocialApiTestsGuiceModule.java?rev=804010&r1=804009&r2=804010&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/SocialApiTestsGuiceModule.java (original)
+++ incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/SocialApiTestsGuiceModule.java Thu Aug 13 19:52:46 2009
@@ -33,16 +33,23 @@
 import org.apache.shindig.social.opensocial.service.MessageHandler;
 import org.apache.shindig.social.opensocial.spi.ActivityService;
 import org.apache.shindig.social.opensocial.spi.AppDataService;
+import org.apache.shindig.social.opensocial.spi.MessageService;
 import org.apache.shindig.social.opensocial.spi.PersonService;
 import org.apache.shindig.social.sample.spi.JsonDbOpensocialService;
 
+import org.easymock.EasyMock;
+
 import com.google.common.collect.ImmutableSet;
 import com.google.inject.AbstractModule;
 import com.google.inject.TypeLiteral;
+import com.google.inject.Provider;
 import com.google.inject.name.Names;
 
 import java.util.Set;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.ServletRequest;
+
 /**
  * Provides social api component injection for all large tests
  */
@@ -55,6 +62,7 @@
 
     bind(ActivityService.class).to(JsonDbOpensocialService.class);
     bind(AppDataService.class).to(JsonDbOpensocialService.class);
+    bind(MessageService.class).to(JsonDbOpensocialService.class);
     bind(PersonService.class).to(JsonDbOpensocialService.class);
 
     bind(String.class).annotatedWith(Names.named("shindig.canonical.json.db"))