[jbosstools-issues] [JBoss JIRA] (JBIDE-15766) openshift-java-client: dont refresh env variables on each addition/removal

Martes Wigglesworth (JIRA) jira-events at lists.jboss.org
Thu Oct 24 00:47:01 EDT 2013


    [ https://issues.jboss.org/browse/JBIDE-15766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12824499#comment-12824499 ] 

Martes Wigglesworth edited comment on JBIDE-15766 at 10/24/13 12:46 AM:
------------------------------------------------------------------------

When attempting to use solutions I., and II. in the previously listed solution analysis, I became aware of the fact that none of the integration tests will pass without this update feature called at the end of each operation referenced.

There is no internal aspect that refreshes the list, so for now, it seems that the only option, without referencing option IV., is to refer to option III. and leave it as is.

There does not seem to be any simple way to update the components each time that we add or remove from the list in the backend.  

I.E. 
When we need to remove the a variable, we don't actually alter the object collection on the plugin side, when the operation is concluded.  So when we destroy a variable, the IEnvironmentVariable instance is still alive on this side, instead of being removed already.  The way this is resolved currently, is that the Collection is repopulated with the current pull from the back-end, using the update... methods being referenced in this JIRA issue.

The methods calls can be removed, however, only with further investigation.

Until we do the extra cleanup, we will need to keep these method calls in place.
                
      was (Author: mwigglesworth-redhat):
    Technically I can resolve this issue by removing the update call from both add, and remove, hence forcing the refresh to be called explicitly.

Is this behaviour desirable?
                  
> openshift-java-client: dont refresh env variables on each addition/removal
> --------------------------------------------------------------------------
>
>                 Key: JBIDE-15766
>                 URL: https://issues.jboss.org/browse/JBIDE-15766
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: openshift
>    Affects Versions: 4.1.1.Beta1, 4.2.0.Alpha1
>            Reporter: Andre Dietisheim
>            Assignee: Andre Dietisheim
>             Fix For: 4.1.1.Beta1, 4.2.0.Alpha1
>
>
> When adding/removing environment variables, the openshift-java-client would always request the backend for the full list. This should not be required and avoided
> {code:title=ApplicationResource#addEnvironmentVariable}
> 		EnvironmentVariableResourceDTO environmentVariableResourceDTO =
> 				new AddEnvironmentVariableRequest().execute(name, value);
> 		IEnvironmentVariable environmentVariable = new EnvironmentVariableResource(environmentVariableResourceDTO, this);
> 		updateEnvironmentVariables();
> 		return environmentVariable;
> {code}
> {code:title=ApplicationResource#updateEnvironmentVariables}
> 	protected void updateEnvironmentVariables() throws OpenShiftException {
> 		if (environmentVariableByName == null) {
> 			environmentVariableByName = loadEnvironmentVariables();
> 		} else {
> 			environmentVariableByName.clear();
> 			environmentVariableByName.putAll(loadEnvironmentVariables());
> 		}
> 	}
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jbosstools-issues mailing list