ePOST API

rice.post.proxy
Class PostProxy

java.lang.Object
  extended by rice.post.proxy.PostProxy
Direct Known Subclasses:
EmailProxy

public class PostProxy
extends java.lang.Object

This class starts up everything on the Pastry side, and then boots up the PAST, Scribe, POST.


Nested Class Summary
protected  class PostProxy.KillPanel
           
protected  class PostProxy.LivenessKeyHandler
           
protected  class PostProxy.LivenessThread
           
 class PostProxy.PasswordFrame
           
protected  class PostProxy.PostDialog
           
protected  class PostProxy.PostPanel
           
 class PostProxy.SMTPServerPanel
           
 
Field Summary
protected  PostUserAddress address
          The address of the local user
protected  StorageManagerImpl aggrWaitingStorage
          The local storage for objects waiting to be aggregated
protected  java.security.PublicKey caPublic
          The well-known public key of the CA
protected  RingCertificate cert
          The ring certificate for the pastry node
protected  PostCertificate certificate
          The certificate of the local user
 PostEntityAddress clone
          The previous address of the user, used to clone the old PostLog
static java.lang.String[] DEFAULT_PARAMS_FILES
           
protected  Cache deliveredBackupCache
          The local backup cache for pending deliveries
protected  PastImpl deliveredPast
          The local Past service
protected  StorageManagerImpl deliveredStorage
          The local storage for pending deliveries
protected  PostProxy.PostDialog dialog
          The dialog showing the post status to users
protected  Environment environment
           
protected  DistPastryNodeFactory factory
          The factory used to create the normal Pastry node
protected  IdFactory FACTORY
          The IdFactory to use (for protocol independence)
protected static java.lang.String FAILURE
           
protected  ForwardLog forwardLog
          The fetched forward log
protected  StorageManagerImpl glacierImmutableStorage
          The local storage for immutable glacier fragments
protected  StorageManagerImpl glacierMutableStorage
          The local storage for mutable glacier fragments
protected  StorageManagerImpl glacierNeighborStorage
          The local storage for glacier neighbor certificates
protected  StorageManagerImpl glacierTrashStorage
          The local storage for glacier's 'trash can'
protected  RingCertificate globalCert
          The ring certificate for the global node (if one exists)
protected  Node globalNode
          The node running in the global ring (if one exists)
protected  PastryNode globalPastryNode
          The node running in the global ring (if one exists)
protected  int globalPort
          The port number for the global Pastry node
protected  Cache immutableBackupCache
          The local backup cache, for immutable objects
protected  GlacierImpl immutableGlacier
          The local Glacier service
protected  Past immutablePast
          The local Past service, for immutable objects
protected  StorageManagerImpl immutableStorage
          The local storage manager, for immutable objects
protected  FragmentKeyFactory KFACTORY
          The IdFactory to use for glacier fragments
protected  java.net.InetAddress localHost
           
protected  PostLog log
          The fetched POST log
protected  Logger logger
           
protected  LogManager logManager
          The class which manages the log
protected  Past mutablePast
          The local Past service, for mutable objects
protected  StorageManagerImpl mutableStorage
          The local storage manager, for mutable objects
protected  Node node
          The node the services should use
protected static int PAD_SIZE
           
protected  java.security.KeyPair pair
          The keypair of the local user
protected  Parameters parameters
          The parameters we are running with
protected  java.lang.String pass
          The password of the local user
protected  PastryNode pastryNode
          The node the services should use
protected  Cache pendingBackupCache
          The local backup cache, for pending deliveries
protected  DeliveryPastImpl pendingPast
          The local Past service for delivery requests
protected  StorageManagerImpl pendingStorage
          The local storage for pending deliveries
protected  int port
          The port number for the Pastry node
protected  Post post
          The local Post service
static java.lang.String PROXY_PARAMETERS_NAME
          The name of the parameters file for Post
