|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.lib.cvsclient.connection.AbstractConnection
org.netbeans.lib.cvsclient.connection.PServerConnection
public class PServerConnection
Implements a connection to a pserver. See the cvs documents for more information about different connection methods. PServer is popular where security is not an issue. For secure connections, consider using a kserver (Kerberos) or the GSSAPI.
Field Summary | |
---|---|
protected static String |
AUTHENTICATION_FAILED_RESPONSE
A response indicating that the authorisation has failed. |
protected static String |
AUTHENTICATION_SUCCEEDED_RESPONSE
A response indicating that authorisation has succeeded. |
static int |
DEFAULT_PORT
The default port number to use. |
protected String |
encodedPassword
The password, encoded appropriately. |
protected String |
hostName
The host to use. |
protected static String |
OPEN_POSTAMBLE
The string that is sent at the end of the request to open a connection. |
protected static String |
OPEN_PREAMBLE
The string that is sent at the beginning of the request to open a connection. |
protected int |
port
The port number to use. |
protected Socket |
socket
The socket used for the connection. |
protected SocketFactory |
socketFactory
The socket factory that will be used to create sockets. |
protected String |
userName
The user name to use. |
protected static String |
VERIFY_POSTAMBLE
The string that is sent at the end of a verify request. |
protected static String |
VERIFY_PREAMBLE
The string that is sent at the beginning of the request to verify a connection. |
Constructor Summary | |
---|---|
PServerConnection()
Create an uninitialized PServerConnection. |
|
PServerConnection(CVSRoot cvsRoot)
Create PServerConnection and setup it's properties from the supplied CVSRoot object. |
|
PServerConnection(CVSRoot cvsRoot,
SocketFactory factory)
Create PServerConnection and setup it's properties from the supplied CVSRoot object. |
Method Summary | |
---|---|
void |
close()
Close the connection with the server. |
String |
getEncodedPassword()
Get the encoded password. |
String |
getHostName()
Get the host name to use. |
int |
getPort()
Get the port number to use. |
String |
getUserName()
Get the username. |
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 |
setEncodedPassword(String encodedPassword)
Set the encoded password. |
void |
setHostName(String hostName)
Get the host name to use. |
void |
setPort(int port)
Set the port number to use. |
void |
setUserName(String userName)
Set the userName. |
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 |
---|
protected static final String OPEN_PREAMBLE
protected static final String OPEN_POSTAMBLE
protected static final String VERIFY_PREAMBLE
protected static final String VERIFY_POSTAMBLE
protected static final String AUTHENTICATION_SUCCEEDED_RESPONSE
protected static final String AUTHENTICATION_FAILED_RESPONSE
protected String userName
protected String encodedPassword
public static final int DEFAULT_PORT
protected int port
protected String hostName
protected Socket socket
protected SocketFactory socketFactory
Constructor Detail |
---|
public PServerConnection()
public PServerConnection(CVSRoot cvsRoot)
IllegalArgumentException
- if the cvsRoot does not represent pserver
connection type.public PServerConnection(CVSRoot cvsRoot, SocketFactory factory)
IllegalArgumentException
- if the cvsRoot does not represent pserver
connection type.Method Detail |
---|
public void verify() throws AuthenticationException
AuthenticationException
- if the connection with the server
cannot be establishedpublic void open() throws AuthenticationException, CommandAbortedException
AutenticationException
- if the connection with the server
cannot be established
AuthenticationException
CommandAbortedException
public String getUserName()
public void setUserName(String userName)
name
- the userNamepublic String getEncodedPassword()
public void setEncodedPassword(String encodedPassword)
password
- the encoded password to use for authenticationpublic int getPort()
public void setPort(int port)
thePort
- the port number to use. If you do not set this, 2401
is used by default for pserver.public String getHostName()
public void setHostName(String hostName)
theHostName
- the host name of the server to connect to. If you
do not set this, localhost is used by default for pserver.public void close() throws IOException
IOException
public void modifyInputStream(ConnectionModifier modifier) throws IOException
modifier
- the connection modifier that performs the modifications
IOException
- if an error occurs modifying the streamspublic void modifyOutputStream(ConnectionModifier modifier) throws IOException
modifier
- the connection modifier that performs the modifications
IOException
- if an error occurs modifying the streamspublic boolean isOpen()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |