-
Notifications
You must be signed in to change notification settings - Fork 14
US97526: Change attribute connector persistence to JSON #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| boolean isCreated = false; | ||
| try { | ||
| AttributeConnector existingConnector = zoneEntity.getResourceAttributeConnector(); | ||
| isCreated = (null == existingConnector); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 29: does not look right to me, if existingConnector is not null then isCreated will be false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this just means that the connector has been updated. If existingConnector is null then isCreated will be true, meaning you are creating a new connector.
| public AttributeConnector retrieveResourceConnector() { | ||
| ZoneEntity zoneEntity = this.zoneResolver.getZoneEntityOrFail(); | ||
| return this.connectorConverter.toConnector(zoneEntity.getResourceAttributeConnector()); | ||
| try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add throws clause to this function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guys,
This is good we are using Json thanks for fast turnaround but should we define the fields/format of the Json like:
{
"CLIENTD" : "ddd",
"CLIENDSECRET" : " secret",
"UAAURL" : "uaa_url",
"endpoint" : "ep"
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that is the current format of the Json. The Object Mapper deserializes the object into those fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked with Frank the last comment is not an issue
Signed-off-by: Irina <[email protected]>
461d41f to
e6e2917
Compare
| if (null == this.resourceAttributeConnector) { | ||
| return null; | ||
| } | ||
| return OBJECT_MAPPER.readValue(this.resourceAttributeConnector, AttributeConnector.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method should deserialize the json only when the json has changed
- keep a separate field of type AttributeConnector
- initialize from json when getter is called, only if null
- setter should also set this field, and serialize to json only if new value does not equal current value in object
Signed-off-by: Irina [email protected]