congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CollectionOptionsFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
CollectionOptionsFactory
in
org.apache.shindig.social.opensocial.spi

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

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

@Before
public void setUp() throws Exception {
 token = new FakeGadgetToken();
 messageService = EasyMock.createMock(MessageService.class);
 messageService = EasyMock.createMock(MessageService.class);
 converter = EasyMock.createMock(BeanJsonConverter.class);
 sender = new UserId(UserId.Type.userId, "message.sender");
 recipients = ImmutableList.of("second.recipient", "first.recipient");
 handler = new MessageHandler(messageService, new CollectionOptionsFactory());
 registry = new DefaultHandlerRegistry(null, converter,
   new HandlerExecutionListener.NoOpHandler());
 registry.addHandlers(ImmutableSet.<Object>of(handler));
}
origin: org.wso2.org.apache.shindig/shindig-social-api

 @Operation(httpMethods = "GET")
 public Future<?> get(SocialRequestItem request) throws ProtocolException {
  Set<UserId> userIds = request.getUsers();
  CollectionOptions options = collectionOptionsFactory.create(request);

  // Preconditions
  HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
  HandlerPreconditions.requireSingular(userIds, "Only one userId must be specified");

  return service.getGroups(userIds.iterator().next(), options, request.getFields(), request.getToken());
 }
}
origin: org.apache.shindig/shindig-social-api

 @Operation(httpMethods = "GET")
 public Future<?> get(SocialRequestItem request) throws ProtocolException {
  Set<UserId> userIds = request.getUsers();
  CollectionOptions options = collectionOptionsFactory.create(request);

  // Preconditions
  HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
  HandlerPreconditions.requireSingular(userIds, "Only one userId must be specified");

  return service.getGroups(userIds.iterator().next(), options, request.getFields(), request.getToken());
 }
}
origin: org.wso2.org.apache.shindig/shindig-social-api

@Before
public void setUp() throws Exception {
 token = new FakeGadgetToken();
 messageService = EasyMock.createMock(MessageService.class);
 messageService = EasyMock.createMock(MessageService.class);
 converter = EasyMock.createMock(BeanJsonConverter.class);
 sender = new UserId(UserId.Type.userId, "message.sender");
 recipients = ImmutableList.of("second.recipient", "first.recipient");
 handler = new MessageHandler(messageService, new CollectionOptionsFactory());
 registry = new DefaultHandlerRegistry(null, converter,
   new HandlerExecutionListener.NoOpHandler());
 registry.addHandlers(ImmutableSet.<Object>of(handler));
}
origin: org.wso2.org.apache.shindig/shindig-social-api

 return service.getMediaItems(Iterables.getOnlyElement(userIds),
   request.getAppId(), albumId, optionalMediaItemIds,
   request.getFields(), collectionOptionsFactory.create(request),
   request.getToken());
return service.getMediaItems(Iterables.getOnlyElement(userIds),
  request.getAppId(), albumId, request.getFields(),
  collectionOptionsFactory.create(request), request.getToken());
 collectionOptionsFactory.create(request), request.getToken());
origin: org.apache.shindig/shindig-social-api

@Before
public void setUp() throws Exception {
 token = new FakeGadgetToken();
 converter = new BeanJsonConverter(Guice.createInjector());
 mediaService = mock(MediaItemService.class);
 JSONObject config = new JSONObject('{' + ContainerConfig.DEFAULT_CONTAINER + ':' +
   "{'gadgets.container': ['default']," +
    "'gadgets.features':{opensocial:" +
     "{supportedFields: {mediaItem: ['id', 'language', 'title']}}" +
    "}}}");
 containerConfig = new JsonContainerConfig(config, Expressions.forTesting());
 handler = new MediaItemHandler(mediaService, containerConfig, new CollectionOptionsFactory());
 registry = new DefaultHandlerRegistry(null, converter,
   new HandlerExecutionListener.NoOpHandler());
 registry.addHandlers(ImmutableSet.<Object>of(handler));
 request = new SocialRequestItem(
   Maps.<String, String[]>newHashMap(),
   token, converter, converter);
}
origin: org.apache.shindig/shindig-social-api

@Operation(httpMethods = "GET")
public Future<?> get(SocialRequestItem request) throws ProtocolException {
 // Get user, group, and album IDs
 Set<UserId> userIds = request.getUsers();
 Set<String> optionalAlbumIds = ImmutableSet.copyOf(request
   .getListParameter("albumId"));
 // At least one userId must be specified
 HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
 // If multiple userIds specified, albumIds must not be specified
 if (userIds.size() > 1 && !optionalAlbumIds.isEmpty()) {
  throw new IllegalArgumentException("Cannot fetch same albumIds for multiple userIds");
 }
 // Retrieve albums by ID
 if (!optionalAlbumIds.isEmpty()) {
  if (optionalAlbumIds.size() == 1) {
   return service.getAlbum(Iterables.getOnlyElement(userIds),
     request.getAppId(), request.getFields(),
     optionalAlbumIds.iterator().next(), request.getToken());
  } else {
   return service.getAlbums(Iterables.getOnlyElement(userIds),
     request.getAppId(), request.getFields(),
     collectionOptionsFactory.create(request), optionalAlbumIds,
     request.getToken());
  }
 }
 // Retrieve albums by group
 return service.getAlbums(userIds, request.getGroup(), request
   .getAppId(), request.getFields(),
   collectionOptionsFactory.create(request), request.getToken());
}
origin: org.wso2.org.apache.shindig/shindig-social-api

