Class ItemListener

    • Constructor Detail

      • ItemListener

        public ItemListener()
    • Method Detail

      • onCreated

        public void onCreated​(Item item)
        Called after a new job is created and added to Jenkins, before the initial configuration page is provided.

        This is useful for changing the default initial configuration of newly created jobs. For example, you can enable/add builders, etc.

      • onCheckCopy

        public void onCheckCopy​(Item src,
                                ItemGroup parent)
                         throws Failure
        Called before a job is copied into a new parent, providing the ability to veto the copy operation before it starts.
        Parameters:
        src - the item being copied
        parent - the proposed parent
        Throws:
        Failure - to veto the operation.
        Since:
        2.51
      • onCopied

        public void onCopied​(Item src,
                             Item item)
        Called after a new job is created by copying from an existing job. For backward compatibility, the default implementation of this method calls onCreated(Item). If you choose to handle this method, think about whether you want to call super.onCopied or not.
        Parameters:
        src - The source item that the new one was copied from. Never null.
        item - The newly created item. Never null.
        Since:
        1.325 Before this version, a copy triggered onCreated(Item).
      • onLoaded

        public void onLoaded()
        Called after all the jobs are loaded from disk into Jenkins object.
      • onDeleted

        public void onDeleted​(Item item)
        Called right before a job is going to be deleted. At this point the data files of the job is already gone.
      • onUpdated

        public void onUpdated​(Item item)
        Called after a job has its configuration updated.
        Since:
        1.460
      • onBeforeShutdown

        public void onBeforeShutdown()
        Since:
        1.446 Called at the beginning of the orderly shutdown sequence to allow plugins to clean up stuff
      • register

        @Deprecated
        public void register()
        Deprecated.
        as of 1.286 put Extension on your class to have it auto-registered.
        Registers this instance to Hudson and start getting notifications.
      • fireOnCopied

        public static void fireOnCopied​(Item src,
                                        Item result)
      • checkBeforeCopy

        public static void checkBeforeCopy​(Item src,
                                           ItemGroup parent)
                                    throws Failure
        Call before a job is copied into a new parent, to allow the ItemListener implementations the ability to veto the copy operation before it starts.
        Parameters:
        src - the item being copied
        parent - the proposed parent
        Throws:
        Failure - if the copy operation has been vetoed.
        Since:
        2.51
      • fireOnCreated

        public static void fireOnCreated​(Item item)
      • fireOnUpdated

        public static void fireOnUpdated​(Item item)
      • fireOnDeleted

        public static void fireOnDeleted​(Item item)
        Since:
        1.548