Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@FrankGasparovic
Copy link

Signed-off-by: Irina [email protected]

boolean isCreated = false;
try {
AttributeConnector existingConnector = zoneEntity.getResourceAttributeConnector();
isCreated = (null == existingConnector);
Copy link
Contributor

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.

Copy link
Author

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 {
Copy link
Contributor

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

Copy link
Contributor

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"
}

Copy link
Author

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.

Copy link
Contributor

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

@FrankGasparovic
Copy link
Author

Build pass Build Status

if (null == this.resourceAttributeConnector) {
return null;
}
return OBJECT_MAPPER.readValue(this.resourceAttributeConnector, AttributeConnector.class);
Copy link
Contributor

@sanjeevchopra sanjeevchopra Mar 16, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants