examples.postcard
Class PostcardWebserviceImpl

java.lang.Object
  extended byexamples.postcard.PostcardWebserviceImpl
All Implemented Interfaces:
PostcardWebservice

public class PostcardWebserviceImpl
extends Object
implements PostcardWebservice

Author:
Jan Peters

Field Summary
private  int BUF_SIZE
          The size of the buffer used to load images.
static int DEFAULT_IMAGE_HEIGHT
          The heigth of the default image.
static int DEFAULT_IMAGE_WIDTH
          The width of the default image.
private  BufferedImage image_
          The postcard image of this service.
private  String location_
          The host location.
 
Fields inherited from interface examples.postcard.PostcardWebservice
PUBLISH_KEY
 
Constructor Summary
PostcardWebserviceImpl()
          Constructor.
 
Method Summary
 Calendar getDate()
           
 byte[] getJpegPostcard()
           
 byte[] getJpegPostcard(String name)
           
 String getLocation()
           
 void setImage(File file)
          Allows to read the image to be used as postcard from a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_IMAGE_WIDTH

public static final int DEFAULT_IMAGE_WIDTH
The width of the default image. Any image loaded by other means, needs NOT to fit this size.

See Also:
Constant Field Values

DEFAULT_IMAGE_HEIGHT

public static final int DEFAULT_IMAGE_HEIGHT
The heigth of the default image. Any image loaded by other means needs NOT to fit this size.

See Also:
Constant Field Values

image_

private BufferedImage image_
The postcard image of this service.


location_

private String location_
The host location.


BUF_SIZE

private final int BUF_SIZE
The size of the buffer used to load images.

See Also:
Constant Field Values
Constructor Detail

PostcardWebserviceImpl

public PostcardWebserviceImpl()
Constructor. The image is per default initialized with a white picture.

Method Detail

setImage

public void setImage(File file)
Allows to read the image to be used as postcard from a file. The method is not intended to be used by an agent, but to initialze the service at startup time. Therefor it does not occur in PostcardService.

Throws:
IOException - when the file could not be read

getJpegPostcard

public byte[] getJpegPostcard()
Specified by:
getJpegPostcard in interface PostcardWebservice

getJpegPostcard

public byte[] getJpegPostcard(String name)
Specified by:
getJpegPostcard in interface PostcardWebservice

getLocation

public String getLocation()
Specified by:
getLocation in interface PostcardWebservice

getDate

public Calendar getDate()
Specified by:
getDate in interface PostcardWebservice


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.