Class MetadataStoreFactory


  • public class MetadataStoreFactory
    extends java.lang.Object
    Factory class for creating and accessing the MetadataStore instance.

    Use the appropriate create method to initialize the desired metadatastore type as the instance. A Db2 or a filesystem-backed metadata store can be initialized using the methods in this factory.

    Use the getMetadataStore() method to retrieve the metadata store instance after it has been initialzied using this factory. metadataStoreExists() can be used to check if an instance has been initialized or not.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static MetadataStore createDb2MetadataStore​(java.lang.String userid, java.io.File passwordFile, java.util.Properties connectionProperties)
      Create a configured Db2 backed metadata store instance using Db2 JDBC connection properties.
      static MetadataStore createDb2MetadataStore​(java.lang.String url, java.lang.String userid, java.io.File passwordFile)
      Create a basic Db2 connected metadata store instance.
      static MetadataStore createDb2MetadataStore​(java.lang.String url, java.lang.String userId, java.lang.String password)
      Create a basic Db2 connected metadata store instance.
      static MetadataStore createDb2MetadataStore​(java.lang.String userid, java.lang.String password, java.util.Properties connectionProperties)
      Create a configured Db2 backed metadata store instance using Db2 JDBC connection properties.
      static MetadataStore createFileMetadataStore()
      Create a file system metadata store instance in the user's $HOME directory
      static MetadataStore createFileMetadataStore​(java.lang.String location)
      Create a file system metadata store instance at the location provided.
      static MetadataStore getMetadataStore()
      Returns the previously created metadata store instance.
      static boolean metadataStoreExists()
      Check to see if a MetadataStore instance already exists
      static void staticReset()
      Resets the static metadataStore instance created by the factory.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MetadataStoreFactory

        public MetadataStoreFactory()
    • Method Detail

      • metadataStoreExists

        public static boolean metadataStoreExists()
        Check to see if a MetadataStore instance already exists
        Returns:
        TRUE if MetadataStore exists
      • getMetadataStore

        public static MetadataStore getMetadataStore()
        Returns the previously created metadata store instance.
        Returns:
        the metadata store instance, if one exists, otherwise null if no instance has been initilized
      • createFileMetadataStore

        public static MetadataStore createFileMetadataStore()
                                                     throws BuildException
        Create a file system metadata store instance in the user's $HOME directory
        Returns:
        a file system metadata store
        Throws:
        BuildException
      • createFileMetadataStore

        public static MetadataStore createFileMetadataStore​(java.lang.String location)
                                                     throws BuildException
        Create a file system metadata store instance at the location provided.
        Parameters:
        location - - Location of the metadata store. If null then defaults to the user's $HOME directory
        Returns:
        a file system based metadata store
        Throws:
        BuildException
      • createDb2MetadataStore

        public static MetadataStore createDb2MetadataStore​(java.lang.String url,
                                                           java.lang.String userId,
                                                           java.lang.String password)
                                                    throws BuildException
        Create a basic Db2 connected metadata store instance.
        Parameters:
        url - - Db2 server location. Local or remote URL. Must begin with 'jdbc:db2:'.
        userId - - The Db2 connection user ID
        password - - The Db2 connection password. IMPORTANT! : This password must be encrypted using the DBB password utility.
        Returns:
        a Db2 based metadata store
        Throws:
        BuildException
      • createDb2MetadataStore

        public static MetadataStore createDb2MetadataStore​(java.lang.String url,
                                                           java.lang.String userid,
                                                           java.io.File passwordFile)
                                                    throws BuildException
        Create a basic Db2 connected metadata store instance.
        Parameters:
        url - - Db2 server location. Local or remote URL. Must begin with 'jdbc:db2:'.
        userId - - The Db2 connection user ID.
        passwordFile - - The Db2 connection passwordFile. IMPORTANT! : The password file must be encrypted using the DBB password utility.
        Returns:
        a Db2 based metadata store
        Throws:
        BuildException
      • createDb2MetadataStore

        public static MetadataStore createDb2MetadataStore​(java.lang.String userid,
                                                           java.lang.String password,
                                                           java.util.Properties connectionProperties)
                                                    throws BuildException
        Create a configured Db2 backed metadata store instance using Db2 JDBC connection properties.
        Parameters:
        userId - - The Db2 connection user ID
        password - - The Db2 connection password. IMPORTANT! : This password must be encrypted using the DBB password utility.
        db2Properties - - Java properties object containing Db2 JDBC connection properties
        Returns:
        a Db2 based metadata store instance
        Throws:
        BuildException
      • createDb2MetadataStore

        public static MetadataStore createDb2MetadataStore​(java.lang.String userid,
                                                           java.io.File passwordFile,
                                                           java.util.Properties connectionProperties)
                                                    throws BuildException
        Create a configured Db2 backed metadata store instance using Db2 JDBC connection properties.
        Parameters:
        userId - - The Db2 connection user ID
        passwordFile - - The Db2 connection passwordFile. IMPORTANT! : The password file must be encrypted using the DBB password utility.
        db2Properties - - Java properties object containing Db2 JDBC connection properties
        Returns:
        a Db2 based metadata store instance
        Throws:
        BuildException
      • staticReset

        public static void staticReset()
        Resets the static metadataStore instance created by the factory.