DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
SecuritySubject can be used to provide fine-grained access control to cache data. For example, CacheInterceptor saves the subject id it along with data and it can be used for filtering....
Application context mechanism exists in Oracle [1] and it's widely used [6]. Support similar mechanisms (custom session variables) exist in multiple DBMS (e.g. SQLServer [8], Snowflake [7], MySQL [9]).
ApplicationContext is an entrypoint for accessing all non-tabular data.QuerySqlFunction are static, CacheInterceptor is a cache singleton).QuerySqlFunction to get access to the attribute from attributes in SQL queries if needed (see example below).| Code Block | ||
|---|---|---|
| ||
/** ApplicationContext interface. It's an entrypoint for all non-tabular data. */
public class ApplicationContext {
/** @return Application attributes set for current thread. */
public static @Nullable Map<String, String> getAttributes();
/** @return Current SecuritySubject. */
public static @Nullable SecuritySubject getSecuritySubject();
}
/** Example, use it in QuerySqlFunction. */
public static class UserDefinedFunctions {
/** @return Session ID set with application attributes. */
@QuerySqlFunction
public static @Nullable String sessionId() {
Map<String, String> appAttrs = ApplicationContext.getAttributes();
return appAttrs == null ? null : appAttr.get("SESSION_ID");
}
}
|
...
ClientCache#withApplicationAttributes and must clean it by selfClient should mirror the logic of Ignite node.ClientBitmaskFeature protocol....
| Code Block | ||
|---|---|---|
| ||
// Example of usage.
try (IgniteClient cln = Ignition.startClient(clnCfg)) {
Map<String, String> appAttrs = F.asMap("SESSION_ID", "1234");
ClientCache<?, try (ClientTransaction tx?> cache = cln.transactionscache("CACHE").withApplicationAttributes(appAttrs).txStart(;
...
}
|
ClientCache#withApplicationAttributes and must clean it by self.ClientBitmaskFeature protocol.| Code Block | ||
|---|---|---|
| ||
// Example of usage. try (IgniteClient cln = Ignition.startClient(clnCfg)) { Map<String, String> appAttrs = ... }F.asMap("SESSION_ID", "1234"); ClientCache<?, ?> cache = cln.cache("CACHE").withApplicationAttributes(appAttrs); ... } |
The standard jdbc protocol describes the methods Connection#setClientInfo, which allow changing the values of client attributes during the life of the connection [3]. Implementation features:
...