com.twistedmatrix.spread.pb
Class Connection

java.lang.Object
  |
  +--com.twistedmatrix.spread.pb.Connection

public class Connection
extends java.lang.Object

Various methods for connecting to a remote PB servers. The connect() methods are for old-style PB servers. login() is used for new style (realm/portal/avatar) servers, available in Twisted 1.1.


Field Summary
static ByteString ROOT
           
 
Constructor Summary
Connection()
           
 
Method Summary
static ByteString challengeResponse(ByteString challenge, ByteString password)
          Make a response to a challenge.
static RemoteReference connect(StreamPair sp, ByteString username, ByteString password, ByteString service)
          Log in to a perspective whose name is the same as the username.
static RemoteReference connect(StreamPair sp, ByteString username, ByteString password, ByteString service, ByteString perspective)
          Log in to a perspective.
static RemoteReference connect(StreamPair sp, ByteString username, ByteString password, ByteString service, ByteString perspective, JellyPolicy policy)
          Log in to a perspective.
static RemoteReference connect(StreamPair sp, ByteString username, ByteString password, ByteString service, ByteString perspective, JellyPolicy policy, Referenceable client)
          Log in to a perspective.
static RemoteReference connect(StreamPair sp, ByteString username, ByteString password, ByteString service, JellyPolicy policy)
          Log in to a perspective whose name is the same as the username.
static RemoteReference getObjectAt(StreamPair sp)
          Get the remote object at the root of server.
static RemoteReference getObjectAt(StreamPair sp, JellyPolicy policy)
          Get the remote object at the root of server.
static RemoteReference login(StreamPair sp, ByteString username, ByteString password)
          Log in to a perspective (new method).
static RemoteReference login(StreamPair sp, ByteString username, ByteString password, JellyPolicy policy)
          Log in to a perspective (new method).
static RemoteReference login(StreamPair sp, ByteString username, ByteString password, JellyPolicy policy, Referenceable client)
          Log in to a perspective (new method).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROOT

public static final ByteString ROOT
Constructor Detail

Connection

public Connection()
Method Detail

getObjectAt

public static RemoteReference getObjectAt(StreamPair sp,
                                          JellyPolicy policy)
Get the remote object at the root of server.

getObjectAt

public static RemoteReference getObjectAt(StreamPair sp)
Get the remote object at the root of server.

login

public static RemoteReference login(StreamPair sp,
                                    ByteString username,
                                    ByteString password,
                                    JellyPolicy policy,
                                    Referenceable client)
                             throws RemoteError,
                                    java.io.IOException
Log in to a perspective (new method). Twisted 1.1 later has a new, cleaner, authentication model, replacing the one used by connect().
Parameters:
sp - an open connection to a remote server.
username - the name you will be identified as.
password - the password for this username.
policy - used to determine Jellying policies.
client - passed as the 'reference' parameter to perspective's attached() method

login

public static RemoteReference login(StreamPair sp,
                                    ByteString username,
                                    ByteString password,
                                    JellyPolicy policy)
                             throws RemoteError,
                                    java.io.IOException
Log in to a perspective (new method). Twisted 1.1 later has a new, cleaner, authentication model, replacing the one used by connect().
Parameters:
sp - an open connection to a remote server.
username - the name you will be identified as.
password - the password for this username.
policy - used to determine Jellying policies.

login

public static RemoteReference login(StreamPair sp,
                                    ByteString username,
                                    ByteString password)
                             throws RemoteError,
                                    java.io.IOException
Log in to a perspective (new method). Twisted 1.1 later has a new, cleaner, authentication model, replacing the one used by connect().
Parameters:
sp - an open connection to a remote server.
username - the name you will be identified as.
password - the password for this username.

connect

public static RemoteReference connect(StreamPair sp,
                                      ByteString username,
                                      ByteString password,
                                      ByteString service,
                                      ByteString perspective,
                                      JellyPolicy policy,
                                      Referenceable client)
                               throws RemoteError,
                                      java.io.IOException
Log in to a perspective.
Parameters:
sp - an open connection to a remote server.
username - the name you will be identified as to the authorizer.
password - the password for this username.
service - the service to request.
perspective - the name of the perspective to request.
policy - used to determine Jellying policies.
client - passed as the 'reference' parameter to perspective's attached() method

connect

public static RemoteReference connect(StreamPair sp,
                                      ByteString username,
                                      ByteString password,
                                      ByteString service,
                                      ByteString perspective,
                                      JellyPolicy policy)
                               throws RemoteError,
                                      java.io.IOException
Log in to a perspective.
Parameters:
sp - an open connection to a remote server.
username - the name you will be identified as to the authorizer.
password - the password for this username.
service - the service to request.
perspective - the name of the perspective to request.
policy - used to determine Jellying policies.

connect

public static RemoteReference connect(StreamPair sp,
                                      ByteString username,
                                      ByteString password,
                                      ByteString service,
                                      ByteString perspective)
                               throws RemoteError,
                                      java.io.IOException
Log in to a perspective.
Parameters:
sp - an open connection to a remote server.
username - the name you will be identified as to the authorizer.
password - the password for this username.
service - the service to request.
perspective - the name of the perspective to request.

connect

public static RemoteReference connect(StreamPair sp,
                                      ByteString username,
                                      ByteString password,
                                      ByteString service,
                                      JellyPolicy policy)
                               throws RemoteError,
                                      java.io.IOException
Log in to a perspective whose name is the same as the username.
Parameters:
sp - an open connection to a remote server.
username - the name you will be identified as to the authorizer.
password - the password for this username.
service - the service to request.

connect

public static RemoteReference connect(StreamPair sp,
                                      ByteString username,
                                      ByteString password,
                                      ByteString service)
                               throws RemoteError,
                                      java.io.IOException
Log in to a perspective whose name is the same as the username.
Parameters:
sp - an open connection to a remote server.
username - the name you will be identified as to the authorizer.
password - the password for this username.
service - the service to request.

challengeResponse

public static ByteString challengeResponse(ByteString challenge,
                                           ByteString password)
Make a response to a challenge.