]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.project/src/org/eclipse/equinox/internal/provisional/p2/installer/InstallDescription.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.project / src / org / eclipse / equinox / internal / provisional / p2 / installer / InstallDescription.java
1 /*******************************************************************************\r
2  *  Copyright (c) 2007, 2009 IBM Corporation and others.\r
3  *  All rights reserved. This program and the accompanying materials\r
4  *  are made available under the terms of the Eclipse Public License v1.0\r
5  *  which accompanies this distribution, and is available at\r
6  *  http://www.eclipse.org/legal/epl-v10.html\r
7  * \r
8  *  Contributors:\r
9  *     IBM Corporation - initial API and implementation\r
10  *     Code 9 - ongoing development\r
11  *******************************************************************************/\r
12 package org.eclipse.equinox.internal.provisional.p2.installer;\r
13 \r
14 import java.net.URI;\r
15 import java.util.HashMap;\r
16 import java.util.Map;\r
17 \r
18 import org.eclipse.core.runtime.IPath;\r
19 import org.eclipse.equinox.p2.metadata.IVersionedId;\r
20 \r
21 /**\r
22  * An install information captures all the data needed to perform a product install.\r
23  * This includes information on where the installed product comes from, what will\r
24  * be installed, and where it will be installed.\r
25  */\r
26 public class InstallDescription {\r
27         private URI[] artifactRepos;\r
28         private IPath installLocation;\r
29         private IPath agentLocation;\r
30         private IPath bundleLocation;\r
31         private boolean isAutoStart;\r
32         private String launcherName;\r
33         private URI[] metadataRepos;\r
34         private String productName;\r
35         private IVersionedId[] roots;\r
36         private final Map<String, String> profileProperties = new HashMap<String, String>();\r
37 \r
38         /**\r
39          * Returns the p2 agent location, or <code>null</code> to indicate\r
40          * the default agent location.\r
41          */\r
42         public IPath getAgentLocation() {\r
43                 return agentLocation;\r
44         }\r
45 \r
46         /**\r
47          * Returns the locations of the artifact repositories to install from\r
48          * @return a list of artifact repository URLs\r
49          */\r
50         public URI[] getArtifactRepositories() {\r
51                 return artifactRepos;\r
52         }\r
53 \r
54         /**\r
55          * Returns the bundle pool location, or <code>null</code> to\r
56          * indicate the default bundle pool location.\r
57          */\r
58         public IPath getBundleLocation() {\r
59                 return bundleLocation;\r
60         }\r
61 \r
62         /**\r
63          * Returns the local file system location to install into.\r
64          * @return a local file system location\r
65          */\r
66         public IPath getInstallLocation() {\r
67                 return installLocation;\r
68         }\r
69 \r
70         /**\r
71          * Returns the name of the product's launcher executable\r
72          * @return the name of the launcher executable\r
73          */\r
74         public String getLauncherName() {\r
75                 return launcherName;\r
76         }\r
77 \r
78         /**\r
79          * Returns the locations of the metadata repositories to install from\r
80          * @return a list of metadata repository URLs\r
81          */\r
82         public URI[] getMetadataRepositories() {\r
83                 return metadataRepos;\r
84         }\r
85 \r
86         /**\r
87          * Returns the profile properties for this install.\r
88          */\r
89         public Map<String, String> getProfileProperties() {\r
90                 return profileProperties;\r
91         }\r
92 \r
93         /**\r
94          * Returns a human-readable name for this install.\r
95          * @return the name of the product\r
96          */\r
97         public String getProductName() {\r
98                 return productName;\r
99         }\r
100 \r
101         /**\r
102          * Returns whether the installed product should be started upon successful\r
103          * install.\r
104          * @return <code>true</code> if the product should be started upon successful\r
105          * install, and <code>false</code> otherwise\r
106          */\r
107         public boolean isAutoStart() {\r
108                 return isAutoStart;\r
109         }\r
110 \r
111         public void setAgentLocation(IPath agentLocation) {\r
112                 this.agentLocation = agentLocation;\r
113         }\r
114 \r
115         public void setArtifactRepositories(URI[] value) {\r
116                 this.artifactRepos = value;\r
117         }\r
118 \r
119         public void setAutoStart(boolean value) {\r
120                 this.isAutoStart = value;\r
121         }\r
122 \r
123         public void setBundleLocation(IPath bundleLocation) {\r
124                 this.bundleLocation = bundleLocation;\r
125         }\r
126 \r
127         public void setInstallLocation(IPath location) {\r
128                 this.installLocation = location;\r
129         }\r
130 \r
131         public void setLauncherName(String name) {\r
132                 this.launcherName = name;\r
133         }\r
134 \r
135         public void setMetadataRepositories(URI[] value) {\r
136                 this.metadataRepos = value;\r
137         }\r
138 \r
139         /**\r
140          * Supplies a set of profile properties to be added when the profile is created.\r
141          * @param properties the profile properties to be added\r
142          */\r
143         public void setProfileProperties(Map<String, String> properties) {\r
144                 profileProperties.putAll(properties);\r
145         }\r
146 \r
147         /**\r
148          * Returns the set of roots to be installed for this installation\r
149          * @return the roots to install\r
150          */\r
151         public IVersionedId[] getRoots() {\r
152                 return roots;\r
153         }\r
154 \r
155         /**\r
156          * Set the list of roots to install\r
157          * @param value the set of roots to install\r
158          */\r
159         public void setRoots(IVersionedId[] value) {\r
160                 roots = value;\r
161         }\r
162 \r
163         /**\r
164          * Set the name of the product being installed.\r
165          * @param value the new name of the product to install\r
166          */\r
167         public void setProductName(String value) {\r
168                 productName = value;\r
169         }\r
170 \r
171 }\r