本文整理了Java中datawave.webservice.query.Query.getQueryAuthorizations
方法的一些代码示例,展示了Query.getQueryAuthorizations
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getQueryAuthorizations
方法的具体详情如下:
包路径:datawave.webservice.query.Query
类名称:Query
方法名:getQueryAuthorizations
暂无
代码示例来源:origin: NationalSecurityAgency/datawave
public EventQueryTransformerSupport(String tableName, Query settings, MarkingFunctions markingFunctions, ResponseObjectFactory responseObjectFactory) {
super(markingFunctions);
this.settings = settings;
this.auths = new Authorizations(settings.getQueryAuthorizations().split(","));
this.tableName = tableName;
this.responseObjectFactory = responseObjectFactory;
}
代码示例来源:origin: NationalSecurityAgency/datawave
public ShardQueryCountTableTransformer(Query settings, MarkingFunctions markingFunctions, ResponseObjectFactory responseObjectFactory) {
super(markingFunctions);
this.responseObjectFactory = responseObjectFactory;
this.auths = new Authorizations(settings.getQueryAuthorizations().split(","));
}
代码示例来源:origin: NationalSecurityAgency/datawave
public FieldIndexCountQueryTransformer(BaseQueryLogic<Entry<Key,Value>> logic, Query settings, MarkingFunctions markingFunctions,
ResponseObjectFactory responseObjectFactory) {
super(markingFunctions);
this.auths = new Authorizations(settings.getQueryAuthorizations().split(","));
this.logic = logic;
this.responseObjectFactory = responseObjectFactory;
}
代码示例来源:origin: NationalSecurityAgency/datawave
public ContentQueryTransformer(Query query, MarkingFunctions markingFunctions) {
super(markingFunctions);
this.auths = new Authorizations(query.getQueryAuthorizations().split(","));
}
代码示例来源:origin: NationalSecurityAgency/datawave
public ShardIndexQueryTransformer(BaseQueryLogic<Entry<Key,Value>> logic, Query settings, MarkingFunctions markingFunctions,
ResponseObjectFactory responseObjectFactory, QueryModel qm) {
super(markingFunctions);
this.responseObjectFactory = responseObjectFactory;
this.auths = new Authorizations(settings.getQueryAuthorizations().split(","));
this.logic = logic;
this.myQueryModel = qm;
}
代码示例来源:origin: NationalSecurityAgency/datawave
public EdgeQueryTransformerSupport(Query settings, MarkingFunctions markingFunctions, ResponseObjectFactory responseObjectFactory) {
super(markingFunctions);
this.responseObjectFactory = responseObjectFactory;
auths = new Authorizations(settings.getQueryAuthorizations().split(","));
}
代码示例来源:origin: NationalSecurityAgency/datawave
@Override
public String toString() {
String host = System.getProperty("jboss.host.name");
return new StringBuilder().append("host:").append(host).append(", id:").append(this.getSettings().getId()).append(", query:")
.append(StringEscapeUtils.escapeHtml(this.getSettings().getQuery())).append(", auths:")
.append(this.getSettings().getQueryAuthorizations()).append(", user:").append(this.getSettings().getOwner()).append(", queryLogic:")
.append(this.getSettings().getQueryLogicName()).append(", name:").append(this.getSettings().getQueryName()).append(", pagesize:")
.append(this.getSettings().getPagesize()).append(", begin:").append(this.getSettings().getBeginDate()).append(", end:")
.append(this.getSettings().getEndDate()).append(", expiration:").append(this.getSettings().getExpirationDate()).append(", params: ")
.append(this.getSettings().getParameters()).append(", callTime: ")
.append((this.getTimeOfCurrentCall() == 0) ? 0 : System.currentTimeMillis() - this.getTimeOfCurrentCall()).toString();
}
代码示例来源:origin: NationalSecurityAgency/datawave
x++;
ps.setString(x++, query.getQueryAuthorizations());
ps.setString(x++, query.getQueryLogicName());
ps.setString(x++, query.getQueryName());
代码示例来源:origin: NationalSecurityAgency/datawave
private RunningQuery adminGetQueryById(String id) throws Exception {
RunningQuery query = queryCache.get(id);
if (query == null) {
log.info("Query not found in cache, retrieving from accumulo");
List<Query> queries = persister.adminFindById(id);
if (queries == null || queries.isEmpty())
throw new NotFoundQueryException(DatawaveErrorCode.NO_QUERY_OBJECT_MATCH);
if (queries.size() > 1)
throw new NotFoundQueryException(DatawaveErrorCode.TOO_MANY_QUERY_OBJECT_MATCHES);
Query q = queries.get(0);
final String auths = q.getQueryAuthorizations();
// will throw IllegalArgumentException if not defined
final QueryLogic<?> logic = queryLogicFactory.getQueryLogic(q.getQueryLogicName(), ctx.getCallerPrincipal());
final AccumuloConnectionFactory.Priority priority = logic.getConnectionPriority();
query = RunningQuery.createQueryWithAuthorizations(metrics, null, priority, logic, q, auths,
new RunningQueryTimingImpl(queryExpirationConf, qp.getPageTimeout()), this.executor, this.predictor, this.metricFactory);
// Put in the cache by id and name, we will have two copies that reference the same object
queryCache.put(q.getId().toString(), query);
}
return query;
}
代码示例来源:origin: NationalSecurityAgency/datawave
Set<Authorizations> runtimeQueryAuthorizations = AuthorizationsUtil.getDowngradedAuthorizations(q.getQueryAuthorizations(), principal);
代码示例来源:origin: NationalSecurityAgency/datawave
query = new RunningQuery(metrics, null, priority, logic, q, q.getQueryAuthorizations(), principal, new RunningQueryTimingImpl(
queryExpirationConf, qp.getPageTimeout()), this.executor, this.predictor, this.metricFactory);
代码示例来源:origin: NationalSecurityAgency/datawave
RunningQuery query = new RunningQuery(metrics, null, priority, logic, q, q.getQueryAuthorizations(), p, new RunningQueryTimingImpl(
queryExpirationConf, qp.getPageTimeout()), this.executor, this.predictor, this.metricFactory);
results.add(query);
代码示例来源:origin: NationalSecurityAgency/datawave
public HudQuerySummary build(Query query) {
HudQuerySummary summary = new HudQuerySummary();
summary.setQueryLogicName(query.getQueryLogicName());
summary.setId(query.getId().toString());
summary.setQueryName(query.getQueryName());
summary.setUserDN(query.getUserDN());
summary.setQuery(query.getQuery());
summary.setQueryAuthorizations(query.getQueryAuthorizations());
summary.setExpirationDate(query.getExpirationDate().getTime());
return summary;
}
代码示例来源:origin: NationalSecurityAgency/datawave
private void basicExpects(Document d, Key key, Map.Entry<Key,Value> entry) throws MarkingFunctions.Exception {
// AbstractMap.SimpleEntry<Key, Document> documentEntry = new AbstractMap.SimpleEntry<>(key, mockDocument);
d.put("field1", new Numeric("5", key, true));
AbstractMap.SimpleEntry<Key,Document> documentEntry = new AbstractMap.SimpleEntry<>(key, d);
// Map<String,Attribute<?extends Comparable<?>>> dictionary = new HashMap<>();
// dictionary.put("field1", mockNumeric);
SimpleField simpleField = new SimpleField();
SimpleEvent simpleEvent = new SimpleEvent();
PowerMock.mockStatic(DocumentSerialization.class);
EasyMock.expect(DocumentSerialization.getDocumentDeserializer(mockQuery)).andReturn(mockDeserializer);
EasyMock.expect(mockLogic.getTableName()).andReturn("table1");
EasyMock.expect(mockQuery.getQueryAuthorizations()).andReturn("A,B,C");
EasyMock.expect(mockQuery.findParameter("log.timing.details")).andReturn(new QueryImpl.Parameter("", ""));
EasyMock.expect(mockDeserializer.apply(entry)).andReturn(documentEntry);
// EasyMock.expect(mockDocument.getDictionary()).andReturn(Collections.EMPTY_MAP);
// mockDocument.debugDocumentSize(key);
EasyMock.expect(mockMarkingFunctions.translateFromColumnVisibility(key.getColumnVisibilityParsed())).andReturn(Collections.EMPTY_MAP);
// EasyMock.expect(mockDocument.getDictionary()).andReturn(dictionary);
// EasyMock.expect(mockNumeric.getData()).andReturn("5");
EasyMock.expect(mockResponseFactory.getField()).andReturn(simpleField);
EasyMock.expect(mockResponseFactory.getEvent()).andReturn(simpleEvent);
// EasyMock.expect(mockDocument.sizeInBytes()).andReturn(1l);
}
代码示例来源:origin: NationalSecurityAgency/datawave
query = new RunningQuery(metrics, null, priority, logic, q, q.getQueryAuthorizations(), p, new RunningQueryTimingImpl(queryExpirationConf,
q.getPageTimeout()), executor, predictor, metricFactory);
query.setActiveCall(true);
代码示例来源:origin: NationalSecurityAgency/datawave
((QueryMetricQueryLogic) queryLogic).setRolesSets(datawavePrincipal.getPrimaryUser().getRoles());
runningQuery = new RunningQuery(null, connector, Priority.ADMIN, queryLogic, query, query.getQueryAuthorizations(), datawavePrincipal,
metricFactory);
代码示例来源:origin: NationalSecurityAgency/datawave
Set<String> methodAuths = new HashSet<>(Arrays.asList(q.getQueryAuthorizations().split("\\s*,\\s*")));
cbAuths.retainAll(methodAuths);
AuditType auditType = runningQuery.getLogic().getAuditType(runningQuery.getSettings());
代码示例来源:origin: NationalSecurityAgency/datawave
private void setMetricsInfo() {
BaseQueryMetric m = this.getMetric();
// set the metric information
m.setQueryType(this.getClass());
m.setQueryId(this.queryId);
m.setUser(this.user);
m.setUserDN(this.query.getUserDN());
if (this.query != null) {
m.setColumnVisibility(this.query.getColumnVisibility());
m.setQueryAuthorizations(this.query.getQueryAuthorizations());
m.setQueryLogic(this.query.getQueryLogicName());
m.setBeginDate(this.query.getBeginDate());
m.setEndDate(this.query.getEndDate());
}
}
代码示例来源:origin: NationalSecurityAgency/datawave
query = new RunningQuery(null, null, logic.getConnectionPriority(), logic, q, q.getQueryAuthorizations(), p, new RunningQueryTimingImpl(
queryExpirationConf, q.getPageTimeout()), executor, predictor, metricFactory);
query.setActiveCall(true);
内容来源于网络,如有侵权,请联系作者删除!