public class

GoogleTasksConnector

extends AbstractGoogleOAuthConnector
java.lang.Object
   ↳ org.mule.modules.google.AbstractGoogleOAuthConnector
     ↳ org.mule.module.google.task.GoogleTasksConnector
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Google Tasks Cloud connector. This connector covers almost all the Google Tasks API v3 using OAuth2 for authentication.

Summary

Constants
String NEXT_PAGE_TOKEN
[Expand]
Inherited Constants
From class org.mule.modules.google.AbstractGoogleOAuthConnector
Fields
private String accessToken
private String applicationName Application name registered on Google API console
private Tasks client The google api client
private String consumerKey The OAuth2 consumer key
private String consumerSecret The OAuth2 consumer secret
private IdentifierPolicy identifierPolicy This policy represents which id we want to use to represent each google account.
private String scope The OAuth scopes you want to request
[Expand]
Inherited Fields
From class org.mule.modules.google.AbstractGoogleOAuthConnector
Public Constructors
GoogleTasksConnector()
Public Methods
void clearTasks(String taskListId)
Clears all completed tasks from the specified task list.
void deleteTask(String taskListId, String taskId)
Deletes the specified task from the task list.
void deleteTaskList(String taskListId)
Deletes the authenticated user's specified task list.
String getAccessToken()
String getAccessTokenId()
String getApplicationName()
String getConsumerKey()
String getConsumerSecret()
IdentifierPolicy getIdentifierPolicy()
String getScope()
Task getTaskById(String taskListId, String taskId)
Returns the specified task.
TaskList getTaskListById(String taskListId)
Returns the authenticated user's specified task list
List<TaskList> getTaskLists(MuleMessage message, long maxResults, String pageToken)
Returns all the authenticated user's task lists.
List<Task> getTasks(MuleMessage message, String taskListId, String completedMin, String completedMax, String dueMin, String dueMax, String updatedMin, long maxResults, String pageToken, boolean showDeleted, boolean showHidden, boolean showcompleted)
Returns all tasks in the specified task list.
Task insertTask(String taskListId, Task task)
Creates a new task on the specified task list
TaskList insertTaskList(TaskList taskList)
Creates a new task list and adds it to the authenticated user's task lists.
Task move(String taskListId, String taskId, String parentId, String previousId)
Moves the specified task to another position in the task list.
void postAuth()
void setAccessToken(String accessToken)
void setApplicationName(String applicationName)
void setConsumerKey(String consumerKey)
void setConsumerSecret(String consumerSecret)
void setIdentifierPolicy(IdentifierPolicy identifierPolicy)
void setScope(String scope)
Task updateTask(String taskListId, String taskId, Task task)
Updates the specified task.
TaskList updateTaskList(TaskList taskList, String taskListId)
Updates the authenticated user's specified task list.
[Expand]
Inherited Methods
From class org.mule.modules.google.AbstractGoogleOAuthConnector
From class java.lang.Object

Constants

public static final String NEXT_PAGE_TOKEN

Constant Value: "GoogleTask_NEXT_PAGE_TOKEN"

Fields

private String accessToken

private String applicationName

Application name registered on Google API console

private Tasks client

The google api client

private String consumerKey

The OAuth2 consumer key

private String consumerSecret

The OAuth2 consumer secret

private IdentifierPolicy identifierPolicy

This policy represents which id we want to use to represent each google account. PROFILE means that we want the google profile id. That means, the user's primary key in google's DB. This is a long number represented as a string. EMAIL means you want to use the account's email address

private String scope

The OAuth scopes you want to request

Public Constructors

public GoogleTasksConnector ()

Public Methods

public void clearTasks (String taskListId)

Clears all completed tasks from the specified task list. The affected tasks will be marked as 'hidden' and no longer be returned by default when retrieving all tasks for a task list.

Parameters
taskListId Task list identifier
Throws
IOException if there's an error in the communication

public void deleteTask (String taskListId, String taskId)

Deletes the specified task from the task list.

Parameters
taskListId Task list identifier
taskId Task identifier.
Throws
IOException if there's an error in the communication

public void deleteTaskList (String taskListId)

Deletes the authenticated user's specified task list.

Parameters
taskListId Task list identifier.
Throws
IOException if there's an error in the communication

public String getAccessToken ()

public String getAccessTokenId ()

public String getApplicationName ()

public String getConsumerKey ()

public String getConsumerSecret ()

