public class

YammerConnector

extends Object
java.lang.Object
   ↳ org.mule.yammer.YammerConnector
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Connector for Yammer related functions. Yammer is a social-network-like internal corporate communications system, where users are able to post messages, follow users, images and so on in a manner like Facebook or Twitter. This connector allows to:

  • Retrieve messages
  • Retrieve received messages
  • Retrieve private messages
  • Retrieve sent messages

It's necessary to set in yammer (https://www.yammer.com/client_applications where you can create an application or edit it) the next Callback URL:

http://{host}:{port}/yammerCodeRetrievingPath

where the {host} is the same host as the Website of the yammer application.

Then you have to configure yammer:

<http:connector name="connector.http.mule.default" enableCookies="true" keepAlive="true" />

<yammer:config consumerKey="${consumerKey}" consumerSecret="${consumerSecret}">
<yammer:http-callback-config domain="{host}" remotePort="SOME_PORT" localPort="{port}" />
</yammer:config>

where {host} and {port} are the same of the Callback URL used before.

Summary

Fields
private String accessToken
private Client client
private String consumerKey The OAuth consumer key
private String consumerSecret The OAuth consumer secret
private boolean debug If connector should be run in debug mode.
protected Log logger
Public Constructors
YammerConnector()
Public Methods
String createMessage(String body)
Creates a new message in the account of the logged-in user.
String getAccessToken()
Client getClient()
String getConsumerKey()
String getConsumerSecret()
List<Message> getFollowingMessages()
Answers the list of messages followed by the logged-in user.
List<Message> getMessages()
Answers all messages in this network.
List<Message> getPrivateMessages()
Answers the whole list of private Messages (aka Direct Messages) for the logged-in user.
List<Message> getReceivedMessages()
Answers the list of messages received by the logged-in user.
Relationships getRelationships(String id)
Relationship

List<Message> getSentMessages()
Answers the whole list of messages sent by the current user.
User getUserByEmail(String email)
A single user by email.
User getUserById(String id)
A single user by id.
List<User> getUsers()
All users in this network

void initialize()
boolean isDebug()
void setAccessToken(String accessToken)
void setClient(Client client)
void setConsumerKey(String applicationKey)
void setConsumerSecret(String applicationSecret)
void setDebug(boolean debug)
Protected Methods
WebResource oauthResource(String url, String accessToken)
Creates a WebResource with the proper oauth authentication information.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private String accessToken

private Client client

private String consumerKey

The OAuth consumer key

private String consumerSecret

The OAuth consumer secret

private boolean debug

If connector should be run in debug mode. This enables logging of HTTP activity against Yammer

protected Log logger

Public Constructors

public YammerConnector ()

Public Methods

public String createMessage (String body)

Creates a new message in the account of the logged-in user.

Parameters
body The content of the message to create
Returns
  • the message created.

public String getAccessToken ()

public Client getClient ()

public String getConsumerKey ()

public String getConsumerSecret ()

public List<Message> getFollowingMessages ()

Answers the list of messages followed by the logged-in user. Corresponds to the "My Feed" tab on the website.

Returns

public List<Message> getMessages ()

Answers all messages in this network. Corresponds to the "Company Feed" tab on the website.

Returns

public List<Message> getPrivateMessages ()

Answers the whole list of private Messages (aka Direct Messages) for the logged-in user. Corresponds to the "Direct Messages" section on the website.

Returns

public List<Message> getReceivedMessages ()

Answers the list of messages received by the logged-in user. Corresponds to the "Received" tab on the website.

Returns

public Relationships getRelationships (String id)

Relationship

Parameters
id Yammer user id
Returns
  • User

public List<Message> getSentMessages ()

Answers the whole list of messages sent by the current user. Corresponds to the "Sent" tab on the website.

Returns

public User getUserByEmail (String email)

A single user by email.

Parameters
email Yammer user email
Returns
  • User

public User getUserById (String id)

A single user by id.

Parameters
id Yammer unique user id
Returns
  • User

public List<User> getUsers ()

All users in this network

Returns

public void initialize ()

public boolean isDebug ()

public void setAccessToken (String accessToken)

Parameters
accessToken

public void setClient (Client client)

Parameters
client

public void setConsumerKey (String applicationKey)

Parameters
applicationKey

public void setConsumerSecret (String applicationSecret)

Parameters
applicationSecret

public void setDebug (boolean debug)

Parameters
debug

Protected Methods

protected WebResource oauthResource (String url, String accessToken)

Creates a WebResource with the proper oauth authentication information.

Parameters
url The url of the resource
accessToken OAuth access token
Returns
  • the authenticated WebResource