選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

RepositoryLifeCycleListener.java 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright 2014 gitblit.com.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.gitblit.extensions;
  17. import ro.fortsoft.pf4j.ExtensionPoint;
  18. import com.gitblit.models.RepositoryModel;
  19. /**
  20. * Extension point to allow plugins to listen to major repository lifecycle events.
  21. *
  22. * @author James Moger
  23. * @since 1.6.0
  24. */
  25. public abstract class RepositoryLifeCycleListener implements ExtensionPoint {
  26. /**
  27. * Called after a repository has been created.
  28. *
  29. * @param repository
  30. * @since 1.6.0
  31. */
  32. public abstract void onCreation(RepositoryModel repository);
  33. /**
  34. * Called after a repository has been forked.
  35. *
  36. * @param origin
  37. * @param fork
  38. * @since 1.7.0
  39. */
  40. public abstract void onFork(RepositoryModel origin, RepositoryModel fork);
  41. /**
  42. * Called after a repository has been renamed.
  43. *
  44. * @param oldName
  45. * @param repository
  46. * @since 1.7.0
  47. */
  48. public abstract void onRename(String oldName, RepositoryModel repository);
  49. /**
  50. * Called after a repository has been deleted.
  51. *
  52. * @param repository
  53. * @since 1.6.0
  54. */
  55. public abstract void onDeletion(RepositoryModel repository);
  56. }