org.netbeans.lib.cvsclient.connection
Interface Connection

All Known Implementing Classes:
AbstractConnection, ExtConnection, LocalConnection, PServerConnection

public interface Connection

Provides a method for accessing a connection, in order to be able to communicate using the CVS Protocol. Instances of this interface are used by the Client class to communicate with the server without being too concerned with how the communication is taking place or how it was set up.

See Also:
Client

Method Summary
 void close()
          Close the connection with the server
 LoggedDataInputStream getInputStream()
          Get a data inputstream for reading data
 LoggedDataOutputStream getOutputStream()
          Get an output stream for sending data to the server
 int getPort()
          Get the port number, which this connection is actually using.
 java.lang.String getRepository()
          Get the repository
 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()
          Open a connection with the server.
 void verify()
          Verify a cnnection with the server.
 

Method Detail

getInputStream

LoggedDataInputStream getInputStream()
Get a data inputstream for reading data

Returns:
an input stream

getOutputStream

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

Returns:
an output stream

open

void open()
          throws AuthenticationException,
                 CommandAbortedException
Open a connection with the server. Until this method is called, no communication with the server can take place. 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:
AutenticationException - if the connection with the server cannot be established
AuthenticationException
CommandAbortedException

verify

void verify()
            throws AuthenticationException
Verify a cnnection with the server. Simply verifies that a connection could be made, for example that the user name and password are both acceptable. Does not create input and output stream. For that, use the open() method.

Throws:
AuthenticationException

close

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

Throws:
java.io.IOException

isOpen

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


getRepository

java.lang.String getRepository()
Get the repository


getPort

int getPort()
Get the port number, which this connection is actually using.

Returns:
The port number or zero, when the port number does not have sense.

modifyInputStream

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

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 October 26 2010.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.