Bugg i hantering av gamla connection string formatet i OraMon
Showing
4 changed files
with
7 additions
and
7 deletions
No preview for this file type
... | @@ -53,7 +53,7 @@ public class OraMonRESTgetData extends HttpServlet { | ... | @@ -53,7 +53,7 @@ public class OraMonRESTgetData extends HttpServlet { |
53 | if(shortConArray.length != 2) { | 53 | if(shortConArray.length != 2) { |
54 | // Error, wrong format of string | 54 | // Error, wrong format of string |
55 | response.setStatus(HttpServletResponse.SC_BAD_REQUEST); | 55 | response.setStatus(HttpServletResponse.SC_BAD_REQUEST); |
56 | response.getWriter().println("{\"error\":true,\"msg\":\"connectionString needs to be in format jdbc:oracle:thin:@//host:port/sid with optional :username:password at the end.\"}"); | 56 | response.getWriter().println("{\"error\":true,\"msg\":\"connectionString needs to be in format jdbc:oracle:thin:@//host:port/servicename with optional :username:password at the end.\"}"); |
57 | return; | 57 | return; |
58 | } | 58 | } |
59 | String[] shortConArray2 = shortConArray[1].split(":"); | 59 | String[] shortConArray2 = shortConArray[1].split(":"); |
... | @@ -72,7 +72,7 @@ public class OraMonRESTgetData extends HttpServlet { | ... | @@ -72,7 +72,7 @@ public class OraMonRESTgetData extends HttpServlet { |
72 | } else { | 72 | } else { |
73 | // Wrong format | 73 | // Wrong format |
74 | response.setStatus(HttpServletResponse.SC_BAD_REQUEST); | 74 | response.setStatus(HttpServletResponse.SC_BAD_REQUEST); |
75 | response.getWriter().println("{\"error\":true,\"msg\":\"connectionString needs to be in format jdbc:oracle:thin:@//host:port/sid with optional :username:password at the end.\"}"); | 75 | response.getWriter().println("{\"error\":true,\"msg\":\"connectionString needs to be in format jdbc:oracle:thin:@//host:port/servicename with optional :username:password at the end.\"}"); |
76 | return; | 76 | return; |
77 | } | 77 | } |
78 | } else { | 78 | } else { |
... | @@ -98,7 +98,7 @@ public class OraMonRESTgetData extends HttpServlet { | ... | @@ -98,7 +98,7 @@ public class OraMonRESTgetData extends HttpServlet { |
98 | usrStr = conStrParamArray[2]; | 98 | usrStr = conStrParamArray[2]; |
99 | pwdStr = conStrParamArray[3]; | 99 | pwdStr = conStrParamArray[3]; |
100 | } else { | 100 | } else { |
101 | conStr = "jdbc:oracle:thin:@//" + conStrParamArray[0] + ":" + conStrParamArray[1] + ":" + conStrParamArray[2]; | 101 | conStr = "jdbc:oracle:thin:@" + conStrParamArray[0] + ":" + conStrParamArray[1] + ":" + conStrParamArray[2]; |
102 | usrStr = conStrParamArray[3]; | 102 | usrStr = conStrParamArray[3]; |
103 | pwdStr = conStrParamArray[4]; | 103 | pwdStr = conStrParamArray[4]; |
104 | } | 104 | } | ... | ... |
... | @@ -45,7 +45,7 @@ public class OraMonRESTgetMetrics extends HttpServlet { | ... | @@ -45,7 +45,7 @@ public class OraMonRESTgetMetrics extends HttpServlet { |
45 | if(shortConArray.length != 2) { | 45 | if(shortConArray.length != 2) { |
46 | // Error, wrong format of string | 46 | // Error, wrong format of string |
47 | response.setStatus(HttpServletResponse.SC_BAD_REQUEST); | 47 | response.setStatus(HttpServletResponse.SC_BAD_REQUEST); |
48 | response.getWriter().println("{\"error\":true,\"msg\":\"connectionString needs to be in format jdbc:oracle:thin:@//host:port/sid with optional :username:password at the end.\"}"); | 48 | response.getWriter().println("{\"error\":true,\"msg\":\"connectionString needs to be in format jdbc:oracle:thin:@//host:port/servicename with optional :username:password at the end.\"}"); |
49 | return; | 49 | return; |
50 | } | 50 | } |
51 | String[] shortConArray2 = shortConArray[1].split(":"); | 51 | String[] shortConArray2 = shortConArray[1].split(":"); |
... | @@ -68,7 +68,7 @@ public class OraMonRESTgetMetrics extends HttpServlet { | ... | @@ -68,7 +68,7 @@ public class OraMonRESTgetMetrics extends HttpServlet { |
68 | } else { | 68 | } else { |
69 | // Wrong format | 69 | // Wrong format |
70 | response.setStatus(HttpServletResponse.SC_BAD_REQUEST); | 70 | response.setStatus(HttpServletResponse.SC_BAD_REQUEST); |
71 | response.getWriter().println("{\"error\":true,\"msg\":\"connectionString needs to be in format jdbc:oracle:thin:@//host:port/sid with optional :username:password at the end.\"}"); | 71 | response.getWriter().println("{\"error\":true,\"msg\":\"connectionString needs to be in format jdbc:oracle:thin:@//host:port/servicename with optional :username:password at the end.\"}"); |
72 | return; | 72 | return; |
73 | } | 73 | } |
74 | } else { | 74 | } else { |
... | @@ -91,7 +91,7 @@ public class OraMonRESTgetMetrics extends HttpServlet { | ... | @@ -91,7 +91,7 @@ public class OraMonRESTgetMetrics extends HttpServlet { |
91 | if(serviceName) { | 91 | if(serviceName) { |
92 | conStr = "jdbc:oracle:thin:@//" + conStrParamArray[0] + ":" + conStrParamArray[1]; | 92 | conStr = "jdbc:oracle:thin:@//" + conStrParamArray[0] + ":" + conStrParamArray[1]; |
93 | } else { | 93 | } else { |
94 | conStr = "jdbc:oracle:thin:@//" + conStrParamArray[0] + ":" + conStrParamArray[1] + ":" + conStrParamArray[2]; | 94 | conStr = "jdbc:oracle:thin:@" + conStrParamArray[0] + ":" + conStrParamArray[1] + ":" + conStrParamArray[2]; |
95 | } | 95 | } |
96 | monitor = Registry.find(conStr); | 96 | monitor = Registry.find(conStr); |
97 | if(monitor == null) { | 97 | if(monitor == null) { | ... | ... |
... | @@ -34,7 +34,7 @@ class LongDelta { | ... | @@ -34,7 +34,7 @@ class LongDelta { |
34 | update(value, timestamp, false); | 34 | update(value, timestamp, false); |
35 | } | 35 | } |
36 | 36 | ||
37 | public void update(Long value, Timestamp timestamp, boolean convert) { | 37 | public void update(long value, Timestamp timestamp, boolean convert) { |
38 | if(convert) value = value/1000; | 38 | if(convert) value = value/1000; |
39 | if(urProt) { | 39 | if(urProt) { |
40 | if(this.curValue != null && this.curValue > value) { | 40 | if(this.curValue != null && this.curValue > value) { | ... | ... |
-
Please register or sign in to post a comment