protected  Past realImmutablePast
          The local Past service, for immutable objects
protected  Id ringId
          The ring Id
protected  java.lang.String smtpServer
          The SMTP Server
protected static java.lang.String SUCCESS
           
protected  Timer timer
          The global timer used for scheduling events
protected  StorageManagerImpl trashStorage
          The local trash can, if in use
static java.lang.String version
           
 
Constructor Summary
PostProxy()
           
 
Method Summary
protected  void dialogPrint(java.lang.String message)
           
protected  Id generateRingId(java.lang.String name)
          Method which builds a ring id given a string to hash.
protected  java.net.InetSocketAddress[] getBootstrapsThatAreNotMe(java.net.InetSocketAddress[] addrs, int port)
          Pulls the
 GlacierImpl getGlacier()
           
 java.net.InetAddress getLocalHost()
           
static void main(java.lang.String[] args)
           
 int message(java.lang.String m, java.lang.String[] options, java.lang.String def)
           
 void panic(java.lang.Exception e, java.lang.String m, java.lang.String params)
          Helper method which throws an exception and tells the user a message why the error occurred.
 void panic(java.lang.Exception e, java.lang.String m, java.lang.String[] params)
           
 void panic(java.lang.String m)
           
 void resign()
           
protected  void sectionDone()
           
protected  void sectionStart(java.lang.String name)
           
protected  void setVersion()
           
protected  void start()
           
protected  void start2()
           
protected  void startCheckBoot()
          Method which check all necessary boot conditions before starting the proxy.
protected  void startCreateIdFactory()
          Method which creates the IdFactory to use
protected  void startDeterminePorts(Parameters parameters)
          Method which determines the local ports to use
protected  void startDetermineSMTPServer(Parameters parameters)
          Method which determines the local SMTP server to use
protected  void startDialog(Parameters parameters)
          Method which sees if we are going to use a proxy for the pastry node, and if so initiates the remote connection.
protected  void startFetchForwardingLog()
          Method which fetches the local user's forwarding log
protected  void startFetchLog()
          Method which fetches the local user's log
protected  void startGlacier()
          Method which initializes and starts up the glacier service
protected  void startGlobalMultiringNode(Environment env)
          Method which starts up the global multiring node service
protected  void startGlobalNode()
          Method which starts up the global ring node, if required
protected  void startGlobalPastryNode(Parameters parameters)
          Method which starts up the local pastry node
protected  void startInsertLog()
          Method which forces a log reinsertion, if desired (deletes all of the local log, so beware)
protected  void startLivenessMonitor()
          Method which sees if we are using a liveness monitor, and if so, sets up this VM to have a client liveness monitor.
protected  void startLoadRingCertificates(Parameters parameters)
          Method which loads the ring certificates ports to use
protected  void startMultiringNode()
          Method which starts up the local multiring node service
protected  void startPast()
          Method which starts up the local past service
protected  void startPastryNode()
          Method which starts up the local pastry node
protected  void startPost()
          Method which starts up the local post service
protected  void startRetrieveCAKey(Parameters parameters)
          Method which retrieves the CA's public key
protected  void startRetrieveUser(Parameters parameters)
          Method which retrieve the post user's certificate and key
protected  void startRetrieveUserCertificate(Parameters parameters)
          Method which retrieve's the user's certificate
protected  void startRetrieveUserClone(Parameters parameters)
          Method which sets up the post log we're going to clone, if we can't find ours
protected  void startRetrieveUserKey(Parameters parameters)
          Method which retrieves the user's encrypted keypair
protected  void startRetrieveUsername(Parameters parameters)
          Method which determines the username which POST should run with
protected  void startSecurityManager(Parameters parameters)
          Method which installs a modified security manager
protected  void startShutdownHooks(Parameters parameters)
          Method which installs shutdown hooks
protected  void startStorageManagers()
          Method which initializes the storage managers
protected  void startUpdateForwardingLog()
          Method which updates the local user's forward log
