Initial source code
[oam/tr069-adapter.git] / acs / common / src / main / java / org / commscope / tr069adapter / acs / common / utils / AcsConstants.java
diff --git a/acs/common/src/main/java/org/commscope/tr069adapter/acs/common/utils/AcsConstants.java b/acs/common/src/main/java/org/commscope/tr069adapter/acs/common/utils/AcsConstants.java
new file mode 100644 (file)
index 0000000..8eae37d
--- /dev/null
@@ -0,0 +1,111 @@
+/*\r
+ * ============LICENSE_START========================================================================\r
+ * ONAP : tr-069-adapter\r
+ * =================================================================================================\r
+ * Copyright (C) 2020 CommScope Inc Intellectual Property.\r
+ * =================================================================================================\r
+ * This tr-069-adapter software file is distributed by CommScope Inc under the Apache License,\r
+ * Version 2.0 (the "License"); you may not use this file except in compliance with the License. You\r
+ * may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\r
+ * either express or implied. See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ===============LICENSE_END=======================================================================\r
+ */\r
+\r
+package org.commscope.tr069adapter.acs.common.utils;\r
+\r
+public class AcsConstants {\r
+\r
+  private AcsConstants() {}\r
+\r
+  // CPE Management constants\r
+  public static final String INFORM = "Inform";\r
+  public static final String TRANSFER_COMPLETE = "TransferComplete";\r
+  public static final String ACS_SESSIONID = "JSESSIONID";\r
+  public static final String CWMP_VERSION = "CWMP_VERSION";\r
+\r
+  // JMS Queues and connection factory names\r
+  public static final String TR069_NBI_REQUEST_Q = "TR069NBIRequestQueue";\r
+  public static final String TR069_NBI_REQUEST_CF = "tr069NBIRequestCF";\r
+\r
+  public static final String CR_REQ_Q = "TR069DeviceResponseQueue";\r
+  public static final String CR_REQ_CF = "tr069DeviceResponseCF";\r
+\r
+  public static final String NBI_NOTIFICATION_Q = "NBINotificationQueue";\r
+  public static final String NBI_NOTIFICATION_CF = "nbiNotificationCF";\r
+\r
+  public static final String NBI_OP_RESULT_Q = "NBIOpResultQueue";\r
+  public static final String NBI_OP_RESULT_CF = "nbiOpResultCF";\r
+\r
+  // Mapper Service Constants\r
+  public static final String MAPPER_SERVICE_QUALILFIER = "mapper-service";\r
+\r
+  // TIMER ID Constants\r
+  public static final String CONNECTION_REQUEST = "CONNECTION_REQUEST"; // Constant used in\r
+                                                                        // building the TIMER ID\r
+  public static final String SEPERATOR = "_"; // Constant used in building the TIMER ID\r
+\r
+  // Connection Request (HTTP Get) constants\r
+  public static final long CONNECTION_RETRY_SLEEP_TIME = 10 * 1000L; // On Connection Request (HTTP\r
+                                                                     // GET) failure, thread will\r
+                                                                     // sleep for x seconds before\r
+                                                                     // retrying.\r
+  public static final Long CR_TIMEOUT = 10 * 1000L; // On Connection Request (HTTP GET) is\r
+                                                    // accepted by device, time to wait for '6\r
+                                                    // Connection Request' Inform to be sent by\r
+                                                    // device. If device does not send any inform\r
+                                                    // within the configured time, connection\r
+                                                    // request shall be retried\r
+  public static final String CR_TIMEOUT_CALLBACK = "ConnectionRequestTimeoutHandler"; // On\r
+                                                                                      // CR_TIMEOUT\r
+                                                                                      // case, the\r
+                                                                                      // callback\r
+                                                                                      // class to\r
+                                                                                      // be called\r
+  public static final int HTTP_OP_FAILED = 1;\r
+  public static final int MAX_CONNECT_RETRY_COUNT = 3; // Max retry count in case device is not\r
+                                                       // accpeting the Connection Request (HTTP\r
+                                                       // GET)\r
+  public static final int DEFAULT_CONNECTION_TIMEOUT = 1 * 10 * 1000; // HTTP GET TIMEOUT, the\r
+                                                                      // thread will be held for x\r
+                                                                      // secs while connecting to\r
+                                                                      // device\r
+  public static final int HTTP_STATUS_OK = 200;\r
+  public static final int HTTP_STATUS_OK_WITH_NO_CONTENT = 204;\r
+  public static final int HTTP_OP_SUCCESS = 0;\r
+  public static final Long HTTP_CONNECTION_IDLE_TIMEOUT = 5 * 1000L;\r
+\r
+  // Request Processor Retry and Delay constants\r
+  public static final Integer MAX_RETRY_LIMIT = 5; // Max retry count by request processor while\r
+                                                   // processing Informs and Device RPC Responses\r
+  public static final Long DELAY = 10000L; // A delay befoee retrying\r
+\r
+  // RPC Timer Execution Constants\r
+  public static final Long DEVICE_RPC_EXECUTION_TIMEOUT_SECONDS = 30L; // Timeout for the RPC,\r
+                                                                       // Timer starts after\r
+                                                                       // persisting the RPC. On\r
+                                                                       // timeout, timedout RPC\r
+                                                                       // response shall be sent\r
+                                                                       // to device\r
+  public static final Long DEVICE_RESPONSE_TIMEOUT = 30 * 1000L; // Session timeout, each session\r
+                                                                 // on moving to processing state\r
+                                                                 // will timeout after the\r
+                                                                 // configured value, will restart\r
+                                                                 // the timer if RPOC isn't\r
+                                                                 // timedout yet\r
+  public static final String SESSION_TIMEOUT_CALLBACK_JNDI = "SessionTimeoutHandler";\r
+  public static final String WAITING_FOR_DEVICE_RESPONSE = "WAITING_FOR_DEVICE_RESPONSE";\r
+  public static final String WAITING_FOR_NBI_RESPONSE = "WAITING_FOR_NBI_RESPONSE";\r
+\r
+  // Timeout operation status codes\r
+  public static final int OPERATION_EXPIRATION_TIMEOUT = 3;\r
+\r
+  // Custom function constants\r
+  public static final String SESSION_ID = "SESSION_ID";\r
+  public static final String NUMBER_REGEX = "[.][0-9]+[.]";\r
+  public static final String SUCCESS = "SUCCESS";\r
+}\r