|
||||||||||
| 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.
| Constructor Summary | |
|---|---|
AbstractPerforceTemplate(Depot depot)
|
|
| Method Summary | |
|---|---|
protected java.lang.String[] |
getExtraParams(java.lang.String[] cmd)
Adds any extra parameters that need to be applied to all perforce commands. |
org.slf4j.Logger |
getLogger()
|
protected java.lang.String |
getP4Exe()
|
protected java.lang.StringBuilder |
getPerforceResponse(java.lang.String[] cmd)
Executes a perforce command and returns the output as a StringBuilder. |
protected java.util.List<java.lang.String> |
getRawPerforceResponseLines(java.lang.String[] cmd)
Executes a p4 command and returns the output as list of lines. |
protected boolean |
hitMax(java.lang.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 java.util.List<java.lang.String> |
parseList(java.lang.StringBuilder response,
int index)
Parses lines of formatted text for a list of values. |
protected void |
saveToPerforce(java.lang.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 java.util.List<java.lang.String> parseList(java.lang.StringBuilder response,
int index)
response - The response from perforce to parseindex - The column index to add to the list
protected boolean hitMax(java.lang.StringBuilder response)
response - The response from perforce
protected java.lang.String[] getExtraParams(java.lang.String[] cmd)
cmd - String array that will be executed
protected void saveToPerforce(java.lang.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 java.lang.StringBuilder getPerforceResponse(java.lang.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 java.util.List<java.lang.String> getRawPerforceResponseLines(java.lang.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 void login()
throws PerforceException
Unfortunately, this likely doesn't work on windows.
PerforceException - If perforce throws any errorsprotected java.lang.String getP4Exe()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||