Source code: org/acs/damsel/srvr/asset/Asset.java
1 package org.acs.damsel.srvr.asset;
2
3 import java.io.*;
4 import java.util.Iterator;
5 import org.acs.damsel.srvr.Config;
6 import org.apache.log4j.*;
7 import java.util.Vector;
8 import org.acs.damsel.srvr.db.AssetDB;
9 import java.sql.SQLException;
10
11 /**
12 * <p>Class Name: Asset</p>
13 * <p>Description: Each instance of the Asset class represents a single asset
14 * stored in the repository. Instances maintain asset filename and metadata
15 * filename as well as an Asset Descriptor Collection which stores all of
16 * the asset descriptors listed in the metadata file. The one metadata tag that
17 * all assets have in common is the assetID, which is an autonumber (i.e., a
18 * number that is unique and automatically incremented) retrieved from the
19 * Config object.</p>
20 * @version 1.1
21 */
22
23 public class Asset
24 implements Serializable {
25
26
27 /* Collection of all AssetDescriptors associated with the asset */
28 private AssetDescriptorCollection assetDescColl;
29 private static Logger log = Logger.getLogger(Asset.class);
30
31 /**
32 * Default constructor that creates an AssetDescriptorCollection for the Asset
33 */
34 public Asset() {
35 BasicConfigurator.resetConfiguration();
36 PropertyConfigurator.configure(Config.instance().getLogPropertiesFileName());
37 assetDescColl = new AssetDescriptorCollection();
38 }
39
40 /**
41 * Returns the filename of the asset as a String.
42 * @return String
43 * @throws SQLException
44 */
45
46 public String getFileName() throws SQLException {
47 return this.getAssetDescriptors().getValue("FileName");
48 }
49
50 /**
51 * Returns the webFileName of the asset as a String.
52 * @return String containing WebFileName pulled from database
53 */
54 public String getWebFileName() {
55 return this.getAssetDescriptors().getValue("WebFileName");
56 }
57
58
59 public AssetDescriptorCollection getAssetDescriptors() {
60 return assetDescColl;
61 }
62
63 public void setAssetDescriptors(AssetDescriptorCollection assetDescriptors) {
64 this.assetDescColl = assetDescriptors;
65 }
66
67 }