ImagingTools Core SDK
CGqlContextCreatorComp.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// ACF includes
6#include <ilog/TLoggerCompWrap.h>
7
8// ImtCore includes
9#include <imtbase/IObjectCollection.h>
10#include <imtgql/IGqlContextCreator.h>
11
12
13namespace imtservergql
14{
15
16
17class CGqlContextCreatorComp:
18 public ilog::CLoggerComponentBase,
19 virtual public imtgql::IGqlContextCreator
20{
21public:
22 typedef ilog::CLoggerComponentBase BaseClass;
23
24 I_BEGIN_COMPONENT(CGqlContextCreatorComp);
25 I_REGISTER_INTERFACE(imtgql::IGqlContextCreator);
26 I_ASSIGN(m_userCollectionCompPtr, "UserCollection", "User collection", false, "UserCollection");
27 I_ASSIGN(m_userSettingsCollectionCompPtr, "UserSettingsCollection", "User settings collection", false, "UserSettingsCollection");
28 I_ASSIGN(m_gqlContextFactCompPtr, "GqlContextFactory", "GraphQL context factory", true, "GqlContextFactory");
29 I_END_COMPONENT;
30
31 // reimplemented (imtgql::IGqlContextCreator)
32 virtual imtgql::IGqlContextUniquePtr CreateGqlContext(
33 const QByteArray& token,
34 const QByteArray& productId,
35 const QByteArray& userId,
36 const imtgql::IGqlContext::Headers& headers,
37 QString& errorMessage) const override;
38
39private:
40 I_REF(imtbase::IObjectCollection, m_userCollectionCompPtr);
41 I_REF(imtbase::IObjectCollection, m_userSettingsCollectionCompPtr);
42 I_FACT(imtgql::IGqlContext, m_gqlContextFactCompPtr);
43};
44
45
46} // namespace imtservergql
47
48