Apache Geode Native C++ Reference 1.15.0
CqQuery.hpp
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#pragma once
19
20#ifndef GEODE_CQQUERY_H_
21#define GEODE_CQQUERY_H_
22
23#include <chrono>
24
25#include "CqAttributes.hpp"
27#include "CqResults.hpp"
28#include "CqState.hpp"
29#include "CqStatistics.hpp"
30#include "internal/geode_globals.hpp"
31
36namespace apache {
37namespace geode {
38namespace client {
39class Query;
40
54class APACHE_GEODE_EXPORT CqQuery {
55 public:
61 virtual const std::string& getQueryString() const = 0;
62
67 virtual std::shared_ptr<Query> getQuery() const = 0;
68
73 virtual const std::string& getName() const = 0;
74
79 virtual std::shared_ptr<CqStatistics> getStatistics() const = 0;
80
85 virtual std::shared_ptr<CqAttributes> getCqAttributes() const = 0;
86
92
112 virtual std::shared_ptr<CqResults> executeWithInitialResults(
113 std::chrono::milliseconds timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT) = 0;
114
129 virtual void execute() = 0;
130
139 virtual void stop() = 0;
140
147 virtual CqState getState() = 0;
148
156 virtual void close() = 0;
157
162 virtual bool isRunning() const = 0;
163
168 virtual bool isStopped() const = 0;
169
174 virtual bool isClosed() const = 0;
175
181 virtual bool isDurable() const = 0;
182};
183
184} // namespace client
185} // namespace geode
186} // namespace apache
187
188#endif // GEODE_CQQUERY_H_
CqState
CqState.hpp.
Definition: CqState.hpp:37
This interface is used to modify the listeners that are associated with a CQ.
Definition: CqAttributesMutator.hpp:43
A Query is obtained from a QueryService which in turn is obtained from the Cache.
Definition: CqQuery.hpp:54
virtual const std::string & getName() const =0
Get the name of the CQ.
virtual bool isClosed() const =0
This allows to check if the CQ is closed.
virtual bool isDurable() const =0
This allows to check if the CQ is durable.
virtual bool isStopped() const =0
This allows to check if the CQ is in stopped.
virtual std::shared_ptr< CqStatistics > getStatistics() const =0
Get the statistics information of this CQ.
virtual const std::string & getQueryString() const =0
Get the query string provided when a new Query was created from a QueryService.
virtual CqState getState()=0
Get the state of the CQ in CqState object form.
virtual bool isRunning() const =0
This allows to check if the CQ is in running or active.
virtual std::shared_ptr< Query > getQuery() const =0
Get the query object generated for this CQs query.
virtual void close()=0
Close the CQ and stop execution.
virtual CqAttributesMutator getCqAttributesMutator() const =0
Get the AttributesMutator of this CQ.
virtual std::shared_ptr< CqAttributes > getCqAttributes() const =0
Get the Attributes of this CQ.
virtual void execute()=0
Executes the OQL Query on the cache server and returns the results.
virtual std::shared_ptr< CqResults > executeWithInitialResults(std::chrono::milliseconds timeout=DEFAULT_QUERY_RESPONSE_TIMEOUT)=0
Start executing the CQ or if this CQ is stopped earlier, resumes execution of the CQ.
virtual void stop()=0
Stops this CqQuery without releasing resources.

Apache Geode C++ Cache API Documentation