Scroll History Alerts¶
查询最近三个月内的历史告警,第一次查询跟随机查询的方式类似,得到一个 pageToken,后续每一页都是根据 pageToken 来查询下一页。
请求格式¶
POST https://{apigw-address}/event-service/v2.1/history-alerts?action=scroll
请求参数(URI)¶
名称 |
位置(Path/Query) |
必需/可选 |
数据类型 |
描述 |
---|---|---|---|---|
orgId |
Query |
必需 |
String |
资产所属的组织 ID。如何获取 orgId 信息>> |
请求参数(Body)¶
名称 |
必需/可选 |
数据类型 |
描述 |
---|---|---|---|
modelId |
可选 |
String |
资产所属模型 ID。如何获取 modelId 信息>> |
assetId |
可选 |
String |
资产 ID。如何获取 assetId 信息>> |
measurepointsId |
可选 |
String |
资产测点 ID。如何获取测点(pointId)信息>> |
startOccurTime |
|
String |
查询起始时间,与 |
endOccurTime |
|
String |
查询结束时间,与 |
recoverStartTime |
可选 |
String |
查询起始时间,与 |
recoverEndTime |
可选 |
String |
查询起始时间,与 |
expression |
可选 |
String |
查询表达式,支持类 SQL 的查询。目前支持的逻辑运算是 and 和 or,查询的字段和对应的运算符清单如下。
|
scope |
可选 |
Scope 结构体 |
查询指定资产树或资产树上某资产节点下的告警,并指定是否返回被屏蔽的衍生告警。该参数不可与 rootAlert 参数同时使用。见 Scope 结构体>> |
rootAlert |
可选 |
RootAlert 结构体 |
查询被指定根源告警屏蔽的衍生告警。该参数不可与 scope 参数同时使用。见 RootAlert 结构体>> |
scroll |
必需 |
Scroll 结构体 |
翻页。只能按照 |
Scroll 结构体 ¶
名称 |
必需/可选 |
数据类型 |
描述 |
---|---|---|---|
pageSize |
|
Integer |
每页记录数,必须大于0。 |
pageToken |
|
String |
下一页的 token。 |
响应参数¶
名称 |
数据类型 |
描述 |
---|---|---|
data |
HistoryAlert 结构体数组 |
有关 HistoryAlert 结构体的定义。见 HistoryAlert 结构体>> |
sortedBy |
Sorters 结构体 |
分页排序方式,支持多个排序方式,顺序靠前的排序方式,优先级更高。见 Sorters 结构体>> |
pageToken |
String |
下一页的 token。 |
pageSize |
Integer |
每页记录数。 |
示例¶
请求示例¶
url: https://{apigw-address}/event-service/v2.1/history-alerts?action=scroll&orgId=yourOrgId
method: POST
requestBody:
{
"endOccurTime":"2020-11-15T00:00:00Z",
"startOccurTime":"2020-09-10T00:00:00Z",
"scroll":{
"pageSize":5
}
}
返回示例¶
{
"code":0,
"msg":"OK",
"requestId":"7b062dce-1c75-45d8-94f8-943d3ae57d80",
"data":{
"items":[
{
"eventId":"20201114544f397a1ed4e5d4e307b30596a73349",
"orgId":"o15475450989191",
"assetId":"device-8999",
"modelId":"modelId-99",
"modelIdPath":"/modelId-99",
"measurepointId":"device-8999:point-9",
"deviceStatus":null,
"hitRuleId":"ruleId-8999",
"value":"8999.0",
"occurTime":1605360260827,
"localOccurTime":"2020-12-17 23:48:55",
"createTime":1608248937673,
"updateTime":1608248937673,
"severityId":"ruleId-8999:severity-9",
"severityDesc":{
"defaultValue":"default",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"typeId":"ruleId-8999:type-99",
"typeDesc":{
"defaultValue":"default1",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"subTypeId":null,
"subTypeDesc":null,
"contentId":"ruleId-8999:content-8999",
"contentDesc":{
"defaultValue":"default2",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"eventType":2,
"tag":{
"tag1":"vvvvvv",
"tag2":"vvvvvv",
"tag3":"vvvvvv"
},
"ruleDesc":{
"defaultValue":"default-8999",
"i18nValue":{
"en_US":"english8999",
"zh_CN":"中文-8999"
}
},
"assetPath":[
"tree-99:/device-8999"
],
"maskedBy":null,
"recoverTime":1608248935537,
"recoverLocalTime":"2019-11-18 00:00:00",
"recoverReason":"performance"
},
{
"eventId":"20201114a2633d52450a04835d390fdcb36ceb99",
"orgId":"o15475450989191",
"assetId":"device-8998",
"modelId":"modelId-98",
"modelIdPath":"/modelId-98",
"measurepointId":"device-8998:point-8",
"deviceStatus":null,
"hitRuleId":"ruleId-8998",
"value":"8998.0",
"occurTime":1605360260826,
"localOccurTime":"2020-12-17 23:48:55",
"createTime":1608248937673,
"updateTime":1608248937673,
"severityId":"ruleId-8998:severity-8",
"severityDesc":{
"defaultValue":"default",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"typeId":"ruleId-8998:type-98",
"typeDesc":{
"defaultValue":"default1",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"subTypeId":null,
"subTypeDesc":null,
"contentId":"ruleId-8998:content-8998",
"contentDesc":{
"defaultValue":"default2",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"eventType":2,
"tag":{
"tag1":"vvvvvv",
"tag2":"vvvvvv",
"tag3":"vvvvvv"
},
"ruleDesc":{
"defaultValue":"default-8998",
"i18nValue":{
"en_US":"english8998",
"zh_CN":"中文-8998"
}
},
"assetPath":[
"tree-98:/device-8998"
],
"maskedBy":null,
"recoverTime":1608248935537,
"recoverLocalTime":"2019-11-18 00:00:00",
"recoverReason":"performance"
},
{
"eventId":"2020111476be05332ebfce5b1b226ee8dcdfcbd4",
"orgId":"o15475450989191",
"assetId":"device-8997",
"modelId":"modelId-97",
"modelIdPath":"/modelId-97",
"measurepointId":"device-8997:point-7",
"deviceStatus":null,
"hitRuleId":"ruleId-8997",
"value":"8997.0",
"occurTime":1605360260825,
"localOccurTime":"2020-12-17 23:48:55",
"createTime":1608248937673,
"updateTime":1608248937673,
"severityId":"ruleId-8997:severity-7",
"severityDesc":{
"defaultValue":"default",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"typeId":"ruleId-8997:type-97",
"typeDesc":{
"defaultValue":"default1",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"subTypeId":null,
"subTypeDesc":null,
"contentId":"ruleId-8997:content-8997",
"contentDesc":{
"defaultValue":"default2",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"eventType":2,
"tag":{
"tag1":"vvvvvv",
"tag2":"vvvvvv",
"tag3":"vvvvvv"
},
"ruleDesc":{
"defaultValue":"default-8997",
"i18nValue":{
"en_US":"english8997",
"zh_CN":"中文-8997"
}
},
"assetPath":[
"tree-97:/device-8997"
],
"maskedBy":null,
"recoverTime":1608248935536,
"recoverLocalTime":"2019-11-18 00:00:00",
"recoverReason":"performance"
},
{
"eventId":"2020111488875dea7dc454a779cd7b474226525d",
"orgId":"o15475450989191",
"assetId":"device-8996",
"modelId":"modelId-96",
"modelIdPath":"/modelId-96",
"measurepointId":"device-8996:point-6",
"deviceStatus":null,
"hitRuleId":"ruleId-8996",
"value":"8996.0",
"occurTime":1605360260824,
"localOccurTime":"2020-12-17 23:48:55",
"createTime":1608248937673,
"updateTime":1608248937673,
"severityId":"ruleId-8996:severity-6",
"severityDesc":{
"defaultValue":"default",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"typeId":"ruleId-8996:type-96",
"typeDesc":{
"defaultValue":"default1",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"subTypeId":null,
"subTypeDesc":null,
"contentId":"ruleId-8996:content-8996",
"contentDesc":{
"defaultValue":"default2",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"eventType":2,
"tag":{
"tag1":"vvvvvv",
"tag2":"vvvvvv",
"tag3":"vvvvvv"
},
"ruleDesc":{
"defaultValue":"default-8996",
"i18nValue":{
"en_US":"english8996",
"zh_CN":"中文-8996"
}
},
"assetPath":[
"tree-96:/device-8996"
],
"maskedBy":null,
"recoverTime":1608248935536,
"recoverLocalTime":"2019-11-18 00:00:00",
"recoverReason":"performance"
},
{
"eventId":"2020111437c5603b2d76895a6625a59728bef325",
"orgId":"o15475450989191",
"assetId":"device-8995",
"modelId":"modelId-95",
"modelIdPath":"/modelId-95",
"measurepointId":"device-8995:point-5",
"deviceStatus":null,
"hitRuleId":"ruleId-8995",
"value":"8995.0",
"occurTime":1605360260823,
"localOccurTime":"2020-12-17 23:48:55",
"createTime":1608248937673,
"updateTime":1608248937673,
"severityId":"ruleId-8995:severity-5",
"severityDesc":{
"defaultValue":"default",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"typeId":"ruleId-8995:type-95",
"typeDesc":{
"defaultValue":"default1",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"subTypeId":null,
"subTypeDesc":null,
"contentId":"ruleId-8995:content-8995",
"contentDesc":{
"defaultValue":"default2",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"eventType":2,
"tag":{
"tag1":"vvvvvv",
"tag2":"vvvvvv",
"tag3":"vvvvvv"
},
"ruleDesc":{
"defaultValue":"default-8995",
"i18nValue":{
"en_US":"english8995",
"zh_CN":"中文-8995"
}
},
"assetPath":[
"tree-95:/device-8995"
],
"maskedBy":null,
"recoverTime":1608248935536,
"recoverLocalTime":"2019-11-18 00:00:00",
"recoverReason":"performance"
}
],
"sortedBy":[
{
"field":"occurTime",
"order":"DESC"
},
{
"field":"eventId",
"order":"DESC"
}
],
"pageToken":"DnF1ZXJ5VGhlbkZldGNoJQAAAAAD-2cPFjdwdXpUdWdsVEktTW9TUFZfbl9nZXcAAAAAA-s7PRZ6cThReE4weFRwRzhwZ293Y21oNzB3AAAAAAPrOz4WenE4UXhOMHhUcEc4cGdvd2NtaDcwdwAAAAAD-2cSFjdwdXpUdWdsVEktTW9TUFZfbl9nZXcAAAAAA-s7QBZ6cThReE4weFRwRzhwZ293Y21oNzB3AAAAAAP7ZxEWN3B1elR1Z2xUSS1Nb1NQVl9uX2dldwAAAAAD-2cTFjdwdXpUdWdsVEktTW9TUFZfbl9nZXcAAAAAA_tnEBY3cHV6VHVnbFRJLU1vU1BWX25fZ2V3AAAAAAOfARcWRXgtb0pOcktRUTJqQkRBUHl5UGVVUQAAAAAD-2cXFjdwdXpUdWdsVEktTW9TUFZfbl9nZXcAAAAAA-s7PxZ6cThReE4weFRwRzhwZ293Y21oNzB3AAAAAAP7ZxQWN3B1elR1Z2xUSS1Nb1NQVl9uX2dldwAAAAADnwEYFkV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2xUSS1Nb1NQVl9uX2dldwAAAAAD6ztGFnpxOFF4TjB4VHBHOHBnb3djbWg3MHcAAAAAA-s7RRZ6cThReE4weFRwRzhwZ293Y21oNzB3AAAAAAP7ZxkWN3B1elR1Z2xUSS1Nb1NQVl9uX2dldwAAAAADnwEdFkV4LW9KTnJLUVEyakJEQVB5eVBlVVEAAAAAA_tnGhY3cHV6VHVnbFRJLU1vU1BWX25fZ2V3AAAAAAOfAR4WRXgtb0pOcktRUTJqQkRBUHl5UGVVUQAAAAADnwEfFkV4LW9KTnJLUVEyakJEQVB5eVBlVVEAAAAAA-s7RxZ6cThReE4weFRwRzhwZ293Y21oNzB3AAAAAAPrO0gWenE4UXhOMHhUcEc4cGdvd2NtaDcwdwAAAAAD-2ccFjdwdXpUdWdsVEktTW9TUFZfbl9nZXcAAAAAA-s7SRZ6cThReE4weFRwRzhwZ293Y21oNzB3AAAAAAOfASAWRXgtb0pOcktRUTJqQkRBUHl5UGVVUQAAAAADnwEhFkV4LW9KTnJLUVEyakJEQVB5eVBlVVE="
}
}
翻下一页的返回结果¶
{
"code":0,
"msg":"OK",
"requestId":"d66c8f5b-5df2-42af-a644-1580aeff1a7c",
"data":{
"items":[
{
"eventId":"202011143ce0d9337de8af73f9ceb69bd6429597",
"orgId":"o15475450989191",
"assetId":"device-8994",
"modelId":"modelId-94",
"modelIdPath":"/modelId-94",
"measurepointId":"device-8994:point-4",
"deviceStatus":null,
"hitRuleId":"ruleId-8994",
"value":"8994.0",
"occurTime":1605360260822,
"localOccurTime":"2020-12-17 23:48:55",
"createTime":1608248937673,
"updateTime":1608248937673,
"severityId":"ruleId-8994:severity-4",
"severityDesc":{
"defaultValue":"default",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"typeId":"ruleId-8994:type-94",
"typeDesc":{
"defaultValue":"default1",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"subTypeId":null,
"subTypeDesc":null,
"contentId":"ruleId-8994:content-8994",
"contentDesc":{
"defaultValue":"default2",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"eventType":2,
"tag":{
"tag1":"vvvvvv",
"tag2":"vvvvvv",
"tag3":"vvvvvv"
},
"ruleDesc":{
"defaultValue":"default-8994",
"i18nValue":{
"en_US":"english8994",
"zh_CN":"中文-8994"
}
},
"assetPath":[
"tree-94:/device-8994"
],
"maskedBy":null,
"recoverTime":1608248935536,
"recoverLocalTime":"2019-11-18 00:00:00",
"recoverReason":"performance"
},
{
"eventId":"202011140785be50c976cd9e9b9dcb4b3654b1ac",
"orgId":"o15475450989191",
"assetId":"device-8993",
"modelId":"modelId-93",
"modelIdPath":"/modelId-93",
"measurepointId":"device-8993:point-3",
"deviceStatus":null,
"hitRuleId":"ruleId-8993",
"value":"8993.0",
"occurTime":1605360260821,
"localOccurTime":"2020-12-17 23:48:55",
"createTime":1608248937673,
"updateTime":1608248937673,
"severityId":"ruleId-8993:severity-3",
"severityDesc":{
"defaultValue":"default",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"typeId":"ruleId-8993:type-93",
"typeDesc":{
"defaultValue":"default1",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"subTypeId":null,
"subTypeDesc":null,
"contentId":"ruleId-8993:content-8993",
"contentDesc":{
"defaultValue":"default2",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"eventType":2,
"tag":{
"tag1":"vvvvvv",
"tag2":"vvvvvv",
"tag3":"vvvvvv"
},
"ruleDesc":{
"defaultValue":"default-8993",
"i18nValue":{
"en_US":"english8993",
"zh_CN":"中文-8993"
}
},
"assetPath":[
"tree-93:/device-8993"
],
"maskedBy":null,
"recoverTime":1608248935536,
"recoverLocalTime":"2019-11-18 00:00:00",
"recoverReason":"performance"
},
{
"eventId":"202011140593158501cb599efb5c146542260e5a",
"orgId":"o15475450989191",
"assetId":"device-8992",
"modelId":"modelId-92",
"modelIdPath":"/modelId-92",
"measurepointId":"device-8992:point-2",
"deviceStatus":null,
"hitRuleId":"ruleId-8992",
"value":"8992.0",
"occurTime":1605360260820,
"localOccurTime":"2020-12-17 23:48:55",
"createTime":1608248937673,
"updateTime":1608248937673,
"severityId":"ruleId-8992:severity-2",
"severityDesc":{
"defaultValue":"default",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"typeId":"ruleId-8992:type-92",
"typeDesc":{
"defaultValue":"default1",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"subTypeId":null,
"subTypeDesc":null,
"contentId":"ruleId-8992:content-8992",
"contentDesc":{
"defaultValue":"default2",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"eventType":2,
"tag":{
"tag1":"vvvvvv",
"tag2":"vvvvvv",
"tag3":"vvvvvv"
},
"ruleDesc":{
"defaultValue":"default-8992",
"i18nValue":{
"en_US":"english8992",
"zh_CN":"中文-8992"
}
},
"assetPath":[
"tree-92:/device-8992"
],
"maskedBy":null,
"recoverTime":1608248935535,
"recoverLocalTime":"2019-11-18 00:00:00",
"recoverReason":"performance"
},
{
"eventId":"202011144cc687134bc23615d2e4f7c3b2f2d318",
"orgId":"o15475450989191",
"assetId":"device-8991",
"modelId":"modelId-91",
"modelIdPath":"/modelId-91",
"measurepointId":"device-8991:point-1",
"deviceStatus":null,
"hitRuleId":"ruleId-8991",
"value":"8991.0",
"occurTime":1605360260819,
"localOccurTime":"2020-12-17 23:48:55",
"createTime":1608248937673,
"updateTime":1608248937673,
"severityId":"ruleId-8991:severity-1",
"severityDesc":{
"defaultValue":"default",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"typeId":"ruleId-8991:type-91",
"typeDesc":{
"defaultValue":"default1",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"subTypeId":null,
"subTypeDesc":null,
"contentId":"ruleId-8991:content-8991",
"contentDesc":{
"defaultValue":"default2",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"eventType":2,
"tag":{
"tag1":"vvvvvv",
"tag2":"vvvvvv",
"tag3":"vvvvvv"
},
"ruleDesc":{
"defaultValue":"default-8991",
"i18nValue":{
"en_US":"english8991",
"zh_CN":"中文-8991"
}
},
"assetPath":[
"tree-91:/device-8991"
],
"maskedBy":null,
"recoverTime":1608248935535,
"recoverLocalTime":"2019-11-18 00:00:00",
"recoverReason":"performance"
},
{
"eventId":"202011146d6cb76f813081f87a403cbcec868248",
"orgId":"o15475450989191",
"assetId":"device-8990",
"modelId":"modelId-90",
"modelIdPath":"/modelId-90",
"measurepointId":"device-8990:point-0",
"deviceStatus":null,
"hitRuleId":"ruleId-8990",
"value":"8990.0",
"occurTime":1605360260818,
"localOccurTime":"2020-12-17 23:48:55",
"createTime":1608248937609,
"updateTime":1608248937609,
"severityId":"ruleId-8990:severity-0",
"severityDesc":{
"defaultValue":"default",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"typeId":"ruleId-8990:type-90",
"typeDesc":{
"defaultValue":"default1",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"subTypeId":null,
"subTypeDesc":null,
"contentId":"ruleId-8990:content-8990",
"contentDesc":{
"defaultValue":"default2",
"i18nValue":{
"en_US":"english",
"zh_CN":"中文"
}
},
"eventType":2,
"tag":{
"tag1":"vvvvvv",
"tag2":"vvvvvv",
"tag3":"vvvvvv"
},
"ruleDesc":{
"defaultValue":"default-8990",
"i18nValue":{
"en_US":"english8990",
"zh_CN":"中文-8990"
}
},
"assetPath":[
"tree-90:/device-8990"
],
"maskedBy":null,
"recoverTime":1608248935535,
"recoverLocalTime":"2019-11-18 00:00:00",
"recoverReason":"performance"
}
],
"sortedBy":[
{
"field":"occurTime",
"order":"DESC"
},
{
"field":"eventId",
"order":"DESC"
}
],
"pageToken":"YjW7ZHK8QFxczrEctFJoPNAAAAAF-2cPFjdwdXpUdWdsVEktTW9TUFZfbl9nZXcAAAAAA-s7PRZ6cThReE4weFRwRzhwZ293Y21oNzB3AAAAAAPrOz4WenE4UXh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VEAAAAAA_tnGhY3cHV6VHVnbFRJLU1vU1BWX25fZ2V3AAAAAAOfAR4WRXgtb0pOcktRUTJqQkRBUHl5UGVVUQAAAAADnwEfFkV4LW9KTnJLUVEyakJEQVB5eVBlVVEAAAAAA-s7RxZ6cThReE4weFRwRzhwZ293Y21oNzB3AAAAAAPrO0gWenE4UXhOMHhUcEc4cGdvd2NtaDcwdwAAAAAD-2ccFjdwdXpUdWdsVEktTW9TUFZfbl9nZXcAAAAAA-s7SRZ6cThReE4weFRwRzhwZ293Y21oNzB3AAAAAAOfASAWRXgtb0pOcktRUTJqQkRBUHl5UGVVUQAAAAADnhEnFkV9LW3KTnULUVEpekTERVD2eSDlYYW=",
"pageSize":5
}
}
Java SDK 调用示例¶
public void testSearchHistoryAlerts(){
ScrollHistoryAlertRequest request = new ScrollHistoryAlertRequest();
request.setOrgId(orgId);
request.setStartOccurTime("2020-09-10T00:00:00Z");
request.setEndOccurTime("2020-11-15T00:00:00Z");
Scroll scroll = new Scroll();
scroll.setPageSize(5);
request.setScroll(scroll);
try {
long t1 = System.currentTimeMillis();
ScrollHistoryAlertResponse response = Poseidon.config(PConfig.init().appKey(appKey).appSecret(appSecret).debug())
.url(url)
.getResponse(request, ScrollHistoryAlertResponse.class);
for (HistoryAlert datum : response.getData().getItems()) {
System.out.println(datum.getEventId() + " " + datum.getLocalOccurTime());
}
ScrollHistoryAlertRequest request1 = new ScrollHistoryAlertRequest();
request1.setOrgId(orgId);
scroll = new Scroll(5, response.getData().getPageToken(),null);
request1.setScroll(scroll);
try {
ScrollHistoryAlertResponse response1 = Poseidon.config(PConfig.init().appKey(appKey).appSecret(appSecret).debug())
.url(url)
.getResponse(request1, ScrollHistoryAlertResponse.class);
for (HistoryAlert datum : response1.getData().getItems()) {
System.out.println(datum.getEventId() + " " + datum.getLocalOccurTime());
}
}catch(Exception e){
System.out.print(e);
}
}catch(Exception e){
System.out.print(e);
}
}