public interface P4Connection
extends java.io.Closeable
Modifier and Type | Method and Description |
---|---|
default void |
close() |
default void |
connectAs(java.lang.String user)
Sets the user name of the underlying connection and ensures we're connected.
|
static P4Connection |
create(com.perforce.p4java.server.IOptionsServer optionsServer)
Wraps an existing IOptionsServer instance.
|
static P4Connection |
create(java.lang.String hostname,
int port,
boolean isSsl,
java.lang.String progName,
java.lang.String progVersion)
Generates a new IOptionsServer instance based on some common defaults.
|
default void |
disconnect() |
java.lang.String |
getLogin()
Each connection must have a logged in user ID.
|
com.perforce.p4java.server.IOptionsServer |
getOptionsServer()
The underlying P4Java interface used by our wrapping objects.
|
static java.lang.String |
getServerLocation(java.lang.String hostname,
int port,
boolean isSsl) |
static java.util.Properties |
getServerProperties(java.lang.String progName,
java.lang.String progVersion) |
void |
setLogin(java.lang.String login) |
static P4Connection create(java.lang.String hostname, int port, boolean isSsl, java.lang.String progName, java.lang.String progVersion)
hostname
- Perforce hostnameport
- Perforce server portisSsl
- If the Perforce server requires SSLprogName
- A short ID of your applicationprogVersion
- A short version string of your applicationstatic P4Connection create(com.perforce.p4java.server.IOptionsServer optionsServer)
optionsServer
- The optionsServer that should basically have been
created by the ServerFactorystatic java.lang.String getServerLocation(java.lang.String hostname, int port, boolean isSsl)
static java.util.Properties getServerProperties(java.lang.String progName, java.lang.String progVersion)
com.perforce.p4java.server.IOptionsServer getOptionsServer()
java.lang.String getLogin()
void setLogin(java.lang.String login)
default void connectAs(java.lang.String user)
user
- The perforce logindefault void disconnect()
default void close()
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable