All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.antmedia.console.datastore.ConsoleDataStoreFactory Maven / Gradle / Ivy

Go to download

Ant Media Server supports RTMP, RTSP, MP4, HLS, WebRTC, Adaptive Streaming, etc.

There is a newer version: 2.11.3
Show newest version
package io.antmedia.console.datastore;

import org.springframework.beans.factory.annotation.Value;

import io.antmedia.AppSettings;

public class ConsoleDataStoreFactory  {

	private AbstractConsoleDataStore dataStore;
	
	@Value( "${"+AppSettings.SETTINGS_DB_APP_NAME+":#{null}}" )
	private String appName;
	
	@Value( "${"+io.antmedia.datastore.db.DataStoreFactory.SETTINGS_DB_NAME+":#{null}}" )
	private String dbName;
	
	@Value( "${"+io.antmedia.datastore.db.DataStoreFactory.SETTINGS_DB_TYPE+":#{null}}" )
	private String dbType;
	
	@Value( "${"+io.antmedia.datastore.db.DataStoreFactory.SETTINGS_DB_HOST+":#{null}}" )
	private String dbHost;
	
	@Value( "${"+io.antmedia.datastore.db.DataStoreFactory.SETTINGS_DB_USER+":#{null}}" )
	private String dbUser;
	
	@Value( "${"+io.antmedia.datastore.db.DataStoreFactory.SETTINGS_DB_PASS+":#{null}}" )
	private String dbPassword;
	
	public String getAppName() {
		return appName;
	}

	public void setAppName(String appName) {
		this.appName = appName;
	}

	public String getDbName() {
		return dbName;
	}

	public void setDbName(String dbName) {
		this.dbName = dbName;
	}

	public String getDbType() {
		return dbType;
	}

	public void setDbType(String dbType) {
		this.dbType = dbType;
	}

	public String getDbHost() {
		return dbHost;
	}

	public void setDbHost(String dbHost) {
		this.dbHost = dbHost;
	}

	public String getDbUser() {
		return dbUser;
	}

	public void setDbUser(String dbUser) {
		this.dbUser = dbUser;
	}

	public String getDbPassword() {
		return dbPassword;
	}

	public void setDbPassword(String dbPassword) {
		this.dbPassword = dbPassword;
	}

	public AbstractConsoleDataStore getDataStore() {
		if (dataStore == null) {
			if(dbType.contentEquals("mongodb"))
			{
				
				dataStore = new MongoStore(dbHost, dbUser, dbPassword);
			}
			else if(dbType.contentEquals("mapdb"))
			{
				dataStore = new MapDBStore();
			}
		}
		return dataStore;
	}

}
	




© 2015 - 2024 Weber Informatics LLC | Privacy Policy