Important Classes Base Framework

22-8 Oracle Fusion Middleware Developers Guide for Oracle Adaptive Access Manager called and returns true, you are guaranteed that currentLine is not null and is within your session sets range. Another field you might need to know about is controller. controller is an instance of RiskAnalyzer and contains context information about your current OAAM Offline job. Other methods that you can override if the default behavior is not what you need are getTotalNumberToProcess, isBeforeBeginning, isAfterEnd, and skipToBeginning. The default implementation of getTotalNumberToProcess assumes that you will not know how many records you intend to process, so it returns a constant invalid value, signifying NA. If your implementation has some way to know how many records it will be processing, you can override this method with your algorithm. The default implementation of isBeforeBeginning returns true if the date returned by dateOfCurrentRecord is before controllers start date range. You can override this method if you need to do this in a different way. Your file must be sorted by whichever field or fields you are comparing here. The default implementation of isAfterEnd returns true if the date returned by dateOfCurrentRecord is after controllers end date range. You can override this method if you need to do this in a different way. Your file must be sorted by whichever field or fields you are comparing here. If you wanted to turn off this behavior, you can override this method to return a constant value of false. The default implementation of skipToBeginning iterates through the file until it finds a record for which isBeforeBeginning returns false. If you wanted to turn off this behavior, you could override this method to have an empty body. The default manner in which this method skips to the next record is to go through the motions of constructing the loadable record, only to throw it away. This step is required for the case where it takes multiple lines from the file to make a single loadable record, to ensure that all of those lines are skipped at once. If you are guaranteed that one line is equal to one loadable record, you can replace this method with the following more efficient version. The nextRecordIsReady variable is a flag the hasMoreRecords checks to know if it needs to skip to the next line. Any overriding version of skiptoBeginning must set the initialized flag to true before calling hasMoreRecords to avoid an infinite loop. protected void skipToBeginning throws Exception { initialized = true; while hasMoreRecords isBeforeBeginning { nextRecordIsReady = false; } }

22.4.3 Extending AbstractRiskAnalyzerDataSource

If neither AbstractJDBCRiskAnalyzerDataSource nor AbstractTextFile-RiskAnalyzerDataSource is appropriate, then you will need to extend AbstractRiskAnalyzerDataSource instead. You might find yourself in this situation if you are reading from a binary file or if you are implementing a data source for a custom playback mode and using TopLink to read from the OAAM Offline database. The constructor should put your class into a state so that you are ready to iterate through the data. There are four abstract methods you will have to implement. Developing a Custom Loader for OAAM Offline 22-9 getTotalNumberToProcess will return the total number of records in the data source that satisfy the conditions that define a given Session Set. hasMoreRecords will return true if there are more records to be processed, and will move any sort of record pointer to the next available record if required. There is a flag named nextRecordIsReady that should be used for signaling here. The superclass sets this flag to false when it has made use of the next available record. Your implementation of hasMoreRecords should check the value of the nextRecordIsReady flag, move the pointer to the next record only if the flags value is false, and change the flags value to true when you successfully move the pointer to a new record. If you are following this paradigm, then if your implementation of hasMoreRecords is called while nextRecordIsReady is true, then you should return true without changing the state of any record pointers. buildNextRecord will return a new instance of the required subclass of AbstractTransactionRecord. close is called when you have finished processing all of the records. Any required clean-up should be performed here.

22.5 Implement RunMode

If you have created any customized classes for the load or playback behavior, you are required to create a customized subclass of AbstractLoadLoginsRunMode, AbstractLoadTransactionsRunMode, or PlaybackRunMode, depending on your requirements. The most important RunMode methods are acquireDataSource and buildObjectLoader. acquireDataSourceRiskAnalyzer returns an instance of the RiskAnalyzerDataSource required to run your process. The RiskAnalyzer parameter contains context information that the RunMode can use to instantiate the data source object. buildObjectLoaderRiskAnalyzer returns an instance of the AbstractRiskAnalyzerLoader required to run your process. The RiskAnalyzer parameter contains context information that the RunMode can use to instantiate the object loader. When implementing RunMode, it is critical that your object loader and data source are compatible, meaning that the data source you return produces the specific type of loadable object that your object loader expects. The method chooseStartDateRangeVCryptDataAccessMgr, RunSession method is used to determine the start date range for your OAAM Offline job. All of your implementors of RunMode have a default implementation of this method. The default behavior is as follows. If this is the first time the job has run, you return the start date from the run sessions session set if any, or an arbitrary date guaranteed to be earlier than the earliest date in your data source if your session set has no begin date. If this is a resumed job, then you determine, in an implementation specific way, which record you need to start from when the job is resumed.

22.5.1 Extending AbstractLoadLoginsRunMode

This is the appropriate choice if you are loading login data, and you need a custom data source. You must implement the acquireDataSourceRiskAnalyzer method, and return a new instance of your custom data source. If you need a custom