mail.test
Class TestCommunicator

java.lang.Object
  extended by mail.communication.Communicator
      extended by mail.test.TestCommunicator

public class TestCommunicator
extends Communicator

Author:
Arne Müller

Field Summary
(package private)  javax.xml.parsers.DocumentBuilderFactory factory
           
private  Address myAddress
           
private  LocalNode myNode
           
private static int nextIndex
           
(package private) static boolean testOut
           
(package private)  javax.xml.transform.TransformerFactory transFactory
           
static java.util.Hashtable<java.lang.String,TestCommunicator> web
           
 
Constructor Summary
TestCommunicator(java.lang.String addrName)
           
 
Method Summary
 void attachNode(LocalNode l)
           
 void close()
           
 void disable()
           
 void enable()
           
 void findMyAddress(Address apeer)
           
 java.util.Collection<Address> getAddress()
          returns the Address this Communicator uses to send Packets
 javax.xml.parsers.DocumentBuilder getDocumentBuilder()
           
 boolean isOpen()
           
static void main(java.lang.String[] args)
           
 Address parseAddress(java.lang.String addr)
           
private  void print_debug(org.w3c.dom.Document d)
           
 void receivePackage(java.io.InputStream p, Address from)
           
 void sendPackage(CPackage p, Address to)
           
 void sendPackage(CPackage p, RemoteNode to)
           
private static RemoteNode spawn(Communicator c)
           
 void testConnections()
           
 java.lang.String toString()
           
 void write(org.w3c.dom.Document d, java.io.File f)
           
 
Methods inherited from class mail.communication.Communicator
getReplyList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

web

public static java.util.Hashtable<java.lang.String,TestCommunicator> web

myAddress

private Address myAddress

myNode

private LocalNode myNode

factory

javax.xml.parsers.DocumentBuilderFactory factory

transFactory

javax.xml.transform.TransformerFactory transFactory

testOut

static boolean testOut

nextIndex

private static int nextIndex
Constructor Detail

TestCommunicator

public TestCommunicator(java.lang.String addrName)
Method Detail

getDocumentBuilder

public javax.xml.parsers.DocumentBuilder getDocumentBuilder()
Specified by:
getDocumentBuilder in class Communicator

parseAddress

public Address parseAddress(java.lang.String addr)
Specified by:
parseAddress in class Communicator

findMyAddress

public void findMyAddress(Address apeer)
Specified by:
findMyAddress in class Communicator

getAddress

public java.util.Collection<Address> getAddress()
Description copied from class: Communicator
returns the Address this Communicator uses to send Packets

Specified by:
getAddress in class Communicator
Returns:

sendPackage

public void sendPackage(CPackage p,
                        RemoteNode to)
                 throws IncompatibleAddressException,
                        NotReachableException,
                        PackageBuildException
Specified by:
sendPackage in class Communicator
Throws:
IncompatibleAddressException
NotReachableException
PackageBuildException

attachNode

public void attachNode(LocalNode l)
Specified by:
attachNode in class Communicator

enable

public void enable()

disable

public void disable()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

print_debug

private void print_debug(org.w3c.dom.Document d)

sendPackage

public void sendPackage(CPackage p,
                        Address to)
                 throws IncompatibleAddressException,
                        java.io.IOException,
                        PackageBuildException
Specified by:
sendPackage in class Communicator
Throws:
IncompatibleAddressException
java.io.IOException
PackageBuildException

receivePackage

public void receivePackage(java.io.InputStream p,
                           Address from)
                    throws IncompatibleAddressException,
                           java.io.IOException
Throws:
IncompatibleAddressException
java.io.IOException

spawn

private static RemoteNode spawn(Communicator c)
                         throws EncSupplyException
Throws:
EncSupplyException

testConnections

public void testConnections()
                     throws EncSupplyException
Throws:
EncSupplyException

main

public static void main(java.lang.String[] args)

isOpen

public boolean isOpen()
Specified by:
isOpen in class Communicator

close

public void close()
Specified by:
close in class Communicator

write

public void write(org.w3c.dom.Document d,
                  java.io.File f)
           throws javax.xml.transform.TransformerException
Specified by:
write in class Communicator
Throws:
javax.xml.transform.TransformerException