List of usage examples for org.springframework.ide.eclipse.boot.dash.cloudfoundry OrgsAndSpaces OrgsAndSpaces
public OrgsAndSpaces(List<CFSpace> spaces)
From source file:org.springframework.ide.eclipse.boot.dash.cloudfoundry.CloudFoundryTargetWizardModel.java
private OrgsAndSpaces getCloudSpaces(final CloudFoundryTargetProperties targetProperties, IRunnableContext context) throws Exception { OrgsAndSpaces spaces = null;//w w w .j a v a 2s.co m Operation<List<CFSpace>> op = new Operation<List<CFSpace>>( "Connecting to the Cloud Foundry target. Please wait while the list of spaces is resolved...") { protected List<CFSpace> runOp(IProgressMonitor monitor) throws Exception, OperationCanceledException { ClientRequests client = clientFactory.getClient(targetProperties); List<CFSpace> spaces = client.getSpaces(); String t = client.getRefreshToken(); if (t != null) { refreshToken = t; } String effectiveUser = client.getUserName().block(); if (effectiveUser != null) { userName.setValue(effectiveUser); } return spaces; } }; List<CFSpace> actualSpaces = op.run(context, true); if (actualSpaces != null && !actualSpaces.isEmpty()) { spaces = new OrgsAndSpaces(actualSpaces); } return spaces; }