private static void deleteOldFeedItems ( AdWordsServicesInterface adWordsServices , AdWordsSession session , Set < Long > feedItemIds , Feed feed ) throws RemoteException { // Get the FeedItemService. FeedItemServiceInterface feedItemService = adWordsServices . get ( session , FeedItemServiceInterface . class ) ; if ( feedItemIds . isEmpty ( ) ) { return ; } List < FeedItemOperation > operations = new ArrayList <> ( ) ; for ( Long feedItemId : feedItemIds ) { FeedItemOperation operation = new FeedItemOperation ( ) ; FeedItem feedItem = new FeedItem ( ) ; feedItem . setFeedId ( feed . getId ( ) ) ; feedItem . setFeedItemId ( feedItemId ) ; operation . setOperand ( feedItem ) ; operation . setOperator ( Operator . REMOVE ) ; operations . add ( operation ) ; } feedItemService . mutate ( operations . toArray ( new FeedItemOperation [ operations . size ( ) ] ) ) ; }
Deletes the old feed items for which extension settings have been created .