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
0722a521
Commit
0722a521
authored
Feb 28, 2017
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Null checks
parent
13ffcc8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
ProvisionController.java
...in/java/nl/uva/sne/drip/api/rest/ProvisionController.java
+10
-4
Converter.java
...rc/main/java/nl/uva/sne/drip/commons/utils/Converter.java
+4
-2
No files found.
drip-api/src/main/java/nl/uva/sne/drip/api/rest/ProvisionController.java
View file @
0722a521
...
@@ -124,11 +124,17 @@ public class ProvisionController {
...
@@ -124,11 +124,17 @@ public class ProvisionController {
List
<
Parameter
>
topologies
=
buildTopologyParams
(
pReq
.
getPlanID
());
List
<
Parameter
>
topologies
=
buildTopologyParams
(
pReq
.
getPlanID
());
parameters
.
addAll
(
topologies
);
parameters
.
addAll
(
topologies
);
List
<
Parameter
>
userScripts
=
buildScriptParams
(
pReq
.
getUserScriptID
());
String
scriptID
=
pReq
.
getUserScriptID
();
parameters
.
addAll
(
userScripts
);
if
(
scriptID
!=
null
)
{
List
<
Parameter
>
userScripts
=
buildScriptParams
(
scriptID
);
parameters
.
addAll
(
userScripts
);
}
List
<
Parameter
>
userKeys
=
buildKeysParams
(
pReq
.
getUserKeyID
());
String
userKeyID
=
pReq
.
getUserKeyID
();
parameters
.
addAll
(
userKeys
);
if
(
userKeyID
!=
null
)
{
List
<
Parameter
>
userKeys
=
buildKeysParams
(
userKeyID
);
parameters
.
addAll
(
userKeys
);
}
invokationMessage
.
setParameters
(
parameters
);
invokationMessage
.
setParameters
(
parameters
);
invokationMessage
.
setCreationDate
((
System
.
currentTimeMillis
()));
invokationMessage
.
setCreationDate
((
System
.
currentTimeMillis
()));
...
...
drip-commons/src/main/java/nl/uva/sne/drip/commons/utils/Converter.java
View file @
0722a521
...
@@ -57,7 +57,8 @@ public class Converter {
...
@@ -57,7 +57,8 @@ public class Converter {
public
static
String
map2YmlString
(
Map
<
String
,
Object
>
map
)
throws
JSONException
{
public
static
String
map2YmlString
(
Map
<
String
,
Object
>
map
)
throws
JSONException
{
JSONObject
jsonObject
=
new
JSONObject
(
map
);
JSONObject
jsonObject
=
new
JSONObject
(
map
);
return
json2Yml2
(
jsonObject
.
toString
());
String
yamlStr
=
json2Yml2
(
jsonObject
.
toString
());
return
yamlStr
;
}
}
public
static
String
map2JsonString
(
Map
<
String
,
Object
>
map
)
{
public
static
String
map2JsonString
(
Map
<
String
,
Object
>
map
)
{
...
@@ -105,7 +106,8 @@ public class Converter {
...
@@ -105,7 +106,8 @@ public class Converter {
public
static
String
json2Yml2
(
String
jsonString
)
throws
JSONException
{
public
static
String
json2Yml2
(
String
jsonString
)
throws
JSONException
{
Yaml
yaml
=
new
Yaml
();
Yaml
yaml
=
new
Yaml
();
return
yaml
.
dump
(
ymlString2Map
(
jsonString
));
String
yamlStr
=
yaml
.
dump
(
ymlString2Map
(
jsonString
));
return
yamlStr
;
}
}
public
static
Properties
Object2Properties
(
Object
obj
)
throws
JsonProcessingException
,
JSONException
{
public
static
Properties
Object2Properties
(
Object
obj
)
throws
JsonProcessingException
,
JSONException
{
...
...
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