/// /// declare namespace tacsit { /** * This interface allows to create and list groups. It is the entry point of the API. * It must be noted that groups may be limited in number. */ interface GroupManager { /** * Create a group from the given payload. * The implementation shall return the GroupAlreadyKnown exception if the name is already used. * The implementation may choose to limit the creation of groups existing in the system at the same time by returning either the TooManyGroups exception (when the number of groups is limited by the implementation) or the GroupCreationNotAllowed exception (when the creation of new groups is not allowed by the implementation). */ createGroup(ovl: tacsit.DataPayload): tacsit.Group; /** * List the references of the already defined groups filtered by their name (namePattern is a regexp). */ listGroups(namePattern: string): tacsit.DataPayload; /** * Get the interface to a group from its URI and return the UnknownURI exception if the entity does not exist (anymore). */ getGroup(uri: tacsit.DataPayload): tacsit.Group; /** * Listen to the group creation, deletion, and update events at a given rate. * This method may return the InadequateRate exception (if the implementation deems this parameter as unsuitable) or the TooManyListeners exception (if the implementation limit the number of listeners) or the NotImplemented exception if this capability is not available. */ addListener(l: tacsit.GroupChangeListener, rate: number): void; /** * Listen to the group creation, deletion, and update events. * This method may return the TooManyListeners exception (if the implementation limit the number of listeners). */ addListener(l: tacsit.GroupChangeListener): void; /** * Remove a previously set listener and return the UnknownListener exception if the listener does not exist (any more). */ removeChangeListener(l: tacsit.GroupChangeListener): void; /** * Translate an Entity from the package Controller (from standard TCI) to the local Entity (from TEX). If not possible, the exception EntityUknown is thrown. */ castEntity(e: tacsit.Entity): tacsit.Entity; } /** * This interface accesses to a group. */ interface Group { /** * Get the payload of the group. */ read(): tacsit.DataPayload; /** * Get the interface of an entity from its URI and return the UnknownURI exception if the entity does not exist (anymore). */ getEntity(uri: tacsit.DataPayload): tacsit.Entity; /** * List the references to the entities of the group after filtering them on their name (namePattern is a regexp). */ listEntities(namePattern: string): tacsit.DataPayload; /** * List the references to the entities of the group that match the predicate in argument. */ queryEntities(p: tacsit.EntityQuerier): tacsit.DataPayload; /** * Update the meta data of the group and return the new group. * The implementation may return a NotImplemented exception. */ update(gmd: tacsit.DataPayload): tacsit.DataPayload; /** * Add an entity to the group and returns the possibly modified entity with its URI. * The implementation may return a NotImplemented exception. */ addEntity(ent: tacsit.DataPayload): tacsit.Entity; /** * Modify an entity in the group (based on its URI) and returns the possibly modified entity. * The implementation may return a NotImplemented exception. */ updateEntity(ent: tacsit.DataPayload): tacsit.DataPayload; /** * Remove an entity in the group and return the UnknownEntity exception if the entity does not exist (anymore). * The implementation may return a NotImplemented exception. */ removeEntity(ent: tacsit.DataPayload): void; /** * Grouped creation of entities. * The implementation may return a NotImplemented exception. */ addEntities(ents: tacsit.DataPayload): void; /** * Grouped modification of entities. * The implementation may return a NotImplemented exception. */ updateEntities(ents: tacsit.DataPayload): void; /** * Grouped retrieval of entities. * The implementation may return a NotImplemented exception. */ removeEntities(ents: tacsit.DataPayload): void; /** * Delete the group. * The implementation may return a NotImplemented exception. */ delete(): void; /** * Returns true if the group may be edited according to the TACSIT system. */ isEditable(): boolean; /** * Listen to the entity creation, deletion, and update events in the group at a given rate. * This method may return the InadequateRate exception (if the implementation deems this parameter as unsuitable) or the TooManyListeners exception (if the implementation limit the number of listeners) or the NotImplemented exception if this capability is not available. */ addListener(l: tacsit.EntityChangeListener, rate: number): void; /** * Listen to the entity creation, deletion, and update events in the group. * This method may return the TooManyListeners exception (if the implementation limit the number of listeners). */ addListener(l: tacsit.EntityChangeListener): void; /** * Remove a previously set listener and return the UnknownListener exception if the listener does not exist (any more). */ removeChangeListener(l: tacsit.EntityChangeListener): void; } /** * This interface accesses to an entity. */ interface Entity { /** * Get the payload of the entity. */ read(): tacsit.DataPayload; /** * Get the interface to the history of the entity. */ getHistory(): tacsit.EntityHistory; /** * Get back the matching Group interface. */ getGroup(): tacsit.Group; /** * Update the entity and return the new payload. * The implementation may return a NotImplemented exception. */ update(payload: tacsit.DataPayload): tacsit.DataPayload; /** * Delete the entity. * The implementation may return a NotImplemented exception. */ delete(): void; /** * Listen to the history creation, deletion, and update events for the entity at a given rate. * This method may return the InadequateRate exception (if the implementation deems this parameter as unsuitable) or the TooManyListeners exception (if the implementation limit the number of listeners) or the NotImplemented exception if this capability is not available. */ addListener(l: tacsit.HistoryChangeListener, rate: number): void; /** * Listen to the history creation, deletion, and update events for the entity. * This method may return the TooManyListeners exception (if the implementation limit the number of listeners). */ addListener(l: tacsit.HistoryChangeListener): void; /** * Remove a previously set listener and return the UnknownListener exception if the listener does not exist (any more). */ removeListener(l: tacsit.HistoryChangeListener): void; /** * Returns true if the given Entity corresponds to this Entity (i.e., the Tactical Objects are the same). */ equals(entity: tacsit.Entity): tacsit.DataPayload; /** * Returns true if this instance is valid. */ isValid(): boolean; /** * Returns the type of the Entity. This corresponds to the application specific class of the tactical object that has been added to the TACSIT. */ getType(): tacsit.EntityType; /** * This is a convenience method for indicating whether the entity is to be handled as though it is a “single” point rather than a complex geometry. This is useful for containment and other queries. */ isPointEntity(): boolean; /** * Returns the GeodeticPosition to be used as the main point of reference for this entity. */ getReferencePoint(): tacsit.GeodeticPosition; } /** * This interface access to the history of an entity. */ interface EntityHistory { /** * Get the payload of the history filtered on the date (no history before this date will be returned). */ getTimeSpan(filter: tacsit.DataPayload): tacsit.DataPayload; /** * Get the payload of the history sampled with a 'maxPoints' maximum number of points. * If 'fromStart' is false, the les than 'maxPoints' most recent data are returned. * Otherwise, an equal distribution of 'maxPoints' data taken among the known points is returned. */ getHistorySampling(maxPoints: number, fromStart: boolean): tacsit.DataPayload; /** * Get back the matching Entity interface. */ getEntity(): tacsit.Entity; /** * Get the number of data in the history. */ getLength(): number; /** * Get the date of the first data in the history. */ getHistoryStart(): Date; } /** * Interface invoked as a callback when a group is created, modified or deleted. */ interface GroupChangeListener { /** * This method is called for each creation, modification and deletion of group. * The implementation of this callback may return the exception StopListening as soon it wants to kill the listeners. */ groupChanged(e: tacsit.DataPayload): void; } /** * Interface invoked as a callback when entities are created, modified or deleted within a group. * The implementation of this callback may return the exception StopListening as soon it wants to kill the listeners. */ interface EntityChangeListener { /** * Interface invoked as a callback when a bulk of entity creation, modification or deletion happens. */ entityChanged(e: tacsit.DataPayload): void; } /** * Interface invoked as a callback when histories are created, modified or deleted for an entity. */ interface HistoryChangeListener { /** * Interface invoked as a callback when a bulk of history creation, modification or deletion happens. * The implementation of this callback may return the exception StopListening as soon it wants to kill the listeners. */ historyChanged(e: tacsit.DataPayload): void; } /** * Predicate function for the query service. */ interface EntityQuerier { /** * Predicate function returning true if e matches the predicate. */ match(e: tacsit.DataPayload): boolean; } }