Classes
The following classes are available globally.
-
Supports decoding of any Coaty object, either as a core type or as a custom, i.e application-specific object type.
If the Coaty object type specified in the decodable JSON object has been registered as a Swift class, an instance of the corresponding class type is created with all core type and custom type properties filled in. Any extra fields present on the decodable object are ignored.
Otherwise, if the Coaty object type has not been registered, an instance of the core type class as specified in the decodable JSON object is created with all core type properties filled in. Additionally, any other field present on the decodable object is added to the
custom
dictionary property of the created instance.The second approach is especially useful if you want to observe custom Coaty objects whose object type is not known at compile time so that no Swift class definition exists for them.
Note
the created Coaty object instance is accessible by theobject
property.Declaration
Swift
public class AnyCoatyObjectDecodable : Decodable
-
Custom implementation of a UUID that actually is compatible with the RFC 4122 V4 specification of defining UUIDs (lowercase in contrast to Apple’s uppercase implementation).
See moreDeclaration
Swift
public class CoatyUUID : Codable, CustomStringConvertible, Hashable
-
PayloadCoder provides utility methods to encode and decode communication events from and to JSON.
See moreDeclaration
Swift
public class PayloadCoder
-
AdvertiseEvent provides a generic implementation for advertising CoatyObjects.
See moreDeclaration
Swift
public class AdvertiseEvent : CommunicationEvent<AdvertiseEventData>
-
Defines event data format for advertising objects.
See moreDeclaration
Swift
public class AdvertiseEventData : CommunicationEventData
-
Associate event
See moreDeclaration
Swift
public class AssociateEvent : CommunicationEvent<AssociateEventData>
-
Defines event data format to associate or disassociate an IO source with an IO actor.
See moreDeclaration
Swift
public class AssociateEventData : CommunicationEventData
-
CallEvent provides a generic implementation for invoking remote operations.
See moreDeclaration
Swift
public class CallEvent : CommunicationEvent<CallEventData>
-
Declaration
Swift
public class CallEventData : CommunicationEventData
-
ChannelEvent provides a generic implementation for broadcasting objects through a channel.
See moreDeclaration
Swift
public class ChannelEvent : CommunicationEvent<ChannelEventData>
-
ChannelEventData provides the entire message payload data for a
See moreChannelEvent
including the object itself as well as associated private data.Declaration
Swift
public class ChannelEventData : CommunicationEventData
-
CommunicationEvent is a generic supertype for all defined Coaty event types.
See moreDeclaration
Swift
public class CommunicationEvent<T> : Codable where T : CommunicationEventData
-
CommunicationEventData provides the generic type required by the CommunicationEvent. Note that this cannot be a type alias since we need it to be an actual class.
Declaration
Swift
public class CommunicationEventData : Codable
-
CompleteEvent provides a generic implementation for responding to an
See moreUpdateEvent
.Declaration
Swift
public class CompleteEvent : CommunicationEvent<CompleteEventData>
-
CompleteEventData provides the entire message payload data for a
See moreCompleteEvent
including the object itself as well as associated private data.Declaration
Swift
public class CompleteEventData : CommunicationEventData
-
DeadvertiseEvent provides a generic implementation for deadvertising CoatyObjects.
See moreDeclaration
Swift
public class DeadvertiseEvent : CommunicationEvent<DeadvertiseEventData>
-
DeadvertiseEventData provides the entire message payload data for a
See moreDeadvertiseEvent
.Declaration
Swift
public class DeadvertiseEventData : CommunicationEventData
-
DiscoverEvent provides a generic implementation for discovering CoatyObjects. Note that this class should preferably be initialized by its withObject() method.
See moreDeclaration
Swift
public class DiscoverEvent : CommunicationEvent<DiscoverEventData>
-
DiscoverEventData provides the entire message payload data of a
See moreDiscoverEvent
.Declaration
Swift
public class DiscoverEventData : CommunicationEventData
-
IoState event.
This event is internally emitted by the observable returned by
CommunicationManager.observeIoState
.Warning
IoStateEvent is not a MQTT event. For internal use in framework only.Declaration
Swift
public class IoStateEvent
-
Defines event data format for association/disassociation related to a specific IO source/actor.
This data is emitted by the observable returned by
See moreCommunicationManager.observeIoState
.Declaration
Swift
public class IoStateEventData : CommunicationEventData
-
Undocumented
See moreDeclaration
Swift
public class IoValueEvent : CommunicationEvent<IoValueEventData>
-
Undocumented
See moreDeclaration
Swift
public class IoValueEventData : CommunicationEventData
-
QueryEvent provides a generic implementation for querying CoatyObjects.
See moreDeclaration
Swift
public class QueryEvent : CommunicationEvent<QueryEventData>
-
QueryEventData provides the entire message payload data for a
See moreQueryEvent
.Declaration
Swift
public class QueryEventData : CommunicationEventData
-
ResolveEvent provides a generic implementation for responding to a
See moreDiscoverEvent
.Declaration
Swift
public class ResolveEvent : CommunicationEvent<ResolveEventData>
-
ResolveEventData provides the entire message payload data for a
See moreResolveEvent
including the object itself as well as associated private data.Declaration
Swift
public class ResolveEventData : CommunicationEventData
-
RetrieveEvent provides a generic implementation for responding to a
See moreQueryEvent
.Declaration
Swift
public class RetrieveEvent : CommunicationEvent<RetrieveEventData>
-
RetrieveEventData provides the entire message payload data for a
See moreRetrieveEvent
including the object itself as well as associated private data.Declaration
Swift
public class RetrieveEventData : CommunicationEventData
-
Declaration
Swift
public class ReturnEvent : CommunicationEvent<ReturnEventData>
-
Undocumented
See moreDeclaration
Swift
public class ReturnEventData : CommunicationEventData
-
Undocumented
See moreDeclaration
Swift
public class ReturnError : Codable
-
UpdateEvent provides a generic implementation for updating a CoatyObject.
See moreDeclaration
Swift
public class UpdateEvent : CommunicationEvent<UpdateEventData>
-
Defines event data format for update operations on an object.
See moreDeclaration
Swift
public class UpdateEventData : CommunicationEventData
-
Provides a set of predefined communication events to transfer Coaty objects between distributed Coaty agents based on the publish-subscribe API of a
See moreCommunicationClient
.Declaration
Swift
public class CommunicationManager
-
Keeps track of agents or specific Coaty objects in a Coaty network by monitoring agent identities or custom object types.
This controller observes advertisements and deadvertisements of such objects and discovers them. Changes are emitted on corresponding observables that applications can subscribe to.
You can use this controller either standalone by adding it to the container components or extend your custom controller class from this controller class.
If you want to keep track of custom object types (not agent identities), you have to implement the remote side of the distributed object lifecycle management explicitely, i.e. advertise/readvertise/deadvertise your custom objects and observe/resolve corresponding Discover events. To facilitate this, this controller provides convenience methods:
advertiseDiscoverableObject
,readvertiseDiscoverableObject
, anddeadvertiseDiscoverableObject
.Usually, a custom object should have the object ID of its agent identity, i.e.
See moreContainer.identity
, set as itsparentObjectId
in order to be automatically deadvertised when the agent terminates abnormally. You can automate this by passingtrue
to the optional parametershouldSetParentObjectId
of methodadvertiseDiscoverableObject
(true
is also the default parameter value).Declaration
Swift
open class ObjectLifecycleController : Controller
-
Describes information used to connect to a specific database server using a specific database adapter.
See moreDeclaration
Swift
public class DbConnectionInfo
-
Supports basic routing of data from IO sources to IO actors based on an associated IO context.
This class implements a basic routing algorithm where all compatible pairs of IO sources and IO actors are associated, not taking any other context information into account. An IO source and an IO actor are compatible if both define equal value types in equal data formats.
Note that this router makes its IO context available by advertising and for discovery (by core type, object type, or object Id) and listens for Update-Complete events on its IO context, triggering
onIoContextChanged
automatically.This router class requires the following controller options:
ioContext
: the IO context for which this router is managing routes (mandatory)
Declaration
Swift
public class BasicIoRouter : RuleBasedIoRouter
-
Provides convenience methods for observing IO values and for monitoring changes in the association state of specific IO actors.
See moreDeclaration
Swift
open class IoActorController : Controller
-
Base IO router class for context-driven routing of IO values.
This router implements the base logic of routing. It observes IO nodes that are associated with the router’s IO context and manages routes for the IO sources and actors of these nodes.
This router implements a basic routing algorithm where all compatible pairs of IO sources and IO actors are associated. An IO source and an IO actor are compatible if both define equal value types in equal data formats. You can define your own custom compatibility check on value types in a subclass by overriding the
areValueTypesCompatible
method.To implement context-specific routing strategies extend this class and implement the methods marked with the fatal error: “This method must be overridden”
Note that this router makes its IO context available for discovery (by core type, object type, or object Id) and listens for Update-Complete events on its IO context, triggering
onIoContextChanged
automatically.This base router class requires the following controller options:
ioContext
: the IO context for which this router is managing routes (mandatory) Otherwise a fatalError is thrown
Declaration
Swift
public class IoRouter : Controller
-
Provides data transfer rate controlled publishing of IO values for IO sources and monitoring of changes in the association state of IO sources.
This controller respects the backpressure strategy of an IO source in order to cope with IO values that are more rapidly produced than specified in the recommended update rate.
See moreDeclaration
Swift
open class IoSourceController : Controller
-
Supports rule-based routing of data from IO sources to IO actors based on an associated IO context.
Define rules that determine whether a given pair of IO source and IO actor should be associated or not. A rule is only applied if the value type of IO source and IO actor are compatible. If no rules are defined or no rule matches no associations between IO sources and IO actors are established.
You can define global rules that match IO sources and actors of any compatible value type or value-type specific rules that are only applied to IO sources and IO actors with a given value type.
By default, an IO source and an IO actor are compatible if both define equal value types in equal data formats. You can define your own custom compatibility check on value types in a subclass by overriding the
areValueTypesCompatible
method.Note that this router makes its IO context available by advertising and for discovery (by core type, object type, or object Id) and listens for Update-Complete events on its IO context, triggering
onIoContextChanged
automatically.This router requires the following controller options:
ioContext
: the IO context for which this router is managing routes (mandatory)rules
: an array of rule definitions for this router. The rules listed here override any rules defined in theonInit
method.
Declaration
Swift
public class RuleBasedIoRouter : IoRouter
-
Represents an annotation
See moreDeclaration
Swift
open class Annotation : CoatyObject
-
Variant object composed of a description key and a download url
See moreDeclaration
Swift
public class AnnotationVariant : Codable
-
The base type of all objects in the Coaty object model. Application-specific object types extend either CoatyObject directly or any of its derived core types.
See moreDeclaration
Swift
open class CoatyObject : Codable
-
Represents the unique identity of a Coaty container.
See moreDeclaration
Swift
open class Identity : CoatyObject
-
Represents the context of IO routing.
An IO context is associated with an IO router that can use its context information to manage routes.
Remark
If needed, create a custom subtype with custom properties that represent application-specific context information.Declaration
Swift
open class IoContext : CoatyObject
-
Represents an IO node with IO sources and IO actors for IO routing.
The name of an IO node equals the name of the IO context it is associated with. An IO node also contains node-specific characteristics used by IO routers to manage routes.
See moreDeclaration
Swift
open class IoNode : CoatyObject
-
Defines meta information of an IO point.
This base object has no associated framework base object type. For instantiation use one of the concrete subtypes
See moreIoSource
orIoActor
.Declaration
Swift
open class IoPoint : CoatyObject
-
Object model representing location information including geolocation according to W3C Geolocation API Specification.
This interface can be extended to allow additional attributes that provide other information about this position (e.g. street address, shop floor number, etc.).
See moreDeclaration
Swift
open class Location : CoatyObject
-
Represents geolocation information according to W3C Geolocation API Specification.
This version of the specification allows one attribute of type GeoCoordinates and a timestamp.
See moreDeclaration
Swift
public class GeoLocation : Codable
-
Represent geographic coordinates. The reference system used by the properties in this interface is the World Geodetic System (2d) [WGS84].
See moreDeclaration
Swift
public class GeoCoordinates : Codable
-
Represents a log object.
See moreDeclaration
Swift
open class Log : CoatyObject
-
Information about the host environment in which a Log object is created. This information should only be logged once by each agent, e.g. initially at startup.
See moreDeclaration
Swift
public class LogHost : Codable
-
Represents a snapshot in time of the state of any Coaty object.
See moreDeclaration
Swift
open class Snapshot : CoatyObject
-
Represents a task or task request.
See moreDeclaration
Swift
open class Task : CoatyObject
-
Object model representing users as defined by the SCIM 2 standard according to RFC7643.
Note that the SCIM
See moreuserName
property is represented in thename
property of the base CoatyObject type.Declaration
Swift
open class User : CoatyObject
-
The components of the SCIM user’s name. Service providers MAY return just the full name as a single string in the formatted sub-attribute, or they MAY return just the individual component attributes using the other sub-attributes, or they MAY return both. If both variants are returned, they SHOULD be describing the same name, with the formatted name indicating how the component attributes should be combined.
See moreDeclaration
Swift
public class ScimUserNames : Codable
-
Undocumented
See moreDeclaration
Swift
public class ScimMultiValuedAttribute : Codable
-
Undocumented
See moreDeclaration
Swift
public class ScimAddress : ScimMultiValuedAttribute
-
Defines criteria for filtering and ordering a result set of Coaty objects. Used in combination with Query events and database operations, as well as the
See moreObjectMatcher
functionality.Declaration
Swift
public class ObjectFilter : Codable
-
Determines the ordering of result objects by an array of (property name, sort order) tuples. The results are ordered by the first tuple, then by the second tuple, etc.
See moreDeclaration
Swift
public class OrderByProperty : Codable
-
Defines the format of nested properties used in ObjectFilter
See moreconditions
andorderByProperties
clauses. Both dot notation ("property.subproperty.subsubproperty"
) and array notation (["property", "subproperty", "subsubproperty"]
) are supported for naming nested properties. Note that dot notation cannot be used if one of the properties contains a dot (.) in its name. In such cases, array notation must be used.Declaration
Swift
public class ObjectFilterProperty : Codable
-
Defines a set of conditions for filtering objects. Filter conditions can be combined by logical AND or OR.
See moreDeclaration
Swift
public class ObjectFilterConditions : Codable
-
An object filter condition is defined by an object property name - object filter expression pair. The filter expression must evaluate to true when applied to the object property’s value for the condition to become true.
See moreDeclaration
Swift
public class ObjectFilterCondition : Codable
-
A filter expression consists of a filter operator and an operator-specific number of filter operands (at most two).
Tip: use one of the typesafe
See moreFilterOperations
functions to specify a filter expression.Declaration
Swift
public class ObjectFilterExpression : Codable
-
Defines filter operator functions that yield object filter expressions.
See moreDeclaration
Swift
public class FilterOperations
-
Convenience builder class for
See moreObjectFilter
objects.Declaration
Swift
public class ObjectFilterBuilder
-
Convenience builder class for
See moreObjectFilterCondition
objects.Declaration
Swift
public class ObjectFilterConditionBuilder
-
Convenience builder class for
ObjectFilterConditions
objects.Note
You may want to consider to use the usual initializer instead and construct the array ofObjectFilterCondition
objects using the dedicated single instance builder.Declaration
Swift
public class ObjectFilterConditionsBuilder
-
Defines a condition for joining related objects into a result set of Coaty objects. Result objects are augmented by resolving object references to related objects and by storing them in an extra property of the result object. Used in combination with Query events.
See moreDeclaration
Swift
public class ObjectJoinCondition : Codable
-
Represents package, build and release information about a Coaty agent.
Agent information is generated when the agent project is build and can be used at run time, e.g. for logging, display, or configuration.
See moreDeclaration
Swift
public class AgentInfo : Codable
-
Represents information about the agent’s package, such as Swift package format or Cocoapods.
See moreDeclaration
Swift
public class AgentPackageInfo : Codable
-
Represents information about agent build.
See moreDeclaration
Swift
public class AgentBuildInfo : Codable
-
Represents information about agent configuration.
See moreDeclaration
Swift
public class AgentConfigInfo : Codable
-
Defines the application-specific container components to be registered with a Coaty Container.
See moreDeclaration
Swift
public class Components
-
Convenience class for building a configuration.
See moreDeclaration
Swift
public class ConfigurationBuilder
-
Configuration options for Coaty container components, such as controllers, communication manager, and runtime.
Warning
Configuration objects do not need to conform to JSON format as opposed to the Coaty JS framework!!Declaration
Swift
public class Configuration
-
Common options shared by container components.
See moreDeclaration
Swift
public class CommonOptions
-
Options used for communication
See moreDeclaration
Swift
public class CommunicationOptions
-
Controller options mapped by controller class name.
See moreDeclaration
Swift
public class ControllerConfig
-
Controller-specific options.
See moreDeclaration
Swift
public class ControllerOptions
-
Database access options mapped by a unique database key.
See moreDeclaration
Swift
public class DatabaseOptions
-
MQTT client options for the CocoaMQTT client.
See moreDeclaration
Swift
public class MQTTClientOptions
-
An IoC container that uses constructor dependency injection to create container components and to resolve dependencies. This container defines the entry and exit points for any Coaty application providing lifecycle management for its components.
See moreDeclaration
Swift
public class Container
-
The base controller class.
See moreDeclaration
Swift
open class Controller
-
Provides access to runtime data of a Coaty container, including shared configuration options, as well as platform and framework meta information.
See moreDeclaration
Swift
public class Runtime
-
Defines a time interval using the number of milliseconds since the epoc in UTC instead of ISO 8601 standard time intervals. This is used for consistency within the system.
A valid interval can have four formats:
- start and end timestamps
- start timestamp and duration
- duration and end timestamp
- duration only
Four different initializers, one for each format case ensure that this object always has a correct format.
The ISO 8601 standard string can be created using the function
See moretoLocalTimeIntervalIsoString
which is a part of this class.Declaration
Swift
public class CoatyTimeInterval : Codable
-
An Observation results in a value being assigned to a phenomenon. The phenomenon is a property of a feature, the latter being the FeatureOfInterest of the Observation. In the context of the Internet of Things, many Observations’ FeatureOfInterest can be the Location of the Thing. For example, the FeatureOfInterest of a wifi-connect thermostat can be the Location of the thermostat (i.e., the living room where the thermostat is located in). In the case of remote sensing, the FeatureOfInterest can be the geographical area or volume that is being sensed.
See moreDeclaration
Swift
open class FeatureOfInterest : CoatyObject
-
An Observation is the act of measuring or otherwise determining the value of a property.
See moreDeclaration
Swift
open class Observation : CoatyObject
-
NOTE: This file implements a small portion of the RFC7946 that is used in the coaty framework. This implementation is by no means complete. Many trivial choices were made during development. In case more compliance with the standard is needed, further development of this class is necessary. Polygon geometry object as defined in: https://tools.ietf.org/html/rfc7946#section-3.1.6
See moreDeclaration
Swift
open class Polygon : Codable, GeoJsonObject
-
Undocumented
See moreDeclaration
Swift
public class BBox : Codable
-
A Sensor is an instrument that observes a property or phenomenon with the goal of producing an estimate of the value of the property. It groups a collection of Observations measuring the same ObservedProperty.
See moreDeclaration
Swift
open class Sensor : CoatyObject
-
Some common sensor encoding types.
http://docs.opengeospatial.org/is/15-078r6/15-078r6.html#table_15
See moreDeclaration
Swift
open class SensorEncodingTypes
-
Some common encoding types.
- http://docs.opengeospatial.org/is/15-078r6/15-078r6.html#table_7
- http://docs.opengeospatial.org/is/15-078r6/15-078r6.html#table_15
Declaration
Swift
open class EncodingTypes : SensorEncodingTypes
-
Some common observations types
http://docs.opengeospatial.org/is/15-078r6/15-078r6.html#table_12
See moreDeclaration
Swift
public class ObservationTypes
-
The base class for sensor hardware-level IO control. Some IO classes are already defined:
- MockSensorIo: Mocks the functionality with a cached value.
Note
no sensorIo classes are defined except for the mocked version.Applications can also define their own SensorIo classes.
See moreDeclaration
Swift
open class SensorIo : ISensorIo
-
Observes Sensors and Sensor-related objects. This controller is designed to be used by a client as a counterpart to a SensorSourceController which should answer its requests.
See moreDeclaration
Swift
open class SensorObserverController : Controller
-
Manages a set of registered Sensors and provides a source for both Sensors and Sensor-related objects.
This controller is designed to be used by a server as a counterpart of a SensorObserverController.
You can either register the Sensors manually by calling registerSensor method or do it automatically from the controller options by defining your Sensors in a SensorDefinition array given in the
sensors
option of the controller.SensorSourceController also takes some other options (they all default to false):
- ignoreSensorDiscoverEvents: Ignores received discover events for registered sensors.
- ignoreSensorQueryEvents: Ignores received query events for registered sensors.
- skipSensorAdvertise: Does not advertise a sensor when registered.
- skipSensorDeadvertise: Does not deadvertise a sensor when unregistered.
Declaration
Swift
open class SensorSourceController : Controller
-
With regard to the Internet of Things, a thing is an object of the physical world (physical things) or the information world (virtual things) that is capable of being identified and integrated into communication networks.
See moreDeclaration
Swift
open class Thing : CoatyObject
-
Observes Things and Thing-related objects.
This controller is designed to be used by a client with a corresponding controller (e.g. ThingSourceController) that answers to its events.
See moreDeclaration
Swift
open class ThingObserverController : Controller
-
A convenience controller that observes things and associated sensor and observation objects, combining the functionality of
ThingObserverController
andSensorObserverController
.This controller is designed to be used by a client that wants to easily handle sensor-related events as well as sensor observations.
See moreDeclaration
Swift
open class ThingSensorObservationObserverController : ThingObserverController