Skip to content

Commit

Permalink
More descriptive Listener parameter names
Browse files Browse the repository at this point in the history
  • Loading branch information
marstr committed May 22, 2020
1 parent 3578d3b commit 6ec1bf8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public DebounceInstallationAdapter(Context context, InstallationAdapter installa


@Override
public void saveInstallation(final Installation installation, final Listener onSuccess, final ErrorListener onFailure) {
public void saveInstallation(final Installation installation, final Listener onInstallationSaved, final ErrorListener onInstallationSaveError) {
if (mSchedFuture != null && !mSchedFuture.isDone()) {
mSchedFuture.cancel(true);
}
Expand All @@ -51,10 +51,10 @@ public void saveInstallation(final Installation installation, final Listener onS
@Override
public void run() {
try {
mInstallationAdapter.saveInstallation(installation, onSuccess, onFailure);
mInstallationAdapter.saveInstallation(installation, onInstallationSaved, onInstallationSaveError);
mPreferences.edit().putInt(PREFERENCE_KEY, installation.hashCode()).apply();
} catch (Exception e) {
onFailure.onInstallationSaveError(e);
onInstallationSaveError.onInstallationSaveError(e);
}
}
}, mInterval, TimeUnit.MILLISECONDS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public interface InstallationAdapter {
* Updates a backend with the updated Installation information for this device.
* @param installation The record to update.
*/
void saveInstallation(Installation installation, Listener onSuccess, ErrorListener onFailure);
void saveInstallation(Installation installation, Listener onInstallationSaved, ErrorListener onInstallationSaveError);

/**
* Defines the callback that should be invoked when an Installation is successfully processed by
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ public NotificationHubInstallationAdapter(Context context, String hubName, Strin
* @param installation The record to update.\
*/
@Override
public void saveInstallation(final Installation installation, final Listener onSuccess, final ErrorListener onFailure) {
public void saveInstallation(final Installation installation, final Listener onInstallationSaved, final ErrorListener onInstallationSaveError) {
String formatEndpoint = NotificationHubInstallationHelper.parseSbEndpoint(mConnectionString.getEndpoint());
final String url = NotificationHubInstallationHelper.getInstallationUrl(formatEndpoint, mHubName, installation.getInstallationId());

mHttpClient.callAsync(url, "PUT", getHeaders(url), buildCallTemplate(installation), buildServiceCallback(installation, onSuccess, onFailure));
mHttpClient.callAsync(url, "PUT", getHeaders(url), buildCallTemplate(installation), buildServiceCallback(installation, onInstallationSaved, onInstallationSaveError));
}

private String generateAuthToken(String url) throws InvalidKeyException {
Expand Down

0 comments on commit 6ec1bf8

Please sign in to comment.