Package com.impossibl.postgres.system
Class BasicContext
- java.lang.Object
-
- com.impossibl.postgres.system.AbstractContext
-
- com.impossibl.postgres.system.BasicContext
-
- All Implemented Interfaces:
Configuration
,Context
- Direct Known Subclasses:
PGDirectConnection
public class BasicContext extends AbstractContext
-
-
Constructor Summary
Constructors Constructor Description BasicContext(SocketAddress address, Settings settings)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.impossibl.postgres.system.Configuration
getSetting
-
-
-
-
Constructor Detail
-
BasicContext
public BasicContext(SocketAddress address, Settings settings) throws IOException
- Throws:
IOException
-
-
Method Detail
-
shutdown
protected io.netty.channel.ChannelFuture shutdown()
-
connectionClosed
protected void connectionClosed()
Called whenserverConnection
was closed externally (i.e. without callingshutdown()
-
connectionNotificationReceived
protected void connectionNotificationReceived(int processId, String channelName, String payload)
Called whenserverConnection
received an asynchronous notification
-
getAllocator
public io.netty.buffer.ByteBufAllocator getAllocator()
-
getServerConnection
protected ServerConnection getServerConnection()
-
getRegistry
public Registry getRegistry()
-
getRequestExecutor
public RequestExecutor getRequestExecutor()
-
getSetting
public <T> T getSetting(Setting<T> setting)
- Specified by:
getSetting
in interfaceConfiguration
- Overrides:
getSetting
in classAbstractContext
-
getCharset
public Charset getCharset()
-
getTimeZone
public TimeZone getTimeZone()
-
getTimeZoneId
public ZoneId getTimeZoneId()
-
getServerInfo
public ServerInfo getServerInfo()
-
getKeyData
public ServerConnection.KeyData getKeyData()
-
getServerDateFormat
public DateTimeFormat getServerDateFormat()
-
getClientDateFormat
public DateTimeFormat getClientDateFormat()
-
getServerTimeFormat
public DateTimeFormat getServerTimeFormat()
-
getClientTimeFormat
public DateTimeFormat getClientTimeFormat()
-
getServerIntervalFormat
public IntervalFormat getServerIntervalFormat()
-
getClientIntervalFormat
public IntervalFormat getClientIntervalFormat()
-
getServerTimestampFormat
public DateTimeFormat getServerTimestampFormat()
-
getClientTimestampFormat
public DateTimeFormat getClientTimestampFormat()
-
getClientIntegerFormatter
public NumberFormat getClientIntegerFormatter()
-
getClientDecimalFormatter
public NumberFormat getClientDecimalFormatter()
-
getServerCurrencyFormatter
public NumberFormat getServerCurrencyFormatter()
-
getClientCurrencyFormatter
public NumberFormat getClientCurrencyFormatter()
-
init
protected void init(SharedRegistry.Factory sharedRegistryFactory) throws IOException
- Throws:
IOException
-
isUtilQueryPrepared
public boolean isUtilQueryPrepared(String name)
-
prepareUtilQuery
public void prepareUtilQuery(String name, String sql, String... parameterTypeNames) throws IOException
- Throws:
IOException
-
query
public void query(String queryTxt, long timeout) throws IOException
- Throws:
IOException
-
queryString
protected String queryString(String queryTxt, long timeout) throws IOException
- Throws:
IOException
-
queryBatch
protected ResultBatch queryBatch(String queryTxt, long timeout) throws IOException
Queries for a single (the first) result batch. The batch must be released.- Throws:
IOException
-
queryBatchPrepared
public ResultBatch queryBatchPrepared(String queryTxt, Object[] paramValues, long timeout) throws IOException
Queries a single result batch (the first) via a parameterized query. The batch must be released.- Throws:
IOException
-
queryBatchPrepared
protected ResultBatch queryBatchPrepared(String queryTxt, FieldFormatRef[] paramFormats, io.netty.buffer.ByteBuf[] paramBuffers, long timeout) throws IOException
Queries a single result batch (the first) via a parameterized query. The batch must be released.- Throws:
IOException
-
unwrap
public Context unwrap()
-
-