@Before
public void setUp() throws Exception {
 token = new FakeGadgetToken();
 converter = new BeanJsonConverter(Guice.createInjector());
 mediaService = mock(MediaItemService.class);
 JSONObject config = new JSONObject('{' + ContainerConfig.DEFAULT_CONTAINER + ':' +
   "{'gadgets.container': ['default']," +
    "'gadgets.features':{opensocial:" +
     "{supportedFields: {mediaItem: ['id', 'language', 'title']}}" +
    "}}}");
 containerConfig = new JsonContainerConfig(config, Expressions.forTesting());
 handler = new MediaItemHandler(mediaService, containerConfig, new CollectionOptionsFactory());
 registry = new DefaultHandlerRegistry(null, converter,
   new HandlerExecutionListener.NoOpHandler());
 registry.addHandlers(ImmutableSet.<Object>of(handler));
 request = new SocialRequestItem(
   Maps.<String, String[]>newHashMap(),
   token, converter, converter);
}
origin: org.wso2.org.apache.shindig/shindig-social-api

@Operation(httpMethods = "GET")
public Future<?> get(SocialRequestItem request) throws ProtocolException {
 // Get user, group, and album IDs
 Set<UserId> userIds = request.getUsers();
 Set<String> optionalAlbumIds = ImmutableSet.copyOf(request
   .getListParameter("albumId"));
 // At least one userId must be specified
 HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
 // If multiple userIds specified, albumIds must not be specified
 if (userIds.size() > 1 && !optionalAlbumIds.isEmpty()) {
  throw new IllegalArgumentException("Cannot fetch same albumIds for multiple userIds");
 }
 // Retrieve albums by ID
 if (!optionalAlbumIds.isEmpty()) {
  if (optionalAlbumIds.size() == 1) {
   return service.getAlbum(Iterables.getOnlyElement(userIds),
     request.getAppId(), request.getFields(),
     optionalAlbumIds.iterator().next(), request.getToken());
  } else {
   return service.getAlbums(Iterables.getOnlyElement(userIds),
     request.getAppId(), request.getFields(),
     collectionOptionsFactory.create(request), optionalAlbumIds,
     request.getToken());
  }
 }
 // Retrieve albums by group
 return service.getAlbums(userIds, request.getGroup(), request
   .getAppId(), request.getFields(),
   collectionOptionsFactory.create(request), request.getToken());
}
origin: org.apache.shindig/shindig-social-api

@Before
public void setUp() throws Exception {
 token = new FakeGadgetToken();
 converter = mock(BeanJsonConverter.class);
 albumService = mock(AlbumService.class);
 JSONObject config = new JSONObject('{' + ContainerConfig.DEFAULT_CONTAINER + ':' +
   "{'gadgets.container': ['default']," +
    "'gadgets.features':{opensocial:" +
     "{supportedFields: {album: ['id', 'title', 'location']}}" +
    "}}}");
 containerConfig = new JsonContainerConfig(config, Expressions.forTesting());
 handler = new AlbumHandler(albumService, containerConfig, new CollectionOptionsFactory());
 registry = new DefaultHandlerRegistry(null, converter,
   new HandlerExecutionListener.NoOpHandler());
 registry.addHandlers(ImmutableSet.<Object>of(handler));
}
origin: org.apache.shindig/shindig-social-api

 return service.getMediaItems(Iterables.getOnlyElement(userIds),
   request.getAppId(), albumId, optionalMediaItemIds,
   request.getFields(), collectionOptionsFactory.create(request),
   request.getToken());
return service.getMediaItems(Iterables.getOnlyElement(userIds),
  request.getAppId(), albumId, request.getFields(),
  collectionOptionsFactory.create(request), request.getToken());
 collectionOptionsFactory.create(request), request.getToken());
origin: org.apache.shindig/shindig-social-api

@Before
public void setUp() throws Exception {
 token = new FakeGadgetToken();
 converter = mock(BeanJsonConverter.class);
 personService = mock(PersonService.class);
 JSONObject config = new JSONObject('{' + ContainerConfig.DEFAULT_CONTAINER + ':' +
   "{'gadgets.container': ['default']," +
    "'gadgets.features':{opensocial:" +
     "{supportedFields: {person: ['id', {name: 'familyName'}]}}" +
    "}}}");
 containerConfig = new JsonContainerConfig(config, Expressions.forTesting());
 handler = new PersonHandler(personService, containerConfig, new CollectionOptionsFactory());
 registry = new DefaultHandlerRegistry(null, converter,
   new HandlerExecutionListener.NoOpHandler());
 registry.addHandlers(ImmutableSet.<Object>of(handler));
}
origin: org.wso2.org.apache.shindig/shindig-social-api

