public class

CloudHubConnector

extends Object
java.lang.Object
   ↳ org.mule.modules.cloudhub.CloudHubConnector
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Provides the ability to interact with Mule CloudHub from within a Mule application. There are operations to deploy, start, stop, and update applications as well as send notifications from your application to CloudHub.

When running this connector in an application inside CloudHub, it will use token based authentication to access the API. This will allow access and usage of the CloudHub APIs without the need to specify your username and password.

Summary

Fields
private Connection connection
private Logger logger
private Long maxWaitTime Maximum time allowed to deplpoy/undeploy.
private String password CloudHub password.
private String url CloudHub URL.
private String username CloudHub username.
Public Constructors
CloudHubConnector()
Public Methods
Notification createNotification(String message, Notification.Priority priority, String domain, Object payload, Map<String, String> customProperties)
Create a notification inside CloudHub.
void createNotificationFromFlow(String message, Notification.Priority priority, Object payload, boolean includeStacktrace, Map<String, String> customProperties)
Create a notification inside CloudHub for your flow.
void deleteApplication(String domain)
Delete an application.
void deployApplication(InputStream file, String domain, String muleVersion, int workerCount, Map<String, String> environmentVariables)
Deploy specified application.
void dismissNotification(String href)
Dismiss an individual notification.
Application getApplication(String domain)
Get an application.
Long getMaxWaitTime()
String getPassword()
static String getStackTrace(Throwable aThrowable)
String getUrl()
String getUsername()
List<Application> listApplications()
List applications.
NotificationResults listNotifications(Integer maxResults, Integer offset)
List a user's notifications.
void setMaxWaitTime(Long maxWaitTime)
void setPassword(String password)
void setUrl(String url)
void setUsername(String username)
void startApplication(String domain)
Start an application.
void stopApplication(String domain)
Stop an application.
void updateApplication(Application application)
Update an application.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private Connection connection

private Logger logger

private Long maxWaitTime

Maximum time allowed to deplpoy/undeploy.

private String password

CloudHub password.

private String url

CloudHub URL.

private String username

CloudHub username.

Public Constructors

public CloudHubConnector ()

Public Methods

public Notification createNotification (String message, Notification.Priority priority, String domain, Object payload, Map<String, String> customProperties)

Create a notification inside CloudHub.

Parameters
message The contents of the notification.
priority The notification priority.
domain The application domain.
payload The payload of the message. If it's an exception, it'll get appended to the message.
customProperties A map to represent custom placeholders on the notification template
Returns
  • The notification that was created.

public void createNotificationFromFlow (String message, Notification.Priority priority, Object payload, boolean includeStacktrace, Map<String, String> customProperties)

Create a notification inside CloudHub for your flow. If not running in an CloudHub environment, this will log to the console.

Parameters
message The contents of the notification.
priority The notification priority.
payload The payload of the message. If it's an exception, it'll get appended to the message.
includeStacktrace If the message payload contains an Exception, whether or not to include the stacktrace. True by default.
customProperties A map to represent custom placeholders on the notification template

public void deleteApplication (String domain)

Delete an application.

Parameters
domain The application domain.

public void deployApplication (InputStream file, String domain, String muleVersion, int workerCount, Map<String, String> environmentVariables)

Deploy specified application.

Parameters
file Mule application to deploy, Input Object type: java.io.InputStream
domain The application domain.
muleVersion The version of Mule, e.g. 3.2.2.
workerCount The number of workers to deploy.
environmentVariables Environment variables for you application.

public void dismissNotification (String href)

Dismiss an individual notification.

Parameters
href The href property of the Notification object.

public Application getApplication (String domain)

Get an application.

Parameters
domain The application domain.
Returns
  • An application.

public Long getMaxWaitTime ()

public String getPassword ()

public static String getStackTrace (Throwable aThrowable)

Parameters
aThrowable

public String getUrl ()

public String getUsername ()

public List<Application> listApplications ()

List applications.

Returns
  • A list of applications.

public NotificationResults listNotifications (Integer maxResults, Integer offset)

List a user's notifications.

Parameters
maxResults The maximum number of results to retrieve.
offset The offset to start listing alerts from.
Returns
  • A List of notifications.

public void setMaxWaitTime (Long maxWaitTime)

Parameters
maxWaitTime

public void setPassword (String password)

Parameters
password

public void setUrl (String url)

Parameters
url

public void setUsername (String username)

Parameters
username

public void startApplication (String domain)

Start an application.

Parameters
domain The application domain.

public void stopApplication (String domain)

Stop an application.

Parameters
domain The application domain.

public void updateApplication (Application application)

Update an application.

Parameters
application The application to update.