@ GET @ Timed @ Produces ( ProtocolBufferMediaType . APPLICATION_PROTOBUF ) @ CacheControl ( mustRevalidate = true , noCache = true , noStore = true ) public SnowizardResponse getIdAsProtobuf ( @ HeaderParam ( HttpHeaders . USER_AGENT ) final String agent , @ QueryParam ( "count" ) final Optional < IntParam > count ) { final List < Long > ids = Lists . newArrayList ( ) ; if ( count . isPresent ( ) ) { for ( int i = 0 ; i < count . get ( ) . get ( ) ; i ++ ) { ids . add ( getId ( agent ) ) ; } } else { ids . add ( getId ( agent ) ) ; } return SnowizardResponse . newBuilder ( ) . addAllId ( ids ) . build ( ) ; }
Get one or more IDs as a Google Protocol Buffer response