KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > webdocwf > dods > access > SecureDO


1 /**
2  * Title: SecureDO<p>
3  * Description: SecureDO is a superclass for all DODS DO's with access rights<p>
4  * Copyright: Copyright (c) Together Teamlösungen EDV-Dienstleistungen GmbH. under LGPL<p>
5  * Company: Together Teamlösungen EDV-Dienstleistungen GmbH.<p>
6  * @author Alfred Madl (a.madl@together.at)
7  * @version 1.0
8  */

9 package org.webdocwf.dods.access;
10
11 import java.sql.ResultSet JavaDoc;
12 import java.sql.SQLException JavaDoc;
13 import com.lutris.appserver.server.sql.DBRowUpdateException;
14 import com.lutris.appserver.server.sql.DBTransaction;
15 import com.lutris.appserver.server.sql.DatabaseManagerException;
16 import com.lutris.appserver.server.sql.ObjectId;
17 import com.lutris.appserver.server.sql.ObjectIdException;
18 import com.lutris.dods.builder.generator.dataobject.GenericDO;
19 import com.lutris.dods.builder.generator.query.DataObjectException;
20 import com.lutris.dods.builder.generator.query.QueryException;
21 import com.lutris.dods.builder.generator.query.RefAssertionException;
22
23 public abstract class SecureDO extends GenericDO {
24
25     /**
26      * Deletes the DO from its table.
27      *
28      * @exception com.lutris.appserver.server.sql.DatabaseManagerException if a Transaction can not be created.
29      * @exception RefAssertionException thrown by okTo method.
30      * @exception java.sql.SQLException if any SQL errors occur.
31      */

32     public abstract void delete() throws SQLException JavaDoc, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException;
33
34     /**
35      * Deletes the DO from its table.
36      * The transaction is likely provided by the delete() method of another DO
37      * which references this DO.
38      *
39      * @param dbt The transaction object to use for this operation.
40      * @exception com.lutris.appserver.server.sql.DatabaseManagerException if a Transaction can not be created.
41      * @exception com.lutris.appserver.server.sql.DBRowUpdateException if a version error occurs.
42      * @exception RefAssertionException thrown by okTo method.
43      * @exception java.sql.SQLException if any SQL errors occur.
44      */

45     public abstract void delete(DBTransaction dbt) throws SQLException JavaDoc, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException;
46
47     /**
48      * Load the actual DO data if necessary.
49      * Called by get/set methods.
50      *
51      * @exception DataObjectException If a data access error occurs.
52      */

53     protected abstract void checkLoad() throws DataObjectException;
54     
55     public abstract String JavaDoc getHandle() throws DatabaseManagerException;
56
57     public abstract String JavaDoc get_Handle() throws DatabaseManagerException;
58
59     public abstract boolean hasMatchingHandle(String JavaDoc handle);
60
61     /**
62      * isReadOnly()
63      * Returns true if the data for this object has been marked read-only.
64      */

65     public abstract boolean isReadOnly();
66
67     /**
68      * makeReadOnly()
69      * Mark the object as readonly
70      *
71      * WebDocWf extension
72      *
73      */

74     public abstract void makeReadOnly();
75
76     /**
77      * Mark the object as readwrite
78      *
79      * WebDocWf extension
80      *
81      */

82     public abstract void makeReadWrite();
83
84     public SecureDO() throws DatabaseManagerException, ObjectIdException {
85         super();
86     }
87
88     public SecureDO(String JavaDoc dbName) throws DatabaseManagerException, ObjectIdException {
89         super(dbName);
90     }
91   
92     public SecureDO(boolean isView) throws ObjectIdException, DatabaseManagerException {
93         super(isView);
94     }
95
96     public SecureDO(String JavaDoc dbName, boolean isView) throws ObjectIdException, DatabaseManagerException {
97         super(dbName, isView);
98     }
99
100     public SecureDO(ObjectId id) throws ObjectIdException, DatabaseManagerException {
101         super(id);
102     }
103
104     public SecureDO(String JavaDoc dbName, ObjectId id) throws ObjectIdException, DatabaseManagerException {
105         super(dbName, id);
106     }
107
108     public SecureDO(ResultSet JavaDoc rs) throws SQLException JavaDoc, ObjectIdException, DatabaseManagerException {
109         super(rs);
110     }
111
112     public SecureDO(String JavaDoc dbName, ResultSet JavaDoc rs) throws SQLException JavaDoc, ObjectIdException, DatabaseManagerException {
113         super(dbName, rs);
114     }
115
116     /**
117      * Deletes the DO from its table.
118      *
119      * @param usr The user for security checks
120      *
121      * @exception com.lutris.appserver.server.sql.DatabaseManagerException if a Transaction can not be created.
122      * @exception RefAssertionException thrown by okTo method.
123      * @exception java.sql.SQLException if any SQL errors occur.
124      * @exception AccessException
125      * The user is not allowed to delete the DO
126      *
127      * This is a WebDocWf extension for DODS row instance security
128      *
129      */

130     public void delete(org.webdocwf.dods.access.User usr)
131         throws SQLException JavaDoc, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException, AccessException {
132         assertDODeleteAccess(usr);
133         delete();
134     }
135
136     /**
137      * Ensure that the given user is allowed to delete the DO
138      *
139      * @param usr The user for security checks
140      *
141      * @exception AccessException
142      * The user is not allowed to delete the DO
143      *
144      * This is a WebDocWf extension for DODS row instance security
145      *
146      */

147     public void assertDODeleteAccess(org.webdocwf.dods.access.User usr)
148         throws AccessException {
149         if (!hasDODeleteAccess(usr)) {
150             throw new AccessRightException("No access !", usr, "Delete", this,
151                     null, null, null, null, null, null);
152         }
153     }
154
155     /**
156      * Check if the given user is allowed to delete the DO
157      *
158      * @param usr The user for security checks
159      * @return Whether the user is allowed to delete this DO
160      *
161      * @exception AccessEvalException
162      * Error during access evaluation
163      *
164      * This is a WebDocWf extension for DODS row instance security
165      *
166      */

167     public boolean hasDODeleteAccess(org.webdocwf.dods.access.User usr)
168         throws AccessEvalException {
169         try {
170             checkLoad();
171         } catch (Exception JavaDoc e) {
172             throw new AccessEvalException("Error in hasDODeleteAccess/checkLoad !",
173                     e, usr, "Delete", this, null, null, null, null, null, null);
174         }
175         return usr.hasDODeleteAccess(this);
176     }
177
178     /**
179      * Deletes the DO from its table.
180      *
181      * @param usr The user for security checks
182      *
183      * @param dbt The transaction object to use for this operation.
184      * @exception com.lutris.appserver.server.sql.DatabaseManagerException if a Transaction can not be created.
185      * @exception RefAssertionException thrown by okTo method.
186      * @exception java.sql.SQLException if any SQL errors occur.
187      * @exception AccessException
188      * The user is not allowed to delete the DO
189      *
190      * This is a WebDocWf extension for DODS row instance security
191      *
192      */

193     public void delete(DBTransaction dbt, org.webdocwf.dods.access.User usr)
194         throws SQLException JavaDoc, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException, AccessException {
195         assertDODeleteAccess(usr);
196         delete(dbt);
197     }
198
199     /**
200      * Ensure that the given user is allowed to copy the DO
201      *
202      * @param usr The user for security check
203      *
204      * @exception AccessException
205      * The user is not allowed to make a copy
206      *
207      * WebDocWf extension
208      *
209      */

210     public void assertDOCopyAccess(org.webdocwf.dods.access.User usr)
211         throws AccessException {
212         if (!hasDOCopyAccess(usr)) {
213             throw new AccessRightException("No access !", usr, "Copy", this,
214                     null, null, null, null, null, null);
215         }
216     }
217
218     /**
219      * Check whether the given user is allowed to copy the DO
220      *
221      * @param usr The user for security check
222      * @return Whether the given user is allowed to copy the DO
223      *
224      * WebDocWf extension
225      *
226      */

227     public boolean hasDOCopyAccess(org.webdocwf.dods.access.User usr)
228         throws AccessEvalException {
229         try {
230             checkLoad();
231         } catch (Exception JavaDoc e) {
232             throw new AccessEvalException("Error in hasDoCopyAccess/checkLoad !",
233                     e, usr, "Copy", this, null, null, null, null, null, null);
234         }
235         return usr.hasDOCopyAccess(this);
236     }
237
238     /**
239      * The get_Handle() method is used
240      * to set the value for each GUI option,
241      * and the hasMatchingHandle()
242      * methods are used to lookup the Data Object when the selection has
243      * been made.
244      *
245      * @param usr The user for security check
246      * @return id of this DO as a string
247      *
248      * @exception DatabaseManagerException
249      * If a connection to the database cannot be established, etc.
250      * @exception AccessException
251      * The user is not allowed to read the object existance
252      *
253      * WebDocWf extension
254      *
255      */

256     public String JavaDoc get_Handle(org.webdocwf.dods.access.User usr)
257         throws DatabaseManagerException, AccessException {
258         assertDOGetAccess(usr);
259         return getHandle();
260     }
261
262     /**
263      * The getHandle() method is used
264      * to set the value for each GUI option,
265      * and the hasMatchingHandle()
266      * methods are used to lookup the Data Object when the selection has
267      * been made.
268      *
269      * @param usr The user for security check
270      * @return id of this DO as a string
271      *
272      * @exception DatabaseManagerException
273      * If a connection to the database cannot be established, etc.
274      * @exception AccessException
275      * The user is not allowed to read the object existance
276      *
277      * WebDocWf extension
278      * @deprecated Use get_Handle() instead.
279      */

280     public String JavaDoc getHandle(org.webdocwf.dods.access.User usr)
281         throws DatabaseManagerException, AccessException {
282         return get_Handle();
283     }
284
285     /**
286      * hasMatchingHandle
287      *
288      * @param handle
289      * String version of DO id
290      * @param usr The user for security check
291      * @return boolean
292      * True if the string version of the id of this DO matches passed handle
293      * @exception AccessException
294      * The user is not allowed to read the object existance
295      *
296      * WebDocWf extension
297      *
298      */

299     public boolean hasMatchingHandle(String JavaDoc handle, org.webdocwf.dods.access.User usr)
300         throws AccessException {
301         assertDOGetAccess(usr);
302         return hasMatchingHandle(handle);
303     }
304
305     // WebDocWf extension for DODS row instance security
306
// The following lines have been added:
307
/**
308      * Check whether the given user is allowed to read
309      * the attribute and the value
310      *
311      * @param attrName The name of the attribute
312      * @param value The current value of the attribute
313      * @param usr The user for security check
314      * @return Whether the given user is allowed to read the attribute
315      *
316      * WebDocWf extension
317      *
318      */

319     public boolean hasDOGetAttrAccess(String JavaDoc attrName, Object JavaDoc value, org.webdocwf.dods.access.User usr)
320         throws AccessEvalException {
321         try {
322             checkLoad();
323         } catch (Exception JavaDoc e) {
324             throw new AccessEvalException("Error in hasDoGetAttrAccess/checkLoad !",
325                     e, usr, "GetAttr", this, null, attrName, null, null,
326                     "Object", null);
327         }
328         return usr.hasDOGetAttrAccess(this, attrName, value);
329     }
330
331     /**
332      * Check whether the given user is allowed to read
333      * the attribute and the value
334      *
335      * @param attrName The name of the attribute
336      * @param value The current value of the attribute
337      * @param usr The user for security check
338      * @return Whether the given user is allowed to read the attribute
339      *
340      * WebDocWf extension
341      *
342      */

343     public boolean hasDOGetAttrAccess(String JavaDoc attrName, boolean value, org.webdocwf.dods.access.User usr)
344         throws AccessEvalException {
345         try {
346             checkLoad();
347         } catch (Exception JavaDoc e) {
348             throw new AccessEvalException("Error in hasDoGetAttrAccess/checkLoad !",
349                     e, usr, "GetAttr", this, null, attrName, null, null,
350                     "boolean", null);
351         }
352         return usr.hasDOGetAttrAccess(this, attrName, value);
353     }
354
355     /**
356      * Check whether the given user is allowed to read
357      * the attribute and the value
358      *
359      * @param attrName The name of the attribute
360      * @param value The current value of the attribute
361      * @param usr The user for security check
362      * @return Whether the given user is allowed to read the attribute
363      *
364      * WebDocWf extension
365      *
366      */

367     public boolean hasDOGetAttrAccess(String JavaDoc attrName, byte value, org.webdocwf.dods.access.User usr)
368         throws AccessEvalException {
369         try {
370             checkLoad();
371         } catch (Exception JavaDoc e) {
372             throw new AccessEvalException("Error in hasDoGetAttrAccess/checkLoad !",
373                     e, usr, "GetAttr", this, null, attrName, null, null, "byte",
374                     null);
375         }
376         return usr.hasDOGetAttrAccess(this, attrName, value);
377     }
378
379     /**
380      * Check whether the given user is allowed to read
381      * the attribute and the value
382      *
383      * @param attrName The name of the attribute
384      * @param value The current value of the attribute
385      * @param usr The user for security check
386      * @return Whether the given user is allowed to read the attribute
387      *
388      * WebDocWf extension
389      *
390      */

391     public boolean hasDOGetAttrAccess(String JavaDoc attrName, short value, org.webdocwf.dods.access.User usr)
392         throws AccessEvalException {
393         try {
394             checkLoad();
395         } catch (Exception JavaDoc e) {
396             throw new AccessEvalException("Error in hasDoGetAttrAccess/checkLoad !",
397                     e, usr, "GetAttr", this, null, attrName, null, null, "short",
398                     null);
399         }
400         return usr.hasDOGetAttrAccess(this, attrName, value);
401     }
402
403     /**
404      * Check whether the given user is allowed to read
405      * the attribute and the value
406      *
407      * @param attrName The name of the attribute
408      * @param value The current value of the attribute
409      * @param usr The user for security check
410      * @return Whether the given user is allowed to read the attribute
411      *
412      * WebDocWf extension
413      *
414      */

415     public boolean hasDOGetAttrAccess(String JavaDoc attrName, int value, org.webdocwf.dods.access.User usr)
416         throws AccessEvalException {
417         try {
418             checkLoad();
419         } catch (Exception JavaDoc e) {
420             throw new AccessEvalException("Error in hasDoGetAttrAccess/checkLoad !",
421                     e, usr, "GetAttr", this, null, attrName, null, null, "int",
422                     null);
423         }
424         return usr.hasDOGetAttrAccess(this, attrName, value);
425     }
426
427     /**
428      * Check whether the given user is allowed to read
429      * the attribute and the value
430      *
431      * @param attrName The name of the attribute
432      * @param value The current value of the attribute
433      * @param usr The user for security check
434      * @return Whether the given user is allowed to read the attribute
435      *
436      * WebDocWf extension
437      *
438      */

439     public boolean hasDOGetAttrAccess(String JavaDoc attrName, long value, org.webdocwf.dods.access.User usr)
440         throws AccessEvalException {
441         try {
442             checkLoad();
443         } catch (Exception JavaDoc e) {
444             throw new AccessEvalException("Error in hasDoGetAttrAccess/checkLoad !",
445                     e, usr, "GetAttr", this, null, attrName, null, null, "long",
446                     null);
447         }
448         return usr.hasDOGetAttrAccess(this, attrName, value);
449     }
450
451     /**
452      * Check whether the given user is allowed to read
453      * the attribute and the value
454      *
455      * @param attrName The name of the attribute
456      * @param value The current value of the attribute
457      * @param usr The user for security check
458      * @return Whether the given user is allowed to read the attribute
459      *
460      * WebDocWf extension
461      *
462      */

463     public boolean hasDOGetAttrAccess(String JavaDoc attrName, float value, org.webdocwf.dods.access.User usr)
464         throws AccessEvalException {
465         try {
466             checkLoad();
467         } catch (Exception JavaDoc e) {
468             throw new AccessEvalException("Error in hasDoGetAttrAccess/checkLoad !",
469                     e, usr, "GetAttr", this, null, attrName, null, null, "float",
470                     null);
471         }
472         return usr.hasDOGetAttrAccess(this, attrName, value);
473     }
474
475     /**
476      * Check whether the given user is allowed to read
477      * the attribute and the value
478      *
479      * @param attrName The name of the attribute
480      * @param value The current value of the attribute
481      * @param usr The user for security check
482      * @return Whether the given user is allowed to read the attribute
483      *
484      * WebDocWf extension
485      *
486      */

487     public boolean hasDOGetAttrAccess(String JavaDoc attrName, double value, org.webdocwf.dods.access.User usr)
488         throws AccessEvalException {
489         try {
490             checkLoad();
491         } catch (Exception JavaDoc e) {
492             throw new AccessEvalException("Error in hasDoGetAttrAccess/checkLoad !",
493                     e, usr, "GetAttr", this, null, attrName, null, null,
494                     "double", null);
495         }
496         return usr.hasDOGetAttrAccess(this, attrName, value);
497     }
498
499     /**
500      * Check whether the given user is allowed to read
501      * the attribute and the value
502      *
503      * @param attrName The name of the attribute
504      * @param value The current value of the attribute
505      * @param usr The user for security check
506      * @return Whether the given user is allowed to read the attribute
507      *
508      * WebDocWf extension
509      *
510      */

511     public boolean hasDOGetAttrAccess(String JavaDoc attrName, byte[] value, org.webdocwf.dods.access.User usr)
512         throws AccessEvalException {
513         try {
514             checkLoad();
515         } catch (Exception JavaDoc e) {
516             throw new AccessEvalException("Error in hasDoGetAttrAccess/checkLoad !",
517                     e, usr, "GetAttr", this, null, attrName, null, null,
518                     "byte[]", null);
519         }
520         return usr.hasDOGetAttrAccess(this, attrName, value);
521     }
522
523     /**
524      * Check whether the given user is allowed to update
525      * the attribute and the value
526      *
527      * @param attrName The name of the attribute
528      * @param oldValue The current value of the attribute
529      * @param newValue The new value of the attribute
530      * @param usr The user for security check
531      * @return Whether the given user is allowed to update the attribute
532      *
533      * WebDocWf extension
534      *
535      */

536     protected boolean hasDOSetAttrAccess(String JavaDoc attrName, Object JavaDoc oldValue, Object JavaDoc newValue, org.webdocwf.dods.access.User usr)
537         throws AccessEvalException {
538         return usr.hasDOSetAttrAccess(this, attrName, oldValue, newValue);
539     }
540
541     /**
542      * Check whether the given user is allowed to update
543      * the attribute and the value
544      *
545      * @param attrName The name of the attribute
546      * @param oldValue The current value of the attribute
547      * @param newValue The new value of the attribute
548      * @param usr The user for security check
549      * @return Whether the given user is allowed to update the attribute
550      *
551      * WebDocWf extension
552      *
553      */

554     protected boolean hasDOSetAttrAccess(String JavaDoc attrName, boolean oldValue, boolean newValue, org.webdocwf.dods.access.User usr)
555         throws AccessEvalException {
556         return usr.hasDOSetAttrAccess(this, attrName, oldValue, newValue);
557     }
558
559     /**
560      * Check whether the given user is allowed to update
561      * the attribute and the value
562      *
563      * @param attrName The name of the attribute
564      * @param oldValue The current value of the attribute
565      * @param newValue The new value of the attribute
566      * @param usr The user for security check
567      * @return Whether the given user is allowed to update the attribute
568      *
569      * WebDocWf extension
570      *
571      */

572     protected boolean hasDOSetAttrAccess(String JavaDoc attrName, byte oldValue, byte newValue, org.webdocwf.dods.access.User usr)
573         throws AccessEvalException {
574         return usr.hasDOSetAttrAccess(this, attrName, oldValue, newValue);
575     }
576
577     /**
578      * Check whether the given user is allowed to update
579      * the attribute and the value
580      *
581      * @param attrName The name of the attribute
582      * @param oldValue The current value of the attribute
583      * @param newValue The new value of the attribute
584      * @param usr The user for security check
585      * @return Whether the given user is allowed to update the attribute
586      *
587      * WebDocWf extension
588      *
589      */

590     protected boolean hasDOSetAttrAccess(String JavaDoc attrName, short oldValue, short newValue, org.webdocwf.dods.access.User usr)
591         throws AccessEvalException {
592         return usr.hasDOSetAttrAccess(this, attrName, oldValue, newValue);
593     }
594
595     /**
596      * Check whether the given user is allowed to update
597      * the attribute and the value
598      *
599      * @param attrName The name of the attribute
600      * @param oldValue The current value of the attribute
601      * @param newValue The new value of the attribute
602      * @param usr The user for security check
603      * @return Whether the given user is allowed to update the attribute
604      *
605      * WebDocWf extension
606      *
607      */

608     protected boolean hasDOSetAttrAccess(String JavaDoc attrName, int oldValue, int newValue, org.webdocwf.dods.access.User usr)
609         throws AccessEvalException {
610         return usr.hasDOSetAttrAccess(this, attrName, oldValue, newValue);
611     }
612
613     /**
614      * Check whether the given user is allowed to update
615      * the attribute and the value
616      *
617      * @param attrName The name of the attribute
618      * @param oldValue The current value of the attribute
619      * @param newValue The new value of the attribute
620      * @param usr The user for security check
621      * @return Whether the given user is allowed to update the attribute
622      *
623      * WebDocWf extension
624      *
625      */

626     protected boolean hasDOSetAttrAccess(String JavaDoc attrName, long oldValue, long newValue, org.webdocwf.dods.access.User usr)
627         throws AccessEvalException {
628         return usr.hasDOSetAttrAccess(this, attrName, oldValue, newValue);
629     }
630
631     /**
632      * Check whether the given user is allowed to update
633      * the attribute and the value
634      *
635      * @param attrName The name of the attribute
636      * @param oldValue The current value of the attribute
637      * @param newValue The new value of the attribute
638      * @param usr The user for security check
639      * @return Whether the given user is allowed to update the attribute
640      *
641      * WebDocWf extension
642      *
643      */

644     protected boolean hasDOSetAttrAccess(String JavaDoc attrName, float oldValue, float newValue, org.webdocwf.dods.access.User usr)
645         throws AccessEvalException {
646         return usr.hasDOSetAttrAccess(this, attrName, oldValue, newValue);
647     }
648
649     /**
650      * Check whether the given user is allowed to update
651      * the attribute and the value
652      *
653      * @param attrName The name of the attribute
654      * @param oldValue The current value of the attribute
655      * @param newValue The new value of the attribute
656      * @param usr The user for security check
657      * @return Whether the given user is allowed to update the attribute
658      *
659      * WebDocWf extension
660      *
661      */

662     protected boolean hasDOSetAttrAccess(String JavaDoc attrName, double oldValue, double newValue, org.webdocwf.dods.access.User usr)
663         throws AccessEvalException {
664         return usr.hasDOSetAttrAccess(this, attrName, oldValue, newValue);
665     }
666
667     /**
668      * Check whether the given user is allowed to update
669      * the attribute and the value
670      *
671      * @param attrName The name of the attribute
672      * @param oldValue The current value of the attribute
673      * @param newValue The new value of the attribute
674      * @param usr The user for security check
675      * @return Whether the given user is allowed to update the attribute
676      *
677      * WebDocWf extension
678      *
679      */

680     protected boolean hasDOSetAttrAccess(String JavaDoc attrName, byte[] oldValue, byte[] newValue, org.webdocwf.dods.access.User usr)
681         throws AccessEvalException {
682         return usr.hasDOSetAttrAccess(this, attrName, oldValue, newValue);
683     }
684
685     /**
686      * Ensure that the given user is allowed to read
687      * the object in a given pointer
688      *
689      * @param attrName The name of the attribute
690      * @param value The object in the pointer
691      * @param usr The user for security check
692      *
693      * @exception AccessException
694      * The user is not allowed to read the object
695      *
696      * WebDocWf extension
697      *
698      */

699     public void assertDOGetDOValueAccess(String JavaDoc attrName, SecureDO value, org.webdocwf.dods.access.User usr)
700         throws AccessException {
701         if (value != null) {
702             if (!value.hasDOGetAccess(usr)) {
703                 throw new AccessRightException("No access !", usr, "GETDOValue",
704                         this, null, attrName, null, null, null, null);
705             }
706         }
707     }
708
709     /**
710      * Check whether the given user is allowed to read
711      * the object in a given pointer
712      *
713      * @param value The object in the pointer
714      * @param usr The user for security check
715      * @return Whether the given user is allowed to read the object
716      *
717      * WebDocWf extension
718      *
719      */

720     protected boolean hasDOGetDOValueAccess(SecureDO value, org.webdocwf.dods.access.User usr)
721         throws AccessEvalException {
722         return value.hasDOGetAccess(usr);
723     }
724
725     /**
726      * Dummy method for generated datatypes
727      *
728      * WebDocWf extension
729      *
730      */

731     protected boolean hasDOGetDOValueAccess(Object JavaDoc value, org.webdocwf.dods.access.User usr)
732         throws AccessEvalException {
733         if (false) {
734             throw new AccessEvalException("Should never occur !");
735         }
736         return true;
737     }
738
739     /**
740      * Dummy method for generated datatypes
741      *
742      * WebDocWf extension
743      *
744      */

745     protected boolean hasDOGetDOValueAccess(boolean value, org.webdocwf.dods.access.User usr)
746         throws AccessEvalException {
747         if (false) {
748             throw new AccessEvalException("Should never occur !");
749         }
750         return true;
751     }
752
753     /**
754      * Dummy method for generated datatypes
755      *
756      * WebDocWf extension
757      *
758      */

759     protected boolean hasDOGetDOValueAccess(byte value, org.webdocwf.dods.access.User usr)
760         throws AccessEvalException {
761         if (false) {
762             throw new AccessEvalException("Should never occur !");
763         }
764         return true;
765     }
766
767     /**
768      * Dummy method for generated datatypes
769      *
770      * WebDocWf extension
771      *
772      */

773     protected boolean hasDOGetDOValueAccess(short value, org.webdocwf.dods.access.User usr)
774         throws AccessEvalException {
775         if (false) {
776             throw new AccessEvalException("Should never occur !");
777         }
778         return true;
779     }
780
781     /**
782      * Dummy method for generated datatypes
783      *
784      * WebDocWf extension
785      *
786      */

787     protected boolean hasDOGetDOValueAccess(int value, org.webdocwf.dods.access.User usr)
788         throws AccessEvalException {
789         if (false) {
790             throw new AccessEvalException("Should never occur !");
791         }
792         return true;
793     }
794
795     /**
796      * Dummy method for generated datatypes
797      *
798      * WebDocWf extension
799      *
800      */

801     protected boolean hasDOGetDOValueAccess(long value, org.webdocwf.dods.access.User usr)
802         throws AccessEvalException {
803         if (false) {
804             throw new AccessEvalException("Should never occur !");
805         }
806         return true;
807     }
808
809     /**
810      * Dummy method for generated datatypes
811      *
812      * WebDocWf extension
813      *
814      */

815     protected boolean hasDOGetDOValueAccess(float value, org.webdocwf.dods.access.User usr)
816         throws AccessEvalException {
817         if (false) {
818             throw new AccessEvalException("Should never occur !");
819         }
820         return true;
821     }
822
823     /**
824      * Dummy method for generated datatypes
825      *
826      * WebDocWf extension
827      *
828      */

829     protected boolean hasDOGetDOValueAccess(double value, org.webdocwf.dods.access.User usr)
830         throws AccessEvalException {
831         if (false) {
832             throw new AccessEvalException("Should never occur !");
833         }
834         return true;
835     }
836
837     /**
838      * Dummy method for generated datatypes
839      *
840      * WebDocWf extension
841      *
842      */

843     protected boolean hasDOGetDOValueAccess(byte[] value, org.webdocwf.dods.access.User usr)
844         throws AccessEvalException {
845         if (false) {
846             throw new AccessEvalException("Should never occur !");
847         }
848         return true;
849     }
850
851     /**
852      * Dummy method for generated datatypes
853      *
854      * WebDocWf extension
855      *
856      */

857     protected void assertDOGetDOValueAccess(String JavaDoc attrName, Object JavaDoc value, org.webdocwf.dods.access.User usr)
858         throws AccessException {
859         if (false) {
860             throw new AccessEvalException("Should never occur !");
861         }
862     }
863
864     /**
865      * Dummy method for generated datatypes
866      *
867      * WebDocWf extension
868      *
869      */

870     protected void assertDOGetDOValueAccess(String JavaDoc attrName, boolean value, org.webdocwf.dods.access.User usr)
871         throws AccessException {
872         if (false) {
873             throw new AccessEvalException("Should never occur !");
874         }
875     }
876
877     /**
878      * Dummy method for generated datatypes
879      *
880      * WebDocWf extension
881      *
882      */

883     protected void assertDOGetDOValueAccess(String JavaDoc attrName, byte value, org.webdocwf.dods.access.User usr)
884         throws AccessException {
885         if (false) {
886             throw new AccessEvalException("Should never occur !");
887         }
888     }
889
890     /**
891      * Dummy method for generated datatypes
892      *
893      * WebDocWf extension
894      *
895      */

896     protected void assertDOGetDOValueAccess(String JavaDoc attrName, short value, org.webdocwf.dods.access.User usr)
897         throws AccessException {
898         if (false) {
899             throw new AccessEvalException("Should never occur !");
900         }
901     }
902
903     /**
904      * Dummy method for generated datatypes
905      *
906      * WebDocWf extension
907      *
908      */

909     protected void assertDOGetDOValueAccess(String JavaDoc attrName, int value, org.webdocwf.dods.access.User usr)
910         throws AccessException {
911         if (false) {
912             throw new AccessEvalException("Should never occur !");
913         }
914     }
915
916     /**
917      * Dummy method for generated datatypes
918      *
919      * WebDocWf extension
920      *
921      */

922     protected void assertDOGetDOValueAccess(String JavaDoc attrName, long value, org.webdocwf.dods.access.User usr)
923         throws AccessException {
924         if (false) {
925             throw new AccessEvalException("Should never occur !");
926         }
927     }
928
929     /**
930      * Dummy method for generated datatypes
931      *
932      * WebDocWf extension
933      *
934      */

935     protected void assertDOGetDOValueAccess(String JavaDoc attrName, float value, org.webdocwf.dods.access.User usr)
936         throws AccessException {
937         if (false) {
938             throw new AccessEvalException("Should never occur !");
939         }
940     }
941
942     /**
943      * Dummy method for generated datatypes
944      *
945      * WebDocWf extension
946      *
947      */

948     protected void assertDOGetDOValueAccess(String JavaDoc attrName, double value, org.webdocwf.dods.access.User usr)
949         throws AccessException {
950         if (false) {
951             throw new AccessEvalException("Should never occur !");
952         }
953     }
954
955     /**
956      * Dummy method for generated datatypes
957      *
958      * WebDocWf extension
959      *
960      */

961     protected void assertDOGetDOValueAccess(String JavaDoc attrName, byte[] value, org.webdocwf.dods.access.User usr)
962         throws AccessException {
963         if (false) {
964             throw new AccessEvalException("Should never occur !");
965         }
966     }
967
968     /**
969      * Check whether the given user is allowed to
970      * find the object using a query
971      *
972      * @param usr The user for security check
973      * @return Whether the given user is allowed to find the object
974      *
975      * WebDocWf extension
976      *
977      */

978     public boolean hasQueryFindAccess(org.webdocwf.dods.access.User usr)
979         throws AccessEvalException {
980         if (usr == null) {
981             return false;
982         }
983         try {
984             checkLoad();
985         } catch (Exception JavaDoc e) {
986             throw new AccessEvalException("Error in hasQueryFindAccess/checkLoad !",
987                     e, usr, "Query", this, null, null, null, null, null, null);
988         }
989         return usr.hasQueryFindAccess(this);
990     }
991
992     // end of WebDocWf extension for DODS row instance security
993
// WebDocWf enhancement for public versionnumber
994
// The following line has been added:
995
/**
996      * @deprecated Use get_Version()
997      * @return this object's version.
998      */

999     public int getVersion() {
1000        return get_Version();
1001    }
1002
1003    /**
1004     * Returns this object's version.
1005     *
1006     * @return this object's version.
1007     *
1008     * WebDocWf extension
1009     *
1010     */

1011    public int get_Version() {
1012        return super.get_Version();
1013    }
1014
1015    /**
1016     * Returns this object's version.
1017     *
1018     * @param usr The user for security check
1019     * @return this object's version.
1020     *
1021     * WebDocWf extension
1022     *
1023     */

1024    public int get_Version(org.webdocwf.dods.access.User usr)
1025        throws AccessException {
1026        assertDOGetVersionAccess(usr);
1027        return get_Version();
1028    }
1029
1030    /**
1031     * Ensure that the given user is allowed to access the version number
1032     *
1033     * @param usr The user for security check
1034     *
1035     * WebDocWf extension
1036     *
1037     */

1038    public void assertDOGetVersionAccess(org.webdocwf.dods.access.User usr)
1039        throws AccessException {
1040        if (!hasDOGetVersionAccess(usr)) {
1041            throw new AccessRightException("No access !", usr, "GetVersion",
1042                    this, null, null, null, null, null, null);
1043        }
1044    }
1045
1046    /**
1047     * Check whether the given user is allowed to access the version number
1048     *
1049     * @param usr The user for security check
1050     * @return Whether the given user is allowed to access the version number
1051     *
1052     * WebDocWf extension
1053     *
1054     */

1055    public boolean hasDOGetVersionAccess(org.webdocwf.dods.access.User usr)
1056        throws AccessEvalException {
1057        try {
1058            checkLoad();
1059        } catch (Exception JavaDoc e) {
1060            throw new AccessEvalException("Error in hasDOGetVersionAccess/checkLoad !",
1061                    e, usr, "GetVersion", this, null, null, null, null, null,
1062                    null);
1063        }
1064        return usr.hasDOGetVersionAccess(this);
1065    }
1066
1067    /**
1068     * isReadOnly()
1069     * Returns true if the data for this object has been marked read-only.
1070     *
1071     * @param usr The user for security check
1072     * @return Whether the data for this object has been marked read-only.
1073     *
1074     * WebDocWf extension
1075     *
1076     */

1077    public boolean isReadOnly(org.webdocwf.dods.access.User usr)
1078        throws AccessException {
1079        assertDOIsReadOnlyAccess(usr);
1080        return isReadOnly();
1081    }
1082
1083    /**
1084     * Ensure that the given user is allowed to read the readonly flag
1085     *
1086     * @param usr The user for security check
1087     *
1088     * WebDocWf extension
1089     *
1090     */

1091    public void assertDOIsReadOnlyAccess(org.webdocwf.dods.access.User usr)
1092        throws AccessException {
1093        if (!hasDOIsReadOnlyAccess(usr)) {
1094            throw new AccessRightException("No access !", usr, "IsReadOnly",
1095                    this, null, null, null, null, null, null);
1096        }
1097    }
1098
1099    /**
1100     * Check whether the given user is allowed to read the readonly flag
1101     *
1102     * @param usr The user for security check
1103     * @return Whether the given user is allowed to read the readonly flag
1104     *
1105     * WebDocWf extension
1106     *
1107     */

1108    public boolean hasDOIsReadOnlyAccess(org.webdocwf.dods.access.User usr)
1109        throws AccessEvalException {
1110        try {
1111            checkLoad();
1112        } catch (Exception JavaDoc e) {
1113            throw new AccessEvalException("Error in hasDOIsReadOnlyAccess/checkLoad !",
1114                    e, usr, "IsReadOnly", this, null, null, null, null, null,
1115                    null);
1116        }
1117        return usr.hasDOIsReadOnlyAccess(this);
1118    }
1119
1120    /**
1121     * Ensure that the given user is allowed to read the DO existance
1122     *
1123     * @param usr The user for security check
1124     *
1125     * @exception AccessException
1126     * The user is not allowed to read the instance existance
1127     *
1128     * WebDocWf extension
1129     *
1130     */

1131    public void assertDOGetAccess(org.webdocwf.dods.access.User usr)
1132        throws AccessException {
1133        if (!hasDOGetAccess(usr)) {
1134            throw new AccessRightException("No access", usr, "Get", this, null,
1135                    null, null, null, null, null);
1136        }
1137    }
1138
1139    /**
1140     * Check whether the given user is allowed to read the DO existance
1141     *
1142     * @param usr The user for security check
1143     * @return Whether the given user is allowed to read the DO existance
1144     *
1145     * WebDocWf extension
1146     *
1147     */

1148    public boolean hasDOGetAccess(org.webdocwf.dods.access.User usr)
1149        throws AccessEvalException {
1150        try {
1151            checkLoad();
1152        } catch (Exception JavaDoc e) {
1153            throw new AccessEvalException("Error in hasDoGetAccess/checkLoad !",
1154                    e, usr, "Get", this, null, null, null, null, null, null);
1155        }
1156        return usr.hasDOGetAccess(this);
1157    }
1158
1159    // end of WebDocWf extension for DODS row instance security
1160
// WebDocWf extension for writeable fully cached obejcts
1161
/**
1162     * makeReadOnly()
1163     * Mark the object as readonly
1164     *
1165     * @param usr The user for security check
1166     *
1167     * WebDocWf extension
1168     *
1169     */

1170    public void makeReadOnly(org.webdocwf.dods.access.User usr)
1171        throws AccessException {
1172        assertDOMakeReadOnlyAccess(usr);
1173        makeReadOnly();
1174    }
1175
1176    /**
1177     * Ensure that the given user is allowed to set the object readonly
1178     *
1179     * @param usr The user for security check
1180     *
1181     * WebDocWf extension
1182     *
1183     */

1184    public void assertDOMakeReadOnlyAccess(org.webdocwf.dods.access.User usr)
1185        throws AccessException {
1186        if (!hasDOMakeReadOnlyAccess(usr)) {
1187            throw new AccessRightException("No access", usr, "MakeReadOnly",
1188                    this, null, null, null, null, null, null);
1189        }
1190    }
1191
1192    /**
1193     * Check whether the given user is allowed to set the object readonly
1194     *
1195     * @param usr The user for security check
1196     * @return Whether the given user is allowed to set the object readonly
1197     *
1198     * WebDocWf extension
1199     *
1200     */

1201    public boolean hasDOMakeReadOnlyAccess(org.webdocwf.dods.access.User usr)
1202        throws AccessEvalException {
1203        try {
1204            checkLoad();
1205        } catch (Exception JavaDoc e) {
1206            throw new AccessEvalException("Error in hasDOMakeReadOnlyAccess/checkLoad !",
1207                    e, usr, "MakeReadOnly", this, null, null, null, null, null,
1208                    null);
1209        }
1210        return usr.hasDOMakeReadOnlyAccess(this);
1211    }
1212
1213    /**
1214     * Mark the object as readwrite
1215     *
1216     * @param usr The user for security check
1217     *
1218     * WebDocWf extension
1219     *
1220     */

1221    public void makeReadWrite(org.webdocwf.dods.access.User usr)
1222        throws AccessException {
1223        assertDOMakeReadWriteAccess(usr);
1224        makeReadWrite();
1225    }
1226
1227    /**
1228     * Ensure that the given user is allowed to set the object readwrite
1229     *
1230     * @param usr The user for security check
1231     *
1232     * WebDocWf extension
1233     *
1234     */

1235    public void assertDOMakeReadWriteAccess(org.webdocwf.dods.access.User usr)
1236        throws AccessException {
1237        if (!hasDOMakeReadWriteAccess(usr)) {
1238            throw new AccessRightException("No access", usr, "MakeReadWrite",
1239                    this, null, null, null, null, null, null);
1240        }
1241    }
1242
1243    /**
1244     * Check whether the given user is allowed to set the object readwrite
1245     *
1246     * @param usr The user for security check
1247     * @return Whether the given user is allowed to set the object readwrite
1248     *
1249     * WebDocWf extension
1250     *
1251     */

1252    public boolean hasDOMakeReadWriteAccess(org.webdocwf.dods.access.User usr)
1253        throws AccessEvalException {
1254        try {
1255            checkLoad();
1256        } catch (Exception JavaDoc e) {
1257            throw new AccessEvalException("Error in hasDOMakeReadWriteAccess/checkLoad !",
1258                    e, usr, "MakeReadWrite", this, null, null, null, null, null,
1259                    null);
1260        }
1261        return usr.hasDOMakeReadWriteAccess(this);
1262    }
1263    // end of WebDocWf extension for writeable fully cached obejcts
1264
}
1265
Popular Tags