diff options
author | michal.banka <michal.banka@nokia.com> | 2019-06-26 11:05:13 +0200 |
---|---|---|
committer | michal.banka <michal.banka@nokia.com> | 2019-07-04 13:37:28 +0200 |
commit | b5bfe9c92e75f80fcad25ea0ce65ef9e45d13a8c (patch) | |
tree | 6913d03a472ed1a5b0c7cfd517fd9eb59d85cd29 /vid-app-common/src/main/java/org/onap/vid/model | |
parent | b460da47f0aebe67bed1234711b8bbf4889d1354 (diff) |
Add controller which create error reports
Change-Id: Icfba59e90420c0d849c9ba5fae3d0cb1b40ed265
Issue-ID: VID-488
Signed-off-by: michal.banka <michal.banka@nokia.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/model')
3 files changed, 100 insertions, 43 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/GitRepositoryState.java b/vid-app-common/src/main/java/org/onap/vid/model/GitRepositoryState.java index f7c56b7b6..a6419ef42 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/GitRepositoryState.java +++ b/vid-app-common/src/main/java/org/onap/vid/model/GitRepositoryState.java @@ -7,9 +7,9 @@ * 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. @@ -24,25 +24,34 @@ import java.util.Properties; public class GitRepositoryState { - private final String commitId; - private final String commitMessageShort; - private final String commitTime; + public static final GitRepositoryState EMPTY = new GitRepositoryState("", "", ""); - public GitRepositoryState(Properties properties) { - this.commitId = String.valueOf(properties.get("git.commit.id")); - this.commitMessageShort = String.valueOf(properties.get("git.commit.message.short")); - this.commitTime = String.valueOf(properties.get("git.commit.time")); - } + private final String commitId; + private final String commitMessageShort; + private final String commitTime; - public String getCommitId() { - return commitId; - } + public GitRepositoryState(Properties properties) { + this(String.valueOf(String.valueOf(properties.get("git.commit.id"))), + String.valueOf(properties.get("git.commit.message.short")), + String.valueOf(properties.get("git.commit.time")) + ); + } - public String getCommitMessageShort() { - return commitMessageShort; - } + private GitRepositoryState(String commitId, String commitMessageShort, String commitTime) { + this.commitId = commitId; + this.commitMessageShort = commitMessageShort; + this.commitTime = commitTime; + } - public String getCommitTime() { - return commitTime; - } + public String getCommitId() { + return commitId; + } + + public String getCommitMessageShort() { + return commitMessageShort; + } + + public String getCommitTime() { + return commitTime; + } } diff --git a/vid-app-common/src/main/java/org/onap/vid/model/Service.java b/vid-app-common/src/main/java/org/onap/vid/model/Service.java index bb6c92e89..016828381 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/Service.java +++ b/vid-app-common/src/main/java/org/onap/vid/model/Service.java @@ -33,19 +33,19 @@ public class Service { /** The uuid. */ private String uuid; - + /** The invariant uuid. */ private String invariantUuid; - + /** The name. */ private String name; - + /** The version. */ private String version; - + /** The tosca model URL. */ private String toscaModelURL; - + /** The category. */ private String category; @@ -54,10 +54,10 @@ public class Service { /** The Service Role */ private String serviceRole; - + /** The description. */ private String description; - + /** The service ecomp naming flag */ private String serviceEcompNaming; @@ -77,7 +77,7 @@ public class Service { public String getUuid() { return uuid; } - + /** * Gets the invariant uuid. * @@ -86,7 +86,7 @@ public class Service { public String getInvariantUuid() { return invariantUuid; } - + /** * Gets the name. * @@ -95,7 +95,7 @@ public class Service { public String getName() { return name; } - + /** * Gets the version. * @@ -104,7 +104,7 @@ public class Service { public String getVersion() { return version; } - + /** * Gets the tosca model URL. * @@ -113,7 +113,7 @@ public class Service { public String getToscaModelURL() { return toscaModelURL; } - + /** * Gets the category. * @@ -122,7 +122,7 @@ public class Service { public String getCategory() { return category; } - + /** * Gets the description. * @@ -131,7 +131,7 @@ public class Service { public String getDescription() { return description; } - + /** * Gets the inputs. * @@ -161,7 +161,7 @@ public class Service { public void setUuid(String uuid) { this.uuid = uuid; } - + /** * Sets the invariant uuid. * @@ -170,7 +170,7 @@ public class Service { public void setInvariantUuid(String invariantUuid) { this.invariantUuid = invariantUuid; } - + /** * Sets the name. * @@ -179,7 +179,7 @@ public class Service { public void setName(String name) { this.name = name; } - + /** * Sets the version. * @@ -188,7 +188,7 @@ public class Service { public void setVersion(String version) { this.version = version; } - + /** * Sets the tosca model URL. * @@ -197,7 +197,7 @@ public class Service { public void setToscaModelURL(String toscaModelURL) { this.toscaModelURL = toscaModelURL; } - + /** * Sets the category. * @@ -206,7 +206,7 @@ public class Service { public void setCategory(String category) { this.category = category; } - + /** * Sets the description. * @@ -215,7 +215,7 @@ public class Service { public void setDescription(String description) { this.description = description; } - + /** * Sets the inputs. * @@ -239,7 +239,7 @@ public class Service { public int hashCode() { return UUID.fromString(getUuid()).hashCode(); } - + /* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ @@ -247,9 +247,9 @@ public class Service { public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Service)) return false; - + final Service service = (Service) o; - + return (service.getUuid().equals(getUuid())); } diff --git a/vid-app-common/src/main/java/org/onap/vid/model/errorReport/ReportCreationParameters.java b/vid-app-common/src/main/java/org/onap/vid/model/errorReport/ReportCreationParameters.java new file mode 100644 index 000000000..babbf8906 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/model/errorReport/ReportCreationParameters.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * VID + * ================================================================================ + * Copyright (C) 2019 Nokia 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.vid.model.errorReport; + +public class ReportCreationParameters { + private String requestId; + private String serviceUuid; + + public ReportCreationParameters() {} + + public ReportCreationParameters(String requestId, String serviceUuid) { + this.requestId = requestId; + this.serviceUuid = serviceUuid; + } + + public String getRequestId() { + return requestId; + } + + public String getServiceUuid() { + return serviceUuid; + } + + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public void setServiceUuid(String serviceUuid) { + this.serviceUuid = serviceUuid; + } +}
\ No newline at end of file |