org.scohen.juploadr.uploadapi.zooomr
Class ZooomrRestApi

java.lang.Object
  extended byorg.scohen.juploadr.uploadapi.ImageUploadApi
      extended byorg.scohen.juploadr.uploadapi.zooomr.ZooomrRestApi

public class ZooomrRestApi
extends ImageUploadApi

This is the REST based implementation of the FlickrApi


Field Summary
static java.lang.String ZOOOMR_API_KEY
           
static java.lang.String ZOOOMR_SHARED_SECRET
           
 
Fields inherited from class org.scohen.juploadr.uploadapi.ImageUploadApi
icon
 
Constructor Summary
ZooomrRestApi()
           
 
Method Summary
static void addPhotoSet(PhotoSet set)
           
 java.util.List allAccounts()
          Get a list of all the accounts in this protocol implementation
 boolean authenticate(Account account)
          Authenticate with the new flickr auth api.
 boolean executeMethod(ZooomrMethod method)
           
 java.lang.Class[] getConfiurationDialogs()
          Returns the class names of configuration dialogs for this API.
 Account getCurrentAccount()
          Returns the currently enabled account
static ImageUploadApi getInstance()
           
 java.lang.String getSiteName()
          Returns the friendly name of the upload site.
 void initialize()
          Do any initialization stuff that needs to be done.
 boolean isCurrentAccountNullAccount()
           
 Account newAccount(java.lang.String name)
          Creates a new account with the given name
 void postProcessAllUploads(java.util.Collection images)
          Event handler that is fired after all photos have finished uploading
 void postProcessUpload(UploadCompleteEvent e, ImageAttributes atts)
           
 void setCurrentAccount(Account account)
          Sets the currently enabled acconut to the one passed in
static void setPhotoSets(java.util.List sets)
           
 PopupHandler thumbnailRightClicked(Decorations parent, JUploadr uploadr, ImageAttributes clicked)
           
 void upload(UploadImage imageAttributes, UploadStatusMonitor monitor)
          Uploads the image and data in imageAttributes for Flickr user userInfo and notifying monitor of upload bar.
 PopupHandler windowRightClicked(Decorations parent, JUploadr clicked)
           
 
Methods inherited from class org.scohen.juploadr.uploadapi.ImageUploadApi
allAccountsForAllApis, authenticateCurrentAccount, changeImplementation, getIcon, getRegisteredImplemtations, isCurrentAccountAuthenticated, versionCheck
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ZOOOMR_SHARED_SECRET

public static final java.lang.String ZOOOMR_SHARED_SECRET
See Also:
Constant Field Values

ZOOOMR_API_KEY

public static final java.lang.String ZOOOMR_API_KEY
See Also:
Constant Field Values
Constructor Detail

ZooomrRestApi

public ZooomrRestApi()
Method Detail

getInstance

public static ImageUploadApi getInstance()

getSiteName

public java.lang.String getSiteName()
Description copied from class: ImageUploadApi
Returns the friendly name of the upload site. Like "Flickr" or "Zooomr"

Specified by:
getSiteName in class ImageUploadApi
Returns:
the name of the site.

upload

public void upload(UploadImage imageAttributes,
                   UploadStatusMonitor monitor)
            throws UploadFailedException,
                   CommunicationException
Description copied from class: ImageUploadApi
Uploads the image and data in imageAttributes for Flickr user userInfo and notifying monitor of upload bar.

Specified by:
upload in class ImageUploadApi
Parameters:
imageAttributes - the image to be uploaded
monitor - The monitor that should be notified of upload bar
Throws:
UploadFailedException - When a problem occurs during the uploading
CommunicationException
See Also:
org.scohen.juploadr.uploadapi.ImageUploadApi#upload(org.scohen.juploadr.uploadapi.UserInfo, org.scohen.juploadr.app.UploadImage, org.scohen.juploadr.event.UploadStatusMonitor)

getCurrentAccount

public Account getCurrentAccount()
Description copied from class: ImageUploadApi
Returns the currently enabled account

Specified by:
getCurrentAccount in class ImageUploadApi
Returns:

newAccount

public Account newAccount(java.lang.String name)
Description copied from class: ImageUploadApi
Creates a new account with the given name

Specified by:
newAccount in class ImageUploadApi
Parameters:
name - the name to give the account
Returns:
a new account with the name given

setCurrentAccount

public void setCurrentAccount(Account account)
Description copied from class: ImageUploadApi
Sets the currently enabled acconut to the one passed in

Specified by:
setCurrentAccount in class ImageUploadApi
Parameters:
account - the account to enable.

isCurrentAccountNullAccount

public boolean isCurrentAccountNullAccount()
Specified by:
isCurrentAccountNullAccount in class ImageUploadApi

allAccounts

public java.util.List allAccounts()
Description copied from class: ImageUploadApi
Get a list of all the accounts in this protocol implementation

Specified by:
allAccounts in class ImageUploadApi
Returns:
a list of Account objects

authenticate

public boolean authenticate(Account account)
                     throws ProtocolException,
                            CommunicationException
Description copied from class: ImageUploadApi
Authenticate with the new flickr auth api.

Specified by:
authenticate in class ImageUploadApi
Returns:
true if OK was clicked, false if cancel was clicked
Throws:
ProtocolException
CommunicationException

initialize

public void initialize()
Description copied from class: ImageUploadApi
Do any initialization stuff that needs to be done. this method does not throw exceptions, as it's called when jUploadr is started, and we don't want to have it crash on startup. This is not guaranteed to be the first method called on your newly created object. In fact, authenticate() will probably be called first.

Specified by:
initialize in class ImageUploadApi

getConfiurationDialogs

public java.lang.Class[] getConfiurationDialogs()
Description copied from class: ImageUploadApi
Returns the class names of configuration dialogs for this API.

Specified by:
getConfiurationDialogs in class ImageUploadApi
Returns:

windowRightClicked

public PopupHandler windowRightClicked(Decorations parent,
                                       JUploadr clicked)
Specified by:
windowRightClicked in class ImageUploadApi

thumbnailRightClicked

public PopupHandler thumbnailRightClicked(Decorations parent,
                                          JUploadr uploadr,
                                          ImageAttributes clicked)
Specified by:
thumbnailRightClicked in class ImageUploadApi

setPhotoSets

public static void setPhotoSets(java.util.List sets)

addPhotoSet

public static void addPhotoSet(PhotoSet set)

postProcessUpload

public void postProcessUpload(UploadCompleteEvent e,
                              ImageAttributes atts)
Specified by:
postProcessUpload in class ImageUploadApi

postProcessAllUploads

public void postProcessAllUploads(java.util.Collection images)
Description copied from class: ImageUploadApi
Event handler that is fired after all photos have finished uploading

Specified by:
postProcessAllUploads in class ImageUploadApi
Parameters:
images - All the photos that have been uploaded: consists of ImageAttributes objects

executeMethod

public boolean executeMethod(ZooomrMethod method)