public class GerritProjectListUpdater extends Thread implements com.sonymobile.tools.gerrit.gerritevents.ConnectionListener, com.sonymobile.tools.gerrit.gerritevents.GerritEventListener
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
static String |
GERRIT_LS_PROJECTS
The command for fetching projects.
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
GerritProjectListUpdater(String serverName,
boolean hasProjectCreatedEvents)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addGerritProject(String gerritProject)
Adds a Gerrit project to this.gerritProjects.
|
void |
connectionDown() |
void |
connectionEstablished() |
void |
gerritEvent(com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent gerritEvent) |
void |
gerritEvent(com.sonymobile.tools.gerrit.gerritevents.dto.events.ProjectCreated gerritEvent)
OverLoaded gerritEvent(GerritEvent gerritEvent).
|
List<String> |
getGerritProjects()
Returns a string list of Gerrit projects.
|
boolean |
isConnected() |
static List<String> |
readProjects(Reader commandReader)
Reads a list of Gerrit projects from a Reader, one project per line.
|
void |
run() |
void |
setConnected(boolean connected) |
void |
setGerritProjects(List<String> projects)
Sets the internal Gerrit project list.
|
void |
shutdown()
Shutdown the thread.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public static final String GERRIT_LS_PROJECTS
public GerritProjectListUpdater(String serverName, boolean hasProjectCreatedEvents)
serverName
- the name of the Gerrit server.hasProjectCreatedEvents
- true if Gerrit server has project-created events.public void connectionEstablished()
connectionEstablished
in interface com.sonymobile.tools.gerrit.gerritevents.ConnectionListener
public void connectionDown()
connectionDown
in interface com.sonymobile.tools.gerrit.gerritevents.ConnectionListener
public void gerritEvent(com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent gerritEvent)
gerritEvent
in interface com.sonymobile.tools.gerrit.gerritevents.GerritEventListener
public void gerritEvent(com.sonymobile.tools.gerrit.gerritevents.dto.events.ProjectCreated gerritEvent)
gerritEvent
- the event.public void shutdown()
public static List<String> readProjects(Reader commandReader) throws IOException
commandReader
- the Reader.IOException
- if something unfortunate happens.public boolean isConnected()
public void setConnected(boolean connected)
connected
- the connected to set.public void addGerritProject(String gerritProject)
gerritProject
- the Gerrit project to add.public void setGerritProjects(List<String> projects)
projects
- The list of projectsCopyright © 2004-2015. All Rights Reserved.