8#define OPENFIN_ADAPTER_API __declspec(dllimport)
10namespace OpenFinAdapterApi {
19 std::string channelName;
20 std::string channelId;
21 std::string endpointId;
56 shared_future<shared_ptr<string>>
dispatchAsync(
const string& topic)
const;
62 shared_future<shared_ptr<string>>
dispatchAsync(
const string& topic,
const string& payloadJson)
const;
109 shared_future<shared_ptr<string>>
dispatchAsync(
const EndpointId& targetChannel,
const string& topic,
const string& payloadJson)
const;
115 shared_future<shared_ptr<string>>
broadcastAsync(
const string& topic,
const string& payloadJson)
const;
146 const char* what()
const noexcept override;
157 string productVersion;
159 string runtimeVersion;
163 bool disableAutoUpdates;
165 string installDirectory;
166 string workingDirectory;
170 bool disableAutoUpdates,
172 const string& installDirectory,
173 const string& workingDirectory,
174 const string& productName,
175 const string& productVersion,
176 const string& companyName,
177 const string& runtimeVersion);
198 NonPersistent = 0x0001,
243 const string& licenseKey,
244 const string& version,
248 const string& arguments,
250 const string& securityRealm,
259 const string& licenseKey,
260 const string& version
270 shared_future<shared_ptr<string>> launchManifest(
const string& manifestUrl,
const shared_ptr<RvmOptions>& rvmOptions =
nullptr)
const;
319 map<string, shared_ptr<Runtime>> runtimes;
Represents a Channel Client that can connect to a Channel Provider.
Definition OpenFinAdapter.h:42
shared_future< void > connectAsync(bool wait=true)
Connects the client to a channel.
void unsubscribeDisconnected(const function< void()> &listener)
Un-registers a listener from the channel disconnected event.
shared_future< shared_ptr< string > > dispatchAsync(const string &topic, const string &payloadJson) const
Dispatches a payload on a topic to the channel provider.
void subscribeDisconnected(const function< void()> &listener)
Creates a subscription to the channel disconnected event.
shared_future< shared_ptr< string > > dispatchAsync(const string &topic) const
Dispatches a signal on a topic to a channel provider, with no payload.
shared_future< void > disconnectAsync() const
Disconnects the client from the channel.
Represents a Channel Provider that accepts connections from Channel Clients.
Definition OpenFinAdapter.h:76
void unsubscribeClientConnected(const function< void(const EndpointId &)> &listener)
Un-registers a listener from being called upon client connections.
void subscribeClientDisconnected(const function< void(const EndpointId &)> &listener)
Registers a listener function that will be called upon client disconnections.
shared_future< shared_ptr< string > > dispatchAsync(const EndpointId &targetChannel, const string &topic) const
Dispatches an empty message to a remote endpoint on a topic.
shared_future< shared_ptr< string > > broadcastAsync(const string &topic) const
Dispatches an empty message to all connected clients on a topic.
void unsubscribeClientDisconnected(const function< void(const EndpointId &)> &listener)
Un-registers a listener from being called upon client disconnections.
void subscribeClientConnected(const function< void(const EndpointId &)> &listener)
Registers a listener function that will be called upon client connections.
shared_future< shared_ptr< string > > dispatchAsync(const EndpointId &targetChannel, const string &topic, const string &payloadJson) const
Dispatches a payload to a remote endpoint on a topic.
shared_future< void > openAsync()
Opens the Channel Provider, making it available for client connections.
shared_future< shared_ptr< string > > broadcastAsync(const string &topic, const string &payloadJson) const
Dispatches a payload to all connected clients.
Represents Channels connectivity for a Runtime connection, providing functions for creating clients a...
Definition OpenFinAdapter.h:126
shared_ptr< ChannelClient > createClient(const string &channelName)
Creates a Channel Client for the given channel name.
shared_ptr< ChannelProvider > createProvider(const string &channelName)
Creates a Channel Provider with the given name.
The Desktop System API.
Definition OpenFinAdapter.h:268
Base class for a channel client and channel provider.
Definition OpenFinAdapter.h:27
void registerTopic(const string &topic, const function< shared_ptr< string >(shared_ptr< string >, EndpointId)> &listener)
Registers a listener of a topic.
void unregisterTopic(const string &topic)
Unregisters a listener of a topic.
Represents and error thrown by the OpenFin runtime API.
Definition OpenFinAdapter.h:142
A factory for creating runtime instances from a set of runtime options.
Definition OpenFinAdapter.h:317
shared_ptr< Runtime > getRuntimeInstance(const RuntimeOptions &runtimeOptions)
Gets a runtime instance for the given options.
The options required for initialising the runtime.
Definition OpenFinAdapter.h:183
RuntimeConnectOptions runtimeConnectOptions
Advanced settings to configure how the adapter manages and connects to a runtime instance.
Definition OpenFinAdapter.h:229
string version
Requested Runtime Version to connect to.
Definition OpenFinAdapter.h:208
string securityRealm
Security Realm.
Definition OpenFinAdapter.h:226
RuntimeConnectOptions
Advanced settings to configure how the adapter manages and connects to a runtime instance.
Definition OpenFinAdapter.h:194
PortDiscoveryMode
Enum of the port discovery mode to use.
Definition OpenFinAdapter.h:186
@ None
No port discovery. The provided port will be used.
Definition OpenFinAdapter.h:188
string host
Requested Runtime defaults to 127.0.0.1.
Definition OpenFinAdapter.h:211
string license_key
The per-customer or per-contract licensing identifier for the RVM.
Definition OpenFinAdapter.h:205
RvmOptions * rvmOptions
The RVM Options to be used.
Definition OpenFinAdapter.h:223
RuntimeOptions(const string &uuid, const string &licenseKey, const string &version)
Constructs a new instance of the RuntimeOptions.
RuntimeOptions(const string &uuid, const string &licenseKey, const string &version, const string &host, int32_t port, PortDiscoveryMode portDiscoveryMode, const string &arguments, const RvmOptions &rvmOptions, const string &securityRealm, const RuntimeConnectOptions runtimeConnectOptions=RuntimeConnectOptions::None)
Constructs a new instance of the RuntimeOptions.
int32_t port
Requested Runtime port number; only used when PortDiscovery is disabled.
Definition OpenFinAdapter.h:214
string arguments
Arguments to be passed to the Runtime.
Definition OpenFinAdapter.h:220
PortDiscoveryMode portDiscoveryMode
Determines Port discovery methods to be used. Defaults to all available.
Definition OpenFinAdapter.h:217
string uuid
Connection UUID.
Definition OpenFinAdapter.h:202
Represents a connection to the OpenFin runtime.
Definition OpenFinAdapter.h:277
string getRuntimeId()
Gets the runtime ID.
future< void > disconnectAsync()
Disconnects from the runtime.
shared_ptr< Channels > getChannels()
Gets the Channels object.
future< void > connectAsync()
Initialises and connects to the runtime.
RuntimeOptions getRuntimeOptions()
Gets the Runtime options.
void subscribeDisconnected(const function< void()> &listener)
Registers a listener function that will be called when the adapter disconnects.
bool isConnected() const
Gets whether the runtime is connected.
shared_ptr< DesktopSystem > getDesktopSystem()
Gets the Desktop System API object.
void unsubscribeDisconnected(const function< void()> &listener)
Unregisters a listener function such that it will no longer be called when the adapter disconnects.
The options required to initialise the RVM.
Definition OpenFinAdapter.h:152
A structure that identifies a Channels endpoint.
Definition OpenFinAdapter.h:15
Definition OpenFinAdapter.h:155