boolean performRemoteCheck ( MnoHttpClient httpClient ) { // Prepare request String url = sso . getSessionCheckUrl ( this . uid , this . sessionToken ) ; String respStr ; try { respStr = httpClient . get ( url ) ; } catch ( AuthenticationException e1 ) { // TODO log error e1 . printStackTrace ( ) ; return false ; } catch ( ApiException e1 ) { // TODO log error e1 . printStackTrace ( ) ; return false ; } // Parse response Gson gson = new Gson ( ) ; Type type = new TypeToken < Map < String , String > > ( ) { } . getType ( ) ; Map < String , String > respObj = gson . fromJson ( respStr , type ) ; Boolean isValid = ( respObj . get ( "valid" ) != null && respObj . get ( "valid" ) . equals ( "true" ) ) ; if ( isValid ) { try { this . recheck = MnoDateHelper . fromIso8601 ( respObj . get ( "recheck" ) ) ; } catch ( Exception e ) { return false ; } return true ; } return false ; }
Check whether the remote maestrano session is still valid