diff options
author | Shawn O. Pearce <sop@google.com> | 2012-05-10 19:12:09 -0700 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2012-05-18 10:25:19 -0700 |
commit | 7d2cb04d078ee10418680c2e9758066eb4bb4bea (patch) | |
tree | 8d61324aaf9407a7a71fb743751e103fd4fa8b82 /gerrit-extension-api/src | |
parent | 795167c05e60a0c0ba7b5edb00bab85b9d5b104e (diff) |
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
Diffstat (limited to 'gerrit-extension-api/src')
2 files changed, 63 insertions, 0 deletions
diff --git a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/events/GitReferenceUpdatedListener.java b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/events/GitReferenceUpdatedListener.java new file mode 100644 index 0000000000..438500d5e6 --- /dev/null +++ b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/events/GitReferenceUpdatedListener.java @@ -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); +} diff --git a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/events/NewProjectCreatedListener.java b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/events/NewProjectCreatedListener.java new file mode 100644 index 0000000000..7eed7d4724 --- /dev/null +++ b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/events/NewProjectCreatedListener.java @@ -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); +} |