CollOracle.java 6.25 KB
package com.sitech.ismp.coll;

import com.sitech.ismp.coll.basic.TblATO_KPIDETAIL;
import com.sitech.util.JSONUtil;
import org.apache.log4j.Logger;

import java.util.HashMap;
import java.util.Scanner;
import java.util.Vector;

public class CollOracle implements CollOracleMBean {
    private Logger logger = Logger.getLogger(CollOracle.class);

	@Override
	public Vector<TblATO_KPIDETAIL> getCMStandKPI(HashMap<String, String> params) {
		try {
			CollOracleBySql collector = new CollOracleBySql();
			return collector.getCMStandKPI(params);
		} catch (Exception e) {
			logger.error("Exception while getCMStandKPI", e);
			return new Vector<TblATO_KPIDETAIL>();
		}
	}

	@Override
	public Vector<TblATO_KPIDETAIL> getDataFile(HashMap<String, String> params) {
		try {
			CollOracleBySql collector = new CollOracleBySql();
			return collector.getDataFile(params);
		} catch (Exception e) {
			logger.error("Exception while getDataFile", e);
			return new Vector<TblATO_KPIDETAIL>();
		}
	}

	@Override
	public Vector<TblATO_KPIDETAIL> getExtendKPI(HashMap<String, String> params) {
		try {
			return  new CollOracleBySql().getExtendKPI(params);
		} catch (Exception e) {
			throw new RuntimeException("Exception while getExtendKPI,params=" + JSONUtil.toJSON(params), e);
		}
	}

    //全库数据量 CM-00-03-006-02 单位G  1个月一次
    public Vector<TblATO_KPIDETAIL> getTotalData(HashMap<String, String> params) {
        try {
            return  new CollOracleBySql().getTotalData(params);
        } catch (Exception e) {
            throw new RuntimeException("Exception while getTotalData,params=" + JSONUtil.toJSON(params), e);
        }
    }

//    //数据库Headroom时间 PM-00-03-009-10   ASM归档磁盘组  PM-00-03-001-05
//    public Vector<TblATO_KPIDETAIL> getAsmHeadroom(HashMap<String, String> params) {
//        try {
//            return  new CollOracleBySql().getAsmHeadroom(params);
//        } catch (Exception e) {
//            throw new RuntimeException("Exception while getAsmHeadroom,params=" + JSONUtil.toJSON(params), e);
//        }
//    }

    // 数据库Headroom时间 PM-00-03-009-10
    public Vector<TblATO_KPIDETAIL> getHeadroom(HashMap<String,String> params) {
        try {
            return  new CollOracleBySql().getHeadroom(params);
        } catch (Exception e) {
            throw new RuntimeException("Exception while getHeadroom,params=" + JSONUtil.toJSON(params), e);
        }
    }

    // ASM归档磁盘组  PM-00-03-001-05
    public Vector<TblATO_KPIDETAIL> getAsmDiskGroup(HashMap<String,String> params) {
        try {
            return  new CollOracleBySql().getAsmDiskGroup(params);
        } catch (Exception e) {
            throw new RuntimeException("Exception while getAsmDiskGroup,params=" + JSONUtil.toJSON(params), e);
        }
    }

    public Vector<TblATO_KPIDETAIL> getPMExtendKPI(HashMap<String, String> params) {
        try {
            return  new CollOracleBySql().getPMExtendKPI(params);
        } catch (Exception e) {
            throw new RuntimeException("Exception while getPMExtendKPI,params=" + JSONUtil.toJSON(params), e);
        }
    }

    @Override
    public Vector<TblATO_KPIDETAIL> getSessionWait(HashMap<String, String> params) {
        try {
            return  new CollOracleBySql().getSessionWait(params);
        } catch (Exception e) {
            throw new RuntimeException("Exception while getSessionWait,params=" + JSONUtil.toJSON(params), e);
        }
    }

    /**
     * 获取数据库所在主机的ping状态
     * @param params
     * @return
     */
    @Override
    public Vector<TblATO_KPIDETAIL> getPingStatus(HashMap<String, String> params) {
        try {
            CollOracleBySql collector = new CollOracleBySql();
            return collector.getPingStatus(params);
        } catch (Exception e) {
            logger.error("Exception while getPingStatus", e);
            return new Vector<TblATO_KPIDETAIL>();
        }
    }

    @Override
	public Vector<TblATO_KPIDETAIL> getSpecialTable(
			HashMap<String, String> params) {
		try {
			CollOracleBySql collector = new CollOracleBySql();
			return collector.getSpecialTable(params);
		} catch (Exception e) {
			logger.error("Exception while getSpecialTable", e);
			return new Vector<TblATO_KPIDETAIL>();
		}
	}

	@Override
	public Vector<TblATO_KPIDETAIL> getStatus(HashMap<String, String> params) {
		try {
			CollOracleBySql collector = new CollOracleBySql();
			return collector.getStatus(params);
		} catch (Exception e) {
			logger.error("Exception while getStatus", e);
			return new Vector<TblATO_KPIDETAIL>();
		}
	}

	@Override
	public Vector<TblATO_KPIDETAIL> getSystem(HashMap<String, String> params) {
		try {
			CollOracleBySql collector = new CollOracleBySql();
			return collector.getSystem(params);
		} catch (Exception e) {
			logger.error("Exception while getSystem", e);
			return new Vector<TblATO_KPIDETAIL>();
		}
	}

    @Override
    public Vector<TblATO_KPIDETAIL> getTableSpaces(HashMap<String, String> params) {
        try {
            CollOracleBySql collector = new CollOracleBySql();
            return collector.getTableSpaces(params);
        } catch (Exception e) {
            throw new RuntimeException("Exception while getTableSpaces, params=" + JSONUtil.toJSON(params), e);
        }
    }

    /**
     * 调整oracle数据库回滚段表空间的监控策略
     * add by mooker 2014-01-22
     * @param params
     * @return
     */
    @Override
    public Vector<TblATO_KPIDETAIL> getTableSpacesSpecial(HashMap<String, String> params) {
        try {
            CollOracleBySql collector = new CollOracleBySql();
            return collector.getTableSpacesSpecial(params);
        } catch (Exception e) {
            throw new RuntimeException("Exception while getTableSpacesSpecial, params=" + JSONUtil.toJSON(params), e);
        }
    }

	@Override
	public Vector<TblATO_KPIDETAIL> getUndoTableSpaces(
			HashMap<String, String> params) {
		try {
			CollOracleBySql collector = new CollOracleBySql();
			return collector.getUndoTableSpaces(params);
		} catch (Exception e) {
			logger.error("Exception while getUndoTableSpaces", e);
			return new Vector<TblATO_KPIDETAIL>();
		}
	}

    private static String read(String prompt) {
        Scanner scanner = new Scanner(System.in);
        System.out.print(prompt);
        return scanner.nextLine();
    }
	
}