cd4c52a26ea687b7141612b460f9cd9ff5d398d3
[platform/upstream/iotivity.git] / service / simulator / java / eclipse-plugin / ServiceProviderPlugin / src / oic / simulator / serviceprovider / utils / Constants.java
1 /*
2  * Copyright 2015 Samsung Electronics All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package oic.simulator.serviceprovider.utils;
18
19 import org.oic.simulator.server.SimulatorResource.AutoUpdateType;
20
21 /**
22  * This class maintains all constants which are used throughout the service
23  * provider plug-in.
24  */
25 public class Constants {
26
27     public static final String         INT                                        = "Int";
28     public static final String         DOUBLE                                     = "Double";
29     public static final String         BOOL                                       = "Boolean";
30     public static final String         STRING                                     = "String";
31     public static final String         UNKNOWN                                    = "Unknown";
32
33     public static final String         CONFIG_DIRECTORY_PATH                      = "/resource";
34
35     public static final String         UNDERSCORE                                 = "_";
36     public static final String         FORWARD_SLASH                              = "/";
37
38     public static final String         OIC_PREFIX                                 = "/oic/r";
39     public static final String         SIMULATOR                                  = "simulator";
40
41     public static final String         RESOURCE_URI                               = "Resource URI";
42     public static final String         RESOURCE_TYPE                              = "Resource Type";
43     public static final String         RESOURCE_TYPES                             = "Resource Types";
44     public static final String         RESOURCE_NAME                              = "Resource Name";
45     public static final String         RESOURCE_UID                               = "Resource ID";
46     public static final String         CONNECTIVITY_TYPE                          = "Connectivity Type";
47     public static final String         INTERFACE_TYPES                            = "Interface Types";
48
49     public static final String[]       META_PROPERTIES                            = {
50             RESOURCE_NAME, RESOURCE_URI, RESOURCE_TYPE, INTERFACE_TYPES          };
51
52     public static final int            META_PROPERTY_COUNT                        = META_PROPERTIES.length;
53
54     public static final String         ENABLE                                     = "Enable";
55     public static final String         DISABLE                                    = "Disable";
56     public static final String         ENABLED                                    = "Enabled";
57     public static final String         DISABLED                                   = "Disabled";
58
59     public static final String         AUTOMATION                                 = "Automation";
60     public static final String         AUTOMATION_TYPE                            = "Automation Type";
61     public static final String         UPDATE_INTERVAL_IN_MS                      = "Update Interval(ms)";
62
63     public static final String[]       AUTOMATION_SETTINGS                        = {
64             AUTOMATION_TYPE, UPDATE_INTERVAL_IN_MS                               };
65
66     public static final int            AUTOMATION_SETTINGS_COUNT                  = AUTOMATION_SETTINGS.length;
67
68     public static final String         START_RESOURCE_AUTOMATION                  = "Start Automation";
69     public static final String         STOP_RESOURCE_AUTOMATION                   = "Stop Automation";
70
71     public static final int            DISPLAY_RESOURCE_URI_TOKEN_COUNT           = 2;
72
73     public static final AutoUpdateType DEFAULT_AUTOMATION_TYPE                    = AutoUpdateType.ONE_TIME;
74
75     public static final int            DEFAULT_AUTOMATION_INTERVAL                = 500;
76
77     public static final int            PROPER_LOG_TIME_TOKEN_LENGTH               = 3;
78
79     public static final String[]       BROWSE_RAML_FILTER_EXTENSIONS              = new String[] { "*.raml" };
80     public static final String[]       SAVE_LOG_FILTER_EXTENSIONS                 = new String[] {
81             "*.log", "*"                                                         };
82
83     public static final int            LOG_SIZE                                   = 1000;
84
85     public static final String         INFO_LOG                                   = "info_log";
86     public static final String         WARNING_LOG                                = "warning_log";
87     public static final String         ERROR_LOG                                  = "error_log";
88     public static final String         DEBUG_LOG                                  = "debug_log";
89     public static final String         UNKNOWN_LOG                                = "unknown_log";
90
91     public static final String         INFO                                       = "Info";
92     public static final String         WARNING                                    = "Warning";
93     public static final String         ERROR                                      = "Error";
94     public static final String         DEBUG                                      = "Debug";
95
96     public static final String         CHECKED                                    = "Checked";
97     public static final String         UNCHECKED                                  = "Unchecked";
98     public static final String         NOTIFY_BUTTON_SELECTED                     = "Notify_Selected";
99     public static final String         NOTIFY_BUTTON_UNSELECTED                   = "Notify_Unselected";
100
101     public static final String         CREATE_PAGE_TITLE                          = "Create Resource";
102     public static final String         CREATE_PAGE_MESSAGE                        = "Create a resource from RAML file";
103
104     public static final String         DELETE_PAGE_TITLE                          = "Delete Resource";
105     public static final String         DELETE_PAGE_MESSAGE                        = "Select the resource(s) to be deleted";
106
107     public static final String         RAML_FILE_PREFIX                           = "/resource/";
108
109     public static final String         RAML_FILE_EXTENSION                        = ".raml";
110     public static final String         JSON_FILE_EXTENSION                        = ".json";
111
112     public static final String         SPLIT_BY_DOT_PATTERN                       = "\\.";
113
114     // Platform information
115     public static final String         PLATFORM_ID                                = "Id";
116     public static final String         PLATFORM_MANUFAC_NAME                      = "Manufacturer Name";
117     public static final String         PLATFORM_MANUFAC_URL                       = "Manufacturer URL";
118     public static final String         PLATFORM_MODEL_NO                          = "Model Number";
119     public static final String         PLATFORM_DATE_OF_MANUFAC                   = "Date of Manufacture";
120     public static final String         PLATFORM_VERSION                           = "Version";
121     public static final String         PLATFORM_OS_VERSION                        = "OS Version";
122     public static final String         PLATFORM_HARDWARE_VERSION                  = "HardWare Version";
123     public static final String         PLATFORM_FIRMWARE_VERSION                  = "Firmware Version";
124     public static final String         PLATFORM_SUPPORT_URL                       = "Support URL";
125     public static final String         PLATFORM_SYSTEM_TIME                       = "System Time";
126
127     // Device information
128     public static final String         DEVICE_NAME                                = "Device Name";
129     public static final String         DEVICE_ID                                  = "Device ID";
130     public static final String         DEVICE_SPEC_VERSION                        = "Spec Version";
131     public static final String         DEVICE_DMV                                 = "Data Model Version";
132
133     public static final String         SAMPLE_LIGHT                               = "sample.light";
134
135     public static final String         UPDATE_PROP_PAGE_TITLE                     = "Update Properties";
136     public static final String         UPDATE_PROP_PAGE_MESSAGE                   = "Update the default values of resource properties";
137
138     public static final String         START_STOP_PAGE_TITLE                      = "Start/Stop Resource";
139     public static final String         START_STOP_PAGE_MESSAGE                    = "This page allows to start or stop the created resource(s)";
140
141     public static final String         START_RESOURCE                             = "Start Resource";
142     public static final String         STOP_RESOURCE                              = "Stop Resource";
143
144     public static final String         DELETE_RESOURCE                            = "Delete Resource";
145
146     public static final String         MAIN_PAGE_TITLE                            = "Create Resource";
147     public static final String         MAIN_PAGE_MESSAGE                          = "Create a Simple resource";
148
149     public static final String         SIMPLE_PAGE_TITLE                          = "Create Simple Resource";
150     public static final String         SIMPLE_PAGE_MESSAGE                        = "Either manually or from RAML file";
151
152     public static final String         SIMPLE_RESOURCE_BASIC_DETAILS_PAGE_TITLE   = "Create Simple Resource(Step 1 of 3)";
153     public static final String         SIMPLE_RESOURCE_BASIC_DETAILS_PAGE_MESSAGE = "Fill basic details of the resource";
154
155     public static final String         SIMPLE_RESOURCE_ADD_ATTRIBUTE_PAGE_TITLE   = "Create Simple Resource(Step 2 of 3)";
156     public static final String         SIMPLE_RESOURCE_ADD_ATTRIBUTE_PAGE_MESSAGE = "Add attributes to the resource";
157
158     public static final String         SIMPLE_RESOURCE_OTHER_DETAILS_PAGE_TITLE   = "Create Simple Resource(Step 3 of 3)";
159     public static final String         SIMPLE_RESOURCE_OTHER_DETAILS_PAGE_MESSAGE = "Fill other details of the resource";
160
161     public static final String         SINGLE_RESOURCE                            = "Single Resource";
162     public static final String         INVALID_URI_MESSAGE                        = "Resource URI should start with a '/'."
163                                                                                           + "\nIt should be 2 to 63 chars long.\n"
164                                                                                           + "It should not contain # or ? or % or "
165                                                                                           + "consecutive '/' or '/./' or "
166                                                                                           + "'/..'(more than one dot following a slash).";
167     public static final int            TREE_EXPANSION_LEVEL                       = 10;
168
169     public static final String         BASELINE_INTERFACE                         = "oic.if.baseline";
170     public static final String         LINKS_LIST_INTERFACE                       = "oic.if.ll";
171     public static final String         BATCH_INTERFACE                            = "oic.if.b";
172     public static final String         LINK_BATCH_INTERFACE                       = "oic.if.lb";
173     public static final String         READ_ONLY_INTERFACE                        = "oic.if.r";
174     public static final String         READ_WRITE_INTERFACE                       = "oic.if.rw";
175     public static final String         ACTUATOR_INTERFACE                         = "oic.if.a";
176     public static final String         SENSOR_INTERFACE                           = "oic.if.s";
177
178     public static final String         DEFAULT_SINGLE_RESOURCE_INTERFACE          = "oic.if.baseline";
179
180     public static final int            MAX_RESOURCE_COUNT                         = 200;
181
182 }