public class PgServer extends java.lang.Object implements Service
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PORT
The default port to use for the PG server.
|
static int |
PG_TYPE_BOOL |
static int |
PG_TYPE_BPCHAR |
static int |
PG_TYPE_BYTEA |
static int |
PG_TYPE_DATE |
static int |
PG_TYPE_FLOAT4 |
static int |
PG_TYPE_FLOAT8 |
static int |
PG_TYPE_INT2 |
static int |
PG_TYPE_INT2_ARRAY |
static int |
PG_TYPE_INT4 |
static int |
PG_TYPE_INT4_ARRAY |
static int |
PG_TYPE_INT8 |
static int |
PG_TYPE_NUMERIC |
static int |
PG_TYPE_TEXT |
static int |
PG_TYPE_TIME |
static int |
PG_TYPE_TIMESTAMP |
static int |
PG_TYPE_TIMESTAMPTZ |
static int |
PG_TYPE_TIMETZ |
static int |
PG_TYPE_UNKNOWN |
static int |
PG_TYPE_VARCHAR
The VARCHAR type.
|
static int |
PG_TYPE_VARCHAR_ARRAY |
Constructor and Description |
---|
PgServer() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
checkKeyAndGetDatabaseName(java.lang.String db)
If no key is set, return the original database name.
|
static int |
convertType(TypeInfo type)
Convert the SQL type to a PostgreSQL type
|
static java.lang.String |
formatType(int pgType)
Returns the name of the given type.
|
boolean |
getAllowOthers()
Check if remote connections are allowed.
|
java.lang.String |
getName()
Get the human readable name of the service.
|
int |
getPort()
Gets the port this service is listening on.
|
java.lang.String |
getType()
Get the human readable short name of the service.
|
java.lang.String |
getURL()
Get the URL of this service in a human readable form
|
void |
init(java.lang.String... args)
Initialize the service from command line options.
|
boolean |
isDaemon()
Check if a daemon thread should be used.
|
boolean |
isRunning(boolean traceError)
Check if the service is running.
|
void |
listen()
Listen for incoming connections.
|
void |
start()
Start the service.
|
void |
stop()
Stop the service.
|
public static final int DEFAULT_PORT
public static final int PG_TYPE_VARCHAR
public static final int PG_TYPE_BOOL
public static final int PG_TYPE_BYTEA
public static final int PG_TYPE_BPCHAR
public static final int PG_TYPE_INT8
public static final int PG_TYPE_INT2
public static final int PG_TYPE_INT4
public static final int PG_TYPE_TEXT
public static final int PG_TYPE_FLOAT4
public static final int PG_TYPE_FLOAT8
public static final int PG_TYPE_UNKNOWN
public static final int PG_TYPE_INT2_ARRAY
public static final int PG_TYPE_INT4_ARRAY
public static final int PG_TYPE_VARCHAR_ARRAY
public static final int PG_TYPE_DATE
public static final int PG_TYPE_TIME
public static final int PG_TYPE_TIMETZ
public static final int PG_TYPE_TIMESTAMP
public static final int PG_TYPE_TIMESTAMPTZ
public static final int PG_TYPE_NUMERIC
public void init(java.lang.String... args)
Service
public java.lang.String getURL()
Service
public int getPort()
Service
public void start()
Service
public void listen()
Service
public void stop()
Service
public boolean isRunning(boolean traceError)
Service
public boolean getAllowOthers()
Service
getAllowOthers
in interface Service
public java.lang.String getType()
Service
public java.lang.String getName()
Service
public static java.lang.String formatType(int pgType)
pgType
- the PostgreSQL type oidpublic static int convertType(TypeInfo type)
type
- the SQL typepublic java.lang.String checkKeyAndGetDatabaseName(java.lang.String db)
db
- the key to test (or database name if no key is used)DbException
- if a key is set but doesn't match