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
ConstructorDescriptionPlainSwapEditorController
(DatabaseConnector databaseConnector, ResourceGovernor resourceGovernor, com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
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, wait
Methods 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)
-
-
Method Details
-
generatePlainSwapSdcml
public org.springframework.http.ResponseEntity<String> generatePlainSwapSdcml(PlainSwapOperationRequest plainSwapOperationRequest) Controller that handles requests for generation of a SDCmL document.- Specified by:
generatePlainSwapSdcml
in 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:
evaluateFromPlainSwapEditor
in 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:
getFixedSchedule
in 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:
getFloatingSchedule
in 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:
grabMarketData
in 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:
refreshMarketData
in 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:
getParRate
in 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:
getSavedContracts
in interfacePlainSwapEditorApi
- Returns:
- a list of file names
-
changeDataset
Controller that handles requests for performing the hotswap of the active dataset- Specified by:
changeDataset
in 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:
getSavedMarketData
in 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:
loadContract
in 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:
saveContract
in 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:
uploadMarketData
in interfacePlainSwapEditorApi
- Parameters:
marketData
- a multipart file wrapping the source JSON file- Returns:
- a brief status message
-