package com.platform.entities;

import java.util.Properties;

import com.platform.utils.ConfigPropertyReader;
import com.platform.utils.Configs;

public class OracleConnectorParams {
	
	private String dataId;
	private String port;
	private String ip;
	private String name;
	private String user;
	private String password;
	private String databaseName;
	
	public OracleConnectorParams() {
		// TODO Auto-generated constructor stub
		maybeInit();
	}

	public OracleConnectorParams(String port, String ip, String name) {
		maybeInit();
		this.port = port;
		this.ip = ip;
		this.name = name;
	}

	public OracleConnectorParams(String port, String ip, String name,
			String user, String password, String database) {
		this.port = port;
		this.ip = ip;
		this.name = name;
		this.user = user;
		this.password = password;
		this.databaseName = database;
	}

	private void maybeInit() {
		Properties properties = ConfigPropertyReader.Builder(
				Configs.CONFIG_LOCALTION).getProperties();
		this.user = properties.getProperty("collect-user-name");
		this.password = properties.getProperty("collect-password");
		this.databaseName = properties.getProperty("collect-service-name");
	}

	/**
	 * @return the dataId
	 */
	public String getDataId() {
		return dataId;
	}

	/**
	 * @param dataId the dataId to set
	 */
	public void setDataId(String dataId) {
		this.dataId = dataId;
	}

	public String getPort() {
		return port;
	}

	public void setPort(String port) {
		this.port = port;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getDatabaseName() {
		return databaseName;
	}

	public void setDatabaseName(String databaseName) {
		this.databaseName = databaseName;
	}
}
