Class TickDBFactory


  • public class TickDBFactory
    extends java.lang.Object
    Public methods for creating instances of TickDB.
    • Constructor Summary

      Constructors 
      Constructor Description
      TickDBFactory()  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static DXTickDB connect​(java.lang.String host, int port)
      Deprecated.
      static RemoteTickDB connect​(java.lang.String host, int port, boolean enableSSL)  
      static RemoteTickDB connect​(java.lang.String host, int port, boolean enableSSL, java.lang.String user, java.lang.String pass)  
      static DXTickDB create​(DataCacheOptions options, java.io.File... paths)
      Creates a new embedded database with the specified root folders.
      static DXTickDB create​(DataCacheOptions options, java.lang.String... paths)
      Creates a new embedded database with the specified root folders.
      static DXTickDB create​(java.io.File... paths)
      Creates a new embedded database with the specified root folders.
      static DXTickDB create​(java.lang.String... paths)
      Creates a new embedded database with the specified root folders.
      static DXTickDB createFromUrl​(java.lang.String url)
      Creates a new database instance with the specified root folder, or URL.
      static DXTickDB createFromUrl​(java.lang.String url, java.lang.String user, java.lang.String pass)
      Creates a new database instance with the specified URL and credentials
      static java.lang.String format​(java.lang.String url, java.lang.String user, java.lang.String pass)
      Formats Timebase url connection string using given credentials.
      static boolean isRemote​(java.lang.String url)  
      static DXTickDB open​(java.lang.String host, int port, boolean readOnly)
      Deprecated.
      static DXTickDB openFromUrl​(java.lang.String url, boolean readOnly)
      Creates and opens Timebase instance using specified url.
      static DXTickDB openFromUrl​(java.lang.String url, boolean readOnly, long timeout)
      Creates and opens Timebase instance using specified url.
      static void setApplicationName​(DXTickDB db, java.lang.String application)
      Set "Application Name" for the DXTickDB instance.
      static void setApplicationName​(java.lang.String application)
      Set default "Application Name" that will be used for newly created connections.
      static DXTickDB wrap​(DXTickDB timebase, java.security.Principal user)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • EVENTS_STREAM_NAME

        public static final java.lang.String EVENTS_STREAM_NAME
        See Also:
        Constant Field Values
      • VERSION_PROPERTY

        public static java.lang.String VERSION_PROPERTY
    • Constructor Detail

      • TickDBFactory

        public TickDBFactory()
    • Method Detail

      • create

        public static DXTickDB create​(java.io.File... paths)
        Creates a new embedded database with the specified root folders.
        Parameters:
        paths - All root folders comprising the database.
        Returns:
        An un-opened TickDB instance. Next, the caller should call AbstractDataStore.open(boolean) or AbstractDataStore.format().
      • create

        public static DXTickDB create​(DataCacheOptions options,
                                      java.io.File... paths)
        Creates a new embedded database with the specified root folders.
        Parameters:
        paths - All root folders comprising the database.
        options - Options for data caching.
        Returns:
        An un-opened TickDB instance. Next, the caller should call AbstractDataStore.open(boolean) or AbstractDataStore.format().
      • connect

        @Deprecated
        public static DXTickDB connect​(java.lang.String host,
                                       int port)
        Deprecated.
      • connect

        public static RemoteTickDB connect​(java.lang.String host,
                                           int port,
                                           boolean enableSSL)
      • connect

        public static RemoteTickDB connect​(java.lang.String host,
                                           int port,
                                           boolean enableSSL,
                                           java.lang.String user,
                                           java.lang.String pass)
      • isRemote

        public static boolean isRemote​(java.lang.String url)
      • createFromUrl

        public static DXTickDB createFromUrl​(java.lang.String url)
        Creates a new database instance with the specified root folder, or URL.
        Parameters:
        url - Local folder or connection URL.
        Returns:
        An un-opened TickDB instance. Next, the caller should call AbstractDataStore.open(boolean) or AbstractDataStore.format().
      • createFromUrl

        public static DXTickDB createFromUrl​(java.lang.String url,
                                             java.lang.String user,
                                             java.lang.String pass)
        Creates a new database instance with the specified URL and credentials
        Parameters:
        url - Local folder or connection URL.
        Returns:
        An un-opened TickDB instance. Next, the caller should call AbstractDataStore.open(boolean) or AbstractDataStore.format().
      • format

        public static java.lang.String format​(java.lang.String url,
                                              java.lang.String user,
                                              java.lang.String pass)
        Formats Timebase url connection string using given credentials. if user is not specified, then result will not contains any credentials
      • create

        public static DXTickDB create​(java.lang.String... paths)
        Creates a new embedded database with the specified root folders.
        Parameters:
        paths - All root folders comprising the database.
        Returns:
        An un-opened TickDB instance. Next, the caller should call AbstractDataStore.open(boolean) or AbstractDataStore.format().
      • create

        public static DXTickDB create​(DataCacheOptions options,
                                      java.lang.String... paths)
        Creates a new embedded database with the specified root folders.
        Parameters:
        paths - All root folders comprising the database.
        options - Options for data caching.
        Returns:
        An un-opened TickDB instance. Next, the caller should call AbstractDataStore.open(boolean) or AbstractDataStore.format().
      • open

        @Deprecated
        public static DXTickDB open​(java.lang.String host,
                                    int port,
                                    boolean readOnly)
        Deprecated.
      • openFromUrl

        public static DXTickDB openFromUrl​(java.lang.String url,
                                           boolean readOnly)
        Creates and opens Timebase instance using specified url.
        Parameters:
        url - timebase connection url
        readOnly - readonly connection
        Returns:
        opened DXTickDB instance
        Throws:
        java.lang.RuntimeException - when connection cannot be established.
      • openFromUrl

        public static DXTickDB openFromUrl​(java.lang.String url,
                                           boolean readOnly,
                                           long timeout)
        Creates and opens Timebase instance using specified url. After given timeout throws exception if connection cannot be established.
        Parameters:
        url - timebase connection url
        readOnly - is readonly
        timeout - timeout to wait until connection is established
        Returns:
        opened DXTickDB instance
        Throws:
        java.lang.RuntimeException - when connection cannot be established.
      • wrap

        public static DXTickDB wrap​(DXTickDB timebase,
                                    java.security.Principal user)
      • setApplicationName

        public static void setApplicationName​(DXTickDB db,
                                              java.lang.String application)
        Set "Application Name" for the DXTickDB instance. Applicable for remote connections only. Should be used before @see deltix.qsrv.hf.tickdb.pub.DXTickDB#open(boolean)
        Parameters:
        db - DXTickDB instance
        application - Name of the application that owns connection
      • setApplicationName

        public static void setApplicationName​(java.lang.String application)
        Set default "Application Name" that will be used for newly created connections. Specific application name can for single connection can be set using @see TickDBFactory#setApplicationName(DXTickDB, String)