Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ipgallery
/
mde
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Registry
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b18d9b3e
authored
Mar 21, 2017
by
Adi Amir
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
publish startTime & endTime to public-safety
parent
4cdc3108
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
src/main/java/logic/GEManager.java
src/main/java/logic/GEManager.java
View file @
b18d9b3e
...
@@ -29,6 +29,7 @@ import java.io.InputStream;
...
@@ -29,6 +29,7 @@ import java.io.InputStream;
import
java.nio.file.Files
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.nio.file.Paths
;
import
java.text.DecimalFormat
;
import
java.util.Deque
;
import
java.util.Deque
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -239,10 +240,22 @@ public class GEManager {
...
@@ -239,10 +240,22 @@ public class GEManager {
logger
.
info
(
"getSensorDetails() activated. camId="
+
sensorId
);
logger
.
info
(
"getSensorDetails() activated. camId="
+
sensorId
);
// execute the request ...
// execute the request ...
// envType
String
envType
=
requestContext
.
getParameter
(
"envType"
);
String
envType
=
requestContext
.
getParameter
(
"envType"
);
Long
tsEndTime
=
System
.
currentTimeMillis
();
if
(
envType
==
null
)
Long
tsStartTime
=
tsEndTime
-
ONE_DAY_IN_MILLI_SECS
;
return
errorResponse
(
"missing mandatory parameter: envType"
);
req
=
buildSensorDetailsRequest
(
sensorId
,
envType
,
tsStartTime
,
tsEndTime
);
// endTime
String
endTime
=
requestContext
.
getParameter
(
"endTime"
);
//System.currentTimeMillis(); // 1486758673000L;
if
(
endTime
==
null
)
return
errorResponse
(
"missing mandatory parameter: endTime"
);
Long
tsEndTime
=
Long
.
parseLong
(
endTime
);
// start time
String
startTime
=
requestContext
.
getParameter
(
"startTime"
);
//tsEndTime - ONE_DAY_IN_MILLI_SECS; //1486755073000L;
if
(
startTime
==
null
)
return
errorResponse
(
"missing mandatory parameter: startTime"
);
Long
tsStartTime
=
Long
.
parseLong
(
startTime
);
req
=
buildSensorDetailsRequest
(
sensorId
,
envType
,
tsStartTime
,
tsEndTime
);
try
{
try
{
httpResp
=
httpClient
.
processRequest
(
req
);
httpResp
=
httpClient
.
processRequest
(
req
);
if
(
httpResp
.
getStatusCode
()
==
200
)
if
(
httpResp
.
getStatusCode
()
==
200
)
...
@@ -274,8 +287,8 @@ public class GEManager {
...
@@ -274,8 +287,8 @@ public class GEManager {
// query string
// query string
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
"eventType="
).
append
(
envType
).
append
(
"&"
)
sb
.
append
(
"eventType="
).
append
(
envType
).
append
(
"&"
)
.
append
(
"startTime="
).
append
(
1486755073000L
).
append
(
"&"
)
.
append
(
"startTime="
).
append
(
tsStartTime
).
append
(
"&"
)
.
append
(
"endTime="
).
append
(
1486758673000L
);
.
append
(
"endTime="
).
append
(
tsEndTime
);
String
queryStr
=
sb
.
toString
();
String
queryStr
=
sb
.
toString
();
request
.
setQueryString
(
queryStr
);
request
.
setQueryString
(
queryStr
);
request
.
addHeader
(
"Authorization"
,
"Bearer "
+
TOKEN
);
request
.
addHeader
(
"Authorization"
,
"Bearer "
+
TOKEN
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment