Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97874405
ServerAppStandalone.java
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Jan 7, 01:21
Size
1 KB
Mime Type
text/x-c
Expires
Thu, Jan 9, 01:21 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23425123
Attached To
R3229 Genome Privacy - SHCS App
ServerAppStandalone.java
View Options
import
java.io.IOException
;
import
java.sql.SQLException
;
import
java.util.LinkedList
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
database.DBconnectorServer
;
import
database.DBconnectorServerStandalone
;
import
utils.ServerProperties
;
import
framework.RequestHandler
;
import
framework.reply.ReplyDecryptionRaw
;
import
framework.request.RequestDecryptionRaw
;
public
class
ServerAppStandalone
{
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
ServerAppStandalone
.
class
.
getName
());
public
static
void
main
(
String
[]
args
)
{
ServerProperties
props
=
new
ServerProperties
(
"config/config_server.fry.properties"
);
DBconnectorServer
connectServer
=
new
DBconnectorServer
(
props
.
getConfigSPU
());
DBconnectorServerStandalone
connect
=
new
DBconnectorServerStandalone
(
props
.
getConfigSPU
());
// fetch all requests
LinkedList
<
RequestDecryptionRaw
>
requests
=
null
;
try
{
requests
=
connect
.
getRequests
();
}
catch
(
SQLException
e
)
{
LOGGER
.
log
(
Level
.
SEVERE
,
null
,
e
);
}
if
(
requests
!=
null
)
{
// process requests
ReplyDecryptionRaw
[]
replies
=
new
ReplyDecryptionRaw
[
requests
.
size
()];
RequestHandler
handler
=
new
RequestHandler
(
connectServer
,
props
.
getCurve
());
for
(
int
i
=
0
;
i
<
requests
.
size
();
i
++)
{
RequestDecryptionRaw
rqt
=
requests
.
get
(
i
);
int
patientId
=
rqt
.
getPatientId
();
long
timestamp
=
rqt
.
getTimestamp
();
String
rqtSerial
=
rqt
.
getRequestSerialized
();
try
{
replies
[
i
]
=
handler
.
handleDecryptionRequestParsed
(
patientId
,
timestamp
,
rqtSerial
);
}
catch
(
SQLException
|
IOException
e
)
{
LOGGER
.
log
(
Level
.
SEVERE
,
e
.
getMessage
());
LOGGER
.
log
(
Level
.
SEVERE
,
null
,
e
);
replies
[
i
]
=
new
ReplyDecryptionRaw
(
rqt
.
getPatientId
(),
timestamp
,
""
);
}
}
// insert replies
try
{
connect
.
insertReplies
(
replies
);
}
catch
(
SQLException
e
)
{
LOGGER
.
log
(
Level
.
SEVERE
,
null
,
e
);
}
}
}
}
Event Timeline
Log In to Comment