001: /*
002: * %W% %E%
003: *
004: * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
005: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006: *
007: * This program is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU General Public License version
009: * 2 only, as published by the Free Software Foundation.
010: *
011: * This program is distributed in the hope that it will be useful, but
012: * WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * General Public License version 2 for more details (a copy is
015: * included at /legal/license.txt).
016: *
017: * You should have received a copy of the GNU General Public License
018: * version 2 along with this work; if not, write to the Free Software
019: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA
021: *
022: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023: * Clara, CA 95054 or visit www.sun.com if you need additional
024: * information or have any questions.
025: */
026:
027: package com.sun.jump.module.download;
028:
029: import java.util.Properties;
030:
031: /**
032: * <code>JUMPDownloadDescriptor</code> contains the metadata associated with
033: * any content that can be downloaded.
034: */
035: public abstract class JUMPDownloadDescriptor {
036: public static final String TYPE_APPLICATION = "app";
037: public static final String TYPE_LIBRARY = "library";
038: public static final String TYPE_DATA = "data";
039:
040: /**
041: * The user-readable name of the media object, which identifies
042: * it to the user.
043: */
044: protected String name = null;
045:
046: /**
047: * A displayable name of this media object for use on the
048: * device, if desired.
049: */
050: protected String displayName = null;
051:
052: /**
053: * The version of this descriptor.
054: */
055: protected String version = null;
056:
057: /*
058: * The number of bytes (non-negative integer) to
059: * download from the media object's download URI.
060: */
061: protected int size = -1;
062:
063: /**
064: * The MIME type of the media object.
065: */
066: protected String mimeType = null;
067:
068: /**
069: * The content type of the media object.
070: * Normally Appmanager treats downloads as
071: * either applications {@link #TYPE_APPLICATION},
072: * libraries {@link #TYPE_LIBRARY} or binary data
073: * of some sort {@link #TYPE_DATA}.
074: */
075: protected String type = null;
076:
077: /**
078: * The URI (usually URL) from which the object can
079: * be downloaded. This must be accessible via an
080: * HTTP GET in order to allow the client agent to
081: * perform a download.
082: */
083: protected String objectURI = null;
084:
085: /**
086: * A URI to notify after a successful
087: * download and installation.
088: */
089: protected String installNotifyURI = null;
090:
091: /**
092: * A short, textual description of the media
093: * object. There are no particular semantics associated
094: * with the description, but it should be displayed
095: * to the user prior to installation.
096: */
097: protected String description = null;
098:
099: /**
100: * The organization which provides the media
101: * object.
102: */
103: protected String vendor = null;
104:
105: /**
106: * The URI of an icon object which can
107: * be used by the client to represent the
108: * media object.
109: */
110: protected String iconURI = null;
111:
112: /**
113: * The security level which the Appmanager will associate
114: * with this media object.
115: */
116: protected String securityLevel = null;
117:
118: /**
119: * For application media objects, a classpath.
120: */
121: protected String classpath = null;
122:
123: /**
124: * A vector of applications contained in this media
125: * object.
126: */
127: protected Properties applications[] = null;
128:
129: /**
130: * The mimetype of a data object.
131: */
132: protected String data = null;
133:
134: /**
135: * The URI of a data object.
136: */
137: protected String href;
138:
139: /**
140: * An indicator of whether the media object is
141: * a library.
142: */
143: protected boolean isLibraryType = false;
144:
145: /**
146: * An indicator of whether the media object
147: * is a native executable.
148: */
149: protected boolean isNativeType = false;
150:
151: /**
152: * The download application protocol used.
153: */
154: protected String schema;
155:
156: /**
157: * The source of the content.
158: */
159: protected String source;
160:
161: /**
162: * Creates a new instance of JUMPDownloadDescriptor
163: */
164: protected JUMPDownloadDescriptor(String schema, String source) {
165: this .source = source;
166: this .schema = schema;
167: }
168:
169: public String getName() {
170: return name;
171: }
172:
173: public String getDisplayName() {
174: return displayName;
175: }
176:
177: public String getVersion() {
178: return version;
179: }
180:
181: public int getSize() {
182: return size;
183: }
184:
185: public String getMimeType() {
186: return mimeType;
187: }
188:
189: public String getType() {
190: return type;
191: }
192:
193: public String getObjectURI() {
194: return objectURI;
195: }
196:
197: public String getInstallNotifyURI() {
198: return installNotifyURI;
199: }
200:
201: public String getDescription() {
202: return description;
203: }
204:
205: public String getVendor() {
206: return vendor;
207: }
208:
209: public String getIconURI() {
210: return iconURI;
211: }
212:
213: public String getSecurityLevel() {
214: return securityLevel;
215: }
216:
217: public String getClasspath() {
218: return classpath;
219: }
220:
221: public Properties[] getApplications() {
222: return applications;
223: }
224:
225: public String getData() {
226: return data;
227: }
228:
229: public String getHref() {
230: return href;
231: }
232:
233: public boolean isLibrary() {
234: return isLibraryType;
235: }
236:
237: public boolean isNative() {
238: return isNativeType;
239: }
240:
241: public String getSchema() {
242: return schema;
243: }
244:
245: public String getSource() {
246: return source;
247: }
248:
249: }
|