KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > corba > WfResourceIteratorCORBA


1 package org.enhydra.shark.corba;
2
3 import org.enhydra.shark.corba.WorkflowService._WfResourceIteratorImplBase;
4 import org.omg.WfBase.*;
5 import org.omg.WorkflowModel.WfResource;
6
7 /**
8  * Iterator for engine resources.
9  *
10  * @author Sasa Bojanic
11  * @version 1.0
12  */

13 public class WfResourceIteratorCORBA extends _WfResourceIteratorImplBase /*implements
14 Collective.Member */
{
15
16    org.enhydra.shark.api.client.wfservice.WfResourceIterator myIterator;
17
18    private Collective __collective;
19
20    protected WfResourceIteratorCORBA(Collective toJoin,
21                                      org.enhydra.shark.api.client.wfservice.WfResourceIterator iter) throws BaseException {
22       __collective = toJoin;
23       toJoin.__recruit(this);
24       this.myIterator = iter;
25    }
26
27    public String JavaDoc query_expression() throws BaseException {
28       try {
29          return myIterator.query_expression();
30       } catch (Exception JavaDoc ex) {
31          throw new BaseException();
32       }
33    }
34
35    /*
36     * The following names may be used: username
37     */

38    public void set_query_expression(String JavaDoc query) throws BaseException,
39                                                  InvalidQuery {
40       try {
41          myIterator.set_query_expression(query);
42       } catch (org.enhydra.shark.api.client.wfbase.InvalidQuery iq) {
43          throw new InvalidQuery();
44       } catch (Exception JavaDoc ex) {
45          throw new BaseException();
46       }
47    }
48
49    public NameValue[] names_in_expression() throws BaseException {
50       try {
51          return SharkCORBAUtilities.makeCORBANameValueArray(this._orb(),
52                                                             myIterator.names_in_expression());
53       } catch (Exception JavaDoc ex) {
54          throw new BaseException();
55       }
56    }
57
58    public void set_names_in_expression(NameValue[] query) throws BaseException,
59                                                          NameMismatch {
60       try {
61          myIterator.set_names_in_expression(SharkCORBAUtilities.makeMap(query));
62       } catch (org.enhydra.shark.api.client.wfbase.NameMismatch nm) {
63          throw new NameMismatch();
64       } catch (Exception JavaDoc ex) {
65          throw new BaseException();
66       }
67    }
68
69    public String JavaDoc query_grammar() throws BaseException {
70       try {
71          return myIterator.query_grammar();
72       } catch (Exception JavaDoc ex) {
73          throw new BaseException();
74       }
75    }
76
77    public void set_query_grammar(String JavaDoc query_grammmar) throws BaseException,
78                                                        GrammarNotSupported {
79       try {
80          myIterator.set_query_grammar(query_grammmar);
81       } catch (org.enhydra.shark.api.client.wfbase.GrammarNotSupported gns) {
82          throw new GrammarNotSupported();
83       } catch (Exception JavaDoc ex) {
84          throw new BaseException();
85       }
86    }
87
88    public int how_many() throws BaseException {
89       try {
90          return myIterator.how_many();
91       } catch (Exception JavaDoc ex) {
92          throw new BaseException();
93       }
94    }
95
96    public void goto_start() throws BaseException {
97       try {
98          myIterator.goto_start();
99       } catch (Exception JavaDoc ex) {
100          throw new BaseException();
101       }
102    }
103
104    public void goto_end() throws BaseException {
105       try {
106          myIterator.goto_end();
107       } catch (Exception JavaDoc ex) {
108          throw new BaseException();
109       }
110    }
111
112    public WfResource get_next_object() throws BaseException {
113       try {
114          return new WfResourceCORBA(__collective,
115                                     myIterator.get_next_object());
116       } catch (Exception JavaDoc ex) {
117          throw new BaseException();
118       }
119    }
120
121    public WfResource get_previous_object() throws BaseException {
122       try {
123          return new WfResourceCORBA(__collective,
124                                     myIterator.get_previous_object());
125       } catch (Exception JavaDoc ex) {
126          throw new BaseException();
127       }
128    }
129
130    public WfResource[] get_next_n_sequence(int max_number) throws BaseException {
131       try {
132          return SharkCORBAUtilities.makeCORBAResources(__collective,
133                                                        myIterator.get_next_n_sequence(max_number));
134       } catch (Exception JavaDoc ex) {
135          throw new BaseException();
136       }
137    }
138
139    public WfResource[] get_previous_n_sequence(int max_number) throws BaseException {
140       try {
141          return SharkCORBAUtilities.makeCORBAResources(__collective,
142                                                        myIterator.get_previous_n_sequence(max_number));
143       } catch (Exception JavaDoc ex) {
144          throw new BaseException();
145       }
146    }
147
148 }
Popular Tags