public IdentifierPolicy getIdentifierPolicy ()

public String getScope ()

public Task getTaskById (String taskListId, String taskId)

Returns the specified task.

Parameters
taskListId Task list identifier
taskId Task identifier
Returns
Throws
IOException if there's an error in the communication

public TaskList getTaskListById (String taskListId)

Returns the authenticated user's specified task list

Parameters
taskListId Task list identifier.
Returns
Throws
IOException if there's an error in the communication

public List<TaskList> getTaskLists (MuleMessage message, long maxResults, String pageToken)

Returns all the authenticated user's task lists. For supporting google's paging mechanism, the next page token is store on the message property "GoogleTask_NEXT_PAGE_TOKEN". If there isn't a next page, then the property is removed

Parameters
message The current mule message
maxResults Maximum number of task lists returned on one page
pageToken Token specifying the result page to return
Returns
Throws
IOException if there's an error in the communication

public List<Task> getTasks (MuleMessage message, String taskListId, String completedMin, String completedMax, String dueMin, String dueMax, String updatedMin, long maxResults, String pageToken, boolean showDeleted, boolean showHidden, boolean showcompleted)

Returns all tasks in the specified task list. This method accepts a number of filtering attributes. The one for which no values is specified will not be used when filtering For supporting google's paging mechanism, the next page token is store on the message property "GoogleTask_NEXT_PAGE_TOKEN". If there isn't a next page, then the property is removed

Parameters
message The current mule message
taskListId Task list identifier
completedMin Lower bound for a task's completion date (as a RFC 3339 timestamp) to filter by
completedMax Upper bound for a task's completion date (as a RFC 3339 timestamp) to filter by
dueMin Lower bound for a task's due date (as a RFC 3339 timestamp) to filter by
dueMax Upper bound for a task's due date (as a RFC 3339 timestamp) to filter by
updatedMin Lower bound for a task's last modification time (as a RFC 3339 timestamp) to filter by
maxResults Maximum number of task lists returned on one page
pageToken Token specifying the result page to return
showDeleted Flag indicating whether deleted tasks are returned in the result
showHidden Flag indicating whether hidden tasks are returned in the result
showcompleted Flag indicating whether completed tasks are returned in the result
Returns
  • list with instances of Task
Throws
IOException if there's an error in the communication

public Task insertTask (String taskListId, Task task)

Creates a new task on the specified task list

Parameters
taskListId Task list identifier
task Instance of Task containing the state of the task to be inserted
Returns
  • instance of Task representing the state of the newly inserted task
Throws
IOException if there's an error in the communication

public TaskList insertTaskList (TaskList taskList)

Creates a new task list and adds it to the authenticated user's task lists.

Parameters
taskList The taskList to be inserted
Returns
  • an instance of TaskList representing the newly inserted task list
Throws
IOException if there's an error in the communication

public Task move (String taskListId, String taskId, String parentId, String previousId)

Moves the specified task to another position in the task list. This can include putting it as a child task under a new parent and/or move it to a different position among its sibling tasks.

Parameters
taskListId Task list identifier
taskId Identifier for the task being moved.
parentId Parent task identifier. If the task is created at the top level, this parameter is omitted
previousId New previous sibling task identifier. If the task is moved to the first position among its siblings, this parameter is omitted
Returns
  • an instance of Task representing the state of the moved task
Throws
IOException if there's an error in the communication

public void postAuth ()

public void setAccessToken (String accessToken)

Parameters
accessToken

public void setApplicationName (String applicationName)

Parameters
applicationName

public void setConsumerKey (String consumerKey)

Parameters
consumerKey

public void setConsumerSecret (String consumerSecret)

Parameters
consumerSecret

public void setIdentifierPolicy (IdentifierPolicy identifierPolicy)

Parameters
identifierPolicy

public void setScope (String scope)

Parameters
scope

public Task updateTask (String taskListId, String taskId, Task task)

Updates the specified task.

Parameters
taskListId Task list identifier
taskId Task identifier.
task Instance of Task containing the state we want the updated task to have
Returns
  • an instance of Task representing the state of the updated task
Throws
IOException if there's an error in the communication

public TaskList updateTaskList (TaskList taskList, String taskListId)

Updates the authenticated user's specified task list.

Parameters
taskList An instance of TaskList with the task list's new state
taskListId Task list identifier
Returns
  • an instance of TaskList representing the state of the updated list
Throws
IOException if there's an error in the communication