ZetaGrid v1.9

zeta
Class ZetaClient

java.lang.Object
  |
  +--zeta.ZetaClient

public class ZetaClient
extends java.lang.Object

Kernel of ZetaGrid.


Field Summary
private  boolean active
          Is true if and only if the client is running.
private static boolean downloadCompleted
           
private static ZetaProperties properties
          Contains a persistent set of the ZetaGrid properties.
private static boolean unknownHostExceptionOccur
          true if an UnknownHostException occurs.
 
Constructor Summary
private ZetaClient()
          Constructs the environment for the client.
 
Method Summary
private  void downloadFiles()
          Sends local information (filenames of the local directory (max. 900 characters), hostname, host address, os name, os version, os architecture, task name) to the server and receives required libraries for the runtime environment of the task.
(package private) static void encrypt(int randomize, byte[] keyClassData, java.lang.String inFilename, java.lang.String outFilename)
          Encrypts a specified file.
(package private) static void encrypt(int randomize, java.lang.String inFilename, java.lang.String outFilename)
          Encrypts a specified file using the default encryption key.
(package private) static java.lang.String encryptURLFile(java.lang.String urlFile)
          Encrypts the file attribute of a URL if the parameter 'encryption.url' is equal to true.
private static void exit()
          Terminates the client process.
private  java.lang.Object[] extractSignature(java.lang.String signatures, java.lang.String osName, java.lang.String arch, java.lang.String program)
          Searches the digital signature of a specified program, os name and architecture in all downloaded digital signatures.
static java.lang.String getKey()
          Returns a unique key of this computer.
private  java.lang.String getSignatures(java.io.InputStream in)
          Converts the digital signatures from an input stream to a string.
private  boolean ignoreFilename(java.lang.String filename)
           
static boolean isUnknownHostExceptionOccur()
          Returns true if an UnknownHostException occurs.
static void main(java.lang.String[] args)
          Main program to start the client.
private  void setProxyAuthentification()
           
private  void startComputationManager()
          Starts the computation manager.
(package private) static boolean verify(java.lang.String key, java.lang.String signature, byte[] data)
          Verifies the digital signature of the data using the specified key
private  boolean verifySignatures(java.lang.String signatures)
          Verifies the digital signature of all signatures.
private  void writeData(java.lang.String signature, Key key, java.io.InputStream in, java.lang.String outName)
          Writes a program on hard disk if the digital signature is correct.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

active

private boolean active
Is true if and only if the client is running.


downloadCompleted

private static boolean downloadCompleted

unknownHostExceptionOccur

private static boolean unknownHostExceptionOccur
true if an UnknownHostException occurs.


properties

private static ZetaProperties properties
Contains a persistent set of the ZetaGrid properties.

Constructor Detail

ZetaClient

private ZetaClient()
Constructs the environment for the client. Downloads the managing part of the client and the required libraries for the defined task. A socket will be opened on default port 10000 to block a second start of the same client on the same computer which occur synchronization problems.

Method Detail

main

public static void main(java.lang.String[] args)
Main program to start the client.

Parameters:
args - argumens from the command line; 'exit' will terminate the active client

isUnknownHostExceptionOccur

public static boolean isUnknownHostExceptionOccur()
Returns true if an UnknownHostException occurs.

Returns:
true if an UnknownHostException occurs.

downloadFiles

private void downloadFiles()
Sends local information (filenames of the local directory (max. 900 characters), hostname, host address, os name, os version, os architecture, task name) to the server and receives required libraries for the runtime environment of the task. Every downloaded library must have a correct digital signature before it will be stored on hard disk. The first file "signature.txt" contains all digital signatures.


ignoreFilename

private boolean ignoreFilename(java.lang.String filename)

startComputationManager

private void startComputationManager()
                              throws java.lang.ClassNotFoundException,
                                     java.lang.IllegalAccessException,
                                     java.lang.InstantiationException,
                                     java.lang.reflect.InvocationTargetException,
                                     java.lang.NoSuchMethodException
