1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 IBM Corporation 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  *     IBM Corporation - initial API and implementation
13  *******************************************************************************/
14 package org.eclipse.equinox.p2.ui;
15 
16 import org.eclipse.equinox.p2.metadata.ILicense;
17 
18 /**
19  * LicenseManager defines a service which records the licenses that have been
20  * accepted in the course of installing or updating software. It can be used to determine
21  * whether a particular license should be presented to a user for acceptance, and
22  * to record the user's decision.
23  *
24  * @since 2.0
25  */
26 public abstract class LicenseManager {
27 
28 	/**
29 	 * Record the acceptance of the specified license.
30 	 *
31 	 * @param license the license to be accepted
32 	 *
33 	 * @return <code>true</code> if the license was recorded as accepted, <code>false</code> if
34 	 * it was not.
35 	 *
36 	 */
accept(ILicense license)37 	public abstract boolean accept(ILicense license);
38 
39 	/**
40 	 * Record the rejection of the specified license.
41 	 *
42 	 * @param license the license to be rejected
43 	 *
44 	 * @return <code>true</code> if the license was recorded as rejected, <code>false</code> if
45 	 * it was not.
46 	 *
47 	 */
reject(ILicense license)48 	public abstract boolean reject(ILicense license);
49 
50 	/**
51 	 * Return a boolean indicating whether a particular license has previously
52 	 * been accepted.
53 	 *
54 	 * @param license the license in question
55 	 *
56 	 * @return <code>true</code> if the license has previously been accepted,
57 	 * <code>false</code> if it has not been accepted before.
58 	 *
59 	 */
isAccepted(ILicense license)60 	public abstract boolean isAccepted(ILicense license);
61 
62 	/**
63 	 * Return a boolean indicating whether any licenses have been
64 	 * accepted.
65 	 *
66 	 * @return <code>true</code> if accepted licenses have been recorded,
67 	 * <code>false</code> if there have been no licenses accepted.
68 
69 	 */
hasAcceptedLicenses()70 	public abstract boolean hasAcceptedLicenses();
71 }
72