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
5fa4e769
Commit
5fa4e769
authored
7 years ago
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added null check
parent
0c872925
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
14 deletions
+24
-14
ConfigurationService.java
...ava/nl/uva/sne/drip/api/service/ConfigurationService.java
+3
-0
ProvisionService.java
...in/java/nl/uva/sne/drip/api/service/ProvisionService.java
+14
-12
ConfigurationController.java
.../nl/uva/sne/drip/api/v1/rest/ConfigurationController.java
+7
-2
No files found.
drip-api/src/main/java/nl/uva/sne/drip/api/service/ConfigurationService.java
View file @
5fa4e769
...
@@ -89,6 +89,9 @@ public class ConfigurationService {
...
@@ -89,6 +89,9 @@ public class ConfigurationService {
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
@PostAuthorize
(
"(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))"
)
public
ConfigurationRepresentation
delete
(
String
id
)
{
public
ConfigurationRepresentation
delete
(
String
id
)
{
ConfigurationRepresentation
tr
=
dao
.
findOne
(
id
);
ConfigurationRepresentation
tr
=
dao
.
findOne
(
id
);
if
(
tr
==
null
){
throw
new
NotFoundException
();
}
dao
.
delete
(
tr
);
dao
.
delete
(
tr
);
return
tr
;
return
tr
;
}
}
...
...
This diff is collapsed.
Click to expand it.
drip-api/src/main/java/nl/uva/sne/drip/api/service/ProvisionService.java
View file @
5fa4e769
...
@@ -250,6 +250,7 @@ public class ProvisionService {
...
@@ -250,6 +250,7 @@ public class ProvisionService {
parameters
.
add
(
topology
);
parameters
.
add
(
topology
);
Set
<
String
>
ids
=
plan
.
getLoweLevelPlanIDs
();
Set
<
String
>
ids
=
plan
.
getLoweLevelPlanIDs
();
if
(
ids
!=
null
)
{
for
(
String
lowID
:
ids
)
{
for
(
String
lowID
:
ids
)
{
PlanResponse
lowPlan
=
planService
.
getDao
().
findOne
(
lowID
);
PlanResponse
lowPlan
=
planService
.
getDao
().
findOne
(
lowID
);
topology
=
new
MessageParameter
();
topology
=
new
MessageParameter
();
...
@@ -263,6 +264,7 @@ public class ProvisionService {
...
@@ -263,6 +264,7 @@ public class ProvisionService {
topology
.
setAttributes
(
attributes
);
topology
.
setAttributes
(
attributes
);
parameters
.
add
(
topology
);
parameters
.
add
(
topology
);
}
}
}
return
parameters
;
return
parameters
;
}
}
...
...
This diff is collapsed.
Click to expand it.
drip-api/src/main/java/nl/uva/sne/drip/api/v1/rest/ConfigurationController.java
View file @
5fa4e769
...
@@ -135,11 +135,16 @@ public class ConfigurationController {
...
@@ -135,11 +135,16 @@ public class ConfigurationController {
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
@StatusCodes
({
@StatusCodes
({
@ResponseCode
(
code
=
200
,
condition
=
"Successful delete"
)
@ResponseCode
(
code
=
200
,
condition
=
"Successful delete"
),
@ResponseCode
(
code
=
404
,
condition
=
"Object not found"
)
})
})
public
@ResponseBody
public
@ResponseBody
String
delete
(
@PathVariable
(
"id"
)
String
id
)
{
String
delete
(
@PathVariable
(
"id"
)
String
id
)
{
try
{
configurationService
.
delete
(
id
);
configurationService
.
delete
(
id
);
}
catch
(
NotFoundException
ex
)
{
throw
ex
;
}
return
"Deleted : "
+
id
;
return
"Deleted : "
+
id
;
}
}
...
...
This diff is collapsed.
Click to expand it.
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