public class

ZuoraModule

extends Object
implements MuleContextAware
java.lang.Object
   ↳ org.mule.modules.zuora.ZuoraModule
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Zuora is the leader in online recurring billing and payment solutions for SaaS and subscription businesses.

This connector provides full access to the Z-Commerce platform API.

Summary

Nested Classes
class ZuoraModule.ZuoraOperatorVisitor  
class ZuoraModule.ZuoraQueryVisitor  
Constants
String API_URL
String REST_API_URL
Fields
private ZuoraClient<Exception> client The client to use.
private String endpoint Target URI to connect to
private MuleContext muleContext
private String password
private RestZuoraClient restClient
private String username
Public Constructors
ZuoraModule()
Public Methods
List<AmendResult> amend(List<AmendRequest> amendaments)
Amends subscriptions

synchronized void connect(String username, String password)
Connects to Zuora
List<SaveResult> create(String type, List<Map<String, Object>> zobjects)
Batch creation of ZObjects

List<DeleteResult> delete(String type, List<String> ids)
Batch delete of ZObjects

synchronized void disconnect()
Destroys the session
PagingDelegate<Map<String, Object>> find(String query, PagingConfiguration pagingConfiguration)
Lazily retrieves ZObject that match a given query, written in Zuora native query language

If you expect more than 2000 results to be returned, remember that you have to enable queryMore for your zuora account (as documented: http://knowledgecenter.zuora.com/D_Using_the_Zuora_API/C_API_Reference/E_API_Calls/queryMore())

List<SaveResult> generate(String type, List<Map<String, Object>> zobjects)
Batch creation of invoices for accounts

ZuoraClient<Exception> getClient()
String getEndpoint()
String getExportFileContent(String exportId)
Retrieve an exported file from Zuora, and return its content as a String
InputStream getExportFileStream(String exportId)
Retrieve an exported file from Zuora and return an InputStream to it
MetaData getMetadata(MetaDataKey key)
List<MetaDataKey> getMetadataKeys()
String getSessionId()
User getUserInfo()
Answers user information

boolean isConnected()
void setClient(ZuoraClient<Exception> client)
void setEndpoint(String endpoint)
void setMuleContext(MuleContext context)
void setRestClient(RestZuoraClient client)
List<SubscribeResult> subscribe(List<SubscribeRequest> subscriptions)
Batch creation of ZObjects associated to Subscriptions

String toNativeQuery(DsqlQuery query)
List<SaveResult> update(String type, List<Map<String, Object>> zobjects)
Batch update of ZObjects

[Expand]
Inherited Methods
From class java.lang.Object
From interface org.mule.api.context.MuleContextAware

Constants

private static final String API_URL

Constant Value: "/apps/services/a/48.0"

private static final String REST_API_URL

Constant Value: "/apps/api/"

Fields

private ZuoraClient<Exception> client

The client to use. Mainly for mocking purposes

private String endpoint

Target URI to connect to

private MuleContext muleContext

private String password

private RestZuoraClient restClient

private String username

Public Constructors

public ZuoraModule ()

Public Methods

public List<AmendResult> amend (List<AmendRequest> amendaments)

Amends subscriptions

Parameters
amendaments The list of amendments to perform
Returns
Throws
Exception if amend fails

public synchronized void connect (String username, String password)

Connects to Zuora

Parameters
username Username to identify the user
password Password to authenticate the username
Throws
ConnectionException

public List<SaveResult> create (String type, List<Map<String, Object>> zobjects)

Batch creation of ZObjects

Parameters
type The type of zobject passed
zobjects The zobjects to create
Returns
Throws
Exception If creation fails

public List<DeleteResult> delete (String type, List<String> ids)

Batch delete of ZObjects

Parameters
type The type of ZObjects to delete
ids The list of ids to delete
Returns
Throws
Exception if deletion fails

public synchronized void disconnect ()

Destroys the session

public PagingDelegate<Map<String, Object>> find (String query, PagingConfiguration pagingConfiguration)

Lazily retrieves ZObject that match a given query, written in Zuora native query language

If you expect more than 2000 results to be returned, remember that you have to enable queryMore for your zuora account (as documented: http://knowledgecenter.zuora.com/D_Using_the_Zuora_API/C_API_Reference/E_API_Calls/queryMore())

Parameters
query The query, using the SQL-Like Zuora Query Language
pagingConfiguration .
Returns
  • a ZObject iterable. ZObject returned by this operation may be instances of either static ZObject - like Account or Amendment -, if the object is a non-customizable Zuora entity, or ZObject, if the object is a customizable Zuora entity
Throws
Exception if find fails

public List<SaveResult> generate (String type, List<Map<String, Object>> zobjects)

Batch creation of invoices for accounts

Parameters
type The type of zobject passed
zobjects The zobjects to generate, as a list of string-object maps . Zuora attribute names, unlike java beans, are CamelCase.
Returns
Throws
Exception if generation fails

public ZuoraClient<Exception> getClient ()

public String getEndpoint ()

public String getExportFileContent (String exportId)

Retrieve an exported file from Zuora, and return its content as a String

Parameters
exportId Id of the Zuora exported file to retrieve
Returns
  • the file's content as a String
Throws
IOException if can't access the exported file
ZuoraException if the exported file doesn't exist

public InputStream getExportFileStream (String exportId)

Retrieve an exported file from Zuora and return an InputStream to it

Parameters
exportId Id of the Zuora exported file to retrieve
Returns
  • an InputStream to read from the exported file
Throws
IOException if can't access the exported file
ZuoraException if the exported file doesn't exist

public MetaData getMetadata (MetaDataKey key)

Parameters
key
Throws
Exception

public List<MetaDataKey> getMetadataKeys ()

public String getSessionId ()

public User getUserInfo ()

Answers user information

Returns
Throws
Exception if request fails

public boolean isConnected ()

public void setClient (ZuoraClient<Exception> client)

Parameters
client

public void setEndpoint (String endpoint)

Parameters
endpoint

public void setMuleContext (MuleContext context)

Parameters
context

public void setRestClient (RestZuoraClient client)

Parameters
client

public List<SubscribeResult> subscribe (List<SubscribeRequest> subscriptions)

Batch creation of ZObjects associated to Subscriptions

Parameters
subscriptions The list of subscriptions to perform
Returns
  • a subscription results list, one for each subscription
Throws
Exception If subscription fails

public String toNativeQuery (DsqlQuery query)

Parameters
query

public List<SaveResult> update (String type, List<Map<String, Object>> zobjects)

Batch update of ZObjects

Parameters
type The type of zobject passed
zobjects The zobjects to update, as a list of string-object maps . Zuora attribute names, unlike java beans, are CamelCase.
Returns
Throws
Exception If update fails