package com.cloudbees.plugins.credentials;

import hudson.ExtensionPoint;
import hudson.model.ModelObject;
import jenkins.util.Listeners;


/**
 * A Listener to track {@link Credentials } usage.
 */
public abstract class CredentialsUseListener implements ExtensionPoint {

    /**
     * Called when {@link Credentials} is read by an object.
     *
     * @param c   The used Credentials.
     * @param obj The object using the credentials.
     */
    public abstract void onUse(Credentials c, ModelObject obj);

    /**
     * Fires the {@link #onUse} event to track the object that uses credentials.
     */
    public static void fireUse(Credentials c, ModelObject obj) {
        Listeners.notify(CredentialsUseListener.class, true, listener -> {
            listener.onUse(c, obj);
        });
    }
}

@@ -87,27 +87,104 @@
 n.model.
-ModelObject
+Item;%0Aimport hudson.model.ModelObject;%0Aimport hudson.model.Node;%0Aimport hudson.model.Run
 ;%0Aimport
@@ -209,16 +209,40 @@
 eners;%0A%0A
+import java.util.List;%0A%0A
 %0A/**%0A * 
@@ -279,17 +279,16 @@
 dentials
- 
 %7D usage.
@@ -288,16 +288,165 @@
  usage.%0A
+ * @see CredentialsProvider#trackAll(Item, List) %0A * @see CredentialsProvider#trackAll(Run, List) %0A * @see CredentialsProvider#trackAll(Node, List) %0A
  */%0Apubl
@@ -837,32 +837,193 @@
 es credentials.%0A
+     *  @see CredentialsProvider#trackAll(Item, List)%0A     *  @see CredentialsProvider#trackAll(Run, List)%0A     *  @see CredentialsProvider#trackAll(Node, List)%0A
      */%0A    publ
@@ -1155,22 +1155,8 @@
 r -%3E
- %7B%0A           
  lis
@@ -1178,19 +1178,8 @@
 obj)
-;%0A        %7D
 );%0A 

Add @see links