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/ApplicationData.java


1   /*
2    * ApplicationData.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.Data;
16  import com.flexstor.common.data.ejb.property.PropertyData;
17  import com.flexstor.common.keys.ejb.ApplicationKey;
18  
19  /**
20   * This class supports state data for Application.  A Data class holds
21   * all of the state information for a corresponding class that
22   * contains references to other Data Objects.
23   *
24   * @author Daniel Nickel
25   * @author 2/14/99
26   * @version 3.0
27   * @since FLEXSTOR.db 3.0
28   * @see com.flexstor.ejb.application.persist.ApplicationPersistHome
29   */
30  
31  public class ApplicationData
32      extends Data
33  {
34  
35      /* MKS Identifier */
36      public final static String IDENTIFIER="$Id: ApplicationData.java,v 1.4 2003/08/11 02:22:28 aleric Exp $";
37      static final long serialVersionUID = 473665262303440384L;
38      
39      /**
40      *  Application ID for this object
41      */
42  
43      protected int id = 0;
44  
45      /**
46      *  Application ID for this object
47      */
48  
49      protected boolean classify = false;
50  
51      /**
52      *  Application Key for this object
53      */
54  
55      protected ApplicationKey key = null;
56  
57    /**
58     * This is the application name.
59     */
60  
61    protected String name = null;
62  
63      /**
64       * This is a vector of application buckets.
65       */
66  
67      protected Vector buckets = null;
68  
69  
70      /**
71      * Container for this application
72      */
73      protected String container = null;
74  
75      /**
76       * Properties of all fields
77       *
78       * @since FlexDB 3.0
79       */
80      protected Vector properties = new Vector();
81  
82      /**
83       * Constructor : Default
84       */
85       public ApplicationData()
86       {
87          super();
88       }
89  
90      /**
91       * Get the Identifier associated with this data object.
92       *
93       * @return int - Identifier
94       * @since FlexDB 3.0
95       */
96  
97      public int getId()
98      {
99          return id;
100     }
101 
102     /**
103      * Get the application name associated with this dataobject.
104      *
105      * @return java.lang.String - Name of Application
106      * @since FlexDB 3.0
107      * @see java.lang.String
108      */
109 
110     public String getName()
111     {
112         return name;
113     }
114 
115     /**
116      * Get the application Container.
117      *
118      * @return java.lang.String - Name of Container
119      * @since FlexDB 3.0
120      * @see java.lang.String
121      */
122 
123     public String getContainer()
124     {
125         return container;
126     }
127 
128     /**
129      * Get the Application Buckets associated with this application.
130      * This will return a Vector of AppBucketData
131      * or an Empty Vector Object if no buckets exists.
132      *
133      * @return java.util.Vector - List of BucketData Objects
134      * @since FlexDB 3.0
135      * @see java.util.Vector
136      * @see com.flexstor.ejb.dataobject.BucketData
137      */
138 
139     public Vector getBucketDataObjects()
140     {
141         return buckets;
142     }
143 
144 
145     /**
146     * Returns the Application Key for this object.
147     * This is a key that is needed for persistent
148     * manipulation.
149     *
150     * @return com.flexstor.ejb.key.ApplicationKey
151     */
152     public ApplicationKey getKey()
153     {
154         return key;
155     }
156 
157     /**
158     * This is true/false depending on whether this Object
159     * is classified or not.
160     *
161     * @return true if the object if classified<br>
162     *         false if it isn't
163     */
164     public boolean isClassify()
165     {
166         return classify;
167     }
168 
169 
170     /**
171     * This will return a list of properties.
172     *
173     * @return java.util.Vector - A list of PropertyData objects
174     */
175     public Vector getPropertyDataObjects()
176     {
177         return properties;
178     }
179 
180     /**
181     * Get property where it accepts a property String and returns the
182     * value
183     *
184     * @return String - Value
185     */
186     public String getProperty( String key )
187     {
188         if ( properties == null )
189             return null;
190 
191         for ( int i = 0; i < properties.size() ; i++ )
192         {
193             PropertyData _dat = (PropertyData)properties.elementAt( i );
194 
195             if ( _dat.getPropertyKey().compareTo( key ) == 0 )
196                 return _dat.getPropertyValue();
197         }
198 
199         return null;
200     }
201 
202 
203 }