Interface CurrencyConversionSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface CurrencyConversionSession extends OsidSession

This session defines methods to convert currency.

  • Method Details

    • getSourceCurrencyType

      Type getSourceCurrencyType()
      Gets the source currency type used in this session.
      Returns:
      the source currency
      Compliance:
      mandatory - This method must be implemented.
    • getTargetCurrencyType

      Type getTargetCurrencyType()
      Gets the target currency type used in this session.
      Returns:
      the target currency
      Compliance:
      mandatory - This method must be implemented.
    • canConvertCurrency

      boolean canConvertCurrency()
      Tests if this user can perform currency conversions. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer lookup operations.
      Returns:
      false if conversion methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • convertCurrency

      Currency convertCurrency(Currency sourceCurrencyAmount) throws OperationFailedException, PermissionDeniedException
      Converts currency.
      Parameters:
      sourceCurrencyAmount - the currency amount to convert
      Returns:
      resulting currency units
      Throws:
      InvalidArgumentException - sourceCurrencyAmount.getCurrencyType() != getSourcecurrencyType()
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • convertCurrencies

      Currency[] convertCurrencies(Currency[] sourceCurrencyAmounts) throws OperationFailedException, PermissionDeniedException
      Converts currencies.
      Parameters:
      sourceCurrencyAmounts - the currency amounts to convert
      Returns:
      resulting currency units
      Throws:
      InvalidArgumentException - sourceCurrencyAmount.getCurrencyType() != getSourcecurrencyType()
      NullArgumentException - sourceCurrencyAmounts is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.