edu.nyu.cs.pdsg.switchboard
Class Switchboard

java.lang.Object
  extended byedu.nyu.cs.pdsg.switchboard.Switchboard

public class Switchboard
extends java.lang.Object


Field Summary
private static boolean initialized
           
private static PermissionsAdaptor permissionsAdaptor
           
private static java.util.HashMap stacks
          a collection of stacks
private static long uid
           
 
Constructor Summary
Switchboard()
           
 
Method Summary
static SbStreamsStack connect(java.net.InetSocketAddress _address, java.lang.String _name, java.security.KeyPair _keyPair, Authorizer _authorizer, Credentials _credentials, long _livenessTimeDiff, SbEventHandler _eventHandler)
          This really ought not to return the stack itself.
static SbStreamsStack connect(java.net.InetSocketAddress _address, java.lang.String _name, java.security.KeyPair _keyPair, Authorizer _authorizer, Credentials _credentials, SbEventHandler _eventHandler)
          Allows requestor to use with default timeout
static java.util.HashMap getStacks()
           
static PermissionsAdaptor getSystemPermissionsAdaptor()
           
static long getUid()
           
static void init()
          Base initialization.
static void initInDumbMode()
          Need to figure out what this does
static SbServerSocket listen(java.net.InetSocketAddress _address, java.lang.String _name, java.security.KeyPair _keyPair, Authorizer _authorizer, Credentials _credentials, long _livenessTimeDiff, SbEventHandlerFactory _eventHandlerFactory)
           
static SbServerSocket listen(java.net.InetSocketAddress _address, java.lang.String _name, java.security.KeyPair _keyPair, Authorizer _authorizer, Credentials _credentials, SbEventHandlerFactory _eventHandlerFactory)
           
static SbRpcStack lookup(java.net.InetSocketAddress _address, java.lang.String _name, java.security.KeyPair _keyPair, Authorizer _authorizer, Credentials _credentials, long _livenessTimeDiff, SbEventHandler _eventHandler)
          This really ought not to return the stack itself.
static SbRpcStack lookup(java.net.InetSocketAddress _address, java.lang.String _name, java.security.KeyPair _keyPair, Authorizer _authorizer, Credentials _credentials, SbEventHandler _eventHandler)
          Allows requestor to use with default timeout
static void serve(java.net.InetSocketAddress _address, java.lang.String _name, java.security.KeyPair _keyPair, Authorizer _authorizer, Credentials _credentials, LifetimeManagerFactory _lifetimeManagerFactory)
          Serves an object over Switchboard and uses the default timeout.
static void serve(java.net.InetSocketAddress _address, java.lang.String _name, java.security.KeyPair _keyPair, Authorizer _authorizer, Credentials _credentials, long _livenessTimeDiff, LifetimeManagerFactory _lifetimeManagerFactory)
          Serves an object over Switchboard.
static void serve(java.net.InetSocketAddress _address, java.lang.String _name, java.security.KeyPair _keyPair, Authorizer _authorizer, Credentials _credentials, java.io.Serializable _singleton)
          Serves an object over Switchboard.
