import {Ice} from 'ice'; import {IceGrid} from '../IceGrid/Exception'; import '../IceGrid/Session'; import '../IceGrid/Admin'; import '../Ice/Locator'; declare module './IceGrid.ns' { namespace IceGrid { type LoadSampleName = 'LoadSample1' | 'LoadSample5' | 'LoadSample15'; /** * Determines which load sampling interval to use. */ class LoadSample< Name extends LoadSampleName = LoadSampleName > extends Ice.EnumBase { /** * Sample every minute. */ static LoadSample1: LoadSample<'LoadSample1'>; /** * Sample every five minutes. */ static LoadSample5: LoadSample<'LoadSample5'>; /** * Sample every fifteen minutes. */ static LoadSample15: LoadSample<'LoadSample15'>; } /** * The IceGrid query interface. This interface is accessible to * Ice clients who wish to look up well-known objects. */ abstract class Query extends Ice.Object { /** * Find a well-known object by identity. * * @param id The identity. * * @return The proxy or null if no such object has been found. */ abstract findObjectById( id: Ice.Identity, current: Ice.Current, ): Ice.OperationResult; /** * Find a well-known object by type. If there are several objects * registered for the given type, the object is randomly * selected. * * @param type The object type. * * @return The proxy or null, if no such object has been found. */ abstract findObjectByType( type: string, current: Ice.Current, ): Ice.OperationResult; /** * Find a well-known object by type on the least-loaded node. If * the registry does not know which node hosts the object * (for example, because the object was registered with a direct proxy), the * registry assumes the object is hosted on a node that has a load * average of 1.0. * * @param type The object type. * * @param sample The sampling interval. * * @return The proxy or null, if no such object has been found. */ abstract findObjectByTypeOnLeastLoadedNode( type: string, sample: LoadSample, current: Ice.Current, ): Ice.OperationResult; /** * Find all the well-known objects with the given type. * * @param type The object type. * * @return The proxies or an empty sequence, if no such objects * have been found. */ abstract findAllObjectsByType( type: string, current: Ice.Current, ): Ice.OperationResult; /** * Find all the object replicas associated with the given * proxy. If the given proxy is not an indirect proxy from a * replica group, an empty sequence is returned. * * @param proxy The object proxy. * * @return The proxies of each object replica or an empty sequence, * if the given proxy is not from a replica group. */ abstract findAllReplicas( proxy: Ice.ObjectPrx | null, current: Ice.Current, ): Ice.OperationResult; } /** * The IceGrid query interface. This interface is accessible to * Ice clients who wish to look up well-known objects. */ class QueryPrx extends Ice.ObjectPrx { /** * Find a well-known object by identity. * * @param id The identity. * * @return The proxy or null if no such object has been found. */ findObjectById( id: Ice.Identity, ctx?: Ice.Context, ): Ice.AsyncResult; /** * Find a well-known object by type. If there are several objects * registered for the given type, the object is randomly * selected. * * @param type The object type. * * @return The proxy or null, if no such object has been found. */ findObjectByType( type: string, ctx?: Ice.Context, ): Ice.AsyncResult; /** * Find a well-known object by type on the least-loaded node. If * the registry does not know which node hosts the object * (for example, because the object was registered with a direct proxy), the * registry assumes the object is hosted on a node that has a load * average of 1.0. * * @param type The object type. * * @param sample The sampling interval. * * @return The proxy or null, if no such object has been found. */ findObjectByTypeOnLeastLoadedNode( type: string, sample: LoadSample, ctx?: Ice.Context, ): Ice.AsyncResult; /** * Find all the well-known objects with the given type. * * @param type The object type. * * @return The proxies or an empty sequence, if no such objects * have been found. */ findAllObjectsByType( type: string, ctx?: Ice.Context, ): Ice.AsyncResult; /** * Find all the object replicas associated with the given * proxy. If the given proxy is not an indirect proxy from a * replica group, an empty sequence is returned. * * @param proxy The object proxy. * * @return The proxies of each object replica or an empty sequence, * if the given proxy is not from a replica group. */ findAllReplicas( proxy: Ice.ObjectPrx | null, ctx?: Ice.Context, ): Ice.AsyncResult; } /** * The IceGrid registry allows clients create sessions * directly with the registry. * * @see Session * @see AdminSession */ abstract class Registry extends Ice.Object { /** * Create a client session. * * @return A proxy for the newly created session. * * @param userId The user id. * * @param password The password for the given user id. * * @throws PermissionDeniedException Raised if the password for * the given user id is not correct, or if the user is not allowed * access. */ abstract createSession( userId: string, password: string, current: Ice.Current, ): Ice.OperationResult; /** * Create an administrative session. * * @return A proxy for the newly created session. * * @param userId The user id. * * @param password The password for the given user id. * * @throws PermissionDeniedException Raised if the password for * the given user id is not correct, or if the user is not allowed * access. */ abstract createAdminSession( userId: string, password: string, current: Ice.Current, ): Ice.OperationResult; /** * Create a client session from a secure connection. * * @return A proxy for the newly created session. * * @throws PermissionDeniedException Raised if the password for * the given user id is not correct, or if the user is not allowed * access. */ abstract createSessionFromSecureConnection( current: Ice.Current, ): Ice.OperationResult; /** * Create an administrative session from a secure connection. * * @return A proxy for the newly created session. * * @throws PermissionDeniedException Raised if the password for * the given user id is not correct, or if the user is not allowed * access. */ abstract createAdminSessionFromSecureConnection( current: Ice.Current, ): Ice.OperationResult; /** * Get the session timeout. If a client or administrative client * doesn't call the session keepAlive method in the time interval * defined by this timeout, IceGrid might reap the session. * * @see Session#keepAlive * @see AdminSession#keepAlive * * @return The timeout (in seconds). */ abstract getSessionTimeout( current: Ice.Current, ): Ice.OperationResult; /** * Get the value of the ACM timeout. Clients supporting ACM * connection heartbeats can enable them instead of explicitly * sending keep alives requests. * * NOTE: This method is only available since Ice 3.6. * * @return The timeout (in seconds). */ abstract getACMTimeout(current: Ice.Current): Ice.OperationResult; } /** * The IceGrid registry allows clients create sessions * directly with the registry. * * @see Session * @see AdminSession */ class RegistryPrx extends Ice.ObjectPrx { /** * Create a client session. * * @return A proxy for the newly created session. * * @param userId The user id. * * @param password The password for the given user id. * * @throws PermissionDeniedException Raised if the password for * the given user id is not correct, or if the user is not allowed * access. */ createSession( userId: string, password: string, ctx?: Ice.Context, ): Ice.AsyncResult; /** * Create an administrative session. * * @return A proxy for the newly created session. * * @param userId The user id. * * @param password The password for the given user id. * * @throws PermissionDeniedException Raised if the password for * the given user id is not correct, or if the user is not allowed * access. */ createAdminSession( userId: string, password: string, ctx?: Ice.Context, ): Ice.AsyncResult; /** * Create a client session from a secure connection. * * @return A proxy for the newly created session. * * @throws PermissionDeniedException Raised if the password for * the given user id is not correct, or if the user is not allowed * access. */ createSessionFromSecureConnection( ctx?: Ice.Context, ): Ice.AsyncResult; /** * Create an administrative session from a secure connection. * * @return A proxy for the newly created session. * * @throws PermissionDeniedException Raised if the password for * the given user id is not correct, or if the user is not allowed * access. */ createAdminSessionFromSecureConnection( ctx?: Ice.Context, ): Ice.AsyncResult; /** * Get the session timeout. If a client or administrative client * doesn't call the session keepAlive method in the time interval * defined by this timeout, IceGrid might reap the session. * * @see Session#keepAlive * @see AdminSession#keepAlive * * @return The timeout (in seconds). */ getSessionTimeout(ctx?: Ice.Context): Ice.AsyncResult; /** * Get the value of the ACM timeout. Clients supporting ACM * connection heartbeats can enable them instead of explicitly * sending keep alives requests. * * NOTE: This method is only available since Ice 3.6. * * @return The timeout (in seconds). */ getACMTimeout(ctx?: Ice.Context): Ice.AsyncResult; } /** * The IceGrid locator interface provides access to the {@link Query} * and {@link Registry} object of the IceGrid registry. * * @see Query * @see Registry */ abstract class Locator extends Ice.Object implements Ice.Locator { /** * Find an object by identity and return a proxy that contains * the adapter ID or endpoints which can be used to access the * object. * * @param id The identity. * * @return The proxy, or null if the object is not active. * * @throws ObjectNotFoundException Raised if the object cannot * be found. */ abstract findObjectById( id: Ice.Identity, current: Ice.Current, ): Ice.OperationResult; /** * Find an adapter by id and return a proxy that contains * its endpoints. * * @param id The adapter id. * * @return The adapter proxy, or null if the adapter is not active. * * @throws AdapterNotFoundException Raised if the adapter cannot be * found. */ abstract findAdapterById( id: string, current: Ice.Current, ): Ice.OperationResult; /** * Get the locator registry. * * @return The locator registry. */ abstract getRegistry( current: Ice.Current, ): Ice.OperationResult; /** * Get the proxy of the registry object hosted by this IceGrid * registry. * * @return The proxy of the registry object. */ abstract getLocalRegistry( current: Ice.Current, ): Ice.OperationResult; /** * Get the proxy of the query object hosted by this IceGrid * registry. * * @return The proxy of the query object. */ abstract getLocalQuery( current: Ice.Current, ): Ice.OperationResult; } /** * The IceGrid locator interface provides access to the {@link Query} * and {@link Registry} object of the IceGrid registry. * * @see Query * @see Registry */ class LocatorPrx extends Ice.ObjectPrx implements Ice.LocatorPrx { /** * Find an object by identity and return a proxy that contains * the adapter ID or endpoints which can be used to access the * object. * * @param id The identity. * * @return The proxy, or null if the object is not active. * * @throws ObjectNotFoundException Raised if the object cannot * be found. */ findObjectById( id: Ice.Identity, ctx?: Ice.Context, ): Ice.AsyncResult; /** * Find an adapter by id and return a proxy that contains * its endpoints. * * @param id The adapter id. * * @return The adapter proxy, or null if the adapter is not active. * * @throws AdapterNotFoundException Raised if the adapter cannot be * found. */ findAdapterById( id: string, ctx?: Ice.Context, ): Ice.AsyncResult; /** * Get the locator registry. * * @return The locator registry. */ getRegistry( ctx?: Ice.Context, ): Ice.AsyncResult; /** * Get the proxy of the registry object hosted by this IceGrid * registry. * * @return The proxy of the registry object. */ getLocalRegistry(ctx?: Ice.Context): Ice.AsyncResult; /** * Get the proxy of the query object hosted by this IceGrid * registry. * * @return The proxy of the query object. */ getLocalQuery(ctx?: Ice.Context): Ice.AsyncResult; } } } export {IceGrid} from './IceGrid.ns';