public class

EspnConnectorRestClientAdapter

extends EspnConnectorProcessAdapter
implements MuleContextAware Disposable Initialisable
java.lang.Object
   ↳ org.mule.module.EspnConnector
     ↳ org.mule.module.adapters.EspnConnectorCapabilitiesAdapter
       ↳ org.mule.module.adapters.EspnConnectorMetadataAdapater
         ↳ org.mule.module.adapters.EspnConnectorLifecycleAdapter
           ↳ org.mule.module.adapters.EspnConnectorProcessAdapter
             ↳ org.mule.module.adapters.EspnConnectorRestClientAdapter

Summary

[Expand]
Inherited Constants
From class org.mule.module.adapters.EspnConnectorMetadataAdapater
From class org.mule.module.EspnConnector
From interface org.mule.api.lifecycle.Disposable
From interface org.mule.api.lifecycle.Initialisable
From interface org.mule.api.lifecycle.Startable
From interface org.mule.api.lifecycle.Stoppable
Fields
private HttpMuleMessageFactory httpMuleMessageFactory
private MuleContext muleContext
private int responseTimeout
[Expand]
Inherited Fields
From class org.mule.module.EspnConnector
Public Constructors
EspnConnectorRestClientAdapter()
Public Methods
String getAthletes(String resource, String athleteId, String dates, String group, String enable, String seasonType, String language, String limit, String offset, String accept)
getAthletes
String getAthletesNews(String resource, String athleteId, String dates, String insider, String language, String limit, String offset, String accept)
getAthletesNews
String getNews(String resource, String dates, String insider, String language, String limit, String offset, String accept)
getNews
String getNewsById(String resource, String newsId, String dates, String insider, String language, String accept)
getNewsById
String getNewsHeadlines(String resource, String insider, String language, String limit, String offset, String accept)
getNewsHeadlines
String getNewsHeadlinesTop(String resource, String insider, String language, String region, String limit, String offset, String accept)
getNewsHeadlinesTop
String getSports(String limit, String offset, String accept)
getAllSports
String getSportsOrganizingBodies(String sport, String limit, String offset, String accept)
getSportsOrganizingBodies
String getSportsOrganizingGroupsDivisions(String sport, String league, String limit, String offset, String accept)
getSportsOrganizingGroupsDivisions
String getTeams(String resource, String teamId, String enable, String groups, String language, String limit, String offset, String accept)
getTeams
String getTeamsNews(String resource, String teamId, String dates, String insider, String language, String limit, String offset, String accept)
getTeamsNews
void initialise()
void setMuleContext(MuleContext context)
void setResponseTimeout(int value)
Sets responseTimeout
[Expand]
Inherited Methods
From class org.mule.module.adapters.EspnConnectorProcessAdapter
From class org.mule.module.adapters.EspnConnectorLifecycleAdapter
From class org.mule.module.adapters.EspnConnectorMetadataAdapater
From class org.mule.module.adapters.EspnConnectorCapabilitiesAdapter
From class org.mule.module.EspnConnector
From class java.lang.Object
From interface org.mule.api.Capabilities
From interface org.mule.api.MetadataAware
From interface org.mule.api.context.MuleContextAware
From interface org.mule.api.lifecycle.Disposable
From interface org.mule.api.lifecycle.Initialisable
From interface org.mule.api.lifecycle.Startable
From interface org.mule.api.lifecycle.Stoppable
From interface org.mule.api.process.ProcessAdapter

Fields

private HttpMuleMessageFactory httpMuleMessageFactory

private MuleContext muleContext

private int responseTimeout

Public Constructors

public EspnConnectorRestClientAdapter ()

Public Methods

public String getAthletes (String resource, String athleteId, String dates, String group, String enable, String seasonType, String language, String limit, String offset, String accept)

getAthletes

Parameters
resource ESPN resource (i.e. /sports/baseball/mlb)
athleteId ESPN player id
dates ESPN dates values (year) for requested data (i.e. 2011, 2012, etc...)
group ESPN group (integer) allows filtering by "group" or division
enable ESPN optional flag to enable specific info (comma separated string) valid values: [stats|logos|notes|competitors]
seasonType ESPN season type accepts pre/reg/post for preseason, regular and postseason respectively
language ESPN lang - valid values include 'en' (English) and 'es' (Spanish)
limit Used to limit the number of results returned
offset Used for pagination (i.e. 11 will start with the 11th entry in the response)
accept Used when you can not set the Accepted header (i.e. application/json, text/xml)
Returns
  • String representing athlete data (can be JSON or XML depending on 'accept' parameter)
Throws
IOException

public String getAthletesNews (String resource, String athleteId, String dates, String insider, String language, String limit, String offset, String accept)

getAthletesNews

Parameters
resource ESPN resource (i.e. /espnw)
athleteId ESPN identifier for a particular player/athlete.
dates Integer in the form of "yyyymmdd" to get news for a particular date.
insider ESPN content to be included, valid values: yes, no, only
language ESPN lang - valid values include 'en' (English) and 'es' (Spanish)
limit Used to limit the number of results returned
offset Used for pagination (i.e. 11 will start with the 11th entry in the response)
accept Used when you can not set the Accepted header (i.e. application/json, text/xml)
Returns
  • String Stories about a particular player/athlete (can be JSON or XML depending on 'accept' parameter).
Throws
IOException

public String getNews (String resource, String dates, String insider, String language, String limit, String offset, String accept)

getNews

