/*! Copyright (c) 2018 Siemens AG. Licensed under the MIT License. */ import { Observable } from "rxjs"; import { CoatyObject, CoreType, Uuid } from ".."; import { Controller } from "./controller"; /** * Discovers objects by given object Ids and maintains a local cache of * resolved objects. The controller will also update existing objects in its * cache whenever such objects are advertised by other parties. * * To realize an object cache controller for a specific core types or for specific objects, * define a custom controller class that extends this abstract class and * set the core type and/or the filter predicate of objects to be cached in the `OnInit` method. */ export declare abstract class ObjectCacheController extends Controller { private _objectCache; private _pendingRequests; private _coreType; private _objectFilter; onInit(): void; onCommunicationManagerStarting(): void; /** * Gets an observable that emits the first object resolved for the given * object Id, then completes. * * @param objectId the object Id of the object to resolve * @param shouldResolvePending true if an already pending resolution should be * rediscovered; false otherwise (default) */ resolveObject(objectId: Uuid, shouldResolvePending?: boolean): Observable; /** * Sets a filter predicate on objects to be resolved. * * To filter out specific objects or object types you should set an object * filter once in the `OnInit` method of your custom controller. */ set objectFilter(predicate: (obj: T) => boolean); /** * Gets the core type of objects to be cached. * The default value returned is `CoatyObject`. */ protected get coreType(): CoreType; /** * Sets the core type of objects to be cached. * * To filter out specific object core types you should set * the core type once in the `OnInit` * method of your custom controller. */ protected set coreType(value: CoreType); private _observeObjectAdvertisements; }