org.iids.aos.kernel.ac
Class AgentContainerTransfer

java.lang.Object
  extended by org.iids.aos.kernel.ac.AgentContainerTransfer

public class AgentContainerTransfer
extends java.lang.Object

Singleton class (sort of) containing some config for ACReceiver and ACSender.

Author:
arno

Nested Class Summary
static class AgentContainerTransfer.FileRecord
           
 
Field Summary
static java.lang.String AC_RECEIVE_LOG_FILENAME
          File where logs of received ACs are stored
protected  java.io.File acDir
          The directory where the kernel normally stores ACs
protected  AgentContainerTable agentContainerTable
          See constructor.
protected static org.apache.commons.logging.Log log
           
protected  boolean logReceipts
          Whether to log receive ACTP receipts
protected static int MAX_AGENT_CONTAINER_LENGTH
          The maximum number of bytes in an agent container that this AOS kernel is willing to handle.
protected static int MAX_MESSAGE_LENGTH
          Maximum XDR message length that this AOS kernel is willing to handle.
protected  java.security.PrivateKey privateKey
          The private key used for signing received TOCs to send back
protected static int PROTO_HEADER_LENGTH
          Length in bytes of PROTO header V1
protected  ACReceiver receiver
          Handles receiption
protected  java.util.ArrayList<AgentContainerTransfer.FileRecord> recoveredList
           
protected  boolean secureComm
          Whether to use secure communication
protected  ACSender sender
           
protected static int SHIP_CONSTANT_LENGTH
          The constant component of the 'ship' message length.
protected static int SHIP_REPLY_CONSTANT_LENGTH
           
protected  boolean shutdown
          Set if transfer code is being shutdown as part of kernel shutdown
protected static int XDR_WRITE_BUFFER_SIZE
          The size of a write buffer large enough to hold any ACTP protocol message, excluding the (variable component of) an agent container.
 
Constructor Summary
AgentContainerTransfer(AgentContainerTable agentContainerTable, java.io.File acDir, java.net.InetSocketAddress socketAddress, boolean secureComm, java.security.KeyStore keyStore, java.lang.String keyStorePassphrase, boolean signedReceipts, byte[] certificate, java.security.PrivateKey privateKey, boolean logReceipts, KernelImpl kernel)
          Creates a new instance of AgentContainerTransfer
 
Method Summary
 AOSapi.WaitACResult findInRecoveredList(Cookie c, TransactionID[] tids)
           
protected static AgentContainerTransfer getInstance()
           
 ACReceiver getReceiver()
           
 ACSender getSender()
           
 void handleMUXP(java.net.Socket socket, java.io.InputStream ins, int bodyLength)
           
 void recordReceivedAC(int acid, TransactionID tid, TIDRecord tidrec, Endpoint ep)
           
 void recover(RoleTable roleTable)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log

agentContainerTable

protected final AgentContainerTable agentContainerTable
See constructor.


acDir

protected final java.io.File acDir
The directory where the kernel normally stores ACs


secureComm

protected final boolean secureComm
Whether to use secure communication


privateKey

protected final java.security.PrivateKey privateKey
The private key used for signing received TOCs to send back


logReceipts

protected boolean logReceipts
Whether to log receive ACTP receipts


shutdown

protected boolean shutdown
Set if transfer code is being shutdown as part of kernel shutdown


receiver

protected ACReceiver receiver
Handles receiption


sender

protected ACSender sender

recoveredList

protected java.util.ArrayList<AgentContainerTransfer.FileRecord> recoveredList

AC_RECEIVE_LOG_FILENAME

public static final java.lang.String AC_RECEIVE_LOG_FILENAME
File where logs of received ACs are stored

See Also:
Constant Field Values

XDR_WRITE_BUFFER_SIZE

protected static final int XDR_WRITE_BUFFER_SIZE
The size of a write buffer large enough to hold any ACTP protocol message, excluding the (variable component of) an agent container.


SHIP_CONSTANT_LENGTH

protected static final int SHIP_CONSTANT_LENGTH
The constant component of the 'ship' message length.


SHIP_REPLY_CONSTANT_LENGTH

protected static final int SHIP_REPLY_CONSTANT_LENGTH

PROTO_HEADER_LENGTH

protected static final int PROTO_HEADER_LENGTH
Length in bytes of PROTO header V1

See Also:
Constant Field Values

MAX_AGENT_CONTAINER_LENGTH

protected static final int MAX_AGENT_CONTAINER_LENGTH
The maximum number of bytes in an agent container that this AOS kernel is willing to handle.

See Also:
Constant Field Values

MAX_MESSAGE_LENGTH

protected static final int MAX_MESSAGE_LENGTH
Maximum XDR message length that this AOS kernel is willing to handle.

Constructor Detail

AgentContainerTransfer

public AgentContainerTransfer(AgentContainerTable agentContainerTable,
                              java.io.File acDir,
                              java.net.InetSocketAddress socketAddress,
                              boolean secureComm,
                              java.security.KeyStore keyStore,
                              java.lang.String keyStorePassphrase,
                              boolean signedReceipts,
                              byte[] certificate,
                              java.security.PrivateKey privateKey,
                              boolean logReceipts,
                              KernelImpl kernel)
                       throws java.io.IOException,
                              java.net.SocketException,
                              java.security.NoSuchAlgorithmException,
                              java.security.KeyStoreException,
                              java.security.KeyManagementException,
                              java.security.UnrecoverableKeyException,
                              NoKnownSecuritySuiteException
Creates a new instance of AgentContainerTransfer

Throws:
java.io.IOException
java.net.SocketException
java.security.NoSuchAlgorithmException
java.security.KeyStoreException
java.security.KeyManagementException
java.security.UnrecoverableKeyException
NoKnownSecuritySuiteException
Method Detail

getInstance

protected static AgentContainerTransfer getInstance()

shutdown

public void shutdown()

getSender

public ACSender getSender()

getReceiver

public ACReceiver getReceiver()

handleMUXP

public void handleMUXP(java.net.Socket socket,
                       java.io.InputStream ins,
                       int bodyLength)
                throws java.io.IOException
Throws:
java.io.IOException

findInRecoveredList

public AOSapi.WaitACResult findInRecoveredList(Cookie c,
                                               TransactionID[] tids)

recover

public void recover(RoleTable roleTable)
             throws KernelException
Throws:
KernelException

recordReceivedAC

public void recordReceivedAC(int acid,
                             TransactionID tid,
                             TIDRecord tidrec,
                             Endpoint ep)
                      throws KernelException
Throws:
KernelException


Copyright © 2003, 2004 IIDS Group. All Rights Reserved.