issrg.SAWS
Class SAWSServer

java.lang.Object
  extended byissrg.SAWS.SAWSServer

public class SAWSServer
extends java.lang.Object

This is the SAWS Server class. It provides all the necessary API methods for SAWS API clients.

Version:
0.1, Oct. 2005
Author:
W. Xu

Nested Class Summary
 class SAWSServer.HeartbeatRecordWriting
          This sub class is for generating heartbeat records.
 
Field Summary
 int currentReadingFileNo
           
 java.util.Vector logFileList
           
 java.util.Vector recordBlockListFromOneLogFile
           
 
Constructor Summary
SAWSServer()
          This method is the constructor of SAWSServer.
SAWSServer(int flag)
          This method is the constructor of SAWSServer.
 
Method Summary
 void closeLog()
          This method closes the current log file.
 void createEncryptionKeystore()
          This method is used by the SAWS command line mode to create the encryption keystore
 void createSigningKeystore()
          This method is used by the SAWS command line mode to create the signing keystore
 void importRootCA()
          This method is used by the SAWS command line mode to import the root CA PKC into the signing keystore
 void importSigningPKC()
          This method is used by the SAWS command line mode to import the signing PKC which is issued by root CA into the signing keystore
 void listSigningKeystore()
          This method is used by the SAWS command line mode to list all entries in the signing keystore
static void main(java.lang.String[] args)
          This main method is SAWS command-line working mode.
 void outputPKCRequest()
          This method is used by the SAWS command line mode to output the PKC request file from the signing keystore.
 java.util.Vector sawsReadOneLogFile()
          This method is to read saws log files one at a time from the first log file to the last log file in the log file list logFileList.
 void sawsStart()
          This method is to start SAWSServer to record client records.
 int sendLogRecord(byte[] messageBlock)
          This method is used by the SAWS API client to send a log message to SAWS server.
 int sendLogRecord(byte[] messageBlock, byte encryptionFlag)
          This method is used by the SAWS API client to send a log message to SAWS server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logFileList

public java.util.Vector logFileList

currentReadingFileNo

public int currentReadingFileNo

recordBlockListFromOneLogFile

public java.util.Vector recordBlockListFromOneLogFile
Constructor Detail

SAWSServer

public SAWSServer()
This method is the constructor of SAWSServer. It is for SAWS web service interface. It is equivalent to the following constructor when flag = 1


SAWSServer

public SAWSServer(int flag)
This method is the constructor of SAWSServer.

Method Detail

sawsStart

public void sawsStart()
This method is to start SAWSServer to record client records.

Returns:
null

sawsReadOneLogFile

public java.util.Vector sawsReadOneLogFile()
This method is to read saws log files one at a time from the first log file to the last log file in the log file list logFileList. So you can invoke it again and again unitl null is returned.

Returns:
Vector the Vector of log records

closeLog

public void closeLog()
This method closes the current log file.


sendLogRecord

public int sendLogRecord(byte[] messageBlock)
This method is used by the SAWS API client to send a log message to SAWS server. No encryption is used by this method.


sendLogRecord

public int sendLogRecord(byte[] messageBlock,
                         byte encryptionFlag)
This method is used by the SAWS API client to send a log message to SAWS server. Since this log message is coming from a SAWS client, so the log message type is certainly SAWSClientLogDataType.

Parameters:
messageBlock - is the log message to be sent.
encryptionFlag - encryption flag to indicate the encryption requirement. SAWSConstant.NoEncryptionFlag: log with no encryption; SAWSConstant.SymmetricEncryptionFlag: log with symmetric encryption; SAWSConstant.CommandFlag: command for SAWS to perform: the command contents are contained in messageBlock.
Returns:
int 0 sucess; -1 failure.

outputPKCRequest

public void outputPKCRequest()
This method is used by the SAWS command line mode to output the PKC request file from the signing keystore.


createEncryptionKeystore

public void createEncryptionKeystore()
This method is used by the SAWS command line mode to create the encryption keystore


createSigningKeystore

public void createSigningKeystore()
This method is used by the SAWS command line mode to create the signing keystore


importRootCA

public void importRootCA()
This method is used by the SAWS command line mode to import the root CA PKC into the signing keystore


importSigningPKC

public void importSigningPKC()
This method is used by the SAWS command line mode to import the signing PKC which is issued by root CA into the signing keystore


listSigningKeystore

public void listSigningKeystore()
This method is used by the SAWS command line mode to list all entries in the signing keystore


main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
This main method is SAWS command-line working mode.

Throws:
java.lang.Exception