adams.core.net
Class TwitterHelper

java.lang.Object
  extended by adams.core.net.TwitterHelper

public class TwitterHelper
extends Object

A helper class for the twitter setup.

Version:
$Revision: 7103 $
Author:
fracpete (fracpete at waikato dot ac dot nz)

Field Summary
static String ACCESS_TOKEN
          the access token.
static String ACCESS_TOKEN_SECRET
          the access token secret.
static String CONSUMER_KEY
          the consumer key.
static String CONSUMER_SECRET
          the consumer secret.
static String FILENAME
          the name of the props file.
protected static Properties m_Properties
          the properties.
 
Constructor Summary
TwitterHelper()
           
 
Method Summary
static String getAccessToken()
          Returns the access token.
static BasePassword getAccessTokenSecret()
          Returns the access token secret.
static String getConsumerKey()
          Returns the consumer key.
static BasePassword getConsumerSecret()
          Returns the consumer secret.
static Properties getProperties()
          Returns the underlying properties.
static twitter4j.Twitter getTwitterConnection(AbstractActor actor)
          Returns the twitter connection object.
protected static TwitterConnection getTwitterConnectionActor(AbstractActor actor)
          Returns the closest TwitterConnection actor, if available.
static twitter4j.TwitterStream getTwitterStreamConnection(AbstractActor actor)
          Returns the twitter stream connection object.
static boolean writeProperties()
          Writes the specified properties to disk.
static boolean writeProperties(Properties props)
          Writes the specified properties to disk.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILENAME

public static final String FILENAME
the name of the props file.

See Also:
Constant Field Values

CONSUMER_KEY

public static final String CONSUMER_KEY
the consumer key.

See Also:
Constant Field Values

CONSUMER_SECRET

public static final String CONSUMER_SECRET
the consumer secret.

See Also:
Constant Field Values

ACCESS_TOKEN

public static final String ACCESS_TOKEN
the access token.

See Also:
Constant Field Values

ACCESS_TOKEN_SECRET

public static final String ACCESS_TOKEN_SECRET
the access token secret.

See Also:
Constant Field Values

m_Properties

protected static Properties m_Properties
the properties.

Constructor Detail

TwitterHelper

public TwitterHelper()
Method Detail

getProperties

public static Properties getProperties()
Returns the underlying properties.

Returns:
the properties

writeProperties

public static boolean writeProperties()
Writes the specified properties to disk.

Parameters:
props - the properties to write to disk
Returns:
true if successfully stored

writeProperties

public static boolean writeProperties(Properties props)
Writes the specified properties to disk.

Parameters:
props - the properties to write to disk
Returns:
true if successfully stored

getConsumerKey

public static String getConsumerKey()
Returns the consumer key.

Returns:
the key

getConsumerSecret

public static BasePassword getConsumerSecret()
Returns the consumer secret.

Returns:
the secret

getAccessToken

public static String getAccessToken()
Returns the access token.

Returns:
the token

getAccessTokenSecret

public static BasePassword getAccessTokenSecret()
Returns the access token secret.

Returns:
the secret

getTwitterConnectionActor

protected static TwitterConnection getTwitterConnectionActor(AbstractActor actor)
Returns the closest TwitterConnection actor, if available.

Parameters:
actor - the actor start the search from (towards the root)
Returns:
the TwitterConnection actor, or null if none found

getTwitterConnection

public static twitter4j.Twitter getTwitterConnection(AbstractActor actor)
Returns the twitter connection object.

Parameters:
actor - the actor to start the search from
Returns:
the connection, default connection object if no TwitterConnection actor found

getTwitterStreamConnection

public static twitter4j.TwitterStream getTwitterStreamConnection(AbstractActor actor)
Returns the twitter stream connection object.

Returns:
the stream connection, null if no TwitterConnection actor found


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.