Class PlainSwapEditorController
java.lang.Object
net.finmath.smartcontract.valuation.service.controllers.PlainSwapEditorController
- All Implemented Interfaces:
PlainSwapEditorApi
@RestController
@CrossOrigin(origins={"http://localhost:4200","${serviceUrl}"},
allowCredentials="true")
public class PlainSwapEditorController
extends Object
implements PlainSwapEditorApi
-
Constructor Summary
ConstructorsConstructorDescriptionPlainSwapEditorController(DatabaseConnector databaseConnector, ResourceGovernor resourceGovernor, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ValuationConfig valuationConfig, ValuationConfig valuationConfig1, org.springframework.boot.info.BuildProperties buildProperties, org.springframework.core.io.ResourceLoader resourceLoader) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<String> changeDataset(String fileName) Controller that handles requests for performing the hotswap of the active datasetorg.springframework.http.ResponseEntity<ValueResult> evaluateFromPlainSwapEditor(PlainSwapOperationRequest plainSwapOperationRequest) Controller that handles requests for contract valuation.org.springframework.http.ResponseEntity<String> generatePlainSwapSdcml(PlainSwapOperationRequest plainSwapOperationRequest) Controller that handles requests for generation of a SDCmL document.org.springframework.http.ResponseEntity<List<CashflowPeriod>> getFixedSchedule(PlainSwapOperationRequest plainSwapOperationRequest) Controller that handles requests for payment schedule generation relative to the fixed leg.org.springframework.http.ResponseEntity<List<CashflowPeriod>> getFloatingSchedule(PlainSwapOperationRequest plainSwapOperationRequest) Controller that handles requests for payment schedule generation relative to the floating leg.org.springframework.http.ResponseEntity<Double> getParRate(PlainSwapOperationRequest plainSwapOperationRequest) Controller method that handles requests for calculating the par rateController that handles requests for the contents of the user contract storage.Controller that handles requests for the contents of the user market data storage.org.springframework.http.ResponseEntity<MarketDataSet> Controller that echoes the active dataset to the clientorg.springframework.http.ResponseEntity<PlainSwapOperationRequest> loadContract(String requestedFilename) Controller that handles requests for loading a stored contract.org.springframework.http.ResponseEntity<ValueResult> refreshMarketData(PlainSwapOperationRequest plainSwapOperationRequest) Controller that handles requests for refresh of the market dataorg.springframework.http.ResponseEntity<String> saveContract(SaveContractRequest saveContractRequest) Controller that handles requests for saving a contract.org.springframework.http.ResponseEntity<String> uploadMarketData(org.springframework.web.multipart.MultipartFile marketData) Controller that handles requests for saving market data.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.finmath.smartcontract.api.PlainSwapEditorApi
_changeDataset, _evaluateFromPlainSwapEditor, _generatePlainSwapSdcml, _getFixedSchedule, _getFloatingSchedule, _getParRate, _getSavedContracts, _getSavedMarketData, _grabMarketData, _loadContract, _refreshMarketData, _saveContract, _uploadMarketData, getRequest
-
Constructor Details
-
PlainSwapEditorController
public PlainSwapEditorController(DatabaseConnector databaseConnector, ResourceGovernor resourceGovernor, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ValuationConfig valuationConfig, ValuationConfig valuationConfig1, org.springframework.boot.info.BuildProperties buildProperties, org.springframework.core.io.ResourceLoader resourceLoader)
-
-
Method Details
-
generatePlainSwapSdcml
public org.springframework.http.ResponseEntity<String> generatePlainSwapSdcml(PlainSwapOperationRequest plainSwapOperationRequest) Controller that handles requests for generation of a SDCmL document.- Specified by:
generatePlainSwapSdcmlin interfacePlainSwapEditorApi- Parameters:
plainSwapOperationRequest- , the specification for the contract as gathered from the user forms- Returns:
- a string containing the SDCmL document
-
evaluateFromPlainSwapEditor
public org.springframework.http.ResponseEntity<ValueResult> evaluateFromPlainSwapEditor(PlainSwapOperationRequest plainSwapOperationRequest) Controller that handles requests for contract valuation.- Specified by:
evaluateFromPlainSwapEditorin interfacePlainSwapEditorApi- Parameters:
plainSwapOperationRequest- the specification for the contract as gathered from the user forms- Returns:
- a result object containing value, currency and reference timestamp for the dataset used
-
getFixedSchedule
public org.springframework.http.ResponseEntity<List<CashflowPeriod>> getFixedSchedule(PlainSwapOperationRequest plainSwapOperationRequest) Controller that handles requests for payment schedule generation relative to the fixed leg.- Specified by:
getFixedSchedulein interfacePlainSwapEditorApi- Parameters:
plainSwapOperationRequest- the specification for the contract as gathered from the user forms- Returns:
- a list of cashflows matched with their reference period
-
getFloatingSchedule
public org.springframework.http.ResponseEntity<List<CashflowPeriod>> getFloatingSchedule(PlainSwapOperationRequest plainSwapOperationRequest) Controller that handles requests for payment schedule generation relative to the floating leg.- Specified by:
getFloatingSchedulein interfacePlainSwapEditorApi- Parameters:
plainSwapOperationRequest- the specification for the contract as gathered from the user forms- Returns:
- a list of cashflows matched with their reference period
-
grabMarketData
Controller that echoes the active dataset to the client- Specified by:
grabMarketDatain interfacePlainSwapEditorApi- Returns:
- a market data transfer message that matches the contents of the active dataset
-
refreshMarketData
public org.springframework.http.ResponseEntity<ValueResult> refreshMarketData(PlainSwapOperationRequest plainSwapOperationRequest) Controller that handles requests for refresh of the market data- Specified by:
refreshMarketDatain interfacePlainSwapEditorApi- Returns:
- the valuation result obtained with the refreshed data
-
getParRate
public org.springframework.http.ResponseEntity<Double> getParRate(PlainSwapOperationRequest plainSwapOperationRequest) Controller method that handles requests for calculating the par rate- Specified by:
getParRatein interfacePlainSwapEditorApi- Parameters:
plainSwapOperationRequest- the specification for the contract as gathered from the user forms- Returns:
- the par rate
-
getSavedContracts
Controller that handles requests for the contents of the user contract storage.- Specified by:
getSavedContractsin interfacePlainSwapEditorApi- Returns:
- a list of file names
-
changeDataset
Controller that handles requests for performing the hotswap of the active dataset- Specified by:
changeDatasetin interfacePlainSwapEditorApi- Parameters:
fileName- the source file name or the USELIVE directive- Returns:
- a brief status message
-
getSavedMarketData
Controller that handles requests for the contents of the user market data storage.- Specified by:
getSavedMarketDatain interfacePlainSwapEditorApi- Returns:
- a list of file names
-
loadContract
public org.springframework.http.ResponseEntity<PlainSwapOperationRequest> loadContract(String requestedFilename) Controller that handles requests for loading a stored contract.- Specified by:
loadContractin interfacePlainSwapEditorApi- Parameters:
requestedFilename- the name of the file containing the stored contract- Returns:
- a contract specification
-
saveContract
public org.springframework.http.ResponseEntity<String> saveContract(SaveContractRequest saveContractRequest) Controller that handles requests for saving a contract.- Specified by:
saveContractin interfacePlainSwapEditorApi- Parameters:
saveContractRequest- an object containing contract specification and destination file name- Returns:
- a brief status message
-
uploadMarketData
public org.springframework.http.ResponseEntity<String> uploadMarketData(org.springframework.web.multipart.MultipartFile marketData) Controller that handles requests for saving market data.- Specified by:
uploadMarketDatain interfacePlainSwapEditorApi- Parameters:
marketData- a multipart file wrapping the source JSON file- Returns:
- a brief status message
-