protected  void startUpdateUser(Parameters parameters)
          Method which updates the user certificate from userid.certificate and userid.keypair.enc to userid.epost.
protected  void startVerifyUserCertificate(Parameters parameters)
          Method which verifies the user's certificate
protected  void startVerifyUserKey(Parameters parameters)
          Method which verifies the user's encrypted keypair
protected  void stepDone(java.lang.String status)
           
protected  void stepDone(java.lang.String status, java.lang.String message)
           
protected  void stepException(java.lang.Exception e)
           
protected  void stepStart(java.lang.String name)
           
protected  void updateParameters(Parameters parameters)
           
 boolean useUI()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROXY_PARAMETERS_NAME

public static java.lang.String PROXY_PARAMETERS_NAME
The name of the parameters file for Post


DEFAULT_PARAMS_FILES

public static java.lang.String[] DEFAULT_PARAMS_FILES

SUCCESS

protected static final java.lang.String SUCCESS
See Also:
Constant Field Values

FAILURE

protected static final java.lang.String FAILURE
See Also:
Constant Field Values

PAD_SIZE

protected static final int PAD_SIZE
See Also:
Constant Field Values

ringId

protected Id ringId
The ring Id


FACTORY

protected IdFactory FACTORY
The IdFactory to use (for protocol independence)


KFACTORY

protected FragmentKeyFactory KFACTORY
The IdFactory to use for glacier fragments


factory

protected DistPastryNodeFactory factory
The factory used to create the normal Pastry node


pastryNode

protected PastryNode pastryNode
The node the services should use


cert

protected RingCertificate cert
The ring certificate for the pastry node


globalPastryNode

protected PastryNode globalPastryNode
The node running in the global ring (if one exists)


globalCert

protected RingCertificate globalCert
The ring certificate for the global node (if one exists)


port

protected int port
The port number for the Pastry node


globalPort

protected int globalPort
The port number for the global Pastry node


node

protected Node node
The node the services should use


globalNode

protected Node globalNode
The node running in the global ring (if one exists)


immutablePast

protected Past immutablePast
The local Past service, for immutable objects


realImmutablePast

protected Past realImmutablePast
The local Past service, for immutable objects


mutablePast

protected Past mutablePast
The local Past service, for mutable objects


pendingPast

protected DeliveryPastImpl pendingPast
The local Past service for delivery requests


deliveredPast

protected PastImpl deliveredPast
The local Past service


immutableGlacier

protected GlacierImpl immutableGlacier
The local Glacier service


post

protected Post post
The local Post service


timer

protected Timer timer
The global timer used for scheduling events


immutableStorage

protected StorageManagerImpl immutableStorage
The local storage manager, for immutable objects


mutableStorage

protected StorageManagerImpl mutableStorage
The local storage manager, for mutable objects


pendingStorage

protected StorageManagerImpl pendingStorage
The local storage for pending deliveries


deliveredStorage

protected StorageManagerImpl deliveredStorage
The local storage for pending deliveries


trashStorage

protected StorageManagerImpl trashStorage
The local trash can, if in use


glacierMutableStorage

protected StorageManagerImpl glacierMutableStorage
The local storage for mutable glacier fragments


glacierImmutableStorage

protected StorageManagerImpl glacierImmutableStorage
The local storage for immutable glacier fragments


glacierNeighborStorage

protected StorageManagerImpl glacierNeighborStorage
The local storage for glacier neighbor certificates


glacierTrashStorage

protected StorageManagerImpl glacierTrashStorage
The local storage for glacier's 'trash can'


aggrWaitingStorage

protected StorageManagerImpl aggrWaitingStorage
The local storage for objects waiting to be aggregated


immutableBackupCache

protected Cache immutableBackupCache
The local backup cache, for immutable objects


pendingBackupCache

protected Cache pendingBackupCache
The local backup cache, for pending deliveries


deliveredBackupCache

