org.scohen.juploadr.uploadapi
Class ImageUploadApi

java.lang.Object
  extended byorg.scohen.juploadr.uploadapi.ImageUploadApi
Direct Known Subclasses:
RestFlickrApi, ZooomrRestApi

public abstract class ImageUploadApi
extends java.lang.Object

This is the overal FlickrApi It gives some direct access to the methods we utilize from the Flickr API In the future a further split-up may be required to keep the number of methods manageable


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

Field Detail

icon

protected Image icon
Constructor Detail

ImageUploadApi

public ImageUploadApi()
Method Detail

getInstance

public static ImageUploadApi getInstance()

changeImplementation

public static final void changeImplementation(java.lang.String newImplementation,
                                              JUploadr parent)

getIcon

public Image getIcon()

getSiteName

public abstract java.lang.String getSiteName()
Returns the friendly name of the upload site. Like "Flickr" or "Zooomr"

Returns:
the name of the site.

getCurrentAccount

public abstract Account getCurrentAccount()
Returns the currently enabled account

Returns:

newAccount

public abstract Account newAccount(java.lang.String name)
Creates a new account with the given name

Parameters:
name - the name to give the account
Returns:
a new account with the name given

setCurrentAccount

public abstract void setCurrentAccount(Account account)
Sets the currently enabled acconut to the one passed in

Parameters:
account - the account to enable.

initialize

public abstract void initialize()
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.


authenticate

public abstract boolean authenticate(Account toAuthenticate)
                              throws ProtocolException,
                                     CommunicationException
Authenticate with the new flickr auth api.

Returns:
true if OK was clicked, false if cancel was clicked
Throws:
ProtocolException
CommunicationException

upload

public abstract void upload(UploadImage imageAttributes,
                            UploadStatusMonitor monitor)
                     throws UploadFailedException,
                            CommunicationException
Uploads the image and data in imageAttributes for Flickr user userInfo and notifying monitor of upload bar.

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

getConfiurationDialogs

public abstract java.lang.Class[] getConfiurationDialogs()
Returns the class names of configuration dialogs for this API.

Returns:

windowRightClicked

public abstract PopupHandler windowRightClicked(Decorations parent,
                                                JUploadr clicked)

thumbnailRightClicked

public abstract PopupHandler thumbnailRightClicked(Decorations parent,
                                                   JUploadr uploadr,
                                                   ImageAttributes clicked)

postProcessUpload

public abstract void postProcessUpload(UploadCompleteEvent e,
                                       ImageAttributes atts)

postProcessAllUploads

public abstract void postProcessAllUploads(java.util.Collection collection)
Event handler that is fired after all photos have finished uploading

Parameters:
collection - All the photos that have been uploaded: consists of ImageAttributes objects

isCurrentAccountAuthenticated

public boolean isCurrentAccountAuthenticated()

isCurrentAccountNullAccount

public abstract boolean isCurrentAccountNullAccount()

authenticateCurrentAccount

public void authenticateCurrentAccount()
                                throws ProtocolException,
                                       CommunicationException
Throws:
ProtocolException
CommunicationException

getRegisteredImplemtations

public static ImageUploadApi[] getRegisteredImplemtations()

allAccounts

public abstract java.util.List allAccounts()
Get a list of all the accounts in this protocol implementation

Returns:
a list of Account objects

versionCheck

protected static void versionCheck()

allAccountsForAllApis

public static java.util.List allAccountsForAllApis()