01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: */
18: package org.apache.ivy.core.event.resolve;
19:
20: import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
21: import org.apache.ivy.core.report.ResolveReport;
22:
23: public class EndResolveEvent extends ResolveEvent {
24: public static final String NAME = "post-resolve";
25:
26: private ResolveReport report;
27:
28: public EndResolveEvent(ModuleDescriptor md, String[] confs,
29: ResolveReport report) {
30: super (NAME, md, confs);
31: this .report = report;
32: addAttribute("resolve-id", String
33: .valueOf(report.getResolveId()));
34: addAttribute("nb-dependencies", String.valueOf(report
35: .getDependencies().size()));
36: addAttribute("nb-artifacts", String.valueOf(report
37: .getArtifacts().size()));
38: addAttribute("resolve-duration", String.valueOf(report
39: .getResolveTime()));
40: addAttribute("download-duration", String.valueOf(report
41: .getDownloadTime()));
42: addAttribute("download-size", String.valueOf(report
43: .getDownloadSize()));
44: }
45:
46: public ResolveReport getReport() {
47: return report;
48: }
49:
50: }
|