org.netbeans.lib.cvsclient.connection
Class AbstractConnection

java.lang.Object
  extended by org.netbeans.lib.cvsclient.connection.AbstractConnection
All Implemented Interfaces:
Connection
Direct Known Subclasses:
ExtConnection, LocalConnection, PServerConnection

public abstract class AbstractConnection
extends java.lang.Object
implements Connection

This class abstracts the common features and functionality that all connection protocols to CVS share


Constructor Summary
AbstractConnection()
          Creates a new instance of AbstractConnection
 
Method Summary
 LoggedDataInputStream getInputStream()
          Get an input stream for receiving data from the server.
 LoggedDataOutputStream getOutputStream()
          Get an output stream for sending data to the server.
 java.lang.String getRepository()
          Get the repository path.
protected  void setInputStream(LoggedDataInputStream inputStream)
          Set an input stream for receiving data from the server.
protected  void setOutputStream(LoggedDataOutputStream outputStream)
          Set an output stream for sending data to the server.
 void setRepository(java.lang.String repository)
          Set the repository path.
protected  void verifyProtocol()
          Verifies that this open connection is a connetion to a working CVS server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.netbeans.lib.cvsclient.connection.Connection
close, getPort, isOpen, modifyInputStream, modifyOutputStream, open, verify
 

Constructor Detail

AbstractConnection

public AbstractConnection()
Creates a new instance of AbstractConnection

Method Detail

getInputStream

public LoggedDataInputStream getInputStream()
Get an input stream for receiving data from the server.

Specified by:
getInputStream in interface Connection
Returns:
a data input stream

setInputStream

protected final void setInputStream(LoggedDataInputStream inputStream)
Set an input stream for receiving data from the server. The old stream (if any) is closed.

Parameters:
inputStream - The data input stream

getOutputStream

public LoggedDataOutputStream getOutputStream()
Get an output stream for sending data to the server.

Specified by:
getOutputStream in interface Connection
Returns:
an output stream

setOutputStream

protected final void setOutputStream(LoggedDataOutputStream outputStream)
Set an output stream for sending data to the server. The old stream (if any) is closed.

Parameters:
outputStream - The data output stream

getRepository

public java.lang.String getRepository()
Get the repository path.

Specified by:
getRepository in interface Connection
Returns:
the repository path, e.g. /home/banana/foo/cvs

setRepository

public void setRepository(java.lang.String repository)
Set the repository path.

Parameters:
repository - the repository

verifyProtocol

protected void verifyProtocol()
                       throws java.io.IOException
Verifies that this open connection is a connetion to a working CVS server. Clients should close this connection after verifying.

Throws:
java.io.IOException

 

Built on October 26 2010.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.