def __init__(self): """Inits SearchManager.""" # Note: added as a good practice since we use SearchManager as a base class. super(SearchManager, self).__init__() # Init database connections self._host = '/tmp' self._search_database = "gesearch" self._poi_database = "gepoi" self._db_user = "******" postgres_prop = postgres_properties.PostgresProperties() self._port = postgres_prop.GetPortNumber() # Create DB connection to gesearch database. self._search_db_connection = postgres_manager.PostgresConnection( self._search_database, self._db_user, self._host, self._port, logger) # Create DB connection to gepoi database. self._poi_db_connection = postgres_manager.PostgresConnection( self._poi_database, self._db_user, self._host, self._port, logger) # Create search schema table utility. self.table_utility = search_schema_table_util.SearchSchemaTableUtil( self._poi_db_connection)
def __init__(self): """Inits snippets DB manager.""" # Note: added as a good practice since we use SnippetsDbManager as a base # class. super(SnippetsDbManager, self).__init__() # Init database connection. self._host = "localhost" self._snippets_db_name = "geendsnippet" self._db_user = "******" postgres_prop = postgres_properties.PostgresProperties() self._port = postgres_prop.GetPortNumber() # Create DB connection to gesnippets database. self._snippets_db_connection = postgres_manager.PostgresConnection( self._snippets_db_name, self._db_user, self._host, self._port, logger)
def __init__(self): """Inits stream manager.""" # Note: added as a good practice since we use StreamManager as a base class. super(StreamManager, self).__init__() self.server_prefix = "" self._ReadDavConfig() # Get server host name (FQDN) - get once to use everywhere. self.server_hostname = utils.GetServerHost() # Init PostgresManager. self._host = '/tmp' self._database = "gestream" self._db_user = "******" postgres_prop = postgres_properties.PostgresProperties() self._port = postgres_prop.GetPortNumber() self.stream_db = postgres_manager.PostgresConnection( self._database, self._db_user, self._host, self._port, logger)