use of com.openshift.restclient.authorization.UnauthorizedException in project jbosstools-openshift by jbosstools.
the class Connection method isAuthorized.
/**
* Computes authorization state of connection. May be a long running operation.
* @return
*/
public boolean isAuthorized(IProgressMonitor monitor) {
try {
IAuthorizationContext context = client.getAuthorizationContext();
boolean result = context.isAuthorized();
if (result) {
// being true, promises that connect will go smoothly.
return connect();
}
return result;
} catch (UnauthorizedException e) {
return false;
}
}
Aggregations