com.licel.jcardsim.samples.photocard
Interface PhotoCard

All Superinterfaces:
Remote
All Known Implementing Classes:
PhotoCardImpl

public interface PhotoCard
extends Remote

PhotoCard interface Defines methods to be used as interface between photo client and storage smart card


Field Summary
static short INVALID_ARGUMENT
          Invalid argument value
static short INVALID_PHOTO_ID
          Invalid photo ID
static short MAX_BUFFER_BYTES
          Maximum bytes for transfer
static short MAX_PHOTO_COUNT
          Maximum on-card photos
static short MAX_SIZE
          Maximum photo size
static short NO_PHOTO_STORED
          No photo stored in selected location
static short NO_SPACE_AVAILABLE
          No space available for photo storage
 
Method Summary
 void deletePhoto(short photoID)
          This method deletes the photo whose ID is specified in the card.
 byte[] getPhoto(short photoID, short offset, short size)
          This method retrueves a series of bytes belonging to the photo from the smart card at the position specified.
 short getPhotoSize(short photoID)
          This method retrieves the photo size whose ID is specified.
 void loadPhoto(short photoID, byte[] data, short size, short offset, boolean more)
          This method loads a series of bytes belonging to the photo into the smart card at the position specified.
 short requestPhotoStorage(short size)
          This method requests the smart card to allocate space to store a photo image of the specified size.
 

Field Detail

NO_SPACE_AVAILABLE

static final short NO_SPACE_AVAILABLE
No space available for photo storage

See Also:
Constant Field Values

NO_PHOTO_STORED

static final short NO_PHOTO_STORED
No photo stored in selected location

See Also:
Constant Field Values

INVALID_PHOTO_ID

static final short INVALID_PHOTO_ID
Invalid photo ID

See Also:
Constant Field Values

INVALID_ARGUMENT

static final short INVALID_ARGUMENT
Invalid argument value

See Also:
Constant Field Values

MAX_SIZE

static final short MAX_SIZE
Maximum photo size

See Also:
Constant Field Values

MAX_PHOTO_COUNT

static final short MAX_PHOTO_COUNT
Maximum on-card photos

See Also:
Constant Field Values

MAX_BUFFER_BYTES

static final short MAX_BUFFER_BYTES
Maximum bytes for transfer

See Also:
Constant Field Values
Method Detail

requestPhotoStorage

short requestPhotoStorage(short size)
                          throws RemoteException,
                                 UserException
This method requests the smart card to allocate space to store a photo image of the specified size.

Parameters:
size - - Image size to store in the smart card
Returns:
photoID - ID slot in card where photo will be stored
Throws:
UserException - - thrown if error condition occurs, or invalid parameters passed.
RemoteException

loadPhoto

void loadPhoto(short photoID,
               byte[] data,
               short size,
               short offset,
               boolean more)
               throws RemoteException,
                      UserException
This method loads a series of bytes belonging to the photo into the smart card at the position specified.

Parameters:
photoID - - photo slot where to store data
data - - byte array contaiing binary photo information
size - - number of bytes being passed into the smart card
offset - - position inside photo buffer where to store data.
Throws:
UserException - - thrown if error condition occurs, or invalid parameters passed.
RemoteException

deletePhoto

void deletePhoto(short photoID)
                 throws RemoteException,
                        UserException
This method deletes the photo whose ID is specified in the card.

Parameters:
photoID - - ID slot of photo to delete
Throws:
UserException - - thrown if error condition occurs, or invalid parameters passed.
RemoteException

getPhotoSize

short getPhotoSize(short photoID)
                   throws RemoteException,
                          UserException
This method retrieves the photo size whose ID is specified.

Parameters:
photoID - - ID slot of photo to access
Throws:
UserException - - thrown if error condition occurs, or invalid parameters passed.
RemoteException

getPhoto

byte[] getPhoto(short photoID,
                short offset,
                short size)
                throws RemoteException,
                       UserException
This method retrueves a series of bytes belonging to the photo from the smart card at the position specified.

Parameters:
photoID - - photo slot where to store data
size - - number of bytes expected from the smart card
offset - - position inside photo buffer where to access data.
Returns:
byte array with binary data from photo stored inside the smart card
Throws:
UserException - - thrown if error condition occurs, or invalid parameters passed.
RemoteException