com.mulesoft.cloudhub.client
Interface CloudhubConnection

All Known Implementing Classes:
Connection, DomainConnection

public interface CloudhubConnection

Interface of the cloudhub connector

Since:
1.4

Method Summary
 Notification create(Notification notification)
           Connects to CH to create a notification
 Tenant create(Tenant tenant, String domain)
           Creates a tenant
 Notification createNotification(String text, Notification.Priority priority, String domain, Map<String,String> customProperties)
          Deprecated. 
 void delete(String tenantId, String domain)
           Deletes a given tenant
 void deleteTenants(String domain, List<String> tenantIds)
           Deletes the tenants matching one of many given ids
 void dismissAllNotifications()
           Does what dismissNotification(String) to all the queued notifications in CH
 void dismissNotification(String href)
           Removes the notification form the read queue
 Account getAccount()
          Returns the Account information of the logged user
 Tenant getTenant(String domain, String tenantId)
           Returns an specific tenant
 List<Application> listApplications()
           
 NotificationResults listNotifications(Integer maxResults, Integer offset, String tenantId)
           Lists all the notifications of an app.
 TenantResults listTenants(String domain, Integer limit, Integer offset, String query)
           Lists tenants for a given domain
 DomainConnection on(String domain)
           
 boolean test()
           
 Tenant update(Tenant tenant, String domain)
           Updates a tenant
 

Method Detail

on

DomainConnection on(String domain)
Parameters:
domain -

The domain of the required connection

Returns:

A connection for a specific domain


test

boolean test()
Returns:
true if provided connection details allow to connect; false otherwise

listApplications

List<Application> listApplications()
Returns:
all existing applications

getAccount

Account getAccount()
Returns the Account information of the logged user

Returns:
The account information.

createNotification

@Deprecated
Notification createNotification(String text,
                                           Notification.Priority priority,
                                           String domain,
                                           Map<String,String> customProperties)
Deprecated. 

Use create(Notification) instead


create

Notification create(Notification notification)

Connects to CH to create a notification

Parameters:
notification -

The notification information that needs to be created in CH

Returns:

The created notification

Throws:

- CloudHub exceptions based on the http response.

Since:
1.4

listNotifications

NotificationResults listNotifications(Integer maxResults,
                                      Integer offset,
                                      String tenantId)

Lists all the notifications of an app.

In the case of a multitenant application those notifications will be filtered by tenant id.

Parameters:
offset -

Since which notification. For pagination.

maxResults -

Maximum number of results. For pagination.

tenantId -

Filter by tenant id. If null then don't apply the filter

Returns:

all existing applications


dismissNotification

void dismissNotification(String href)

Removes the notification form the read queue

Parameters:
href -

href id of the notification that needs to be dismissed


dismissAllNotifications

void dismissAllNotifications()

Does what dismissNotification(String) to all the queued notifications in CH


listTenants

TenantResults listTenants(String domain,
                          Integer limit,
                          Integer offset,
                          String query)

Lists tenants for a given domain

Parameters:
domain - the domain owning the tenants
limit - The maximum number of results to return by default. Maximum of 100.
offset - The offset to start searching at
query - The company name, contact name, and email of the tenant to search form. Performs a case insensitive match to any part of the tenant name.
Returns:
an instance of TenantResults

getTenant

Tenant getTenant(String domain,
                 String tenantId)

Returns an specific tenant

Parameters:
domain - the domain owning the tenants
tenantId - the id of the tenant you want
Returns:
an instance of Tenant

create

Tenant create(Tenant tenant,
              String domain)

Creates a tenant

Parameters:
tenant - an instance of Tenant representing the tenant
domain - the domain that will own the tenant
Returns:
an instance of Tenant carrying the state of the newly created tenant

update

Tenant update(Tenant tenant,
              String domain)

Updates a tenant

Parameters:
tenant - an instance of Tenant with the tenant's new state
domain - the domain that will own the tenant
Returns:
an instance of Tenant carrying the tenant's updated state

delete

void delete(String tenantId,
            String domain)

Deletes a given tenant

Parameters:
tenantId - the id of the tenant to be deleted
domain - the domain that owns the tenant to be deleted

deleteTenants

void deleteTenants(String domain,
                   List<String> tenantIds)

Deletes the tenants matching one of many given ids

Parameters:
domain - the domain you want to clear of tenants
tenantIds - a list with tenant ids to be deleted


Copyright © 2012-2013. All Rights Reserved.