nz.ac.waikato.mcennis.rat.parser.xmlHandler
Class LastFMUserExpansion

java.lang.Object
  extended by nz.ac.waikato.mcennis.rat.parser.xmlHandler.LastFMUserExpansion

public class LastFMUserExpansion
extends java.lang.Object

Class for setting up a set of parsers for crawling LastFM or reading XML files downloaded from LastFM. Also is the object responsible for crawling all the files associated with a LastFM username.


Constructor Summary
LastFMUserExpansion()
           
 
Method Summary
static void blockUsername(java.lang.String userName)
          Prevent the given username from being exapnded
 void expandUser(Crawler crawler, java.lang.String username, Properties properties)
          Takes the given username and schedules the parsing of LastFM using this information if this username has not already been scheduled for download or blocked.
 boolean isParseArtists()
           
 boolean isParseFriends()
           
 boolean isParseProfile()
           
 boolean isParseSimilar()
           
 boolean isParseTags()
           
 boolean isParseTopArtists()
           
 boolean isParseUserArtist()
           
 void setParseArtists(boolean parseArtists)
           
 void setParseFriends(boolean parseFriends)
           
 void setParseProfile(boolean parseProfile)
           
 void setParseSimilar(boolean parseSimilar)
           
 void setParseTags(boolean parseTags)
           
 void setParseTopArtists(boolean parseTopArtists)
           
 void setParseUserArtist(boolean parseUserArtist)
           
 Parser[] setUpParsers(java.io.File toFileDirectory, Graph graph)
          Create the set of parsers for a crawler to parse.
 Parser[] setUpParsers(java.io.File toFileDirectory, Graph graph, java.lang.String[] parserNames)
          Create the set of parsers for a crawler to parse.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LastFMUserExpansion

public LastFMUserExpansion()
Method Detail

isParseArtists

public boolean isParseArtists()

setParseArtists

public void setParseArtists(boolean parseArtists)

isParseUserArtist

public boolean isParseUserArtist()

setParseUserArtist

public void setParseUserArtist(boolean parseUserArtist)

blockUsername

public static void blockUsername(java.lang.String userName)
Prevent the given username from being exapnded

Parameters:
userName - name to not parse

setUpParsers

public Parser[] setUpParsers(java.io.File toFileDirectory,
                             Graph graph)
Create the set of parsers for a crawler to parse. If the toFileDirectory is set, it saves copies of all files in that directory, otherwise no saving of files is performed. The graph is set as the graph associated with each of the given objects.

Parameters:
toFileDirectory - location to store files or null if no files are to be stored
graph - graph to be used for holding the data generated by the parsers
Returns:
array of parsers for loading into a crawler

setUpParsers

public Parser[] setUpParsers(java.io.File toFileDirectory,
                             Graph graph,
                             java.lang.String[] parserNames)
Create the set of parsers for a crawler to parse. If the toFileDirectory is set, it saves copies of all files in that directory, otherwise no saving of files is performed. The graph is set as the graph associated with each of the given objects. The parser names are derived from the arrayof parser names. This throws an OutOfBounds exception if the number of names does not match the number of parsers created.

Parameters:
toFileDirectory - location to store files or null if no files are to be stored
graph - graph to be used for holding the data generated by the parsers
parserNames - names to use for each of the parsers.
Returns:
array of parsers for loading into a crawler

expandUser

public void expandUser(Crawler crawler,
                       java.lang.String username,
                       Properties properties)
                throws java.net.MalformedURLException,
                       java.io.IOException
Takes the given username and schedules the parsing of LastFM using this information if this username has not already been scheduled for download or blocked.

Parameters:
crawler - crawler for parsing LastFM
username - user whose LastFM data is to be downloaded
Throws:
java.net.MalformedURLException
java.io.IOException

isParseFriends

public boolean isParseFriends()

setParseFriends

public void setParseFriends(boolean parseFriends)

isParseProfile

public boolean isParseProfile()

setParseProfile

public void setParseProfile(boolean parseProfile)

isParseSimilar

public boolean isParseSimilar()

setParseSimilar

public void setParseSimilar(boolean parseSimilar)

isParseTags

public boolean isParseTags()

setParseTags

public void setParseTags(boolean parseTags)

isParseTopArtists

public boolean isParseTopArtists()

setParseTopArtists

public void setParseTopArtists(boolean parseTopArtists)

Get Relational Analysis Toolkit at SourceForge.net. Fast, secure and Free Open Source software downloads