static void setSystemPermissionsAdaptor(PermissionsAdaptor _permissionsAdaptor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stacks

private static java.util.HashMap stacks
a collection of stacks


initialized

private static boolean initialized

uid

private static long uid

permissionsAdaptor

private static PermissionsAdaptor permissionsAdaptor
Constructor Detail

Switchboard

public Switchboard()
Method Detail

init

public static void init()
Base initialization. Must be called before use of any Switchboard static methods.


setSystemPermissionsAdaptor

public static void setSystemPermissionsAdaptor(PermissionsAdaptor _permissionsAdaptor)

getSystemPermissionsAdaptor

public static PermissionsAdaptor getSystemPermissionsAdaptor()

getUid

public static long getUid()

initInDumbMode

public static void initInDumbMode()
Need to figure out what this does


getStacks

public static java.util.HashMap getStacks()

serve

public static void serve(java.net.InetSocketAddress _address,
                         java.lang.String _name,
                         java.security.KeyPair _keyPair,
                         Authorizer _authorizer,
                         Credentials _credentials,
                         long _livenessTimeDiff,
                         LifetimeManagerFactory _lifetimeManagerFactory)
Serves an object over Switchboard.

This version takes a LifetimeManagerFactory which will generate SbEventHandlers and IncalHandlers on a per-connection basis.

Parameters:
_address - the local host IP to which the served object should be bound
_name - the name under which the served object should be bound
_keyPair - the public/private key pair of the serving entity
_authorizer - used to authorize any potential users of the object
_credentials - the credentials presented by the server that clients may use to authorize the server
_livenessTimeDiff - the timeout parameter

serve

public static void serve(java.net.InetSocketAddress _address,
                         java.lang.String _name,
                         java.security.KeyPair _keyPair,
                         Authorizer _authorizer,
                         Credentials _credentials,
                         LifetimeManagerFactory _lifetimeManagerFactory)
Serves an object over Switchboard and uses the default timeout.

This version takes an instance of an Incall Handler and a single instance of an SbEventHandler.


serve

public static void serve(java.net.InetSocketAddress _address,
                         java.lang.String _name,
                         java.security.KeyPair _keyPair,
                         Authorizer _authorizer,
                         Credentials _credentials,
                         java.io.Serializable _singleton)
Serves an object over Switchboard.

This version takes a LifetimeManagerFactory which will generate SbEventHandlers and IncalHandlers on a per-connection basis.

Parameters:
_address - the local host IP to which the served object should be bound
_name - the name under which the served object should be bound
_keyPair - the public/private key pair of the serving entity
_authorizer - used to authorize any potential users of the object
_credentials - the credentials presented by the server that clients may use to authorize the server
_singleton - a singleton instance of the in-call handler

lookup

public static SbRpcStack lookup(java.net.InetSocketAddress _address,
                                java.lang.String _name,
                                java.security.KeyPair _keyPair,
                                Authorizer _authorizer,
                                Credentials _credentials,
                                long _livenessTimeDiff,
                                SbEventHandler _eventHandler)
This really ought not to return the stack itself. Some wrapper, maybe? PROBLEM: We're not doing anything with _name right now. This means that we're binding one object per port. There can be multiple connections per object, but this obviously means that we can only serve 64,000 objects per host right now.

Parameters:
_address - the local host IP to which the served object should be bound
_name - the name under which the served object should be bound
_keyPair - the public/private key pair of the serving entity
_authorizer - used to authorize any potential users of the object
_credentials - the credentials presented by the server that clients may use to authorize the server
_livenessTimeDiff - the timeout parameter
_eventHandler - the Switchboard Event handling code

lookup

public static SbRpcStack lookup(java.net.InetSocketAddress _address,
                                java.lang.String _name,
                                java.security.KeyPair _keyPair,
                                Authorizer _authorizer,
                                Credentials _credentials,
                                SbEventHandler _eventHandler)
Allows requestor to use with default timeout


listen

public static SbServerSocket listen(java.net.InetSocketAddress _address,
                                    java.lang.String _name,
                                    java.security.KeyPair _keyPair,
                                    Authorizer _authorizer,
                                    Credentials _credentials,
                                    long _livenessTimeDiff,
                                    SbEventHandlerFactory _eventHandlerFactory)
Parameters:
_address - the local host IP to which the served object should be bound
_name - the name under which the served object should be bound
_keyPair - the public/private key pair of the serving entity
_authorizer - used to authorize any potential users of the object
_credentials - the credentials presented by the server that clients may use to authorize the server
_livenessTimeDiff - the timeout parameter
_eventHandlerFactory - a generator for the Switchboard Event handling code.

listen

public static SbServerSocket listen(java.net.InetSocketAddress _address,
                                    java.lang.String _name,
                                    java.security.KeyPair _keyPair,
                                    Authorizer _authorizer,
                                    Credentials _credentials,
                                    SbEventHandlerFactory _eventHandlerFactory)

connect

public static SbStreamsStack connect(java.net.InetSocketAddress _address,
                                     java.lang.String _name,
                                     java.security.KeyPair _keyPair,
                                     Authorizer _authorizer,
                                     Credentials _credentials,
                                     long _livenessTimeDiff,
                                     SbEventHandler _eventHandler)
This really ought not to return the stack itself. Some wrapper, maybe? PROBLEM: We're not doing anything with _name right now. This means that we're binding one object per port. There can be multiple connections per object, but this obviously means that we can only serve 64,000 objects per host right now.

Parameters:
_address - the local host IP to which the served object should be bound
_name - the name under which the served object should be bound
_keyPair - the public/private key pair of the serving entity
_authorizer - used to authorize any potential users of the object
_credentials - the credentials presented by the server that clients may use to authorize the server
_livenessTimeDiff - the timeout parameter
_eventHandler - the Switchboard Event handling code

connect

public static SbStreamsStack connect(java.net.InetSocketAddress _address,
                                     java.lang.String _name,
                                     java.security.KeyPair _keyPair,
                                     Authorizer _authorizer,
                                     Credentials _credentials,
                                     SbEventHandler _eventHandler)
Allows requestor to use with default timeout



Copyright (c) 2002-2003 New York University RLAB