aboutsummaryrefslogtreecommitdiffstats
path: root/common/src
diff options
context:
space:
mode:
Diffstat (limited to 'common/src')
-rw-r--r--common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerTaskRequest.java9
-rw-r--r--common/src/main/java/org/onap/so/client/exception/BadResponseException.java42
-rw-r--r--common/src/main/java/org/onap/so/client/exception/MapperException.java31
-rw-r--r--common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java22
4 files changed, 103 insertions, 1 deletions
diff --git a/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerTaskRequest.java b/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerTaskRequest.java
index c240957ae9..010e184618 100644
--- a/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerTaskRequest.java
+++ b/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerTaskRequest.java
@@ -11,6 +11,7 @@ public class ApplicationControllerTaskRequest implements Serializable {
private static final long serialVersionUID = -3150320542857627682L;
private Action action;
+ private String requestorId;
private String controllerType;
private String identityUrl;
private String operationsTimeout;
@@ -110,6 +111,14 @@ public class ApplicationControllerTaskRequest implements Serializable {
this.newSoftwareVersion = newSoftwareVersion;
}
+ public String getRequestorId() {
+ return requestorId;
+ }
+
+ public void setRequestorId(String requestorId) {
+ this.requestorId = requestorId;
+ }
+
}
diff --git a/common/src/main/java/org/onap/so/client/exception/BadResponseException.java b/common/src/main/java/org/onap/so/client/exception/BadResponseException.java
new file mode 100644
index 0000000000..7b1066d48c
--- /dev/null
+++ b/common/src/main/java/org/onap/so/client/exception/BadResponseException.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.client.exception;
+
+public class BadResponseException extends Exception {
+
+ String responseCode;
+
+ public BadResponseException() {}
+
+ public BadResponseException(String message) {
+ super(message);
+ }
+
+ public BadResponseException(String message, String responseCode) {
+ super(message);
+ this.responseCode = responseCode;
+ }
+
+ public String getResponseCode() {
+ return responseCode;
+ }
+
+}
diff --git a/common/src/main/java/org/onap/so/client/exception/MapperException.java b/common/src/main/java/org/onap/so/client/exception/MapperException.java
new file mode 100644
index 0000000000..354c669d62
--- /dev/null
+++ b/common/src/main/java/org/onap/so/client/exception/MapperException.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.client.exception;
+
+public class MapperException extends Exception {
+
+ public MapperException() {}
+
+ public MapperException(String message) {
+ super(message);
+ }
+
+}
diff --git a/common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java b/common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java
index 7ae7de2ece..fff82ea5bc 100644
--- a/common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java
+++ b/common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java
@@ -22,8 +22,16 @@ public class ExternalTaskServiceUtils {
@Autowired
public Environment env;
- protected Set<ExternalTaskClient> taskClients = ConcurrentHashMap.newKeySet();
+ private static final long DEFAULT_LOCK_DURATION_LONG = 2700000;
+ private static final long DEFAULT_LOCK_DURATION_MEDIUM = 900000;
+ private static final long DEFAULT_LOCK_DURATION_SHORT = 300000;
+
+ private static final String LOCK_DURATION_LONG = "mso.workflow.topics.lockDurationLong";
+ private static final String LOCK_DURATION_MEDIUM = "mso.workflow.topics.lockDurationMedium";
+ private static final String LOCK_DURATION_SHORT = "mso.workflow.topics.lockDurationShort";
+
+ protected Set<ExternalTaskClient> taskClients = ConcurrentHashMap.newKeySet();
private static final Logger logger = LoggerFactory.getLogger(ExternalTaskServiceUtils.class);
@@ -74,4 +82,16 @@ public class ExternalTaskServiceUtils {
return taskClients;
}
+ public long getLockDurationLong() {
+ return env.getProperty(LOCK_DURATION_LONG, Long.class, new Long(DEFAULT_LOCK_DURATION_LONG));
+ }
+
+ public long getLockDurationMedium() {
+ return env.getProperty(LOCK_DURATION_MEDIUM, Long.class, new Long(DEFAULT_LOCK_DURATION_MEDIUM));
+ }
+
+ public long getLockDurationShort() {
+ return env.getProperty(LOCK_DURATION_SHORT, Long.class, new Long(DEFAULT_LOCK_DURATION_SHORT));
+ }
+
}