Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EntityManagerFactory

Hierarchy

Index

Constructors

Properties

[CONNECTED]?: () => any

Type declaration

    • (): any
    • Returns any

code: Code = ...
connectData: null | ConnectData = null
connection: null | Connector = null
metamodel: Metamodel = ...
staleness: null | number = null
tokenStorage: null | TokenStorage = null
tokenStorageFactory: TokenStorageFactory = ...

Accessors

  • get isReady(): boolean
  • Indicates if there is currently no exclusive operation executed true If no exclusive lock is hold

    Returns boolean

  • Retrieves the websocket connection if the websocket SDK is available

    Returns WebSocketConnector

Methods

  • Apply additional configurations to this EntityManagerFactory

    Parameters

    Returns void

  • connect(hostOrApp: string, secure?: boolean, basePath?: string): Promise<EntityManagerFactory>
  • connect(hostOrApp: string, port?: number, secure?: boolean, basePath?: string): Promise<EntityManagerFactory>
  • Connects this EntityManager to the given destination

    Parameters

    • hostOrApp: string

      The host or the app name to connect with

    • Optional secure: boolean
    • Optional basePath: string

    Returns Promise<EntityManagerFactory>

  • Connects this EntityManager to the given destination

    Parameters

    • hostOrApp: string

      The host or the app name to connect with

    • Optional port: number
    • Optional secure: boolean
    • Optional basePath: string

    Returns Promise<EntityManagerFactory>

  • createEntityManager(useSharedTokenStorage?: boolean): EntityManager
  • Create a new application-managed EntityManager.

    Parameters

    • Optional useSharedTokenStorage: boolean

      The token storage to persist the authorization token, or true To use the shared token storage of the emf. false To use a instance based storage.

    Returns EntityManager

    a new entityManager

  • Creates a new Metamodel instance, which is not connected

    Returns Metamodel

    A new Metamodel instance

  • Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled

    Parameters

    • Optional doneCallback: (this: EntityManagerFactory) => any

      The callback which will be invoked when the previously operations on this object is completed.

    • Optional failCallback: (error: Error) => any

      When the lock can't be released caused by a none recoverable error

        • (error: Error): any
        • Parameters

          • error: Error

          Returns any

    Returns Promise<EntityManagerFactory>

    A promise which completes successfully, when the previously requested operation completes

  • Parameters

    Returns Promise<Response>

  • withLock<T>(callback: () => Promise<T>, critical?: boolean): Promise<T>
  • Try to aquire an exclusive lock and executes the given callback.

    throws

    If the lock can't be aquired

    Type parameters

    • T

    Parameters

    • callback: () => Promise<T>

      The exclusive operation to execute

        • (): Promise<T>
        • Returns Promise<T>

    • critical: boolean = false

    Returns Promise<T>

    A promise

Generated using TypeDoc