1 21 22 package org.opensubsystems.patterns.mappeddata.logic.impl; 23 24 import java.rmi.RemoteException ; 25 26 import org.opensubsystems.core.data.DataObject; 27 import org.opensubsystems.core.data.ModifiableDataObject; 28 import org.opensubsystems.core.error.OSSException; 29 import org.opensubsystems.core.logic.impl.StatelessControllerImpl; 30 import org.opensubsystems.core.util.CallContext; 31 import org.opensubsystems.core.util.ThreeIntStruct; 32 import org.opensubsystems.patterns.mappeddata.data.MappedData; 33 import org.opensubsystems.patterns.mappeddata.logic.MappingController; 34 import org.opensubsystems.patterns.mappeddata.persist.MappingFactory; 35 36 57 public class MappingControllerImpl extends StatelessControllerImpl 58 implements MappingController 59 { 60 62 68 protected MappingFactory m_mappingFactory; 69 70 72 75 private static final long serialVersionUID = -6311825396478182048L; 76 77 79 82 public MappingControllerImpl( 83 ) 84 { 85 super(); 86 87 m_mappingFactory = null; 90 } 91 92 94 100 public DataObject get( 101 int iId 102 ) throws OSSException, 103 RemoteException 104 { 105 MappedData data = null; 106 107 data = (MappedData)m_mappingFactory.get( 108 iId, CallContext.getInstance().getCurrentDomainId()); 109 110 return data; 111 } 112 113 119 public DataObject create( 120 DataObject data 121 ) throws OSSException, 122 RemoteException 123 { 124 MappedData createddata = null; 125 126 createddata = (MappedData)m_mappingFactory.create(data); 127 128 return createddata; 129 } 130 131 137 public ModifiableDataObject save( 138 ModifiableDataObject data 139 ) throws OSSException, 140 RemoteException 141 { 142 MappedData updatedddata = null; 143 144 updatedddata = (MappedData)m_mappingFactory.create(data); 145 146 return updatedddata; 147 } 148 149 155 public void delete( 156 int iId 157 ) throws OSSException, 158 RemoteException 159 { 160 m_mappingFactory.delete(iId, 161 CallContext.getInstance().getCurrentDomainId()); 162 } 163 164 170 public void create( 171 ThreeIntStruct tisValues 172 ) throws OSSException, 173 RemoteException 174 { 175 m_mappingFactory.create(tisValues); 176 } 177 178 184 public void delete( 185 ThreeIntStruct tisValues 186 ) throws OSSException, 187 RemoteException 188 { 189 m_mappingFactory.delete(tisValues); 190 } 191 192 198 public int[] getMappedData( 199 int iId, 200 int iMappingType 201 ) throws OSSException, 202 RemoteException 203 { 204 int[] arrReturn = null; 205 206 arrReturn = m_mappingFactory.getMappedData(iId, iMappingType); 207 208 return arrReturn; 209 } 210 } 211 | Popular Tags |