001package com.box.sdk; 002 003/** Listener to listen to Box API connection events. */ 004public interface BoxAPIConnectionListener { 005 006 /** 007 * Called when the Box API connection refreshes its tokens. 008 * 009 * <p>The provided connection is guaranteed to not be auto-refreshed or modified by another 010 * listener until this method returns. 011 * 012 * @param api the API connection that was refreshed. 013 */ 014 void onRefresh(BoxAPIConnection api); 015 016 /** 017 * Called when an error occurs while attempting to refresh the Box API connection's tokens. 018 * 019 * <p>The provided connection is guaranteed to not be auto-refreshed or modified by another 020 * listener until this method returns. 021 * 022 * @param api the API connection that encountered an error. 023 * @param error the error that occurred. 024 */ 025 void onError(BoxAPIConnection api, BoxAPIException error); 026}