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

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

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

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

@Operation(httpMethods = "DELETE")
public Future<?> delete(SocialRequestItem request) throws ProtocolException {
 // Get user and album ID
 Set<UserId> userIds = request.getUsers();
 String albumId = request.getParameter("albumId");
 // Enforce preconditions - userIds must contain exactly one element
 HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
 HandlerPreconditions.requireSingular(userIds, "Multiple userIds not supported");
 // Service request
 return service.deleteAlbum(Iterables.getOnlyElement(userIds),
   request.getAppId(), albumId, request.getToken());
}
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

@Operation(httpMethods = "POST", bodyParam = "album")
public Future<?> create(SocialRequestItem request) throws ProtocolException {
 // Retrieve userIds and albumIds
 Set<UserId> userIds = request.getUsers();
 List<String> albumIds = request.getListParameter("albumId");
 // Preconditions - exactly one userId specified, no albumIds specified
 HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
 HandlerPreconditions.requireSingular(userIds, "Multiple userIds not supported");
 HandlerPreconditions.requireEmpty(albumIds, "Cannot specify albumId in create");
 return service.createAlbum(Iterables.getOnlyElement(userIds),
   request.getAppId(),
   request.getTypedParameter("album", Album.class),
   request.getToken());
}
origin: com.lmco.shindig/shindig-social-api

@Operation(httpMethods = "PUT", bodyParam = "album")
public Future<?> update(SocialRequestItem request) throws ProtocolException {
 // Retrieve userIds and albumIds
 Set<UserId> userIds = request.getUsers();
 List<String> albumIds = request.getListParameter("albumId");
 // Enforce preconditions - exactly one user and one album specified
 HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
 HandlerPreconditions.requireSingular(userIds, "Multiple userIds not supported");
 HandlerPreconditions.requireNotEmpty(albumIds, "No albumId specified");
 HandlerPreconditions.requireSingular(albumIds, "Multiple albumIds not supported");
 return service.updateAlbum(Iterables.getOnlyElement(userIds),
   request.getAppId(),
   request.getTypedParameter("album", Album.class),
   Iterables.getOnlyElement(albumIds), request.getToken());
}
origin: org.apache.shindig/shindig-social-api

@Operation(httpMethods = "POST", bodyParam = "album")
public Future<?> create(SocialRequestItem request) throws ProtocolException {
 // Retrieve userIds and albumIds
 Set<UserId> userIds = request.getUsers();
 List<String> albumIds = request.getListParameter("albumId");
 // Preconditions - exactly one userId specified, no albumIds specified
 HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
 HandlerPreconditions.requireSingular(userIds, "Multiple userIds not supported");
 HandlerPreconditions.requireEmpty(albumIds, "Cannot specify albumId in create");
 return service.createAlbum(Iterables.getOnlyElement(userIds),
   request.getAppId(),
   request.getTypedParameter("album", Album.class),
   request.getToken());
}
origin: org.apache.shindig/shindig-social-api

@Operation(httpMethods = "PUT", bodyParam = "album")
public Future<?> update(SocialRequestItem request) throws ProtocolException {
 // Retrieve userIds and albumIds
 Set<UserId> userIds = request.getUsers();
 List<String> albumIds = request.getListParameter("albumId");
 // Enforce preconditions - exactly one user and one album specified
 HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
 HandlerPreconditions.requireSingular(userIds, "Multiple userIds not supported");
 HandlerPreconditions.requireNotEmpty(albumIds, "No albumId specified");
 HandlerPreconditions.requireSingular(albumIds, "Multiple albumIds not supported");
 return service.updateAlbum(Iterables.getOnlyElement(userIds),
   request.getAppId(),
   request.getTypedParameter("album", Album.class),
   Iterables.getOnlyElement(albumIds), request.getToken());
}
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: com.lmco.shindig/shindig-social-api

@Operation(httpMethods = "DELETE")
public Future<?> delete(SocialRequestItem request) throws ProtocolException {
 // Get user and album ID
 Set<UserId> userIds = request.getUsers();
 String albumId = request.getParameter("albumId");
 // Enforce preconditions - userIds must contain exactly one element
 HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
 HandlerPreconditions.requireSingular(userIds, "Multiple userIds not supported");
 // Service request
 return service.deleteAlbum(Iterables.getOnlyElement(userIds),
   request.getAppId(), albumId, request.getToken());
}
origin: com.lmco.shindig/shindig-social-api

@Operation(httpMethods = "POST", bodyParam = "album")
public Future<?> create(SocialRequestItem request) throws ProtocolException {
 // Retrieve userIds and albumIds
 Set<UserId> userIds = request.getUsers();
 List<String> albumIds = request.getListParameter("albumId");
 // Preconditions - exactly one userId specified, no albumIds specified
 HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
 HandlerPreconditions.requireSingular(userIds, "Multiple userIds not supported");
 HandlerPreconditions.requireEmpty(albumIds, "Cannot specify albumId in create");
 return service.createAlbum(Iterables.getOnlyElement(userIds),
   request.getAppId(),
   request.getTypedParameter("album", Album.class),
   request.getToken());
}
origin: org.wso2.org.apache.shindig/shindig-social-api

@Operation(httpMethods = "PUT", bodyParam = "album")
public Future<?> update(SocialRequestItem request) throws ProtocolException {
 // Retrieve userIds and albumIds
 Set<UserId> userIds = request.getUsers();
 List<String> albumIds = request.getListParameter("albumId");
 // Enforce preconditions - exactly one user and one album specified
 HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
 HandlerPreconditions.requireSingular(userIds, "Multiple userIds not supported");
 HandlerPreconditions.requireNotEmpty(albumIds, "No albumId specified");
 HandlerPreconditions.requireSingular(albumIds, "Multiple albumIds not supported");
 return service.updateAlbum(Iterables.getOnlyElement(userIds),
   request.getAppId(),
   request.getTypedParameter("album", Album.class),
   Iterables.getOnlyElement(albumIds), request.getToken());
}
origin: com.lmco.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(),
     new CollectionOptions(request), optionalAlbumIds,
     request.getToken());
  }
 }
 // Retrieve albums by group
 return service.getAlbums(userIds, request.getGroup(), request
   .getAppId(), request.getFields(),
   new CollectionOptions(request), request.getToken());
}
origin: org.wso2.org.apache.shindig/shindig-social-api

@Operation(httpMethods = "DELETE")
public Future<?> delete(SocialRequestItem request) throws ProtocolException {
 // Get user and album ID
 Set<UserId> userIds = request.getUsers();
 String albumId = request.getParameter("albumId");
 // Enforce preconditions - userIds must contain exactly one element
 HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
 HandlerPreconditions.requireSingular(userIds, "Multiple userIds not supported");
 // Service request
 return service.deleteAlbum(Iterables.getOnlyElement(userIds),
   request.getAppId(), albumId, request.getToken());
}
org.apache.shindig.social.opensocial.spiAlbumService

Javadoc

The AlbumService interface defines the service provider interface for creating, retrieving, updating, and deleting OpenSocial albums.

Most used methods

  • createAlbum
    Creates an album for the given user.
  • deleteAlbum
    Deletes a single album for the given user with the given album ID.
  • getAlbum
    Retrieves a single album for the given user with the given album ID.
  • getAlbums
    Retrieves albums for the given user with the given album IDs.
  • updateAlbum
    Updates an album for the given user. The album ID specified in the REST end-point is used, even if t

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSystemService (Context)
  • addToBackStack (FragmentTransaction)
  • getApplicationContext (Context)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • ImageIO (javax.imageio)
  • JTextField (javax.swing)
  • Top plugins for Android Studio
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