2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.mso.cloudify.exceptions;
23 import org.openecomp.mso.cloudify.v3.model.Execution;
24 import org.openecomp.mso.openstack.exceptions.MsoException;
25 import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory;
28 * MSO Exception when a Cloudify workflow execution times out waiting for completion.
29 * Exception includes the last known state of the workflow execution.
31 public class MsoCloudifyTimeout extends MsoException
37 private static final long serialVersionUID = 3313636124141766495L;
39 private Execution execution;
42 * Constructor to create a new MsoOpenstackException instance
43 * @param code the error code
44 * @param message the error message
45 * @param detail error details
47 public MsoCloudifyTimeout (Execution execution) {
48 // Set the detailed error as the Exception 'message'
49 super("Cloudify Workflow Timeout for workflow " + execution.getWorkflowId() + " on deployment " + execution.getDeploymentId());
50 super.category = MsoExceptionCategory.OPENSTACK;
52 this.execution = execution;
55 public Execution getExecution() {
56 return this.execution;
60 public String toString () {
61 String error = "Workflow timeout: workflow=" + execution.getWorkflowId() + ",deployment=" + execution.getDeploymentId();