Set<String> optionalActivityIds = ImmutableSet.copyOf(request.getListParameter("activityId"));
CollectionOptions options = collectionOptionsFactory.create(request);
origin: org.wso2.org.apache.shindig/shindig-social-api

@Before
public void setUp() throws Exception {
 token = new FakeGadgetToken();
 converter = mock(BeanJsonConverter.class);
 albumService = mock(AlbumService.class);
 JSONObject config = new JSONObject('{' + ContainerConfig.DEFAULT_CONTAINER + ':' +
   "{'gadgets.container': ['default']," +
    "'gadgets.features':{opensocial:" +
     "{supportedFields: {album: ['id', 'title', 'location']}}" +
    "}}}");
 containerConfig = new JsonContainerConfig(config, Expressions.forTesting());
 handler = new AlbumHandler(albumService, containerConfig, new CollectionOptionsFactory());
 registry = new DefaultHandlerRegistry(null, converter,
   new HandlerExecutionListener.NoOpHandler());
 registry.addHandlers(ImmutableSet.<Object>of(handler));
}
origin: org.apache.shindig/shindig-social-api

Set<String> optionalActivityIds = ImmutableSet.copyOf(request.getListParameter("activityId"));
CollectionOptions options = collectionOptionsFactory.create(request);
origin: org.wso2.org.apache.shindig/shindig-social-api

@Before
public void setUp() throws Exception {
 token = new FakeGadgetToken();
 converter = mock(BeanJsonConverter.class);
 personService = mock(PersonService.class);
 JSONObject config = new JSONObject('{' + ContainerConfig.DEFAULT_CONTAINER + ':' +
   "{'gadgets.container': ['default']," +
    "'gadgets.features':{opensocial:" +
     "{supportedFields: {person: ['id', {name: 'familyName'}]}}" +
    "}}}");
 containerConfig = new JsonContainerConfig(config, Expressions.forTesting());
 handler = new PersonHandler(personService, containerConfig, new CollectionOptionsFactory());
 registry = new DefaultHandlerRegistry(null, converter,
   new HandlerExecutionListener.NoOpHandler());
 registry.addHandlers(ImmutableSet.<Object>of(handler));
}
origin: org.apache.shindig/shindig-social-api

Set<String> optionalActivityIds = ImmutableSet.copyOf(request.getListParameter("activityId"));
CollectionOptions options = collectionOptionsFactory.create(request);
origin: org.apache.shindig/shindig-social-api

@Before
public void setUp() throws Exception {
 token = new FakeGadgetToken();
 token.setAppId("appId");
 converter = mock(BeanJsonConverter.class);
 activityService = mock(ActivityService.class);
 JSONObject config = new JSONObject('{' + ContainerConfig.DEFAULT_CONTAINER + ':' +
   "{'gadgets.container': ['default']," +
    "'gadgets.features':{opensocial:" +
     "{supportedFields: {activity: ['id', 'title']}}" +
    "}}}");
 containerConfig = new JsonContainerConfig(config, Expressions.forTesting());
 handler = new ActivityHandler(activityService, containerConfig, new CollectionOptionsFactory());
 registry = new DefaultHandlerRegistry(null, converter,
   new HandlerExecutionListener.NoOpHandler());
 registry.addHandlers(ImmutableSet.<Object>of(handler));
}
origin: org.wso2.org.apache.shindig/shindig-social-api

Set<String> optionalActivityIds = ImmutableSet.copyOf(request.getListParameter("activityId"));
CollectionOptions options = collectionOptionsFactory.create(request);
origin: org.wso2.org.apache.shindig/shindig-social-api

@Before
public void setUp() throws Exception {
 token = new FakeGadgetToken();
 token.setAppId("appId");
 converter = mock(BeanJsonConverter.class);
 service = mock(ActivityStreamService.class);
 JSONObject config = new JSONObject('{' + ContainerConfig.DEFAULT_CONTAINER + ':' +
   "{'gadgets.container': ['default']," +
    "'gadgets.features':{opensocial:" +
     "{supportedFields: {activityEntry: ['id', 'title']}}" +
    "}}}");
 containerConfig = new JsonContainerConfig(config, Expressions.forTesting());
 handler = new ActivityStreamHandler(service, containerConfig, new CollectionOptionsFactory());
 registry = new DefaultHandlerRegistry(null, converter,
   new HandlerExecutionListener.NoOpHandler());
 registry.addHandlers(ImmutableSet.<Object>of(handler));
}
org.apache.shindig.social.opensocial.spiCollectionOptionsFactory

Javadoc

Factory for CollectionOptions.

Most used methods

  • <init>
  • create
    Create an instance of CollectionOptions from the provided request.

Popular in Java

  • Creating JSON documents from java classes using gson
  • onCreateOptionsMenu (Activity)
  • getExternalFilesDir (Context)
  • requestLocationUpdates (LocationManager)
  • Menu (java.awt)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • 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