diff options
author | Jim Hahn <jrh3@att.com> | 2020-02-08 08:32:59 -0500 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-02-11 17:31:35 -0500 |
commit | 35867f2e63c26d47417bfefc9a0912f17c4a873a (patch) | |
tree | 77791874b4337725a0c109a2d1195ee0c4e5a3a6 /models-interactions/model-impl/aai/src | |
parent | fd79f7920d454c35d6a8c02d430d9beba434dcc2 (diff) |
Add more code to facilitate actor implementation
Added obtain() to Context
Added startGuardAsync(), in anticipation of adding guards.
Moved logRestXxx() from Util to HttpOperation.
Added actor.test to facilitate testing of actors.
Changed timeoutSec from long to int in various places.
Made a couple of methods public to support junit testing.
Most of the methods required Params to be passed, which indicated a
design issue. Split Operator and Operation so that the Params could
be kept in a field and thus need not be passed to every method.
Basically, renamed OperatorPartial.java to OperationPartial.java and
created a new OperatorPartial.java. Of course, this makes it look to
gerrit like it's all new code, when in fact, most of it is unchanged,
other than removing the Params argument to the method calls. That
accounts for about half of the "lines changed" count.
Issue-ID: POLICY-1625
Change-Id: I9e98c9dadcbed145bf84deb06c9db1c864a3c24a
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-impl/aai/src')
5 files changed, 43 insertions, 2 deletions
diff --git a/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiConstants.java b/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiConstants.java new file mode 100644 index 000000000..084e4a504 --- /dev/null +++ b/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiConstants.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP + * ================================================================================ + * Copyright (C) 2020 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.policy.aai; + +/** + * Constants used with A&AI classes. + */ +public class AaiConstants { + + public static final String ACTOR_NAME = "AAI"; + public static final String CONTEXT_PREFIX = ACTOR_NAME + "."; + + private AaiConstants() { + // do nothing + } +} diff --git a/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiCqResponse.java b/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiCqResponse.java index 2010a5dff..6fb42db6b 100644 --- a/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiCqResponse.java +++ b/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiCqResponse.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2020 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. @@ -50,6 +50,7 @@ import org.slf4j.LoggerFactory; public class AaiCqResponse implements Serializable { private static final long serialVersionUID = 1L; + public static final String CONTEXT_KEY = AaiConstants.CONTEXT_PREFIX + "AaiCqResponse"; private static final String GENERIC_VNF = "generic-vnf"; private static final String VF_MODULE = "vf-module"; private static final Logger LOGGER = LoggerFactory.getLogger(AaiCqResponse.class); diff --git a/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiManager.java b/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiManager.java index 923b8d329..41f4d3b90 100644 --- a/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiManager.java +++ b/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiManager.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * aai * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. * Modifications Copyright (C) 2019 Samsung Electronics Co., Ltd. * ================================================================================ @@ -47,6 +47,8 @@ import org.slf4j.LoggerFactory; */ public final class AaiManager { + // TODO remove this class + /** The Constant logger. */ private static final Logger logger = LoggerFactory.getLogger(AaiManager.class); diff --git a/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/util/AaiException.java b/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/util/AaiException.java index 1fe23cfde..83923f1bb 100644 --- a/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/util/AaiException.java +++ b/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/util/AaiException.java @@ -23,6 +23,8 @@ package org.onap.policy.aai.util; public class AaiException extends Exception { + // TODO remove this class + private static final long serialVersionUID = 9220983727706207465L; public AaiException() { diff --git a/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/util/Serialization.java b/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/util/Serialization.java index e42325f4a..326294aab 100644 --- a/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/util/Serialization.java +++ b/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/util/Serialization.java @@ -26,6 +26,8 @@ import com.google.gson.GsonBuilder; public final class Serialization { + // TODO remove this class + public static final Gson gsonPretty = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create(); private Serialization() { |