View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.eventspy.internal;
20  
21  import org.eclipse.aether.AbstractRepositoryListener;
22  import org.eclipse.aether.RepositoryEvent;
23  import org.eclipse.aether.RepositoryListener;
24  
25  /**
26   * Forwards repository events to EventSpies.
27   * @since 3.0.2
28   */
29  class EventSpyRepositoryListener extends AbstractRepositoryListener {
30      private final EventSpyDispatcher dispatcher;
31  
32      private final RepositoryListener delegate;
33  
34      EventSpyRepositoryListener(EventSpyDispatcher dispatcher, RepositoryListener delegate) {
35          this.dispatcher = dispatcher;
36          this.delegate = delegate;
37      }
38  
39      @Override
40      public void artifactDeployed(RepositoryEvent event) {
41          dispatcher.onEvent(event);
42          delegate.artifactDeployed(event);
43      }
44  
45      @Override
46      public void artifactDeploying(RepositoryEvent event) {
47          dispatcher.onEvent(event);
48          delegate.artifactDeploying(event);
49      }
50  
51      @Override
52      public void artifactDescriptorInvalid(RepositoryEvent event) {
53          dispatcher.onEvent(event);
54          delegate.artifactDescriptorInvalid(event);
55      }
56  
57      @Override
58      public void artifactDescriptorMissing(RepositoryEvent event) {
59          dispatcher.onEvent(event);
60          delegate.artifactDescriptorMissing(event);
61      }
62  
63      @Override
64      public void artifactInstalled(RepositoryEvent event) {
65          dispatcher.onEvent(event);
66          delegate.artifactInstalled(event);
67      }
68  
69      @Override
70      public void artifactInstalling(RepositoryEvent event) {
71          dispatcher.onEvent(event);
72          delegate.artifactInstalling(event);
73      }
74  
75      @Override
76      public void artifactResolved(RepositoryEvent event) {
77          dispatcher.onEvent(event);
78          delegate.artifactResolved(event);
79      }
80  
81      @Override
82      public void artifactResolving(RepositoryEvent event) {
83          dispatcher.onEvent(event);
84          delegate.artifactResolving(event);
85      }
86  
87      @Override
88      public void metadataDeployed(RepositoryEvent event) {
89          dispatcher.onEvent(event);
90          delegate.metadataDeployed(event);
91      }
92  
93      @Override
94      public void metadataDeploying(RepositoryEvent event) {
95          dispatcher.onEvent(event);
96          delegate.metadataDeploying(event);
97      }
98  
99      @Override
100     public void metadataInstalled(RepositoryEvent event) {
101         dispatcher.onEvent(event);
102         delegate.metadataInstalled(event);
103     }
104 
105     @Override
106     public void metadataInstalling(RepositoryEvent event) {
107         dispatcher.onEvent(event);
108         delegate.metadataInstalling(event);
109     }
110 
111     @Override
112     public void metadataInvalid(RepositoryEvent event) {
113         dispatcher.onEvent(event);
114         delegate.metadataInvalid(event);
115     }
116 
117     @Override
118     public void metadataResolved(RepositoryEvent event) {
119         dispatcher.onEvent(event);
120         delegate.metadataResolved(event);
121     }
122 
123     @Override
124     public void metadataResolving(RepositoryEvent event) {
125         dispatcher.onEvent(event);
126         delegate.metadataResolving(event);
127     }
128 
129     @Override
130     public void artifactDownloaded(RepositoryEvent event) {
131         dispatcher.onEvent(event);
132         delegate.artifactDownloaded(event);
133     }
134 
135     @Override
136     public void artifactDownloading(RepositoryEvent event) {
137         dispatcher.onEvent(event);
138         delegate.artifactDownloading(event);
139     }
140 
141     @Override
142     public void metadataDownloaded(RepositoryEvent event) {
143         dispatcher.onEvent(event);
144         delegate.metadataDownloaded(event);
145     }
146 
147     @Override
148     public void metadataDownloading(RepositoryEvent event) {
149         dispatcher.onEvent(event);
150         delegate.metadataDownloading(event);
151     }
152 }