Debian Codegraph @

bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/CollectEvent.java

raw
1 /*******************************************************************************
2 * Copyright (c) 2012 Wind River and others.
3 *
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
8 *
9 * SPDX-License-Identifier: EPL-2.0
10 *
11 * Contributors:
12 * Wind River - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.equinox.internal.p2.engine;
15
16 import java.util.EventObject;
17 import org.eclipse.equinox.p2.engine.ProvisioningContext;
18 import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
19 import org.eclipse.equinox.p2.repository.artifact.IArtifactRequest;
20
21 public class CollectEvent extends EventObject {
22
23 private static final long serialVersionUID = 5782796765127875200L;
24 /**
25 * It means the overall collecting requests are started.
26 */
27 public static final int TYPE_OVERALL_START = 1;
28 /**
29 * It means the overall collecting requests are finished.
30 */
31 public static final int TYPE_OVERALL_END = 2;
32 /**
33 * It means the collecting requests related to a special repository are started.
34 * See {@link CollectEvent#getRepository()}
35 */
36 public static final int TYPE_REPOSITORY_START = 3;
37 /**
38 * It means the collecting requests related to a special repository are end.
39 * See {@link CollectEvent#getRepository()}
40 */
41 public static final int TYPE_REPOSITORY_END = 4;
42
43 private IArtifactRepository artifactRepo;
44 private IArtifactRequest[] requests;
45
46 private ProvisioningContext context;
47
48 private int type;
49
50 public CollectEvent(int type, IArtifactRepository artifactRepo, ProvisioningContext context, IArtifactRequest[] requests) {
51 super(requests);
52 this.type = type;
53 this.artifactRepo = artifactRepo;
54 this.context = context;
55 this.requests = requests;
56 }
57
58 public int getType() {
59 return type;
60 }
61
62 /**
63 * Return the associated repository if the downloading requests are related to a special repository
64 * @return the associated repository or <code>null</code> if the repository is unknown
65 */
66 public IArtifactRepository getRepository() {
67 return artifactRepo;
68 }
69
70 public IArtifactRequest[] getDownloadRequests() {
71 return requests;
72 }
73
74 public ProvisioningContext getContext() {
75 return context;
76 }
77 }