...
As PersistenceCmHandle has all the necessary fields of CmHandle, can we just modify existing code to use PerisistenceCmHandle and remove CmHandle?
Cm Handle Model | Persistence Cm Handle Model |
|
---|
Code Block |
---|
language | java |
---|
title | CmHandle.java |
---|
| /**
* CmHandle.
*/
@Validated
@Getter
@Setter
@NoArgsConstructor
public class CmHandle {
@JsonProperty("cmHandle")
private String cmHandleID;
@JsonSetter(nulls = Nulls.AS_EMPTY)
@JsonProperty("cmHandleProperties")
private Map<String, String> dmiProperties = Collections.emptyMap();
@JsonSetter(nulls = Nulls.AS_EMPTY)
@JsonProperty("publicCmHandleProperties")
private Map<String, String> publicProperties = Collections.emptyMap();
}
|
|
Code Block |
---|
language | java |
---|
title | PersistenceCmHandle.java |
---|
| /**
* DmiRegistry.
*/
@Getter
@Setter
@NoArgsConstructor
public class PersistenceCmHandle {
private String id;
@JsonProperty("dmi-service-name")
private String dmiServiceName;
@JsonProperty("dmi-data-service-name")
private String dmiDataServiceName;
@JsonProperty("dmi-model-service-name")
private String dmiModelServiceName;
@JsonProperty("additional-properties")
private List<Property> dmiProperties;
@JsonProperty("public-properties")
private List<Property> publicProperties; |
|
|
- Both contained within the same package
- Properties are only used within PersistenceCmHandle to set Persistence Cm Handle ID, DMI and public properties when a cm handle is being retrieved using the get data node api.
| - Both are contained in the same package
- Properties are also used in DmiModelOperations and DmiData operation when getting and writing resource data to DMI, and when fetching yang resources.
- Is also used to persist the cm handle to the fragment table within CPS db
|
|
Potential Issue
If we decide to only use one model, one potentially backwards incompatible change is the property names, which differ between persistenceCmHandle and the CmHandle class.
...