public final class APIConnection extends java.lang.Object implements LogMappable
Constructor and Description |
---|
APIConnection(java.lang.String host,
java.lang.String deploymentPath,
java.lang.String username,
java.lang.String password)
Creates a new connection to the given host
|
APIConnection(java.lang.String host,
java.lang.String deploymentPath,
java.lang.String username,
java.lang.String password,
int connectionTimeout)
Creates a new connection to the given host
|
Modifier and Type | Method and Description |
---|---|
Developer |
addDeveloper(java.lang.String iteratorName,
java.lang.String name,
java.lang.String email) |
boolean |
changeIteratorQuery(java.lang.String iteratorId,
java.lang.String query,
java.lang.Boolean allowFieldReduction,
java.util.Collection<java.lang.String> ignoreFields) |
boolean |
changeIteratorQuery(java.lang.String iteratorId,
java.lang.String query,
java.util.Collection<java.lang.String> ignoreFields) |
java.util.Map<java.lang.String,java.lang.Object> |
convertMap()
Converts the current object into a mapping of key-value pairs that can be logged
|
Iterator |
createIterator(java.lang.String iteratorName,
java.lang.String query) |
Iterator |
createIterator(java.lang.String iteratorName,
java.lang.String query,
java.lang.Integer projectId) |
IteratorInstance |
createIteratorInstance(java.lang.String iteratorName,
java.lang.String instanceUID) |
Project |
createProject(java.lang.String name) |
boolean |
deleteDeveloper(int developerPk) |
boolean |
deleteErrorIteration(int iterationPk) |
boolean |
deleteErrorIterations(java.lang.String instanceId) |
boolean |
deleteInstance(java.lang.String instanceUID) |
boolean |
deleteIterator(java.lang.String iteratorName) |
boolean |
deleteProject(int projectId) |
java.util.Collection<java.lang.String> |
getAllAvailableIteratorFields(java.lang.String iteratorName) |
java.util.Collection<Iteration> |
getAllIterations(java.lang.String instanceUID) |
java.util.Collection<Iterator> |
getAllIterators() |
java.util.Collection<Iterator> |
getAllIterators(java.lang.Integer projectId) |
java.util.Collection<Project> |
getAllProjects() |
java.util.Collection<Iteration> |
getCompletedIterations(java.lang.String instanceUID) |
java.util.Collection<Developer> |
getDevelopersForIterator(int iteratorPk) |
java.util.Collection<Iteration> |
getErrorIterations(java.lang.String instanceUID) |
Iteration |
getIteration(long iterationPk) |
Iteration |
getIterationForOffset(java.lang.String instanceUID,
int offset) |
java.util.Map<java.lang.String,java.lang.Object> |
getIterationValues(long iterationPk) |
java.util.Map<java.lang.String,java.lang.Object> |
getIterationValues(java.lang.String instanceUID,
int offset) |
Iterator |
getIterator(int iteratorPk) |
Iterator |
getIterator(java.lang.String iteratorName) |
java.util.Collection<java.lang.String> |
getIteratorFields(java.lang.String iteratorName) |
IteratorInstance |
getIteratorInstance(java.lang.String instanceUID) |
java.util.Collection<IteratorInstance> |
getIteratorInstances(java.lang.String iteratorName) |
Iteration |
getNextIteration(java.lang.String instanceUID) |
Iteration |
getNextIteration(java.lang.String instanceUID,
java.lang.Integer port,
java.lang.String localUrl) |
Iteration |
getNextIteration(java.lang.String instanceUID,
java.lang.String iteratorName) |
Iteration |
getNextIteration(java.lang.String instanceUID,
java.lang.String iteratorName,
java.lang.Integer port,
java.lang.String localUrl) |
Project |
getProject(int projectId) |
Project |
getProject(java.lang.String name) |
Iteration |
getRandomIteration(java.lang.String instanceUID) |
Iteration |
getRandomIteration(java.lang.String instanceUID,
java.lang.Integer port,
java.lang.String localUrl) |
Iteration |
getRandomIteration(java.lang.String instanceUID,
java.lang.String iteratorName) |
Iteration |
getRandomIteration(java.lang.String instanceUID,
java.lang.String iteratorName,
java.lang.Integer port,
java.lang.String localUrl) |
java.util.Collection<Iteration> |
getRemainingIterations(java.lang.String instanceUID) |
java.util.Collection<Iteration> |
getRunningIterations(java.lang.String instanceUID) |
java.util.Collection<IteratorTable> |
getTables() |
boolean |
hasNext(java.lang.String instanceUID) |
boolean |
hasNext(java.lang.String instanceUID,
java.lang.String iteratorId) |
org.jdom.Element |
issueRequest(java.lang.String type,
java.util.Map<java.lang.String,java.lang.Object> parameters)
Issues a request to the api server
|
boolean |
moveIteratorToProject(java.lang.String iteratorName,
int projectId) |
boolean |
pauseInstance(java.lang.String instanceUID) |
Iteration |
peekNextIteration(java.lang.String instanceUID) |
Iteration |
peekNextIteration(java.lang.String instanceUID,
java.lang.String iteratorName) |
boolean |
pingIteration(int iterationPk,
java.lang.Long timeSinceLastActivity) |
boolean |
reportCompletion(long iterationPk,
java.lang.String message,
int recordCount) |
boolean |
reportCompletion(long iterationPk,
java.lang.String message,
int recordCount,
boolean forceChange) |
boolean |
reportError(long iterationPk,
java.lang.String message,
int recordCount) |
boolean |
reportError(long iterationPk,
java.lang.String message,
int recordCount,
boolean forceChange) |
boolean |
reportError(long iterationPk,
java.lang.String message,
int recordCount,
boolean forceChange,
boolean rerunImmediately) |
boolean |
reset(long iterationPk) |
boolean |
reset(long iterationPk,
boolean forceChange) |
boolean |
resumeInstance(java.lang.String instanceUID) |
boolean |
rollbackInstance(java.lang.String instanceUID,
java.lang.String amount) |
boolean |
setNote(java.lang.String instanceUID,
java.lang.String note) |
boolean |
updateIteratorFields(java.lang.String iteratorName,
java.util.Collection<java.lang.String> usedFields) |
public APIConnection(java.lang.String host, java.lang.String deploymentPath, java.lang.String username, java.lang.String password)
host
- The host to connect to (including port if required)deploymentPath
- The path the API is located at, such as /IteratorAPIusername
- The username used to authenticate to the serverpassword
- The password for authenticating to the serverAuthorizationException
- If the connection failed to authenticatepublic APIConnection(java.lang.String host, java.lang.String deploymentPath, java.lang.String username, java.lang.String password, int connectionTimeout)
host
- The host to connect to (including port if required)deploymentPath
- The path the API is located at, such as /IteratorAPIusername
- The username used to authenticate to the serverpassword
- The password for authenticating to the serverconnectionTimeout
- The timeout for connections to the serverAuthorizationException
- If the connection failed to authenticate@NotNull public java.util.Map<java.lang.String,java.lang.Object> convertMap()
LogMappable
convertMap
in interface LogMappable
@Nullable public org.jdom.Element issueRequest(java.lang.String type, java.util.Map<java.lang.String,java.lang.Object> parameters)
type
- The type to issue (enterCategory, etc...)parameters
- The additional parameters to send@NotNull public java.util.Collection<Iterator> getAllIterators(java.lang.Integer projectId)
@NotNull public java.util.Collection<IteratorTable> getTables()
@NotNull public java.util.Collection<Developer> getDevelopersForIterator(int iteratorPk)
public boolean deleteDeveloper(int developerPk)
public Developer addDeveloper(java.lang.String iteratorName, java.lang.String name, java.lang.String email)
public Project getProject(int projectId)
public boolean deleteProject(int projectId)
public Project getProject(java.lang.String name)
public Project createProject(java.lang.String name)
public boolean moveIteratorToProject(java.lang.String iteratorName, int projectId)
public boolean changeIteratorQuery(java.lang.String iteratorId, java.lang.String query, java.util.Collection<java.lang.String> ignoreFields)
public boolean changeIteratorQuery(java.lang.String iteratorId, java.lang.String query, java.lang.Boolean allowFieldReduction, java.util.Collection<java.lang.String> ignoreFields)
public Iterator getIterator(java.lang.String iteratorName)
public Iterator getIterator(int iteratorPk)
@Nullable public Iterator createIterator(java.lang.String iteratorName, java.lang.String query)
public Iterator createIterator(java.lang.String iteratorName, java.lang.String query, java.lang.Integer projectId)
public boolean deleteIterator(java.lang.String iteratorName)
@NotNull public java.util.Collection<IteratorInstance> getIteratorInstances(java.lang.String iteratorName)
@NotNull public java.util.Collection<java.lang.String> getAllAvailableIteratorFields(java.lang.String iteratorName)
@NotNull public java.util.Collection<java.lang.String> getIteratorFields(java.lang.String iteratorName)
public boolean updateIteratorFields(java.lang.String iteratorName, java.util.Collection<java.lang.String> usedFields)
public IteratorInstance getIteratorInstance(java.lang.String instanceUID)
public IteratorInstance createIteratorInstance(java.lang.String iteratorName, java.lang.String instanceUID)
public boolean deleteInstance(java.lang.String instanceUID)
public boolean hasNext(java.lang.String instanceUID)
public boolean hasNext(java.lang.String instanceUID, java.lang.String iteratorId)
public boolean rollbackInstance(java.lang.String instanceUID, java.lang.String amount)
public boolean pauseInstance(java.lang.String instanceUID)
public boolean resumeInstance(java.lang.String instanceUID)
public boolean setNote(java.lang.String instanceUID, java.lang.String note)
@Nullable public Iteration getNextIteration(java.lang.String instanceUID, java.lang.String iteratorName)
@Nullable public Iteration getNextIteration(java.lang.String instanceUID, java.lang.Integer port, java.lang.String localUrl)
public Iteration getNextIteration(java.lang.String instanceUID, java.lang.String iteratorName, java.lang.Integer port, java.lang.String localUrl)
@Nullable public Iteration getRandomIteration(java.lang.String instanceUID, java.lang.String iteratorName)
@Nullable public Iteration getRandomIteration(java.lang.String instanceUID, java.lang.Integer port, java.lang.String localUrl)
public Iteration getRandomIteration(java.lang.String instanceUID, java.lang.String iteratorName, java.lang.Integer port, java.lang.String localUrl)
public Iteration peekNextIteration(java.lang.String instanceUID, java.lang.String iteratorName)
public Iteration getIterationForOffset(java.lang.String instanceUID, int offset)
public boolean deleteErrorIterations(java.lang.String instanceId)
@NotNull public java.util.Collection<Iteration> getAllIterations(java.lang.String instanceUID)
@NotNull public java.util.Collection<Iteration> getErrorIterations(java.lang.String instanceUID)
@NotNull public java.util.Collection<Iteration> getCompletedIterations(java.lang.String instanceUID)
@NotNull public java.util.Collection<Iteration> getRemainingIterations(java.lang.String instanceUID)
@NotNull public java.util.Collection<Iteration> getRunningIterations(java.lang.String instanceUID)
public Iteration getIteration(long iterationPk)
@NotNull public java.util.Map<java.lang.String,java.lang.Object> getIterationValues(java.lang.String instanceUID, int offset)
@NotNull public java.util.Map<java.lang.String,java.lang.Object> getIterationValues(long iterationPk)
public boolean reportCompletion(long iterationPk, java.lang.String message, int recordCount)
public boolean reportCompletion(long iterationPk, java.lang.String message, int recordCount, boolean forceChange)
public boolean reportError(long iterationPk, java.lang.String message, int recordCount)
public boolean reportError(long iterationPk, java.lang.String message, int recordCount, boolean forceChange)
public boolean reportError(long iterationPk, java.lang.String message, int recordCount, boolean forceChange, boolean rerunImmediately)
public boolean reset(long iterationPk)
public boolean reset(long iterationPk, boolean forceChange)
public boolean pingIteration(int iterationPk, java.lang.Long timeSinceLastActivity)
public boolean deleteErrorIteration(int iterationPk)