001: /* BaseIteratorSSBean.java */
002: package org.enhydra.shark.ejb;
003:
004: import java.util.Map;
005:
006: import org.enhydra.shark.api.client.wfbase.BaseIterator;
007: import org.enhydra.shark.api.client.wfbase.GrammarNotSupported;
008: import org.enhydra.shark.api.client.wfbase.InvalidQuery;
009: import org.enhydra.shark.api.client.wfbase.NameMismatch;
010:
011: /**
012: * Java implementation of OMG's interface. This is how OMG defines it:
013: * <p>
014: * The BaseIterator interface is used to navigate relationships of cardinality
015: * greater than 1 in this specification. It supports specification of a filter
016: * using parameterized query expressions.
017: *
018: * @author V.Puskas
019: * @author S.Bojanic
020: * @author T.Jovanovic
021: * @version 0.1
022: */
023: public abstract class BaseIteratorSSBean implements BaseIterator { // is serializable
024:
025: protected org.enhydra.shark.api.client.wfbase.BaseIterator sharkObj;
026:
027: /**
028: * @ejb:interface-method
029: * view-type="both"
030: * Returns the query expression used to filter the contents of the iterator.
031: */
032: public String query_expression() throws Exception {
033: return sharkObj.query_expression();
034: }
035:
036: /**
037: * @ejb:interface-method
038: * view-type="both"
039: * Defines the query expression used to filter the contents of the iterator.
040: */
041: public void set_query_expression(String query) throws Exception,
042: InvalidQuery {
043: sharkObj.set_query_expression(query);
044: }
045:
046: /**
047: * @ejb:interface-method
048: * view-type="both"
049: * OMG definition: Returns a set of parameters that are used to substitute variables in the
050: * query_expression. The parameters are defined by name-value pairs, where the name
051: * identifies the variable and the value represents the variable value to be substituted.
052: */
053: public Map names_in_expression() throws Exception {
054: return sharkObj.names_in_expression();
055: }
056:
057: /**
058: * @ejb:interface-method
059: * view-type="both"
060: * NOTE: It does not have any influence on querying in our implementations.
061: * <p>
062: * OMG definition: Defines a set of parameters that are used to substitute variables in the
063: * query_expression. The parameters are defined by name-value pairs, where the name
064: * identifies the variable and the value represents the variable value to be substituted.
065: */
066: public void set_names_in_expression(Map query) throws Exception,
067: NameMismatch {
068: sharkObj.set_names_in_expression(query);
069: }
070:
071: /**
072: * @ejb:interface-method
073: * view-type="both"
074: * OMG definition: The query_grammar attribute identifies the query grammar
075: * used to define the query expression. The Constraint Language defined by
076: * the OMG Object Trading Service is used as the mandatory query grammar in
077: * this specification; implementations of the WfM Facility may support
078: * additional query grammars. The Trader Constraint Language is identified
079: * via the string TCL.
080: */
081: public String query_grammar() throws Exception {
082: return sharkObj.query_grammar();
083: }
084:
085: /**
086: * @ejb:interface-method
087: * view-type="both"
088: * OMG definition: The query_grammar attribute identifies the query grammar
089: * used to define the query expression. The Constraint Language defined by
090: * the OMG Object Trading Service is used as the mandatory query gramma in
091: * this specification; implementations of the WfM Facility may support
092: * additional query grammars. The Trader Constraint Language is identified
093: * via the string TCL.
094: */
095: public void set_query_grammar(String query_grammmar)
096: throws Exception, GrammarNotSupported {
097: sharkObj.set_query_grammar(query_grammmar);
098: }
099:
100: /**
101: * @ejb:interface-method
102: * view-type="both"
103: * Returns the number of elements in the collection.
104: */
105: public int how_many() throws Exception {
106: return sharkObj.how_many();
107: }
108:
109: /**
110: * @ejb:interface-method
111: * view-type="both"
112: * Positions the iterator such that the next "next" retrieval will retrieve
113: * the first element in he collection.
114: */
115: public void goto_start() throws Exception {
116: sharkObj.goto_start();
117: }
118:
119: /**
120: * @ejb:interface-method
121: * view-type="both"
122: * Positions the iterator such that the next "previous" retrieval will
123: * retrieve the last element in the collection.
124: */
125: public void goto_end() throws Exception {
126: sharkObj.goto_end();
127: }
128:
129: }
|