Move replication logic to replication plugin

This splits all of the replication code out of the core server
and moves it into a standard plugin. A new listener API is used
inside of the core server to notify interested plugins of any Git
reference changes, which the replication code can hook into to
schedule its events.

Change-Id: I77ee4440a009c2ce1c62fb6a445c7e3c912245f9
This commit is contained in:
Shawn O. Pearce
2012-05-10 19:12:09 -07:00
parent 795167c05e
commit 7d2cb04d07
56 changed files with 306 additions and 2055 deletions

View File

@@ -0,0 +1,34 @@
// Copyright (C) 2012 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.extensions.events;
import com.google.gerrit.extensions.annotations.ExtensionPoint;
import java.util.List;
/** Notified when one or more references are modified. */
@ExtensionPoint
public interface GitReferenceUpdatedListener {
public interface Update {
String getRefName();
}
public interface Event {
String getProjectName();
List<Update> getUpdates();
}
void onGitReferenceUpdated(Event event);
}

View File

@@ -0,0 +1,29 @@
// Copyright (C) 2012 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.extensions.events;
import com.google.gerrit.extensions.annotations.ExtensionPoint;
/** Notified whenever a project is created on the master. */
@ExtensionPoint
public interface NewProjectCreatedListener {
public interface Event {
String getProjectName();
String getHeadName();
}
void onNewProjectCreated(Event event);
}