001: /*
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: ARemote.java 4369 2004-03-15 15:02:35Z joaninh $
023: * --------------------------------------------------------------------------
024: */
025:
026: package org.objectweb.jonas.jtests.beans.relation.omb;
027:
028: import java.util.Collection;
029: import java.rmi.RemoteException;
030: import javax.ejb.CreateException;
031: import javax.ejb.EJBObject;
032: import javax.ejb.FinderException;
033:
034: /**
035: * @author S.Chassande-Barrioz, Helene Joanin, Philippe Durieux
036: */
037: public interface ARemote extends EJBObject {
038:
039: String getId() throws RemoteException;
040:
041: /**
042: * It replaces the referenced elements of the relation by the element of the
043: * collection specified.
044: * This method has the transactional attribut TX_SUPPORTS.
045: * @param c is a collection of the primary key of the bean 'B'. Then the
046: * elements are java.lang.String objects.
047: * @throw a FinderException if among the collection a primary key does not
048: * match to a bean.
049: */
050: void assignB(Collection c) throws FinderException, RemoteException;
051:
052: /**
053: * It replaces the referenced elements of the relation by the element of the
054: * collection specified.
055: * This method has the transactional attribut TX_REQUIRES_NEW.
056: * @param c is a collection of the primary key of the bean 'B'. Then the
057: * elements are java.lang.String objects.
058: * @throw a FinderException if among the collection a primary key does not
059: * match to a bean.
060: */
061: void assignBInNewTx(Collection c) throws FinderException,
062: RemoteException;
063:
064: /**
065: * It returns the primary key of the referenced elements.
066: * This method has the transactional attribut TX_SUPPORTS.
067: * @return a collection of the primary key of the bean 'B'. Then the
068: * elements are java.lang.String objects.
069: */
070: Collection retrieveB() throws RemoteException;
071:
072: /**
073: * It returns the primary key of the referenced elements.
074: * @return a collection of the primary key of the bean 'B'. Then the
075: * elements are java.lang.String objects.
076: * Same as retrieveB, but the implementation differs.
077: */
078: Collection retrieveBisB() throws RemoteException;
079:
080: /**
081: * It returns the primary key of the referenced elements.
082: * This method has the transactional attribut TX_REQUIRES_NEW.
083: * @return a collection of the primary key of the bean 'B'. Then the
084: * elements are java.lang.String objects.
085: */
086: Collection retrieveBInNewTx() throws RemoteException;
087:
088: /**
089: * It adds in the multivalued relation the bean B defined by the primary
090: * keys specified by the parameter.
091: * This method has the transactional attribut TX_SUPPORTS.
092: * @throw a FinderException if the primary key does not match to a bean.
093: */
094: void addAllInB(Collection pkbs) throws FinderException,
095: RemoteException;
096:
097: /**
098: * It adds in the multivalued relation the beans B defined by the primary
099: * keys specified by the parameter.
100: * This method has the transactional attribut TX_REQUIRES_NEW.
101: * @throw a FinderException if the primary key does not match to a bean.
102: */
103: void addAllInBInNewTx(Collection pkbs) throws FinderException,
104: RemoteException;
105:
106: /**
107: * It adds in the multivalued relation the bean B defined by its primary
108: * key specified by the parameter.
109: * This method has the transactional attribut TX_SUPPORTS.
110: * @throw a FinderException if the primary key does not match to a bean.
111: */
112: void addInB(String pkb) throws FinderException, RemoteException;
113:
114: /**
115: * It adds in the multivalued relation the bean B defined by its primary
116: * key specified by the parameter.
117: * This method has the transactional attribut TX_REQUIRES_NEW.
118: * @throw a FinderException if the primary key does not match to a bean.
119: */
120: void addInBInNewTx(String pkb) throws FinderException,
121: RemoteException;
122:
123: /**
124: * Creates a new B and add it to the B list of A.
125: */
126: void addNewB(String pkb) throws CreateException, FinderException,
127: RemoteException;
128:
129: /**
130: * It removes from the multivalued relation the bean B defined by its primary
131: * key specified by the parameter.
132: * This method has the transactional attribut TX_SUPPORTS.
133: * @throw a FinderException if the primary key does not match to a bean.
134: */
135: void removeFromB(String pkb) throws FinderException,
136: RemoteException;
137:
138: /**
139: * It removes from the multivalued relation the bean B defined by its primary
140: * key specified by the parameter.
141: * This method has the transactional attribut TX_REQUIRES_NEW.
142: * @throw a FinderException if the primary key does not match to a bean.
143: */
144: void removeFromBInNewTx(String pkb) throws FinderException,
145: RemoteException;
146:
147: /**
148: * It clear the multivalued relation
149: * This method has the transactional attribut TX_SUPPORTS.
150: */
151: void clearB() throws RemoteException;
152:
153: /**
154: * It clear the multivalued relation
155: * This method has the transactional attribut TX_REQUIRES_NEW.
156: */
157: void clearBInNewTx() throws RemoteException;
158:
159: /**
160: * It returns true the multivalued relation contains all the bean B defined
161: * by the primary keys specified by the parameter.
162: * This method has the transactional attribut TX_SUPPORTS.
163: * @throw a FinderException if a primary key does not match to a bean.
164: */
165: boolean containAllInB(Collection pkbs) throws FinderException,
166: RemoteException;
167:
168: /**
169: * It returns true the multivalued relation contains the bean B defined
170: * by the primary key specified by the parameter.
171: * This method has the transactional attribut TX_SUPPORTS.
172: * @throw a FinderException if the primary key does not match to a bean.
173: */
174: boolean containInB(String pkb) throws FinderException,
175: RemoteException;
176:
177: /**
178: * This method check it isn't allowed to reset the pk.
179: * It returns true if the test is ok.
180: * See spec 2.0, chapter 10.3.5, page 134
181: */
182: boolean testResetPkForbidden(String pka) throws RemoteException;
183:
184: }
|