examples.postcard
Class PostcardServiceImpl

java.lang.Object
  extended byde.fhg.igd.semoa.service.AbstractService
      extended byexamples.postcard.PostcardServiceImpl
All Implemented Interfaces:
PostcardService, Service

public class PostcardServiceImpl
extends AbstractService
implements PostcardService

Author:
Ulrich Pinsdorf

Field Summary
private  int BUF_SIZE
          The size of the buffer used to load images.
private  BufferedImage image_
          The postcard image of this service.
private  String location_
          The host location.
private  String url_
          The unique host URL.
 
Fields inherited from class de.fhg.igd.semoa.service.AbstractService
REV_POSTFIX, REV_PREFIX
 
Fields inherited from interface examples.postcard.PostcardService
PUBLISH_KEY
 
Constructor Summary
PostcardServiceImpl()
          Construtor.
 
Method Summary
 String author()
          Returns the name of the author of the service.
private  void debug(Object debugInfo)
           
 Postcard getPostcard()
          Retrieves an image which is stamped with the agent's name, the server URL, the owners name and a time stamp.
 Postcard getPostcard(BufferedImage image)
          Stamps the given image as described at getPostcard() getPostcard.
 String info()
          Returns the informative string which should describe the service's essence in a sentence.
 String revision()
          Returns the revision number of this class as a string.
 void setImage(File f)
          Allows to read the image to be used as postcard from a file.
 
Methods inherited from class de.fhg.igd.semoa.service.AbstractService
checkDependencies, dependencies, docs, doPrivileged, doPrivileged, getACC, getEnvironment, majorVersion, minorVersion, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

image_

private BufferedImage image_
The postcard image of this service.


url_

private String url_
The unique host URL.


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

PostcardServiceImpl

public PostcardServiceImpl()
Construtor. The image is per default initialized with a white picture.

Method Detail

getPostcard

public Postcard getPostcard()
Description copied from interface: PostcardService
Retrieves an image which is stamped with the agent's name, the server URL, the owners name and a time stamp. The information will be retrieved from the agent itself. The image should be a picture of a local point of interest or a photo of the server machine.

Specified by:
getPostcard in interface PostcardService
Returns:
the stamped image

getPostcard

public Postcard getPostcard(BufferedImage image)
Description copied from interface: PostcardService
Stamps the given image as described at getPostcard() getPostcard.

Specified by:
getPostcard in interface PostcardService
Returns:
the stamped image

author

public String author()
Description copied from class: AbstractService
Returns the name of the author of the service. The format to be used should be John Doe <jdoe@zilch.net>.

Specified by:
author in interface Service
Specified by:
author in class AbstractService
Returns:
the String with the author's name.

revision

public String revision()
Description copied from class: AbstractService
Returns the revision number of this class as a string. This class provides default implementations of methods majorVersion(), minorVersion based on the assumption that this method returns a revision string as generated by rcs(1) for the template "$Revision: 1.7 $/$Date: 2007-08-08 04:41:53 +0200 (Wed, 08 Aug 2007) $".

Specified by:
revision in class AbstractService

info

public String info()
Description copied from class: AbstractService
Returns the informative string which should describe the service's essence in a sentence.

Specified by:
info in interface Service
Specified by:
info in class AbstractService
Returns:
the String with the service's short description.

setImage

public void setImage(File f)
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.

Parameters:
f - the file containing an image
Throws:
IOException - when the file could not be read

debug

private void debug(Object debugInfo)


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.