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
fb0fe2be
Commit
fb0fe2be
authored
Mar 20, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
typo
parent
7dfd001e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
25 additions
and
25 deletions
+25
-25
Constants.java
...rc/main/java/nl/uva/sne/drip/commons/utils/Constants.java
+1
-1
ToscaHelper.java
.../main/java/nl/uva/sne/drip/commons/utils/ToscaHelper.java
+1
-1
ToscaHelperTest.java
...t/java/nl/uva/sne/drip/commons/utils/ToscaHelperTest.java
+10
-10
DRIPService.java
...er/src/main/java/nl/uva/sne/drip/service/DRIPService.java
+1
-1
ProvisionerService.java
...main/java/nl/uva/sne/drip/service/ProvisionerService.java
+1
-1
ServiceTests.java
...r/src/test/java/nl/uva/sne/drip/service/ServiceTests.java
+3
-3
CloudStormService.java
...n/java/nl/uva/sne/drip/provisioner/CloudStormService.java
+7
-7
CloudStormServiceTest.java
...va/nl/uva/sne/drip/provisioner/CloudStormServiceTest.java
+1
-1
No files found.
commons/src/main/java/nl/uva/sne/drip/commons/utils/Consta
t
nts.java
→
commons/src/main/java/nl/uva/sne/drip/commons/utils/Constants.java
View file @
fb0fe2be
...
@@ -19,7 +19,7 @@ package nl.uva.sne.drip.commons.utils;
...
@@ -19,7 +19,7 @@ package nl.uva.sne.drip.commons.utils;
*
*
* @author S. Koulouzis
* @author S. Koulouzis
*/
*/
public
class
Consta
t
nts
{
public
class
Constants
{
public
static
final
String
VM_CAPABILITY
=
"tosca.capabilities.ARTICONF.VM"
;
public
static
final
String
VM_CAPABILITY
=
"tosca.capabilities.ARTICONF.VM"
;
public
static
final
String
VM_TYPE
=
"tosca.nodes.ARTICONF.VM.Compute"
;
public
static
final
String
VM_TYPE
=
"tosca.nodes.ARTICONF.VM.Compute"
;
...
...
commons/src/main/java/nl/uva/sne/drip/commons/utils/ToscaHelper.java
View file @
fb0fe2be
...
@@ -45,7 +45,7 @@ import org.apache.commons.io.FileUtils;
...
@@ -45,7 +45,7 @@ import org.apache.commons.io.FileUtils;
import
nl.uva.sne.drip.sure.tosca.client.ApiException
;
import
nl.uva.sne.drip.sure.tosca.client.ApiException
;
import
nl.uva.sne.drip.sure.tosca.client.Configuration
;
import
nl.uva.sne.drip.sure.tosca.client.Configuration
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
static
nl
.
uva
.
sne
.
drip
.
commons
.
utils
.
Consta
t
nts
.*;
import
static
nl
.
uva
.
sne
.
drip
.
commons
.
utils
.
Constants
.*;
import
nl.uva.sne.drip.model.cloud.storm.CloudsStormSubTopology.StatusEnum
;
import
nl.uva.sne.drip.model.cloud.storm.CloudsStormSubTopology.StatusEnum
;
import
nl.uva.sne.drip.model.cloud.storm.OpCode
;
import
nl.uva.sne.drip.model.cloud.storm.OpCode
;
...
...
commons/src/test/java/nl/uva/sne/drip/commons/utils/ToscaHelperTest.java
View file @
fb0fe2be
...
@@ -32,7 +32,7 @@ import java.util.HashMap;
...
@@ -32,7 +32,7 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Properties
;
import
java.util.Properties
;
import
static
nl
.
uva
.
sne
.
drip
.
commons
.
utils
.
Consta
t
nts
.*;
import
static
nl
.
uva
.
sne
.
drip
.
commons
.
utils
.
Constants
.*;
import
nl.uva.sne.drip.model.NodeTemplate
;
import
nl.uva.sne.drip.model.NodeTemplate
;
import
nl.uva.sne.drip.model.NodeTemplateMap
;
import
nl.uva.sne.drip.model.NodeTemplateMap
;
import
nl.uva.sne.drip.model.Provisioner
;
import
nl.uva.sne.drip.model.Provisioner
;
...
@@ -453,7 +453,7 @@ public class ToscaHelperTest {
...
@@ -453,7 +453,7 @@ public class ToscaHelperTest {
public
void
testCloudStormStatus2NodeState
()
{
public
void
testCloudStormStatus2NodeState
()
{
System
.
out
.
println
(
"cloudStormStatus2NodeState"
);
System
.
out
.
println
(
"cloudStormStatus2NodeState"
);
for
(
CloudsStormSubTopology
.
StatusEnum
value
:
CloudsStormSubTopology
.
StatusEnum
.
values
())
{
for
(
CloudsStormSubTopology
.
StatusEnum
value
:
CloudsStormSubTopology
.
StatusEnum
.
values
())
{
Consta
t
nts
.
NODE_STATES
result
=
ToscaHelper
.
cloudStormStatus2NodeState
(
value
);
Constants
.
NODE_STATES
result
=
ToscaHelper
.
cloudStormStatus2NodeState
(
value
);
if
(
value
.
equals
(
CloudsStormSubTopology
.
StatusEnum
.
FRESH
))
{
if
(
value
.
equals
(
CloudsStormSubTopology
.
StatusEnum
.
FRESH
))
{
assertNull
(
result
);
assertNull
(
result
);
}
else
{
}
else
{
...
@@ -475,8 +475,8 @@ public class ToscaHelperTest {
...
@@ -475,8 +475,8 @@ public class ToscaHelperTest {
System
.
out
.
println
(
"getNodeCurrentState"
);
System
.
out
.
println
(
"getNodeCurrentState"
);
instance
.
uploadToscaTemplate
(
provisionedToscaTemplate
);
instance
.
uploadToscaTemplate
(
provisionedToscaTemplate
);
NodeTemplateMap
node
=
instance
.
getVMTopologyTemplates
().
get
(
0
);
NodeTemplateMap
node
=
instance
.
getVMTopologyTemplates
().
get
(
0
);
Consta
tnts
.
NODE_STATES
expResult
=
Constat
nts
.
NODE_STATES
.
RUNNING
;
Consta
nts
.
NODE_STATES
expResult
=
Consta
nts
.
NODE_STATES
.
RUNNING
;
Consta
t
nts
.
NODE_STATES
result
=
instance
.
getNodeCurrentState
(
node
);
Constants
.
NODE_STATES
result
=
instance
.
getNodeCurrentState
(
node
);
assertEquals
(
expResult
,
result
);
assertEquals
(
expResult
,
result
);
}
}
...
@@ -495,7 +495,7 @@ public class ToscaHelperTest {
...
@@ -495,7 +495,7 @@ public class ToscaHelperTest {
System
.
out
.
println
(
"setNodeCurrentState"
);
System
.
out
.
println
(
"setNodeCurrentState"
);
instance
.
uploadToscaTemplate
(
provisionedToscaTemplate
);
instance
.
uploadToscaTemplate
(
provisionedToscaTemplate
);
NodeTemplateMap
node
=
instance
.
getVMTopologyTemplates
().
get
(
0
);
NodeTemplateMap
node
=
instance
.
getVMTopologyTemplates
().
get
(
0
);
Consta
tnts
.
NODE_STATES
nodeState
=
Constat
nts
.
NODE_STATES
.
DELETED
;
Consta
nts
.
NODE_STATES
nodeState
=
Consta
nts
.
NODE_STATES
.
DELETED
;
NodeTemplateMap
result
=
instance
.
setNodeCurrentState
(
node
,
nodeState
);
NodeTemplateMap
result
=
instance
.
setNodeCurrentState
(
node
,
nodeState
);
assertEquals
(
instance
.
getNodeCurrentState
(
node
),
nodeState
);
assertEquals
(
instance
.
getNodeCurrentState
(
node
),
nodeState
);
...
@@ -511,22 +511,22 @@ public class ToscaHelperTest {
...
@@ -511,22 +511,22 @@ public class ToscaHelperTest {
@Test
@Test
public
void
testNodeDesiredState2CloudStormOperation
()
{
public
void
testNodeDesiredState2CloudStormOperation
()
{
System
.
out
.
println
(
"NodeDesiredState2CloudStormOperation"
);
System
.
out
.
println
(
"NodeDesiredState2CloudStormOperation"
);
Consta
tnts
.
NODE_STATES
nodeDesiredState
=
Constat
nts
.
NODE_STATES
.
RUNNING
;
Consta
nts
.
NODE_STATES
nodeDesiredState
=
Consta
nts
.
NODE_STATES
.
RUNNING
;
OpCode
.
OperationEnum
expResult
=
OpCode
.
OperationEnum
.
PROVISION
;
OpCode
.
OperationEnum
expResult
=
OpCode
.
OperationEnum
.
PROVISION
;
OpCode
.
OperationEnum
result
=
ToscaHelper
.
NodeDesiredState2CloudStormOperation
(
nodeDesiredState
);
OpCode
.
OperationEnum
result
=
ToscaHelper
.
NodeDesiredState2CloudStormOperation
(
nodeDesiredState
);
assertEquals
(
expResult
,
result
);
assertEquals
(
expResult
,
result
);
nodeDesiredState
=
Consta
t
nts
.
NODE_STATES
.
DELETED
;
nodeDesiredState
=
Constants
.
NODE_STATES
.
DELETED
;
expResult
=
OpCode
.
OperationEnum
.
DELETE
;
expResult
=
OpCode
.
OperationEnum
.
DELETE
;
result
=
ToscaHelper
.
NodeDesiredState2CloudStormOperation
(
nodeDesiredState
);
result
=
ToscaHelper
.
NodeDesiredState2CloudStormOperation
(
nodeDesiredState
);
assertEquals
(
expResult
,
result
);
assertEquals
(
expResult
,
result
);
nodeDesiredState
=
Consta
t
nts
.
NODE_STATES
.
STOPPED
;
nodeDesiredState
=
Constants
.
NODE_STATES
.
STOPPED
;
expResult
=
OpCode
.
OperationEnum
.
STOP
;
expResult
=
OpCode
.
OperationEnum
.
STOP
;
result
=
ToscaHelper
.
NodeDesiredState2CloudStormOperation
(
nodeDesiredState
);
result
=
ToscaHelper
.
NodeDesiredState2CloudStormOperation
(
nodeDesiredState
);
assertEquals
(
expResult
,
result
);
assertEquals
(
expResult
,
result
);
nodeDesiredState
=
Consta
t
nts
.
NODE_STATES
.
STARTED
;
nodeDesiredState
=
Constants
.
NODE_STATES
.
STARTED
;
expResult
=
OpCode
.
OperationEnum
.
START
;
expResult
=
OpCode
.
OperationEnum
.
START
;
result
=
ToscaHelper
.
NodeDesiredState2CloudStormOperation
(
nodeDesiredState
);
result
=
ToscaHelper
.
NodeDesiredState2CloudStormOperation
(
nodeDesiredState
);
assertEquals
(
expResult
,
result
);
assertEquals
(
expResult
,
result
);
...
@@ -539,7 +539,7 @@ public class ToscaHelperTest {
...
@@ -539,7 +539,7 @@ public class ToscaHelperTest {
@Test
@Test
public
void
testNodeCurrentState2CloudStormStatus
()
{
public
void
testNodeCurrentState2CloudStormStatus
()
{
System
.
out
.
println
(
"nodeCurrentState2CloudStormStatus"
);
System
.
out
.
println
(
"nodeCurrentState2CloudStormStatus"
);
Consta
tnts
.
NODE_STATES
currentState
=
Constat
nts
.
NODE_STATES
.
CONFIGURED
;
Consta
nts
.
NODE_STATES
currentState
=
Consta
nts
.
NODE_STATES
.
CONFIGURED
;
CloudsStormSubTopology
.
StatusEnum
expResult
=
null
;
CloudsStormSubTopology
.
StatusEnum
expResult
=
null
;
CloudsStormSubTopology
.
StatusEnum
result
=
ToscaHelper
.
nodeCurrentState2CloudStormStatus
(
currentState
);
CloudsStormSubTopology
.
StatusEnum
result
=
ToscaHelper
.
nodeCurrentState2CloudStormStatus
(
currentState
);
assertEquals
(
expResult
,
result
);
assertEquals
(
expResult
,
result
);
...
...
manager/src/main/java/nl/uva/sne/drip/service/DRIPService.java
View file @
fb0fe2be
...
@@ -13,7 +13,7 @@ import java.util.logging.Level;
...
@@ -13,7 +13,7 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
import
java.util.logging.Logger
;
import
nl.uva.sne.drip.api.NotFoundException
;
import
nl.uva.sne.drip.api.NotFoundException
;
import
nl.uva.sne.drip.commons.utils.ToscaHelper
;
import
nl.uva.sne.drip.commons.utils.ToscaHelper
;
import
nl.uva.sne.drip.commons.utils.Consta
t
nts.NODE_STATES
;
import
nl.uva.sne.drip.commons.utils.Constants.NODE_STATES
;
import
nl.uva.sne.drip.model.Exceptions.MissingCredentialsException
;
import
nl.uva.sne.drip.model.Exceptions.MissingCredentialsException
;
import
nl.uva.sne.drip.model.Exceptions.MissingVMTopologyException
;
import
nl.uva.sne.drip.model.Exceptions.MissingVMTopologyException
;
import
nl.uva.sne.drip.model.Exceptions.TypeExeption
;
import
nl.uva.sne.drip.model.Exceptions.TypeExeption
;
...
...
manager/src/main/java/nl/uva/sne/drip/service/ProvisionerService.java
View file @
fb0fe2be
...
@@ -7,7 +7,7 @@ package nl.uva.sne.drip.service;
...
@@ -7,7 +7,7 @@ package nl.uva.sne.drip.service;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
static
nl
.
uva
.
sne
.
drip
.
commons
.
utils
.
Consta
t
nts
.
CLOUD_STORM_INTERFACE
;
import
static
nl
.
uva
.
sne
.
drip
.
commons
.
utils
.
Constants
.
CLOUD_STORM_INTERFACE
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
nl.uva.sne.drip.model.Provisioner
;
import
nl.uva.sne.drip.model.Provisioner
;
...
...
manager/src/test/java/nl/uva/sne/drip/service/ServiceTests.java
View file @
fb0fe2be
...
@@ -39,8 +39,8 @@ import java.util.logging.Level;
...
@@ -39,8 +39,8 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
import
java.util.logging.Logger
;
import
nl.uva.sne.drip.Swagger2SpringBoot
;
import
nl.uva.sne.drip.Swagger2SpringBoot
;
import
nl.uva.sne.drip.api.NotFoundException
;
import
nl.uva.sne.drip.api.NotFoundException
;
import
nl.uva.sne.drip.commons.utils.Consta
t
nts
;
import
nl.uva.sne.drip.commons.utils.Constants
;
import
static
nl
.
uva
.
sne
.
drip
.
commons
.
utils
.
Consta
t
nts
.*;
import
static
nl
.
uva
.
sne
.
drip
.
commons
.
utils
.
Constants
.*;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
nl.uva.sne.drip.commons.utils.ToscaHelper
;
import
nl.uva.sne.drip.commons.utils.ToscaHelper
;
import
nl.uva.sne.drip.configuration.MongoConfig
;
import
nl.uva.sne.drip.configuration.MongoConfig
;
...
@@ -435,7 +435,7 @@ public class ServiceTests {
...
@@ -435,7 +435,7 @@ public class ServiceTests {
Assert
.
assertTrue
(
attributes
.
containsKey
(
"credential"
));
Assert
.
assertTrue
(
attributes
.
containsKey
(
"credential"
));
assertNotNull
(
attributes
.
get
(
"credential"
));
assertNotNull
(
attributes
.
get
(
"credential"
));
}
}
toscaTemplate
=
dripService
.
setDesieredSate
(
toscaTemplate
,
vmTopologies
,
Consta
t
nts
.
NODE_STATES
.
RUNNING
);
toscaTemplate
=
dripService
.
setDesieredSate
(
toscaTemplate
,
vmTopologies
,
Constants
.
NODE_STATES
.
RUNNING
);
Map
<
String
,
NodeTemplate
>
nodes
=
toscaTemplate
.
getTopologyTemplate
().
getNodeTemplates
();
Map
<
String
,
NodeTemplate
>
nodes
=
toscaTemplate
.
getTopologyTemplate
().
getNodeTemplates
();
Set
<
String
>
names
=
nodes
.
keySet
();
Set
<
String
>
names
=
nodes
.
keySet
();
for
(
String
name
:
names
)
{
for
(
String
name
:
names
)
{
...
...
provisioner/src/main/java/nl/uva/sne/drip/provisioner/CloudStormService.java
View file @
fb0fe2be
...
@@ -29,9 +29,9 @@ import java.util.Properties;
...
@@ -29,9 +29,9 @@ import java.util.Properties;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.logging.Level
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
java.util.logging.Logger
;
import
nl.uva.sne.drip.commons.utils.Consta
t
nts
;
import
nl.uva.sne.drip.commons.utils.Constants
;
import
static
nl
.
uva
.
sne
.
drip
.
commons
.
utils
.
Consta
t
nts
.
CLOUD_STORM_FILES_ZIP_SUXIF
;
import
static
nl
.
uva
.
sne
.
drip
.
commons
.
utils
.
Constants
.
CLOUD_STORM_FILES_ZIP_SUXIF
;
import
static
nl
.
uva
.
sne
.
drip
.
commons
.
utils
.
Consta
t
nts
.
ENCODED_FILE_DATATYPE
;
import
static
nl
.
uva
.
sne
.
drip
.
commons
.
utils
.
Constants
.
ENCODED_FILE_DATATYPE
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
nl.uva.sne.drip.commons.utils.ToscaHelper
;
import
nl.uva.sne.drip.commons.utils.ToscaHelper
;
import
static
nl
.
uva
.
sne
.
drip
.
commons
.
utils
.
ToscaHelper
.
cloudStormStatus2NodeState
;
import
static
nl
.
uva
.
sne
.
drip
.
commons
.
utils
.
ToscaHelper
.
cloudStormStatus2NodeState
;
...
@@ -206,8 +206,8 @@ class CloudStormService {
...
@@ -206,8 +206,8 @@ class CloudStormService {
cloudsStormSubTopology
.
setDomain
(
domain
);
cloudsStormSubTopology
.
setDomain
(
domain
);
cloudsStormSubTopology
.
setCloudProvider
(
provider
);
cloudsStormSubTopology
.
setCloudProvider
(
provider
);
cloudsStormSubTopology
.
setTopology
(
SUB_TOPOLOGY_NAME
+
i
);
cloudsStormSubTopology
.
setTopology
(
SUB_TOPOLOGY_NAME
+
i
);
Consta
t
nts
.
NODE_STATES
currentState
=
getHelper
().
getNodeCurrentState
(
nodeTemplateMap
);
Constants
.
NODE_STATES
currentState
=
getHelper
().
getNodeCurrentState
(
nodeTemplateMap
);
Consta
t
nts
.
NODE_STATES
desiredState
=
getHelper
().
getNodeDesiredState
(
nodeTemplateMap
);
Constants
.
NODE_STATES
desiredState
=
getHelper
().
getNodeDesiredState
(
nodeTemplateMap
);
cloudsStormSubTopology
.
setStatus
(
ToscaHelper
.
nodeCurrentState2CloudStormStatus
(
currentState
));
cloudsStormSubTopology
.
setStatus
(
ToscaHelper
.
nodeCurrentState2CloudStormStatus
(
currentState
));
CloudsStormVMs
cloudsStormVMs
=
new
CloudsStormVMs
();
CloudsStormVMs
cloudsStormVMs
=
new
CloudsStormVMs
();
...
@@ -320,8 +320,8 @@ class CloudStormService {
...
@@ -320,8 +320,8 @@ class CloudStormService {
int
i
=
0
;
int
i
=
0
;
List
<
InfrasCode
>
infrasCodes
=
new
ArrayList
<>();
List
<
InfrasCode
>
infrasCodes
=
new
ArrayList
<>();
for
(
NodeTemplateMap
vmTopologyMap
:
vmTopologiesMaps
)
{
for
(
NodeTemplateMap
vmTopologyMap
:
vmTopologiesMaps
)
{
Consta
t
nts
.
NODE_STATES
nodeCurrentState
=
getHelper
().
getNodeCurrentState
(
vmTopologyMap
);
Constants
.
NODE_STATES
nodeCurrentState
=
getHelper
().
getNodeCurrentState
(
vmTopologyMap
);
Consta
t
nts
.
NODE_STATES
nodeDesiredState
=
getHelper
().
getNodeDesiredState
(
vmTopologyMap
);
Constants
.
NODE_STATES
nodeDesiredState
=
getHelper
().
getNodeDesiredState
(
vmTopologyMap
);
//Can provision
//Can provision
Map
<
String
,
Object
>
provisionInterface
=
getHelper
().
getProvisionerInterfaceFromVMTopology
(
vmTopologyMap
);
Map
<
String
,
Object
>
provisionInterface
=
getHelper
().
getProvisionerInterfaceFromVMTopology
(
vmTopologyMap
);
...
...
provisioner/src/test/java/nl/uva/sne/drip/provisioner/CloudStormServiceTest.java
View file @
fb0fe2be
...
@@ -19,7 +19,7 @@ import java.nio.file.Files;
...
@@ -19,7 +19,7 @@ import java.nio.file.Files;
import
java.nio.file.Paths
;
import
java.nio.file.Paths
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
static
nl
.
uva
.
sne
.
drip
.
commons
.
utils
.
Consta
t
nts
.
CLOUD_STORM_FILES_ZIP_SUXIF
;
import
static
nl
.
uva
.
sne
.
drip
.
commons
.
utils
.
Constants
.
CLOUD_STORM_FILES_ZIP_SUXIF
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
nl.uva.sne.drip.commons.utils.ToscaHelper
;
import
nl.uva.sne.drip.commons.utils.ToscaHelper
;
import
nl.uva.sne.drip.model.Message
;
import
nl.uva.sne.drip.model.Message
;
...
...
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