Class TransferData

java.lang.Object
ru.bgcrm.plugin.bgbilling.TransferData

public class TransferData extends Object
  • Constructor Details

    • TransferData

      public TransferData(DBInfo dbInfo)
  • Method Details

    • getObjectMapper

      public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
    • postData

      public Document postData(Request request, User user)
      Sends a request to the billing, throws an exception on error, and also throws an exception when the timeout is reached
      Parameters:
      request - the request
      user - the user
      Returns:
      the response document
    • postData

      public com.fasterxml.jackson.databind.JsonNode postData(RequestJsonRpc request, User user)
      Sends a request to the web service in JSON-RPC format. Details on working with the format are in the RequestJsonRpc documentation
      Parameters:
      request - the request
      user - the user
      Returns:
      the data element from the response
    • postDataReturn

      public com.fasterxml.jackson.databind.JsonNode postDataReturn(RequestJsonRpc request, User user)
      Sends a request to the web service in JSON-RPC format. Details on working with the format are in the RequestJsonRpc documentation
      Parameters:
      request - the request
      user - the user
      Returns:
      the return element from the response
    • postDataGetBytes

      public byte[] postDataGetBytes(Request request, User user)
      Sends a request and returns the result as a byte array
      Parameters:
      request - the request
      user - the user
      Returns:
      the response bytes
    • postDataGetString

      public String postDataGetString(Request request, User user)
      Sends a request and returns the result as a string, decoded with RESPONSE_ENCODING
      Parameters:
      request - the request
      user - the user
      Returns:
      the response string
    • uploadFile

      public int uploadFile(String handler, BGServerFile bgServerFile, InputStream inputStream, User user) throws IOException, URISyntaxException
      Uploads a file to the billing server
      Parameters:
      handler - a string like kernel/0/method, module/id/method, plugin.id/method
      bgServerFile - the file metadata
      inputStream - the file content
      Throws:
      IOException
      URISyntaxException
    • initSession

      public void initSession(User user)
    • toString

      public String toString()
      Overrides:
      toString in class Object