Class TransferData
java.lang.Object
ru.bgcrm.plugin.bgbilling.TransferData
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.ObjectMappervoidinitSession(User user) com.fasterxml.jackson.databind.JsonNodepostData(RequestJsonRpc request, User user) Sends a request to the web service in JSON-RPC format.Sends a request to the billing, throws an exception on error, and also throws an exception when the timeout is reachedbyte[]postDataGetBytes(Request request, User user) Sends a request and returns the result as a byte arraypostDataGetString(Request request, User user) Sends a request and returns the result as a string, decoded withRESPONSE_ENCODINGcom.fasterxml.jackson.databind.JsonNodepostDataReturn(RequestJsonRpc request, User user) Sends a request to the web service in JSON-RPC format.toString()intuploadFile(String handler, BGServerFile bgServerFile, InputStream inputStream, User user) Uploads a file to the billing server
-
Constructor Details
-
TransferData
-
-
Method Details
-
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
postData
-
postData
Sends a request to the web service in JSON-RPC format. Details on working with the format are in theRequestJsonRpcdocumentation- Parameters:
request- the requestuser- the user- Returns:
- the
dataelement from the response
-
postDataReturn
Sends a request to the web service in JSON-RPC format. Details on working with the format are in theRequestJsonRpcdocumentation- Parameters:
request- the requestuser- the user- Returns:
- the
returnelement from the response
-
postDataGetBytes
-
postDataGetString
-
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/methodbgServerFile- the file metadatainputStream- the file content- Throws:
IOExceptionURISyntaxException
-
initSession
-
toString
-