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

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

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

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

/**
 * Allowed end-points /activitystreams/{userId}/@self/{appId}/{activityId}
 *
 * Examples: /activitystreams/john.doe/@self/1/object2 - 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="PUT", bodyParam = "activity")
public Future<?> update(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.requireSingular(activityIds, "Must specify exactly one activity ID");
 return service.updateActivityEntry(Iterables.getOnlyElement(userIds), request.getGroup(),
   request.getAppId(), request.getFields(),
   request.getTypedParameter("activity", ActivityEntry.class),
   activityIds.iterator().next(),
   request.getToken());
}
origin: org.wso2.org.apache.shindig/shindig-social-api

/**
 * Allowed end-points /activitystreams/{userId}/@self/{appId}/{activityId}
 *
 * Examples: /activitystreams/john.doe/@self/1/object2 - 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="PUT", bodyParam = "activity")
public Future<?> update(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.requireSingular(activityIds, "Must specify exactly one activity ID");
 return service.updateActivityEntry(Iterables.getOnlyElement(userIds), request.getGroup(),
   request.getAppId(), request.getFields(),
   request.getTypedParameter("activity", ActivityEntry.class),
   activityIds.iterator().next(),
   request.getToken());
}
origin: org.apache.shindig/shindig-social-api

@Test
public void testHandlePut() throws Exception {
 String jsonActivityEntry = "{title: 'hi mom!', object: {id: 'testObject'}}";
 String path = "/activitystreams/john.doe/@self/@app/testObject";
 RestHandler operation = registry.getRestHandler(path, "PUT");
 ActivityEntry entry = new ActivityEntryImpl();
 org.easymock.EasyMock.expect(converter.convertToObject(eq(jsonActivityEntry), eq(ActivityEntry.class)))
   .andReturn(entry);
 org.easymock.EasyMock.expect(service.updateActivityEntry(eq(JOHN_DOE.iterator().next()),
   eq(new GroupId(GroupId.Type.self, null)), eq("appId"), eq(ImmutableSet.<String>of()),
   eq(entry), eq("testObject"), 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

@Test
public void testHandlePut() throws Exception {
 String jsonActivityEntry = "{title: 'hi mom!', object: {id: 'testObject'}}";
 String path = "/activitystreams/john.doe/@self/@app/testObject";
 RestHandler operation = registry.getRestHandler(path, "PUT");
 ActivityEntry entry = new ActivityEntryImpl();
 org.easymock.EasyMock.expect(converter.convertToObject(eq(jsonActivityEntry), eq(ActivityEntry.class)))
   .andReturn(entry);
 org.easymock.EasyMock.expect(service.updateActivityEntry(eq(JOHN_DOE.iterator().next()),
   eq(new GroupId(GroupId.Type.self, null)), eq("appId"), eq(ImmutableSet.<String>of()),
   eq(entry), eq("testObject"), 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();
}
org.apache.shindig.social.opensocial.spiActivityStreamServiceupdateActivityEntry

Javadoc

Updates the specified Activity.

Popular methods of ActivityStreamService

  • createActivityEntry
    Creates the passed in activity for the passed in user and group. Once createActivity is called, getA
  • 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.

Popular in Java

  • Finding current android device location
  • getContentResolver (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • getSupportFragmentManager (FragmentActivity)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • BoxLayout (javax.swing)
  • JCheckBox (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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