public List < Ticket > checkTickets ( Set < String > tickets ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_CHECK_TICKETS ) ; StringBuffer sb = new StringBuffer ( ) ; Iterator < String > it = tickets . iterator ( ) ; while ( it . hasNext ( ) ) { if ( sb . length ( ) > 0 ) { sb . append ( "," ) ; } Object obj = it . next ( ) ; if ( obj instanceof Ticket ) { sb . append ( ( ( Ticket ) obj ) . getTicketId ( ) ) ; } else { sb . append ( obj ) ; } } parameters . put ( "tickets" , sb . toString ( ) ) ; Response response = transportAPI . post ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } // <uploader> // <ticket id="128" complete="1" photoid="2995" /> // <ticket id="129" complete="0" /> // <ticket id="130" complete="2" /> // <ticket id="131" invalid="1" /> // </uploader> List < Ticket > list = new ArrayList < Ticket > ( ) ; Element uploaderElement = response . getPayload ( ) ; NodeList ticketNodes = uploaderElement . getElementsByTagName ( "ticket" ) ; int n = ticketNodes . getLength ( ) ; for ( int i = 0 ; i < n ; i ++ ) { Element ticketElement = ( Element ) ticketNodes . item ( i ) ; String id = ticketElement . getAttribute ( "id" ) ; String complete = ticketElement . getAttribute ( "complete" ) ; boolean invalid = "1" . equals ( ticketElement . getAttribute ( "invalid" ) ) ; String photoId = ticketElement . getAttribute ( "photoid" ) ; Ticket info = new Ticket ( ) ; info . setTicketId ( id ) ; info . setInvalid ( invalid ) ; info . setStatus ( Integer . parseInt ( complete ) ) ; info . setPhotoId ( photoId ) ; list . add ( info ) ; } return list ; }
Checks the status of one or more asynchronous photo upload tickets . This method does not require authentication .