protected Cache deliveredBackupCache
The local backup cache for pending deliveries


pass

protected java.lang.String pass
The password of the local user


address

protected PostUserAddress address
The address of the local user


clone

public PostEntityAddress clone
The previous address of the user, used to clone the old PostLog


certificate

protected PostCertificate certificate
The certificate of the local user


pair

protected java.security.KeyPair pair
The keypair of the local user


caPublic

protected java.security.PublicKey caPublic
The well-known public key of the CA


dialog

protected PostProxy.PostDialog dialog
The dialog showing the post status to users


logManager

protected LogManager logManager
The class which manages the log


parameters

protected Parameters parameters
The parameters we are running with


log

protected PostLog log
The fetched POST log


forwardLog

protected ForwardLog forwardLog
The fetched forward log


smtpServer

protected java.lang.String smtpServer
The SMTP Server


environment

protected Environment environment

localHost

protected java.net.InetAddress localHost

logger

protected Logger logger

version

public static java.lang.String version
Constructor Detail

PostProxy

public PostProxy()
Method Detail

startLivenessMonitor

protected void startLivenessMonitor()
                             throws java.lang.Exception
Method which sees if we are using a liveness monitor, and if so, sets up this VM to have a client liveness monitor.

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

getLocalHost

public java.net.InetAddress getLocalHost()
                                  throws java.io.IOException
Throws:
java.io.IOException

startCheckBoot

protected void startCheckBoot()
                       throws java.lang.Exception
Method which check all necessary boot conditions before starting the proxy.

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startDialog

protected void startDialog(Parameters parameters)
                    throws java.lang.Exception
Method which sees if we are going to use a proxy for the pastry node, and if so initiates the remote connection.

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startShutdownHooks

protected void startShutdownHooks(Parameters parameters)
                           throws java.lang.Exception
Method which installs shutdown hooks

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startSecurityManager

protected void startSecurityManager(Parameters parameters)
                             throws java.lang.Exception
Method which installs a modified security manager

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startRetrieveCAKey

protected void startRetrieveCAKey(Parameters parameters)
                           throws java.lang.Exception
Method which retrieves the CA's public key

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startUpdateUser

protected void startUpdateUser(Parameters parameters)
                        throws java.lang.Exception
Method which updates the user certificate from userid.certificate and userid.keypair.enc to userid.epost.

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startRetrieveUsername

protected void startRetrieveUsername(Parameters parameters)
                              throws java.lang.Exception
Method which determines the username which POST should run with

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startRetrieveUserCertificate

protected void startRetrieveUserCertificate(Parameters parameters)
                                     throws java.lang.Exception
Method which retrieve's the user's certificate

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startVerifyUserCertificate

protected void startVerifyUserCertificate(Parameters parameters)
                                   throws java.lang.Exception
Method which verifies the user's certificate

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startRetrieveUserKey

protected void startRetrieveUserKey(Parameters parameters)
                             throws java.lang.Exception
Method which retrieves the user's encrypted keypair

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startVerifyUserKey

protected void startVerifyUserKey(Parameters parameters)
                           throws java.lang.Exception
Method which verifies the user's encrypted keypair

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startRetrieveUserClone

protected void startRetrieveUserClone(Parameters parameters)
                               throws java.lang.Exception
Method which sets up the post log we're going to clone, if we can't find ours

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startRetrieveUser

protected void startRetrieveUser(Parameters parameters)
                          throws java.lang.Exception
Method which retrieve the post user's certificate and key

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startLoadRingCertificates

protected void startLoadRingCertificates(Parameters parameters)
                                  throws java.lang.Exception
Method which loads the ring certificates ports to use

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startDeterminePorts

protected void startDeterminePorts(Parameters parameters)
                            throws java.lang.Exception
Method which determines the local ports to use

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startDetermineSMTPServer

protected void startDetermineSMTPServer(Parameters parameters)
                                 throws java.lang.Exception
