aboutsummaryrefslogtreecommitdiffstats
path: root/appc-provider/appc-provider-bundle
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2017-04-21 12:34:25 -0700
committerPatrick Brady <pb071s@att.com>2017-05-01 10:58:52 -0700
commitfa68917a405125b75c6b23ca68310aab8c94a79a (patch)
treee9ed20f26647d1be5c308e772a223d9ab8500116 /appc-provider/appc-provider-bundle
parent14365b73fbf5111e62ba91b9d7f80602db383a3c (diff)
Make Flags immutable
Change-Id: Ib2e06d41d4e1eb6fb40144258067d2c71ac1d620 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'appc-provider/appc-provider-bundle')
-rw-r--r--appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/lcm/util/RequestInputBuilder.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/lcm/util/RequestInputBuilder.java b/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/lcm/util/RequestInputBuilder.java
index 7af5f073d..f45748de2 100644
--- a/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/lcm/util/RequestInputBuilder.java
+++ b/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/lcm/util/RequestInputBuilder.java
@@ -28,6 +28,7 @@ import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.Payload;
import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.action.identifiers.ActionIdentifiers;
import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.common.header.CommonHeader;
import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.common.header.common.header.Flags;
+import org.openecomp.appc.domainmodel.lcm.Flags.Mode;
import org.openecomp.appc.domainmodel.lcm.RequestContext;
import org.openecomp.appc.domainmodel.lcm.VNFOperation;
import org.openecomp.appc.requesthandler.objects.RequestHandlerInput;
@@ -105,21 +106,23 @@ public class RequestInputBuilder {
header.setSubRequestId(commonHeader.getSubRequestId());
Flags inFlags = commonHeader.getFlags();
- org.openecomp.appc.domainmodel.lcm.Flags flags = new org.openecomp.appc.domainmodel.lcm.Flags();
+ boolean force = false;
+ Mode mode = null;
+ int ttl = 0;
if (inFlags != null) {
- if(null != inFlags.getForce()) {
- flags.setForce(Boolean.parseBoolean(inFlags.getForce().toString().toLowerCase()));
+ if (null != inFlags.getForce()) {
+ force = Boolean.parseBoolean(inFlags.getForce().toString().toLowerCase());
}
- if(null!=inFlags.getMode()) {
- flags.setMode(inFlags.getMode().name());
+ if (null != inFlags.getMode()) {
+ mode = Mode.valueOf(inFlags.getMode().name());
}
- if(null!= inFlags.getTtl()) {
- flags.setTtl(inFlags.getTtl());
+ if (null != inFlags.getTtl()) {
+ ttl = inFlags.getTtl();
}
}
- this.requestContext.getCommonHeader().setFlags(flags);
+ this.requestContext.getCommonHeader().setFlags(new org.openecomp.appc.domainmodel.lcm.Flags(mode, force, ttl));
return this;
}