2 * Copyright 2015 Samsung Electronics All Rights Reserved.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package oic.simulator.serviceprovider.utils;
19 import org.oic.simulator.server.SimulatorResource.AutoUpdateType;
22 * This class maintains all constants which are used throughout the service
25 public class Constants {
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";
33 public static final String CONFIG_DIRECTORY_PATH = "/resource";
35 public static final String UNDERSCORE = "_";
36 public static final String FORWARD_SLASH = "/";
38 public static final String OIC_PREFIX = "/oic/r";
39 public static final String SIMULATOR = "simulator";
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";
49 public static final String[] META_PROPERTIES = {
50 RESOURCE_NAME, RESOURCE_URI, RESOURCE_TYPE, INTERFACE_TYPES };
52 public static final int META_PROPERTY_COUNT = META_PROPERTIES.length;
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";
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)";
63 public static final String[] AUTOMATION_SETTINGS = {
64 AUTOMATION_TYPE, UPDATE_INTERVAL_IN_MS };
66 public static final int AUTOMATION_SETTINGS_COUNT = AUTOMATION_SETTINGS.length;
68 public static final String START_RESOURCE_AUTOMATION = "Start Automation";
69 public static final String STOP_RESOURCE_AUTOMATION = "Stop Automation";
71 public static final int DISPLAY_RESOURCE_URI_TOKEN_COUNT = 2;
73 public static final AutoUpdateType DEFAULT_AUTOMATION_TYPE = AutoUpdateType.ONE_TIME;
75 public static final int DEFAULT_AUTOMATION_INTERVAL = 500;
77 public static final int PROPER_LOG_TIME_TOKEN_LENGTH = 3;
79 public static final String[] BROWSE_RAML_FILTER_EXTENSIONS = new String[] { "*.raml" };
80 public static final String[] SAVE_LOG_FILTER_EXTENSIONS = new String[] {
83 public static final int LOG_SIZE = 1000;
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";
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";
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";
101 public static final String CREATE_PAGE_TITLE = "Create Resource";
102 public static final String CREATE_PAGE_MESSAGE = "Create a resource from RAML file";
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";
107 public static final String RAML_FILE_PREFIX = "/resource/";
109 public static final String RAML_FILE_EXTENSION = ".raml";
110 public static final String JSON_FILE_EXTENSION = ".json";
112 public static final String SPLIT_BY_DOT_PATTERN = "\\.";
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";
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";
133 public static final String SAMPLE_LIGHT = "sample.light";
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";
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)";
141 public static final String START_RESOURCE = "Start Resource";
142 public static final String STOP_RESOURCE = "Stop Resource";
144 public static final String DELETE_RESOURCE = "Delete Resource";
146 public static final String MAIN_PAGE_TITLE = "Create Resource";
147 public static final String MAIN_PAGE_MESSAGE = "Create a Simple resource";
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";
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";
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";
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";
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).";
168 public static final String INVALID_RESOURCE_TYPE_MESSAGE = "Resource Type should start with an alphabet.\n"
169 + "It should contain only lowercase alphabets, "
170 + "numbers(0-9), dot(.) and hyphen(-).";
172 public static final int TREE_EXPANSION_LEVEL = 10;
174 public static final String BASELINE_INTERFACE = "oic.if.baseline";
175 public static final String LINKS_LIST_INTERFACE = "oic.if.ll";
176 public static final String BATCH_INTERFACE = "oic.if.b";
177 public static final String LINK_BATCH_INTERFACE = "oic.if.lb";
178 public static final String READ_ONLY_INTERFACE = "oic.if.r";
179 public static final String READ_WRITE_INTERFACE = "oic.if.rw";
180 public static final String ACTUATOR_INTERFACE = "oic.if.a";
181 public static final String SENSOR_INTERFACE = "oic.if.s";
183 public static final String DEFAULT_SINGLE_RESOURCE_INTERFACE = "oic.if.baseline";
185 public static final int MAX_RESOURCE_COUNT = 200;