|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.tek42.perforce.parse.AbstractPerforceTemplate
public abstract class AbstractPerforceTemplate
Provides default functionality for interacting with Perforce using the template design pattern.
| Nested Class Summary | |
|---|---|
static class |
AbstractPerforceTemplate.ResponseFilter
Used to filter the response from perforce so the API can throw out useless lines and thus save memory during large operations. |
| Constructor Summary | |
|---|---|
AbstractPerforceTemplate(Depot depot)
|
|
| Method Summary | |
|---|---|
protected String[] |
getExtraParams(String[] cmd)
Adds any extra parameters that need to be applied to all perforce commands. |
org.slf4j.Logger |
getLogger()
|
protected String |
getP4Exe()
|
protected StringBuilder |
getPerforceResponse(String[] cmd)
Executes a perforce command and returns the output as a StringBuilder. |
protected StringBuilder |
getPerforceResponse(String[] cmd,
AbstractPerforceTemplate.ResponseFilter filter)
|
protected byte[] |
getRawPerforceResponseBytes(String[] cmd)
Used by calls that make use of p4.exe's python dictionary output format. |
protected List<String> |
getRawPerforceResponseLines(String[] cmd)
Executes a p4 command and returns the output as list of lines. |
protected boolean |
hitMax(StringBuilder response)
Check to see if the perforce request resulted in a "too many results" error. |
protected void |
login()
Tries to perform a p4 login if the security level on the server is set to level 3 and no ticket was set via depot.setP4Ticket(). |
protected List<String> |
parseList(StringBuilder response,
int index)
Parses lines of formatted text for a list of values. |
protected void |
saveToPerforce(Object object,
Builder builder)
Handles the IO for opening a process, writing to it, flushing, closing, and then handling any errors. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractPerforceTemplate(Depot depot)
| Method Detail |
|---|
public org.slf4j.Logger getLogger()
protected List<String> parseList(StringBuilder response,
int index)
response - The response from perforce to parseindex - The column index to add to the list
protected boolean hitMax(StringBuilder response)
response - The response from perforce
protected String[] getExtraParams(String[] cmd)
cmd - String array that will be executed
protected void saveToPerforce(Object object,
Builder builder)
throws PerforceException
object - The perforce object to savebuilder - The builder responsible for saving the object
PerforceException - If there is any errors thrown from perforce
protected StringBuilder getPerforceResponse(String[] cmd)
throws PerforceException
cmd - The perforce commands to execute. Each command and argument is it's own array element
PerforceException - If perforce throws any errors
protected StringBuilder getPerforceResponse(String[] cmd,
AbstractPerforceTemplate.ResponseFilter filter)
throws PerforceException
PerforceException
protected List<String> getRawPerforceResponseLines(String[] cmd)
throws PerforceException
cmd - The perforce command to execute. The command and arguments are
each in their own array element (e.g. cmd = {"p4", "info"}).
PerforceException
protected byte[] getRawPerforceResponseBytes(String[] cmd)
throws PerforceException
cmd -
PerforceException
protected void login()
throws PerforceException
Unfortunately, this likely doesn't work on windows.
PerforceException - If perforce throws any errorsprotected String getP4Exe()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||