public void getTrustroots ( GSSCredential credential , GetTrustrootsParams params ) throws MyProxyException { if ( params == null ) { throw new IllegalArgumentException ( "params == null" ) ; } if ( credential == null ) { try { credential = getAnonymousCredential ( ) ; } catch ( GSSException e ) { throw new MyProxyException ( "Failed to create anonymous credentials" , e ) ; } } Socket gsiSocket = null ; OutputStream out = null ; InputStream in = null ; String msg = params . makeRequest ( ) ; try { gsiSocket = getSocket ( credential ) ; if ( credential . getName ( ) . isAnonymous ( ) ) { this . context . requestAnonymity ( true ) ; } out = gsiSocket . getOutputStream ( ) ; in = gsiSocket . getInputStream ( ) ; if ( ! ( ( GssSocket ) gsiSocket ) . getContext ( ) . getConfState ( ) ) throw new Exception ( "Confidentiality requested but not available" ) ; // send message out . write ( msg . getBytes ( ) ) ; out . flush ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Req sent:" + params ) ; } // get the response handleReply ( in , out , null , true ) ; } catch ( Exception e ) { throw new MyProxyException ( "MyProxy get-trustroots failed." , e ) ; } finally { // close socket close ( out , in , gsiSocket ) ; } }
Retrieves trustroot information from the MyProxy server .