Merge "Inherit from oparent"
[vfc/nfvo/wfengine.git] / winery / org.eclipse.winery.topologymodeler / src / main / java / org / eclipse / winery / topologymodeler / addons / topologycompleter / helper / Constants.java
1 /*******************************************************************************
2  * Copyright (c) 2013 Pascal Hirmer.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * and the Apache License 2.0 which both accompany this distribution,
6  * and are available at http://www.eclipse.org/legal/epl-v10.html
7  * and http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Contributors:
10  *    Pascal Hirmer - initial API and implementation
11  *******************************************************************************/
12
13 package org.eclipse.winery.topologymodeler.addons.topologycompleter.helper;
14
15 import javax.xml.namespace.QName;
16
17 import org.eclipse.winery.topologymodeler.addons.topologycompleter.topologycompletion.CompletionInterface;
18
19 /**
20  * This class contains several constants used by the completion add-on.
21  */
22 public class Constants {
23
24         /**
25          * Constant for the QName of the "deferred" type.
26          */
27         public static final QName DEFERRED_QNAME = new QName("http://www.opentosca.org", "deferred");
28
29         /**
30          * Constant for the QName of the "PlaceHolder" type.
31          */
32         public static final QName PLACE_HOLDER_QNAME = new QName("http://www.opentosca.org", "PlaceHolder");
33
34         /**
35          * Contains possible types of expandable place holders.
36          */
37         public enum PlaceHolders {
38                 WEBSERVER, DATABASE, OPERATINGSYSTEM, CLOUDPROVIDER;
39
40                 /**
41                  * Overwritten toString() method to return formatted strings.
42                  */
43                 public String toString() {
44
45                         switch (this) {
46                                 case WEBSERVER:
47                                         return "Webserver";
48                                 case DATABASE:
49                                         return "Database";
50                                 case OPERATINGSYSTEM:
51                                         return "OperatingSystem";
52                                 case CLOUDPROVIDER:
53                                         return "CloudProvider";
54                                 default:
55                                         return null;
56                         }
57                 }
58         }
59
60         /**
61          * The messages returned by the {@link CompletionInterface}
62          */
63         public enum CompletionMessages {
64                 TOPOLOGYCOMPLETE, USERINTERACTION, STEPBYSTEP, SUCCESS, USERTOPOLOGYSELECTION, FAILURE;
65
66                 /**
67                  * Overwritten toString() method to return formatted strings.
68                  */
69                 public String toString() {
70
71                         switch (this) {
72                                 case TOPOLOGYCOMPLETE:
73                                         return "topologyComplete";
74                                 case USERINTERACTION:
75                                         return "userInteraction";
76                                 case STEPBYSTEP:
77                                         return "stepByStep";
78                                 case SUCCESS:
79                                         return "success";
80                                 case USERTOPOLOGYSELECTION:
81                                         return "userTopologySelection";
82                                 case FAILURE:
83                                         return "failure";
84                                 default:
85                                         return null;
86                         }
87                 }
88         }
89 }