org.netbeans.lib.cvsclient.connection
Class LocalConnection

java.lang.Object
  extended by org.netbeans.lib.cvsclient.connection.AbstractConnection
      extended by org.netbeans.lib.cvsclient.connection.LocalConnection
All Implemented Interfaces:
Connection

public class LocalConnection
extends AbstractConnection

Implements a connection to a local server. See the cvs documents for more information about different connection methods. Local is popular where the CVS repository exists on the machine where the client library is running.

Because this library implements just the client part, it can not operate directly on the repository. It needs a server to talk to. Therefore it needs to execute the server process on the local machine.


Field Summary
protected  java.lang.Process process
          The CVS process that is being run.
 
Constructor Summary
LocalConnection()
          Creates a instance of ServerConnection.
 
Method Summary
 void close()
          Close the connection with the server.
 int getPort()
          Get the port number, which this connection is actually using.
 boolean isOpen()
          Returns true to indicate that the connection was successfully established.
 void modifyInputStream(ConnectionModifier modifier)
          Modify the underlying inputstream.
 void modifyOutputStream(ConnectionModifier modifier)
          Modify the underlying outputstream.
 void open()
          Authenticate with the server and open a channel of communication with the server.
 void verify()
          Authenticate with the server.
 
Methods inherited from class org.netbeans.lib.cvsclient.connection.AbstractConnection
getInputStream, getOutputStream, getRepository, setInputStream, setOutputStream, setRepository, verifyProtocol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

process

protected java.lang.Process process
The CVS process that is being run.

Constructor Detail

LocalConnection

public LocalConnection()
Creates a instance of ServerConnection.

Method Detail

verify

public void verify()
            throws AuthenticationException
Authenticate with the server. Closes the connection immediately. Clients can use this method to ensure that they are capable of authenticating with the server. If no exception is thrown, you can assume that authentication was successful

Throws:
AuthenticationException - if the connection with the server cannot be established

open

public void open()
          throws AuthenticationException
Authenticate with the server and open a channel of communication with the server. This Client will call this method before interacting with the server. It is up to implementing classes to ensure that they are configured to talk to the server (e.g. port number etc.)

Throws:
AuthenticationException - if the connection with the server cannot be established

isOpen

public boolean isOpen()
Returns true to indicate that the connection was successfully established.


close

public void close()
           throws java.io.IOException
Close the connection with the server.

Throws:
java.io.IOException

getPort

public int getPort()
Description copied from interface: Connection
Get the port number, which this connection is actually using.

Returns:
0, no port is used by the local connection.

modifyInputStream

public void modifyInputStream(ConnectionModifier modifier)
                       throws java.io.IOException
Modify the underlying inputstream.

Parameters:
modifier - the connection modifier that performs the modifications
Throws:
java.io.IOException - if an error occurs modifying the streams

modifyOutputStream

public void modifyOutputStream(ConnectionModifier modifier)
                        throws java.io.IOException
Modify the underlying outputstream.

Parameters:
modifier - the connection modifier that performs the modifications
Throws:
java.io.IOException - if an error occurs modifying the streams

 

Built on August 7 2008.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.