public class CloudHubConnectionImpl extends Object implements CloudHubConnectionI
| Modifier and Type | Class and Description |
|---|---|
static class |
CloudHubConnectionImpl.ObjectMapper |
| Modifier and Type | Field and Description |
|---|---|
protected String |
accessToken |
protected String |
apiToken |
protected com.sun.jersey.api.client.Client |
client |
protected boolean |
csAuthentication |
static String |
DEFAULT_URL
Deprecated.
|
protected String |
environmentId |
protected org.slf4j.Logger |
logger |
static String |
NEW_DEFAULT_URL |
protected String |
password |
protected String |
url |
protected String |
username |
| Modifier | Constructor and Description |
|---|---|
protected |
CloudHubConnectionImpl() |
|
CloudHubConnectionImpl(String url,
String accessToken,
boolean debug) |
|
CloudHubConnectionImpl(String url,
String accessToken,
String environmentId,
boolean debug) |
|
CloudHubConnectionImpl(String url,
String username,
String password,
String sandbox,
boolean debug) |
| Modifier and Type | Method and Description |
|---|---|
protected com.sun.jersey.api.client.WebResource.Builder |
authorizeResource(com.sun.jersey.api.client.WebResource pathResource) |
protected CloudHubException |
buildException(com.sun.jersey.api.client.ClientResponse clientResponse) |
CloudHubDomainConnectionI |
connectWithDomain(String domain)
Returns a connection against a given domain of the CloudHub account
|
com.mulesoft.ch.rest.model.Application |
createApplication(com.mulesoft.ch.rest.model.Application application)
Creates an application on your CloudHub account.
|
protected com.sun.jersey.api.client.WebResource.Builder |
createApplicationBuilder(String path) |
protected com.sun.jersey.api.client.WebResource.Builder |
createBuilder(String path) |
CloudHubConnectionI |
createConnection(String url,
String username,
String password,
String sandbox)
Creates a connection against an specific CloudHub Account
|
com.mulesoft.ch.rest.model.Notification |
createNotification(com.mulesoft.ch.rest.model.Notification notification)
Creates a notification based on the given object
|
protected com.sun.jersey.api.client.WebResource.Builder |
createNotificationBuilder(String path) |
protected com.sun.jersey.api.client.WebResource |
createResource(String path) |
String |
getAccessToken() |
String |
getEnvironmentId() |
String |
getPassword() |
List<String> |
getSupportedMuleVersions()
This method returns all the supported mule versions by CloudHub
|
String |
getUrl() |
String |
getUsername() |
protected void |
init(String url,
boolean debug) |
boolean |
isCsAuthentication() |
boolean |
isDomainAvailable(String domain)
Checks if the domain is valid and available
|
com.mulesoft.ch.rest.model.Account |
retrieveAccount()
Retrieves the CloudHub Account
|
Collection<com.mulesoft.ch.rest.model.Application> |
retrieveApplications()
Retrieves All Applications from an specific CloudHub account
|
com.mulesoft.ch.rest.model.Notification |
retrieveNotification(String notificationId)
Retrieves a single notification, based on the given id.
|
com.mulesoft.ch.rest.model.NotificationResults |
retrieveNotifications(String domain,
String tenantId,
Integer limit,
Integer offset,
com.mulesoft.ch.rest.model.Notification.NotificationStatus status,
String message)
Retrieves a bunch of notifications based on given filters
|
void |
updateNotificationsStatus(String domain,
String tenantId,
com.mulesoft.ch.rest.model.Notification.NotificationStatus status)
Updates all notifications status.
|
void |
updateNotificationStatus(String notificationId,
com.mulesoft.ch.rest.model.Notification.NotificationStatus status)
Updates a notification status.
|
protected org.slf4j.Logger logger
@Deprecated public static final String DEFAULT_URL
public static final String NEW_DEFAULT_URL
protected String url
protected com.sun.jersey.api.client.Client client
protected String username
protected String password
protected String apiToken
protected String accessToken
protected String environmentId
protected boolean csAuthentication
protected CloudHubConnectionImpl()
public CloudHubConnectionImpl(String url, String accessToken, String environmentId, boolean debug)
protected void init(String url, boolean debug)
public CloudHubConnectionI createConnection(String url, String username, String password, String sandbox)
CloudHubConnectionIcreateConnection in interface CloudHubConnectionIurl - Optional. CloudHub URL. If null, default value is https://cloudhub.io/username - CloudHub username to log inpassword - CloudHub password to log insandbox - Optional. Only necessary if you want to connect to the non-default sandbox of the account.
If null, the connection will be established against the default sandboxCloudHubConnectionImplpublic CloudHubDomainConnectionI connectWithDomain(String domain)
CloudHubConnectionIconnectWithDomain in interface CloudHubConnectionIdomain - the domain to which you want to connectCloudHubDomainConnectionImpl connected with the specified domainpublic com.mulesoft.ch.rest.model.Account retrieveAccount()
throws CloudHubException
CloudHubConnectionIretrieveAccount in interface CloudHubConnectionIAccountCloudHubException - if there is an error when retrieving the accountpublic boolean isDomainAvailable(String domain) throws CloudHubException
CloudHubConnectionIisDomainAvailable in interface CloudHubConnectionIdomain - the domain to be validatedCloudHubException - if there is an error when validating the domainpublic Collection<com.mulesoft.ch.rest.model.Application> retrieveApplications()
CloudHubConnectionIretrieveApplications in interface CloudHubConnectionIApplicationpublic com.mulesoft.ch.rest.model.Application createApplication(com.mulesoft.ch.rest.model.Application application)
throws CloudHubException
CloudHubConnectionIcreateApplication in interface CloudHubConnectionIapplication - an instance of Application containing all the application's informationApplication containing all the recently created application's information provided by CloudHubCloudHubException - if there was an error while creating the applicationpublic com.mulesoft.ch.rest.model.NotificationResults retrieveNotifications(String domain, String tenantId, Integer limit, Integer offset, com.mulesoft.ch.rest.model.Notification.NotificationStatus status, String message) throws CloudHubException
CloudHubConnectionIretrieveNotifications in interface CloudHubConnectionIdomain - the domain you want to retrieve the notifications fromtenantId - the id of the tenant you want to retrieve the notifications fromlimit - Optional. The maximum number of notifications you want to retrieveoffset - Optional. The beginning index from which notifications will be retrieved. For example, if you have an offset of 5, and your original
search returns 10 notifications, only the last 5 notifications will be returned.status - Optional. One of Notification.NotificationStatusmessage - Optional. If provided, only notifications containing this message in their body will be returned.NotificationResultsCloudHubException - if there was an error while retrieving of filtering the notificationspublic com.mulesoft.ch.rest.model.Notification retrieveNotification(String notificationId) throws CloudHubException
CloudHubConnectionIretrieveNotification in interface CloudHubConnectionInotificationId - The id of the notification you want to retrieveNotificationCloudHubException - if there was an error while retrieving the specified notificationpublic com.mulesoft.ch.rest.model.Notification createNotification(com.mulesoft.ch.rest.model.Notification notification)
throws CloudHubException
CloudHubConnectionIcreateNotification in interface CloudHubConnectionInotification - an instance of Notification you want to createNotification with the created notification's information provided by CloudHubCloudHubException - if there was an error while creating the notificationpublic void updateNotificationsStatus(String domain, String tenantId, com.mulesoft.ch.rest.model.Notification.NotificationStatus status) throws CloudHubException
CloudHubConnectionIupdateNotificationsStatus in interface CloudHubConnectionIdomain - The domain of the notifications you want to update.tenantId - The id of the tenant from which the notifications you want to update belong to.status - one of Notification.NotificationStatus representing the new status for the notificationCloudHubException - if there was an error while updating the notification statuspublic void updateNotificationStatus(String notificationId, com.mulesoft.ch.rest.model.Notification.NotificationStatus status) throws CloudHubException
CloudHubConnectionIupdateNotificationStatus in interface CloudHubConnectionInotificationId - The id of the notification you want to updatestatus - one of Notification.NotificationStatus representing the new status for the notificationCloudHubException - if there was an error while updating the notification statuspublic List<String> getSupportedMuleVersions() throws CloudHubException
CloudHubConnectionIgetSupportedMuleVersions in interface CloudHubConnectionICloudHubExceptionprotected com.sun.jersey.api.client.WebResource.Builder createBuilder(String path)
protected com.sun.jersey.api.client.WebResource.Builder authorizeResource(com.sun.jersey.api.client.WebResource pathResource)
protected com.sun.jersey.api.client.WebResource createResource(String path)
protected final com.sun.jersey.api.client.WebResource.Builder createApplicationBuilder(String path)
protected final com.sun.jersey.api.client.WebResource.Builder createNotificationBuilder(String path)
protected CloudHubException buildException(com.sun.jersey.api.client.ClientResponse clientResponse) throws CloudHubException
CloudHubExceptionpublic String getUrl()
getUrl in interface CloudHubConnectionIpublic String getUsername()
getUsername in interface CloudHubConnectionIpublic String getPassword()
getPassword in interface CloudHubConnectionIpublic String getEnvironmentId()
getEnvironmentId in interface CloudHubConnectionIpublic String getAccessToken()
getAccessToken in interface CloudHubConnectionIpublic boolean isCsAuthentication()
isCsAuthentication in interface CloudHubConnectionICopyright © 2012-2016. All Rights Reserved.