All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.download.NewsClient

java.lang.Object
   |
   +----semper.download.NewsClient

public class NewsClient
extends Object
implements ProtocolConstants
Class which defines and implements the basic functionality in order to interact with a the CRA/News Server

Version:
$Revision: 1.1 $ $Date: 1998/03/13 16:40:56 $
Author:
Petros Pantis, Kostas Tzelepis

Variable Index

 o NEWS_ACCEPTED
State in which the news server accepted the uploaded news
 o NEWS_ERROR
State identifier which declares that an error has been occured during news down/uploading
 o RETRIEVE_NEWS
During this state the news client thread downloads the last news from the news server
 o SEND_NEWS
During this state the news client thread uploads news to the news server
 o UPLOAD_NEWS
Identifier that informs the news server the intention of the client to upload news

Constructor Index

 o NewsClient(InetAddress, long, Download)
Object constructor

Method Index

 o getNews(String[], Vector[])
Method used to download news from the nes server
 o uploadNews(Credentials, Vector, byte[], String[])
Method used to upload news to the news server

Variables

 o RETRIEVE_NEWS
 public static final int RETRIEVE_NEWS
During this state the news client thread downloads the last news from the news server

 o UPLOAD_NEWS
 public static final int UPLOAD_NEWS
Identifier that informs the news server the intention of the client to upload news

 o NEWS_ACCEPTED
 public static final int NEWS_ACCEPTED
State in which the news server accepted the uploaded news

 o SEND_NEWS
 public static final int SEND_NEWS
During this state the news client thread uploads news to the news server

 o NEWS_ERROR
 public static final int NEWS_ERROR
State identifier which declares that an error has been occured during news down/uploading

Constructors

 o NewsClient
 public NewsClient(InetAddress host,
                   long prevC,
                   Download dm)
Object constructor

Parameters:
host - the ip-address of the current host
prevC - the last down/upload request time
dm - a reference to the download manager

Methods

 o getNews
 public long getNews(String retMsg[],
                     Vector newVector[])
Method used to download news from the nes server

Parameters:
retMsg - a String object that stores a error message that occure during news downloading
newVector - a Vector object in which the downloading news will be stored
Returns:
value a negative value if some error occur, else the current time which is send from the news server
 o uploadNews
 public long uploadNews(Credentials creds,
                        Vector newsVector,
                        byte signature[],
                        String retMsg[])
Method used to upload news to the news server

Parameters:
creds - the owned credentials
newsVector - the news that will be uploaded to the news server
signature - the signature of the above news structure
retMsg - used in order to keep the executional status of the request
Returns:
value a negative value if some error occur, else the current time which is send from the news server

All Packages  Class Hierarchy  This Package  Previous  Next  Index