org.opensubsystems.patterns.mappeddata.logic.impl
Class MappingControllerImpl

java.lang.Object
  extended by org.opensubsystems.core.logic.impl.StatelessControllerImpl
      extended by org.opensubsystems.patterns.mappeddata.logic.impl.MappingControllerImpl
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean, org.opensubsystems.core.logic.BasicDataController, org.opensubsystems.core.logic.DataController, org.opensubsystems.core.logic.ModifiableDataController, org.opensubsystems.core.logic.StatelessController, MappingController

public class MappingControllerImpl
extends org.opensubsystems.core.logic.impl.StatelessControllerImpl
implements MappingController

Implementation of MappingController interface to manage mapped data records.

Version:
$Id: MappingControllerImpl.java,v 1.4 2007/01/28 06:54:52 bastafidli Exp $
Author:
Julian Legeny
See Also:
Serialized Form
Code reviewer:
Miro Halas
Code reviewed:
1.1 2006/07/03 19:53:01 jlegeny
XDoclet tag:
type="Stateless" name="MappingController" jndi-name="org.opensubsystems.patterns.mappeddata.logic.MappingControllerRemote" local-jndi-name="org.opensubsystems.patterns.mappeddata.logic.MappingController"
XDoclet tag:
local-extends="javax.ejb.EJBLocalHome" extends="javax.ejb.EJBHome"
XDoclet tag:
local-extends="javax.ejb.EJBLocalObject, org.opensubsystems.patterns.mappeddata.logic.MappingController" extends="javax.ejb.EJBObject, org.opensubsystems.patterns.mappeddata.logic.MappingController"
XDoclet tag:
ejb-name="MappingController" jndi-name="org.opensubsystems.patterns.mappeddata.logic.MappingControllerRemote"

Field Summary
protected  MappingFactory m_mappingFactory
          Factory to use to execute persistence operations.
 
Constructor Summary
MappingControllerImpl()
          Default constructor.
 
Method Summary
 org.opensubsystems.core.data.DataObject create(org.opensubsystems.core.data.DataObject data)
          
 void create(org.opensubsystems.core.util.ThreeIntStruct tisValues)
          Create mapped data.
 void delete(int iId)
          Delete mapped data
 void delete(org.opensubsystems.core.util.ThreeIntStruct tisValues)
          Delete mapped data
 org.opensubsystems.core.data.DataObject get(int iId)
          
 int[] getMappedData(int iId, int iMappingType)
          Get array of mapped records for particular ID.
 org.opensubsystems.core.data.ModifiableDataObject save(org.opensubsystems.core.data.ModifiableDataObject data)
          
 
Methods inherited from class org.opensubsystems.core.logic.impl.StatelessControllerImpl
constructor, ejbActivate, ejbPassivate, ejbRemove, setSessionContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensubsystems.core.logic.StatelessController
constructor
 

Field Detail

m_mappingFactory

protected MappingFactory m_mappingFactory
Factory to use to execute persistence operations. Inherited class from this base class has to have instantiated particular factory that will be used here. It has to be done within the method constructor().

Constructor Detail

MappingControllerImpl

public MappingControllerImpl()
Default constructor.

Method Detail

get

public org.opensubsystems.core.data.DataObject get(int iId)
                                            throws org.opensubsystems.core.error.OSSException,
                                                   java.rmi.RemoteException

Specified by:
get in interface org.opensubsystems.core.logic.DataController
Throws:
org.opensubsystems.core.error.OSSException
java.rmi.RemoteException
XDoclet tag:
XDoclet tag:
type="Supports"

create

public org.opensubsystems.core.data.DataObject create(org.opensubsystems.core.data.DataObject data)
                                               throws org.opensubsystems.core.error.OSSException,
                                                      java.rmi.RemoteException

Specified by:
create in interface org.opensubsystems.core.logic.BasicDataController
Throws:
org.opensubsystems.core.error.OSSException
java.rmi.RemoteException
XDoclet tag:
XDoclet tag:
type="Required"

save

public org.opensubsystems.core.data.ModifiableDataObject save(org.opensubsystems.core.data.ModifiableDataObject data)
                                                       throws org.opensubsystems.core.error.OSSException,
                                                              java.rmi.RemoteException

Specified by:
save in interface org.opensubsystems.core.logic.ModifiableDataController
Throws:
org.opensubsystems.core.error.OSSException
java.rmi.RemoteException
XDoclet tag:
XDoclet tag:
type="Required"

delete

public void delete(int iId)
            throws org.opensubsystems.core.error.OSSException,
                   java.rmi.RemoteException
Delete mapped data

Specified by:
delete in interface org.opensubsystems.core.logic.BasicDataController
Specified by:
delete in interface MappingController
Parameters:
iId - - mapped data ID to be deleted. This is neither id1 nor id2 but the id of the record representing the relation.
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
java.rmi.RemoteException - - required since this method can be called remotely
XDoclet tag:
XDoclet tag:
type="Required"

create

public void create(org.opensubsystems.core.util.ThreeIntStruct tisValues)
            throws org.opensubsystems.core.error.OSSException,
                   java.rmi.RemoteException
Create mapped data.

Specified by:
create in interface MappingController
Parameters:
tisValues - - IDs and mapping type that has to be added into mapping table 1st value = mapped ID from first table 2nd value = mapped ID from second table 3rd value = mapping type
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured creating mapped data
java.rmi.RemoteException - - required since this method can be called remotely
XDoclet tag:
XDoclet tag:
type="Required"

delete

public void delete(org.opensubsystems.core.util.ThreeIntStruct tisValues)
            throws org.opensubsystems.core.error.OSSException,
                   java.rmi.RemoteException
Delete mapped data

Specified by:
delete in interface MappingController
Parameters:
tisValues - - IDs and mapping type that has to be added into mapping table 1st value = mapped ID from first table 2nd value = mapped ID from second table 3rd value = mapping type
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
java.rmi.RemoteException - - required since this method can be called remotely
XDoclet tag:
XDoclet tag:
type="Required"

getMappedData

public int[] getMappedData(int iId,
                           int iMappingType)
                    throws org.opensubsystems.core.error.OSSException,
                           java.rmi.RemoteException
Get array of mapped records for particular ID.

Specified by:
getMappedData in interface MappingController
Parameters:
iId - - Id of the first data object in relation for which we want to retrieve Ids of the second objects in relation. This is id1 specified during creation.
iMappingType - - mapping type the retrieved data belongs to
Returns:
int[] - array of ids of mapped data objects, these are id2 specified during creation.
Throws:
org.opensubsystems.core.error.OSSException - - error during getting mapped data
java.rmi.RemoteException - - required since this method can be called remotely
XDoclet tag:
XDoclet tag:
type="Supports"


Copyright © 2003 - 2006 OpenSubsystems s.r.o.