com.shephertz.app42.paas.sdk.jme.gallery
Class PhotoService

java.lang.Object
  extended by com.shephertz.app42.paas.sdk.jme.gallery.PhotoService

public class PhotoService
extends java.lang.Object

Adds Photo to the created Album on the Cloud All photos for a given Album can be managed through this service. Photos can be uploaded to the cloud. Uploaded photos are accessible through the generated URL. The service also creates a thumbnail for the Photo which has been uploaded.

See Also:
Album, Album.Photo

Constructor Summary
PhotoService(java.lang.String apiKey, java.lang.String secretKey, java.lang.String baseURL)
          The costructor for the Service
 
Method Summary
 Album addPhoto(java.lang.String userName, java.lang.String albumName, java.lang.String photoName, java.lang.String photoDescription, java.io.InputStream imageIS)
          Adds Photo for a particular user and album via Stream.
 Album addTagToPhoto(java.lang.String userName, java.lang.String albumName, java.lang.String photoName, java.util.Vector tagList)
          Add tags to the Photos for the user in the album.
 java.util.Vector getPhotos(java.lang.String userName)
          Fetches all the Photos based on the userName
 Album getPhotosByAlbumAndPhotoName(java.lang.String userName, java.lang.String albumName, java.lang.String photoName)
          Fetches the particular photo based on the userName, album name and photo name
 Album getPhotosByAlbumName(java.lang.String userName, java.lang.String albumName)
          Fetches all Photos based on the userName and albumName
 Album getPhotosByAlbumName(java.lang.String userName, java.lang.String albumName, java.lang.Integer max, java.lang.Integer offset)
          Fetches all Photos based on the userName and album name by paging.
 App42Response getPhotosCountByAlbumName(java.lang.String userName, java.lang.String albumName)
          Fetches the count of all Photos based on the userName and album name
 java.util.Vector getTaggedPhotos(java.lang.String userName, java.lang.String tag)
          Fetches all the Photos based on the userName and tag
 App42Response removePhoto(java.lang.String userName, java.lang.String albumName, java.lang.String photoName)
          Removes the particular Photo from the specified Album for a particular user.
 java.lang.String testUpload(java.lang.String path)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhotoService

public PhotoService(java.lang.String apiKey,
                    java.lang.String secretKey,
                    java.lang.String baseURL)
The costructor for the Service

Parameters:
apiKey -
secretKey -
baseURL -
Method Detail

addPhoto

public Album addPhoto(java.lang.String userName,
                      java.lang.String albumName,
                      java.lang.String photoName,
                      java.lang.String photoDescription,
                      java.io.InputStream imageIS)
               throws App42Exception
Adds Photo for a particular user and album via Stream. The Photo is uploaded on the cloud

Parameters:
userName - - Name of the User whose photo has to be added
albumName - - Name of the Album in which photo has to be added
photoName - - Name of the Photo that has to be added
photoDescription - - Description of the Photo that has to be added
inputStream - - Input Stream for the Photo that has to be added
Returns:
Album object containing the Photo which has been added
Throws:
App42Exception

addTagToPhoto

public Album addTagToPhoto(java.lang.String userName,
                           java.lang.String albumName,
                           java.lang.String photoName,
                           java.util.Vector tagList)
                    throws App42Exception
Add tags to the Photos for the user in the album.

Parameters:
userName - - Name of the User whose name has to be tagged to photo
albumName - - Album name whose photo is to be tagged
photoName - - Photo name to be tagged
tagList - - List of tages in Photo
Returns:
Album object containing the Photo which has been added
Throws:
App42Exception

getPhotos

public java.util.Vector getPhotos(java.lang.String userName)
                           throws App42Exception
Fetches all the Photos based on the userName

Parameters:
userName - - Name of the User whose photos have to be fetched
Returns:
List of Album object containing all the Photos for the given userName
Throws:
App42Exception

getPhotosByAlbumAndPhotoName

public Album getPhotosByAlbumAndPhotoName(java.lang.String userName,
                                          java.lang.String albumName,
                                          java.lang.String photoName)
                                   throws App42Exception
Fetches the particular photo based on the userName, album name and photo name

Parameters:
userName - - Name of the User whose photo has to be fetched
albumName - - Name of the Album from which photo has to be fetched
photoName - - Name of the Photo that has to be fetched
Returns:
Album object containing the Photo for the given userName, albumName and photoName
Throws:
App42Exception

getPhotosByAlbumName

public Album getPhotosByAlbumName(java.lang.String userName,
                                  java.lang.String albumName)
                           throws App42Exception
Fetches all Photos based on the userName and albumName

Parameters:
userName - - Name of the User whose photos have to be fetched
albumName - - Name of the Album from which photos have to be fetched
Returns:
Album object containing all the Photos for the given userName and albumName
Throws:
App42Exception

getPhotosByAlbumName

public Album getPhotosByAlbumName(java.lang.String userName,
                                  java.lang.String albumName,
                                  java.lang.Integer max,
                                  java.lang.Integer offset)
                           throws App42Exception
Fetches all Photos based on the userName and album name by paging.

Parameters:
userName - - Name of the User whose photos have to be fetched
albumName - - Name of the Album from which photos have to be fetched
max - - Maximum number of records to be fetched
offset - - From where the records are to be fetched
Returns:
Album object containing all the Photos for the given userName and albumName
Throws:
App42Exception

getPhotosCountByAlbumName

public App42Response getPhotosCountByAlbumName(java.lang.String userName,
                                               java.lang.String albumName)
                                        throws App42Exception
Fetches the count of all Photos based on the userName and album name

Parameters:
userName - - Name of the User whose count of photos have to be fetched
albumName - - Name of the Album from which count of photos have to be fetched
Returns:
App42Response object containing the count of all the Photos for the given userName and albumName
Throws:
App42Exception

getTaggedPhotos

public java.util.Vector getTaggedPhotos(java.lang.String userName,
                                        java.lang.String tag)
                                 throws App42Exception
Fetches all the Photos based on the userName and tag

Parameters:
userName - - Name of the User whose photos have to be fetched
tag - - tag on which basis photos have to be fetched
Returns:
List of Album object containing all the Photos for the given userName
Throws:
App42Exception

removePhoto

public App42Response removePhoto(java.lang.String userName,
                                 java.lang.String albumName,
                                 java.lang.String photoName)
                          throws App42Exception
Removes the particular Photo from the specified Album for a particular user. Note: The Photo is removed from the cloud and wont be accessible in future

Parameters:
userName - - Name of the User whose photo has to be removed
albumName - - Name of the Album in which photo has to be removed
photoName - - Name of the Photo that has to be removed
Returns:
App42Response if removed successfully
Throws:
App42Exception

testUpload

public java.lang.String testUpload(java.lang.String path)
                            throws java.lang.Exception
Throws:
java.lang.Exception