Search in sources :

Example 1 with SqlSecurityContext

use of com.hazelcast.sql.impl.security.SqlSecurityContext in project hazelcast by hazelcast.

the class SqlExecuteMessageTask method call.

@Override
protected Object call() {
    SqlSecurityContext sqlSecurityContext = prepareSecurityContext();
    SqlStatement query = new SqlStatement(parameters.sql);
    for (Data param : parameters.parameters) {
        query.addParameter(serializationService.toObject(param));
    }
    query.setSchema(parameters.schema);
    query.setTimeoutMillis(parameters.timeoutMillis);
    query.setCursorBufferSize(parameters.cursorBufferSize);
    query.setExpectedResultType(SqlExpectedResultType.fromId(parameters.expectedResultType));
    SqlServiceImpl sqlService = nodeEngine.getSqlService();
    boolean skipUpdateStatistics = parameters.isSkipUpdateStatisticsExists && parameters.skipUpdateStatistics;
    return sqlService.execute(query, sqlSecurityContext, parameters.queryId, skipUpdateStatistics);
}
Also used : SqlStatement(com.hazelcast.sql.SqlStatement) SqlServiceImpl(com.hazelcast.sql.impl.SqlServiceImpl) NoOpSqlSecurityContext(com.hazelcast.sql.impl.security.NoOpSqlSecurityContext) SqlSecurityContext(com.hazelcast.sql.impl.security.SqlSecurityContext) Data(com.hazelcast.internal.serialization.Data)

Aggregations

Data (com.hazelcast.internal.serialization.Data)1 SqlStatement (com.hazelcast.sql.SqlStatement)1 SqlServiceImpl (com.hazelcast.sql.impl.SqlServiceImpl)1 NoOpSqlSecurityContext (com.hazelcast.sql.impl.security.NoOpSqlSecurityContext)1 SqlSecurityContext (com.hazelcast.sql.impl.security.SqlSecurityContext)1