CollOracle.java
6.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
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();
}
}