Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Instrument Control
NomadCommandSystem
Commits
c9be1dc8
Commit
c9be1dc8
authored
May 07, 2020
by
Locatelli
Browse files
Add function get the last time of e resource file.
parent
9c8e93d4
Changes
3
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
c9be1dc8
...
...
@@ -2,7 +2,7 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
fr.ill.ics
</groupId>
<artifactId>
nomadcommandsystem
</artifactId>
<version>
4.0.
7
</version>
<version>
4.0.
8-SNAPSHOT
</version>
<name>
NomadCommandSystem
</name>
<description>
Java bridge for the communication with the Nomad server
</description>
<scm>
...
...
@@ -66,7 +66,7 @@
<dependency>
<groupId>
fr.ill.ics
</groupId>
<artifactId>
cameo-api
</artifactId>
<version>
0.1.
6
</version>
<version>
0.1.
8
</version>
<exclusions>
<exclusion>
<groupId>
fr.ill.ics
</groupId>
...
...
@@ -77,7 +77,7 @@
<dependency>
<groupId>
fr.ill.ics
</groupId>
<artifactId>
cameo-com-jzmq
</artifactId>
<version>
0.0.
2
</version>
<version>
0.0.
3
</version>
</dependency>
</dependencies>
<build>
...
...
src/main/java/fr/ill/ics/bridge/ResourceManager.java
View file @
c9be1dc8
...
...
@@ -75,6 +75,9 @@ public class ResourceManager {
return
ServantManagerAccessor
.
getInstance
(
serverId
).
readResourceFile
(
controllerType
,
fileName
);
}
public
int
getResourceFileLastTime
(
String
controllerType
,
String
fileName
)
throws
ResourceNotFoundException
{
return
ServantManagerAccessor
.
getInstance
(
serverId
).
getResourceFileLastTime
(
controllerType
,
fileName
);
}
public
void
saveFile
(
String
fileName
,
String
content
,
int
fileType
,
boolean
addServerHome
)
{
CommandZoneAccessor
.
getInstance
(
serverId
).
saveFile
(
fileName
,
content
,
fileType
,
addServerHome
);
...
...
src/main/java/fr/ill/ics/nscclient/dataprovider/ServantManagerAccessor.java
View file @
c9be1dc8
...
...
@@ -883,6 +883,38 @@ public class ServantManagerAccessor {
}
}
public
synchronized
int
getResourceFileLastTime
(
String
resourceType
,
String
fileName
)
throws
ResourceNotFoundException
{
// Create the message type.
ServantManagerRequest
.
Message
type
=
ServantManagerRequest
.
Message
.
newBuilder
()
.
setType
(
ServantManagerRequest
.
Message
.
Type
.
GetResourceFileLastTime
)
.
build
();
// Create the request.
ServantManagerRequest
.
ReadResourceRequest
request
=
ServantManagerRequest
.
ReadResourceRequest
.
newBuilder
()
.
setType
(
resourceType
)
.
setFileName
(
fileName
)
.
build
();
servantManagerRequester
.
sendTwoParts
(
type
.
toByteArray
(),
request
.
toByteArray
());
try
{
Common
.
Int32Response
response
=
Common
.
Int32Response
.
parseFrom
(
servantManagerRequester
.
receive
());
if
(
response
.
hasError
())
{
throw
new
ResourceNotFoundException
(
fileName
);
}
return
response
.
getValue
();
}
catch
(
InvalidProtocolBufferException
e
)
{
LOGGER
.
logp
(
Level
.
WARNING
,
this
.
getClass
().
getName
(),
"getResourceFileInfo"
,
"error in parsing response"
);
}
throw
new
ResourceNotFoundException
(
fileName
);
}
public
synchronized
HashMap
<
String
,
String
>
getServantPropertiesValue
(
int
databaseID
,
int
servantID
)
{
// Create the message type.
...
...
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