Added a "source" field to the PdpStateChange and PdpUpdate messages so
that PAP can record a unique name in the message, for logging purposes.
In a separate review, planning to add a method in policy-common for
creating the unique name. Once that has been created, it will be used
by PAP, to populate the "source" field, and all PDPs, to populate the
"name" field in the PdpStatus messages.
Issue-ID: POLICY-3409
Change-Id: I86c97702abe62a5672720330df50b7b106187661
Signed-off-by: Jim Hahn <jrh3@att.com>
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ToString(callSuper = true)
public class PdpStateChange extends PdpMessage {
@ToString(callSuper = true)
public class PdpStateChange extends PdpMessage {
+ /**
+ * System from which the message originated.
+ */
+ private String source;
+
private PdpState state;
/**
private PdpState state;
/**
public PdpStateChange(PdpStateChange source) {
super(source);
public PdpStateChange(PdpStateChange source) {
super(source);
+ this.source = source.source;
this.state = source.state;
}
}
this.state = source.state;
}
}
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property.
* Modifications Copyright (C) 2021 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* Modifications Copyright (C) 2021 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@ToString(callSuper = true)
public class PdpUpdate extends PdpMessage {
@ToString(callSuper = true)
public class PdpUpdate extends PdpMessage {
+ /**
+ * System from which the message originated.
+ */
+ private String source;
+
/**
* Description of the PDP group.
*/
/**
* Description of the PDP group.
*/
public PdpUpdate(PdpUpdate source) {
super(source);
public PdpUpdate(PdpUpdate source) {
super(source);
+ this.source = source.source;
this.description = source.description;
this.pdpHeartbeatIntervalMs = source.pdpHeartbeatIntervalMs;
this.policiesToBeDeployed = (source.policiesToBeDeployed == null ? null
this.description = source.description;
this.pdpHeartbeatIntervalMs = source.pdpHeartbeatIntervalMs;
this.policiesToBeDeployed = (source.policiesToBeDeployed == null ? null
* ============LICENSE_START=======================================================
* ONAP Policy Models
* ================================================================================
* ============LICENSE_START=======================================================
* ONAP Policy Models
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
assertEquals(removeVariableFields(orig.toString()), removeVariableFields(new PdpStateChange(orig).toString()));
// verify with all values
assertEquals(removeVariableFields(orig.toString()), removeVariableFields(new PdpStateChange(orig).toString()));
// verify with all values
+ orig.setSource("my-source");
orig.setName("my-name");
orig.setPdpGroup("my-group");
orig.setPdpSubgroup("my-subgroup");
orig.setName("my-name");
orig.setPdpGroup("my-group");
orig.setPdpSubgroup("my-subgroup");
* ============LICENSE_START=======================================================
* ONAP Policy Models
* ================================================================================
* ============LICENSE_START=======================================================
* ONAP Policy Models
* ================================================================================
- * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019-2021 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* Modifications Copyright (C) 2019-2021 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
assertEquals(removeVariableFields(orig.toString()), removeVariableFields(new PdpUpdate(orig).toString()));
// verify with all values
assertEquals(removeVariableFields(orig.toString()), removeVariableFields(new PdpUpdate(orig).toString()));
// verify with all values
+ orig.setSource("my-source");
orig.setDescription("my-description");
orig.setName("my-name");
orig.setPdpGroup("my-group");
orig.setDescription("my-description");
orig.setName("my-name");
orig.setPdpGroup("my-group");