com.mulesoft.cloudhub.client
Interface CloudHubDomainConnectionI

All Superinterfaces:
CloudHubConnectionI
All Known Implementing Classes:
CloudHubDomainConnectionImpl

public interface CloudHubDomainConnectionI
extends CloudHubConnectionI


Method Summary
 void deleteApplication()
          Deletes the application by using the connection's domain.
 void deployApplication(File file, long waitMaxTime)
          Deploys an application with the provided fileStream
 String getDomain()
          Returns the connected domain
 com.mulesoft.ch.rest.model.Application retrieveApplication()
          Retrieves the application based on the connected domain
 com.mulesoft.ch.rest.model.ApplicationStatus retrieveApplicationStatus()
          Retrieves the application's status
 com.mulesoft.ch.rest.model.Application updateApplication(com.mulesoft.ch.rest.model.ApplicationUpdateInfo application)
          Updates an application's information on your CloudHub account.
 void updateApplicationStatus(com.mulesoft.ch.rest.model.ApplicationStatusChange applicationStatus, long waitMaxTime)
          Updates an application's status based on some specific commands.
 
Methods inherited from interface com.mulesoft.cloudhub.client.CloudHubConnectionI
connectWithDomain, createApplication, getAccessToken, getPassowrd, getSupportedMuleVersions, getUrl, getUsername, isDomainAvailable, retrieveAccount, retrieveApplications
 

Method Detail

getDomain

String getDomain()
Returns the connected domain

Returns:
the connected domain

retrieveApplication

com.mulesoft.ch.rest.model.Application retrieveApplication()
                                                           throws CloudHubException
Retrieves the application based on the connected domain

Returns:
an instance of Application
Throws:
CloudHubException - if the domain does not exist

retrieveApplicationStatus

com.mulesoft.ch.rest.model.ApplicationStatus retrieveApplicationStatus()
                                                                       throws CloudHubException
Retrieves the application's status

Returns:
one of com.mulesoft.ch.rest.model.Application.ApplicationStatus
Throws:
CloudHubException - if there was an error when retrieving the application status

deployApplication

void deployApplication(File file,
                       long waitMaxTime)
                       throws CloudHubException
Deploys an application with the provided fileStream

Parameters:
file - the file to be deployed
waitMaxTime - Maximum time allowed to deploy/undeploy in miliseconds. Case 1: 0, the connector won't wait CH to finish the deploy/undeploy process and will return a response based on CH API response status. Case 2: 1, the connector will wait until CH finish the deploy/undeploy process and will throw an exception if the deploy fails. Case 3: anyOthervalue, the connector will wait that amount of miliseconds for CH to finish the deploy/undeploy process. If takes longer, it will throw an exception. If takes shorter, it will follow the same process as case 2.
Throws:
CloudHubException - if there was an error while deploying the application

updateApplication

com.mulesoft.ch.rest.model.Application updateApplication(com.mulesoft.ch.rest.model.ApplicationUpdateInfo application)
                                                         throws CloudHubException
Updates an application's information on your CloudHub account. This method just updates metaData like Mule Version, Description, etc. If you want to update a new stream, use deployApplication(java.io.File, long) instead

Parameters:
applicationInfo - an instance of ApplicationUpdateInfo with the information to be updated
Returns:
an instance of Application containing all the new application's information provided by CloudHub
Throws:
CloudHubException - if there was an error while updating the application

updateApplicationStatus

void updateApplicationStatus(com.mulesoft.ch.rest.model.ApplicationStatusChange applicationStatus,
                             long waitMaxTime)
                             throws CloudHubException
Updates an application's status based on some specific commands. Can be START or STOP

Parameters:
applicationStatus - an instance of com.mulesoft.cloudhub.client.ApplicationStatusChange with the new application status
waitMaxTime - Maximum time allowed to deploy/undeploy in miliseconds. Case 1: 0, the connector won't wait CH to finish the deploy/undeploy process and will return a response based on CH API response status. Case 2: 1, the connector will wait until CH finish the deploy/undeploy process and will throw an exception if the deploy fails. Case 3: anyOthervalue, the connector will wait that amount of miliseconds for CH to finish the deploy/undeploy process. If takes longer, it will throw an exception. If takes shorter, it will follow the same process as case 2.
Throws:
CloudHubException - if there was an error while updating the application's status.

deleteApplication

void deleteApplication()
                       throws CloudHubException
Deletes the application by using the connection's domain. The domain can not be invalid since it was validated when creating the connection.

Throws:
CloudHubException - if there was an error while deleting the application


Copyright © 2012-2015. All Rights Reserved.