Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
d321db54
Commit
d321db54
authored
Oct 18, 2017
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set the timestamps on all services
parent
c0f77bfa
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
45 additions
and
37 deletions
+45
-37
AnsibleOutputService.java
...ava/nl/uva/sne/drip/api/service/AnsibleOutputService.java
+4
-3
BenchmarkResultService.java
...a/nl/uva/sne/drip/api/service/BenchmarkResultService.java
+4
-3
CloudCredentialsService.java
.../nl/uva/sne/drip/api/service/CloudCredentialsService.java
+4
-4
ConfigurationService.java
...ava/nl/uva/sne/drip/api/service/ConfigurationService.java
+4
-3
DeployService.java
.../main/java/nl/uva/sne/drip/api/service/DeployService.java
+4
-3
KeyPairService.java
...main/java/nl/uva/sne/drip/api/service/KeyPairService.java
+4
-5
MonitorringMessageService.java
...l/uva/sne/drip/api/service/MonitorringMessageService.java
+4
-3
PlannerService.java
...main/java/nl/uva/sne/drip/api/service/PlannerService.java
+4
-3
ProvisionService.java
...in/java/nl/uva/sne/drip/api/service/ProvisionService.java
+5
-4
ScriptService.java
.../main/java/nl/uva/sne/drip/api/service/ScriptService.java
+4
-3
ToscaService.java
...c/main/java/nl/uva/sne/drip/api/service/ToscaService.java
+4
-3
No files found.
drip-api/src/main/java/nl/uva/sne/drip/api/service/AnsibleOutputService.java
View file @
d321db54
...
...
@@ -66,11 +66,12 @@ public class AnsibleOutputService {
return
ansibleOut
;
}
public
AnsibleOutput
save
(
AnsibleOutput
ansibleOu
t
)
{
public
AnsibleOutput
save
(
AnsibleOutput
ownedObjec
t
)
{
User
user
=
(
User
)
SecurityContextHolder
.
getContext
().
getAuthentication
().
getPrincipal
();
String
owner
=
user
.
getUsername
();
ansibleOut
.
setOwner
(
owner
);
return
ansibleOutputDao
.
save
(
ansibleOut
);
ownedObject
.
setOwner
(
owner
);
ownedObject
.
setTimestamp
(
System
.
currentTimeMillis
());
return
ansibleOutputDao
.
save
(
ownedObject
);
}
@PostAuthorize
(
"(hasRole('ROLE_ADMIN'))"
)
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/BenchmarkResultService.java
View file @
d321db54
...
...
@@ -62,11 +62,12 @@ public class BenchmarkResultService {
return
benchmarkResult
;
}
public
BenchmarkResult
save
(
BenchmarkResult
benchmarkResul
t
)
{
public
BenchmarkResult
save
(
BenchmarkResult
ownedObjec
t
)
{
User
user
=
(
User
)
SecurityContextHolder
.
getContext
().
getAuthentication
().
getPrincipal
();
String
owner
=
user
.
getUsername
();
benchmarkResult
.
setOwner
(
owner
);
return
benchmarkResultDao
.
save
(
benchmarkResult
);
ownedObject
.
setOwner
(
owner
);
ownedObject
.
setTimestamp
(
System
.
currentTimeMillis
());
return
benchmarkResultDao
.
save
(
ownedObject
);
}
@PostAuthorize
(
"(hasRole('ROLE_ADMIN'))"
)
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/CloudCredentialsService.java
View file @
d321db54
...
...
@@ -39,12 +39,12 @@ public class CloudCredentialsService {
@Autowired
private
CloudCredentialsDao
dao
;
public
CloudCredentials
save
(
CloudCredentials
cloudCredentials
)
{
public
CloudCredentials
save
(
CloudCredentials
ownedObject
)
{
User
user
=
(
User
)
SecurityContextHolder
.
getContext
().
getAuthentication
().
getPrincipal
();
String
owner
=
user
.
getUsername
();
cloudCredentials
.
setOwner
(
owner
);
cloudCredentials
.
setTimestamp
(
System
.
currentTimeMillis
());
return
dao
.
save
(
cloudCredentials
);
ownedObject
.
setOwner
(
owner
);
ownedObject
.
setTimestamp
(
System
.
currentTimeMillis
());
return
dao
.
save
(
ownedObject
);
}
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/ConfigurationService.java
View file @
d321db54
...
...
@@ -105,11 +105,12 @@ public class ConfigurationService {
return
dao
.
findOne
(
id
);
}
private
ConfigurationRepresentation
save
(
ConfigurationRepresentation
t
)
{
private
ConfigurationRepresentation
save
(
ConfigurationRepresentation
ownedObjec
t
)
{
User
user
=
(
User
)
SecurityContextHolder
.
getContext
().
getAuthentication
().
getPrincipal
();
String
owner
=
user
.
getUsername
();
t
.
setOwner
(
owner
);
return
dao
.
save
(
t
);
ownedObject
.
setOwner
(
owner
);
ownedObject
.
setTimestamp
(
System
.
currentTimeMillis
());
return
dao
.
save
(
ownedObject
);
}
@PostAuthorize
(
"(hasRole('ROLE_ADMIN'))"
)
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/DeployService.java
View file @
d321db54
...
...
@@ -123,11 +123,12 @@ public class DeployService {
return
creds
;
}
public
DeployResponse
save
(
DeployResponse
clusterCred
)
{
public
DeployResponse
save
(
DeployResponse
ownedObject
)
{
User
user
=
(
User
)
SecurityContextHolder
.
getContext
().
getAuthentication
().
getPrincipal
();
String
owner
=
user
.
getUsername
();
clusterCred
.
setOwner
(
owner
);
return
deployDao
.
save
(
clusterCred
);
ownedObject
.
setOwner
(
owner
);
ownedObject
.
setTimestamp
(
System
.
currentTimeMillis
());
return
deployDao
.
save
(
ownedObject
);
}
public
DeployResponse
deploySoftware
(
DeployRequest
deployInfo
)
throws
Exception
{
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/KeyPairService.java
View file @
d321db54
...
...
@@ -15,10 +15,8 @@
*/
package
nl
.
uva
.
sne
.
drip
.
api
.
service
;
import
java.util.ArrayList
;
import
java.util.List
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.KeyPair
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.User
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PostAuthorize
;
...
...
@@ -59,11 +57,12 @@ public class KeyPairService {
return
k
;
}
public
KeyPair
save
(
KeyPair
keyPair
)
{
public
KeyPair
save
(
KeyPair
ownedObject
)
{
User
user
=
(
User
)
SecurityContextHolder
.
getContext
().
getAuthentication
().
getPrincipal
();
String
owner
=
user
.
getUsername
();
keyPair
.
setOwner
(
owner
);
return
dao
.
save
(
keyPair
);
ownedObject
.
setOwner
(
owner
);
ownedObject
.
setTimestamp
(
System
.
currentTimeMillis
());
return
dao
.
save
(
ownedObject
);
}
@PostAuthorize
(
"(hasRole('ROLE_ADMIN'))"
)
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/MonitorringMessageService.java
View file @
d321db54
...
...
@@ -64,10 +64,11 @@ public class MonitorringMessageService {
dao
.
deleteAll
();
}
public
MonitorringMessage
save
(
MonitorringMessage
message
)
{
public
MonitorringMessage
save
(
MonitorringMessage
ownedObject
)
{
User
user
=
(
User
)
SecurityContextHolder
.
getContext
().
getAuthentication
().
getPrincipal
();
String
owner
=
user
.
getUsername
();
message
.
setOwner
(
owner
);
return
dao
.
save
(
message
);
ownedObject
.
setOwner
(
owner
);
ownedObject
.
setTimestamp
(
System
.
currentTimeMillis
());
return
dao
.
save
(
ownedObject
);
}
}
drip-api/src/main/java/nl/uva/sne/drip/api/service/PlannerService.java
View file @
d321db54
...
...
@@ -191,11 +191,12 @@ public class PlannerService {
return
topLevel
;
}
public
PlanResponse
save
(
PlanResponse
plan
)
{
public
PlanResponse
save
(
PlanResponse
ownedObject
)
{
User
user
=
(
User
)
SecurityContextHolder
.
getContext
().
getAuthentication
().
getPrincipal
();
String
owner
=
user
.
getUsername
();
plan
.
setOwner
(
owner
);
return
planDao
.
save
(
plan
);
ownedObject
.
setOwner
(
owner
);
ownedObject
.
setTimestamp
(
System
.
currentTimeMillis
());
return
planDao
.
save
(
ownedObject
);
}
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/ProvisionService.java
View file @
d321db54
...
...
@@ -89,11 +89,12 @@ public class ProvisionService {
@Value
(
"${message.broker.host}"
)
private
String
messageBrokerHost
;
public
ProvisionResponse
save
(
ProvisionResponse
provision
)
{
public
ProvisionResponse
save
(
ProvisionResponse
ownedObject
)
{
User
user
=
(
User
)
SecurityContextHolder
.
getContext
().
getAuthentication
().
getPrincipal
();
String
owner
=
user
.
getUsername
();
provision
.
setOwner
(
owner
);
return
provisionDao
.
save
(
provision
);
ownedObject
.
setOwner
(
owner
);
ownedObject
.
setTimestamp
(
System
.
currentTimeMillis
());
return
provisionDao
.
save
(
ownedObject
);
}
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
...
...
@@ -487,7 +488,7 @@ public class ProvisionService {
cloudProvider
=
(
String
)
topology
.
get
(
"cloudProvider"
);
domain
=
(
String
)
topology
.
get
(
"domain"
);
scaleNameExists
=
true
;
}
else
if
(
topology
.
get
(
"tag"
).
equals
(
"scaled"
)
}
else
if
(
topology
.
get
(
"tag"
).
equals
(
"scaled"
)
&&
topology
.
get
(
"status"
).
equals
(
"running"
)
&&
topology
.
get
(
"copyOf"
).
equals
(
scaleName
))
{
currentNumOfInstances
++;
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/ScriptService.java
View file @
d321db54
...
...
@@ -38,11 +38,12 @@ public class ScriptService {
@Autowired
ScriptDao
dao
;
public
Script
save
(
Script
scrip
t
)
{
public
Script
save
(
Script
ownedObjec
t
)
{
User
user
=
(
User
)
SecurityContextHolder
.
getContext
().
getAuthentication
().
getPrincipal
();
String
owner
=
user
.
getUsername
();
script
.
setOwner
(
owner
);
return
dao
.
save
(
script
);
ownedObject
.
setOwner
(
owner
);
ownedObject
.
setTimestamp
(
System
.
currentTimeMillis
());
return
dao
.
save
(
ownedObject
);
}
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/ToscaService.java
View file @
d321db54
...
...
@@ -130,11 +130,12 @@ public class ToscaService {
return
tr
;
}
private
ToscaRepresentation
save
(
ToscaRepresentation
t
)
{
private
ToscaRepresentation
save
(
ToscaRepresentation
ownedObjec
t
)
{
User
user
=
(
User
)
SecurityContextHolder
.
getContext
().
getAuthentication
().
getPrincipal
();
String
owner
=
user
.
getUsername
();
t
.
setOwner
(
owner
);
return
dao
.
save
(
t
);
ownedObject
.
setOwner
(
owner
);
ownedObject
.
setTimestamp
(
System
.
currentTimeMillis
());
return
dao
.
save
(
ownedObject
);
}
@PostAuthorize
(
"(hasRole('ROLE_ADMIN'))"
)
...
...
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