Method which determines the local SMTP server to use

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startCreateIdFactory

protected void startCreateIdFactory()
                             throws java.lang.Exception
Method which creates the IdFactory to use

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startStorageManagers

protected void startStorageManagers()
                             throws java.lang.Exception
Method which initializes the storage managers

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startPastryNode

protected void startPastryNode()
                        throws java.lang.Exception
Method which starts up the local pastry node

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

generateRingId

protected Id generateRingId(java.lang.String name)
Method which builds a ring id given a string to hash. If the string is null, then the global ring is returned

Parameters:
name - The name to generate a ring from
Returns:
The ringId

startMultiringNode

protected void startMultiringNode()
                           throws java.lang.Exception
Method which starts up the local multiring node service

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startGlobalPastryNode

protected void startGlobalPastryNode(Parameters parameters)
                              throws java.lang.Exception
Method which starts up the local pastry node

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

getBootstrapsThatAreNotMe

protected java.net.InetSocketAddress[] getBootstrapsThatAreNotMe(java.net.InetSocketAddress[] addrs,
                                                                 int port)
                                                          throws java.io.IOException
Pulls the

Parameters:
addrs -
port -
Returns:
Throws:
java.io.IOException

startGlobalMultiringNode

protected void startGlobalMultiringNode(Environment env)
                                 throws java.lang.Exception
Method which starts up the global multiring node service

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startGlobalNode

protected void startGlobalNode()
                        throws java.lang.Exception
Method which starts up the global ring node, if required

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startGlacier

protected void startGlacier()
                     throws java.lang.Exception
Method which initializes and starts up the glacier service

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startPast

protected void startPast()
                  throws java.lang.Exception
Method which starts up the local past service

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startPost

protected void startPost()
                  throws java.lang.Exception
Method which starts up the local post service

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startInsertLog

protected void startInsertLog()
                       throws java.lang.Exception
Method which forces a log reinsertion, if desired (deletes all of the local log, so beware)

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startFetchLog

protected void startFetchLog()
                      throws java.lang.Exception
Method which fetches the local user's log

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startFetchForwardingLog

protected void startFetchForwardingLog()
                                throws java.lang.Exception
Method which fetches the local user's forwarding log

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

startUpdateForwardingLog

protected void startUpdateForwardingLog()
                                 throws java.lang.Exception
Method which updates the local user's forward log

Parameters:
parameters - The parameters to use
Throws:
java.lang.Exception

setVersion

protected void setVersion()

start2

protected void start2()
               throws java.lang.Exception
Throws:
java.lang.Exception

updateParameters

protected void updateParameters(Parameters parameters)
                         throws java.io.IOException
Throws:
java.io.IOException

start

protected void start()

panic

public void panic(java.lang.Exception e,
                  java.lang.String m,
                  java.lang.String params)
           throws java.lang.Exception
Helper method which throws an exception and tells the user a message why the error occurred.

Parameters:
e - The exception
m - The message why
Throws:
java.lang.Exception

panic

public void panic(java.lang.Exception e,
                  java.lang.String m,
                  java.lang.String[] params)
           throws java.lang.Exception
Throws:
java.lang.Exception

panic

public void panic(java.lang.String m)

useUI

public boolean useUI()

resign

public void resign()

message

public int message(java.lang.String m,
                   java.lang.String[] options,
                   java.lang.String def)

main

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

sectionStart

protected void sectionStart(java.lang.String name)

sectionDone

protected void sectionDone()

stepStart

protected void stepStart(java.lang.String name)

stepDone

protected void stepDone(java.lang.String status)

stepDone

protected void stepDone(java.lang.String status,
                        java.lang.String message)

stepException

protected void stepException(java.lang.Exception e)

dialogPrint

protected void dialogPrint(java.lang.String message)

getGlacier

public GlacierImpl getGlacier()

ePOST API

Copyright © 2001-2005 - Rice Pastry.