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/role/RoleData.java


1   /*
2    * RoleData.java
3    *
4    * Copyright $Date: 2003/08/11 02:22:50 $ 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.role;
12  
13  import java.sql.Timestamp;
14  import java.util.Enumeration;
15  import java.util.Hashtable;
16  import java.util.Vector;
17  
18  import com.flexstor.common.constants.UserGroupDataTypesI;
19  import com.flexstor.common.data.ejb.Data;
20  import com.flexstor.common.keys.ejb.RoleKey;
21  
22  /**
23   * This class supports state data for <code>Role</code>.  A Data class holds <br>
24   * all of the state information for a corresponding class and reference <br>
25   * pointers to other classes <br>
26   *
27   * @author  Perry Hoekstra
28   * @version 1.0, 10/19/98
29   *
30   * @see     flexstor.user.User
31   *
32   * @since   FLEXSTOR.db 3.0
33   */
34   
35  public class RoleData 
36      extends Data 
37  {
38    // MKS macro expander
39    public final static String IDENTIFIER = "$Id: RoleData.java,v 1.4 2003/08/11 02:22:50 aleric Exp $";
40      
41    // indicates if this is a union of many roles or a single role
42    protected boolean unionSet = false;
43  
44    // arbitrary number that identifies this role
45    protected int identifier = 0;
46     
47    // default language 
48    protected String language = null;
49  
50    protected Hashtable preferences = null;
51     
52    protected int[] securityRights = null;  
53     
54    protected Hashtable trackingData = null;
55  
56    // collection of send setting object references for this role or union of roles      
57    protected Vector sendSettings = null;
58    
59    // collection of report template object references for this role or union of roles      
60    protected Vector reportTemplates = null;
61  
62    // collection of import setting object references for this role or union of roles      
63    protected Vector importSettings = null;
64      
65    // collection of disguise object references for this role or union of roles      
66    protected Vector disguises = null;
67  
68    // collection of server object references for this role or union of roles      
69    protected Vector servers = null;
70  
71    // collection of save search object references for this role or union of roles      
72    protected Vector saveSearches = null;
73      
74    // collection of email address object references for this role or union of roles      
75    protected Vector emailAddresses = null;
76    
77    // collection of ftp address object references for this role or union of roles      
78    protected Vector ftpAddresses = null;
79  
80    // collection of where clause object references for this role or union of roles      
81    protected Vector whereClauses = null;
82  
83    // collection of Privilege object references for this role or union of roles      
84    protected Vector privileges = null;
85  
86    // timestamp of record in database when the object was retrieved
87    protected Timestamp currentTimestamp;
88      
89    // object reference to this instance in the database  
90    protected RoleKey roleKey = null;
91  
92      /** 
93      * Default constructor for RoleData class<p>
94      *
95      * <b>Warning</b> Any objects created with this constructor are not updatable or insertable to the database 
96      */
97       
98      public RoleData() 
99      {
100       super();
101 
102       initialize();  
103     }
104 
105     /**
106     * Constructor for RoleData class<p>
107     * 
108     * <b>Warning</b> Any objects created with this constructor are not updatable (insertable, but not updatable) to the database
109     * 
110     * @param int  a role identifier
111     */
112      
113     public RoleData(int anIdentifier) 
114     {
115       super();
116 
117       initialize();
118       
119       identifier = anIdentifier;  
120     }
121 
122     /**
123     * Remove a Preference value from the role
124     *
125     * @param java.lang.String  - key to a Preference value
126     */
127      
128     public void deletePreference(String aKey) 
129     {
130       preferences.remove(aKey);  
131        setModifiedState( new Integer(UserGroupDataTypesI.PREFERENCE), Boolean.TRUE );
132     }
133 
134     /**
135     * Remove a Tracking Data from the role
136     *
137     * @param java.lang.String  - key to the Tracking Data value
138     */
139      
140     public void deleteTrackingData(String aKey) 
141     {
142       trackingData.remove(aKey);  
143        setModifiedState( new Integer(UserGroupDataTypesI.TRACKING_DATA), Boolean.TRUE );
144     }
145 
146     /**
147     * Determine if these two objects are equal, i.e. their attributes are equal.  This method <b>will not</b> test the
148     * equality of references to other objects
149     *
150     * @param com.flexstor.common.data.ejb.role.RoleData  a data object
151     *
152     * @return boolean                                   - <code>true</code> if the objects are equal; <code>false</code> if they are not
153     */
154      
155     public boolean equals(RoleData aDataObject) 
156     {
157       boolean objectsEqual = true;
158 
159       if (getIdentifier() == aDataObject.getIdentifier()) {
160         //continue on
161       }
162       else {
163         objectsEqual = false;
164       }
165 
166       if (getLanguage().equals(aDataObject.getLanguage())) {
167         //continue on
168       }
169       else {
170         objectsEqual = false;
171       }
172 
173       if (isSecurityRightsEqual(aDataObject.getSecurityRights())) {
174         //continue on
175       }
176       else {
177         objectsEqual = false;
178       }
179       
180       if (isPreferencesEqual(aDataObject.getPreferences())) {
181         //continue on
182       }
183       else {
184         objectsEqual = false;
185       }
186       
187       if (isTrackingDataEqual(aDataObject.getTrackingData())) {
188         //continue on
189       }
190       else {
191         objectsEqual = false;
192       }
193         
194       return objectsEqual;
195     }
196 
197     /**
198     * Return the object reference to a collection of Disguises
199     *
200     * @return java.lang.Vector   - a collection of disguise object references (DisguiseKeys)
201     *
202     * @see com.flexstor.common.keys.ejb.DisguiseKey
203     */
204      
205     public Vector getDisguises() 
206     {
207       return disguises;
208     }
209 
210     /**
211     * Return the object reference to a collection of ReportTemplates
212     *
213     * @return java.lang.Vector   - a collection of report template object references (ReportTemplateKeys)
214     *
215     * @see com.flexstor.common.keys.ejb.ReportTemplateCollectionKey
216     */
217      
218     public Vector getReportTemplates() 
219     {
220       return reportTemplates;
221     }
222 
223     /**
224     * Set a list of ReportTemplates
225     *
226     * @param java.lang.Vector   - a collection of report template object references (ReportTemplateKeys)
227     */
228      
229     public void setReportTemplates( Vector rt ) 
230     {
231       reportTemplates = rt;
232        setModifiedState( new Integer(UserGroupDataTypesI.REPORT_TEMPLATE), Boolean.TRUE );
233     }
234 
235     /**
236     * Set a list of Disguises
237     *
238     * @param java.lang.Vector   - a collection of disguise object references (DisguiseKeys)
239     */
240      
241     public void setDisguises( Vector dis ) 
242     {
243       disguises = dis;
244        setModifiedState( new Integer(UserGroupDataTypesI.APPLICATION), Boolean.TRUE );
245     }
246 
247     /**
248     * Return the object reference to a collection of EMailAddresses
249     *
250     * @return java.lang.Vector   - a collection of email address object references (EmailAddressCollectionKey)
251     *
252     * @see com.flexstor.common.keys.ejb.EmailAddressCollectionKey
253     */
254      
255     public Vector getEMailAddresses() 
256     {
257       return emailAddresses;
258     }
259 
260     /**
261     * Set the object reference to a collection of EMailAddresses
262     *
263     * @param java.lang.Vector   - a collection of email address object references (EmailAddressCollectionKey)
264     *
265     * @see com.flexstor.common.keys.ejb.EmailAddressCollectionKey
266     */
267      
268     public void setEMailAddresses( Vector vec ) 
269     {
270       emailAddresses = vec;
271        setModifiedState( new Integer(UserGroupDataTypesI.EMAIL_ADDRESS), Boolean.TRUE );
272     }
273 
274     /**
275     * Return the object reference to a collection of FtpAddresses
276     *
277     * @return java.lang.Vector   - a collection of ftp address object references (FtpAddressCollectionKey)
278     *
279     * @see com.flexstor.common.keys.ejb.FtpAddressCollectionKey
280     */
281      
282     public Vector getFtpAddresses() 
283     {
284       return ftpAddresses;
285     }
286 
287     /**
288     * Set the object reference to a collection of FtpAddresses
289     *
290     * @param java.lang.Vector   - a collection of ftp address object references (FtpAddressCollectionKey)
291     *
292     * @see com.flexstor.common.keys.ejb.FtpAddressCollectionKey
293     */
294      
295     public void setFtpAddresses( Vector vec ) 
296     {
297       ftpAddresses = vec;
298        setModifiedState( new Integer(UserGroupDataTypesI.FTP_ADDRESS), Boolean.TRUE );
299     }
300 
301     /**
302     * Return the role's identifier
303     *
304     * @return int - a role identifier
305     * @deprecated see getId()
306     */
307      
308     public int getIdentifier() 
309     {
310       return identifier;
311     }
312 
313     /**
314     * Return the role's identifier
315     *
316     * @return int - a role identifier
317     */
318      
319     public int getId() 
320     {
321       return identifier;
322     }
323 
324     /**
325     * set the role's identifier
326     *
327     * @param int roleId
328     * @deprecated see setId()
329     */
330      
331     public void setIdentifier( int id ) 
332     {
333       identifier = id;
334     }
335 
336     /**
337     * set the role's identifier
338     *
339     * @param int roleId
340     */
341      
342     public void setId( int id ) 
343     {
344       identifier = id;
345     }
346 
347     /**
348     * Return the collection of Import Setting keys for this role
349     *
350     * @return java.lang.Vector   - a collection of import setting object references (ImportSettingKey)
351     *
352     * @see com.flexstor.common.keys.ejb.ImportSettingKey
353     */
354      
355     public Vector getImportSettings() 
356     {
357       return importSettings;
358     }
359 
360     /**
361     * Set the collection of Import Setting keys for this role
362     *
363     * @param java.lang.Vector   - a collection of import setting object references (ImportSettingKey)
364     *
365     * @see com.flexstor.common.keys.ejb.ImportSettingKey
366     */
367      
368     public void setImportSettings( Vector vec ) 
369     {
370       importSettings = vec;
371        setModifiedState( new Integer(UserGroupDataTypesI.IMPORT_SETTING), Boolean.TRUE );
372     }
373 
374     /**
375     * Return the role's language preference
376     *
377     * @return java.lang.String - a language preference such as ("en" - English)
378     */
379      
380     public String getLanguage() 
381     {
382       return language;
383     }
384 
385     /**
386     * Set the role's language preference
387     *
388     * @param java.lang.String - a language preference such as ("en" - English)
389     */
390      
391     public void setLanguage( String lang ) 
392     {
393        if ( language == null || lang == null || !lang.equals(language) )
394        {
395          language = lang;
396           setModifiedState( new Integer(UserGroupDataTypesI.LANGUAGE), Boolean.TRUE );
397        }
398     }
399 
400     /**
401     * Return the collection of Preferences for this role
402     *
403     * Hashtable key - String
404     *           value - String
405     *
406     * @return java.util.Hashtable - a Preference collection
407     */
408      
409     public Hashtable getPreferences() 
410     {
411       return preferences;
412     }
413 
414     /**
415     * Return the reference to this object
416     *
417     * @return com.flexstor.common.keys.ejb.RoleKey - an object reference
418     * @deprecated see getKey()
419     */
420      
421     public RoleKey getReference() 
422     {
423       return roleKey;
424     }
425 
426     /**
427     * Return the reference to this object
428     *
429     * @return com.flexstor.common.keys.ejb.RoleKey - an object reference
430     */
431      
432     public RoleKey getKey() 
433     {
434       return roleKey;
435     }
436 
437     /**
438     * Return the object reference to a collection of SaveSearches
439     *
440     * @return java.lang.Vector   - a collection of server object references (SaveSearchCollectionKey)
441     *
442     * @see com.flexstor.common.keys.ejb.SaveSearchCollectionKey
443     */
444      
445     public Vector getSaveSearches() 
446     {
447       return saveSearches;
448     }
449 
450     /**
451     * Return the object reference to a collection of SaveSearches
452     *
453     * @param java.lang.Vector   - a collection of server object references (SaveSearchCollectionKey)
454     *
455     * @see com.flexstor.common.keys.ejb.SaveSearchCollectionKey
456     */
457      
458     public void setSaveSearches( Vector vec ) 
459     {
460       saveSearches = vec;
461        setModifiedState( new Integer(UserGroupDataTypesI.SAVED_SEARCH), Boolean.TRUE );
462     }
463 
464     /**
465     * Return the collection of Security Rights for this role
466     *
467     * @return int[] - a Security Rights collection
468     */
469      
470     public int[] getSecurityRights() 
471     {
472       return securityRights;
473     }
474 
475     /**
476     * Return the collection of Security Rights for this role
477     *
478     * @param int[] - a Security Rights collection
479     */
480      
481     public void setSecurityRights( int[] ray ) 
482     {
483       securityRights = ray;
484        setModifiedState( new Integer(UserGroupDataTypesI.FUNCTIONAL_RIGHT), Boolean.TRUE );
485     }
486 
487     /**
488     * Return the collection of Send Settings for this role
489     *
490     * @return java.lang.Vector   - a collection of send setting object references (SendSettingKey)
491     * 
492     * @see com.flexstor.common.keys.ejb.SendSettingKey
493     */
494      
495     public Vector getSendSettings() 
496     {
497       return sendSettings;
498     }
499     
500     /**
501     * Return the collection of Send Settings for this role
502     *
503     * @return java.lang.Vector   - a collection of send setting object references (SendSettingKey)
504     * 
505     * @see com.flexstor.common.keys.ejb.SendSettingKey
506     */
507      
508     public void setSendSettings( Vector vec ) 
509     {
510       sendSettings = vec;
511        setModifiedState( new Integer(UserGroupDataTypesI.SEND_SETTING), Boolean.TRUE );
512     }
513 
514     /**
515     * Return the object reference to a collection of Servers
516     *
517     * @return java.lang.Vector   - a collection of server object references (ServerCollectionKey)
518     *
519     * @see com.flexstor.common.keys.ejb.ServerCollectionKey
520     */
521      
522     public Vector getServers() 
523     {
524       return servers;
525     }
526 
527     /**
528     * Set the object reference to a collection of Servers
529     *
530     * @param java.lang.Vector   - a collection of server object references (ServerCollectionKey)
531     *
532     * @see com.flexstor.common.keys.ejb.ServerCollectionKey
533     */
534      
535     public void setServers( Vector vec ) 
536     {
537       servers = vec;
538        setModifiedState( new Integer(UserGroupDataTypesI.SERVER), Boolean.TRUE );
539     }
540 
541     /**
542     * Set the object reference to a collection of Privileges for the role.
543     * Please note that these are different from security rights
544     *
545     * @param java.lang.Vector   - a collection of PrivAsset data objects
546     *
547     * @see com.flexstor.common.keys.ejb.PrivAssetCollectionKey
548     */
549      
550     public void setPrivileges( Vector vec ) 
551     {
552       privileges = vec;
553        setModifiedState( new Integer(UserGroupDataTypesI.PRIVILEGE), Boolean.TRUE );
554     }
555 
556     /**
557     * Retrieve a collection of Privileges for the role.
558     * Please note that these are different from security rights
559     *
560     * @return java.lang.Vector   - a collection of PrivAsset data objects
561     *
562     * @see com.flexstor.common.keys.ejb.PrivAssetCollectionKey
563     */
564      
565     public Vector getPrivileges() 
566     {
567       return privileges;
568     }
569 
570     /**
571     * Set the object reference to a collection of Wheres for the role.
572     *
573     * @param java.lang.Vector   - a collection of WhereCollectionKey data objects
574     *
575     * @see com.flexstor.common.keys.ejb.WhereCollectionKey
576     */
577      
578     public void setWheres( Vector vec ) 
579     {
580       whereClauses = vec;
581        setModifiedState( new Integer(UserGroupDataTypesI.WHERE), Boolean.TRUE );
582     }
583 
584     /**
585     * Retrieve a collection of Restrictive Where Clauses for a role.
586     *
587     * @return java.lang.Vector   - a collection of WhereCollectionKey data objects
588     *
589     * @see com.flexstor.common.keys.ejb.WhereCollectionKey
590     */
591      
592     public Vector getWheres() 
593     {
594       return whereClauses;
595     }
596 
597     /**
598     * Return the timestamp of this object in database when the object was retrieved
599     *
600     * @return java.sql.Timestamp
601     */
602      
603     public Timestamp getTimestamp() 
604     {
605       return currentTimestamp;
606     }
607 
608     /**
609     * Return the collection of Tracking Data for this role
610     *
611     * Hashtable key - String
612     *           value - String
613     *
614     * @return java.util.Hashtable - a Tracking Data collection
615     */
616      
617     public Hashtable getTrackingData() 
618     {
619       return trackingData;
620     }
621 
622     /**
623     * Return the collection of Tracking Data for this role
624     *
625     * Hashtable key - String
626     *           value - String
627     *
628     * @return java.util.Hashtable - a Tracking Data collection
629     */
630      
631     public void setTrackingData( Hashtable hash ) 
632     {
633       trackingData = hash;
634        setModifiedState( new Integer(UserGroupDataTypesI.TRACKING_DATA), Boolean.TRUE );
635     }
636 
637     /**
638     * Set various instance variables to their initial state
639     */
640      
641     private void initialize() 
642     {
643       preferences  = new Hashtable(15);
644       trackingData = new Hashtable(10);
645     }
646 
647     /**
648     * Checks whether two collections of prefernces have equal values.
649     *
650     * @param java.util.Hashtable  a preference collection
651     *
652     * @return boolean 
653     */
654      
655     private boolean isPreferencesEqual(Hashtable aPreferenceCollection) 
656     {
657       boolean objectsEqual = true;
658       
659       //get keys from one hashtable
660       Enumeration t_keys = preferences.keys();
661       String t_key = null;
662 
663       Object t_object = null;  
664       String t_value1 = null;
665       String t_value2 = null; 
666           
667       while (t_keys.hasMoreElements()) {
668         t_key = (String)t_keys.nextElement();
669 
670         t_object = preferences.get(t_key);
671 
672         if (t_object != null) {
673           t_value1 = (String)t_object;
674         }
675 
676         t_object = aPreferenceCollection.get(t_key);
677 
678         if (t_object != null) {
679           t_value2 = (String)t_object;
680         }        
681 
682         if (t_value1.equals(t_value2)) {
683           //continue on
684         }
685         else {
686           objectsEqual = false;
687           break;
688         }
689       }
690 
691       return objectsEqual;
692     }
693 
694     /**
695     * Checks whether two collections of prefernces have equal values.
696     *
697     * @param java.util.Hashtable  a preference collection
698     *
699     * @return boolean 
700     */
701      
702     private boolean isSecurityRightsEqual(int[] aSecurityRightsArray) 
703     {
704       boolean objectsEqual = true;
705       
706       if (getSecurityRights() != null) {
707         if (aSecurityRightsArray != null) {
708           if (getSecurityRights().length == aSecurityRightsArray.length) {
709             int[] t_SecurityRights = getSecurityRights();
710             
711             for (int idx = 0; idx < aSecurityRightsArray.length; idx++) {
712               if (t_SecurityRights[idx] != aSecurityRightsArray[idx]) {
713                 objectsEqual = false;
714                 break;
715               }
716             }
717           }
718           else {
719             objectsEqual = false;
720           }
721         }
722         else {
723           objectsEqual = false;
724         }      
725       }
726       else {
727         if (aSecurityRightsArray == null) {
728           //continue on
729         }
730         else {
731           objectsEqual = false;
732         }
733       }
734           
735 
736       return objectsEqual;
737     }
738 
739     /**
740     * Checks whether two collections of prefernces have equal values.
741     *
742     * @param java.util.Hashtable  a preference collection
743     *
744     * @return boolean 
745     */
746      
747     private boolean isSecurityRightsEqual(Hashtable aPreferenceCollection) 
748     {
749       boolean objectsEqual = true;
750       
751       //get keys from one hashtable
752       Enumeration t_keys = preferences.keys();
753       String t_key = null;
754 
755       Object t_object = null;  
756       String t_value1 = null;
757       String t_value2 = null; 
758           
759       while (t_keys.hasMoreElements()) {
760         t_key = (String)t_keys.nextElement();
761 
762         t_object = preferences.get(t_key);
763 
764         if (t_object != null) {
765           t_value1 = (String)t_object;
766         }
767 
768         t_object = aPreferenceCollection.get(t_key);
769 
770         if (t_object != null) {
771           t_value2 = (String)t_object;
772         }        
773 
774         if (t_value1.equals(t_value2)) {
775           //continue on
776         }
777         else {
778           objectsEqual = false;
779           break;
780         }
781       }
782 
783       return objectsEqual;
784     }
785 
786     /**
787     * Checks whether two collections of tracking data have equal values.
788     *
789     * @param java.util.Hashtable  a tracking data collection
790     *
791     * @return boolean 
792     */
793      
794     private boolean isTrackingDataEqual(Hashtable aTrackingDataCollection) 
795     {
796       boolean objectsEqual = true;
797       
798       //get keys from one hashtable
799       Enumeration t_keys = trackingData.keys();
800       String t_key = null;
801 
802       Object t_object = null;  
803       String t_value1 = null;
804       String t_value2 = null; 
805           
806       while (t_keys.hasMoreElements()) {
807         t_key = (String)t_keys.nextElement();
808 
809         t_object = trackingData.get(t_key);
810 
811         if (t_object != null) {
812           t_value1 = (String)t_object;
813         }
814 
815         t_object = aTrackingDataCollection.get(t_key);
816 
817         if (t_object != null) {
818           t_value2 = (String)t_object;
819         }        
820 
821         if (t_value1.equals(t_value2)) {
822           //continue on
823         }
824         else {
825           objectsEqual = false;
826           break;
827         }
828       }
829 
830       return objectsEqual;
831     }
832 
833     /**
834     * Indicates whether this role is actually a union of roles from a collection of groups
835     *
836     * @return boolean  - <code>true</code> means it is a union, <code>false</code> means it is a user's role, 
837     */
838      
839     public boolean isUnionSet() 
840     {
841       return unionSet;
842     }
843 
844 
845     /**
846     * Indicates whether this role is actually a union of roles from a collection of groups
847     *
848     * @return boolean  - <code>true</code> means it is a union, <code>false</code> means it is a user's role, 
849     */
850      
851     public void setUnionSet( boolean b ) 
852     {
853       unionSet = b;
854     }
855 
856     /**
857     * Allow the preference collection to be replaced completely by an external preference 
858     * collection rather that through the <code>updatePreference</code> method
859     *
860     * @param java.util.Hashtable  a preferences collection in key/value format
861     */
862      
863     public void setPreference(Hashtable aPreferenceCollection) 
864     {
865       preferences = aPreferenceCollection;  
866        setModifiedState( new Integer(UserGroupDataTypesI.PREFERENCE), Boolean.TRUE );
867     }
868 
869 
870     /**
871     * Set the reference  for this object
872     *
873     * @param com.flexstor.common.keys.ejb.RoleKey  reference to this object
874     * @deprecated see setKey()
875     */
876      
877     public void setReference(RoleKey aKey) 
878     {
879       roleKey = aKey;
880     }
881 
882     /**
883     * Set the reference for this object
884     *
885     * @param com.flexstor.common.keys.ejb.RoleKey  reference to this object
886     */
887      
888     public void setKey(RoleKey aKey)  
889     {
890       roleKey = aKey;
891     }
892 
893     /**
894     * Assign the current timestamp of the object
895     *
896     * @param java.sql.Timestamp   current timestamp of the database object
897     */
898      
899     public void setTimestamp(Timestamp aTimeStamp) 
900     {
901       currentTimestamp = aTimeStamp;
902     }
903 
904     /**
905     * Return the contents of the instance as a String.  This method is strictly for use by testing classes<br>
906     * and should not be called by business objects
907     *
908     * @return java.lang.String  - String representation of RoleData contents
909     */
910      
911     public String toString() 
912     {
913       String t_key = null;
914       String t_value = null;
915       
916       String t_lineSeparator = System.getProperty("line.separator", "\n");
917       
918       StringBuffer t_roleContents = new StringBuffer(t_lineSeparator);
919         
920       t_roleContents.append("Class: RoleData");
921       t_roleContents.append(t_lineSeparator);
922       t_roleContents.append("Identifier: ");
923       t_roleContents.append(getIdentifier());
924       t_roleContents.append(t_lineSeparator);
925 
926       t_roleContents.append("Language: ");
927       t_roleContents.append(getLanguage());
928       t_roleContents.append(t_lineSeparator);
929 
930       Enumeration t_preferenceEnum = getPreferences().keys();
931       
932       while (t_preferenceEnum.hasMoreElements()) 
933       {
934         t_key = (String)t_preferenceEnum.nextElement();
935 
936         t_roleContents.append("Preference Key: ");
937         t_roleContents.append(t_key);
938         t_roleContents.append(t_lineSeparator);
939 
940         t_value = (String)getPreferences().get(t_key);
941           
942         t_roleContents.append("Preference Value: ");
943         t_roleContents.append(t_value);
944         t_roleContents.append(t_lineSeparator);
945       }
946 
947       int[] securityRightArray = getSecurityRights();
948       int t_arraySize = securityRightArray.length;
949       
950       for (int idx = 0; idx < t_arraySize; idx++) {
951         t_roleContents.append("Security Right: ");
952         t_roleContents.append(securityRightArray[idx]);
953         t_roleContents.append(t_lineSeparator);
954       }
955 
956       Enumeration t_trackingDataEnum = getTrackingData().keys();
957       
958       while (t_trackingDataEnum.hasMoreElements()) 
959       {
960         t_key = (String)t_trackingDataEnum.nextElement();
961 
962         t_roleContents.append("Tracking Data Key: ");
963         t_roleContents.append(t_key);
964         t_roleContents.append(t_lineSeparator);
965 
966         t_value = (String)getTrackingData().get(t_key);
967           
968         t_roleContents.append("Tracking Data Value: ");
969         t_roleContents.append(t_value);
970         t_roleContents.append(t_lineSeparator);
971       }
972         
973       return t_roleContents.toString();
974     }
975 
976     /**
977     * Add a new Preference value or update an existing Preference for the role
978     *
979     * @param java.lang.String  - key to the Preference value
980     * @param java.lang.String  - value for the Preference
981     */
982      
983     public void updatePreference(String aKey, String aValue) 
984     {
985       preferences.put(aKey, aValue);
986        setModifiedState( new Integer(UserGroupDataTypesI.PREFERENCE), Boolean.TRUE );
987     }
988 
989     /**
990     * Add a new Tracking Data value or update an existing Tracking Data for the role
991     *
992     * @param java.lang.String  - key to the Tracking Data value
993     * @param java.lang.String  - value for the Tracking Data
994     */
995      
996     public void updateTrackingData(String aKey, String aValue) 
997     {
998       trackingData.put(aKey, aValue);
999        setModifiedState( new Integer(UserGroupDataTypesI.TRACKING_DATA), Boolean.TRUE );
1000    }
1001}