public class BasicContext extends Object implements Context
Context.KeyData
Modifier and Type | Field and Description |
---|---|
protected Charset |
charset |
protected DecimalFormat |
currencyFormatter |
protected DateTimeFormat |
dateFormatter |
protected DecimalFormat |
decimalFormatter |
protected Context.KeyData |
keyData |
protected Map<com.impossibl.postgres.system.BasicContext.NotificationKey,NotificationListener> |
notificationListeners |
protected Protocol |
protocol |
protected Registry |
registry |
protected Version |
serverVersion |
protected Properties |
settings |
protected Map<String,Class<?>> |
targetTypeMap |
protected DateTimeFormat |
timeFormatter |
protected DateTimeFormat |
timestampFormatter |
protected TimeZone |
timeZone |
protected Map<String,com.impossibl.postgres.system.BasicContext.PreparedQuery> |
utilQueries |
Constructor and Description |
---|
BasicContext(SocketAddress address,
Properties settings,
Map<String,Class<?>> targetTypeMap) |
protected Registry registry
protected Charset charset
protected TimeZone timeZone
protected DateTimeFormat dateFormatter
protected DateTimeFormat timeFormatter
protected DateTimeFormat timestampFormatter
protected DecimalFormat decimalFormatter
protected DecimalFormat currencyFormatter
protected Properties settings
protected Version serverVersion
protected Context.KeyData keyData
protected Protocol protocol
protected Map<com.impossibl.postgres.system.BasicContext.NotificationKey,NotificationListener> notificationListeners
public BasicContext(SocketAddress address, Properties settings, Map<String,Class<?>> targetTypeMap) throws IOException, NoticeException
IOException
NoticeException
protected void shutdown()
public Version getServerVersion()
public void setServerVersion(Version serverVersion)
public Registry getRegistry()
getRegistry
in interface Context
public Protocol getProtocol()
getProtocol
in interface Context
public Object getSetting(String name)
getSetting
in interface Context
public <T> T getSetting(String name, Class<T> type)
getSetting
in interface Context
public <T> T getSetting(String name, T defaultValue)
getSetting
in interface Context
public boolean isSettingEnabled(String name)
isSettingEnabled
in interface Context
public Class<?> lookupInstanceType(Type type)
lookupInstanceType
in interface Context
public Charset getCharset()
getCharset
in interface Context
public TimeZone getTimeZone()
getTimeZone
in interface Context
public Context.KeyData getKeyData()
getKeyData
in interface Context
public DateTimeFormat getDateFormatter()
getDateFormatter
in interface Context
public DateTimeFormat getTimeFormatter()
getTimeFormatter
in interface Context
public DateTimeFormat getTimestampFormatter()
getTimestampFormatter
in interface Context
public DecimalFormat getDecimalFormatter()
getDecimalFormatter
in interface Context
public DecimalFormat getCurrencyFormatter()
getCurrencyFormatter
in interface Context
protected void init() throws IOException, NoticeException
IOException
NoticeException
public void refreshType(int typeId)
refreshType
in interface Context
public void refreshRelationType(int relationId)
refreshRelationType
in interface Context
public boolean isUtilQueryPrepared(String name)
public com.impossibl.postgres.system.BasicContext.PreparedQuery prepareUtilQuery(String name, String sql, String... parameterTypeNames) throws IOException
IOException
public com.impossibl.postgres.system.BasicContext.PreparedQuery prepareUtilQuery(String name, String sql, List<Type> parameterTypes) throws IOException
IOException
public <T> List<T> queryResults(String queryTxt, Class<T> rowType, Object... params) throws IOException, NoticeException
IOException
NoticeException
public List<DataRow> queryResults(String queryTxt) throws IOException, NoticeException
IOException
NoticeException
public void query(String queryTxt) throws IOException, NoticeException
IOException
NoticeException
public String queryFirstResultString(String queryTxt) throws IOException, NoticeException
IOException
NoticeException
public QueryCommand.ResultBatch queryBatch(String queryTxt, Object... params) throws IOException, NoticeException
IOException
NoticeException
public void setKeyData(int processId, int secretKey)
public void addNotificationListener(String name, String channelNameFilter, NotificationListener listener)
public void removeNotificationListener(NotificationListener listener)
public void removeNotificationListener(String listenerName)
public void reportNotification(int processId, String channelName, String payload)
reportNotification
in interface Context
Copyright © 2013–2017 impossibl.com. All rights reserved.