Replaced all tabs with spaces in java and pom.xml
[so.git] / adapters / mso-adapter-utils / src / main / java / org / onap / so / cloudify / exceptions / MsoCloudifyTimeout.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.onap.so.cloudify.exceptions;
22
23 import org.onap.so.cloudify.v3.model.Execution;
24 import org.onap.so.openstack.exceptions.MsoException;
25 import org.onap.so.openstack.exceptions.MsoExceptionCategory;
26
27 /**
28  * MSO Exception when a Cloudify workflow execution times out waiting for completion. Exception includes the last known
29  * state of the workflow execution.
30  */
31 public class MsoCloudifyTimeout extends MsoException {
32
33     /**
34      * Serialization id.
35      */
36     private static final long serialVersionUID = 3313636124141766495L;
37
38     private Execution execution;
39
40     /**
41      * Constructor to create a new MsoOpenstackException instance
42      * 
43      * @param code the error code
44      * @param message the error message
45      * @param detail error details
46      */
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 "
50                 + execution.getDeploymentId());
51         super.category = MsoExceptionCategory.OPENSTACK;
52
53         this.execution = execution;
54     }
55
56     public Execution getExecution() {
57         return this.execution;
58     }
59
60     @Override
61     public String toString() {
62         String error = "Workflow timeout: workflow=" + execution.getWorkflowId() + ",deployment="
63                 + execution.getDeploymentId();
64         return error;
65     }
66 }