Starts the computation manager.

java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException

exit

private static void exit()
Terminates the client process.


writeData

private void writeData(java.lang.String signature,
                       Key key,
                       java.io.InputStream in,
                       java.lang.String outName)
                throws java.io.IOException
Writes a program on hard disk if the digital signature is correct.

Parameters:
signature - digital signature of the program
key - public key of the digital signature
in - input stream with the program data
outName - filename of the program
Throws:
java.io.IOException - if an I/O error occurs.

getSignatures

private java.lang.String getSignatures(java.io.InputStream in)
                                throws java.io.IOException
Converts the digital signatures from an input stream to a string.

Parameters:
in - input stream with the digital signatures
Throws:
java.io.IOException - if an I/O error occurs.

verifySignatures

private boolean verifySignatures(java.lang.String signatures)
                          throws java.io.IOException
Verifies the digital signature of all signatures. The digital signature of all signatures is in the last line. The default key will be used for the verification.

Parameters:
signatures - all digital signatures
Returns:
true if the digital signature of all signatures is correct.
Throws:
java.io.IOException - if an I/O error occurs.

extractSignature

private java.lang.Object[] extractSignature(java.lang.String signatures,
                                            java.lang.String osName,
                                            java.lang.String arch,
                                            java.lang.String program)
                                     throws java.io.IOException
Searches the digital signature of a specified program, os name and architecture in all downloaded digital signatures.

Parameters:
signatures - all downloaded digital signatures
osName - os name
arch - processor architecture
program - name of the program
Returns:
(the digital signature of the specified program and environment, key of the digital signature)
Throws:
java.io.IOException - if an I/O error occurs.

setProxyAuthentification

private void setProxyAuthentification()

getKey

public static java.lang.String getKey()
Returns a unique key of this computer.

Returns:
a unique key of this computer.

encrypt

static void encrypt(int randomize,
                    java.lang.String inFilename,
                    java.lang.String outFilename)
             throws java.io.IOException
Encrypts a specified file using the default encryption key. Every transfer of a result uses a key establishment protocol (half-certified Diffie-Hellman) with keys which have a length of 1024 Bit.

Parameters:
randomize - random number for the key establishment protocol
inFilename - name of the file which should be encrypted
outFilename - name of the encrypted file
Throws:
java.io.IOException - if an I/O error occurs.

encrypt

static void encrypt(int randomize,
                    byte[] keyClassData,
                    java.lang.String inFilename,
                    java.lang.String outFilename)
             throws java.io.IOException
Encrypts a specified file. Every transfer of a result uses a key establishment protocol (half-certified Diffie-Hellman) with keys which have a length of 1024 Bit.

Parameters:
randomize - random number for the key establishment protocol
keyClassData - the bytes that make up the class data which contains the key for the encryption algorithm
inFilename - name of the file which should be encrypted
outFilename - name of the encrypted file
Throws:
java.io.IOException - if an I/O error occurs.

encryptURLFile

static java.lang.String encryptURLFile(java.lang.String urlFile)
                                throws java.io.IOException
Encrypts the file attribute of a URL if the parameter 'encryption.url' is equal to true. The default encryption algorithmus will be used.

Parameters:
urlFile - file attribute of a URL
Returns:
encrypted file attribute of a URL where the parameters are packed in a new parameter 'param'
Throws:
java.io.IOException - if an I/O error occurs.

verify

static boolean verify(java.lang.String key,
                      java.lang.String signature,
                      byte[] data)
               throws java.io.IOException
Verifies the digital signature of the data using the specified key

Throws:
java.io.IOException - if an I/O error occurs.

ZetaGrid v1.9

For further technical papers, see ZetaGrid Technical Documentation.
 
Copyright © 2001,2002 Sebastian Wedeniwski. All Rights Reserved.