// Copyright (C) 2015 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.gerrit.server.git.receive;

import com.google.gerrit.server.plugincontext.PluginSetContext;
import com.google.inject.Inject;
import java.util.Collection;
import org.eclipse.jgit.transport.PostReceiveHook;
import org.eclipse.jgit.transport.ReceiveCommand;
import org.eclipse.jgit.transport.ReceivePack;

class LazyPostReceiveHookChain implements PostReceiveHook {
  private final PluginSetContext<PostReceiveHook> hooks;

  @Inject
  LazyPostReceiveHookChain(PluginSetContext<PostReceiveHook> hooks) {
    this.hooks = hooks;
  }

  @Override
  public void onPostReceive(ReceivePack rp, Collection<ReceiveCommand> commands) {
    hooks.runEach(h -> h.onPostReceive(rp, commands));
  }
}
