: Class Comms

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Free
Class Comms

    java.lang.Object
      |
      +--Free.Comms

public class Comms
extends java.lang.Object

Comms is the key class for launching communications with servers. The class launches a thread for TCP/IP communications and also contains the methods for building packets. These packets are then held in `message` for retrieval by `TCPClient`

Version:
  1.4 8 September 2001
Author:
  Jason Kitcat

Field Summary
`protected java.util.Vector` | `client_hmac_keys`
`protected java.util.Vector` | `client_hmac_seeds`
`protected static java.lang.String` | `ER_address` constant to hold address of electoral roll server
`protected static int` | `freePort` constant to store value being used as GNU.FREE port number for security reasons I recommend this is changed regularly
`protected static int` | `freeRTPort` port number for RTServer
`protected java.util.Vector` | `message_twos`
`protected java.util.Vector` | `server_hmac_keys`
`protected java.util.Vector` | `server_hmac_seeds`
`protected java.util.Vector` | `session_count`
`protected java.util.Vector` | `session_data`
`protected static java.lang.String` | `T_address` constant to hold address of totaller server
`protected int` | `tdCount` keeps track of where we are in the Vector
`protected java.util.Vector` | `threadTimeOut` Vector to store TimeOut threads
`protected java.util.Vector` | `threadVect` Vector to store TCPClient threads
`protected TimeOutThread` | `timer`
`protected java.util.Vector` | `totalData` stores total packet data while waiting to be sent

Constructor Summary
`protected` | `Comms()`

Method Summary
`protected java.util.Date` | `getCheck()`
`protected java.lang.String` | `getCheckKey()`
`protected java.lang.String` | `getMessage()`
`protected java.lang.String[]` | `getSession(int vectIndex)` tries to find matching session data.
`protected void` | `getTotalVoted()` getTotalVoted communicates with the ERServer to find out how many people voted.
`protected char` | `getType()`
`protected void` | `newCheck()`
`protected void` | `noCheck()`
`protected void` | `sendDiag(java.lang.String msg)` sendDiag dispatches any diagnostic packets for debugging.
`protected void` | `sendKey(java.lang.String akey)` sendKey delivers a key to an ERServer for confirming someone has voted.
`protected void` | `sendTotals()` sendTotals creates check date for security, calculates vote counts and sends on to the Totaller server.
`protected void` | `setCheckKey(java.lang.String x)`
`protected void` | `setFromServer(java.lang.String x)`
`protected void` | `setSession(int vectIndex, java.lang.String session_key, java.lang.String client_hmac_key, java.lang.String server_hmac_key, java.lang.String client_hmac_seed, java.lang.String server_hmac_seed, int session_counter, java.lang.String message_two)` adds entries to Vectors to keep track of session_data

Methods inherited from class java.lang.Object
`, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### timer

    protected TimeOutThread timer

### T_address

    protected static final java.lang.String T_address

  constant to hold address of totaller server

### ER_address

    protected static final java.lang.String ER_address

  constant to hold address of electoral roll server

### freePort

    protected static final int freePort

  constant to store value being used as GNU.FREE port number for security reasons I recommend this is changed regularly

### freeRTPort

    protected static final int freeRTPort

  port number for RTServer

### totalData

    protected java.util.Vector totalData

  stores total packet data while waiting to be sent

### tdCount

    protected int tdCount

  keeps track of where we are in the Vector

### threadVect

    protected java.util.Vector threadVect

  Vector to store TCPClient threads

### threadTimeOut

    protected java.util.Vector threadTimeOut

  Vector to store TimeOut threads

### session_data

    protected java.util.Vector session_data

### client_hmac_keys

    protected java.util.Vector client_hmac_keys

### server_hmac_keys

    protected java.util.Vector server_hmac_keys

### client_hmac_seeds

    protected java.util.Vector client_hmac_seeds

### server_hmac_seeds

    protected java.util.Vector server_hmac_seeds

### session_count

    protected java.util.Vector session_count

### message_twos

    protected java.util.Vector message_twos

Constructor Detail

### Comms

    protected Comms()

Method Detail

### setSession

    protected void setSession(int vectIndex,
                              java.lang.String session_key,
                              java.lang.String client_hmac_key,
                              java.lang.String server_hmac_key,
                              java.lang.String client_hmac_seed,
                              java.lang.String server_hmac_seed,
                              int session_counter,
                              java.lang.String message_two)

  adds entries to Vectors to keep track of session_data
  Parameters:
    `vectIndex` - Index of the vector information
    `session_key` - The encryption session_key to index by
    `client_hmac_key` - Client HMAC key
    `server_hmac_key` - Server HMAC key
    `client_hmac_key` - Client HMAC seed
    `server_hmac_key` - Server HMAC seed
    `session_counter` - Packet counter

### getSession

    protected java.lang.String[] getSession(int vectIndex)

  tries to find matching session data.
  Parameters:
    `session_key` -
  Returns:
    A string array with the results of the match

### setFromServer

    protected void setFromServer(java.lang.String x)

### getCheckKey

    protected java.lang.String getCheckKey()

### setCheckKey

    protected void setCheckKey(java.lang.String x)

### getCheck

    protected java.util.Date getCheck()

### noCheck

    protected void noCheck()

### newCheck

    protected void newCheck()

### getMessage

    protected java.lang.String getMessage()

### getType

    protected char getType()

### sendTotals

    protected void sendTotals()

  sendTotals creates check date for security, calculates vote counts and sends on to the Totaller server.

### sendKey

    protected void sendKey(java.lang.String akey)
                    throws java.lang.Exception

  sendKey delivers a key to an ERServer for confirming someone has voted.
  Parameters:
    `akey` - The key to send

### getTotalVoted

    protected void getTotalVoted()

  getTotalVoted communicates with the ERServer to find out how many people voted. This can be compared with the number of votes registered to give an idea of validity.

### sendDiag

    protected void sendDiag(java.lang.String msg)

  sendDiag dispatches any diagnostic packets for debugging.
  Parameters:
    `msg` - Data for packet

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD