Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/flexstor/common/data/ejb/application/ApplicationDataBuild.java


1   /*
2    * ApplicationDataBuild.java
3    *
4    * Copyright $Date: 2003/08/11 02:22:28 $ FLEXSTOR.net Inc.
5    *
6    * This work is licensed for use and distribution under license terms found at
7    * http://www.flexstor.org/license.html
8    *
9    */
10  
11  package com.flexstor.common.data.ejb.application;
12  
13  import java.util.Vector;
14  
15  import com.flexstor.common.data.ejb.bucket.BucketData;
16  import com.flexstor.common.keys.ejb.ApplicationKey;
17  
18  /**
19   * This class supports state data for Application.  A Data class holds
20   * all of the state information for a corresponding class that does
21   * not references to other classes
22   *
23   * @author Daniel Nickel
24   * @author 2/17/99
25   * @version 1.0
26   * @since FLEXSTOR.db 3.0
27   * @see com.flexstor.ejb.disguise.Application
28   * @see com.flexstor.ejb.disguise.ApplicationHome
29   */
30  
31  public class ApplicationDataBuild
32      extends ApplicationData
33  {
34  
35      /* MKS Identifier */
36      public final static String IDENTIFIER="$Id: ApplicationDataBuild.java,v 1.4 2003/08/11 02:22:28 aleric Exp $";
37      static final long serialVersionUID = 542384422077467340L;
38      
39      /**
40       * Constructor
41       *
42       */
43  
44  
45      public ApplicationDataBuild()
46      {
47          super();
48      }
49  
50      /**
51       * Constructor using String to set Application Name
52       *
53       * @param appName This sets the name of the application
54       * @see java.lang.String
55       */
56  
57  
58      public ApplicationDataBuild(String appName)
59      {
60          super();
61          name = appName;
62      }
63  
64      /**
65      * Set the Application ID for this Object.
66      *
67      * @return boolean
68      * @param int id Identification of Application Row
69      *
70      */
71      public boolean setId( int id )
72      {
73          this.id = id;
74          return true;
75      }
76  
77      /**
78       * Get the application name
79       *
80       * @param sName This is the name of the application as String
81       * @see java.lang.String
82       */
83      public boolean setName(String sName)
84      {
85          name = sName;
86          return true;
87      }
88  
89      /**
90       * Set the application Container.
91       *
92       * @param cont - Name of Container
93       * @since FlexDB 3.0
94       * @see java.lang.String
95       */
96  
97      public void setContainer( String cont )
98      {
99         container = cont;
100     }
101 
102      /**
103       * This will allow a application bucket Object to be added
104       * to the application bucket Vector. If the Vector is null
105       * it will create a new Vector.
106       *
107       * @param bData This is a BucketData Object
108       * @return boolean
109       * @see com.flexstor.ejb.dataobject.BucketData
110       */
111 
112     public boolean addBucketDataObject(BucketData bData)
113     {
114         if (buckets == null) buckets = new Vector();
115 
116         buckets.addElement(bData);
117 
118         return true;
119     }
120 
121    /**
122     * Set the Vector to Bucket Objects
123     *
124     * @param vAppBuckets This is a Vector of Bucket Objects
125     * @see java.util.Vector
126     */
127 
128     public void setBucketDataObjects(Vector vBuckets)
129     {
130 
131         buckets = vBuckets;
132     }
133 
134 
135     /**
136     * Set the Application key for this object
137     *
138     * @param com.flexstor.ejb.key.ApplicationKey Key
139     *
140     */
141     public boolean setKey( ApplicationKey key )
142     {
143         this.key = key;
144         return true;
145     }
146 
147     /**
148     * Set the classify flag true or false
149     *
150     * @param true/false whether object is classified
151     *
152     */
153     public boolean setClassify( boolean classify )
154     {
155         this.classify = classify;
156         return true;
157     }
158 
159     /**
160     * Set the classify flag true or false based upon
161     * the first byte of a String 'Y' or 'N'.
162     *
163     * @param classify whether object is classified
164     *
165     */
166     public boolean setClassify( String classify )
167     {
168         // If null don't modify state
169         if ( classify == null )
170             return false;
171 
172         if ((classify.toLowerCase().getBytes())[0] == 'y')
173             this.classify = true;
174         else
175             this.classify = false;
176 
177         return true;
178     }
179 
180 
181     /**
182     * This will set a list of properties.
183     *
184     */
185     public void setPropertyDataObjects( Vector props )
186     {
187         properties = props;
188     }
189 
190 
191 }