Tabnine Logo
ActivityStreamService.createActivityEntry
Code IndexAdd Tabnine to your IDE (free)

How to use
createActivityEntry
method
in
org.apache.shindig.social.opensocial.spi.ActivityStreamService

Best Java code snippets using org.apache.shindig.social.opensocial.spi.ActivityStreamService.createActivityEntry (Showing top 6 results out of 315)

origin: org.apache.shindig/shindig-social-api

private Future<?> setupBodyRequest(String method) throws ProtocolException {
 String jsonActivityEntry = "{title: 'hi mom!', object: {id: 'testObject'}}";
 String path = "/activitystreams/john.doe/@self/@app";
 RestHandler operation = registry.getRestHandler(path, method);
 ActivityEntry entry = new ActivityEntryImpl();
 org.easymock.EasyMock.expect(converter.convertToObject(eq(jsonActivityEntry), eq(ActivityEntry.class)))
   .andReturn(entry);
 org.easymock.EasyMock.expect(service.createActivityEntry(eq(JOHN_DOE.iterator().next()),
   eq(new GroupId(GroupId.Type.self, null)), eq("appId"), eq(ImmutableSet.<String>of()),
   eq(entry), eq(token))).andReturn(Futures.immediateFuture((ActivityEntry) null));
 replay();
 return operation.execute(Maps.<String, String[]>newHashMap(),
   new StringReader(jsonActivityEntry), token, converter);
}
origin: org.wso2.org.apache.shindig/shindig-social-api

private Future<?> setupBodyRequest(String method) throws ProtocolException {
 String jsonActivityEntry = "{title: 'hi mom!', object: {id: 'testObject'}}";
 String path = "/activitystreams/john.doe/@self/@app";
 RestHandler operation = registry.getRestHandler(path, method);
 ActivityEntry entry = new ActivityEntryImpl();
 org.easymock.EasyMock.expect(converter.convertToObject(eq(jsonActivityEntry), eq(ActivityEntry.class)))
   .andReturn(entry);
 org.easymock.EasyMock.expect(service.createActivityEntry(eq(JOHN_DOE.iterator().next()),
   eq(new GroupId(GroupId.Type.self, null)), eq("appId"), eq(ImmutableSet.<String>of()),
   eq(entry), eq(token))).andReturn(Futures.immediateFuture((ActivityEntry) null));
 replay();
 return operation.execute(Maps.<String, String[]>newHashMap(),
   new StringReader(jsonActivityEntry), token, converter);
}
origin: org.wso2.org.apache.shindig/shindig-social-api

@Test
public void testHandlePost() throws Exception {
 String jsonActivityEntry = "{title: 'hi mom!', object: {id: 'testObject'}}";
 String path = "/activitystreams/john.doe/@self/@app";
 RestHandler operation = registry.getRestHandler(path, "POST");
 ActivityEntry entry = new ActivityEntryImpl();
 org.easymock.EasyMock.expect(converter.convertToObject(eq(jsonActivityEntry), eq(ActivityEntry.class)))
   .andReturn(entry);
 org.easymock.EasyMock.expect(service.createActivityEntry(eq(JOHN_DOE.iterator().next()),
   eq(new GroupId(GroupId.Type.self, null)), eq("appId"), eq(ImmutableSet.<String>of()),
   eq(entry), eq(token))).andReturn(Futures.immediateFuture((ActivityEntry) null));
 replay();
 Future<?> future = operation.execute(Maps.<String, String[]>newHashMap(),
   new StringReader(jsonActivityEntry), token, converter);
 assertNull(future.get());
 verify();
 reset();
}
origin: org.wso2.org.apache.shindig/shindig-social-api

/**
 * Allowed end-points /activitystreams/{userId}/@self/{appId}
 *
 * Examples: /activitystreams/john.doe/@self/{appId} - postBody is an activity object
 *
 * @param request a {@link org.apache.shindig.social.opensocial.service.SocialRequestItem} object.
 * @return a {@link java.util.concurrent.Future} object.
 * @throws org.apache.shindig.protocol.ProtocolException if any.
 */
@Operation(httpMethods="POST", bodyParam = "activity")
public Future<?> create(SocialRequestItem request) throws ProtocolException {
 Set<UserId> userIds = request.getUsers();
 List<String> activityIds = request.getListParameter("activityId");
 HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
 HandlerPreconditions.requireSingular(userIds, "Multiple userIds not supported");
 HandlerPreconditions.requireEmpty(activityIds, "Cannot specify activity ID in create");
 return service.createActivityEntry(Iterables.getOnlyElement(userIds), request.getGroup(),
   request.getAppId(), request.getFields(),
   request.getTypedParameter("activity", ActivityEntry.class),
   request.getToken());
}
origin: org.apache.shindig/shindig-social-api

@Test
public void testHandlePost() throws Exception {
 String jsonActivityEntry = "{title: 'hi mom!', object: {id: 'testObject'}}";
 String path = "/activitystreams/john.doe/@self/@app";
 RestHandler operation = registry.getRestHandler(path, "POST");
 ActivityEntry entry = new ActivityEntryImpl();
 org.easymock.EasyMock.expect(converter.convertToObject(eq(jsonActivityEntry), eq(ActivityEntry.class)))
   .andReturn(entry);
 org.easymock.EasyMock.expect(service.createActivityEntry(eq(JOHN_DOE.iterator().next()),
   eq(new GroupId(GroupId.Type.self, null)), eq("appId"), eq(ImmutableSet.<String>of()),
   eq(entry), eq(token))).andReturn(Futures.immediateFuture((ActivityEntry) null));
 replay();
 Future<?> future = operation.execute(Maps.<String, String[]>newHashMap(),
   new StringReader(jsonActivityEntry), token, converter);
 assertNull(future.get());
 verify();
 reset();
}
origin: org.apache.shindig/shindig-social-api

/**
 * Allowed end-points /activitystreams/{userId}/@self/{appId}
 *
 * Examples: /activitystreams/john.doe/@self/{appId} - postBody is an activity object
 *
 * @param request a {@link org.apache.shindig.social.opensocial.service.SocialRequestItem} object.
 * @return a {@link java.util.concurrent.Future} object.
 * @throws org.apache.shindig.protocol.ProtocolException if any.
 */
@Operation(httpMethods="POST", bodyParam = "activity")
public Future<?> create(SocialRequestItem request) throws ProtocolException {
 Set<UserId> userIds = request.getUsers();
 List<String> activityIds = request.getListParameter("activityId");
 HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
 HandlerPreconditions.requireSingular(userIds, "Multiple userIds not supported");
 HandlerPreconditions.requireEmpty(activityIds, "Cannot specify activity ID in create");
 return service.createActivityEntry(Iterables.getOnlyElement(userIds), request.getGroup(),
   request.getAppId(), request.getFields(),
   request.getTypedParameter("activity", ActivityEntry.class),
   request.getToken());
}
org.apache.shindig.social.opensocial.spiActivityStreamServicecreateActivityEntry

Javadoc

Creates the passed in activity for the passed in user and group. Once createActivity is called, getActivities will be able to return the Activity.

Popular methods of ActivityStreamService

  • deleteActivityEntries
    Deletes the activity for the passed in user and group that corresponds to the activityId.
  • getActivityEntries
    Returns a set of activities for the passed in user and group that corresponds to a list of activityI
  • getActivityEntry
    Returns an activity for the passed in user and group that corresponds to a single activityId.
  • updateActivityEntry
    Updates the specified Activity.

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • putExtra (Intent)
  • findViewById (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now