Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
IXmppService.cs
1using System.Diagnostics.CodeAnalysis;
2using System.Reflection;
3using System.Xml;
4using EDaler;
5using EDaler.Uris;
9using NeuroFeatures;
11using Waher.Content;
25using Waher.Things;
27
29{
33 [DefaultImplementation(typeof(XmppService))]
34 public interface IXmppService : ILoadableService
35 {
36 #region Lifecycle
37
43 Task<bool> WaitForConnectedState(TimeSpan timeout);
44
48 Task UnloadFast();
49
53 event StateChangedEventHandler? ConnectionStateChanged;
54
55 #endregion
56
57 #region State
58
62 bool IsOnline { get; }
63
68
72 string BareJid { get; }
73
77 string? LatestError { get; }
78
82 string? LatestConnectionError { get; }
83
84 #endregion
85
86 #region Connections
87
99 Task<(bool Succeeded, string? ErrorMessage, string[]? Alternatives)> TryConnect(string domain, bool isIpAddress, string hostName, int portNumber,
100 string languageCode, Assembly appAssembly, Func<XmppClient, Task> connectedFunc);
101
117 Task<(bool Succeeded, string? ErrorMessage, string[]? Alternatives)> TryConnectAndCreateAccount(string domain, bool isIpAddress, string hostName,
118 int portNumber, string userName, string password, string languageCode, string ApiKey, string ApiSecret,
119 Assembly appAssembly, Func<XmppClient, Task> connectedFunc);
120
135 Task<(bool Succeeded, string? ErrorMessage, string[]? Alternatives)> TryConnectAndConnectToAccount(string domain, bool isIpAddress, string hostName,
136 int portNumber, string userName, string password, string passwordMethod, string languageCode, Assembly appAssembly,
137 Func<XmppClient, Task> connectedFunc);
138
139 #endregion
140
141 #region Password
142
148 Task<bool> ChangePassword(string NewPassword);
149
150 #endregion
151
152 #region Components & Services
153
159 Task<ServiceDiscoveryEventArgs> SendServiceDiscoveryRequest(string FullJid);
160
166 Task<bool> DiscoverServices(XmppClient? Client = null);
167
168 #endregion
169
170 #region Transfer
171
176 Task AddTransferCode(string Code);
177
178 #endregion
179
180 #region IQ Stanzas (Information Query)
181
190 Task<XmlElement> IqSetAsync(string To, string Xml);
191
192 #endregion
193
194 #region Messages
195
211 public void SendMessage(QoSLevel QoS, MessageType Type, string Id, string To, string CustomXml,
212 string Body, string Subject, string Language, string ThreadId, string ParentThreadId,
213 DeliveryEventHandler? DeliveryCallback, object? State);
214
215 #endregion
216
217 #region Presence
218
222 event PresenceEventHandlerAsync? OnPresence;
223
229
235 void RequestPresenceSubscription(string BareJid, string CustomXml);
236
242
248
249 #endregion
250
251 #region Roster
252
257
264
270
276
280 event RosterItemEventHandlerAsync? OnRosterItemAdded;
281
285 event RosterItemEventHandlerAsync? OnRosterItemUpdated;
286
290 event RosterItemEventHandlerAsync? OnRosterItemRemoved;
291
292 #endregion
293
294 #region Push Notification
295
300
307
315
320
331 Task AddPushNotificationRule(MessageType MessageType, string LocalName, string Namespace, string Channel,
332 string MessageVariable, string PatternMatchingScript, string ContentScript);
333
334 #endregion
335
336 #region Tokens
337
345 Task<string?> GetApiToken(int Seconds);
346
356 Task<object> PostToProtectedApi(string LocalResource, object Data, params KeyValuePair<string, string>[] Headers);
357
358 #endregion
359
360 #region HTTP File Upload
361
366
373 Task<HttpFileUploadEventArgs> RequestUploadSlotAsync(string FileName, string ContentType, long ContentSize);
374
375 #endregion
376
377 #region Personal Eventing Protocol (PEP)
378
384 void RegisterPepHandler(Type PersonalEventType, PersonalEventNotificationEventHandler Handler);
385
392 bool UnregisterPepHandler(Type PersonalEventType, PersonalEventNotificationEventHandler Handler);
393
394 #endregion
395
396 #region Thing Registries & Discovery
397
401 string RegistryServiceJid { get; }
402
408 bool IsIoTDiscoClaimURI(string DiscoUri);
409
415 bool IsIoTDiscoSearchURI(string DiscoUri);
416
422 bool IsIoTDiscoDirectURI(string DiscoUri);
423
430 bool TryDecodeIoTDiscoClaimURI(string DiscoUri, [NotNullWhen(true)] out MetaDataTag[]? Tags);
431
439 bool TryDecodeIoTDiscoSearchURI(string DiscoUri, [NotNullWhen(true)] out SearchOperator[]? Operators, out string? RegistryJid);
440
451 bool TryDecodeIoTDiscoDirectURI(string DiscoUri, [NotNullWhen(true)] out string? Jid, out string? SourceId, out string? NodeId,
452 out string? PartitionId, [NotNullWhen(true)] out MetaDataTag[]? Tags);
453
460 Task<NodeResultEventArgs> ClaimThing(string DiscoUri, bool MakePublic);
461
471 Task<bool> Disown(string RegistryJid, string ThingJid, string SourceId, string Partition, string NodeId);
472
480 Task<(SearchResultThing[], string?, bool)> Search(int Offset, int MaxCount, string DiscoUri);
481
490 Task<(SearchResultThing[], bool)> Search(int Offset, int MaxCount, string? RegistryJid, params SearchOperator[] Operators);
491
497 Task<(SearchResultThing[], string?)> SearchAll(string DiscoUri);
498
505 Task<SearchResultThing[]> SearchAll(string RegistryJid, params SearchOperator[] Operators);
506
507 #endregion
508
509 #region Legal Identities
510
515
520 Task<IdApplicationAttributesEventArgs> GetIdApplicationAttributes();
521
529 Task<LegalIdentity> AddLegalIdentity(RegisterIdentityModel Model, bool GenerateNewKeys, params LegalIdentityAttachment[] Attachments);
530
536 Task<LegalIdentity[]> GetLegalIdentities(XmppClient? client = null);
537
543 Task<LegalIdentity> GetLegalIdentity(CaseInsensitiveString legalIdentityId);
544
550 Task<bool> IsContact(CaseInsensitiveString legalIdentityId);
551
557 Task<bool> HasPrivateKey(CaseInsensitiveString legalIdentityId);
558
564 Task<LegalIdentity> ObsoleteLegalIdentity(CaseInsensitiveString legalIdentityId);
565
571 Task<LegalIdentity> CompromiseLegalIdentity(CaseInsensitiveString legalIdentityId);
572
579 Task PetitionIdentity(CaseInsensitiveString LegalId, string PetitionId, string Purpose);
580
588 Task SendPetitionIdentityResponse(CaseInsensitiveString LegalId, string PetitionId, string RequestorFullJid, bool Response);
589
593 event LegalIdentityEventHandler? LegalIdentityChanged;
594
598 public event LegalIdentityEventHandler? IdentityApplicationChanged;
599
603 event LegalIdentityPetitionEventHandler? PetitionForIdentityReceived;
604
608 event LegalIdentityPetitionResponseEventHandler? PetitionedIdentityResponseReceived;
609
614 Task ExportSigningKeys(XmlWriter Output);
615
621 Task<bool> ImportSigningKeys(XmlElement Xml);
622
629
630 #endregion
631
632 #region Smart Contracts
633
638
644 Task<Contract> GetContract(CaseInsensitiveString ContractId);
645
651
657
665 Task<Contract> SignContract(Contract Contract, string Role, bool Transferable);
666
672 Task<Contract> ObsoleteContract(CaseInsensitiveString ContractId);
673
689 Task<Contract> CreateContract(
690 CaseInsensitiveString TemplateId,
691 Part[] Parts,
692 Parameter[] Parameters,
693 ContractVisibility Visibility,
694 ContractParts PartsMode,
696 Duration ArchiveRequired,
697 Duration ArchiveOptional,
698 DateTime? SignAfter,
699 DateTime? SignBefore,
700 bool CanActAsTemplate);
701
707 Task<Contract> DeleteContract(CaseInsensitiveString ContractId);
708
715 Task PetitionContract(CaseInsensitiveString ContractId, string PetitionId, string Purpose);
716
724 Task SendPetitionContractResponse(CaseInsensitiveString ContractId, string PetitionId, string RequestorFullJid, bool Response);
725
729 event ContractProposalEventHandler ContractProposalReceived;
730
734 event ContractReferenceEventHandler ContractUpdated;
735
739 event ContractSignedEventHandler ContractSigned;
740
744 event ContractPetitionEventHandler PetitionForContractReceived;
745
749 event ContractPetitionResponseEventHandler PetitionedContractResponseReceived;
750
757
765 Task SendContractProposal(Contract Contract, string Role, string To, string Message);
766
767 #endregion
768
769 #region Attachments
770
778 Task<KeyValuePair<string, TemporaryFile>> GetAttachment(string Url, SignWith SignWith, TimeSpan Timeout);
779
780 #endregion
781
782 #region Peer Review
783
791 Task PetitionPeerReviewId(CaseInsensitiveString LegalId, LegalIdentity Identity, string PetitionId, string Purpose);
792
800 Task<LegalIdentity> AddPeerReviewIdAttachment(LegalIdentity Identity, LegalIdentity ReviewerLegalIdentity, byte[] PeerSignature);
801
805 event SignaturePetitionEventHandler? PetitionForPeerReviewIdReceived;
806
810 event SignaturePetitionResponseEventHandler? PetitionedPeerReviewIdResponseReceived;
811
816 Task<ServiceProviderWithLegalId[]> GetServiceProvidersForPeerReviewAsync();
817
824 Task SelectPeerReviewService(string ServiceId, string ServiceProvider);
825
826 #endregion
827
828 #region Signatures
829
836 Task<byte[]> Sign(byte[] data, SignWith signWith);
837
847 bool? ValidateSignature(LegalIdentity legalIdentity, byte[] data, byte[] signature);
848
859 Task SendPetitionSignatureResponse(CaseInsensitiveString LegalId, byte[] Content, byte[] Signature, string PetitionId, string RequestorFullJid, bool Response);
860
864 event SignaturePetitionEventHandler? PetitionForSignatureReceived;
865
869 event SignaturePetitionResponseEventHandler? SignaturePetitionResponseReceived;
870
871 #endregion
872
873 #region Provisioning
874
879
891 void IsFriendResponse(string ProvisioningServiceJID, string JID, string RemoteJID, string Key, bool IsFriend,
892 RuleRange Range, IqResultEventHandlerAsync Callback, object? State);
893
906 void CanControlResponseAll(string ProvisioningServiceJID, string JID, string RemoteJID, string Key, bool CanControl,
907 string[]? ParameterNames, IThingReference Node, IqResultEventHandlerAsync Callback, object? State);
908
921 void CanControlResponseCaller(string ProvisioningServiceJID, string JID, string RemoteJID, string Key,
922 bool CanControl, string[]? ParameterNames, IThingReference Node, IqResultEventHandlerAsync Callback, object? State);
923
936 void CanControlResponseDomain(string ProvisioningServiceJID, string JID, string RemoteJID, string Key,
937 bool CanControl, string[]? ParameterNames, IThingReference Node, IqResultEventHandlerAsync Callback, object? State);
938
952 void CanControlResponseDevice(string ProvisioningServiceJID, string JID, string RemoteJID, string Key,
953 bool CanControl, string[]? ParameterNames, string Token, IThingReference Node, IqResultEventHandlerAsync Callback,
954 object? State);
955
969 void CanControlResponseService(string ProvisioningServiceJID, string JID, string RemoteJID, string Key,
970 bool CanControl, string[]? ParameterNames, string Token, IThingReference Node, IqResultEventHandlerAsync Callback,
971 object? State);
972
986 void CanControlResponseUser(string ProvisioningServiceJID, string JID, string RemoteJID, string Key,
987 bool CanControl, string[]? ParameterNames, string Token, IThingReference Node, IqResultEventHandlerAsync Callback,
988 object? State);
989
1003 void CanReadResponseAll(string ProvisioningServiceJID, string JID, string RemoteJID, string Key, bool CanRead,
1004 FieldType FieldTypes, string[]? FieldNames, IThingReference Node, IqResultEventHandlerAsync Callback, object? State);
1005
1019 void CanReadResponseCaller(string ProvisioningServiceJID, string JID, string RemoteJID, string Key, bool CanRead,
1020 FieldType FieldTypes, string[]? FieldNames, IThingReference Node, IqResultEventHandlerAsync Callback, object? State);
1021
1035 void CanReadResponseDomain(string ProvisioningServiceJID, string JID, string RemoteJID, string Key, bool CanRead,
1036 FieldType FieldTypes, string[]? FieldNames, IThingReference Node, IqResultEventHandlerAsync Callback, object? State);
1037
1052 void CanReadResponseDevice(string ProvisioningServiceJID, string JID, string RemoteJID, string Key,
1053 bool CanRead, FieldType FieldTypes, string[]? FieldNames, string Token, IThingReference Node, IqResultEventHandlerAsync Callback,
1054 object? State);
1055
1070 void CanReadResponseService(string ProvisioningServiceJID, string JID, string RemoteJID, string Key,
1071 bool CanRead, FieldType FieldTypes, string[]? FieldNames, string Token, IThingReference Node, IqResultEventHandlerAsync Callback,
1072 object? State);
1073
1088 void CanReadResponseUser(string ProvisioningServiceJID, string JID, string RemoteJID, string Key,
1089 bool CanRead, FieldType FieldTypes, string[]? FieldNames, string Token, IThingReference Node, IqResultEventHandlerAsync Callback,
1090 object? State);
1091
1102 void DeleteDeviceRules(string ServiceJID, string DeviceJID, string NodeId, string SourceId, string Partition,
1103 IqResultEventHandlerAsync Callback, object? State);
1104
1113 void GetCertificate(string Token, CertificateCallback Callback, object? State);
1114
1115 #endregion
1116
1117 #region IoT
1118
1125 Task<(SearchResultThing[], bool)> GetMyDevices(int Offset, int MaxCount);
1126
1131 Task<SearchResultThing[]> GetAllMyDevices();
1132
1141 void GetControlForm(string To, string Language, DataFormResultEventHandler Callback, object? State,
1142 params ThingReference[] Nodes);
1143
1151
1160
1161 #endregion
1162
1163 #region e-Daler
1164
1172 bool TryParseEDalerUri(string Uri, out EDalerUri Parsed, out string Reason);
1173
1182 Task<string> TryDecryptMessage(byte[] EncryptedMessage, byte[] PublicKey, Guid TransactionId, string RemoteEndpoint);
1183
1190
1194 event BalanceEventHandler EDalerBalanceUpdated;
1195
1201 Task<(AccountEvent[], bool)> GetEDalerAccountEvents(int MaxCount);
1202
1209 Task<(AccountEvent[], bool)> GetEDalerAccountEvents(int MaxCount, DateTime From);
1210
1215 Task<Balance> GetEDalerBalance();
1216
1221 Task<(decimal, string, PendingPayment[])> GetPendingEDalerPayments();
1222
1232 Task<string> CreateFullEDalerPaymentUri(string ToBareJid, decimal Amount, decimal? AmountExtra, string Currency, int ValidNrDays);
1233
1244 Task<string> CreateFullEDalerPaymentUri(string ToBareJid, decimal Amount, decimal? AmountExtra, string Currency, int ValidNrDays, string Message);
1245
1255 Task<string> CreateFullEDalerPaymentUri(LegalIdentity To, decimal Amount, decimal? AmountExtra, string Currency, int ValidNrDays);
1256
1267 Task<string> CreateFullEDalerPaymentUri(LegalIdentity To, decimal Amount, decimal? AmountExtra, string Currency, int ValidNrDays, string PrivateMessage);
1268
1278 string CreateIncompleteEDalerPayMeUri(string BareJid, decimal? Amount, decimal? AmountExtra, string Currency, string Message);
1279
1290 string CreateIncompleteEDalerPayMeUri(LegalIdentity To, decimal? Amount, decimal? AmountExtra, string Currency, string PrivateMessage);
1291
1296
1300 DateTime LastEDalerEvent { get; }
1301
1306 Task<IBuyEDalerServiceProvider[]> GetServiceProvidersForBuyingEDalerAsync();
1307
1315 Task<OptionsTransaction> InitiateBuyEDalerGetOptions(string ServiceId, string ServiceProvider);
1316
1322 void BuyEDalerGetOptionsCompleted(string TransactionId, IDictionary<CaseInsensitiveString, object>[] Options);
1323
1329 void BuyEDalerGetOptionsFailed(string TransactionId, string Message);
1330
1339 Task<PaymentTransaction> InitiateBuyEDaler(string ServiceId, string ServiceProvider, decimal Amount, string Currency);
1340
1348 Task<OptionsTransaction> InitiateSellEDalerGetOptions(string ServiceId, string ServiceProvider);
1349
1355 void SellEDalerGetOptionsCompleted(string TransactionId, IDictionary<CaseInsensitiveString, object>[] Options);
1356
1362 void SellEDalerGetOptionsFailed(string TransactionId, string Message);
1363
1370 void BuyEDalerCompleted(string TransactionId, decimal Amount, string Currency);
1371
1377 void BuyEDalerFailed(string TransactionId, string Message);
1378
1383 Task<ISellEDalerServiceProvider[]> GetServiceProvidersForSellingEDalerAsync();
1384
1393 Task<PaymentTransaction> InitiateSellEDaler(string ServiceId, string ServiceProvider, decimal Amount, string Currency);
1394
1401 void SellEDalerCompleted(string TransactionId, decimal Amount, string Currency);
1402
1408 void SellEDalerFailed(string TransactionId, string Message);
1409
1410 #endregion
1411
1412 #region Neuro-Features
1413
1417 event NeuroFeatures.TokenEventHandler NeuroFeatureRemoved;
1418
1422 event NeuroFeatures.TokenEventHandler NeuroFeatureAdded;
1423
1427 event VariablesUpdatedEventHandler NeuroFeatureVariablesUpdated;
1428
1432 event NewStateEventHandler NeuroFeatureStateUpdated;
1433
1437 DateTime LastNeuroFeatureEvent { get; }
1438
1443 Task<TokensEventArgs> GetNeuroFeatures();
1444
1451 Task<TokensEventArgs> GetNeuroFeatures(int Offset, int MaxCount);
1452
1458
1465 Task<string[]> GetNeuroFeatureReferences(int Offset, int MaxCount);
1466
1471 Task<TokenTotalsEventArgs> GetNeuroFeatureTotals();
1472
1478 Task<TokensEventArgs> GetNeuroFeaturesForContract(string ContractId);
1479
1487 Task<TokensEventArgs> GetNeuroFeaturesForContract(string ContractId, int Offset, int MaxCount);
1488
1494 Task<string[]> GetNeuroFeatureReferencesForContract(string ContractId);
1495
1503 Task<string[]> GetNeuroFeatureReferencesForContract(string ContractId, int Offset, int MaxCount);
1504
1510 Task<Token> GetNeuroFeature(string TokenId);
1511
1517 Task<TokenEvent[]> GetNeuroFeatureEvents(string TokenId);
1518
1526 Task<TokenEvent[]> GetNeuroFeatureEvents(string TokenId, int Offset, int MaxCount);
1527
1533 Task AddNeuroFeatureTextNote(string TokenId, string TextNote);
1534
1543 Task AddNeuroFeatureTextNote(string TokenId, string TextNote, bool Personal);
1544
1550 Task AddNeuroFeatureXmlNote(string TokenId, string XmlNote);
1551
1560 Task AddNeuroFeatureXmlNote(string TokenId, string XmlNote, bool Personal);
1561
1566 Task<CreationAttributesEventArgs> GetNeuroFeatureCreationAttributes();
1567
1572 Task<string> GenerateNeuroFeatureStateDiagramReport(string TokenId);
1573
1578 Task<string> GenerateNeuroFeatureProfilingReport(string TokenId);
1579
1584 Task<string> GenerateNeuroFeaturePresentReport(string TokenId);
1585
1590 Task<string> GenerateNeuroFeatureHistoryReport(string TokenId);
1591
1597 Task<CurrentStateEventArgs> GetNeuroFeatureCurrentState(string TokenId);
1598
1599 #endregion
1600
1601 #region Private XML
1602
1610 Task SavePrivateXml(string Xml);
1611
1619 Task SavePrivateXml(XmlElement Xml);
1620
1628 Task<XmlElement?> LoadPrivateXml(string LocalName, string Namespace);
1629
1635 Task DeletePrivateXml(string LocalName, string Namespace);
1636
1637 #endregion
1638 }
1639}
Account event
Definition: AccountEvent.cs:16
Contains information about a balance.
Definition: Balance.cs:11
Contains information about a pending payment.
Represents a transaction in the eDaler network.
Definition: Transaction.cs:36
Abstract base class for eDaler URIs
Definition: EDalerUri.cs:14
Contains information about a push notification token.
Neuro-Feature Token
Definition: Token.cs:43
Contains the definition of a contract
Definition: Contract.cs:22
Adds support for legal identities, smart contracts and signatures to an XMPP client.
Abstract base class for contractual parameters
Definition: Parameter.cs:17
Class defining a part in a contract
Definition: Part.cs:30
Class defining a role
Definition: Role.cs:7
Contains information about a service provider.
Abstract base class of signatures
Definition: Signature.cs:10
Abstract base class for all meta-data tags.
Definition: MetaDataTag.cs:9
Abstract base class for all search operators.
Contains information about a thing in a search result.
Maintains information about an item in the roster.
Definition: RosterItem.cs:75
Contains information about an identity of an entity.
Definition: Identity.cs:11
Contains information about an item of an entity.
Definition: Item.cs:11
Manages an XMPP client connection. Implements XMPP, as defined in https://tools.ietf....
Definition: XmppClient.cs:59
Represents a case-insensitive string.
Static class that dynamically manages types and interfaces available in the runtime environment.
Definition: Types.cs:14
Contains a reference to a thing
A service that can be loaded and unloaded at will. Typically during startup and shutdown of an applic...
Represents an abstraction of a connection to an XMPP Server.
Definition: IXmppService.cs:35
RosterItem? GetRosterItem(string BareJid)
Gets a roster item.
Task< object > PostToProtectedApi(string LocalResource, object Data, params KeyValuePair< string, string >[] Headers)
Performs an HTTP POST to a protected API on the server, over the current XMPP connection,...
void BuyEDalerFailed(string TransactionId, string Message)
Registers an initiated payment as failed.
void SellEDalerGetOptionsCompleted(string TransactionId, IDictionary< CaseInsensitiveString, object >[] Options)
Registers an initiated getting of payment options for selling eDaler as completed.
Task< bool > DiscoverServices(XmppClient? Client=null)
Run this method to discover services for any given XMPP server.
Task< TokenEvent[]> GetNeuroFeatureEvents(string TokenId, int Offset, int MaxCount)
Gets events relating to a specific token.
Task< KeyValuePair< string, TemporaryFile > > GetAttachment(string Url, SignWith SignWith, TimeSpan Timeout)
Gets an attachment for a contract.
string BareJid
The Bare Jid of the current connection, or null.
Definition: IXmppService.cs:72
void CanControlResponseDomain(string ProvisioningServiceJID, string JID, string RemoteJID, string Key, bool CanControl, string[]? ParameterNames, IThingReference Node, IqResultEventHandlerAsync Callback, object? State)
Sends a response to a previous "Can Control" question, based on the domain of the caller.
SensorDataClientRequest RequestSensorReadout(string Destination, FieldType Types)
Requests a sensor data readout.
Task< CreationAttributesEventArgs > GetNeuroFeatureCreationAttributes()
Gets token creation attributes from the broker.
Task SavePrivateXml(XmlElement Xml)
Saves Private XML to the server. Private XML are separated by Local Name and Namespace of the root el...
void CanControlResponseDevice(string ProvisioningServiceJID, string JID, string RemoteJID, string Key, bool CanControl, string[]? ParameterNames, string Token, IThingReference Node, IqResultEventHandlerAsync Callback, object? State)
Sends a response to a previous "Can Control" question, based on a device token.
Task< NodeResultEventArgs > ClaimThing(string DiscoUri, bool MakePublic)
Claims a think in accordance with parameters defined in a iotdisco claim URI.
Task< ServiceProviderWithLegalId[]> GetServiceProvidersForPeerReviewAsync()
Gets available service providers for buying eDaler.
Task< string > CreateFullEDalerPaymentUri(LegalIdentity To, decimal Amount, decimal? AmountExtra, string Currency, int ValidNrDays)
Creates a full payment URI.
void CanReadResponseDevice(string ProvisioningServiceJID, string JID, string RemoteJID, string Key, bool CanRead, FieldType FieldTypes, string[]? FieldNames, string Token, IThingReference Node, IqResultEventHandlerAsync Callback, object? State)
Sends a response to a previous "Can Read" question, based on a device token.
Task< Balance > GetEDalerBalance()
Gets the current account balance.
SignaturePetitionResponseEventHandler? PetitionedPeerReviewIdResponseReceived
An event that fires when a petitioned peer review response is received.
NeuroFeatures.TokenEventHandler NeuroFeatureAdded
Event raised when a token has been added to the wallet.
Task<(SearchResultThing[], bool)> Search(int Offset, int MaxCount, string? RegistryJid, params SearchOperator[] Operators)
Searches for devices in accordance with settings in a iotdisco-URI.
Task SendPetitionContractResponse(CaseInsensitiveString ContractId, string PetitionId, string RequestorFullJid, bool Response)
Sends a response to a petitioning contract request.
Task<(bool Succeeded, string? ErrorMessage, string[]? Alternatives)> TryConnectAndConnectToAccount(string domain, bool isIpAddress, string hostName, int portNumber, string userName, string password, string passwordMethod, string languageCode, Assembly appAssembly, Func< XmppClient, Task > connectedFunc)
To be used during the second phase of the startup/registration procedure. Tries to connect (and then ...
Task< LegalIdentity[]> GetLegalIdentities(XmppClient? client=null)
Returns a list of legal identities.
Task< TokensEventArgs > GetNeuroFeatures()
Gets available tokens
Task< Contract > GetContract(CaseInsensitiveString ContractId)
Gets the contract with the specified id.
void SendMessage(QoSLevel QoS, MessageType Type, string Id, string To, string CustomXml, string Body, string Subject, string Language, string ThreadId, string ParentThreadId, DeliveryEventHandler? DeliveryCallback, object? State)
Sends a message
Task DeletePrivateXml(string LocalName, string Namespace)
Deletes private XML previously saved to the account.
Task< string?> GetApiToken(int Seconds)
Gets a token for use with APIs that are either distributed or use different protocols,...
Task< IBuyEDalerServiceProvider[]> GetServiceProvidersForBuyingEDalerAsync()
Gets available service providers for buying eDaler.
RosterItemEventHandlerAsync? OnRosterItemUpdated
Event raised when a roster item has been updated in the roster.
void BuyEDalerGetOptionsFailed(string TransactionId, string Message)
Registers an initiated getting of payment options for buying eDaler as failed.
Task< string[]> GetSignedContractReferences()
Gets references to signed contracts.
void CanReadResponseUser(string ProvisioningServiceJID, string JID, string RemoteJID, string Key, bool CanRead, FieldType FieldTypes, string[]? FieldNames, string Token, IThingReference Node, IqResultEventHandlerAsync Callback, object? State)
Sends a response to a previous "Can Read" question, based on a user token.
ContractPetitionResponseEventHandler PetitionedContractResponseReceived
An event that fires when a petitioned contract response is received.
bool TryDecodeIoTDiscoDirectURI(string DiscoUri, [NotNullWhen(true)] out string? Jid, out string? SourceId, out string? NodeId, out string? PartitionId, [NotNullWhen(true)] out MetaDataTag[]? Tags)
Tries to decode an IoTDisco Direct Reference URI (subset of all possible IoTDisco URIs).
void CanControlResponseCaller(string ProvisioningServiceJID, string JID, string RemoteJID, string Key, bool CanControl, string[]? ParameterNames, IThingReference Node, IqResultEventHandlerAsync Callback, object? State)
Sends a response to a previous "Can Control" question, based on the JID of the caller.
RosterItem[] Roster
Items in the roster.
Task< bool > HasPrivateKey(CaseInsensitiveString legalIdentityId)
Checks if the client has access to the private keys of the specified legal identity.
LegalIdentityPetitionEventHandler? PetitionForIdentityReceived
An event that fires when a petition for an identity is received.
Task GenerateNewKeys()
Generates new keys
Task<(AccountEvent[], bool)> GetEDalerAccountEvents(int MaxCount, DateTime From)
Gets account events available for the wallet.
void CanReadResponseService(string ProvisioningServiceJID, string JID, string RemoteJID, string Key, bool CanRead, FieldType FieldTypes, string[]? FieldNames, string Token, IThingReference Node, IqResultEventHandlerAsync Callback, object? State)
Sends a response to a previous "Can Read" question, based on a service token.
Task< TokenEvent[]> GetNeuroFeatureEvents(string TokenId)
Gets events relating to a specific token.
void GetCertificate(string Token, CertificateCallback Callback, object? State)
Gets the certificate the corresponds to a token. This certificate can be used to identify services,...
bool TryParseEDalerUri(string Uri, out EDalerUri Parsed, out string Reason)
Tries to parse an eDaler URI.
DateTime LastNeuroFeatureEvent
Timepoint of last Neuro-Feature token event.
Task< string > TryDecryptMessage(byte[] EncryptedMessage, byte[] PublicKey, Guid TransactionId, string RemoteEndpoint)
Tries to decrypt an encrypted private message.
Task< string > CreateFullEDalerPaymentUri(string ToBareJid, decimal Amount, decimal? AmountExtra, string Currency, int ValidNrDays)
Creates a full payment URI.
Task< LegalIdentity > CompromiseLegalIdentity(CaseInsensitiveString legalIdentityId)
Marks the legal identity as compromised.
void IsFriendResponse(string ProvisioningServiceJID, string JID, string RemoteJID, string Key, bool IsFriend, RuleRange Range, IqResultEventHandlerAsync Callback, object? State)
Sends a response to a previous "Is Friend" question.
DateTime LastEDalerEvent
Timepoint of last eDaler event.
void RegisterPepHandler(Type PersonalEventType, PersonalEventNotificationEventHandler Handler)
Registers an event handler of a specific type of personal events.
Task AddPushNotificationRule(MessageType MessageType, string LocalName, string Namespace, string Channel, string MessageVariable, string PatternMatchingScript, string ContentScript)
Adds a push-notification rule in the broker.
Task< bool > ImportSigningKeys(XmlElement Xml)
Imports keys
Task< LegalIdentity > GetLegalIdentity(CaseInsensitiveString legalIdentityId)
Gets a specific legal identity.
Task< PaymentTransaction > InitiateSellEDaler(string ServiceId, string ServiceProvider, decimal Amount, string Currency)
Initiates the selling of eDaler using a service provider that does not use a smart contract.
void CanControlResponseUser(string ProvisioningServiceJID, string JID, string RemoteJID, string Key, bool CanControl, string[]? ParameterNames, string Token, IThingReference Node, IqResultEventHandlerAsync Callback, object? State)
Sends a response to a previous "Can Control" question, based on a user token.
Task< string > GenerateNeuroFeatureStateDiagramReport(string TokenId)
Generates a XAML report for a state diagram corresponding to the token.
Task< string > GenerateNeuroFeatureProfilingReport(string TokenId)
Generates a XAML report for a timing diagram corresponding to the token.
Task< OptionsTransaction > InitiateBuyEDalerGetOptions(string ServiceId, string ServiceProvider)
Initiates the process of getting available options for buying of eDaler using a service provider that...
Task< SearchResultThing[]> GetAllMyDevices()
Gets the full list of my devices.
Task UnloadFast()
Perform a shutdown in critical situations. Attempts to shut down XMPP connection as fast as possible.
Task ReportNewPushNotificationToken(string Token, PushMessagingService Service, ClientType ClientType)
Reports a new push-notification token to the broker.
Task<(bool Succeeded, string? ErrorMessage, string[]? Alternatives)> TryConnectAndCreateAccount(string domain, bool isIpAddress, string hostName, int portNumber, string userName, string password, string languageCode, string ApiKey, string ApiSecret, Assembly appAssembly, Func< XmppClient, Task > connectedFunc)
To be used during the second phase of the startup/registration procedure. Tries to connect (and then ...
Task< TokensEventArgs > GetNeuroFeaturesForContract(string ContractId)
Gets tokens created by a smart contract
void SellEDalerGetOptionsFailed(string TransactionId, string Message)
Registers an initiated getting of payment options for selling eDaler as failed.
Balance? LastEDalerBalance
Last reported balance
Task< CurrentStateEventArgs > GetNeuroFeatureCurrentState(string TokenId)
Gets the current state of a Neuro-Feature token.
ContractPetitionEventHandler PetitionForContractReceived
An event that fires when a petition for a contract is received.
void RequestRevokePresenceSubscription(string BareJid)
Requests a previous presence subscription request revoked.
Task PetitionContract(CaseInsensitiveString ContractId, string PetitionId, string Purpose)
Petitions a contract with the specified id and purpose.
Task<(AccountEvent[], bool)> GetEDalerAccountEvents(int MaxCount)
Gets account events available for the wallet.
bool IsIoTDiscoDirectURI(string DiscoUri)
Checks if a URI is a direct reference URI.
Task< string[]> GetCreatedContractReferences()
Gets references to created contracts.
Task< bool > Disown(string RegistryJid, string ThingJid, string SourceId, string Partition, string NodeId)
Disowns a thing
void CanControlResponseAll(string ProvisioningServiceJID, string JID, string RemoteJID, string Key, bool CanControl, string[]? ParameterNames, IThingReference Node, IqResultEventHandlerAsync Callback, object? State)
Sends a response to a previous "Can Control" question, for all future requests.
void BuyEDalerCompleted(string TransactionId, decimal Amount, string Currency)
Registers an initiated payment as completed.
Task< bool > NewPushNotificationToken(TokenInformation TokenInformation)
Registers a new token.
RosterItemEventHandlerAsync? OnRosterItemAdded
Event raised when a roster item has been added to the roster.
Task< LegalIdentity > ObsoleteLegalIdentity(CaseInsensitiveString legalIdentityId)
Marks the legal identity as obsolete.
Task< byte[]> Sign(byte[] data, SignWith signWith)
Signs binary data with the corresponding private key.
bool FileUploadIsSupported
Returns true if file upload is supported, false otherwise.
bool TryDecodeIoTDiscoSearchURI(string DiscoUri, [NotNullWhen(true)] out SearchOperator[]? Operators, out string? RegistryJid)
Tries to decode an IoTDisco Search URI (subset of all possible IoTDisco URIs).
bool? ValidateSignature(LegalIdentity legalIdentity, byte[] data, byte[] signature)
Validates a signature of binary data.
ContractSignedEventHandler ContractSigned
Event raised when contract was signed.
Task< string > GenerateNeuroFeaturePresentReport(string TokenId)
Generates a XAML present report for a token.
bool UnregisterPepHandler(Type PersonalEventType, PersonalEventNotificationEventHandler Handler)
Unregisters an event handler of a specific type of personal events.
BalanceEventHandler EDalerBalanceUpdated
Event raised when balance has been updated.
void AddRosterItem(RosterItem Item)
Adds an item to the roster. If an item with the same Bare JID is found in the roster,...
NewStateEventHandler NeuroFeatureStateUpdated
Event raised when a state-machine has received a new state.
Task<(decimal, string, PendingPayment[])> GetPendingEDalerPayments()
Gets pending payments
LegalIdentityPetitionResponseEventHandler? PetitionedIdentityResponseReceived
An event that fires when a petitioned identity response is received.
void DeleteDeviceRules(string ServiceJID, string DeviceJID, string NodeId, string SourceId, string Partition, IqResultEventHandlerAsync Callback, object? State)
Deletes the rules of a device.
Task< Contract > SignContract(Contract Contract, string Role, bool Transferable)
Signs a given contract.
ContractProposalEventHandler ContractProposalReceived
Event raised when a contract proposal has been received.
Task< string[]> GetNeuroFeatureReferencesForContract(string ContractId, int Offset, int MaxCount)
Gets token references created by a smart contract
Task SelectPeerReviewService(string ServiceId, string ServiceProvider)
Selects a peer-review service as default, for the account, when sending a peer-review request to the ...
Task< string > GenerateNeuroFeatureHistoryReport(string TokenId)
Generates a XAML history report for a token.
PresenceEventHandlerAsync? OnPresence
Event raised when a new presence stanza has been received.
Task AddTransferCode(string Code)
Registers a Transfer ID Code
Task SendPetitionSignatureResponse(CaseInsensitiveString LegalId, byte[] Content, byte[] Signature, string PetitionId, string RequestorFullJid, bool Response)
Sends a response to a petitioning signature request.
Task< string > CreateFullEDalerPaymentUri(string ToBareJid, decimal Amount, decimal? AmountExtra, string Currency, int ValidNrDays, string Message)
Creates a full payment URI.
void RequestPresenceSubscription(string BareJid)
Requests subscription of presence information from a contact.
Task< IdApplicationAttributesEventArgs > GetIdApplicationAttributes()
Gets important attributes for a successful ID Application.
ContractReferenceEventHandler ContractUpdated
Event raised when contract was updated.
LegalIdentityEventHandler? LegalIdentityChanged
An event that fires when a legal identity changes.
void CanControlResponseService(string ProvisioningServiceJID, string JID, string RemoteJID, string Key, bool CanControl, string[]? ParameterNames, string Token, IThingReference Node, IqResultEventHandlerAsync Callback, object? State)
Sends a response to a previous "Can Control" question, based on a service token.
Task AddNeuroFeatureTextNote(string TokenId, string TextNote)
Adds a text note on a token.
Task< Contract > ObsoleteContract(CaseInsensitiveString ContractId)
Obsoletes a contract.
void CanReadResponseDomain(string ProvisioningServiceJID, string JID, string RemoteJID, string Key, bool CanRead, FieldType FieldTypes, string[]? FieldNames, IThingReference Node, IqResultEventHandlerAsync Callback, object? State)
Sends a response to a previous "Can Read" question, based on the domain of the caller.
bool SupportsPushNotification
If push notification is supported.
Task< LegalIdentity > AddLegalIdentity(RegisterIdentityModel Model, bool GenerateNewKeys, params LegalIdentityAttachment[] Attachments)
Adds a legal identity.
Task< Contract > DeleteContract(CaseInsensitiveString ContractId)
Deletes a contract.
Task< HttpFileUploadEventArgs > RequestUploadSlotAsync(string FileName, string ContentType, long ContentSize)
Uploads a file to the upload component.
Task< IdentityStatus > ValidateIdentity(LegalIdentity Identity)
Validates a legal identity.
DateTime GetTimeOfLastContractEvent(CaseInsensitiveString ContractId)
Gets the timestamp of the last event received for a given contract ID.
RosterItemEventHandlerAsync? OnRosterItemRemoved
Event raised when a roster item has been removed from the roster.
void SellEDalerCompleted(string TransactionId, decimal Amount, string Currency)
Registers an initiated payment as completed.
Task ClearPushNotificationRules()
Clears configured push notification rules in the broker.
bool TryDecodeIoTDiscoClaimURI(string DiscoUri, [NotNullWhen(true)] out MetaDataTag[]? Tags)
Tries to decode an IoTDisco Claim URI (subset of all possible IoTDisco URIs).
LegalIdentityEventHandler? IdentityApplicationChanged
An event that fires when an ID Application has changed.
bool IsIoTDiscoClaimURI(string DiscoUri)
Checks if a URI is a claim URI.
Task< TokensEventArgs > GetNeuroFeatures(int Offset, int MaxCount)
Gets a section of available tokens
string ProvisioningServiceJid
JID of provisioning service.
bool IsOnline
Determines whether the connection to the XMPP server is live or not.
Definition: IXmppService.cs:62
Task<(SearchResultThing[], string?, bool)> Search(int Offset, int MaxCount, string DiscoUri)
Searches for devices in accordance with settings in a iotdisco-URI.
Task< bool > ChangePassword(string NewPassword)
Changes the password of the account.
Task AddNeuroFeatureXmlNote(string TokenId, string XmlNote, bool Personal)
Adds a xml note on a token.
Task<(SearchResultThing[], string?)> SearchAll(string DiscoUri)
Searches for all devices in accordance with settings in a iotdisco-URI.
void BuyEDalerGetOptionsCompleted(string TransactionId, IDictionary< CaseInsensitiveString, object >[] Options)
Registers an initiated getting of payment options for buying eDaler as completed.
void GetControlForm(string To, string Language, DataFormResultEventHandler Callback, object? State, params ThingReference[] Nodes)
Gets a control form from an actuator.
Task<(bool Succeeded, string? ErrorMessage, string[]? Alternatives)> TryConnect(string domain, bool isIpAddress, string hostName, int portNumber, string languageCode, Assembly appAssembly, Func< XmppClient, Task > connectedFunc)
To be used during the very first phase of the startup/registration procedure. Tries to connect (and t...
void CanReadResponseCaller(string ProvisioningServiceJID, string JID, string RemoteJID, string Key, bool CanRead, FieldType FieldTypes, string[]? FieldNames, IThingReference Node, IqResultEventHandlerAsync Callback, object? State)
Sends a response to a previous "Can Read" question, based on the JID of the caller.
string? LatestError
The latest generic xmpp error, if any.
Definition: IXmppService.cs:77
Task ExportSigningKeys(XmlWriter Output)
Exports Keys to XML.
void RequestPresenceSubscription(string BareJid, string CustomXml)
Requests subscription of presence information from a contact.
Task< TokenTotalsEventArgs > GetNeuroFeatureTotals()
Gets the value totals of tokens available in the wallet, grouped and ordered by currency.
string CreateIncompleteEDalerPayMeUri(string BareJid, decimal? Amount, decimal? AmountExtra, string Currency, string Message)
Creates an incomplete PayMe-URI.
StateChangedEventHandler? ConnectionStateChanged
An event that triggers whenever the connection state to the XMPP server changes.
Definition: IXmppService.cs:53
VariablesUpdatedEventHandler NeuroFeatureVariablesUpdated
Event raised when variables have been updated in a state-machine.
string? LatestConnectionError
The latest generic xmpp connection error, if any.
Definition: IXmppService.cs:82
Task PetitionPeerReviewId(CaseInsensitiveString LegalId, LegalIdentity Identity, string PetitionId, string Purpose)
Sends a petition to a third-party to review a legal identity.
Task< ISellEDalerServiceProvider[]> GetServiceProvidersForSellingEDalerAsync()
Gets available service providers for selling eDaler.
Task< string[]> GetNeuroFeatureReferences(int Offset, int MaxCount)
Gets references to a section of available tokens
Task< bool > WaitForConnectedState(TimeSpan timeout)
Can be used to await the server's connection state, i.e. skipping all intermediate states but XmppSta...
Task< string[]> GetNeuroFeatureReferencesForContract(string ContractId)
Gets token references created by a smart contract
Task AddNeuroFeatureTextNote(string TokenId, string TextNote, bool Personal)
Adds a text note on a token.
Task< ServiceDiscoveryEventArgs > SendServiceDiscoveryRequest(string FullJid)
Performs a Service Discovery on a remote entity.
Task< SearchResultThing[]> SearchAll(string RegistryJid, params SearchOperator[] Operators)
Searches for all devices in accordance with settings in a iotdisco-URI.
void CanReadResponseAll(string ProvisioningServiceJID, string JID, string RemoteJID, string Key, bool CanRead, FieldType FieldTypes, string[]? FieldNames, IThingReference Node, IqResultEventHandlerAsync Callback, object? State)
Sends a response to a previous "Can Read" question, for all future requests.
string CreateIncompleteEDalerPayMeUri(LegalIdentity To, decimal? Amount, decimal? AmountExtra, string Currency, string PrivateMessage)
Creates an incomplete PayMe-URI.
bool IsIoTDiscoSearchURI(string DiscoUri)
Checks if a URI is a search URI.
Task< string[]> GetNeuroFeatureReferences()
Gets references to available tokens
Task SendPetitionIdentityResponse(CaseInsensitiveString LegalId, string PetitionId, string RequestorFullJid, bool Response)
Sends a response to a petitioning identity request.
Task< bool > IsContact(CaseInsensitiveString legalIdentityId)
Checks if a legal identity is in the contacts list.
void RemoveRosterItem(string BareJid)
Removes an item from the roster.
Task AddNeuroFeatureXmlNote(string TokenId, string XmlNote)
Adds a xml note on a token.
Task SavePrivateXml(string Xml)
Saves Private XML to the server. Private XML are separated by Local Name and Namespace of the root el...
Task< Contract > CreateContract(CaseInsensitiveString TemplateId, Part[] Parts, Parameter[] Parameters, ContractVisibility Visibility, ContractParts PartsMode, Duration Duration, Duration ArchiveRequired, Duration ArchiveOptional, DateTime? SignAfter, DateTime? SignBefore, bool CanActAsTemplate)
Creates a new contract.
Task< LegalIdentity > AddPeerReviewIdAttachment(LegalIdentity Identity, LegalIdentity ReviewerLegalIdentity, byte[] PeerSignature)
Adds an attachment for the peer review.
SignaturePetitionResponseEventHandler? SignaturePetitionResponseReceived
Event raised when a response to a signature petition has been received.
void SellEDalerFailed(string TransactionId, string Message)
Registers an initiated payment as failed.
XmppState State
The current state of the connection to the XMPP server.
Definition: IXmppService.cs:67
Task PetitionIdentity(CaseInsensitiveString LegalId, string PetitionId, string Purpose)
Petitions a legal identity.
NeuroFeatures.TokenEventHandler NeuroFeatureRemoved
Event raised when a token has been removed from the wallet.
Task< Token > GetNeuroFeature(string TokenId)
Gets a specific token.
Task SendContractProposal(Contract Contract, string Role, string To, string Message)
Sends a contract proposal to a recipient.
Task< XmlElement > IqSetAsync(string To, string Xml)
Performs an asynchronous IQ Set request/response operation.
Task< PaymentTransaction > InitiateBuyEDaler(string ServiceId, string ServiceProvider, decimal Amount, string Currency)
Initiates the buying of eDaler using a service provider that does not use a smart contract.
Task<(SearchResultThing[], bool)> GetMyDevices(int Offset, int MaxCount)
Gets a (partial) list of my devices.
void RequestPresenceUnsubscription(string BareJid)
Requests unssubscription of presence information from a contact.
Task< OptionsTransaction > InitiateSellEDalerGetOptions(string ServiceId, string ServiceProvider)
Initiates the process of getting available options for selling of eDaler using a service provider tha...
Task< TokensEventArgs > GetNeuroFeaturesForContract(string ContractId, int Offset, int MaxCount)
Gets tokens created by a smart contract
SignaturePetitionEventHandler? PetitionForPeerReviewIdReceived
An event that fires when a petition for peer review is received.
string RegistryServiceJid
JID of thing registry service.
SensorDataClientRequest RequestSensorReadout(string Destination, ThingReference[] Nodes, FieldType Types)
Requests a sensor data readout.
Task< XmlElement?> LoadPrivateXml(string LocalName, string Namespace)
Loads private XML previously stored, given the local name and namespace of the XML.
Task< string > CreateFullEDalerPaymentUri(LegalIdentity To, decimal Amount, decimal? AmountExtra, string Currency, int ValidNrDays, string PrivateMessage)
Creates a full payment URI.
SignaturePetitionEventHandler? PetitionForSignatureReceived
An event that fires when a petition for a signature is received.
Task< EDaler.Transaction > SendEDalerUri(string Uri)
Sends an eDaler URI to the eDaler service.
Interface for thing references.
SignWith
Options on what keys to use when signing data.
Definition: Enumerations.cs:84
ContractParts
How the parts of the contract are defined.
Definition: Part.cs:9
ContractVisibility
Visibility types for contracts.
Definition: Enumerations.cs:58
RuleRange
Range of a rule change
Definition: RuleRange.cs:7
ClientType
Type of client requesting notification.
Definition: ClientType.cs:7
PushMessagingService
Push messaging service used.
QoSLevel
Quality of Service Level for asynchronous messages. Support for QoS Levels must be supported by the r...
Definition: QoSLevel.cs:8
MessageType
Type of message received.
Definition: MessageType.cs:7
XmppState
State of XMPP connection.
Definition: XmppState.cs:7
FieldType
Field Type flags
Definition: FieldType.cs:10
Represents a duration value, as defined by the xsd:duration data type: http://www....
Definition: Duration.cs:13