0001 //
0002 // This file is generated by MetaBoss Ver 1.4.0001 at Thu Dec 15 22:36:54 EST 2005
0003 // MetaBoss is Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
0004 // Content of this file is Copyright 2000-2005 © Softaris Pty. Ltd. All Rights Reserved.
0005 // This content is licensed under Open Source Gnu Public License (GPL)
0006 // Full terms and conditions of GPL can be found found at www.gnu.org
0007 //
0008 // The generator class is com.metaboss.sdlctools.services.codegeneration.serviceimplementationgenerator.xmldevsimulator.BSServiceImplementationGeneratorImpl
0009 package com.almamater.crs.services.coursesdomainsupport.generatedimpl.xmldevsimulator;
0010
0011 import java.io.File;
0012 import java.io.FileFilter;
0013 import java.io.FileInputStream;
0014 import java.io.IOException;
0015 import java.io.StringReader;
0016 import java.io.StringWriter;
0017 import java.util.Arrays;
0018 import java.util.Comparator;
0019 import org.xml.sax.SAXException;
0020 import javax.xml.transform.OutputKeys;
0021 import javax.xml.transform.Transformer;
0022 import javax.xml.transform.TransformerFactory;
0023 import javax.xml.transform.TransformerException;
0024 import javax.xml.transform.TransformerConfigurationException;
0025 import javax.xml.transform.stream.StreamResult;
0026 import javax.xml.transform.stream.StreamSource;
0027 import org.apache.commons.logging.Log;
0028 import org.apache.commons.logging.LogFactory;
0029 import com.metaboss.util.StringUtils;
0030 import com.metaboss.enterprise.bs.BSException;
0031 import com.metaboss.enterprise.bs.BSUndefinedSystemPropertyException;
0032 import com.metaboss.enterprise.bs.BSUnexpectedProgramConditionException;
0033 import com.metaboss.enterprise.bs.BSUnexpectedTransactionStatusException;
0034 import com.metaboss.enterprise.bs.BSNamingAndDirectoryServiceInvocationException;
0035 import com.metaboss.enterprise.bs.BSTransactionServiceInvocationException;
0036 import com.metaboss.enterprise.bs.BSTransactionRolledBackException;
0037 import com.metaboss.enterprise.datatypes.DataTypeValidationException;
0038
0039 /** This class contains a xml base development simulator implementation generator.
0040 * This implementation is used to serve dummy responses to requests.
0041 * Having received the request, dev simulator will lookup xml or xsl file in the specified directory.
0042 * The name of this file will have to be the same as OperationRef and extension must be xml or xsl
0043 * If xsl file is found, its contents will be used as a template to translate input document. The result
0044 * of transformation will be packaged in the response.
0045 * If xml file is found (second preference)- its contents will be packaged into the response without any preprocessing.
0046 * <p> Note that the documents used in this implementation are governed by schema generated in the generic dom adapter.
0047 * generic xmlstrings adapter and genericdomadapter translators are used to translate data between input and output structures and.
0048 * xml files.</p> */
0049 public class BSDataManagementImpl implements com.almamater.crs.services.coursesdomainsupport.BSDataManagement
0050 {
0051
0052 private static final Log sLogger = LogFactory.getLog(BSDataManagementImpl.class);
0053 private static final String sDataDirectoryPathEnvironmentPropertyName = "com.almamater.crs.services.coursesdomainsupport.generatedimpl.xmldevsimulator.DataDirectoryPath";
0054 private File mTestDataDirectory = null;
0055 private TransformerFactory mTransformerFactory = null;
0056
0057 /** Constructor. Has package visibility. Instances of this class must be created
0058 * via object factory class located in the same package */
0059 BSDataManagementImpl(java.util.Hashtable pEnvironment) throws Exception
0060 {
0061 String lTestDataDirectoryPath = null;
0062 if (pEnvironment.containsKey(sDataDirectoryPathEnvironmentPropertyName))
0063 lTestDataDirectoryPath = (String)pEnvironment.get(sDataDirectoryPathEnvironmentPropertyName);
0064 else
0065 if (System.getProperty(sDataDirectoryPathEnvironmentPropertyName) != null)
0066 lTestDataDirectoryPath = System.getProperty(sDataDirectoryPathEnvironmentPropertyName);
0067 else
0068 throw new BSUndefinedSystemPropertyException("Property " + sDataDirectoryPathEnvironmentPropertyName + " is not defined in the context or in the system properties");
0069 mTestDataDirectory = new File(lTestDataDirectoryPath).getAbsoluteFile();
0070 if (!mTestDataDirectory.exists())
0071 sLogger.error("Property " + sDataDirectoryPathEnvironmentPropertyName + " is defined, but directory it is pointing to does not exists. Directory: " + mTestDataDirectory.getAbsolutePath());
0072 else
0073 if (!mTestDataDirectory.canRead())
0074 sLogger.error("Property " + sDataDirectoryPathEnvironmentPropertyName + " is defined, but directory it is pointing to is unreadable. Directory: " + mTestDataDirectory.getAbsolutePath());
0075 else
0076 sLogger.info("Will look for simulated data files in " + mTestDataDirectory.getAbsolutePath() + " directory.");
0077 mTransformerFactory = TransformerFactory.newInstance();
0078 }
0079
0080 private File mLastDataFileForgetStudent = null;
0081
0082 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#getStudent(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetStudentInput) getStudent} method and implements
0083 * xml file based functionality, which generates operation results */
0084 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetStudentResult getStudent( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetStudentInput pInput) throws BSException
0085 {
0086 if ((mLastDataFileForgetStudent = getNextDataFile(mLastDataFileForgetStudent,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.GetStudent")) == null)
0087 {
0088 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getStudent] operation invocation. Returning empty result due to data file absence.");
0089 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetStudentResult();
0090 }
0091 try
0092 {
0093 if (mLastDataFileForgetStudent.getName().toLowerCase().endsWith(".xml"))
0094 {
0095 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getStudent] operation invocation. Returning result from " + mLastDataFileForgetStudent.getName() + " file.");
0096 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetStudentResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForgetStudent)));
0097 }
0098 else
0099 if (mLastDataFileForgetStudent.getName().toLowerCase().endsWith(".xsl"))
0100 {
0101 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getStudent] operation invocation. Returning result from " + mLastDataFileForgetStudent.getName() + " file.");
0102 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetStudentInput.toXMLString(pInput);
0103 StringWriter lOutputWriter = new StringWriter();
0104 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForgetStudent));
0105 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
0106 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
0107 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
0108 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
0109 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
0110 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetStudentResult.fromXMLString(lOutputWriter.toString());
0111 }
0112 }
0113 catch(DataTypeValidationException e)
0114 {
0115 sLogger.error("Data validation error while processing " + mLastDataFileForgetStudent.getName() + " file.", e);
0116 }
0117 catch(SAXException e)
0118 {
0119 sLogger.error("XML parsing error while processing " + mLastDataFileForgetStudent.getName() + " file.", e);
0120 }
0121 catch(TransformerConfigurationException e)
0122 {
0123 sLogger.error("Template transformer creation error while processing " + mLastDataFileForgetStudent.getName() + " file.", e);
0124 }
0125 catch(TransformerException e)
0126 {
0127 sLogger.error("Template transformation error while processing " + mLastDataFileForgetStudent.getName() + " file.", e);
0128 }
0129 catch(IOException e)
0130 {
0131 sLogger.error("Error reading " + mLastDataFileForgetStudent.getName() + " file.", e);
0132 }
0133 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetStudentResult();
0134 }
0135
0136 private File mLastDataFileForcreateStudent = null;
0137
0138 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#createStudent(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STCreateStudentInput) createStudent} method and implements
0139 * xml file based functionality, which generates operation results */
0140 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STCreateStudentResult createStudent( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STCreateStudentInput pInput) throws BSException
0141 {
0142 if ((mLastDataFileForcreateStudent = getNextDataFile(mLastDataFileForcreateStudent,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.CreateStudent")) == null)
0143 {
0144 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[createStudent] operation invocation. Returning empty result due to data file absence.");
0145 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STCreateStudentResult();
0146 }
0147 try
0148 {
0149 if (mLastDataFileForcreateStudent.getName().toLowerCase().endsWith(".xml"))
0150 {
0151 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[createStudent] operation invocation. Returning result from " + mLastDataFileForcreateStudent.getName() + " file.");
0152 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTCreateStudentResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForcreateStudent)));
0153 }
0154 else
0155 if (mLastDataFileForcreateStudent.getName().toLowerCase().endsWith(".xsl"))
0156 {
0157 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[createStudent] operation invocation. Returning result from " + mLastDataFileForcreateStudent.getName() + " file.");
0158 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTCreateStudentInput.toXMLString(pInput);
0159 StringWriter lOutputWriter = new StringWriter();
0160 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForcreateStudent));
0161 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
0162 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
0163 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
0164 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
0165 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
0166 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTCreateStudentResult.fromXMLString(lOutputWriter.toString());
0167 }
0168 }
0169 catch(DataTypeValidationException e)
0170 {
0171 sLogger.error("Data validation error while processing " + mLastDataFileForcreateStudent.getName() + " file.", e);
0172 }
0173 catch(SAXException e)
0174 {
0175 sLogger.error("XML parsing error while processing " + mLastDataFileForcreateStudent.getName() + " file.", e);
0176 }
0177 catch(TransformerConfigurationException e)
0178 {
0179 sLogger.error("Template transformer creation error while processing " + mLastDataFileForcreateStudent.getName() + " file.", e);
0180 }
0181 catch(TransformerException e)
0182 {
0183 sLogger.error("Template transformation error while processing " + mLastDataFileForcreateStudent.getName() + " file.", e);
0184 }
0185 catch(IOException e)
0186 {
0187 sLogger.error("Error reading " + mLastDataFileForcreateStudent.getName() + " file.", e);
0188 }
0189 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STCreateStudentResult();
0190 }
0191
0192 private File mLastDataFileFordeleteStudent = null;
0193
0194 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#deleteStudent(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STDeleteStudentInput) deleteStudent} method and implements
0195 * xml file based functionality, which generates operation results */
0196 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STDeleteStudentResult deleteStudent( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STDeleteStudentInput pInput) throws BSException
0197 {
0198 if ((mLastDataFileFordeleteStudent = getNextDataFile(mLastDataFileFordeleteStudent,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.DeleteStudent")) == null)
0199 {
0200 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[deleteStudent] operation invocation. Returning empty result due to data file absence.");
0201 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STDeleteStudentResult();
0202 }
0203 try
0204 {
0205 if (mLastDataFileFordeleteStudent.getName().toLowerCase().endsWith(".xml"))
0206 {
0207 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[deleteStudent] operation invocation. Returning result from " + mLastDataFileFordeleteStudent.getName() + " file.");
0208 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTDeleteStudentResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileFordeleteStudent)));
0209 }
0210 else
0211 if (mLastDataFileFordeleteStudent.getName().toLowerCase().endsWith(".xsl"))
0212 {
0213 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[deleteStudent] operation invocation. Returning result from " + mLastDataFileFordeleteStudent.getName() + " file.");
0214 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTDeleteStudentInput.toXMLString(pInput);
0215 StringWriter lOutputWriter = new StringWriter();
0216 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileFordeleteStudent));
0217 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
0218 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
0219 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
0220 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
0221 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
0222 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTDeleteStudentResult.fromXMLString(lOutputWriter.toString());
0223 }
0224 }
0225 catch(DataTypeValidationException e)
0226 {
0227 sLogger.error("Data validation error while processing " + mLastDataFileFordeleteStudent.getName() + " file.", e);
0228 }
0229 catch(SAXException e)
0230 {
0231 sLogger.error("XML parsing error while processing " + mLastDataFileFordeleteStudent.getName() + " file.", e);
0232 }
0233 catch(TransformerConfigurationException e)
0234 {
0235 sLogger.error("Template transformer creation error while processing " + mLastDataFileFordeleteStudent.getName() + " file.", e);
0236 }
0237 catch(TransformerException e)
0238 {
0239 sLogger.error("Template transformation error while processing " + mLastDataFileFordeleteStudent.getName() + " file.", e);
0240 }
0241 catch(IOException e)
0242 {
0243 sLogger.error("Error reading " + mLastDataFileFordeleteStudent.getName() + " file.", e);
0244 }
0245 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STDeleteStudentResult();
0246 }
0247
0248 private File mLastDataFileForgetAllStudentsCount = null;
0249
0250 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#getAllStudentsCount(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllStudentsCountInput) getAllStudentsCount} method and implements
0251 * xml file based functionality, which generates operation results */
0252 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllStudentsCountResult getAllStudentsCount( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllStudentsCountInput pInput) throws BSException
0253 {
0254 if ((mLastDataFileForgetAllStudentsCount = getNextDataFile(mLastDataFileForgetAllStudentsCount,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.GetAllStudentsCount")) == null)
0255 {
0256 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllStudentsCount] operation invocation. Returning empty result due to data file absence.");
0257 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllStudentsCountResult();
0258 }
0259 try
0260 {
0261 if (mLastDataFileForgetAllStudentsCount.getName().toLowerCase().endsWith(".xml"))
0262 {
0263 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllStudentsCount] operation invocation. Returning result from " + mLastDataFileForgetAllStudentsCount.getName() + " file.");
0264 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllStudentsCountResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForgetAllStudentsCount)));
0265 }
0266 else
0267 if (mLastDataFileForgetAllStudentsCount.getName().toLowerCase().endsWith(".xsl"))
0268 {
0269 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllStudentsCount] operation invocation. Returning result from " + mLastDataFileForgetAllStudentsCount.getName() + " file.");
0270 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllStudentsCountInput.toXMLString(pInput);
0271 StringWriter lOutputWriter = new StringWriter();
0272 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForgetAllStudentsCount));
0273 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
0274 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
0275 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
0276 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
0277 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
0278 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllStudentsCountResult.fromXMLString(lOutputWriter.toString());
0279 }
0280 }
0281 catch(DataTypeValidationException e)
0282 {
0283 sLogger.error("Data validation error while processing " + mLastDataFileForgetAllStudentsCount.getName() + " file.", e);
0284 }
0285 catch(SAXException e)
0286 {
0287 sLogger.error("XML parsing error while processing " + mLastDataFileForgetAllStudentsCount.getName() + " file.", e);
0288 }
0289 catch(TransformerConfigurationException e)
0290 {
0291 sLogger.error("Template transformer creation error while processing " + mLastDataFileForgetAllStudentsCount.getName() + " file.", e);
0292 }
0293 catch(TransformerException e)
0294 {
0295 sLogger.error("Template transformation error while processing " + mLastDataFileForgetAllStudentsCount.getName() + " file.", e);
0296 }
0297 catch(IOException e)
0298 {
0299 sLogger.error("Error reading " + mLastDataFileForgetAllStudentsCount.getName() + " file.", e);
0300 }
0301 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllStudentsCountResult();
0302 }
0303
0304 private File mLastDataFileForgetAllStudents = null;
0305
0306 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#getAllStudents(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllStudentsInput) getAllStudents} method and implements
0307 * xml file based functionality, which generates operation results */
0308 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllStudentsResult getAllStudents( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllStudentsInput pInput) throws BSException
0309 {
0310 if ((mLastDataFileForgetAllStudents = getNextDataFile(mLastDataFileForgetAllStudents,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.GetAllStudents")) == null)
0311 {
0312 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllStudents] operation invocation. Returning empty result due to data file absence.");
0313 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllStudentsResult();
0314 }
0315 try
0316 {
0317 if (mLastDataFileForgetAllStudents.getName().toLowerCase().endsWith(".xml"))
0318 {
0319 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllStudents] operation invocation. Returning result from " + mLastDataFileForgetAllStudents.getName() + " file.");
0320 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllStudentsResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForgetAllStudents)));
0321 }
0322 else
0323 if (mLastDataFileForgetAllStudents.getName().toLowerCase().endsWith(".xsl"))
0324 {
0325 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllStudents] operation invocation. Returning result from " + mLastDataFileForgetAllStudents.getName() + " file.");
0326 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllStudentsInput.toXMLString(pInput);
0327 StringWriter lOutputWriter = new StringWriter();
0328 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForgetAllStudents));
0329 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
0330 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
0331 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
0332 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
0333 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
0334 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllStudentsResult.fromXMLString(lOutputWriter.toString());
0335 }
0336 }
0337 catch(DataTypeValidationException e)
0338 {
0339 sLogger.error("Data validation error while processing " + mLastDataFileForgetAllStudents.getName() + " file.", e);
0340 }
0341 catch(SAXException e)
0342 {
0343 sLogger.error("XML parsing error while processing " + mLastDataFileForgetAllStudents.getName() + " file.", e);
0344 }
0345 catch(TransformerConfigurationException e)
0346 {
0347 sLogger.error("Template transformer creation error while processing " + mLastDataFileForgetAllStudents.getName() + " file.", e);
0348 }
0349 catch(TransformerException e)
0350 {
0351 sLogger.error("Template transformation error while processing " + mLastDataFileForgetAllStudents.getName() + " file.", e);
0352 }
0353 catch(IOException e)
0354 {
0355 sLogger.error("Error reading " + mLastDataFileForgetAllStudents.getName() + " file.", e);
0356 }
0357 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllStudentsResult();
0358 }
0359
0360 private File mLastDataFileForgetSubsetOfStudents = null;
0361
0362 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#getSubsetOfStudents(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetSubsetOfStudentsInput) getSubsetOfStudents} method and implements
0363 * xml file based functionality, which generates operation results */
0364 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetSubsetOfStudentsResult getSubsetOfStudents( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetSubsetOfStudentsInput pInput) throws BSException
0365 {
0366 if ((mLastDataFileForgetSubsetOfStudents = getNextDataFile(mLastDataFileForgetSubsetOfStudents,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.GetSubsetOfStudents")) == null)
0367 {
0368 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getSubsetOfStudents] operation invocation. Returning empty result due to data file absence.");
0369 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetSubsetOfStudentsResult();
0370 }
0371 try
0372 {
0373 if (mLastDataFileForgetSubsetOfStudents.getName().toLowerCase().endsWith(".xml"))
0374 {
0375 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getSubsetOfStudents] operation invocation. Returning result from " + mLastDataFileForgetSubsetOfStudents.getName() + " file.");
0376 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetSubsetOfStudentsResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForgetSubsetOfStudents)));
0377 }
0378 else
0379 if (mLastDataFileForgetSubsetOfStudents.getName().toLowerCase().endsWith(".xsl"))
0380 {
0381 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getSubsetOfStudents] operation invocation. Returning result from " + mLastDataFileForgetSubsetOfStudents.getName() + " file.");
0382 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetSubsetOfStudentsInput.toXMLString(pInput);
0383 StringWriter lOutputWriter = new StringWriter();
0384 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForgetSubsetOfStudents));
0385 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
0386 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
0387 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
0388 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
0389 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
0390 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetSubsetOfStudentsResult.fromXMLString(lOutputWriter.toString());
0391 }
0392 }
0393 catch(DataTypeValidationException e)
0394 {
0395 sLogger.error("Data validation error while processing " + mLastDataFileForgetSubsetOfStudents.getName() + " file.", e);
0396 }
0397 catch(SAXException e)
0398 {
0399 sLogger.error("XML parsing error while processing " + mLastDataFileForgetSubsetOfStudents.getName() + " file.", e);
0400 }
0401 catch(TransformerConfigurationException e)
0402 {
0403 sLogger.error("Template transformer creation error while processing " + mLastDataFileForgetSubsetOfStudents.getName() + " file.", e);
0404 }
0405 catch(TransformerException e)
0406 {
0407 sLogger.error("Template transformation error while processing " + mLastDataFileForgetSubsetOfStudents.getName() + " file.", e);
0408 }
0409 catch(IOException e)
0410 {
0411 sLogger.error("Error reading " + mLastDataFileForgetSubsetOfStudents.getName() + " file.", e);
0412 }
0413 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetSubsetOfStudentsResult();
0414 }
0415
0416 private File mLastDataFileForupdateStudent = null;
0417
0418 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#updateStudent(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STUpdateStudentInput) updateStudent} method and implements
0419 * xml file based functionality, which generates operation results */
0420 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STUpdateStudentResult updateStudent( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STUpdateStudentInput pInput) throws BSException
0421 {
0422 if ((mLastDataFileForupdateStudent = getNextDataFile(mLastDataFileForupdateStudent,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.UpdateStudent")) == null)
0423 {
0424 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[updateStudent] operation invocation. Returning empty result due to data file absence.");
0425 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STUpdateStudentResult();
0426 }
0427 try
0428 {
0429 if (mLastDataFileForupdateStudent.getName().toLowerCase().endsWith(".xml"))
0430 {
0431 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[updateStudent] operation invocation. Returning result from " + mLastDataFileForupdateStudent.getName() + " file.");
0432 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTUpdateStudentResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForupdateStudent)));
0433 }
0434 else
0435 if (mLastDataFileForupdateStudent.getName().toLowerCase().endsWith(".xsl"))
0436 {
0437 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[updateStudent] operation invocation. Returning result from " + mLastDataFileForupdateStudent.getName() + " file.");
0438 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTUpdateStudentInput.toXMLString(pInput);
0439 StringWriter lOutputWriter = new StringWriter();
0440 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForupdateStudent));
0441 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
0442 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
0443 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
0444 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
0445 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
0446 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTUpdateStudentResult.fromXMLString(lOutputWriter.toString());
0447 }
0448 }
0449 catch(DataTypeValidationException e)
0450 {
0451 sLogger.error("Data validation error while processing " + mLastDataFileForupdateStudent.getName() + " file.", e);
0452 }
0453 catch(SAXException e)
0454 {
0455 sLogger.error("XML parsing error while processing " + mLastDataFileForupdateStudent.getName() + " file.", e);
0456 }
0457 catch(TransformerConfigurationException e)
0458 {
0459 sLogger.error("Template transformer creation error while processing " + mLastDataFileForupdateStudent.getName() + " file.", e);
0460 }
0461 catch(TransformerException e)
0462 {
0463 sLogger.error("Template transformation error while processing " + mLastDataFileForupdateStudent.getName() + " file.", e);
0464 }
0465 catch(IOException e)
0466 {
0467 sLogger.error("Error reading " + mLastDataFileForupdateStudent.getName() + " file.", e);
0468 }
0469 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STUpdateStudentResult();
0470 }
0471
0472 private File mLastDataFileForgetCourse = null;
0473
0474 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#getCourse(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetCourseInput) getCourse} method and implements
0475 * xml file based functionality, which generates operation results */
0476 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetCourseResult getCourse( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetCourseInput pInput) throws BSException
0477 {
0478 if ((mLastDataFileForgetCourse = getNextDataFile(mLastDataFileForgetCourse,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.GetCourse")) == null)
0479 {
0480 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getCourse] operation invocation. Returning empty result due to data file absence.");
0481 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetCourseResult();
0482 }
0483 try
0484 {
0485 if (mLastDataFileForgetCourse.getName().toLowerCase().endsWith(".xml"))
0486 {
0487 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getCourse] operation invocation. Returning result from " + mLastDataFileForgetCourse.getName() + " file.");
0488 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetCourseResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForgetCourse)));
0489 }
0490 else
0491 if (mLastDataFileForgetCourse.getName().toLowerCase().endsWith(".xsl"))
0492 {
0493 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getCourse] operation invocation. Returning result from " + mLastDataFileForgetCourse.getName() + " file.");
0494 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetCourseInput.toXMLString(pInput);
0495 StringWriter lOutputWriter = new StringWriter();
0496 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForgetCourse));
0497 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
0498 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
0499 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
0500 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
0501 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
0502 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetCourseResult.fromXMLString(lOutputWriter.toString());
0503 }
0504 }
0505 catch(DataTypeValidationException e)
0506 {
0507 sLogger.error("Data validation error while processing " + mLastDataFileForgetCourse.getName() + " file.", e);
0508 }
0509 catch(SAXException e)
0510 {
0511 sLogger.error("XML parsing error while processing " + mLastDataFileForgetCourse.getName() + " file.", e);
0512 }
0513 catch(TransformerConfigurationException e)
0514 {
0515 sLogger.error("Template transformer creation error while processing " + mLastDataFileForgetCourse.getName() + " file.", e);
0516 }
0517 catch(TransformerException e)
0518 {
0519 sLogger.error("Template transformation error while processing " + mLastDataFileForgetCourse.getName() + " file.", e);
0520 }
0521 catch(IOException e)
0522 {
0523 sLogger.error("Error reading " + mLastDataFileForgetCourse.getName() + " file.", e);
0524 }
0525 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetCourseResult();
0526 }
0527
0528 private File mLastDataFileForcreateCourse = null;
0529
0530 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#createCourse(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STCreateCourseInput) createCourse} method and implements
0531 * xml file based functionality, which generates operation results */
0532 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STCreateCourseResult createCourse( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STCreateCourseInput pInput) throws BSException
0533 {
0534 if ((mLastDataFileForcreateCourse = getNextDataFile(mLastDataFileForcreateCourse,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.CreateCourse")) == null)
0535 {
0536 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[createCourse] operation invocation. Returning empty result due to data file absence.");
0537 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STCreateCourseResult();
0538 }
0539 try
0540 {
0541 if (mLastDataFileForcreateCourse.getName().toLowerCase().endsWith(".xml"))
0542 {
0543 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[createCourse] operation invocation. Returning result from " + mLastDataFileForcreateCourse.getName() + " file.");
0544 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTCreateCourseResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForcreateCourse)));
0545 }
0546 else
0547 if (mLastDataFileForcreateCourse.getName().toLowerCase().endsWith(".xsl"))
0548 {
0549 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[createCourse] operation invocation. Returning result from " + mLastDataFileForcreateCourse.getName() + " file.");
0550 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTCreateCourseInput.toXMLString(pInput);
0551 StringWriter lOutputWriter = new StringWriter();
0552 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForcreateCourse));
0553 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
0554 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
0555 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
0556 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
0557 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
0558 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTCreateCourseResult.fromXMLString(lOutputWriter.toString());
0559 }
0560 }
0561 catch(DataTypeValidationException e)
0562 {
0563 sLogger.error("Data validation error while processing " + mLastDataFileForcreateCourse.getName() + " file.", e);
0564 }
0565 catch(SAXException e)
0566 {
0567 sLogger.error("XML parsing error while processing " + mLastDataFileForcreateCourse.getName() + " file.", e);
0568 }
0569 catch(TransformerConfigurationException e)
0570 {
0571 sLogger.error("Template transformer creation error while processing " + mLastDataFileForcreateCourse.getName() + " file.", e);
0572 }
0573 catch(TransformerException e)
0574 {
0575 sLogger.error("Template transformation error while processing " + mLastDataFileForcreateCourse.getName() + " file.", e);
0576 }
0577 catch(IOException e)
0578 {
0579 sLogger.error("Error reading " + mLastDataFileForcreateCourse.getName() + " file.", e);
0580 }
0581 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STCreateCourseResult();
0582 }
0583
0584 private File mLastDataFileFordeleteCourse = null;
0585
0586 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#deleteCourse(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STDeleteCourseInput) deleteCourse} method and implements
0587 * xml file based functionality, which generates operation results */
0588 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STDeleteCourseResult deleteCourse( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STDeleteCourseInput pInput) throws BSException
0589 {
0590 if ((mLastDataFileFordeleteCourse = getNextDataFile(mLastDataFileFordeleteCourse,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.DeleteCourse")) == null)
0591 {
0592 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[deleteCourse] operation invocation. Returning empty result due to data file absence.");
0593 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STDeleteCourseResult();
0594 }
0595 try
0596 {
0597 if (mLastDataFileFordeleteCourse.getName().toLowerCase().endsWith(".xml"))
0598 {
0599 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[deleteCourse] operation invocation. Returning result from " + mLastDataFileFordeleteCourse.getName() + " file.");
0600 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTDeleteCourseResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileFordeleteCourse)));
0601 }
0602 else
0603 if (mLastDataFileFordeleteCourse.getName().toLowerCase().endsWith(".xsl"))
0604 {
0605 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[deleteCourse] operation invocation. Returning result from " + mLastDataFileFordeleteCourse.getName() + " file.");
0606 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTDeleteCourseInput.toXMLString(pInput);
0607 StringWriter lOutputWriter = new StringWriter();
0608 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileFordeleteCourse));
0609 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
0610 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
0611 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
0612 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
0613 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
0614 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTDeleteCourseResult.fromXMLString(lOutputWriter.toString());
0615 }
0616 }
0617 catch(DataTypeValidationException e)
0618 {
0619 sLogger.error("Data validation error while processing " + mLastDataFileFordeleteCourse.getName() + " file.", e);
0620 }
0621 catch(SAXException e)
0622 {
0623 sLogger.error("XML parsing error while processing " + mLastDataFileFordeleteCourse.getName() + " file.", e);
0624 }
0625 catch(TransformerConfigurationException e)
0626 {
0627 sLogger.error("Template transformer creation error while processing " + mLastDataFileFordeleteCourse.getName() + " file.", e);
0628 }
0629 catch(TransformerException e)
0630 {
0631 sLogger.error("Template transformation error while processing " + mLastDataFileFordeleteCourse.getName() + " file.", e);
0632 }
0633 catch(IOException e)
0634 {
0635 sLogger.error("Error reading " + mLastDataFileFordeleteCourse.getName() + " file.", e);
0636 }
0637 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STDeleteCourseResult();
0638 }
0639
0640 private File mLastDataFileForgetAllCoursesCount = null;
0641
0642 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#getAllCoursesCount(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllCoursesCountInput) getAllCoursesCount} method and implements
0643 * xml file based functionality, which generates operation results */
0644 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllCoursesCountResult getAllCoursesCount( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllCoursesCountInput pInput) throws BSException
0645 {
0646 if ((mLastDataFileForgetAllCoursesCount = getNextDataFile(mLastDataFileForgetAllCoursesCount,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.GetAllCoursesCount")) == null)
0647 {
0648 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllCoursesCount] operation invocation. Returning empty result due to data file absence.");
0649 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllCoursesCountResult();
0650 }
0651 try
0652 {
0653 if (mLastDataFileForgetAllCoursesCount.getName().toLowerCase().endsWith(".xml"))
0654 {
0655 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllCoursesCount] operation invocation. Returning result from " + mLastDataFileForgetAllCoursesCount.getName() + " file.");
0656 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllCoursesCountResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForgetAllCoursesCount)));
0657 }
0658 else
0659 if (mLastDataFileForgetAllCoursesCount.getName().toLowerCase().endsWith(".xsl"))
0660 {
0661 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllCoursesCount] operation invocation. Returning result from " + mLastDataFileForgetAllCoursesCount.getName() + " file.");
0662 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllCoursesCountInput.toXMLString(pInput);
0663 StringWriter lOutputWriter = new StringWriter();
0664 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForgetAllCoursesCount));
0665 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
0666 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
0667 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
0668 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
0669 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
0670 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllCoursesCountResult.fromXMLString(lOutputWriter.toString());
0671 }
0672 }
0673 catch(DataTypeValidationException e)
0674 {
0675 sLogger.error("Data validation error while processing " + mLastDataFileForgetAllCoursesCount.getName() + " file.", e);
0676 }
0677 catch(SAXException e)
0678 {
0679 sLogger.error("XML parsing error while processing " + mLastDataFileForgetAllCoursesCount.getName() + " file.", e);
0680 }
0681 catch(TransformerConfigurationException e)
0682 {
0683 sLogger.error("Template transformer creation error while processing " + mLastDataFileForgetAllCoursesCount.getName() + " file.", e);
0684 }
0685 catch(TransformerException e)
0686 {
0687 sLogger.error("Template transformation error while processing " + mLastDataFileForgetAllCoursesCount.getName() + " file.", e);
0688 }
0689 catch(IOException e)
0690 {
0691 sLogger.error("Error reading " + mLastDataFileForgetAllCoursesCount.getName() + " file.", e);
0692 }
0693 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllCoursesCountResult();
0694 }
0695
0696 private File mLastDataFileForgetAllCourses = null;
0697
0698 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#getAllCourses(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllCoursesInput) getAllCourses} method and implements
0699 * xml file based functionality, which generates operation results */
0700 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllCoursesResult getAllCourses( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllCoursesInput pInput) throws BSException
0701 {
0702 if ((mLastDataFileForgetAllCourses = getNextDataFile(mLastDataFileForgetAllCourses,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.GetAllCourses")) == null)
0703 {
0704 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllCourses] operation invocation. Returning empty result due to data file absence.");
0705 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllCoursesResult();
0706 }
0707 try
0708 {
0709 if (mLastDataFileForgetAllCourses.getName().toLowerCase().endsWith(".xml"))
0710 {
0711 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllCourses] operation invocation. Returning result from " + mLastDataFileForgetAllCourses.getName() + " file.");
0712 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllCoursesResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForgetAllCourses)));
0713 }
0714 else
0715 if (mLastDataFileForgetAllCourses.getName().toLowerCase().endsWith(".xsl"))
0716 {
0717 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllCourses] operation invocation. Returning result from " + mLastDataFileForgetAllCourses.getName() + " file.");
0718 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllCoursesInput.toXMLString(pInput);
0719 StringWriter lOutputWriter = new StringWriter();
0720 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForgetAllCourses));
0721 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
0722 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
0723 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
0724 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
0725 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
0726 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllCoursesResult.fromXMLString(lOutputWriter.toString());
0727 }
0728 }
0729 catch(DataTypeValidationException e)
0730 {
0731 sLogger.error("Data validation error while processing " + mLastDataFileForgetAllCourses.getName() + " file.", e);
0732 }
0733 catch(SAXException e)
0734 {
0735 sLogger.error("XML parsing error while processing " + mLastDataFileForgetAllCourses.getName() + " file.", e);
0736 }
0737 catch(TransformerConfigurationException e)
0738 {
0739 sLogger.error("Template transformer creation error while processing " + mLastDataFileForgetAllCourses.getName() + " file.", e);
0740 }
0741 catch(TransformerException e)
0742 {
0743 sLogger.error("Template transformation error while processing " + mLastDataFileForgetAllCourses.getName() + " file.", e);
0744 }
0745 catch(IOException e)
0746 {
0747 sLogger.error("Error reading " + mLastDataFileForgetAllCourses.getName() + " file.", e);
0748 }
0749 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllCoursesResult();
0750 }
0751
0752 private File mLastDataFileForgetSubsetOfCourses = null;
0753
0754 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#getSubsetOfCourses(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetSubsetOfCoursesInput) getSubsetOfCourses} method and implements
0755 * xml file based functionality, which generates operation results */
0756 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetSubsetOfCoursesResult getSubsetOfCourses( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetSubsetOfCoursesInput pInput) throws BSException
0757 {
0758 if ((mLastDataFileForgetSubsetOfCourses = getNextDataFile(mLastDataFileForgetSubsetOfCourses,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.GetSubsetOfCourses")) == null)
0759 {
0760 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getSubsetOfCourses] operation invocation. Returning empty result due to data file absence.");
0761 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetSubsetOfCoursesResult();
0762 }
0763 try
0764 {
0765 if (mLastDataFileForgetSubsetOfCourses.getName().toLowerCase().endsWith(".xml"))
0766 {
0767 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getSubsetOfCourses] operation invocation. Returning result from " + mLastDataFileForgetSubsetOfCourses.getName() + " file.");
0768 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetSubsetOfCoursesResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForgetSubsetOfCourses)));
0769 }
0770 else
0771 if (mLastDataFileForgetSubsetOfCourses.getName().toLowerCase().endsWith(".xsl"))
0772 {
0773 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getSubsetOfCourses] operation invocation. Returning result from " + mLastDataFileForgetSubsetOfCourses.getName() + " file.");
0774 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetSubsetOfCoursesInput.toXMLString(pInput);
0775 StringWriter lOutputWriter = new StringWriter();
0776 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForgetSubsetOfCourses));
0777 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
0778 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
0779 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
0780 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
0781 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
0782 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetSubsetOfCoursesResult.fromXMLString(lOutputWriter.toString());
0783 }
0784 }
0785 catch(DataTypeValidationException e)
0786 {
0787 sLogger.error("Data validation error while processing " + mLastDataFileForgetSubsetOfCourses.getName() + " file.", e);
0788 }
0789 catch(SAXException e)
0790 {
0791 sLogger.error("XML parsing error while processing " + mLastDataFileForgetSubsetOfCourses.getName() + " file.", e);
0792 }
0793 catch(TransformerConfigurationException e)
0794 {
0795 sLogger.error("Template transformer creation error while processing " + mLastDataFileForgetSubsetOfCourses.getName() + " file.", e);
0796 }
0797 catch(TransformerException e)
0798 {
0799 sLogger.error("Template transformation error while processing " + mLastDataFileForgetSubsetOfCourses.getName() + " file.", e);
0800 }
0801 catch(IOException e)
0802 {
0803 sLogger.error("Error reading " + mLastDataFileForgetSubsetOfCourses.getName() + " file.", e);
0804 }
0805 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetSubsetOfCoursesResult();
0806 }
0807
0808 private File mLastDataFileForupdateCourse = null;
0809
0810 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#updateCourse(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STUpdateCourseInput) updateCourse} method and implements
0811 * xml file based functionality, which generates operation results */
0812 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STUpdateCourseResult updateCourse( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STUpdateCourseInput pInput) throws BSException
0813 {
0814 if ((mLastDataFileForupdateCourse = getNextDataFile(mLastDataFileForupdateCourse,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.UpdateCourse")) == null)
0815 {
0816 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[updateCourse] operation invocation. Returning empty result due to data file absence.");
0817 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STUpdateCourseResult();
0818 }
0819 try
0820 {
0821 if (mLastDataFileForupdateCourse.getName().toLowerCase().endsWith(".xml"))
0822 {
0823 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[updateCourse] operation invocation. Returning result from " + mLastDataFileForupdateCourse.getName() + " file.");
0824 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTUpdateCourseResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForupdateCourse)));
0825 }
0826 else
0827 if (mLastDataFileForupdateCourse.getName().toLowerCase().endsWith(".xsl"))
0828 {
0829 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[updateCourse] operation invocation. Returning result from " + mLastDataFileForupdateCourse.getName() + " file.");
0830 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTUpdateCourseInput.toXMLString(pInput);
0831 StringWriter lOutputWriter = new StringWriter();
0832 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForupdateCourse));
0833 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
0834 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
0835 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
0836 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
0837 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
0838 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTUpdateCourseResult.fromXMLString(lOutputWriter.toString());
0839 }
0840 }
0841 catch(DataTypeValidationException e)
0842 {
0843 sLogger.error("Data validation error while processing " + mLastDataFileForupdateCourse.getName() + " file.", e);
0844 }
0845 catch(SAXException e)
0846 {
0847 sLogger.error("XML parsing error while processing " + mLastDataFileForupdateCourse.getName() + " file.", e);
0848 }
0849 catch(TransformerConfigurationException e)
0850 {
0851 sLogger.error("Template transformer creation error while processing " + mLastDataFileForupdateCourse.getName() + " file.", e);
0852 }
0853 catch(TransformerException e)
0854 {
0855 sLogger.error("Template transformation error while processing " + mLastDataFileForupdateCourse.getName() + " file.", e);
0856 }
0857 catch(IOException e)
0858 {
0859 sLogger.error("Error reading " + mLastDataFileForupdateCourse.getName() + " file.", e);
0860 }
0861 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STUpdateCourseResult();
0862 }
0863
0864 private File mLastDataFileForgetTeacher = null;
0865
0866 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#getTeacher(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetTeacherInput) getTeacher} method and implements
0867 * xml file based functionality, which generates operation results */
0868 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetTeacherResult getTeacher( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetTeacherInput pInput) throws BSException
0869 {
0870 if ((mLastDataFileForgetTeacher = getNextDataFile(mLastDataFileForgetTeacher,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.GetTeacher")) == null)
0871 {
0872 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getTeacher] operation invocation. Returning empty result due to data file absence.");
0873 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetTeacherResult();
0874 }
0875 try
0876 {
0877 if (mLastDataFileForgetTeacher.getName().toLowerCase().endsWith(".xml"))
0878 {
0879 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getTeacher] operation invocation. Returning result from " + mLastDataFileForgetTeacher.getName() + " file.");
0880 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetTeacherResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForgetTeacher)));
0881 }
0882 else
0883 if (mLastDataFileForgetTeacher.getName().toLowerCase().endsWith(".xsl"))
0884 {
0885 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getTeacher] operation invocation. Returning result from " + mLastDataFileForgetTeacher.getName() + " file.");
0886 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetTeacherInput.toXMLString(pInput);
0887 StringWriter lOutputWriter = new StringWriter();
0888 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForgetTeacher));
0889 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
0890 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
0891 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
0892 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
0893 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
0894 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetTeacherResult.fromXMLString(lOutputWriter.toString());
0895 }
0896 }
0897 catch(DataTypeValidationException e)
0898 {
0899 sLogger.error("Data validation error while processing " + mLastDataFileForgetTeacher.getName() + " file.", e);
0900 }
0901 catch(SAXException e)
0902 {
0903 sLogger.error("XML parsing error while processing " + mLastDataFileForgetTeacher.getName() + " file.", e);
0904 }
0905 catch(TransformerConfigurationException e)
0906 {
0907 sLogger.error("Template transformer creation error while processing " + mLastDataFileForgetTeacher.getName() + " file.", e);
0908 }
0909 catch(TransformerException e)
0910 {
0911 sLogger.error("Template transformation error while processing " + mLastDataFileForgetTeacher.getName() + " file.", e);
0912 }
0913 catch(IOException e)
0914 {
0915 sLogger.error("Error reading " + mLastDataFileForgetTeacher.getName() + " file.", e);
0916 }
0917 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetTeacherResult();
0918 }
0919
0920 private File mLastDataFileForcreateTeacher = null;
0921
0922 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#createTeacher(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STCreateTeacherInput) createTeacher} method and implements
0923 * xml file based functionality, which generates operation results */
0924 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STCreateTeacherResult createTeacher( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STCreateTeacherInput pInput) throws BSException
0925 {
0926 if ((mLastDataFileForcreateTeacher = getNextDataFile(mLastDataFileForcreateTeacher,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.CreateTeacher")) == null)
0927 {
0928 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[createTeacher] operation invocation. Returning empty result due to data file absence.");
0929 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STCreateTeacherResult();
0930 }
0931 try
0932 {
0933 if (mLastDataFileForcreateTeacher.getName().toLowerCase().endsWith(".xml"))
0934 {
0935 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[createTeacher] operation invocation. Returning result from " + mLastDataFileForcreateTeacher.getName() + " file.");
0936 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTCreateTeacherResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForcreateTeacher)));
0937 }
0938 else
0939 if (mLastDataFileForcreateTeacher.getName().toLowerCase().endsWith(".xsl"))
0940 {
0941 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[createTeacher] operation invocation. Returning result from " + mLastDataFileForcreateTeacher.getName() + " file.");
0942 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTCreateTeacherInput.toXMLString(pInput);
0943 StringWriter lOutputWriter = new StringWriter();
0944 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForcreateTeacher));
0945 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
0946 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
0947 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
0948 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
0949 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
0950 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTCreateTeacherResult.fromXMLString(lOutputWriter.toString());
0951 }
0952 }
0953 catch(DataTypeValidationException e)
0954 {
0955 sLogger.error("Data validation error while processing " + mLastDataFileForcreateTeacher.getName() + " file.", e);
0956 }
0957 catch(SAXException e)
0958 {
0959 sLogger.error("XML parsing error while processing " + mLastDataFileForcreateTeacher.getName() + " file.", e);
0960 }
0961 catch(TransformerConfigurationException e)
0962 {
0963 sLogger.error("Template transformer creation error while processing " + mLastDataFileForcreateTeacher.getName() + " file.", e);
0964 }
0965 catch(TransformerException e)
0966 {
0967 sLogger.error("Template transformation error while processing " + mLastDataFileForcreateTeacher.getName() + " file.", e);
0968 }
0969 catch(IOException e)
0970 {
0971 sLogger.error("Error reading " + mLastDataFileForcreateTeacher.getName() + " file.", e);
0972 }
0973 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STCreateTeacherResult();
0974 }
0975
0976 private File mLastDataFileFordeleteTeacher = null;
0977
0978 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#deleteTeacher(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STDeleteTeacherInput) deleteTeacher} method and implements
0979 * xml file based functionality, which generates operation results */
0980 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STDeleteTeacherResult deleteTeacher( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STDeleteTeacherInput pInput) throws BSException
0981 {
0982 if ((mLastDataFileFordeleteTeacher = getNextDataFile(mLastDataFileFordeleteTeacher,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.DeleteTeacher")) == null)
0983 {
0984 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[deleteTeacher] operation invocation. Returning empty result due to data file absence.");
0985 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STDeleteTeacherResult();
0986 }
0987 try
0988 {
0989 if (mLastDataFileFordeleteTeacher.getName().toLowerCase().endsWith(".xml"))
0990 {
0991 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[deleteTeacher] operation invocation. Returning result from " + mLastDataFileFordeleteTeacher.getName() + " file.");
0992 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTDeleteTeacherResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileFordeleteTeacher)));
0993 }
0994 else
0995 if (mLastDataFileFordeleteTeacher.getName().toLowerCase().endsWith(".xsl"))
0996 {
0997 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[deleteTeacher] operation invocation. Returning result from " + mLastDataFileFordeleteTeacher.getName() + " file.");
0998 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTDeleteTeacherInput.toXMLString(pInput);
0999 StringWriter lOutputWriter = new StringWriter();
1000 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileFordeleteTeacher));
1001 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
1002 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
1003 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
1004 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
1005 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
1006 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTDeleteTeacherResult.fromXMLString(lOutputWriter.toString());
1007 }
1008 }
1009 catch(DataTypeValidationException e)
1010 {
1011 sLogger.error("Data validation error while processing " + mLastDataFileFordeleteTeacher.getName() + " file.", e);
1012 }
1013 catch(SAXException e)
1014 {
1015 sLogger.error("XML parsing error while processing " + mLastDataFileFordeleteTeacher.getName() + " file.", e);
1016 }
1017 catch(TransformerConfigurationException e)
1018 {
1019 sLogger.error("Template transformer creation error while processing " + mLastDataFileFordeleteTeacher.getName() + " file.", e);
1020 }
1021 catch(TransformerException e)
1022 {
1023 sLogger.error("Template transformation error while processing " + mLastDataFileFordeleteTeacher.getName() + " file.", e);
1024 }
1025 catch(IOException e)
1026 {
1027 sLogger.error("Error reading " + mLastDataFileFordeleteTeacher.getName() + " file.", e);
1028 }
1029 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STDeleteTeacherResult();
1030 }
1031
1032 private File mLastDataFileForgetAllTeachersCount = null;
1033
1034 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#getAllTeachersCount(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllTeachersCountInput) getAllTeachersCount} method and implements
1035 * xml file based functionality, which generates operation results */
1036 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllTeachersCountResult getAllTeachersCount( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllTeachersCountInput pInput) throws BSException
1037 {
1038 if ((mLastDataFileForgetAllTeachersCount = getNextDataFile(mLastDataFileForgetAllTeachersCount,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.GetAllTeachersCount")) == null)
1039 {
1040 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllTeachersCount] operation invocation. Returning empty result due to data file absence.");
1041 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllTeachersCountResult();
1042 }
1043 try
1044 {
1045 if (mLastDataFileForgetAllTeachersCount.getName().toLowerCase().endsWith(".xml"))
1046 {
1047 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllTeachersCount] operation invocation. Returning result from " + mLastDataFileForgetAllTeachersCount.getName() + " file.");
1048 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllTeachersCountResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForgetAllTeachersCount)));
1049 }
1050 else
1051 if (mLastDataFileForgetAllTeachersCount.getName().toLowerCase().endsWith(".xsl"))
1052 {
1053 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllTeachersCount] operation invocation. Returning result from " + mLastDataFileForgetAllTeachersCount.getName() + " file.");
1054 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllTeachersCountInput.toXMLString(pInput);
1055 StringWriter lOutputWriter = new StringWriter();
1056 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForgetAllTeachersCount));
1057 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
1058 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
1059 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
1060 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
1061 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
1062 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllTeachersCountResult.fromXMLString(lOutputWriter.toString());
1063 }
1064 }
1065 catch(DataTypeValidationException e)
1066 {
1067 sLogger.error("Data validation error while processing " + mLastDataFileForgetAllTeachersCount.getName() + " file.", e);
1068 }
1069 catch(SAXException e)
1070 {
1071 sLogger.error("XML parsing error while processing " + mLastDataFileForgetAllTeachersCount.getName() + " file.", e);
1072 }
1073 catch(TransformerConfigurationException e)
1074 {
1075 sLogger.error("Template transformer creation error while processing " + mLastDataFileForgetAllTeachersCount.getName() + " file.", e);
1076 }
1077 catch(TransformerException e)
1078 {
1079 sLogger.error("Template transformation error while processing " + mLastDataFileForgetAllTeachersCount.getName() + " file.", e);
1080 }
1081 catch(IOException e)
1082 {
1083 sLogger.error("Error reading " + mLastDataFileForgetAllTeachersCount.getName() + " file.", e);
1084 }
1085 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllTeachersCountResult();
1086 }
1087
1088 private File mLastDataFileForgetAllTeachers = null;
1089
1090 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#getAllTeachers(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllTeachersInput) getAllTeachers} method and implements
1091 * xml file based functionality, which generates operation results */
1092 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllTeachersResult getAllTeachers( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllTeachersInput pInput) throws BSException
1093 {
1094 if ((mLastDataFileForgetAllTeachers = getNextDataFile(mLastDataFileForgetAllTeachers,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.GetAllTeachers")) == null)
1095 {
1096 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllTeachers] operation invocation. Returning empty result due to data file absence.");
1097 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllTeachersResult();
1098 }
1099 try
1100 {
1101 if (mLastDataFileForgetAllTeachers.getName().toLowerCase().endsWith(".xml"))
1102 {
1103 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllTeachers] operation invocation. Returning result from " + mLastDataFileForgetAllTeachers.getName() + " file.");
1104 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllTeachersResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForgetAllTeachers)));
1105 }
1106 else
1107 if (mLastDataFileForgetAllTeachers.getName().toLowerCase().endsWith(".xsl"))
1108 {
1109 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllTeachers] operation invocation. Returning result from " + mLastDataFileForgetAllTeachers.getName() + " file.");
1110 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllTeachersInput.toXMLString(pInput);
1111 StringWriter lOutputWriter = new StringWriter();
1112 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForgetAllTeachers));
1113 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
1114 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
1115 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
1116 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
1117 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
1118 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllTeachersResult.fromXMLString(lOutputWriter.toString());
1119 }
1120 }
1121 catch(DataTypeValidationException e)
1122 {
1123 sLogger.error("Data validation error while processing " + mLastDataFileForgetAllTeachers.getName() + " file.", e);
1124 }
1125 catch(SAXException e)
1126 {
1127 sLogger.error("XML parsing error while processing " + mLastDataFileForgetAllTeachers.getName() + " file.", e);
1128 }
1129 catch(TransformerConfigurationException e)
1130 {
1131 sLogger.error("Template transformer creation error while processing " + mLastDataFileForgetAllTeachers.getName() + " file.", e);
1132 }
1133 catch(TransformerException e)
1134 {
1135 sLogger.error("Template transformation error while processing " + mLastDataFileForgetAllTeachers.getName() + " file.", e);
1136 }
1137 catch(IOException e)
1138 {
1139 sLogger.error("Error reading " + mLastDataFileForgetAllTeachers.getName() + " file.", e);
1140 }
1141 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllTeachersResult();
1142 }
1143
1144 private File mLastDataFileForgetSubsetOfTeachers = null;
1145
1146 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#getSubsetOfTeachers(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetSubsetOfTeachersInput) getSubsetOfTeachers} method and implements
1147 * xml file based functionality, which generates operation results */
1148 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetSubsetOfTeachersResult getSubsetOfTeachers( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetSubsetOfTeachersInput pInput) throws BSException
1149 {
1150 if ((mLastDataFileForgetSubsetOfTeachers = getNextDataFile(mLastDataFileForgetSubsetOfTeachers,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.GetSubsetOfTeachers")) == null)
1151 {
1152 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getSubsetOfTeachers] operation invocation. Returning empty result due to data file absence.");
1153 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetSubsetOfTeachersResult();
1154 }
1155 try
1156 {
1157 if (mLastDataFileForgetSubsetOfTeachers.getName().toLowerCase().endsWith(".xml"))
1158 {
1159 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getSubsetOfTeachers] operation invocation. Returning result from " + mLastDataFileForgetSubsetOfTeachers.getName() + " file.");
1160 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetSubsetOfTeachersResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForgetSubsetOfTeachers)));
1161 }
1162 else
1163 if (mLastDataFileForgetSubsetOfTeachers.getName().toLowerCase().endsWith(".xsl"))
1164 {
1165 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getSubsetOfTeachers] operation invocation. Returning result from " + mLastDataFileForgetSubsetOfTeachers.getName() + " file.");
1166 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetSubsetOfTeachersInput.toXMLString(pInput);
1167 StringWriter lOutputWriter = new StringWriter();
1168 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForgetSubsetOfTeachers));
1169 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
1170 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
1171 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
1172 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
1173 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
1174 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetSubsetOfTeachersResult.fromXMLString(lOutputWriter.toString());
1175 }
1176 }
1177 catch(DataTypeValidationException e)
1178 {
1179 sLogger.error("Data validation error while processing " + mLastDataFileForgetSubsetOfTeachers.getName() + " file.", e);
1180 }
1181 catch(SAXException e)
1182 {
1183 sLogger.error("XML parsing error while processing " + mLastDataFileForgetSubsetOfTeachers.getName() + " file.", e);
1184 }
1185 catch(TransformerConfigurationException e)
1186 {
1187 sLogger.error("Template transformer creation error while processing " + mLastDataFileForgetSubsetOfTeachers.getName() + " file.", e);
1188 }
1189 catch(TransformerException e)
1190 {
1191 sLogger.error("Template transformation error while processing " + mLastDataFileForgetSubsetOfTeachers.getName() + " file.", e);
1192 }
1193 catch(IOException e)
1194 {
1195 sLogger.error("Error reading " + mLastDataFileForgetSubsetOfTeachers.getName() + " file.", e);
1196 }
1197 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetSubsetOfTeachersResult();
1198 }
1199
1200 private File mLastDataFileForupdateTeacher = null;
1201
1202 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#updateTeacher(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STUpdateTeacherInput) updateTeacher} method and implements
1203 * xml file based functionality, which generates operation results */
1204 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STUpdateTeacherResult updateTeacher( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STUpdateTeacherInput pInput) throws BSException
1205 {
1206 if ((mLastDataFileForupdateTeacher = getNextDataFile(mLastDataFileForupdateTeacher,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.UpdateTeacher")) == null)
1207 {
1208 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[updateTeacher] operation invocation. Returning empty result due to data file absence.");
1209 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STUpdateTeacherResult();
1210 }
1211 try
1212 {
1213 if (mLastDataFileForupdateTeacher.getName().toLowerCase().endsWith(".xml"))
1214 {
1215 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[updateTeacher] operation invocation. Returning result from " + mLastDataFileForupdateTeacher.getName() + " file.");
1216 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTUpdateTeacherResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForupdateTeacher)));
1217 }
1218 else
1219 if (mLastDataFileForupdateTeacher.getName().toLowerCase().endsWith(".xsl"))
1220 {
1221 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[updateTeacher] operation invocation. Returning result from " + mLastDataFileForupdateTeacher.getName() + " file.");
1222 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTUpdateTeacherInput.toXMLString(pInput);
1223 StringWriter lOutputWriter = new StringWriter();
1224 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForupdateTeacher));
1225 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
1226 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
1227 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
1228 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
1229 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
1230 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTUpdateTeacherResult.fromXMLString(lOutputWriter.toString());
1231 }
1232 }
1233 catch(DataTypeValidationException e)
1234 {
1235 sLogger.error("Data validation error while processing " + mLastDataFileForupdateTeacher.getName() + " file.", e);
1236 }
1237 catch(SAXException e)
1238 {
1239 sLogger.error("XML parsing error while processing " + mLastDataFileForupdateTeacher.getName() + " file.", e);
1240 }
1241 catch(TransformerConfigurationException e)
1242 {
1243 sLogger.error("Template transformer creation error while processing " + mLastDataFileForupdateTeacher.getName() + " file.", e);
1244 }
1245 catch(TransformerException e)
1246 {
1247 sLogger.error("Template transformation error while processing " + mLastDataFileForupdateTeacher.getName() + " file.", e);
1248 }
1249 catch(IOException e)
1250 {
1251 sLogger.error("Error reading " + mLastDataFileForupdateTeacher.getName() + " file.", e);
1252 }
1253 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STUpdateTeacherResult();
1254 }
1255
1256 private File mLastDataFileForaddLecturersToCourse = null;
1257
1258 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#addLecturersToCourse(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STAddLecturersToCourseInput) addLecturersToCourse} method and implements
1259 * xml file based functionality, which generates operation results */
1260 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STAddLecturersToCourseResult addLecturersToCourse( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STAddLecturersToCourseInput pInput) throws BSException
1261 {
1262 if ((mLastDataFileForaddLecturersToCourse = getNextDataFile(mLastDataFileForaddLecturersToCourse,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.AddLecturersToCourse")) == null)
1263 {
1264 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[addLecturersToCourse] operation invocation. Returning empty result due to data file absence.");
1265 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STAddLecturersToCourseResult();
1266 }
1267 try
1268 {
1269 if (mLastDataFileForaddLecturersToCourse.getName().toLowerCase().endsWith(".xml"))
1270 {
1271 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[addLecturersToCourse] operation invocation. Returning result from " + mLastDataFileForaddLecturersToCourse.getName() + " file.");
1272 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTAddLecturersToCourseResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForaddLecturersToCourse)));
1273 }
1274 else
1275 if (mLastDataFileForaddLecturersToCourse.getName().toLowerCase().endsWith(".xsl"))
1276 {
1277 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[addLecturersToCourse] operation invocation. Returning result from " + mLastDataFileForaddLecturersToCourse.getName() + " file.");
1278 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTAddLecturersToCourseInput.toXMLString(pInput);
1279 StringWriter lOutputWriter = new StringWriter();
1280 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForaddLecturersToCourse));
1281 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
1282 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
1283 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
1284 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
1285 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
1286 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTAddLecturersToCourseResult.fromXMLString(lOutputWriter.toString());
1287 }
1288 }
1289 catch(DataTypeValidationException e)
1290 {
1291 sLogger.error("Data validation error while processing " + mLastDataFileForaddLecturersToCourse.getName() + " file.", e);
1292 }
1293 catch(SAXException e)
1294 {
1295 sLogger.error("XML parsing error while processing " + mLastDataFileForaddLecturersToCourse.getName() + " file.", e);
1296 }
1297 catch(TransformerConfigurationException e)
1298 {
1299 sLogger.error("Template transformer creation error while processing " + mLastDataFileForaddLecturersToCourse.getName() + " file.", e);
1300 }
1301 catch(TransformerException e)
1302 {
1303 sLogger.error("Template transformation error while processing " + mLastDataFileForaddLecturersToCourse.getName() + " file.", e);
1304 }
1305 catch(IOException e)
1306 {
1307 sLogger.error("Error reading " + mLastDataFileForaddLecturersToCourse.getName() + " file.", e);
1308 }
1309 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STAddLecturersToCourseResult();
1310 }
1311
1312 private File mLastDataFileForremoveLecturersFromCourse = null;
1313
1314 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#removeLecturersFromCourse(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STRemoveLecturersFromCourseInput) removeLecturersFromCourse} method and implements
1315 * xml file based functionality, which generates operation results */
1316 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STRemoveLecturersFromCourseResult removeLecturersFromCourse( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STRemoveLecturersFromCourseInput pInput) throws BSException
1317 {
1318 if ((mLastDataFileForremoveLecturersFromCourse = getNextDataFile(mLastDataFileForremoveLecturersFromCourse,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.RemoveLecturersFromCourse")) == null)
1319 {
1320 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[removeLecturersFromCourse] operation invocation. Returning empty result due to data file absence.");
1321 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STRemoveLecturersFromCourseResult();
1322 }
1323 try
1324 {
1325 if (mLastDataFileForremoveLecturersFromCourse.getName().toLowerCase().endsWith(".xml"))
1326 {
1327 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[removeLecturersFromCourse] operation invocation. Returning result from " + mLastDataFileForremoveLecturersFromCourse.getName() + " file.");
1328 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTRemoveLecturersFromCourseResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForremoveLecturersFromCourse)));
1329 }
1330 else
1331 if (mLastDataFileForremoveLecturersFromCourse.getName().toLowerCase().endsWith(".xsl"))
1332 {
1333 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[removeLecturersFromCourse] operation invocation. Returning result from " + mLastDataFileForremoveLecturersFromCourse.getName() + " file.");
1334 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTRemoveLecturersFromCourseInput.toXMLString(pInput);
1335 StringWriter lOutputWriter = new StringWriter();
1336 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForremoveLecturersFromCourse));
1337 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
1338 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
1339 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
1340 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
1341 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
1342 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTRemoveLecturersFromCourseResult.fromXMLString(lOutputWriter.toString());
1343 }
1344 }
1345 catch(DataTypeValidationException e)
1346 {
1347 sLogger.error("Data validation error while processing " + mLastDataFileForremoveLecturersFromCourse.getName() + " file.", e);
1348 }
1349 catch(SAXException e)
1350 {
1351 sLogger.error("XML parsing error while processing " + mLastDataFileForremoveLecturersFromCourse.getName() + " file.", e);
1352 }
1353 catch(TransformerConfigurationException e)
1354 {
1355 sLogger.error("Template transformer creation error while processing " + mLastDataFileForremoveLecturersFromCourse.getName() + " file.", e);
1356 }
1357 catch(TransformerException e)
1358 {
1359 sLogger.error("Template transformation error while processing " + mLastDataFileForremoveLecturersFromCourse.getName() + " file.", e);
1360 }
1361 catch(IOException e)
1362 {
1363 sLogger.error("Error reading " + mLastDataFileForremoveLecturersFromCourse.getName() + " file.", e);
1364 }
1365 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STRemoveLecturersFromCourseResult();
1366 }
1367
1368 private File mLastDataFileForgetAllLecturersForCourse = null;
1369
1370 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#getAllLecturersForCourse(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllLecturersForCourseInput) getAllLecturersForCourse} method and implements
1371 * xml file based functionality, which generates operation results */
1372 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllLecturersForCourseResult getAllLecturersForCourse( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllLecturersForCourseInput pInput) throws BSException
1373 {
1374 if ((mLastDataFileForgetAllLecturersForCourse = getNextDataFile(mLastDataFileForgetAllLecturersForCourse,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.GetAllLecturersForCourse")) == null)
1375 {
1376 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllLecturersForCourse] operation invocation. Returning empty result due to data file absence.");
1377 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllLecturersForCourseResult();
1378 }
1379 try
1380 {
1381 if (mLastDataFileForgetAllLecturersForCourse.getName().toLowerCase().endsWith(".xml"))
1382 {
1383 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllLecturersForCourse] operation invocation. Returning result from " + mLastDataFileForgetAllLecturersForCourse.getName() + " file.");
1384 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllLecturersForCourseResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForgetAllLecturersForCourse)));
1385 }
1386 else
1387 if (mLastDataFileForgetAllLecturersForCourse.getName().toLowerCase().endsWith(".xsl"))
1388 {
1389 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllLecturersForCourse] operation invocation. Returning result from " + mLastDataFileForgetAllLecturersForCourse.getName() + " file.");
1390 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllLecturersForCourseInput.toXMLString(pInput);
1391 StringWriter lOutputWriter = new StringWriter();
1392 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForgetAllLecturersForCourse));
1393 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
1394 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
1395 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
1396 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
1397 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
1398 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllLecturersForCourseResult.fromXMLString(lOutputWriter.toString());
1399 }
1400 }
1401 catch(DataTypeValidationException e)
1402 {
1403 sLogger.error("Data validation error while processing " + mLastDataFileForgetAllLecturersForCourse.getName() + " file.", e);
1404 }
1405 catch(SAXException e)
1406 {
1407 sLogger.error("XML parsing error while processing " + mLastDataFileForgetAllLecturersForCourse.getName() + " file.", e);
1408 }
1409 catch(TransformerConfigurationException e)
1410 {
1411 sLogger.error("Template transformer creation error while processing " + mLastDataFileForgetAllLecturersForCourse.getName() + " file.", e);
1412 }
1413 catch(TransformerException e)
1414 {
1415 sLogger.error("Template transformation error while processing " + mLastDataFileForgetAllLecturersForCourse.getName() + " file.", e);
1416 }
1417 catch(IOException e)
1418 {
1419 sLogger.error("Error reading " + mLastDataFileForgetAllLecturersForCourse.getName() + " file.", e);
1420 }
1421 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllLecturersForCourseResult();
1422 }
1423
1424 private File mLastDataFileForaddCoursesToStudent = null;
1425
1426 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#addCoursesToStudent(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STAddCoursesToStudentInput) addCoursesToStudent} method and implements
1427 * xml file based functionality, which generates operation results */
1428 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STAddCoursesToStudentResult addCoursesToStudent( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STAddCoursesToStudentInput pInput) throws BSException
1429 {
1430 if ((mLastDataFileForaddCoursesToStudent = getNextDataFile(mLastDataFileForaddCoursesToStudent,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.AddCoursesToStudent")) == null)
1431 {
1432 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[addCoursesToStudent] operation invocation. Returning empty result due to data file absence.");
1433 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STAddCoursesToStudentResult();
1434 }
1435 try
1436 {
1437 if (mLastDataFileForaddCoursesToStudent.getName().toLowerCase().endsWith(".xml"))
1438 {
1439 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[addCoursesToStudent] operation invocation. Returning result from " + mLastDataFileForaddCoursesToStudent.getName() + " file.");
1440 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTAddCoursesToStudentResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForaddCoursesToStudent)));
1441 }
1442 else
1443 if (mLastDataFileForaddCoursesToStudent.getName().toLowerCase().endsWith(".xsl"))
1444 {
1445 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[addCoursesToStudent] operation invocation. Returning result from " + mLastDataFileForaddCoursesToStudent.getName() + " file.");
1446 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTAddCoursesToStudentInput.toXMLString(pInput);
1447 StringWriter lOutputWriter = new StringWriter();
1448 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForaddCoursesToStudent));
1449 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
1450 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
1451 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
1452 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
1453 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
1454 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTAddCoursesToStudentResult.fromXMLString(lOutputWriter.toString());
1455 }
1456 }
1457 catch(DataTypeValidationException e)
1458 {
1459 sLogger.error("Data validation error while processing " + mLastDataFileForaddCoursesToStudent.getName() + " file.", e);
1460 }
1461 catch(SAXException e)
1462 {
1463 sLogger.error("XML parsing error while processing " + mLastDataFileForaddCoursesToStudent.getName() + " file.", e);
1464 }
1465 catch(TransformerConfigurationException e)
1466 {
1467 sLogger.error("Template transformer creation error while processing " + mLastDataFileForaddCoursesToStudent.getName() + " file.", e);
1468 }
1469 catch(TransformerException e)
1470 {
1471 sLogger.error("Template transformation error while processing " + mLastDataFileForaddCoursesToStudent.getName() + " file.", e);
1472 }
1473 catch(IOException e)
1474 {
1475 sLogger.error("Error reading " + mLastDataFileForaddCoursesToStudent.getName() + " file.", e);
1476 }
1477 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STAddCoursesToStudentResult();
1478 }
1479
1480 private File mLastDataFileForremoveCoursesFromStudent = null;
1481
1482 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#removeCoursesFromStudent(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STRemoveCoursesFromStudentInput) removeCoursesFromStudent} method and implements
1483 * xml file based functionality, which generates operation results */
1484 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STRemoveCoursesFromStudentResult removeCoursesFromStudent( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STRemoveCoursesFromStudentInput pInput) throws BSException
1485 {
1486 if ((mLastDataFileForremoveCoursesFromStudent = getNextDataFile(mLastDataFileForremoveCoursesFromStudent,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.RemoveCoursesFromStudent")) == null)
1487 {
1488 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[removeCoursesFromStudent] operation invocation. Returning empty result due to data file absence.");
1489 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STRemoveCoursesFromStudentResult();
1490 }
1491 try
1492 {
1493 if (mLastDataFileForremoveCoursesFromStudent.getName().toLowerCase().endsWith(".xml"))
1494 {
1495 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[removeCoursesFromStudent] operation invocation. Returning result from " + mLastDataFileForremoveCoursesFromStudent.getName() + " file.");
1496 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTRemoveCoursesFromStudentResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForremoveCoursesFromStudent)));
1497 }
1498 else
1499 if (mLastDataFileForremoveCoursesFromStudent.getName().toLowerCase().endsWith(".xsl"))
1500 {
1501 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[removeCoursesFromStudent] operation invocation. Returning result from " + mLastDataFileForremoveCoursesFromStudent.getName() + " file.");
1502 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTRemoveCoursesFromStudentInput.toXMLString(pInput);
1503 StringWriter lOutputWriter = new StringWriter();
1504 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForremoveCoursesFromStudent));
1505 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
1506 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
1507 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
1508 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
1509 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
1510 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTRemoveCoursesFromStudentResult.fromXMLString(lOutputWriter.toString());
1511 }
1512 }
1513 catch(DataTypeValidationException e)
1514 {
1515 sLogger.error("Data validation error while processing " + mLastDataFileForremoveCoursesFromStudent.getName() + " file.", e);
1516 }
1517 catch(SAXException e)
1518 {
1519 sLogger.error("XML parsing error while processing " + mLastDataFileForremoveCoursesFromStudent.getName() + " file.", e);
1520 }
1521 catch(TransformerConfigurationException e)
1522 {
1523 sLogger.error("Template transformer creation error while processing " + mLastDataFileForremoveCoursesFromStudent.getName() + " file.", e);
1524 }
1525 catch(TransformerException e)
1526 {
1527 sLogger.error("Template transformation error while processing " + mLastDataFileForremoveCoursesFromStudent.getName() + " file.", e);
1528 }
1529 catch(IOException e)
1530 {
1531 sLogger.error("Error reading " + mLastDataFileForremoveCoursesFromStudent.getName() + " file.", e);
1532 }
1533 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STRemoveCoursesFromStudentResult();
1534 }
1535
1536 private File mLastDataFileForgetAllCoursesForStudent = null;
1537
1538 /** This method wraps around {@link com.almamater.crs.services.coursesdomainsupport.BSDataManagement#getAllCoursesForStudent(com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllCoursesForStudentInput) getAllCoursesForStudent} method and implements
1539 * xml file based functionality, which generates operation results */
1540 public com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllCoursesForStudentResult getAllCoursesForStudent( com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllCoursesForStudentInput pInput) throws BSException
1541 {
1542 if ((mLastDataFileForgetAllCoursesForStudent = getNextDataFile(mLastDataFileForgetAllCoursesForStudent,"AlmaMater.CRS.CoursesDomainSupport.DataManagement.GetAllCoursesForStudent")) == null)
1543 {
1544 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllCoursesForStudent] operation invocation. Returning empty result due to data file absence.");
1545 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllCoursesForStudentResult();
1546 }
1547 try
1548 {
1549 if (mLastDataFileForgetAllCoursesForStudent.getName().toLowerCase().endsWith(".xml"))
1550 {
1551 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllCoursesForStudent] operation invocation. Returning result from " + mLastDataFileForgetAllCoursesForStudent.getName() + " file.");
1552 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllCoursesForStudentResult.fromXMLString(StringUtils.readTextStreamFully(new FileInputStream(mLastDataFileForgetAllCoursesForStudent)));
1553 }
1554 else
1555 if (mLastDataFileForgetAllCoursesForStudent.getName().toLowerCase().endsWith(".xsl"))
1556 {
1557 sLogger.info("Simulating Enterprise/systems[CRS]/servicemodules[CoursesDomainSupport]/services[DataManagement]/operations[getAllCoursesForStudent] operation invocation. Returning result from " + mLastDataFileForgetAllCoursesForStudent.getName() + " file.");
1558 String lInputString = com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllCoursesForStudentInput.toXMLString(pInput);
1559 StringWriter lOutputWriter = new StringWriter();
1560 Transformer lTransformer = mTransformerFactory.newTransformer(new StreamSource(mLastDataFileForgetAllCoursesForStudent));
1561 lTransformer.setOutputProperty(OutputKeys.METHOD,"xml");
1562 lTransformer.setOutputProperty(OutputKeys.STANDALONE,"yes");
1563 lTransformer.setOutputProperty(OutputKeys.INDENT,"no");
1564 lTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"no");
1565 lTransformer.transform(new StreamSource(new StringReader(lInputString)), new StreamResult(lOutputWriter));
1566 return com.almamater.crs.adapters.generic.xmlstrings.services.coursesdomainsupport.ADBSDataManagement.TRSTGetAllCoursesForStudentResult.fromXMLString(lOutputWriter.toString());
1567 }
1568 }
1569 catch(DataTypeValidationException e)
1570 {
1571 sLogger.error("Data validation error while processing " + mLastDataFileForgetAllCoursesForStudent.getName() + " file.", e);
1572 }
1573 catch(SAXException e)
1574 {
1575 sLogger.error("XML parsing error while processing " + mLastDataFileForgetAllCoursesForStudent.getName() + " file.", e);
1576 }
1577 catch(TransformerConfigurationException e)
1578 {
1579 sLogger.error("Template transformer creation error while processing " + mLastDataFileForgetAllCoursesForStudent.getName() + " file.", e);
1580 }
1581 catch(TransformerException e)
1582 {
1583 sLogger.error("Template transformation error while processing " + mLastDataFileForgetAllCoursesForStudent.getName() + " file.", e);
1584 }
1585 catch(IOException e)
1586 {
1587 sLogger.error("Error reading " + mLastDataFileForgetAllCoursesForStudent.getName() + " file.", e);
1588 }
1589 return new com.almamater.crs.services.coursesdomainsupport.BSDataManagement.STGetAllCoursesForStudentResult();
1590 }
1591
1592 private static Comparator sFileComparator = new Comparator()
1593 {
1594 public int compare(Object o1, Object o2)
1595 {
1596 return ((File)o1).getName().compareTo(((File)o2).getName());
1597 }
1598 };
1599 private File getNextDataFile( File pPreviousDataFile, final String pOperationFileNameBase) throws BSException
1600 {
1601 File[] lDataFiles = null;
1602 if (mTestDataDirectory.exists() && mTestDataDirectory.canRead())
1603 {
1604 lDataFiles = mTestDataDirectory.listFiles(new FileFilter()
1605 {
1606 public boolean accept(File pPathname)
1607 {
1608 if (!pPathname.isFile())
1609 return false;
1610 if (pPathname.isHidden())
1611 return false;
1612 if (!pPathname.canRead())
1613 return false;
1614 String lName = pPathname.getName().toLowerCase();
1615 if (!lName.startsWith(pOperationFileNameBase.toLowerCase() + "."))
1616 return false;
1617 if ((!lName.endsWith(".xml")) && (!lName.endsWith(".xsl")))
1618 return false;
1619 return true;
1620 }
1621 });
1622 }
1623 if (lDataFiles == null || lDataFiles.length == 0)
1624 {
1625 sLogger.debug("Unable to find any xml or xsl files with name starting with '" + pOperationFileNameBase + "' prefix.");
1626 return null;
1627 }
1628 Arrays.sort(lDataFiles, sFileComparator);
1629 int lNextFileIndex = 0;
1630 if (pPreviousDataFile != null)
1631 {
1632 for (; lNextFileIndex < lDataFiles.length; lNextFileIndex++)
1633 {
1634 if (lDataFiles[lNextFileIndex].equals(pPreviousDataFile))
1635 {
1636 lNextFileIndex++;
1637 break;
1638 }
1639 }
1640 }
1641 return lNextFileIndex < lDataFiles.length ? lDataFiles[lNextFileIndex] : lDataFiles[0];
1642 }
1643 }
|