Parameters
resource ESPN resource (i.e. /espnw)
dates Integer in the form of "yyyymmdd" to get news for a particular date.
insider ESPN content to be included, valid values: yes, no, only
language ESPN lang - valid values include 'en' (English) and 'es' (Spanish)
limit Used to limit the number of results returned
offset Used for pagination (i.e. 11 will start with the 11th entry in the response)
accept Used when you can not set the Accepted header (i.e. application/json, text/xml)
Returns
  • String Representing a stream of all news for current date (can be JSON or XML depending on 'accept' parameter).
Throws
IOException

public String getNewsById (String resource, String newsId, String dates, String insider, String language, String accept)

getNewsById

Parameters
resource ESPN resource (i.e. /espnw)
newsId ESPN specific story identifier
dates Integer in the form of "yyyymmdd" to get news for a particular date.
insider ESPN content to be included, valid values: yes, no, only
language ESPN lang - valid values include 'en' (English) and 'es' (Spanish)
accept Used when you can not set the Accepted header (i.e. application/json, text/xml)
Returns
  • String represents news story identified by input parameter newsId (can be JSON or XML depending on 'accept' parameter).
Throws
IOException

public String getNewsHeadlines (String resource, String insider, String language, String limit, String offset, String accept)

getNewsHeadlines

Parameters
resource ESPN resource (i.e. /espnw)
insider ESPN content to be included, valid values: yes, no, only
language ESPN lang - valid values include 'en' (English) and 'es' (Spanish)
limit Used to limit the number of results returned
offset Used for pagination (i.e. 11 will start with the 11th entry in the response)
accept Used when you can not set the Accepted header (i.e. application/json, text/xml)
Returns
  • String ESPN news headlines (can be JSON or XML depending on 'accept' parameter).
Throws
IOException

public String getNewsHeadlinesTop (String resource, String insider, String language, String region, String limit, String offset, String accept)

getNewsHeadlinesTop

Parameters
resource ESPN resource (i.e. /espnw)
insider ESPN content to be included, valid values: yes, no, only
language ESPN lang - valid values include 'en' (English) and 'es' (Spanish)
region Can be used in conjunction with the lang query string parameter to return focused headlines for a particular region, where available.
limit Used to limit the number of results returned
offset Used for pagination (i.e. 11 will start with the 11th entry in the response)
accept Used when you can not set the Accepted header (i.e. application/json, text/xml)
Returns
  • String Top stories as shown on ESPN.com home page. Only applicable to /sports resource (can be JSON or XML depending on 'accept' parameter).
Throws
IOException

public String getSports (String limit, String offset, String accept)

getAllSports

Parameters
limit Used to limit the number of results returned
offset Used for pagination (i.e. 11 will start with the 11th entry in the response)
accept Used when you can not set the Accepted header (i.e. application/json, text/xml)
Returns
  • String List of all sports currently supported in the ESPN API (can be JSON or XML depending on 'accept' parameter).
Throws
IOException

public String getSportsOrganizingBodies (String sport, String limit, String offset, String accept)

getSportsOrganizingBodies

Parameters
sport ESPN sport name
limit Used to limit the number of results returned
offset Used for pagination (i.e. 11 will start with the 11th entry in the response)
accept Used when you can not set the Accepted header (i.e. application/json, text/xml)
Returns
  • String returns a reference to all organizing bodies, or leagues (e.g. MLB) that are supported within a sport (e.g. baseball) (can be JSON or XML depending on 'accept' parameter).
Throws
IOException

public String getSportsOrganizingGroupsDivisions (String sport, String league, String limit, String offset, String accept)

getSportsOrganizingGroupsDivisions

Parameters
sport ESPN sport name
league ESPN league abbreviation (organizing body)
limit Used to limit the number of results returned
offset Used for pagination (i.e. 11 will start with the 11th entry in the response)
accept Used when you can not set the Accepted header (i.e. application/json, text/xml)
Returns
  • String returns information for all groups/divisions that make up an organizing body (i.e. MLB) (can be JSON or XML depending on 'accept' parameter).
Throws
IOException

public String getTeams (String resource, String teamId, String enable, String groups, String language, String limit, String offset, String accept)

getTeams

Parameters
resource ESPN resource (i.e. /sports/baseball/mlb)
teamId ESPN team identifier
enable ESPN optional flag to enable specific info (comma separated string) valid values: [venues|stats|roster|leaders]
groups ESPN group (integer) allows filtering by "group" or division
language ESPN lang - valid values include 'en' (English) and 'es' (Spanish)
limit Used to limit the number of results returned
offset Used for pagination (i.e. 11 will start with the 11th entry in the response)
accept Used when you can not set the Accepted header (i.e. application/json, text/xml)
Returns
  • String representing team data (can be JSON or XML depending on 'accept' parameter)
Throws
IOException

public String getTeamsNews (String resource, String teamId, String dates, String insider, String language, String limit, String offset, String accept)

getTeamsNews

Parameters
resource ESPN resource (i.e. /espnw)
teamId ESPN identifier for a particular team.
dates Integer in the form of "yyyymmdd" to get news for a particular date.
insider ESPN content to be included, valid values: yes, no, only
language ESPN lang - valid values include 'en' (English) and 'es' (Spanish)
limit Used to limit the number of results returned
offset Used for pagination (i.e. 11 will start with the 11th entry in the response)
accept Used when you can not set the Accepted header (i.e. application/json, text/xml)
Returns
  • String Stories about a particular team (can be JSON or XML depending on 'accept' parameter).
Throws
IOException

public void initialise ()

Throws
InitialisationException

public void setMuleContext (MuleContext context)

Parameters
context

public void setResponseTimeout (int value)

Sets responseTimeout

Parameters
value Value to set