2 * ============LICENSE_START===================================================
3 * SPARKY (AAI UI service)
4 * ============================================================================
5 * Copyright © 2017 AT&T Intellectual Property.
6 * Copyright © 2017 Amdocs
8 * ============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=====================================================
22 * ECOMP and OpenECOMP are trademarks
23 * and service marks of AT&T Intellectual Property.
25 package org.onap.aai.sparky.dal;
27 import org.onap.aai.restclient.client.OperationResult;
28 import org.onap.aai.sparky.config.oxm.OxmEntityDescriptor;
29 import org.onap.aai.sparky.dal.rest.HttpMethod;
33 * The Class NetworkTransaction.
35 public class NetworkTransaction {
37 private OperationResult operationResult;
39 private String entityType;
43 private String queryParameters;
45 private HttpMethod operationType;
47 private OxmEntityDescriptor descriptor;
49 private long createdTimeStampInMs;
51 private long opTimeInMs;
53 private long taskAgeInMs;
56 * Instantiates a new network transaction.
58 public NetworkTransaction() {
59 this.createdTimeStampInMs = System.currentTimeMillis();
64 * Instantiates a new network transaction.
66 * @param method the method
67 * @param entityType the entity type
70 public NetworkTransaction(HttpMethod method, String entityType, OperationResult or) {
72 this.operationType = method;
73 this.entityType = entityType;
74 this.operationResult = or;
78 public HttpMethod getOperationType() {
82 public long getTaskAgeInMs() {
87 * Sets the task age in ms.
89 public void setTaskAgeInMs() {
90 this.taskAgeInMs = (System.currentTimeMillis() - createdTimeStampInMs);
93 public void setOperationType(HttpMethod operationType) {
94 this.operationType = operationType;
97 public OperationResult getOperationResult() {
98 return operationResult;
101 public void setOperationResult(OperationResult operationResult) {
102 this.operationResult = operationResult;
105 public String getEntityType() {
109 public void setEntityType(String entityType) {
110 this.entityType = entityType;
113 public String getLink() {
117 public void setLink(String link) {
121 public String getQueryParameters() {
122 return queryParameters;
125 public void setQueryParameters(String queryParameters) {
126 this.queryParameters = queryParameters;
129 public long getOpTimeInMs() {
133 public void setOpTimeInMs(long opTimeInMs) {
134 this.opTimeInMs = opTimeInMs;
137 public OxmEntityDescriptor getDescriptor() {
141 public void setDescriptor(OxmEntityDescriptor descriptor) {
142 this.descriptor = descriptor;
148 * @see java.lang.Object#toString()
151 public String toString() {
152 return "NetworkTransaction [operationResult=" + operationResult.toString() + ", entityType="
153 + entityType + ", link=" + link + ", operationType=" + operationType + ", descriptor="
154 + descriptor.toString() + ", createdTimeStampInMs=" + createdTimeStampInMs
155 + ", taskAgeInMs=" + taskAgeInMs + "]";