|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.perforce.p4java.impl.mapbased.server.Server
public abstract class Server
Generic abstract superclass for implementation-specific server implementations that use a command-style server interface implementation.
Normal users should not be creating this class or subclasses of this class directly; you should use the ServerFactory server factory methods to get a suitable server implementation class.
Field Summary | |
---|---|
static String |
ATTRIBUTE_STREAM_MAP_KEY
|
protected Map<String,String> |
authTickets
Storage for user auth tickets. |
protected boolean |
caseSensitive
|
protected Charset |
charset
|
protected String |
charsetName
|
protected IClient |
client
|
protected String |
clientName
|
protected String |
clientUnsetName
Used when we have no client set. |
protected ICommandCallback |
commandCallback
|
protected boolean |
connected
|
protected static String |
CORE_AUTH_FAIL_STRING_1
Signals access (login) needed |
protected static String |
CORE_AUTH_FAIL_STRING_2
Signals access (login) needed |
protected static String |
CORE_AUTH_FAIL_STRING_3
Signals ticket has expired |
protected static String |
CORE_AUTH_FAIL_STRING_4
Signals ticket has expired |
static String |
DEFAULT_STATUS_FIELD_NAME
|
protected boolean |
enableProgress
|
protected boolean |
enableTracking
|
protected String |
ignoreFileName
|
static String |
IMPL_COMMENTS_FIELD_NAME
|
static String |
IMPL_TYPE_FIELD_NAME
|
static String |
IN_MAP_USE_TAGS_KEY
Property key for overriding the default tagged/non-tagged behavior of a command. |
protected boolean |
loginOnConnect
|
static String |
MINIMUM_SUPPORTED_SERVER_LEVEL_FIELD_NAME
|
protected int |
minumumSupportedServerVersion
|
protected AtomicInteger |
nextCmdCallBackKey
|
protected AtomicInteger |
nextProgressCallbackKey
|
protected boolean |
nonCheckedSyncs
|
static String |
P4IGNORE_ENV_VAR
P4IGNORE environment variable |
static String |
P4TICKETS_DEFAULT_OTHER
P4TICKETS_DEFAULT_OTHER |
static String |
P4TICKETS_DEFAULT_WINDOWS
P4TICKETS_DEFAULT_WINDOWS |
static String |
P4TICKETS_ENV_VAR
P4TICKETS environment variable |
static String |
P4TRUST_DEFAULT_OTHER
P4TRUST_DEFAULT_OTHER |
static String |
P4TRUST_DEFAULT_WINDOWS
P4TRUST_DEFAULT_WINDOWS |
static String |
P4TRUST_ENV_VAR
P4TRUST environment variable |
protected String |
password
|
protected IProgressCallback |
progressCallback
|
protected Properties |
props
|
static String |
PROTOCOL_NAME_FIELD_NAME
|
protected boolean |
quietMode
|
protected Random |
rand
Useful source of random integers, etc. |
protected String |
rsh
|
protected static boolean |
runningOnWindows
|
static String |
SCREEN_NAME_FIELD_NAME
|
protected boolean |
secure
|
protected String |
serverAddress
|
protected String |
serverHost
|
protected IServerInfo |
serverInfo
|
protected int |
serverPort
|
protected int |
serverVersion
|
protected boolean |
setupOnConnect
|
protected ISSOCallback |
ssoCallback
|
protected String |
ssoKey
|
protected ServerStatus |
status
|
protected String |
tmpDirName
|
protected static String |
UNKNOWN_SERVER_HOST
|
protected static int |
UNKNOWN_SERVER_PORT
|
protected static int |
UNKNOWN_SERVER_VERSION
|
protected UsageOptions |
usageOptions
|
protected boolean |
useAuthMemoryStore
|
protected String |
userName
|
Constructor Summary | |
---|---|
Server()
|
Method Summary | |
---|---|
abstract String |
addTrust(String fingerprintValue)
Approve and add the specified fingerprint for the Perforce SSL connection. |
abstract String |
addTrust(String fingerprintValue,
TrustOptions opts)
Approve and add the specified fingerprint or replacement for the Perforce SSL connection. |
abstract String |
addTrust(TrustOptions opts)
Approve and add the fingerprint for the Perforce SSL connection. |
String |
changePassword(String oldPassword,
String newPassword,
String userName)
Change a user's password on the server. |
void |
connect()
Connect to the Perforce server associated with this server object. |
String |
createBranchSpec(IBranchSpec branchSpec)
Create a new Perforce branch spec on the Perforce server. |
String |
createClient(IClient newClient)
Attempt to create a new Perforce client (a.k.a. |
String |
createDepot(IDepot newDepot)
Create a new depot in the repository. |
IJob |
createJob(Map<String,Object> fieldMap)
Create a new Perforce job in the Perforce server corresponding to the passed-in Perforce job fields (which in turn should correspond to at least the mandatory fields defined in the reigning Perforce job spec). |
String |
createLabel(ILabel label)
Create a new Perforce label in the Perforce server. |
String |
createProtectionEntries(List<IProtectionEntry> entryList)
Create or replace the protections table data on the Perforce server with these new protection entries. |
String |
createStream(IStream stream)
Create a new stream in the repository. |
String |
createTriggerEntries(List<ITriggerEntry> entryList)
Create or replace the triggers table data on the Perforce server with these new trigger entries. |
String |
createUser(IUser user,
boolean force)
Create a new Perforce user on the Perforce server. |
String |
createUser(IUser user,
UpdateUserOptions opts)
Create a new Perforce user on the Perforce server. |
String |
createUserGroup(IUserGroup group)
Create a new Perforce user group on the Perforce server. |
String |
createUserGroup(IUserGroup group,
UpdateUserGroupOptions opts)
Create a new Perforce user group on the Perforce server. |
String |
deleteBranchSpec(String branchSpecName,
boolean force)
Delete a named Perforce branch spec from the Perforce server. |
String |
deleteBranchSpec(String branchSpecName,
DeleteBranchSpecOptions opts)
Delete a named Perforce branch spec from the Perforce server. |
String |
deleteClient(String clientName,
boolean force)
Delete a Perforce client from a Perforce server. |
String |
deleteClient(String clientName,
DeleteClientOptions opts)
Delete a Perforce client from a Perforce server. |
void |
deleteCounter(String counterName,
boolean perforceCounter)
|
String |
deleteDepot(String name)
Delete a named depot from the repository. |
String |
deleteJob(String jobId)
Delete a job from the Perforce server. |
String |
deleteKey(String KeyName)
Delete a key on a Perforce server. |
String |
deleteLabel(String labelName,
boolean force)
Delete a named Perforce label from the Perforce server. |
String |
deleteLabel(String labelName,
DeleteLabelOptions opts)
Delete a named Perforce label from the Perforce server. |
String |
deletePendingChangelist(int id)
Delete a pending Perforce changelist. |
String |
deletePendingChangelist(int id,
ChangelistOptions opts)
Delete a pending Perforce changelist. |
String |
deleteProperty(String name,
PropertyOptions opts)
Deletes a property value from the Perforce server. |
String |
deleteStream(String streamPath,
StreamOptions opts)
Delete a Perforce stream spec from the Perforce server. |
String |
deleteUser(String userName,
boolean force)
Delete a named Perforce user from the Perforce server. |
String |
deleteUser(String userName,
UpdateUserOptions opts)
Delete a named Perforce user from the Perforce server |
String |
deleteUserGroup(IUserGroup group)
Delete a Perforce user group from the Perforce server. |
String |
deleteUserGroup(IUserGroup group,
UpdateUserGroupOptions opts)
Delete a Perforce user group from the Perforce server. |
void |
disconnect()
Disconnect from this Perforce server. |
List<IFileSpec> |
duplicateRevisions(IFileSpec fromFile,
IFileSpec toFile,
DuplicateRevisionsOptions opts)
Duplicate revisions with integration history (unsupported). |
abstract Map<String,Object>[] |
execInputStringMapCmd(String cmdName,
String[] cmdArgs,
String inString)
Issue an arbitrary P4Java command to the Perforce server and return the results as a map. |
abstract List<Map<String,Object>> |
execInputStringMapCmdList(String cmdName,
String[] cmdArgs,
String inString)
Issue an arbitrary P4Java command to the Perforce server and return the results as a list of maps. |
abstract List<Map<String,Object>> |
execInputStringMapCmdList(String cmdName,
String[] cmdArgs,
String inString,
IFilterCallback filterCallback)
Issue an arbitrary P4Java command to the Perforce server and return the results as a list of maps. |
abstract InputStream |
execInputStringStreamCmd(String cmdName,
String[] cmdArgs,
String inString)
Issue an arbitrary P4Java command to the Perforce server and return the results as a stream. |
abstract void |
execInputStringStreamingMapCmd(String cmdName,
String[] cmdArgs,
String inString,
IStreamingCallback callback,
int key)
Issue a streaming map command to the Perforce server, using an optional string for any input expected by the server (such as label or job specs, etc.). |
abstract void |
execInputStringStreamingMapComd(String cmdName,
String[] cmdArgs,
String inString,
IStreamingCallback callback,
int key)
Deprecated. As of release 2013.1, replaced by execInputStringStreamingMapCmd(java.lang.String, java.lang.String[], java.lang.String, com.perforce.p4java.server.callback.IStreamingCallback, int) |
Map<String,Object>[] |
execMapCmd(CmdSpec cmdSpec,
String[] cmdArgs,
Map<String,Object> inMap)
|
abstract Map<String,Object>[] |
execMapCmd(String cmdName,
String[] cmdArgs,
Map<String,Object> inMap)
Issue an arbitrary P4Java command to the Perforce server and return the results as a map. |
List<Map<String,Object>> |
execMapCmdList(CmdSpec cmdSpec,
String[] cmdArgs,
Map<String,Object> inMap)
|
abstract List<Map<String,Object>> |
execMapCmdList(String cmdName,
String[] cmdArgs,
Map<String,Object> inMap)
Issue an arbitrary P4Java command to the Perforce server and return the results as a list of maps. |
abstract List<Map<String,Object>> |
execMapCmdList(String cmdName,
String[] cmdArgs,
Map<String,Object> inMap,
IFilterCallback filterCallback)
Issue an arbitrary P4Java command to the Perforce server and return the results as a list of maps. |
abstract Map<String,Object>[] |
execQuietMapCmd(String cmdName,
String[] cmdArgs,
Map<String,Object> inMap)
Issue an arbitrary P4Java command to the Perforce server and return the results as a map without invoking any command callbacks. |
abstract List<Map<String,Object>> |
execQuietMapCmdList(String cmdName,
String[] cmdArgs,
Map<String,Object> inMap)
Issue an arbitrary P4Java command to the Perforce server and return the results as a list of maps without invoking any command callbacks. |
abstract InputStream |
execQuietStreamCmd(String cmdName,
String[] cmdArgs)
Issue an arbitrary P4Java command to the Perforce server and get the results as a stream without invoking any command callbacks. |
InputStream |
execStreamCmd(CmdSpec cmdSpec,
String[] cmdArgs)
|
abstract InputStream |
execStreamCmd(String cmdName,
String[] cmdArgs)
Issue an arbitrary P4Java command to the Perforce server and get the results as a stream. |
abstract InputStream |
execStreamCmd(String cmdName,
String[] cmdArgs,
Map<String,Object> inMap)
Issue an arbitrary P4Java command to the Perforce server and get the results as a stream. |
abstract void |
execStreamingMapCommand(String cmdName,
String[] cmdArgs,
Map<String,Object> inMap,
IStreamingCallback callback,
int key)
Issue a streaming map command to the Perforce server, using an optional map for any input expected by the server (such as label or job specs, etc.). |
List<IFix> |
fixJobs(List<String> jobIds,
int changelistId,
FixJobsOptions opts)
Mark each named job as being fixed by the changelist number given with changeListId. |
List<IFix> |
fixJobs(List<String> jobIdList,
int changeListId,
String status,
boolean delete)
Mark each named job as being fixed by the changelist number given with changeListId. |
String |
getAuthTicket()
Return the current Perforce authentication ticket being used by this server, if any. |
abstract String |
getAuthTicket(String userName)
Return the Perforce authentication ticket for specified user. |
IBranchSpec |
getBranchSpec(String name)
Get a specific named Perforce branch spec from the Perforce server. |
IBranchSpec |
getBranchSpec(String name,
GetBranchSpecOptions opts)
Get a specific named Perforce branch spec from the Perforce server. |
List<IBranchSpecSummary> |
getBranchSpecs(GetBranchSpecsOptions opts)
Get a list of all summary Perforce branch specs known to the Perforce server. |
List<IBranchSpecSummary> |
getBranchSpecs(String userName,
String nameFilter,
int maxReturns)
Get a list of all summary Perforce branch specs known to the Perforce server. |
IChangelist |
getChangelist(int id)
Get a specific Perforce changelist from a Perforce server. |
IChangelist |
getChangelist(int id,
ChangelistOptions opts)
Get a specific Perforce changelist from a Perforce server. |
InputStream |
getChangelistDiffs(int id,
DiffType diffType)
Get an InputStream onto the file diffs associated with a specific submitted changelist. |
InputStream |
getChangelistDiffs(int id,
GetChangelistDiffsOptions opts)
Get an InputStream onto the file diffs associated with a specific submitted changelist. |
InputStream |
getChangelistDiffsStream(int id,
DescribeOptions options)
Get an InputStream onto the file diffs associated with a specific submitted changelist. |
List<IFileSpec> |
getChangelistFiles(int id)
Get a list of the Perforce depot files associated with a Perforce changelist. |
List<IChangelistSummary> |
getChangelists(int maxMostRecent,
List<IFileSpec> fileSpecs,
String clientName,
String userName,
boolean includeIntegrated,
boolean submittedOnly,
boolean pendingOnly,
boolean longDesc)
An omnibus method to get a list of Perforce changelists from a server using zero or more qualifiers (note that convenience methods also exists, especially on the IClient interface). |
List<IChangelistSummary> |
getChangelists(int maxMostRecent,
List<IFileSpec> fileSpecs,
String clientName,
String userName,
boolean includeIntegrated,
IChangelist.Type type,
boolean longDesc)
An omnibus method to get a list of Perforce changelists from a server using zero or more qualifiers (note that convenience methods also exists, especially on the IClient interface). |
List<IChangelistSummary> |
getChangelists(List<IFileSpec> fileSpecs,
GetChangelistsOptions opts)
Get a list of Perforce changelist summary objects from the Perforce server. |
String |
getCharsetName()
Get the current charset name for the server connection. |
IClient |
getClient(IClientSummary clientSummary)
Convenience method for getClient(clientSummary.getName()). |
IClient |
getClient(String clientName)
Get an IClient object for a specific named Perforce client. |
String |
getClientName()
|
List<IClientSummary> |
getClients(GetClientsOptions opts)
Get a list of IClientSummary objects for all Perforce clients known to this Perforce server. |
List<IClientSummary> |
getClients(String userName,
String queryString,
int maxResults)
Get a list of IClientSummary objects for all Perforce clients known to this Perforce server. |
IClient |
getClientTemplate(String clientName)
Get a template of a non-existent named Perforce client. |
IClient |
getClientTemplate(String clientName,
boolean allowExistent)
Get a template of a non-existent named Perforce client. |
IClient |
getClientTemplate(String clientName,
GetClientTemplateOptions opts)
Get a template of a non-existent named Perforce client. |
String |
getCounter(String counterName)
Get the value of a named Perforce counter from the Perforce server. |
String |
getCounter(String counterName,
CounterOptions opts)
Get the value of a named Perforce counter from the Perforce server. |
Map<String,String> |
getCounters()
Get a map of the Perforce server's counters. |
Map<String,String> |
getCounters(CounterOptions opts)
Deprecated. As of release 2013.1, replaced by getCounters(com.perforce.p4java.option.server.GetCountersOptions) |
Map<String,String> |
getCounters(GetCountersOptions opts)
Get a map of the Perforce server's counters. |
IClient |
getCurrentClient()
Return the Perforce client currently associated with this Perforce server, if any. |
List<IDbSchema> |
getDbSchema(List<String> tableSpecs)
Get the database schema associated with this server (admin / superuser command). |
protected String |
getDefaultP4TicketsFile()
Get default p4tickets file for the running OS |
protected String |
getDefaultP4TrustFile()
Get default p4trust file for the running OS |
IDepot |
getDepot(String name)
Get an individual depot by name. |
List<IFileSpec> |
getDepotFiles(List<IFileSpec> fileSpecs,
boolean allRevs)
List all Perforce depot files known to the Perforce server that conform to the passed-in wild-card file specification(s). |
List<IFileSpec> |
getDepotFiles(List<IFileSpec> fileSpecs,
GetDepotFilesOptions opts)
List all Perforce depot files known to the Perforce server that conform to the passed-in wild-card file specification(s). |
List<IDepot> |
getDepots()
Get a list of all Perforce depots known to this Perforce server. |
List<IFileSpec> |
getDirectories(List<IFileSpec> fileSpecs,
boolean clientOnly,
boolean deletedOnly,
boolean haveListOnly)
List any directories matching the passed-in file specifications. |
List<IFileSpec> |
getDirectories(List<IFileSpec> fileSpecs,
GetDirectoriesOptions opts)
List any directories matching the passed-in file specifications. |
List<IDiskSpace> |
getDiskSpace(List<String> filesystems)
Get a list of disk space information about the current availability of disk space on the server. |
String |
getErrorOrInfoStr(Map<String,Object> map)
Gets the info/warning/error/fatal message from the passed-in Perforce command results map. |
String |
getErrorStr(Map<String,Object> map)
Gets the error/fatal message from the passed-in Perforce command results map. |
List<Map<String,Object>> |
getExportRecords(boolean useJournal,
long maxRecs,
int sourceNum,
long offset,
boolean format,
String journalPrefix,
String filter)
Get a list of exported journal or checkpoint records (admin / superuser command). |
List<Map<String,Object>> |
getExportRecords(ExportRecordsOptions opts)
Get a list of exported journal or checkpoint records (admin / superuser command). |
List<IExtendedFileSpec> |
getExtendedFiles(List<IFileSpec> fileSpecs,
GetExtendedFilesOptions opts)
Return a list of everything Perforce knows about a set of Perforce files. |
List<IExtendedFileSpec> |
getExtendedFiles(List<IFileSpec> fileSpecs,
int maxFiles,
int sinceChangelist,
int affectedByChangelist,
FileStatOutputOptions outputOptions,
FileStatAncilliaryOptions ancilliaryOptions)
Return a list of everything Perforce knows about a possibly very large set of Perforce files. |
List<IFileAnnotation> |
getFileAnnotations(List<IFileSpec> fileSpecs,
DiffType wsOpts,
boolean allResults,
boolean useChangeNumbers,
boolean followBranches)
Get a list of revision annotations for the specified files. |
List<IFileAnnotation> |
getFileAnnotations(List<IFileSpec> fileSpecs,
GetFileAnnotationsOptions opts)
Get a list of revision annotations for the specified files. |
InputStream |
getFileContents(List<IFileSpec> fileSpecs,
boolean allRevs,
boolean noHeaderLine)
Return an InputStream onto the contents of one or more revisions of one or more Perforce depot file contents. |
InputStream |
getFileContents(List<IFileSpec> fileSpecs,
GetFileContentsOptions opts)
Return an InputStream onto the contents of one or more revisions of one or more Perforce depot file contents. |
List<IFileDiff> |
getFileDiffs(IFileSpec file1,
IFileSpec file2,
String branchSpecName,
DiffType diffType,
boolean quiet,
boolean includeNonTextDiffs,
boolean gnuDiffs)
Run diff on the Perforce server of two files in the depot. |
List<IFileDiff> |
getFileDiffs(IFileSpec file1,
IFileSpec file2,
String branchSpecName,
GetFileDiffsOptions opts)
Run diff on the Perforce server of two files in the depot. |
InputStream |
getFileDiffsStream(IFileSpec file1,
IFileSpec file2,
String branchSpecName,
GetFileDiffsOptions opts)
Run diff on the Perforce server of two files in the depot. |
List<IFileSize> |
getFileSizes(List<IFileSpec> fileSpecs,
GetFileSizesOptions opts)
Gets a list of file sizes for one or more files in the depot. |
List<IFix> |
getFixes(List<IFileSpec> fileSpecs,
GetFixesOptions opts)
Return a list of all Perforce jobs with fix records associated with them, along with the changelist number of the fix. |
List<IFix> |
getFixList(List<IFileSpec> fileSpecs,
int changeListId,
String jobId,
boolean includeIntegrations,
int maxFixes)
Return a list of all Perforce jobs with fix records associated with them, along with the changelist number of the fix. |
protected abstract int |
getGenericCode(Map<String,Object> map)
|
String |
getIgnoreFileName()
|
protected String |
getInfoServerAddress()
Get the server address entry from the p4 info. |
String |
getInfoStr(Map<String,Object> map)
Gets the info message from the passed-in Perforce command results map. |
List<IChangelist> |
getInterchanges(IFileSpec fromFile,
IFileSpec toFile,
boolean showFiles,
boolean longDesc,
int maxChangelistId)
Get a list of changes and / or associated files not yet integrated (unsupported). |
List<IChangelist> |
getInterchanges(IFileSpec fromFile,
IFileSpec toFile,
GetInterchangesOptions opts)
Returns a list of changelists that have not been integrated from a set of source files to a set of target files. |
List<IChangelist> |
getInterchanges(String branchSpecName,
List<IFileSpec> fromFileList,
List<IFileSpec> toFileList,
boolean showFiles,
boolean longDesc,
int maxChangelistId,
boolean reverseMapping,
boolean biDirectional)
Get a list of changes and / or associated files not yet integrated, based on branchspecs (unsupported). |
List<IChangelist> |
getInterchanges(String branchSpecName,
List<IFileSpec> fromFileList,
List<IFileSpec> toFileList,
GetInterchangesOptions opts)
Returns a list of changelists that have not been integrated from a set of source files to a set of target files. |
IJob |
getJob(String jobId)
Get a specific job. |
List<IJob> |
getJobs(List<IFileSpec> fileSpecs,
GetJobsOptions opts)
Return a list of Perforce jobs. |
List<IJob> |
getJobs(List<IFileSpec> fileSpecs,
int maxJobs,
boolean longDescriptions,
boolean reverseOrder,
boolean includeIntegrated,
String jobView)
Return a list of Perforce jobs. |
IJobSpec |
getJobSpec()
Return the Perforce jobspec associated with this Perforce server. |
String |
getKey(String keyName)
Get the value of a named Perforce key from the Perforce server. |
Map<String,String> |
getKeys(GetKeysOptions opts)
Get a map of the Perforce server's keys. |
String[] |
getKnownCharsets()
Return an array of strings representing "known" charsets (e.g. |
ILabel |
getLabel(String labelName)
Get a specific named Perforce label. |
List<ILabelSummary> |
getLabels(List<IFileSpec> fileList,
GetLabelsOptions opts)
Get a list of Perforce labels, optionally tied to a specific set of files. |
List<ILabelSummary> |
getLabels(String user,
int maxLabels,
String nameFilter,
List<IFileSpec> fileList)
Get a list of Perforce labels, optionally tied to a specific set of files. |
String |
getLoginStatus()
Return a string indicating the current login status; corresponds to the p4 login -s command. |
ILogTail |
getLogTail(LogTailOptions opts)
Get the last block(s) of the errorLog and the offset required to get the next block when it becomes available. |
List<IFileLineMatch> |
getMatchingLines(List<IFileSpec> fileSpecs,
String pattern,
List<String> infoLines,
MatchingLinesOptions options)
Get list of matching lines in the specified file specs. |
List<IFileLineMatch> |
getMatchingLines(List<IFileSpec> fileSpecs,
String pattern,
MatchingLinesOptions options)
Get list of matching lines in the specified file specs. |
List<IFileSpec> |
getOpenedFiles(List<IFileSpec> fileSpecs,
boolean allClients,
String clientName,
int maxFiles,
int changeListId)
If one or more Perforce file specs is passed-in, return the opened / locked status of each file (if known) within an IFileSpec object; otherwise return a list of all files known to be open for this Perforce client workspace. |
List<IFileSpec> |
getOpenedFiles(List<IFileSpec> fileSpecs,
OpenedFilesOptions opts)
If one or more Perforce file specs is passed-in, return the opened / locked status of each file (if known) within an IFileSpec object; otherwise return a list of all files known to be open for this Perforce client workspace. |
static String[] |
getPreferredPathArray(String[] preamble,
List<IFileSpec> specList)
|
static String[] |
getPreferredPathArray(String[] preamble,
List<IFileSpec> specList,
boolean annotate)
|
Properties |
getProperties()
Return the Java properties associated with this server. |
List<IProperty> |
getProperty(GetPropertyOptions opts)
Gets a list of one or more property values from the Perforce server. |
List<IProtectionEntry> |
getProtectionEntries(boolean allUsers,
String hostName,
String userName,
String groupName,
List<IFileSpec> fileList)
Get a list of Perforce protection entries for the passed-in arguments. |
List<IProtectionEntry> |
getProtectionEntries(List<IFileSpec> fileList,
GetProtectionEntriesOptions opts)
Get a list of Perforce protection entries for the passed-in arguments. |
InputStream |
getProtectionsTable()
Get an InputStream onto the entries of the Perforce protections table. |
protected int |
getRandomInt()
Returns the next positive pseudo random int. |
List<IReviewChangelist> |
getReviewChangelists(GetReviewChangelistsOptions opts)
Get a list of all submitted changelists equal or above a provided changelist number that have not been reviewed before. |
List<IUserSummary> |
getReviews(int changelistId,
List<IFileSpec> fileSpecs)
Get a list of all users who have subscribed to review the named files, the files in the numbered changelist, or all files by default. |
List<IUserSummary> |
getReviews(List<IFileSpec> fileSpecs,
GetReviewsOptions opts)
Get a list of all users who have subscribed to review the named files. |
Map<IFileSpec,List<IFileRevisionData>> |
getRevisionHistory(List<IFileSpec> fileSpecs,
GetRevisionHistoryOptions opts)
Get the revision history data for one or more Perforce files. |
Map<IFileSpec,List<IFileRevisionData>> |
getRevisionHistory(List<IFileSpec> fileSpecs,
int maxRevs,
boolean contentHistory,
boolean includeInherited,
boolean longOutput,
boolean truncatedLongOutput)
Get the revision history data for one or more Perforce files. |
InputStream |
getServerFileDiffs(IFileSpec file1,
IFileSpec file2,
String branchSpecName,
DiffType diffType,
boolean quiet,
boolean includeNonTextDiffs,
boolean gnuDiffs)
Run diff on the Perforce server of two files in the depot. |
IServerInfo |
getServerInfo()
Return a snapshot set of data on the Perforce server associated with this server interface. |
List<IServerProcess> |
getServerProcesses()
Return a list of Perforce server processes active on the Perforce server. |
List<IServerProcess> |
getServerProcesses(GetServerProcessesOptions opts)
Return a list of Perforce server processes active on the Perforce server. |
protected int |
getServerVersion()
|
int |
getServerVersionNumber()
Get the Perforce version number of the Perforce server associated with this IServer object, if any. |
protected abstract int |
getSeverityCode(Map<String,Object> map)
|
List<IFileSpec> |
getShelvedFiles(int id)
Get a list of shelved files associated with a Perforce pending changelist. |
ISSOCallback |
getSSOCallback()
|
String |
getSSOKey()
|
ServerStatus |
getStatus()
Return the current status of this server object. |
IStream |
getStream(String streamPath)
Get an individual stream by stream path. |
IStream |
getStream(String streamPath,
GetStreamOptions opts)
Get an individual stream by stream path. |
void |
getStreamingExportRecords(ExportRecordsOptions opts,
IStreamingCallback callback,
int key)
Get each exported journal or checkpoint record (admin / superuser command) as it comes in from the server, rather than waiting for the entire command to complete. |
IStreamIntegrationStatus |
getStreamIntegrationStatus(String stream,
StreamIntegrationStatusOptions opts)
Get a stream's cached integration status with respect to its parent. |
List<IStreamSummary> |
getStreams(List<String> streamPaths,
GetStreamsOptions opts)
Get a list of all summary Perforce streams known to the Perforce server. |
List<IFileSpec> |
getSubmittedIntegrations(List<IFileSpec> fileSpecs,
GetSubmittedIntegrationsOptions opts)
Get a list of submitted integrations for the passed-in filespecs |
List<IFileSpec> |
getSubmittedIntegrations(List<IFileSpec> fileSpecs,
String branchSpec,
boolean reverseMappings)
Get a list of submitted integrations for the passed-in filespecs. |
abstract String |
getTicketsFilePath()
Return the Perforce authentication tickets file path. |
List<ITriggerEntry> |
getTriggerEntries()
Get a list of Perforce trigger entries. |
InputStream |
getTriggersTable()
Get an InputStream onto the entries of the Perforce triggers table. |
abstract String |
getTrust()
Return the fingerprint for the Perforce SSL connection. |
abstract String |
getTrustFilePath()
Return the Perforce trust file path. |
abstract List<Fingerprint> |
getTrusts()
List all fingerprints in the trust file. |
abstract List<Fingerprint> |
getTrusts(TrustOptions opts)
List all fingerprints or replacements in the trust file. |
UsageOptions |
getUsageOptions()
Get the UsageOptions object associated with this server. |
IUser |
getUser(String userName)
Get the user details of a specific Perforce user from the Perforce server. |
IUserGroup |
getUserGroup(String name)
Get the named Perforce user group. |
List<IUserGroup> |
getUserGroups(String userOrGroupName,
boolean indirect,
boolean displayValues,
int maxGroups)
Get a list of Perforce user groups from the server. |
List<IUserGroup> |
getUserGroups(String userOrGroupName,
GetUserGroupsOptions opts)
Get a list of Perforce user groups from the server. |
String |
getUserName()
Return the user name currently associated with this server, if any. |
List<IUserSummary> |
getUsers(List<String> userList,
GetUsersOptions opts)
Get a list of Perforce users known to this Perforce server. |
List<IUserSummary> |
getUsers(List<String> userList,
int maxUsers)
Get a list of Perforce users known to this Perforce server. |
String |
getWorkingDirectory()
Get the underlying server's notion of the current working directory. |
static String |
guardNull(String str)
|
boolean |
handleErrorStr(Map<String,Object> map)
|
String |
handleFileErrorStr(Map<String,Object> map)
|
IFileSpec |
handleFileReturn(Map<String,Object> map)
|
IFileSpec |
handleFileReturn(Map<String,Object> map,
IClient client)
|
IFileSpec |
handleIntegrationFileReturn(Map<String,Object> map,
boolean ignoreInfo)
|
IFileSpec |
handleIntegrationFileReturn(Map<String,Object> map,
IClient client)
|
ServerStatus |
init(String host,
int port,
Properties props)
Convenience method for init(host, port, props, null). |
ServerStatus |
init(String host,
int port,
Properties props,
UsageOptions opts)
Convenience method for init(host, port, props, opts, secure). |
ServerStatus |
init(String host,
int port,
Properties props,
UsageOptions opts,
boolean secure)
Convenience method for init(host, port, props, opts, secure, null). |
abstract boolean |
isAuthFail(String errStr)
|
boolean |
isCaseSensitive()
Returns whether the Perforce server associated with this IServer object is case sensitive. |
boolean |
isConnected()
Return true iff and the server object is connected to the associated Perforce server. |
protected boolean |
isDontWriteTicket(String cmd,
String[] cmdArgs)
Special case handling of the "-p" flag for the "p4 login" command. |
boolean |
isEnableProgress()
|
boolean |
isEnableTracking()
|
abstract boolean |
isInfoMessage(Map<String,Object> map)
|
abstract boolean |
isLoginNotRequired(String msgStr)
|
boolean |
isNonCheckedSyncs()
|
boolean |
isQuietMode()
|
static boolean |
isRunningOnWindows()
Return true if the JVM indicates that we're running on a Windows platform. |
protected boolean |
isSecure()
Check if the server is secure (SSL) or not. |
protected boolean |
isUnicode()
|
void |
journalWait(JournalWaitOptions opts)
Turns on/off journal-wait. |
void |
login(IUser user,
StringBuffer ticket,
LoginOptions opts)
Log another user in to Perforce by obtaining a session ticket for that user. |
void |
login(String password)
Convenience method for login(password, false). |
void |
login(String password,
boolean allHosts)
Works by retrieving the auth ticket and storing it away for use on all future commands. |
void |
login(String password,
LoginOptions opts)
Log the current user (if any) in to a Perforce server, optionally arranging to be logged in for all hosts. |
void |
login(String password,
StringBuffer ticket,
LoginOptions opts)
Log the current user (if any) in to a Perforce server using. |
void |
logout()
Log the current Perforce user out of a Perforce server session. |
void |
logout(LoginOptions opts)
Log the current Perforce user out of a Perforce server session. |
List<IFileSpec> |
moveFile(IFileSpec fromFile,
IFileSpec toFile,
MoveFileOptions opts)
Move a file already opened for edit or add (the fromFile) to the destination file (the toFile). |
List<IFileSpec> |
moveFile(int changeListId,
boolean listOnly,
boolean noClientMove,
String fileType,
IFileSpec fromFile,
IFileSpec toFile)
Move a file already opened for edit or add (the fromFile) to the destination file (the toFile). |
List<IObliterateResult> |
obliterateFiles(List<IFileSpec> fileSpecs,
ObliterateFilesOptions opts)
Obliterate permanently remove files and their history from the server. |
protected int |
parseVersionString(String versionString)
Return the major version number (e.g. |
static String[] |
populatePathArray(String[] pathArray,
int start,
List<IFileSpec> fileSpecList)
|
protected List<IChangelist> |
processInterchangeMaps(List<Map<String,Object>> resultMaps,
boolean showFiles)
|
ICommandCallback |
registerCallback(ICommandCallback callback)
Register a P4Java command callback with this Perforce server. |
IProgressCallback |
registerProgressCallback(IProgressCallback progressCallback)
Register a P4Java command progress callback with this Perforce server. |
ISSOCallback |
registerSSOCallback(ISSOCallback callback,
String ssoKey)
Register a Perforce Single Sign On (SSO) callback and key for this server. |
String |
reload(ReloadOptions opts)
Reload an unloaded client or label. |
abstract String |
removeTrust()
Remove the fingerprint for the Perforce SSL connection. |
abstract String |
removeTrust(TrustOptions opts)
Remove the fingerprint or replacement for the Perforce SSL connection. |
String |
renameUser(String oldUserName,
String newUserName)
Completely renames a user, modifying all database records which mention the user. |
List<String> |
searchJobs(String words,
SearchJobsOptions opts)
Search for jobs that contain the specified words in the search engine's index. |
void |
setAuthTicket(String authTicket)
Set the server's Perforce authentication ticket to the passed-in string. |
abstract void |
setAuthTicket(String userName,
String authTicket)
Set the server's Perforce authentication ticket for the specified user to the passed-in string. |
boolean |
setCharsetName(String charsetName)
Set the Perforce server's charset to the passed-in charset name. |
void |
setClientName(String clientName)
|
void |
setCounter(String counterName,
String value,
boolean perforceCounter)
|
String |
setCounter(String counterName,
String value,
CounterOptions opts)
Create, set or delete a counter on a Perforce server. |
void |
setCurrentClient(IClient client)
Set the Perforce client associated with this server. |
void |
setEnableProgress(boolean enableProgress)
|
void |
setEnableTracking(boolean enableTracking)
|
List<IFileSpec> |
setFileAttributes(List<IFileSpec> files,
Map<String,String> attributes,
SetFileAttributesOptions opts)
Set file attributes on one or more files (unsupported). |
List<IFileSpec> |
setFileAttributes(List<IFileSpec> files,
String attributeName,
InputStream inStream,
SetFileAttributesOptions opts)
Set a file attribute on one or more files using the passed-in input stream as the source for the attribute's value (unsupported). |
void |
setIgnoreFileName(String ignoreFileName)
|
String |
setKey(String KeyName,
String value,
KeyOptions opts)
Create, set or delete a key on a Perforce server. |
void |
setNonCheckedSyncs(boolean nonCheckedSyncs)
|
String |
setProperty(String name,
String value,
PropertyOptions opts)
Updates a property value in the Perforce server, or adds the property value to the Perforce server if it is not yet there. |
void |
setQuietMode(boolean quietMode)
|
protected void |
setSecure(boolean secure)
Sets the server to secure (SSL) or non-secure mode. |
String |
setServerConfigurationValue(String name,
String value)
Set or unset a specific names server configuration variable. |
abstract void |
setTicketsFilePath(String ticketsFilePath)
Set the Perforce authentication tickets file path. |
abstract void |
setTrustFilePath(String trustFilePath)
Set the Perforce trust file path. |
Server |
setUsageOptions(UsageOptions usageOptions)
Set the UsageOptions object associated with this server. |
void |
setUserName(String userName)
Set the Perforce user name to be used with this server. |
void |
setWorkingDirectory(String dirPath)
Set the Perforce server's idea of each command's working directory. |
List<ServerConfigurationValue> |
showServerConfiguration(String serverName,
String variableName)
Show server configuration values. |
boolean |
supportsUnicode()
Return true if the underlying Perforce server supports Unicode (and is connected). |
String |
switchClientView(String templateClientName,
String targetClientName,
SwitchClientViewOptions opts)
Switch the target client spec's view without invoking the editor. |
String |
switchStreamView(String streamPath,
String targetClientName,
SwitchClientViewOptions opts)
Switch the target client spec's view without invoking the editor. |
List<IFileSpec> |
tagFiles(List<IFileSpec> fileSpecs,
String labelName,
boolean listOnly,
boolean delete)
Tag files with a Perforce label. |
List<IFileSpec> |
tagFiles(List<IFileSpec> fileSpecs,
String labelName,
TagFilesOptions opts)
|
String |
unload(UnloadOptions opts)
Unloads a client or label to the unload depot. |
String |
updateBranchSpec(IBranchSpec branchSpec)
Update a Perforce branch spec on the Perforce server. |
String |
updateClient(IClient client)
Update an existing Perforce client on the current Perforce server. |
String |
updateClient(IClient client,
boolean force)
Update an existing Perforce client on the current Perforce server. |
String |
updateClient(IClient client,
UpdateClientOptions opts)
Update an existing Perforce client on the current Perforce server. |
String |
updateJob(IJob job)
Update a Perforce job on the Perforce server. |
String |
updateLabel(ILabel label)
Update an existing Perforce label in the Perforce server. |
String |
updateProtectionEntries(List<IProtectionEntry> entryList)
Replace the protections table data on the Perforce server with these new protection entries. |
String |
updateStream(IStream stream,
StreamOptions opts)
Update a Perforce stream spec on the Perforce server. |
String |
updateTriggerEntries(List<ITriggerEntry> entryList)
Replace the triggers table data on the Perforce server with these new triggers entries. |
String |
updateUser(IUser user,
boolean force)
Update a Perforce user on the Perforce server. |
String |
updateUser(IUser user,
UpdateUserOptions opts)
Update a Perforce user on the Perforce server. |
String |
updateUserGroup(IUserGroup group,
boolean updateIfOwner)
Update a Perforce user group on the Perforce server. |
String |
updateUserGroup(IUserGroup group,
UpdateUserGroupOptions opts)
Update a Perforce user group on the Perforce server. |
List<IExtendedFileSpec> |
verifyFiles(List<IFileSpec> fileSpecs,
VerifyFilesOptions opts)
Verify that the server archives are intact. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.perforce.p4java.impl.mapbased.server.IServerControl |
---|
init |
Methods inherited from interface com.perforce.p4java.server.IServer |
---|
supportsSmartMove |
Field Detail |
---|
public static final String SCREEN_NAME_FIELD_NAME
public static final String IMPL_COMMENTS_FIELD_NAME
public static final String IMPL_TYPE_FIELD_NAME
public static final String MINIMUM_SUPPORTED_SERVER_LEVEL_FIELD_NAME
public static final String PROTOCOL_NAME_FIELD_NAME
public static final String DEFAULT_STATUS_FIELD_NAME
public static final String IN_MAP_USE_TAGS_KEY
public static final String ATTRIBUTE_STREAM_MAP_KEY
protected static final String CORE_AUTH_FAIL_STRING_1
protected static final String CORE_AUTH_FAIL_STRING_2
protected static final String CORE_AUTH_FAIL_STRING_3
protected static final String CORE_AUTH_FAIL_STRING_4
public static final String P4TICKETS_ENV_VAR
public static final String P4TICKETS_DEFAULT_WINDOWS
public static final String P4TICKETS_DEFAULT_OTHER
public static final String P4TRUST_ENV_VAR
public static final String P4TRUST_DEFAULT_WINDOWS
public static final String P4TRUST_DEFAULT_OTHER
public static final String P4IGNORE_ENV_VAR
protected UsageOptions usageOptions
protected static final int UNKNOWN_SERVER_VERSION
protected static final String UNKNOWN_SERVER_HOST
protected static final int UNKNOWN_SERVER_PORT
protected ServerStatus status
protected Properties props
protected IServerInfo serverInfo
protected String serverAddress
protected boolean caseSensitive
protected int serverVersion
protected String serverHost
protected int serverPort
protected String userName
protected String password
protected Map<String,String> authTickets
protected IClient client
protected String clientName
protected String clientUnsetName
protected boolean setupOnConnect
protected boolean loginOnConnect
protected ICommandCallback commandCallback
protected IProgressCallback progressCallback
protected ISSOCallback ssoCallback
protected String ssoKey
protected String charsetName
protected Charset charset
protected boolean connected
protected int minumumSupportedServerVersion
protected String tmpDirName
protected AtomicInteger nextCmdCallBackKey
protected AtomicInteger nextProgressCallbackKey
protected static boolean runningOnWindows
protected boolean nonCheckedSyncs
protected boolean enableTracking
protected boolean enableProgress
protected boolean quietMode
protected boolean secure
protected boolean useAuthMemoryStore
protected String ignoreFileName
protected String rsh
protected Random rand
Constructor Detail |
---|
public Server()
Method Detail |
---|
public ICommandCallback registerCallback(ICommandCallback callback)
IServer
See the ICommandCallback javadocs for callback semantics. Note that only one command callback can be active and registered for a given server at any one time.
registerCallback
in interface IServer
callback
- ICommandCallback object to be registered; if null, command
callbacks are disabled.
IServer.registerCallback(com.perforce.p4java.server.callback.ICommandCallback)
public IProgressCallback registerProgressCallback(IProgressCallback progressCallback)
IServer
See the IProgressCallback javadocs for callback semantics. Note that only one progress callback can be active and registered for a given server at any one time.
registerProgressCallback
in interface IServer
progressCallback
- IProgressCallback object to be registered; if null, progress
callbacks are disabled.
IServer.registerProgressCallback(com.perforce.p4java.server.callback.IProgressCallback)
public ISSOCallback registerSSOCallback(ISSOCallback callback, String ssoKey)
IServer
See the ISSOCallback Javadoc comments for an explanation of the SSO callback feature; note that only one SSO callback can be active and registered for a given P4Jserver object at any one time.
Note that SSO callbacks work only with the (default) pure Java (RPC) protocol implementation.
registerSSOCallback
in interface IServer
callback
- ISSOCallback object to be registered; if null, SSO
callbacks are disabled.ssoKey
- opaque string to be passed untouched to the callback; can
be null, in which case null is passed in to the callback
IServer.registerSSOCallback(com.perforce.p4java.server.callback.ISSOCallback, java.lang.String)
public ServerStatus getStatus()
IServer
getStatus
in interface IServer
IServer.getStatus()
public int getServerVersionNumber()
IServer
getServerVersionNumber
in interface IServer
IServer.getServerVersionNumber()
public boolean isCaseSensitive()
IServer
isCaseSensitive
in interface IServer
IServer.isCaseSensitive()
public boolean setCharsetName(String charsetName) throws UnsupportedCharsetException
IServer
setCharsetName
in interface IServer
charsetName
- charset name; if null, resets the charset to "no charset".
UnsupportedCharsetException
- if the Perforce server doesn't
support or recognize the charset name.IServer.setCharsetName(java.lang.String)
public String getCharsetName()
IServer
getCharsetName
in interface IServer
IServer.getCharsetName()
public boolean supportsUnicode() throws ConnectionException, RequestException, AccessException
IServer
supportsUnicode
in interface IServer
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.supportsUnicode()
public String[] getKnownCharsets()
IServer
Note that in this context, "known" simply means that Perforce servers supported by this API can potentially recognize the charset name and (hopefully) act accordingly.
Charset support in Perforce is described in more detail in the main p4 command documentation; in summary, although the list returned here is comprehensive and quite impressive, unless the Perforce server is actually primed to cope with Unicode (which, by default, they're not), the only charset listed here that will work is "none"; furthermore, actual charset support is somewhat idiosyncratic -- please refer to specific documentation for guidance with this. You probably need to use this method in conjunction with the supportsUnicode() method above.
getKnownCharsets
in interface IServer
IServer.getKnownCharsets()
public Properties getProperties()
IServer
getProperties
in interface IServer
IServer.getProperties()
public ServerStatus init(String host, int port, Properties props) throws ConfigException, ConnectionException
IServerControl
init
in interface IServerControl
host
- the Perforce server hostname or IP address as passed in to the factory methodport
- the Perforce server port number as passed in to the factory method
ConfigException
- if there's something wrong with the
specified configuration or associated config files, etc.
ConnectionException
- if the server is unreachable on initialization, and that
unreachability is serious and unrecoverable (there are implementations that don't
really do connections per se, so they may not consider this an error or even try
connecting during initialisation).IServerControl.init(java.lang.String, int, java.util.Properties)
public ServerStatus init(String host, int port, Properties props, UsageOptions opts) throws ConfigException, ConnectionException
IServerControl
init
in interface IServerControl
host
- the Perforce server hostname or IP address as passed in to the factory methodport
- the Perforce server port number as passed in to the factory methodprops
- the properties passed in to the factory methodopts
- the UsageOptions object to be associated with the server object; if null,
the server should construct a new default UsageOptions object.
ConfigException
- if there's something wrong with the
specified configuration or associated config files, etc.
ConnectionException
- if the server is unreachable on initialization, and that
unreachability is serious and unrecoverable (there are implementations that don't
really do connections per se, so they may not consider this an error or even try
connecting during initialisation).IServerControl.init(java.lang.String, int, java.util.Properties, com.perforce.p4java.option.UsageOptions)
public ServerStatus init(String host, int port, Properties props, UsageOptions opts, boolean secure) throws ConfigException, ConnectionException
IServerControl
init
in interface IServerControl
host
- the Perforce server hostname or IP address as passed in to the factory methodport
- the Perforce server port number as passed in to the factory methodprops
- the properties passed in to the factory methodopts
- the UsageOptions object to be associated with the server object; if null,
the server should construct a new default UsageOptions object.
ConfigException
- if there's something wrong with the
specified configuration or associated config files, etc.
ConnectionException
- if the server is unreachable on initialization, and that
unreachability is serious and unrecoverable (there are implementations that don't
really do connections per se, so they may not consider this an error or even try
connecting during initialisation).IServerControl.init(java.lang.String, int, java.util.Properties, com.perforce.p4java.option.UsageOptions, boolean)
public void connect() throws ConnectionException, AccessException, RequestException, ConfigException
IServer
This method's detailed semantics depend on the underlying transport implementation, but in general, it's intended to be called before any attempt is made to issue a command to the associated Perforce server. It's also intended to be called after any (intentional or accidental) disconnect.
Note that certain implementations may try to request a client, etc., on connection (in response to property values passed in through the URL, etc.), which may cause a RequestException to be generated.
connect
in interface IServer
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the caller
RequestException
- if the Perforce server encounters an error during
its processing of the request
ConfigException
- if local I/O exception occursIServer.connect()
public boolean isConnected()
IServer
The meaning of "connected" is generally dependent on the underlying transport layer, but in general, if the server is not connected, issuing server commands to the associated Perforce server will fail with a connection exception.
isConnected
in interface IServer
IServer.isConnected()
public void disconnect() throws ConnectionException, AccessException
IServer
This command should be run at the point at which this server is not going to be used any more, and attempts to disconnect from the associated server. "Disconnect" here has different meanings according to the underlying transport mechanism, but in practice it will mean that attempting to use this server object to issue Perforce commands will fail, usually with a ConnectionException exception.
disconnect
in interface IServer
ConnectionException
AccessException
IServer.disconnect()
public void setUserName(String userName)
IServer
Note that the auth ticket (if available) for this user will also be set to this server instance.
setUserName
in interface IServer
userName
- Perforce user name; can be null, which is interpreted
as "don't associate a user name with this server".IServer.setUserName(java.lang.String)
public String getUserName()
IServer
getUserName
in interface IServer
IServer.getUserName()
public void setAuthTicket(String authTicket)
IServer
No checking is performed on the passed-in ticket, and any changes to existing tickets can cause authentication failures, so you should ensure the passed-in ticket is valid and makes sense for the current context.
setAuthTicket
in interface IServer
authTicket
- possibly-null Perforce authentication ticketIServer.setAuthTicket(java.lang.String)
public String getAuthTicket()
IServer
getAuthTicket
in interface IServer
IServer.getAuthTicket()
public IServerInfo getServerInfo() throws ConnectionException, RequestException, AccessException
IServer
getServerInfo
in interface IServer
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getServerInfo()
public void login(String password) throws ConnectionException, RequestException, AccessException, ConfigException
IServer
login
in interface IServer
password
- Perforce password; can be null if no password is needed (as
in the case of SSO logins)
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the caller
ConfigException
- if the p4tickets file could not be updated successfullyIServer.login(java.lang.String)
public void login(String password, boolean allHosts) throws ConnectionException, RequestException, AccessException, ConfigException
login
in interface IServer
password
- Perforce password; can be null if no password is needed (as
in the case of SSO logins)allHosts
- if true, perform the equivalent of a "login -a"
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the caller
ConfigException
- if the p4tickets file could not be updated successfullyIServer.login(java.lang.String)
public String getLoginStatus() throws P4JavaException
IServer
getLoginStatus
in interface IServer
P4JavaException
- if any errors occur during the processing of
this command.IServer.getLoginStatus()
public void login(String password, LoginOptions opts) throws P4JavaException
IOptionsServer
Attempts to log in to the underlying Perforce server. If successful, successive calls to server-side services will succeed until the session is terminated by the server or the user logs out.
Behavior is undefined if the server's user name attribute is null (but will probably cause a NullPointerError with most implementations).
Login will work with the Perforce SSO (single sign-on) scheme: in this case your password should be null, and the environment variable P4LOGINSSO should point to an executable SSO script as described in p4 help undoc (help for this is beyond the scope of this method doc, unfortunately, and the feature is not well tested here, but it "works" in general...).
login
in interface IOptionsServer
password
- Perforce password; can be null if no password is needed (as
in the case of SSO logins)opts
- if LoginOptions.allHosts is true, perform the equivalent
of a "login -a". A null LoginOptions parameter is equivalent
to no options being set.
P4JavaException
- if any error occurs in the processing of this
method. A specific ConfigException is thrown if the p4tickets
file could not be updated successfully.IOptionsServer.login(java.lang.String, com.perforce.p4java.option.server.LoginOptions)
public void login(String password, StringBuffer ticket, LoginOptions opts) throws P4JavaException
IOptionsServer
Optionally, if the opts.isDontWriteTicket() is true ('login -p'), the ticket is not written to file; if opts.isAllHosts is true ('login -a'), the ticket is valid on all hosts; if opts.getHost() is non-null ('login -h'), the ticket is valid on the specified host.
Note: if the passed-in ticket StringBuffer originally has content it will remain there. The auth ticket will only be appended to the buffer. If a null ticket StringBuffer is passed in, the auth ticket will not be appended to it. The normal use case should be to pass in a new ticket StringBuffer.
login
in interface IOptionsServer
password
- Perforce password; can be null if no password is needed (as
in the case of SSO logins)ticket
- if the ticket StringBuffer parameter is non-null, the auth
ticket that was returned by the login attempt is appended to
the passed-in ticket StringBuffer.opts
- LoginOptions describing the associated options; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.login(java.lang.String, java.lang.StringBuffer, com.perforce.p4java.option.server.LoginOptions)
public void login(IUser user, StringBuffer ticket, LoginOptions opts) throws P4JavaException
IOptionsServer
Optionally, if the opts.isDontWriteTicket() is true ('login -p'), the ticket is not written to file; if opts.isAllHosts is true ('login -a'), the ticket is valid on all hosts; if opts.getHost() is non-null ('login -h'), the ticket is valid on the specified host.
Specifying a user as an argument requires 'super' access, which is granted by 'p4 protect'. In this case, login another user does not require a password, assuming that you (a 'super' user) had already been logged in.
Note: if the passed-in ticket StringBuffer originally has content it will remain there. The auth ticket will only be appended to the buffer. If a null ticket StringBuffer is passed in, the auth ticket will not be appended to it. The normal use case should be to pass in a new ticket StringBuffer.
login
in interface IOptionsServer
user
- non-null Perforce user; login request is for this specified user.ticket
- if the ticket StringBuffer parameter is non-null, the auth
ticket that was returned by the login attempt is appended to
the passed-in ticket StringBuffer.opts
- LoginOptions describing the associated options; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.login(com.perforce.p4java.core.IUser, java.lang.StringBuffer, com.perforce.p4java.option.server.LoginOptions)
public void logout() throws ConnectionException, RequestException, AccessException, ConfigException
IServer
logout
in interface IServer
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the caller
ConfigException
- if the p4tickets file could not be updated successfullyIServer.logout()
public void logout(LoginOptions opts) throws P4JavaException
IOptionsServer
logout
in interface IOptionsServer
opts
- currently ignored; can be null.
P4JavaException
- if any error occurs in the processing of this
method.IOptionsServer.logout(com.perforce.p4java.option.server.LoginOptions)
public String changePassword(String oldPassword, String newPassword, String userName) throws P4JavaException
IOptionsServer
Note: setting the 'newPassword' to null or empty will delete the password.
changePassword
in interface IOptionsServer
oldPassword
- possibly-null or possibly-empty user's old password.
If null or empty, it assumes the current password is not set.newPassword
- non-null and non-empty user's new password.userName
- possibly-null possibly-null name of the target user whose
password will be changed to the new password. If null, the
current user will be used. If non-null, this command requires
'super' access granted by 'p4 protect'.
P4JavaException
- if any error occurs in the processing of this
method.IOptionsServer.changePassword(java.lang.String, java.lang.String, java.lang.String)
public List<IClientSummary> getClients(String userName, String queryString, int maxResults) throws ConnectionException, RequestException, AccessException
IServer
Note that this method returns light-weight IClientSummary objects rather than full IClient objects; if you need the heavy-weight IClient objects, you should use getClient(). Note also that the returned IClient objects are not "complete", in the sense that implementations are free to leave certain attributes null for performance reasons. In general, at least the client's name, root, description, last modification time are guaranteed correct.
getClients
in interface IServer
userName
- if not null, restrict listings to clients owned by the user 'userName'queryString
- if not null, limits output to clients whose name matches the query
pattern passed-in.
Note this option does not work for earlier Perforce servers.maxResults
- if > 0, restrict output to the first maxResults results.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getClients(java.lang.String, java.lang.String, int)
public List<IClientSummary> getClients(GetClientsOptions opts) throws P4JavaException
IOptionsServer
Note that this method returns light-weight IClientSummary objects rather than full IClient objects; if you need the heavy-weight IClient objects, you should use getClient(). Note also that the returned IClient objects are not "complete", in the sense that implementations are free to leave certain attributes null for performance reasons. In general, at least the client's name, root, description, last modification time are guaranteed correct.
getClients
in interface IOptionsServer
opts
- GetClientsOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getClients(com.perforce.p4java.option.server.GetClientsOptions)
public List<ILabelSummary> getLabels(String user, int maxLabels, String nameFilter, List<IFileSpec> fileList) throws ConnectionException, RequestException, AccessException
IServer
Note that the ILabel objects returned here do not have views associated with them (i.e. the getViewMapping() method will return an empty list. If you need to get the view mapping for a specific label, use the getLabel() method.
getLabels
in interface IServer
user
- if non-null, limit labels to those owned by the named usermaxLabels
- if larger than zero, return only the first maxLabels
(or fewer) qualifying labelsnameFilter
- if not null, limits output to labels whose name matches
the nameFilter pattern, e.g. -e 'svr-dev-rel*'fileList
- if not null, limits its report to labels that contain those files
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getLabels(java.lang.String, int, java.lang.String, java.util.List)
public List<ILabelSummary> getLabels(List<IFileSpec> fileList, GetLabelsOptions opts) throws P4JavaException
IOptionsServer
Note that the ILabel objects returned here do not have views associated with them (i.e. the getViewMapping() method will return an empty list. If you need to get the view mapping for a specific label, use the getLabel() method.
getLabels
in interface IOptionsServer
fileList
- if not null, limits its report to labels that contain those filesopts
- GetLabelsOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.com.perforce.p4java.server.IOptionsServer#getLabels(com.perforce.p4java.option.server.GetLabelsOptions)
public ILabel getLabel(String labelName) throws ConnectionException, RequestException, AccessException
IServer
Unlike the getLabelList method, the getViewMapping method on the returned label will be valid. Note though that changes to the returned label or its view will not be reflected on to the server unless the updateLabel method is called with the label as an argument.
getLabel
in interface IServer
labelName
- non-null label name
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getLabel(java.lang.String)
public String createLabel(ILabel label) throws ConnectionException, RequestException, AccessException
IServer
createLabel
in interface IServer
label
- non-null ILabel to be saved
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.createLabel(com.perforce.p4java.core.ILabel)
public String deleteLabel(String labelName, boolean force) throws ConnectionException, RequestException, AccessException
IServer
deleteLabel
in interface IServer
labelName
- non-null label nameforce
- if true, forces the deletion of any label; normally labels
can only be deleted by their owner
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.deleteLabel(java.lang.String, boolean)
public String deleteLabel(String labelName, DeleteLabelOptions opts) throws P4JavaException
IOptionsServer
deleteLabel
in interface IOptionsServer
labelName
- non-null label nameopts
- DeleteLabelOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.deleteLabel(java.lang.String, com.perforce.p4java.option.server.DeleteLabelOptions)
public String updateLabel(ILabel label) throws ConnectionException, RequestException, AccessException
IServer
updateLabel
in interface IServer
label
- non-null ILabel to be updated
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.updateLabel(com.perforce.p4java.core.ILabel)
public List<IFileSpec> getDepotFiles(List<IFileSpec> fileSpecs, boolean allRevs) throws ConnectionException, AccessException
IServer
If client file names are given as file spec arguments the current Perforce client view mapping is used to list the corresponding depot files, if the client and view exist (if not, the results are undefined).
Normally, the head revision of each matching file is listed, but you can change this by specifying specific revisions or revision ranges. If the file spec argument includes a revision, then all files as of that revision are returned. If the file spec argument has a revision range, then only files selected by that revision range are returned, and the highest revision in the range is used for each file. If allRevs is true, all revisions within the specific range, rather than just the highest revision in the range, are returned.
See 'p4 help revisions' for help specifying revisions.
Note that the IFileSpec objects returned will have null client and local path components.
getDepotFiles
in interface IServer
fileSpecs
- a non-null list of one or more IFileSpecs to be used
to qualify Perforce depot filesallRevs
- if true, list all revisions of qualifying files.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the callerIServer.getDepotFiles(java.util.List, boolean)
public List<IFileSpec> getDepotFiles(List<IFileSpec> fileSpecs, GetDepotFilesOptions opts) throws P4JavaException
IOptionsServer
If client file names are given as file spec arguments the current Perforce client view mapping is used to list the corresponding depot files, if the client and view exist (if not, the results are undefined).
Normally, the head revision of each matching file is listed, but you can change this by specifying specific revisions or revision ranges. If the file spec argument includes a revision, then all files as of that revision are returned. If the file spec argument has a revision range, then only files selected by that revision range are returned, and the highest revision in the range is used for each file. If GetDepotFilesOptions.allRevs is true, all revisions within the specific range, rather than just the highest revision in the range, are returned.
See 'p4 help revisions' for help specifying revisions.
Note that the IFileSpec objects returned will have null client and local path components.
getDepotFiles
in interface IOptionsServer
fileSpecs
- a non-null list of one or more IFileSpecs to be used
to qualify Perforce depot filesopts
- GetDepotFilesOptions describing the associated options; if null,
no options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getDepotFiles(java.util.List, com.perforce.p4java.option.server.GetDepotFilesOptions)
public List<IFileAnnotation> getFileAnnotations(List<IFileSpec> fileSpecs, DiffType wsOpts, boolean allResults, boolean useChangeNumbers, boolean followBranches) throws ConnectionException, RequestException, AccessException
IServer
getFileAnnotations
in interface IServer
fileSpecs
- non-null list of file specs to be annotatedwsOpts
- DiffType describing the white space option to be used; if null,
use default (no options), otherwise must be one of the whitespace
options defined by the isWsOption method on DiffType.allResults
- if true, include both deleted files and lines no longer present
at the head revisionuseChangeNumbers
- if true, annotate with change numbers rather than
revision numbers with each linefollowBranches
- if true, follow branches.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getFileAnnotations(java.util.List, com.perforce.p4java.core.file.DiffType, boolean, boolean, boolean)
public List<IFileAnnotation> getFileAnnotations(List<IFileSpec> fileSpecs, GetFileAnnotationsOptions opts) throws P4JavaException
IOptionsServer
getFileAnnotations
in interface IOptionsServer
fileSpecs
- non-null list of file specs to be annotated.opts
- GetFileAnnotationsOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getFileAnnotations(java.util.List, com.perforce.p4java.option.server.GetFileAnnotationsOptions)
public List<IFileSpec> tagFiles(List<IFileSpec> fileSpecs, String labelName, boolean listOnly, boolean delete) throws ConnectionException, RequestException, AccessException
IServer
tagFiles
in interface IServer
fileSpecs
- non-null list of files to be tagged.labelName
- non-null label name to use for the tagging.listOnly
- if true, don't do the actual tag, just return the list of files that
would have been tagged.delete
- if true, delete the label tag from the files.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.tagFiles(java.util.List, java.lang.String, boolean, boolean)
public List<IFileSpec> tagFiles(List<IFileSpec> fileSpecs, String labelName, TagFilesOptions opts) throws P4JavaException
tagFiles
in interface IOptionsServer
fileSpecs
- non-null list of files to be tagged.labelName
- non-null label name to use for the tagging.opts
- TagFilesOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.tagFiles(java.util.List, java.lang.String, com.perforce.p4java.option.server.TagFilesOptions)
public List<IUserSummary> getReviews(int changelistId, List<IFileSpec> fileSpecs) throws ConnectionException, RequestException, AccessException
IServer
Note that the returned IUserSummary objects will have null access and update dates associated with them.
getReviews
in interface IServer
changelistId
- if not IChangelist.UNKNOWN, use this changelist ID.fileSpecs
- if not null, use this list as the list of named files rather
than all files.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getReviews(int, java.util.List)
public List<IUserSummary> getReviews(List<IFileSpec> fileSpecs, GetReviewsOptions opts) throws P4JavaException
IOptionsServer
getReviews
in interface IOptionsServer
fileSpecs
- if not null, use this list as the list of named files rather
than all files.opts
- GetReviewsOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getReviews(java.util.List, com.perforce.p4java.option.server.GetReviewsOptions)
public List<IReviewChangelist> getReviewChangelists(GetReviewChangelistsOptions opts) throws P4JavaException
IOptionsServer
If only the 'changelistId' option is provided, return a list of changelists that have not been reviewed before, equal or above the specified changelist#.
If only the 'counter' option is provided, return a list of changelists that have not been reviewed before, above the specified counter's changelist#.
If both the 'changelistId' and 'counter' options are specified, 'p4 review' sets the counter to that changelist# and produces no output. This functionality has been superceded by the 'p4 counter' command. The user must have permission to set counters.
getReviewChangelists
in interface IOptionsServer
opts
- GetReviewChangelistsOptions object describing optional parameters;
if null, no options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getReviewChangelists(com.perforce.p4java.option.server.GetReviewChangelistsOptions)
public List<IFileSpec> moveFile(int changeListId, boolean listOnly, boolean noClientMove, String fileType, IFileSpec fromFile, IFileSpec toFile) throws ConnectionException, RequestException, AccessException
IServer
Note that this operation is not supported on servers earlier than 2009.1; any attempt to use this on earlier servers will result in a RequestException with a suitable message. Similarly, not all underlying IServer implementations will work with this either, and will also result in a suitable RequestException.
Note also that the move command is special in that almost alone among Perforce file-based commands, it does not allow full filespecs with version specifiers; these are currently quietly stripped off in the move command implementation here, which may lead to unexpected behaviour if you pass in specific versions expecting them to be honoured.
moveFile
in interface IServer
changeListId
- if not IChangelist.UNKNOWN, the files are opened in the numbered
pending changelist instead of the 'default' changelist.listOnly
- if true, don't actually perform the move, just return what would
happen if the move was performednoClientMove
- if true, bypasses the client file rename. This option can be
used to tell the server that the user has already renamed a file on
the client. The use of this option can confuse the server if you
are wrong about the client's contents. Only works for 2009.2 and later
servers; earlier servers will produce a RequestException if you set
this true.fileType
- if not null, the file is reopened as that filetype.fromFile
- the original file; must be already open for edit.toFile
- the target file.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.moveFile(int, boolean, boolean, java.lang.String, com.perforce.p4java.core.file.IFileSpec, com.perforce.p4java.core.file.IFileSpec)
public List<IFileSpec> moveFile(IFileSpec fromFile, IFileSpec toFile, MoveFileOptions opts) throws P4JavaException
IOptionsServer
Note that this operation is not supported on servers earlier than 2009.1; any attempt to use this on earlier servers will result in a RequestException with a suitable message.
Note also that the move command is special in that almost alone among Perforce file-based commands, it does not allow full filespecs with version specifiers; these are currently quietly stripped off in the move command implementation here, which may lead to unexpected behaviour if you pass in specific versions expecting them to be honoured.
moveFile
in interface IOptionsServer
fromFile
- the original file; must be already open for edit.toFile
- the target file.opts
- MoveFileOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.moveFile(com.perforce.p4java.core.file.IFileSpec, com.perforce.p4java.core.file.IFileSpec, com.perforce.p4java.option.server.MoveFileOptions)
public IUser getUser(String userName) throws ConnectionException, RequestException, AccessException
IServer
getUser
in interface IServer
userName
- if null, get the current user details, otherwise use the
passed-in user name.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getUser(java.lang.String)
public String createUser(IUser user, boolean force) throws ConnectionException, RequestException, AccessException
IServer
createUser
in interface IServer
user
- non-null IUser defining the new user to be created.force
- if true, force the creation of any named user; requires admin
privileges,
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.createUser(com.perforce.p4java.core.IUser, boolean)
public String createUser(IUser user, UpdateUserOptions opts) throws P4JavaException
IOptionsServer
createUser
in interface IOptionsServer
user
- non-null IUser defining the new user to be created.opts
- UpdateUserOptions object describing optional parameters; if null, no
options are set
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.createUser(com.perforce.p4java.core.IUser, com.perforce.p4java.option.server.UpdateUserOptions)
public String updateUser(IUser user, boolean force) throws ConnectionException, RequestException, AccessException
IServer
updateUser
in interface IServer
user
- non-null IUser defining the user to be updatedforce
- if true, force update for users other than the caller. Requires
super user / admin privileges (enforced by the server).
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.updateUser(com.perforce.p4java.core.IUser, boolean)
public String updateUser(IUser user, UpdateUserOptions opts) throws P4JavaException
IOptionsServer
updateUser
in interface IOptionsServer
user
- non-null IUser defining the new user to be updated.opts
- UpdateUserOptions object describing optional parameters; if null, no
options are set
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.updateUser(com.perforce.p4java.core.IUser, com.perforce.p4java.option.server.UpdateUserOptions)
public String deleteUser(String userName, boolean force) throws ConnectionException, RequestException, AccessException
IServer
deleteUser
in interface IServer
userName
- non-null name of the user to be deleted.force
- if true, force deletion for users other than the caller. Requires
super user / admin privileges (enforced by the server).
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.deleteUser(java.lang.String, boolean)
public String deleteUser(String userName, UpdateUserOptions opts) throws P4JavaException
IOptionsServer
deleteUser
in interface IOptionsServer
userName
- non-null name of the user to be deleted.opts
- UpdateUserOptions object describing optional parameters; if null, no
options are set
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.deleteUser(java.lang.String, com.perforce.p4java.option.server.UpdateUserOptions)
public String renameUser(String oldUserName, String newUserName) throws P4JavaException
IOptionsServer
This includes all workspaces, labels, branches, streams, etc. which are owned by the user, all pending, shelved, and committed changes created by the user, any files that the user has opened or shelved, any fixes that the user made to jobs, any properties that apply to the user, any groups that the user is in, and the user record itself.
The username is not changed in descriptive text fields (such as job descriptions, change descriptions, or workspace descriptions), only where it appears as the owner or user field of the database record.
Protection table entries that apply to the user are updated only if the Name: field exactly matches the user name; if the Name: field contains wildcards, it is not modified.
The only job field that is processed is attribute code 103. If you have included the username in other job fields they will have to be processed separately.
The full semantics of this operation are found in the main 'p4 help' documentation.
This method requires 'super' access granted by 'p4 protect'.
renameUser
in interface IOptionsServer
oldUserName
- the old user name to be changed.newUserName
- the new user name to be changed to.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.renameUser(java.lang.String, java.lang.String)
public List<IUserSummary> getUsers(List<String> userList, int maxUsers) throws ConnectionException, RequestException, AccessException
IServer
Note that this implementation differs a bit from the p4 command line version in that it simply doesn't return any output for unmatched users.
getUsers
in interface IServer
userList
- if non-null, restrict output to users matching the passed-in
list of users.maxUsers
- if positive, only return the first maxUsers users.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getUsers(java.util.List, int)
public List<IUserSummary> getUsers(List<String> userList, GetUsersOptions opts) throws P4JavaException
IOptionsServer
Note that this implementation differs a bit from the p4 command line version in that it simply doesn't return any output for unmatched users.
getUsers
in interface IOptionsServer
userList
- if non-null, restrict output to users matching the passed-in
list of users.opts
- GetUsersOptions object describing optional parameters; if null, no
options are set
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getUsers(java.util.List, com.perforce.p4java.option.server.GetUsersOptions)
public List<IUserGroup> getUserGroups(String userOrGroupName, boolean indirect, boolean displayValues, int maxGroups) throws ConnectionException, RequestException, AccessException
IServer
Note that the Perforce server considers it an error to have both indirect and displayValues parameters set true; this will cause the server to throw a RequestException with an appropriate usage message.
getUserGroups
in interface IServer
userOrGroupName
- if non-null, restrict the list to the specified group or username.indirect
- if true, also displays groups that the specified user or group belongs
to indirectly via subgroups.displayValues
- if true, display the MaxResults, MaxScanRows, MaxLockTime,
and Timeout values for the named group.maxGroups
- if > 0, display only the first m results.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request.
AccessException
- if the Perforce server denies access to the caller.IServer.getUserGroups(java.lang.String, boolean, boolean, int)
public List<IUserGroup> getUserGroups(String userOrGroupName, GetUserGroupsOptions opts) throws P4JavaException
IOptionsServer
Note that the Perforce server considers it an error to have both indirect and displayValues parameters set true; this will cause the server to throw a RequestException with an appropriate usage message.
getUserGroups
in interface IOptionsServer
userOrGroupName
- if non-null, restrict the list to the specified group or username.opts
- GetUserGroupsOptions object describing optional parameters; if null, no
options are set
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getUserGroups(java.lang.String, com.perforce.p4java.option.server.GetUserGroupsOptions)
public IUserGroup getUserGroup(String name) throws ConnectionException, RequestException, AccessException
IServer
getUserGroup
in interface IServer
name
- non-null group name.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request.
AccessException
- if the Perforce server denies access to the caller.IServer.getUserGroup(java.lang.String)
public String createUserGroup(IUserGroup group) throws ConnectionException, RequestException, AccessException
IServer
createUserGroup
in interface IServer
group
- non-null IUserGroup to be created.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request.
AccessException
- if the Perforce server denies access to the caller.IServer.createUserGroup(com.perforce.p4java.core.IUserGroup)
public String updateUserGroup(IUserGroup group, boolean updateIfOwner) throws ConnectionException, RequestException, AccessException
IServer
updateUserGroup
in interface IServer
group
- non-null user group to be updated.updateIfOwner
- if true, allows a user without 'super'
access to modify the group only if that user is an
'owner' of that group.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request.
AccessException
- if the Perforce server denies access to the caller.IServer.updateUserGroup(com.perforce.p4java.core.IUserGroup, boolean)
public String deleteUserGroup(IUserGroup group) throws ConnectionException, RequestException, AccessException
IServer
deleteUserGroup
in interface IServer
group
- non-null group to be deleted.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request.
AccessException
- if the Perforce server denies access to the caller.IServer.deleteUserGroup(com.perforce.p4java.core.IUserGroup)
public String createUserGroup(IUserGroup group, UpdateUserGroupOptions opts) throws P4JavaException
IOptionsServer
createUserGroup
in interface IOptionsServer
group
- group non-null IUserGroup to be created.opts
- UpdateUserGroupOptions object describing optional parameters; if null, no
options are set
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.createUserGroup(com.perforce.p4java.core.IUserGroup, com.perforce.p4java.option.server.UpdateUserGroupOptions)
public String updateUserGroup(IUserGroup group, UpdateUserGroupOptions opts) throws P4JavaException
IOptionsServer
updateUserGroup
in interface IOptionsServer
group
- group non-null IUserGroup to be updated.opts
- UpdateUserGroupOptions object describing optional parameters; if null, no
options are set
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.updateUserGroup(com.perforce.p4java.core.IUserGroup, com.perforce.p4java.option.server.UpdateUserGroupOptions)
public String deleteUserGroup(IUserGroup group, UpdateUserGroupOptions opts) throws P4JavaException
IOptionsServer
deleteUserGroup
in interface IOptionsServer
group
- non-null group to be deleted.opts
- UpdateUserGroupOptions object describing optional parameters; if null, no
options are set
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.deleteUserGroup(com.perforce.p4java.core.IUserGroup, com.perforce.p4java.option.server.UpdateUserGroupOptions)
public InputStream getProtectionsTable() throws P4JavaException
IOptionsServer
getProtectionsTable
in interface IOptionsServer
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getProtectionsTable()
public List<IProtectionEntry> getProtectionEntries(boolean allUsers, String hostName, String userName, String groupName, List<IFileSpec> fileList) throws ConnectionException, RequestException, AccessException
IServer
Note that the behavior of this method is unspecified when using clashing options (e.g. having both userName and groupName set non-null). Consult the main Perforce admin documentation for semantics and usage.
Note that the annotations in the file paths will be dropped. The reason is the Perforce server 'protects' command requires a file list devoid of annotated revision specificity.
getProtectionEntries
in interface IServer
allUsers
- if true, protection lines for all users are displayed.hostName
- only protection entries that apply to the given host (IP address)
are displayed.userName
- protection lines Perforce user "userName" are displayed.groupName
- protection lines for Perforce group "groupName" are displayed.fileList
- if non-null, only those protection entries that apply to the
specified files are displayed.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request.
AccessException
- if the Perforce server denies access to the caller.IServer.getProtectionEntries(boolean, java.lang.String, java.lang.String, java.lang.String, java.util.List)
public List<IProtectionEntry> getProtectionEntries(List<IFileSpec> fileList, GetProtectionEntriesOptions opts) throws P4JavaException
IOptionsServer
Note that the behavior of this method is unspecified when using clashing options (e.g. having both userName and groupName set non-null). Consult the main Perforce admin documentation for semantics and usage.
Note that any annotations in the file paths will be ignored. The reason is the Perforce server 'protects' command requires a file list devoid of annotated revision specificity.
getProtectionEntries
in interface IOptionsServer
fileList
- if non-null, only those protection entries that apply to the
specified files are displayed.opts
- GetProtectionEntriesOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getProtectionEntries(java.util.List, com.perforce.p4java.option.server.GetProtectionEntriesOptions)
public String createProtectionEntries(List<IProtectionEntry> entryList) throws P4JavaException
IOptionsServer
Each entry in the table contains a protection mode, a group/user indicator, the group/user name, client host ID and a depot file path pattern. Users receive the highest privilege that is granted on any entry. Warning: this will overwrite the existing protections table data.
createProtectionEntries
in interface IOptionsServer
entryList
- non-null list of protection entries.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.createProtectionEntries(java.util.List)
public String updateProtectionEntries(List<IProtectionEntry> entryList) throws P4JavaException
IOptionsServer
Each entry in the table contains a protection mode, a group/user indicator, the group/user name, client host ID and a depot file path pattern. Users receive the highest privilege that is granted on any entry.
Warning: this will overwrite the existing protections table data.
updateProtectionEntries
in interface IOptionsServer
entryList
- non-null list of protection entries.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.updateProtectionEntries(java.util.List)
public List<IBranchSpecSummary> getBranchSpecs(String userName, String nameFilter, int maxReturns) throws ConnectionException, RequestException, AccessException
IServer
Note that the IBranchSpecSummary objects returned here do not have branch view specs; you must call the getBranchSpec method on a specific branch to get valid view specs for a branch.
getBranchSpecs
in interface IServer
userName
- if non-null, limit qualifying branches to those owned by the named user.nameFilter
- if non-null, limits output to branches whose name matches
the nameFilter pattern.maxReturns
- if greater than zero, limit output to the first maxReturns
number of branches.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getBranchSpecs(java.lang.String, java.lang.String, int)
public List<IBranchSpecSummary> getBranchSpecs(GetBranchSpecsOptions opts) throws P4JavaException
IOptionsServer
Note that the IBranchSpecSummary objects returned here do not have branch view specs; you must call the getBranchSpec method on a specific branch to get valid view specs for a branch.
getBranchSpecs
in interface IOptionsServer
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getBranchSpecs(com.perforce.p4java.option.server.GetBranchSpecsOptions)
public IBranchSpec getBranchSpec(String name) throws ConnectionException, RequestException, AccessException
IServer
Note that since the Perforce server usually interprets asking for a non-existent branch spec as equivalent to asking for a template for a new branch spec, you will normally always get back a result here. It is best to first use the getBranchSpecList method to see if the branch spec exists, then use this method to retrieve a specific branch spec once you know it exists.
getBranchSpec
in interface IServer
name
- non-null branch name
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getBranchSpec(java.lang.String)
public IBranchSpec getBranchSpec(String name, GetBranchSpecOptions opts) throws P4JavaException
IOptionsServer
Note that since the Perforce server usually interprets asking for a non-existent branch spec as equivalent to asking for a template for a new branch spec, you will normally always get back a result here. It is best to first use the getBranchSpecList method to see if the branch spec exists, then use this method to retrieve a specific branch spec once you know it exists.
getBranchSpec
in interface IOptionsServer
name
- non-null Perforce branch name.opts
- GetBranchSpecOptions object describing optional parameters;
if null, no options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getBranchSpec(java.lang.String, com.perforce.p4java.option.server.GetBranchSpecOptions)
public String createBranchSpec(IBranchSpec branchSpec) throws ConnectionException, RequestException, AccessException
IServer
createBranchSpec
in interface IServer
branchSpec
- non-null branch spec to be created.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.createBranchSpec(com.perforce.p4java.core.IBranchSpec)
public String updateBranchSpec(IBranchSpec branchSpec) throws ConnectionException, RequestException, AccessException
IServer
updateBranchSpec
in interface IServer
branchSpec
- non-null branch spec to be updated.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.updateBranchSpec(com.perforce.p4java.core.IBranchSpec)
public String deleteBranchSpec(String branchSpecName, boolean force) throws ConnectionException, RequestException, AccessException
IServer
deleteBranchSpec
in interface IServer
branchSpecName
- non-null branch spec nameforce
- if true, forces the deletion of any branch; normally branches
can only be deleted by their owner
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.deleteBranchSpec(java.lang.String, boolean)
public String deleteBranchSpec(String branchSpecName, DeleteBranchSpecOptions opts) throws P4JavaException
IOptionsServer
deleteBranchSpec
in interface IOptionsServer
branchSpecName
- non-null name of the branch spec to be deleted.opts
- DeleteBranchSpecOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.deleteBranchSpec(java.lang.String, com.perforce.p4java.option.server.DeleteBranchSpecOptions)
public IClient getCurrentClient()
IServer
getCurrentClient
in interface IServer
IServer.getCurrentClient()
public void setCurrentClient(IClient client)
IServer
setCurrentClient
in interface IServer
IServer.setCurrentClient(com.perforce.p4java.client.IClient)
public IClient getClient(String clientName) throws ConnectionException, RequestException, AccessException
IServer
Note that (unfortunately) some implementations cannot detect a non-existent client at this stage, and using the client returned in such circumstances may cause errors down the road.
getClient
in interface IServer
clientName
- non-null Perforce client name.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getClient(java.lang.String)
public IClient getClient(IClientSummary clientSummary) throws ConnectionException, RequestException, AccessException
IServer
getClient
in interface IServer
clientSummary
- non-null Perforce client summary object.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getClient(com.perforce.p4java.client.IClientSummary)
public IClient getClientTemplate(String clientName, boolean allowExistent) throws ConnectionException, RequestException, AccessException
IServer
getClientTemplate
in interface IServer
clientName
- non-null Perforce client name.allowExistent
- - true to return a client even if it exists
ConnectionException
- if the Perforce server is unreachable or is not connected.
RequestException
- if the Perforce server encounters an error during its
processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getClientTemplate(java.lang.String, boolean)
public IClient getClientTemplate(String clientName, GetClientTemplateOptions opts) throws P4JavaException
IOptionsServer
getClientTemplate
in interface IOptionsServer
clientName
- non-null Perforce client name.opts
- GetClientTemplateOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getClientTemplate(java.lang.String, com.perforce.p4java.option.server.GetClientTemplateOptions)
public IClient getClientTemplate(String clientName) throws ConnectionException, RequestException, AccessException
IServer
getClientTemplate
in interface IServer
clientName
- non-null Perforce client name.
ConnectionException
- if the Perforce server is unreachable or is not connected.
RequestException
- if the Perforce server encounters an error during its
processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getClientTemplate(java.lang.String)
public String createClient(IClient newClient) throws ConnectionException, RequestException, AccessException
IServer
IServer.getClient(String)
after this call in order to obtain the full
client spec as the server may fill in defaults for missing fields in the
specified newClient. This method will return a server status message and
will throw an exception if the client was not created for various
reasons. Note that the server status message may have form trigger
output appended or prepended to it.
createClient
in interface IServer
newClient
- non-null IClient defining the new Perforce client to be
created.
ConnectionException
- if the Perforce server is unreachable or is not connected.
RequestException
- if the Perforce server encounters an error during its
processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.createClient(com.perforce.p4java.client.IClient)
public String updateClient(IClient client) throws ConnectionException, RequestException, AccessException
IServer
updateClient
in interface IServer
client
- non-null IClient defining the Perforce client to be updated
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.updateClient(com.perforce.p4java.client.IClient)
public String updateClient(IClient client, boolean force) throws ConnectionException, RequestException, AccessException
IOptionsServer
updateClient
in interface IOptionsServer
client
- non-null IClient defining the Perforce client to be updatedforce
- if true, tell the server to attempt to force the update regardless of
the consequences. You're on your own with this one...
ConnectionException
RequestException
AccessException
IOptionsServer.updateClient(com.perforce.p4java.client.IClient, boolean)
public String updateClient(IClient client, UpdateClientOptions opts) throws P4JavaException
IOptionsServer
updateClient
in interface IOptionsServer
client
- non-null IClient defining the Perforce client to be updatedopts
- UpdateClientOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.updateClient(com.perforce.p4java.client.IClient, com.perforce.p4java.option.server.UpdateClientOptions)
public String deleteClient(String clientName, boolean force) throws ConnectionException, RequestException, AccessException
IServer
deleteClient
in interface IServer
clientName
- non-null name of the client to be deleted from the server.force
- if true, tell the server to attempt to force the delete regardless of
the consequences. You're on your own with this one...
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.deleteClient(java.lang.String, boolean)
public String deleteClient(String clientName, DeleteClientOptions opts) throws P4JavaException
IOptionsServer
deleteClient
in interface IOptionsServer
clientName
- non-null name of the client to be deleted from the server.opts
- DeleteClientOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.deleteClient(java.lang.String, com.perforce.p4java.option.server.DeleteClientOptions)
public String switchClientView(String templateClientName, String targetClientName, SwitchClientViewOptions opts) throws P4JavaException
IOptionsServer
switchClientView
in interface IOptionsServer
templateClientName
- non-null name of the template client who's view
will be used for the target (or current) client to switched to.targetClientName
- possibly-null name of the target client whose view
will be changed to the template client's view. If null, the
current client will be used.opts
- SwitchClientViewOptions object describing optional parameters;
if null, no options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.switchClientView(java.lang.String, java.lang.String, com.perforce.p4java.option.server.SwitchClientViewOptions)
public String switchStreamView(String streamPath, String targetClientName, SwitchClientViewOptions opts) throws P4JavaException
IOptionsServer
switchStreamView
in interface IOptionsServer
streamPath
- non-null stream's path in a stream depot, of the form //depotname/streamname
who's view will be used for the target (or current) client to
switched to.targetClientName
- possibly-null name of the target client whose view
will be changed to the stream's view. If null, the current
client will be used.opts
- SwitchClientViewOptions object describing optional parameters;
if null, no options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.switchStreamView(java.lang.String, java.lang.String, com.perforce.p4java.option.server.SwitchClientViewOptions)
public List<IDepot> getDepots() throws ConnectionException, RequestException, AccessException
IServer
getDepots
in interface IServer
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getDepots()
public IDepot getDepot(String name) throws P4JavaException
IOptionsServer
getDepot
in interface IOptionsServer
name
- non-null name of the depot to be retrieved.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getDepot(java.lang.String)
public String createDepot(IDepot newDepot) throws P4JavaException
IOptionsServer
createDepot
in interface IOptionsServer
newDepot
- non-null IDepot object representing the depot to be created.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.createDepot(com.perforce.p4java.core.IDepot)
public String deleteDepot(String name) throws P4JavaException
IOptionsServer
deleteDepot
in interface IOptionsServer
name
- non-null IDepot object representing the depot to be deleted
P4JavaException
- if any error occurs in the processing of this method.com.perforce.p4java.server.IOptionsServer#deleteDepot(com.perforce.p4java.core.IDepot)
public List<IChangelistSummary> getChangelists(int maxMostRecent, List<IFileSpec> fileSpecs, String clientName, String userName, boolean includeIntegrated, IChangelist.Type type, boolean longDesc) throws ConnectionException, RequestException, AccessException
IServer
Note that if both submittedOnly and pendingOnly are true, the results are implementation-defined.
getChangelists
in interface IServer
maxMostRecent
- if positive, restrict the list to the maxMostRecent
most recent changelists.
Implementations are free to ignore this parameter if necessary
(and return all qualifying results).fileSpecs
- if non-empty, limits the results to
changelists that affect the specified files. If the file specification
includes a revision range, limits its results to
submitted changelists that affect those particular revisions.clientName
- if non-null, restrict the results to changelists associated
with the given client.userName
- if non-null, restrict the results to changelists associated
with the given user name.includeIntegrated
- if true, also include any changelists integrated into the
specified files (if any).type
- if non-null, restrict the results to the specified changelist typelongDesc
- if true, produce a non-truncated long version of the description
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getChangelists(int, java.util.List, java.lang.String, java.lang.String, boolean, com.perforce.p4java.core.IChangelist.Type, boolean)
public List<IChangelistSummary> getChangelists(int maxMostRecent, List<IFileSpec> fileSpecs, String clientName, String userName, boolean includeIntegrated, boolean submittedOnly, boolean pendingOnly, boolean longDesc) throws ConnectionException, RequestException, AccessException
IServer
Note that if both submittedOnly and pendingOnly are true, the results are implementation-defined.
getChangelists
in interface IServer
maxMostRecent
- if positive, restrict the list to the maxMostRecent
most recent changelists.
Implementations are free to ignore this parameter if necessary
(and return all qualifying results).fileSpecs
- if non-empty, limits the results to
changelists that affect the specified files. If the file specification
includes a revision range, limits its results to
submitted changelists that affect those particular revisions.clientName
- if non-null, restrict the results to changelists associated
with the given client.userName
- if non-null, restrict the results to changelists associated
with the given user name.includeIntegrated
- if true, also include any changelists integrated into the
specified files (if any).submittedOnly
- if true, restrict the results to submitted changelists only.pendingOnly
- if true, restrict the results to pending changelists only.longDesc
- if true, produce a non-truncated long version of the description
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getChangelists(int, java.util.List, java.lang.String, java.lang.String, boolean, boolean, boolean, boolean)
public List<IChangelistSummary> getChangelists(List<IFileSpec> fileSpecs, GetChangelistsOptions opts) throws P4JavaException
IOptionsServer
getChangelists
in interface IOptionsServer
fileSpecs
- if non-empty, limits the results to
changelists that affect the specified files. If the file specification
includes a revision range, limits its results to
submitted changelists that affect those particular revisionsopts
- GetChangelistsOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this methodIOptionsServer.getChangelists(java.util.List, com.perforce.p4java.option.server.GetChangelistsOptions)
public IChangelist getChangelist(int id) throws ConnectionException, RequestException, AccessException
IServer
Corresponds fairly well to the p4 command-line command "change -o", and (like "change -o") does not include the associated changelist files (if any) in the returned changelist object -- you must use getChangelistFiles (or similar) to properly populate the changelist for submission, for example.
getChangelist
in interface IServer
id
- the Perforce changelist ID; if id is IChangelist.DEFAULT, get the default
changelist for the current client (if available)
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getChangelist(int)
public IChangelist getChangelist(int id, ChangelistOptions opts) throws P4JavaException
IOptionsServer
Corresponds fairly well to the p4 command-line command "change -o", and (like "change -o") does not include the associated changelist files (if any) in the returned changelist object -- you must use getChangelistFiles (or similar) to properly populate the changelist for submission, for example.
getChangelist
in interface IOptionsServer
id
- the Perforce changelist ID; if id is IChangelist.DEFAULT, get the default
changelist for the current client (if available)opts
- ChangelistOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this methodIOptionsServer.getChangelist(int, com.perforce.p4java.option.server.ChangelistOptions)
public String deletePendingChangelist(int id) throws ConnectionException, RequestException, AccessException
IServer
Note: any IChangelist object associated with the given changelist will no longer be valid after this operation, and using that object may cause undefined results or even global disaster -- you must ensure that the object is not used again improperly.
deletePendingChangelist
in interface IServer
id
- the ID of the Perforce pending changelist to be deleted.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.deletePendingChangelist(int)
public String deletePendingChangelist(int id, ChangelistOptions opts) throws P4JavaException
IOptionsServer
Note: any IChangelist object associated with the given changelist will no longer be valid after this operation, and using that object may cause undefined results or even global disaster -- you must ensure that the object is not used again improperly.
deletePendingChangelist
in interface IOptionsServer
id
- the ID of the Perforce pending changelist to be deleted.opts
- ChangelistOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this methodIOptionsServer.deletePendingChangelist(int, com.perforce.p4java.option.server.ChangelistOptions)
public List<IFileSpec> getChangelistFiles(int id) throws ConnectionException, RequestException, AccessException
IServer
The IFileSpec objects returned are not guaranteed to have any fields except depot path, version, and action valid.
Changelists that are pending will not have files visible through this method; you should use the client openedFiles method for retrieving files in that situation.
getChangelistFiles
in interface IServer
id
- numeric changelist identifier
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getChangelistFiles(int)
public List<IFileSpec> getShelvedFiles(int id) throws P4JavaException
IOptionsServer
getShelvedFiles
in interface IOptionsServer
id
- numeric pending changelist identifier
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getShelvedFiles(int)
public InputStream getChangelistDiffs(int id, DiffType diffType) throws ConnectionException, RequestException, AccessException
IServer
This is one of the guaranteed "live" method on this interface, and will return the diff output as it exists when called (rather than when the underlying implementation object was created). This can be an expensive method to evaluate, and can generate reams and reams (and reams) of output, so don't use it willy-nilly.
Note that unlike the corresponding command-line command, which keeps going in the face of errors by moving on to the next file (or whatever), any errors encountered in this method will cause an exception from this method at the first error, so plan accordingly....
getChangelistDiffs
in interface IServer
id
- the ID of the target changelistdiffType
- if non-null, describes which type of diff to perform.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getChangelistDiffs(int, com.perforce.p4java.core.file.DiffType)
public InputStream getChangelistDiffs(int id, GetChangelistDiffsOptions opts) throws P4JavaException
IOptionsServer
This is one of the guaranteed "live" method on this interface, and will return the diff output as it exists when called (rather than when the underlying implementation object was created). This can be an expensive method to evaluate, and can generate reams and reams (and reams) of output, so don't use it willy-nilly.
Note that unlike the corresponding command-line command, which keeps going in the face of errors by moving on to the next file (or whatever), any errors encountered in this method will cause an exception from this method at the first error, so plan accordingly....
getChangelistDiffs
in interface IOptionsServer
id
- the ID of the target changelist.opts
- GetChangelistDiffsOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getChangelistDiffs(int, com.perforce.p4java.option.server.GetChangelistDiffsOptions)
public InputStream getChangelistDiffsStream(int id, DescribeOptions options) throws ConnectionException, RequestException, AccessException
IServer
This is one of the guaranteed "live" method on this interface, and will return the diff output as it exists when called (rather than when the underlying implementation object was created). This can be an expensive method to evaluate, and can generate reams and reams (and reams) of output, so don't use it willy-nilly.
Note that unlike the corresponding command-line command, which keeps going in the face of errors by moving on to the next file (or whatever), any errors encountered in this method will cause an exception from this method at the first error, so plan accordingly....
getChangelistDiffsStream
in interface IServer
id
- the ID of the target changelistoptions
- DescribeOptions behavioural options for method.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getChangelistDiffsStream(int, com.perforce.p4java.option.server.DescribeOptions)
public Map<IFileSpec,List<IFileRevisionData>> getRevisionHistory(List<IFileSpec> fileSpecs, int maxRevs, boolean contentHistory, boolean includeInherited, boolean longOutput, boolean truncatedLongOutput) throws ConnectionException, AccessException
IServer
Behavior is undefined if both longOutput and truncatedLongOutput are true. If both are false, a short form of the description (prepared by the server) is returned.
getRevisionHistory
in interface IServer
fileSpecs
- filespecs to be processed; if null or empty,
an empty Map is returned.maxRevs
- if positive, return at most maxRev revisions for each file.includeInherited
- if true, causes inherited file history to be returned as well.longOutput
- if true, return the full descriptions associated with each revisiontruncatedLongOutput
- if true, return only the first 250 characters of each description.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the callerIServer.getRevisionHistory(java.util.List, int,
boolean, boolean, boolean, boolean)
public Map<IFileSpec,List<IFileRevisionData>> getRevisionHistory(List<IFileSpec> fileSpecs, GetRevisionHistoryOptions opts) throws P4JavaException
IOptionsServer
getRevisionHistory
in interface IOptionsServer
fileSpecs
- filespecs to be processed; if null or empty,
an empty Map is returned.opts
- GetRevisionHistoryOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getRevisionHistory(java.util.List, com.perforce.p4java.option.server.GetRevisionHistoryOptions)
public List<IFileSpec> getOpenedFiles(List<IFileSpec> fileSpecs, boolean allClients, String clientName, int maxFiles, int changeListId) throws ConnectionException, AccessException
IServer
The returned list can be modified with the other arguments as described below.
getOpenedFiles
in interface IServer
fileSpecs
- if non-empty, determine the status of the specified
files; otherwise return all qualifying files known to be openallClients
- if true, return results for all known clients rather than the
current client (if any).clientName
- if non-null, return results for the named client only.maxFiles
- if positive, return only the first maxFiles qualifying files.changeListId
- if positive, return only files associated with the given
changelist ID; if IChangelist.DEFAULT, retrieve files open
associated with the default changelist.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the callerIServer.getOpenedFiles(java.util.List, boolean, java.lang.String, int, int)
public List<IFileSpec> getOpenedFiles(List<IFileSpec> fileSpecs, OpenedFilesOptions opts) throws P4JavaException
IOptionsServer
getOpenedFiles
in interface IOptionsServer
fileSpecs
- if non-empty, determine the status of the specified
files; otherwise return all qualifying files known to be openopts
- possibly-null OpenedFilesOptions object object specifying method options.
P4JavaException
- if an error occurs processing this method and its parameters.com.perforce.p4java.server.IServer#getOpenedFiles(java.util.List, com.perforce.p4java.option.server.OpenedFilesOptions)
public InputStream getFileContents(List<IFileSpec> fileSpecs, boolean allRevs, boolean noHeaderLine) throws ConnectionException, RequestException, AccessException
IServer
If file is specified as a Perforce client workspace file name, the client view is used to find the corresponding depot file. If a file argument has a revision, then all files as of that revision are streamed. If a file argument has a revision range, then only files selected by that revision range are streamed, and the highest revision in the range is used for each file. Normally, only the head revision is printed.
The underlying input stream is not guaranteed to support mark() and skip() operations, and in some cases can be absolutely ginormously long it is also not guaranteed to be printable, and will be in the charset encoding stored in the Perforce server.
You should close the InputStreamReader after use in order to release any underlying stream-related resources. Failure to do this may lead to the proliferation of temp files or long-term memory wastage or even leaks.
Note that unlike the corresponding command-line command, which keeps going in the face of errors by moving on to the next file (or whatever), any errors encountered in this method will cause an exception from this method at the first error, so plan accordingly....
getFileContents
in interface IServer
fileSpecs
- non-null list of depot or client file specs defining files to be streamedallRevs
- if true, streams all revisions within the specific range, rather
than just the highest revision in the rangenoHeaderLine
- if true, suppresses the initial line that displays the file name
and revision for each file / revision contents
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getFileContents(java.util.List, boolean, boolean)
public InputStream getFileContents(List<IFileSpec> fileSpecs, GetFileContentsOptions opts) throws P4JavaException
IOptionsServer
If file is specified as a Perforce client workspace file name, the client view is used to find the corresponding depot file. If a file argument has a revision, then all files as of that revision are streamed. If a file argument has a revision range, then only files selected by that revision range are streamed, and the highest revision in the range is used for each file. Normally, only the head revision is printed.
The underlying input stream is not guaranteed to support mark() and skip() operations, and in some cases can be absolutely ginormously long it is also not guaranteed to be printable, and will be in the charset encoding stored in the Perforce server.
You should close the InputStreamReader after use in order to release any underlying stream-related resources. Failure to do this may lead to the proliferation of temp files or long-term memory wastage or even leaks.
Note that unlike the corresponding command-line command, which keeps going in the face of errors by moving on to the next file (or whatever), any errors encountered in this method will cause an exception from this method at the first error, so plan accordingly....
getFileContents
in interface IOptionsServer
fileSpecs
- non-null list of depot or client file specs defining files to be streamedopts
- GetFileContentsOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getFileContents(java.util.List, com.perforce.p4java.option.server.GetFileContentsOptions)
public List<IFileSpec> getDirectories(List<IFileSpec> fileSpecs, boolean clientOnly, boolean deletedOnly, boolean haveListOnly) throws ConnectionException, AccessException
IServer
getDirectories
in interface IServer
fileSpecs
- non-null list of file specificationsclientOnly
- if true, limit the returns to directories that are mapped in
the current Perforce client workspacedeletedOnly
- if true, includes directories with only deleted files.haveListOnly
- if true, lists directories of files on the 'have' list.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the callerIServer.getDirectories(java.util.List, boolean, boolean, boolean)
public List<IFileSpec> getDirectories(List<IFileSpec> fileSpecs, GetDirectoriesOptions opts) throws P4JavaException
IOptionsServer
getDirectories
in interface IOptionsServer
fileSpecs
- non-null list of file specifications.opts
- GetDirectoriesOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getDirectories(java.util.List, com.perforce.p4java.option.server.GetDirectoriesOptions)
public List<IFileSpec> getSubmittedIntegrations(List<IFileSpec> fileSpecs, String branchSpec, boolean reverseMappings) throws ConnectionException, RequestException, AccessException
IServer
getSubmittedIntegrations
in interface IServer
fileSpecs
- if null or ommitted, all qualifying depot files are used.branchSpec
- if non-null, only files integrated from the source
to target files in the branch view are shown. Qualified files
are displayed even if they were integrated without using the
branch view itself.reverseMappings
- if true,reverses the mappings in the branch view, with
the target files and source files exchanging place. This requires the
branchSpec to be non-null.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getSubmittedIntegrations(java.util.List, java.lang.String, boolean)
public List<IFileSpec> getSubmittedIntegrations(List<IFileSpec> fileSpecs, GetSubmittedIntegrationsOptions opts) throws P4JavaException
IOptionsServer
getSubmittedIntegrations
in interface IOptionsServer
fileSpecs
- if null or omitted, all qualifying depot files are used.opts
- GetSubmittedIntegrations object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getSubmittedIntegrations(java.util.List, com.perforce.p4java.option.server.GetSubmittedIntegrationsOptions)
public List<IChangelist> getInterchanges(IFileSpec fromFile, IFileSpec toFile, boolean showFiles, boolean longDesc, int maxChangelistId) throws ConnectionException, RequestException, AccessException
IServer
Note that if showFiles is true, the returned files are attached to the associated changelist, and can be retrieved using the getFiles(false) method -- and note that if you call getFiles(true) you will get a refreshed list of all files associated with the changelist, which is probably different from the list associated with the integration.
Note also that if there are no qualifying changes, this method will return an empty list rather than throw an exception; this behaviour is different to that seen with the p4 command line which will throw an exception.
getInterchanges
in interface IServer
fromFile
- non-null from-file specification.toFile
- non-null to-file specification.showFiles
- if true, show the individual files that would require integration.longDesc
- if true, return a long description in the changelist.maxChangelistId
- if greater than zero, only consider integration
history from changelists at or below the given number
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getInterchanges(com.perforce.p4java.core.file.IFileSpec, com.perforce.p4java.core.file.IFileSpec, boolean, boolean, int)
public List<IChangelist> getInterchanges(String branchSpecName, List<IFileSpec> fromFileList, List<IFileSpec> toFileList, boolean showFiles, boolean longDesc, int maxChangelistId, boolean reverseMapping, boolean biDirectional) throws ConnectionException, RequestException, AccessException
IServer
Note that if showFiles is true, the returned files are attached to the associated changelist, and can be retrieved using the getFiles(false) method -- and note that if you call getFiles(true) you will get a refreshed list of all files associated with the changelist, which is probably different from the list associated with the integration.
Note also that if there are no qualifying changes, this method will return an empty list rather than throw an exception; this behaviour is different to that seen with the p4 command line which will throw an exception.
getInterchanges
in interface IServer
branchSpecName
- non-null, non-empty branch spec name.fromFileList
- if non-null and not empty, and biDirectional is true,
use this as the from file list.toFileList
- if non-null and not empty, use this as the to file list.showFiles
- if true, show the individual files that would require integration.longDesc
- if true, return a long description in the changelist.maxChangelistId
- if greater than zero, only consider integrationreverseMapping
- if true, reverse the mappings in the branch view, with the
target files and source files exchanging place.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getInterchanges(java.lang.String, java.util.List, java.util.List, boolean, boolean, int, boolean, boolean)
public List<IChangelist> getInterchanges(IFileSpec fromFile, IFileSpec toFile, GetInterchangesOptions opts) throws P4JavaException
IOptionsServer
getInterchanges
in interface IOptionsServer
fromFile
- if non-null, use this as the from-file specification.toFile
- if non-null, use this as the to-file specification.opts
- GetInterchangesOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getInterchanges(com.perforce.p4java.core.file.IFileSpec, com.perforce.p4java.core.file.IFileSpec, com.perforce.p4java.option.server.GetInterchangesOptions)
public List<IChangelist> getInterchanges(String branchSpecName, List<IFileSpec> fromFileList, List<IFileSpec> toFileList, GetInterchangesOptions opts) throws P4JavaException
IOptionsServer
Note that depending on the specific options passed-in the fromFileList can be null or one file spec; the toFileList can be null, one or more file specs. The full semantics of this operation are found in the main 'p4 help interchanges' documentation.
getInterchanges
in interface IOptionsServer
branchSpecName
- if non-null and not empty, use this as the branch spec name.fromFileList
- if non-null and not empty, and biDirectional is true,
use this as the from file list.toFileList
- if non-null and not empty, use this as the to file list.opts
- GetInterchangesOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getInterchanges(java.lang.String, java.util.List, java.util.List, com.perforce.p4java.option.server.GetInterchangesOptions)
public List<IExtendedFileSpec> getExtendedFiles(List<IFileSpec> fileSpecs, int maxFiles, int sinceChangelist, int affectedByChangelist, FileStatOutputOptions outputOptions, FileStatAncilliaryOptions ancilliaryOptions) throws ConnectionException, AccessException
IServer
This method is not intended for general use, and is not documented in detail here; consult the main Perforce fstat command documentation for detailed help. In particular, the various options are too complex to be described in a few sentences here, and the various option arguments reflect this complexity. Note that setting both sinceChangelist and affectedByChangelist to zero or a positive value will cause usage errors from the server (these are currently intended to be mutually-exclusive options).
This method can be a real server and bandwidth resource hog, and should be used as sparingly as possible; alternatively, try to use it with as narrow a set of file specs as possible.
getExtendedFiles
in interface IServer
fileSpecs
- non-null list of Perforce file specification(s)maxFiles
- if positive, restrict the output to the first maxReturns files.
Implementations are free to ignore this parameter if necessary
(and return all qualifying results).sinceChangelist
- if larger than or equal to zero, display only files
affected since the given changelist number; zero is equivalent
to IChangelist.DEFAULT.affectedByChangelist
- if larger than or equal to zero, display only files
affected by the given changelist number; zero is equivalent
to IChangelist.DEFAULT.outputOptions
- if non-null, specifies the oputput options to be usedancilliaryOptions
- if non-null, specifies the ancilliary output options to be used
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the callerIServer.getExtendedFiles(java.util.List, int, int, int, com.perforce.p4java.core.file.FileStatOutputOptions, com.perforce.p4java.core.file.FileStatAncilliaryOptions)
public List<IExtendedFileSpec> getExtendedFiles(List<IFileSpec> fileSpecs, GetExtendedFilesOptions opts) throws P4JavaException
IOptionsServer
This method is not intended for general use, and is not documented in detail here; consult the main Perforce fstat command documentation for detailed help. This method can be a real server and bandwidth resource hog, and should be used as sparingly as possible; alternatively, try to use it with as narrow a set of file specs as possible.
getExtendedFiles
in interface IOptionsServer
fileSpecs
- non-null list of Perforce file specification(s).opts
- GetExtendedFilesOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getExtendedFiles(java.util.List, com.perforce.p4java.option.server.GetExtendedFilesOptions)
public List<String> searchJobs(String words, SearchJobsOptions opts) throws P4JavaException
IOptionsServer
Note that this is an 'undoc' Perforce command.
See also 'p4 help index'.
searchJobs
in interface IOptionsServer
words
- non-null words to be searched.opts
- SearchJobsOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.searchJobs(java.lang.String, com.perforce.p4java.option.server.SearchJobsOptions)
public List<IJob> getJobs(List<IFileSpec> fileSpecs, int maxJobs, boolean longDescriptions, boolean reverseOrder, boolean includeIntegrated, String jobView) throws ConnectionException, RequestException, AccessException
IServer
Note that this method (unlike the main file list methods) throws an exception and stops at the first encountered error.
getJobs
in interface IServer
fileSpecs
- if given, return only jobspecs affecting the given file(s)maxJobs
- if positive, return only up to maxJobs resultslongDescriptions
- if true, return full descriptions, otherwise show
only a subset (typically the first 128 characters, but
this is not guaranteed).reverseOrder
- if true, reverse the normal sort orderincludeIntegrated
- if true, include any fixes made by changelists
integrated into the specified filesjobView
- if non-null, a string in format detailed by "p4 help jobview"
used to restrict jobs to those satisfying the job view expression.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getJobs(java.util.List, int, boolean, boolean, boolean, java.lang.String)
public List<IJob> getJobs(List<IFileSpec> fileSpecs, GetJobsOptions opts) throws P4JavaException
IOptionsServer
Note that this method (unlike the main file list methods) throws an exception and stops at the first encountered error.
getJobs
in interface IOptionsServer
fileSpecs
- if given, return only jobspecs affecting the given file(s).opts
- GetJobsOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getJobs(java.util.List, com.perforce.p4java.option.server.GetJobsOptions)
public IJob getJob(String jobId) throws ConnectionException, RequestException, AccessException
IServer
getJob
in interface IServer
jobId
- non-null job Id.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getJob(java.lang.String)
public IJob createJob(Map<String,Object> fieldMap) throws ConnectionException, RequestException, AccessException
IServer
Perforce job semantics, field count and layout, etc., are to some extent free-form and specified for each server by the associated job spec (retrievable using the getJobSpec() method below), so map fields are passed to the Perforce server exactly as passed to the create method in the job's field map, so you need to know the field names and semantics given by the associated job spec. This includes setting the relevant job ID field to "new", but otherwise, no checking is done on fields in this method against the job spec (this may be added later).
createJob
in interface IServer
fieldMap
- non-null field map defining the new job in the Perforce server.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.createJob(java.util.Map)
public String updateJob(IJob job) throws ConnectionException, RequestException, AccessException
IServer
The returned string will contain whatever the Perforce server returned in response to this command; in general, if the update fails, an exception will be thrown, meaning that the returned string represents success only. There are two success states -- either the job was saved or it didn't need saving (it was the same after updating). Consumers should parse this accordingly.
updateJob
in interface IServer
job
- non-null candidate for updating.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.updateJob(com.perforce.p4java.core.IJob)
public String deleteJob(String jobId) throws ConnectionException, RequestException, AccessException
IServer
deleteJob
in interface IServer
jobId
- ID of the job to be deleted.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.deleteJob(java.lang.String)
public IJobSpec getJobSpec() throws ConnectionException, RequestException, AccessException
IServer
getJobSpec
in interface IServer
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getJobSpec()
public List<IFix> getFixList(List<IFileSpec> fileSpecs, int changeListId, String jobId, boolean includeIntegrations, int maxFixes) throws ConnectionException, RequestException, AccessException
IServer
Note that this method (unlike the main file list methods) throws an exception and stops at the first encountered error.
getFixList
in interface IServer
fileSpecs
- if given, restrict output to fixes associated with these fileschangeListId
- if positive, only fixes from the numbered changelist are listed.jobId
- if non-null, only fixes for the named job are listedincludeIntegrations
- if true, include any fixes made by changelists integrated
into the specified filesmaxFixes
- if positive, restrict the list to the first maxFixes fixes
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getFixList(java.util.List, int, java.lang.String, boolean, int)
public List<IFix> getFixes(List<IFileSpec> fileSpecs, GetFixesOptions opts) throws P4JavaException
IOptionsServer
Note that this method (unlike the main file list methods) throws an exception and stops at the first encountered error.
getFixes
in interface IOptionsServer
fileSpecs
- if given, restrict output to fixes associated with these filesopts
- FixListOptions object describing optional parameters; if null, no
options are set
P4JavaException
- if any error occurs in the processing of this method.com.perforce.p4java.server.IServer#getFixList(java.util.List, com.perforce.p4java.option.server.GetFixesOptions)
public List<IFix> fixJobs(List<String> jobIdList, int changeListId, String status, boolean delete) throws ConnectionException, RequestException, AccessException
IServer
fixJobs
in interface IServer
changeListId
- changelist numberstatus
- if non-null, use this as the new status rather than "closed"delete
- if true, delete the specified fixes
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.fixJobs(java.util.List, int, java.lang.String, boolean)
public List<IFix> fixJobs(List<String> jobIds, int changelistId, FixJobsOptions opts) throws P4JavaException
IOptionsServer
fixJobs
in interface IOptionsServer
changelistId
- changelist ID for affected changelist.opts
- FixJobsOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.com.perforce.p4java.server.IOptionsServer#fixJobs(java.util.List, com.perforce.p4java.option.server.FixJobsOptions)
public String getCounter(String counterName) throws ConnectionException, RequestException, AccessException
IServer
Note that despite their name, counters can be any value, not just a number; hence the string return value here.
getCounter
in interface IServer
counterName
- non-null counter name.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getCounter(java.lang.String)
public String getCounter(String counterName, CounterOptions opts) throws P4JavaException
IOptionsServer
Note that despite their name, counters can be any value, not just a number; hence the string return value here.
getCounter
in interface IOptionsServer
counterName
- non-null counter name.opts
- CounterOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getCounter(java.lang.String, com.perforce.p4java.option.server.CounterOptions)
public void setCounter(String counterName, String value, boolean perforceCounter) throws ConnectionException, RequestException, AccessException
setCounter
in interface IServer
ConnectionException
RequestException
AccessException
IServer.setCounter(java.lang.String, java.lang.String, boolean)
public String setCounter(String counterName, String value, CounterOptions opts) throws P4JavaException
IOptionsServer
setCounter
in interface IOptionsServer
counterName
- non-null counter name.value
- value the counter should be set to; can be null if the set operation
is an increment.opts
- CounterOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.setCounter(java.lang.String, java.lang.String, com.perforce.p4java.option.server.CounterOptions)
public void deleteCounter(String counterName, boolean perforceCounter) throws ConnectionException, RequestException, AccessException
deleteCounter
in interface IServer
ConnectionException
RequestException
AccessException
IServer.deleteCounter(java.lang.String, boolean)
public Map<String,String> getCounters() throws ConnectionException, RequestException, AccessException
IServer
getCounters
in interface IServer
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getCounters()
@Deprecated public Map<String,String> getCounters(CounterOptions opts) throws P4JavaException
getCounters(com.perforce.p4java.option.server.GetCountersOptions)
IOptionsServer
getCounters
in interface IOptionsServer
opts
- CounterOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getCounters(com.perforce.p4java.option.server.CounterOptions)
public Map<String,String> getCounters(GetCountersOptions opts) throws P4JavaException
IOptionsServer
getCounters
in interface IOptionsServer
opts
- GetCountersOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getCounters(com.perforce.p4java.option.server.GetCountersOptions)
public String getKey(String keyName) throws P4JavaException
IOptionsServer
getKey
in interface IOptionsServer
keyName
- non-null key name.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getKey(java.lang.String)
public String setKey(String KeyName, String value, KeyOptions opts) throws P4JavaException
IOptionsServer
setKey
in interface IOptionsServer
KeyName
- non-null key name.value
- value the key should be set to; can be null if the set operation
is an increment.opts
- KeyOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.setKey(java.lang.String, java.lang.String, com.perforce.p4java.option.server.KeyOptions)
public String deleteKey(String KeyName) throws P4JavaException
IOptionsServer
deleteKey
in interface IOptionsServer
KeyName
- non-null key name.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.deleteKey(java.lang.String)
public Map<String,String> getKeys(GetKeysOptions opts) throws P4JavaException
IOptionsServer
getKeys
in interface IOptionsServer
opts
- GetKeysOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getKeys(com.perforce.p4java.option.server.GetKeysOptions)
public List<IProperty> getProperty(GetPropertyOptions opts) throws P4JavaException
IOptionsServer
The -A flag require that the user have 'admin' access granted by 'p4 protect'.
Note that specifying the -n flag when using the -l flag substantially improves the performance of this command.
getProperty
in interface IOptionsServer
opts
- GetPropertyOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getProperty(com.perforce.p4java.option.server.GetPropertyOptions)
public String setProperty(String name, String value, PropertyOptions opts) throws P4JavaException
IOptionsServer
This method require that the user have 'admin' access granted by 'p4 protect'.
setProperty
in interface IOptionsServer
name
- non-null property name.value
- property value.opts
- PropertyOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.setProperty(java.lang.String, java.lang.String, com.perforce.p4java.option.server.PropertyOptions)
public String deleteProperty(String name, PropertyOptions opts) throws P4JavaException
IOptionsServer
This method require that the user have 'admin' access granted by 'p4 protect'.
deleteProperty
in interface IOptionsServer
name
- non-null property name.opts
- PropertyOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.deleteProperty(java.lang.String, com.perforce.p4java.option.server.PropertyOptions)
public List<IServerProcess> getServerProcesses() throws ConnectionException, RequestException, AccessException
IServer
getServerProcesses
in interface IServer
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getServerProcesses()
public List<IServerProcess> getServerProcesses(GetServerProcessesOptions opts) throws P4JavaException
IOptionsServer
getServerProcesses
in interface IOptionsServer
opts
- GetServerProcessesOptions object describing optional parameters;
if null, no options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getServerProcesses(com.perforce.p4java.option.server.GetServerProcessesOptions)
public InputStream getServerFileDiffs(IFileSpec file1, IFileSpec file2, String branchSpecName, DiffType diffType, boolean quiet, boolean includeNonTextDiffs, boolean gnuDiffs) throws ConnectionException, RequestException, AccessException
IServer
This method corresponds closely to the standard diff2 command, and that command's documentation should be consulted for the overall and detailed semantics. In particular, the various potentially-valid combinations of branch spec and file specs can be complicated and won't be repeated here.
As with other streams-based IServer methods, callers should ensure that the stream returned here is always explicitly closed after use; if not closed, the stream's associated temporary files managed by P4Java (if they exist) may not be properly deleted.
getServerFileDiffs
in interface IServer
file1
- optional first file IFileSpecfile2
- optional second file IFileSpecbranchSpecName
- optional branch spec namequiet
- if true, suppresses the display of the header lines of files whose
content and types are identical and suppresses the actual diff
for all files.includeNonTextDiffs
- if true, forces 'p4 diff2' to diff even files with
non-text (binary) typesgnuDiffs
- see "-u" option in the main diff2 documentation.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getServerFileDiffs(com.perforce.p4java.core.file.IFileSpec, com.perforce.p4java.core.file.IFileSpec, java.lang.String, com.perforce.p4java.core.file.DiffType, boolean, boolean, boolean)
public List<IFileDiff> getFileDiffs(IFileSpec file1, IFileSpec file2, String branchSpecName, DiffType diffType, boolean quiet, boolean includeNonTextDiffs, boolean gnuDiffs) throws ConnectionException, RequestException, AccessException
IServer
This method corresponds closely to the standard diff2 command, and that command's documentation should be consulted for the overall and detailed semantics. In particular, the various potentially-valid combinations of branch spec and file specs can be complicated and won't be repeated here.
getFileDiffs
in interface IServer
file1
- optional first file IFileSpecfile2
- optional second file IFileSpecbranchSpecName
- optional branch spec namequiet
- if true, suppresses the display of the header lines of files whose
content and types are identical and suppresses the actual diff
for all files.includeNonTextDiffs
- if true, forces 'p4 diff2' to diff even files with
non-text (binary) typesgnuDiffs
- see "-u" option in the main diff2 documentation.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getFileDiffs(com.perforce.p4java.core.file.IFileSpec, com.perforce.p4java.core.file.IFileSpec, java.lang.String, com.perforce.p4java.core.file.DiffType, boolean, boolean, boolean)
public InputStream getFileDiffsStream(IFileSpec file1, IFileSpec file2, String branchSpecName, GetFileDiffsOptions opts) throws P4JavaException
IOptionsServer
With a branch view, fromFile and toFile are optional; fromFile limits the scope of the source file set, and toFile limits the scope of the target. If only one file argument is given, it is assumed to be toFile.
This method corresponds closely to the standard diff2 command, and that command's documentation should be consulted for the overall and detailed semantics.
As with other streams-based IServer methods, callers should ensure that the stream returned here is always explicitly closed after use; if not closed, the stream's associated temporary files managed by P4Java (if they exist) may not be properly deleted.
getFileDiffsStream
in interface IOptionsServer
branchSpecName
- optional branch spec nameopts
- GetFileDiffsOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getFileDiffsStream(com.perforce.p4java.core.file.IFileSpec, com.perforce.p4java.core.file.IFileSpec, java.lang.String, com.perforce.p4java.option.server.GetFileDiffsOptions)
public List<IFileDiff> getFileDiffs(IFileSpec file1, IFileSpec file2, String branchSpecName, GetFileDiffsOptions opts) throws P4JavaException
IOptionsServer
With a branch view, fromFile and toFile are optional; fromFile limits the scope of the source file set, and toFile limits the scope of the target. If only one file argument is given, it is assumed to be toFile.
This method corresponds closely to the standard diff2 command, and that command's documentation should be consulted for the overall and detailed semantics.
getFileDiffs
in interface IOptionsServer
branchSpecName
- optional branch spec nameopts
- GetFileDiffsOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getFileDiffs(com.perforce.p4java.core.file.IFileSpec, com.perforce.p4java.core.file.IFileSpec, java.lang.String, com.perforce.p4java.option.server.GetFileDiffsOptions)
public List<IDbSchema> getDbSchema(List<String> tableSpecs) throws ConnectionException, RequestException, AccessException
IServer
See the main p4 admin command documentation for full semantics and usage details.
getDbSchema
in interface IServer
tableSpecs
- if null, return all known schema; otherwise, restrict the returned
list to the named tables and table versions.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getDbSchema(java.util.List)
public List<Map<String,Object>> getExportRecords(boolean useJournal, long maxRecs, int sourceNum, long offset, boolean format, String journalPrefix, String filter) throws ConnectionException, RequestException, AccessException
IServer
See the main p4 admin command documentation for full semantics and usage details.
getExportRecords
in interface IServer
useJournal
- if true, export journal records; otherwise, export checkpoint records.maxRecs
- if larger than zero, return only the first maxRec linessourceNum
- checkpoint or journal number.offset
- offset with in checkpoint or journal.format
- if true, formats record output appropriately for the type of data.journalPrefix
- if not null, specify a journal name prefix.filter
- if not null, pass the specified filter to the exporter.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.getExportRecords(boolean, long, int, long, boolean, java.lang.String, java.lang.String)
public List<Map<String,Object>> getExportRecords(ExportRecordsOptions opts) throws P4JavaException
IOptionsServer
See the main p4 export command documentation for full semantics and usage details.
Note that the 'skip*' options in ExportRecordsOptions are specific to P4Java only; they are not Perforce command options. These options are for field handling rules in the lower layers of P4Java. The field rules are for identifying the fields that should skip charset translation of their values; leaving their values as bytes instead of converting them to strings. Please see ExportRecordsOptions for usage details.
getExportRecords
in interface IOptionsServer
opts
- ExportRecordsOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getExportRecords(com.perforce.p4java.option.server.ExportRecordsOptions)
public void getStreamingExportRecords(ExportRecordsOptions opts, IStreamingCallback callback, int key) throws P4JavaException
IOptionsServer
The results are sent to the user using the IStreamingCallback handleResult method; see the IStreamingCallback Javadoc for details. The payload passed to handleResult is usually the raw map gathered together deep in the RPC protocol layer, and the user is assumed to have the knowledge and technology to be able to parse it and use it suitably in much the same way as a user unpacks or processes the results from the other low-level exec methods like execMapCommand.
See the main p4 export command documentation for full semantics and usage details.
Note that the 'skip*' options in ExportRecordsOptions are specific to P4Java only; they are not Perforce command options. These options are for field handling rules in the lower layers of P4Java. The field rules are for identifying the fields that should skip charset translation of their values; leaving their values as bytes instead of converting them to strings. Please see ExportRecordsOptions for usage details.
getStreamingExportRecords
in interface IOptionsServer
opts
- ExportRecordsOptions object describing optional parameters; if null, no
options are set.callback
- a non-null IStreamingCallback to be used to process the incoming
results.key
- an opaque integer key that is passed to the IStreamingCallback callback
methods to identify the action as being associated with this specific
call.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getStreamingExportRecords(com.perforce.p4java.option.server.ExportRecordsOptions, com.perforce.p4java.server.callback.IStreamingCallback, int)
public List<IDiskSpace> getDiskSpace(List<String> filesystems) throws P4JavaException
IOptionsServer
If no arguments are specified, disk space information for all relevant file systems is displayed; otherwise the output is restricted to the named filesystem(s).
filesystems: P4ROOT | P4JOURNAL | P4LOG | TEMP | journalPrefix | depot See the main 'p4 diskspace' command documentation for full semantics and usage details.
getDiskSpace
in interface IOptionsServer
filesystems
- if not null, specify a list of Perforce named filesystem(s).
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getDiskSpace(java.util.List)
public List<IFileSpec> setFileAttributes(List<IFileSpec> files, Map<String,String> attributes, SetFileAttributesOptions opts) throws P4JavaException
IOptionsServer
Note that this method only accepts String attribute values; if the attribute is intended to be binary, use the setHexValue setter on the associated SetFileAttributesOptions object and hexify the value, or, alternatively, use the stream version of this method. String input this way will be converted to bytes for the attributes before being sent to the Perforce server using the prevailing character set. If this is a problem, use hex encoding or the stream variant of this method
Note that attributes can only be removed from a file by setting the appropriate value of the name / value pair passed-in through the attributes map to null.
Note that the filespecs returned by this method, if valid, contain only the depot path and version information; no other field can be assumed to be valid. Note also that, while the p4 command line executable returns a list of results that amounts to the cross product of files and attributes, this method never returns more than one result for each file affected.
setFileAttributes
in interface IOptionsServer
files
- non-null list of files to be affectedattributes
- a non-null Map of attribute name / value pairs; if any value is null,
that attribute is removed.opts
- SetFileAttributesOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.com.perforce.p4java.server.IOptionsServer#setFileAttributes(com.perforce.p4java.option.server.SetFileAttributesOptions, java.util.Map, java.util.List)
public List<IFileSpec> setFileAttributes(List<IFileSpec> files, String attributeName, InputStream inStream, SetFileAttributesOptions opts) throws P4JavaException
IOptionsServer
This method is intended to allow for unmediated binary definitions of file attribute contents, and is typically used for things like thumbnails that are too big to be conveniently handled using hex conversion with the strings-based version of this method. Absolutely no interpretation is done on the stream -- it's bytes all the way... there is also no hard limit to the size of the stream that contains the attribute value, but the consequences on both the enclosing app and the associated Perforce server of too-large attributes may be severe. Typical 8K thumbnails are no problem at all, but something in the megabyte range or larger might be problematic at both ends.
Note that this method will leave the passed-in stream open, but (in general) the stream's read pointer will be at the end of the stream when this method returns. You are responsible for closing the stream if necessary after the call; you are also responsible for ensuring that the read pointer is where you want it to be in the stream (i.e. where you want the method to start reading the attribute value from) when you pass in the stream. I/O errors while reading the stream will be logged, but otherwise generally ignored -- you must check the actual results of this operation yourself.
Note that the server currently only supports setting file attributes using a stream for one filespec at a time, but for reasons of symmetry you must pass in a list of (one) filespec. Note that this doesn't necessarily mean only one file is affected in the depot, just that only one file spec is used to specify the affected file(s).
Note that attributes can only be removed from a file by setting the appropriate value of the name / value pair passed-in through the attributes map to null.
Note that the filespecs returned by this method, if valid, contain only the depot path and version information; no other field can be assumed to be valid. Note also that, while the p4 command line executable returns a list of results that amounts to the cross product of files and attributes, this method never returns more than one result for each file affected.
setFileAttributes
in interface IOptionsServer
files
- non-null list of files to be affected.attributeName
- the non-null name of the attribute to be set.inStream
- non-null InputStream ready for reading the attribute value from.opts
- SetFileAttributesOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if an error occurs processing this method and its parameters.com.perforce.p4java.server.IOptionsServer#setFileAttributes(com.perforce.p4java.option.server.SetFileAttributesOptions, java.io.InputStream, java.util.List)
public List<ServerConfigurationValue> showServerConfiguration(String serverName, String variableName) throws P4JavaException
IOptionsServer
Note: you must be an admin or super user for this command to work.
showServerConfiguration
in interface IOptionsServer
serverName
- if not null, only show values associated with the named server; if
equals ServerConfigurationValue.ALL_SERVERS, show values associated
with all participating servers.variableName
- if not null, only show the value of this named config variable.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.showServerConfiguration(java.lang.String, java.lang.String)
public String setServerConfigurationValue(String name, String value) throws P4JavaException
IOptionsServer
Expected variable name formats are as specified in the main Perforce documentation: [servername + #] variablename -- but this is not enforced by P4Java itself.
Note: you must be an admin or super user for this command to work.
setServerConfigurationValue
in interface IOptionsServer
name
- non-null config variable name.value
- if null, unset the named variable; otherwise, set it to the passed-in
string value.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.setServerConfigurationValue(java.lang.String, java.lang.String)
public List<IFileSize> getFileSizes(List<IFileSpec> fileSpecs, GetFileSizesOptions opts) throws P4JavaException
IOptionsServer
For specified file specification, get the depot file name, revision, file count and file size. If you use client syntax for the file specification, the view mapping is used to list the corresponding depot files.
getFileSizes
in interface IOptionsServer
fileSpecs
- filespecs to be processed; if null or empty, an empty list
is returned.opts
- GetFileSizesOptions object describing optional parameters; if null,
no options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getFileSizes(java.util.List, com.perforce.p4java.option.server.GetFileSizesOptions)
public void journalWait(JournalWaitOptions opts) throws P4JavaException
IOptionsServer
Note that this method uses a deep undoc 'p4 journalwait [-i]' command.
journalWait
in interface IOptionsServer
opts
- JournalWaitOptions object describing optional parameters;
if null, no options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.journalWait(com.perforce.p4java.option.server.JournalWaitOptions)
public boolean handleErrorStr(Map<String,Object> map) throws RequestException, AccessException
RequestException
AccessException
public IFileSpec handleFileReturn(Map<String,Object> map) throws AccessException, ConnectionException
AccessException
ConnectionException
public IFileSpec handleFileReturn(Map<String,Object> map, IClient client) throws AccessException, ConnectionException
AccessException
ConnectionException
public IFileSpec handleIntegrationFileReturn(Map<String,Object> map, IClient client) throws AccessException, ConnectionException
AccessException
ConnectionException
public IFileSpec handleIntegrationFileReturn(Map<String,Object> map, boolean ignoreInfo) throws AccessException, ConnectionException
AccessException
ConnectionException
public String handleFileErrorStr(Map<String,Object> map) throws ConnectionException, AccessException
ConnectionException
AccessException
public static String guardNull(String str)
public static String[] getPreferredPathArray(String[] preamble, List<IFileSpec> specList, boolean annotate)
public static String[] getPreferredPathArray(String[] preamble, List<IFileSpec> specList)
public static String[] populatePathArray(String[] pathArray, int start, List<IFileSpec> fileSpecList)
public Map<String,Object>[] execMapCmd(CmdSpec cmdSpec, String[] cmdArgs, Map<String,Object> inMap) throws ConnectionException, AccessException
ConnectionException
AccessException
public List<Map<String,Object>> execMapCmdList(CmdSpec cmdSpec, String[] cmdArgs, Map<String,Object> inMap) throws ConnectionException, AccessException
ConnectionException
AccessException
public InputStream execStreamCmd(CmdSpec cmdSpec, String[] cmdArgs) throws ConnectionException, RequestException, AccessException
ConnectionException
RequestException
AccessException
protected boolean isUnicode()
public String getErrorStr(Map<String,Object> map)
IOptionsServer
RPC impl errors come across the wire as a map in the form usually like this:
fmt0=Access for user '%user%' has not been enabled by 'p4 protect'., func=client-Message, user=nouser, code0=822483067Note that the code0 entry will be used to get the severity level; the fmt0 entry contains the message.
getErrorStr
in interface IOptionsServer
map
- Perforce command results map
IOptionsServer.getErrorStr(java.util.Map)
public String getErrorOrInfoStr(Map<String,Object> map)
IOptionsServer
RPC impl errors come across the wire as a map in the form usually like this:
fmt0=Access for user '%user%' has not been enabled by 'p4 protect'., func=client-Message, user=nouser, code0=822483067Note that the code0 entry will be used to get the severity level; the fmt0 entry contains the message.
getErrorOrInfoStr
in interface IOptionsServer
map
- Perforce command results map
IOptionsServer.getErrorOrInfoStr(java.util.Map)
public String getInfoStr(Map<String,Object> map)
IOptionsServer
RPC impl errors come across the wire as a map in the form usually like this:
fmt0=Access for user '%user%' has not been enabled by 'p4 protect'., func=client-Message, user=nouser, code0=822483067Note that the code0 entry will be used to get the severity level; the fmt0 entry contains the message.
getInfoStr
in interface IOptionsServer
map
- Perforce command results map
IOptionsServer.getInfoStr(java.util.Map)
public abstract boolean isAuthFail(String errStr)
public abstract boolean isLoginNotRequired(String msgStr)
public abstract boolean isInfoMessage(Map<String,Object> map)
protected abstract int getGenericCode(Map<String,Object> map)
protected abstract int getSeverityCode(Map<String,Object> map)
public abstract Map<String,Object>[] execMapCmd(String cmdName, String[] cmdArgs, Map<String,Object> inMap) throws ConnectionException, AccessException, RequestException
IServer
This method is intended for low-level commands in the spirit and format of the p4 command line interpreter, and offers a simple way to issue commands to the associated Perforce server without the overhead of the more abstract Java interfaces and methods.
No guidance is given here on the format of the returned map; however, it produces the same output as the p4 command line interpreter in -G (Python map) mode.
Note that this method does not allow you to set "usage" options for the command; these may be added later. Note also that although option arguments passed to this method must be in a form recognized by the p4 command line interpreter, that does not mean the method is being implemented by the interpreter -- the actual implementation depends on the options used to get the server object in the first place from the server factory.
execMapCmd
in interface IServer
cmdName
- the command to be issued; must be non-null, and correspond to a Perforce
command recognized by P4Java and defined in CmdSpec.cmdArgs
- the array of command arguments (options and file arguments, etc.) to be
sent to the Perforce server. These must be in the form used by the corresponding
p4 command line interpreter. Ignored if null.inMap
- an optional map to be sent to the server as standard input, using the
Python map format (-G) form. You must remember to issue the relevant
command-specific option to enable this if needed.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the caller
RequestException
- if the Perforce server encounters an error during
its processing of the requestIServer.execMapCmd(java.lang.String, java.lang.String[], java.util.Map)
public abstract List<Map<String,Object>> execMapCmdList(String cmdName, String[] cmdArgs, Map<String,Object> inMap) throws P4JavaException
IOptionsServer
This method is intended for low-level commands in the spirit and format of the p4 command line interpreter, and offers a simple way to issue commands to the associated Perforce server without the overhead of the more abstract Java interfaces and methods.
No guidance is given here on the format of the returned map; however, it produces the same output as the p4 command line interpreter in -G (Python map) mode.
Note that this method does not allow you to set "usage" options for the command; these may be added later. Note also that although option arguments passed to this method must be in a form recognized by the p4 command line interpreter, that does not mean the method is being implemented by the interpreter -- the actual implementation depends on the options used to get the server object in the first place from the server factory.
execMapCmdList
in interface IOptionsServer
cmdName
- the command to be issued; must be non-null, and correspond to a Perforce
command recognized by P4Java and defined in CmdSpec.cmdArgs
- the array of command arguments (options and file arguments, etc.) to be
sent to the Perforce server. These must be in the form used by the corresponding
p4 command line interpreter. Ignored if null.inMap
- an optional map to be sent to the server as standard input, using the
Python map format (-G) form. You must remember to issue the relevant
command-specific option to enable this if needed.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.execMapCmdList(java.lang.String, java.lang.String[], java.util.Map)
public abstract List<Map<String,Object>> execMapCmdList(String cmdName, String[] cmdArgs, Map<String,Object> inMap, IFilterCallback filterCallback) throws P4JavaException
IOptionsServer
This method is intended for low-level commands in the spirit and format of the p4 command line interpreter, and offers a simple way to issue commands to the associated Perforce server without the overhead of the more abstract Java interfaces and methods.
No guidance is given here on the format of the returned map; however, it produces the same output as the p4 command line interpreter in -G (Python map) mode.
Note that this method does not allow you to set "usage" options for the command; these may be added later. Note also that although option arguments passed to this method must be in a form recognized by the p4 command line interpreter, that does not mean the method is being implemented by the interpreter -- the actual implementation depends on the options used to get the server object in the first place from the server factory.
execMapCmdList
in interface IOptionsServer
cmdName
- the command to be issued; must be non-null, and correspond to a Perforce
command recognized by P4Java and defined in CmdSpec.cmdArgs
- the array of command arguments (options and file arguments, etc.) to be
sent to the Perforce server. These must be in the form used by the corresponding
p4 command line interpreter. Ignored if null.inMap
- an optional map to be sent to the server as standard input, using the
Python map format (-G) form. You must remember to issue the relevant
command-specific option to enable this if needed.filterCallback
- an optional filter callback to decide on skipping or keeping individual
key/value pairs as part of the results map.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.execMapCmdList(java.lang.String, java.lang.String[], java.util.Map, com.perforce.p4java.server.callback.IFilterCallback)
public abstract Map<String,Object>[] execInputStringMapCmd(String cmdName, String[] cmdArgs, String inString) throws P4JavaException
IServer
This method is intended for low-level commands in the spirit and format of the p4 command line interpreter, and offers a simple way to issue commands to the associated Perforce server without the overhead of the more abstract Java interfaces and methods.
No guidance is given here on the format of the returned map; however, it produces the same output as the p4 command line interpreter in -G (Python map) mode.
Note that this method does not allow you to set "usage" options for the command; these may be added later. Note also that although option arguments passed to this method must be in a form recognized by the p4 command line interpreter, that does not mean the method is being implemented by the interpreter -- the actual implementation depends on the options used to get the server object in the first place from the server factory.
execInputStringMapCmd
in interface IServer
cmdName
- the command to be issued; must be non-null, and correspond to a Perforce
command recognized by P4Java and defined in CmdSpec.cmdArgs
- the array of command arguments (options and file arguments, etc.) to be
sent to the Perforce server. These must be in the form used by the corresponding
p4 command line interpreter. Ignored if null.inString
- an optional string to be sent to the server as standard input unchanged
(this must be in the format expected by the server, typically as required
when using the "-i" flag to the p4 command line app for the same command).
You must remember to issue the relevant
command-specific option to enable this if needed.
P4JavaException
- if an error occurs processing this method and its parametersIServer.execInputStringMapCmd(java.lang.String, java.lang.String[], java.lang.String)
public abstract List<Map<String,Object>> execInputStringMapCmdList(String cmdName, String[] cmdArgs, String inString) throws P4JavaException
IOptionsServer
This method is intended for low-level commands in the spirit and format of the p4 command line interpreter, and offers a simple way to issue commands to the associated Perforce server without the overhead of the more abstract Java interfaces and methods.
No guidance is given here on the format of the returned map; however, it produces the same output as the p4 command line interpreter in -G (Python map) mode.
Note that this method does not allow you to set "usage" options for the command; these may be added later. Note also that although option arguments passed to this method must be in a form recognized by the p4 command line interpreter, that does not mean the method is being implemented by the interpreter -- the actual implementation depends on the options used to get the server object in the first place from the server factory.
execInputStringMapCmdList
in interface IOptionsServer
cmdName
- the command to be issued; must be non-null, and correspond to a Perforce
command recognized by P4Java and defined in CmdSpec.cmdArgs
- the array of command arguments (options and file arguments, etc.) to be
sent to the Perforce server. These must be in the form used by the corresponding
p4 command line interpreter. Ignored if null.inString
- an optional string to be sent to the server as standard input unchanged
(this must be in the format expected by the server, typically as required
when using the "-i" flag to the p4 command line app for the same command).
You must remember to issue the relevant
command-specific option to enable this if needed.
P4JavaException
- if an error occurs processing this method and its parametersIOptionsServer.execInputStringMapCmdList(java.lang.String, java.lang.String[], java.lang.String)
public abstract List<Map<String,Object>> execInputStringMapCmdList(String cmdName, String[] cmdArgs, String inString, IFilterCallback filterCallback) throws P4JavaException
IOptionsServer
This method is intended for low-level commands in the spirit and format of the p4 command line interpreter, and offers a simple way to issue commands to the associated Perforce server without the overhead of the more abstract Java interfaces and methods.
No guidance is given here on the format of the returned map; however, it produces the same output as the p4 command line interpreter in -G (Python map) mode.
Note that this method does not allow you to set "usage" options for the command; these may be added later. Note also that although option arguments passed to this method must be in a form recognized by the p4 command line interpreter, that does not mean the method is being implemented by the interpreter -- the actual implementation depends on the options used to get the server object in the first place from the server factory.
execInputStringMapCmdList
in interface IOptionsServer
cmdName
- the command to be issued; must be non-null, and correspond to a Perforce
command recognized by P4Java and defined in CmdSpec.cmdArgs
- the array of command arguments (options and file arguments, etc.) to be
sent to the Perforce server. These must be in the form used by the corresponding
p4 command line interpreter. Ignored if null.inString
- an optional string to be sent to the server as standard input unchanged
(this must be in the format expected by the server, typically as required
when using the "-i" flag to the p4 command line app for the same command).
You must remember to issue the relevant
command-specific option to enable this if needed.filterCallback
- an optional filter callback to decide on skipping or keeping individual
key/value pairs as part of the results map.
P4JavaException
- if an error occurs processing this method and its parametersIOptionsServer.execInputStringMapCmdList(java.lang.String, java.lang.String[], java.lang.String, com.perforce.p4java.server.callback.IFilterCallback)
public abstract Map<String,Object>[] execQuietMapCmd(String cmdName, String[] cmdArgs, Map<String,Object> inMap) throws ConnectionException, RequestException, AccessException
IServer
Basically equivalent to execMapCmd with temporary disabling of any ICommandCallback calls and / or listeners; this turns out to be useful for various reasons we won't go into here...
execQuietMapCmd
in interface IServer
cmdName
- the command to be issued; must be non-null, and correspond to a Perforce
command recognized by P4Java and defined in CmdSpec.cmdArgs
- the array of command arguments (options and file arguments, etc.) to be
sent to the Perforce server. These must be in the form used by the corresponding
p4 command line interpreter. Ignored if null.inMap
- an optional map to be sent to the server as standard input, using the
Python map format (-G) form. You must remember to issue the relevant
command-specific option to enable this if needed.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.execQuietMapCmd(java.lang.String, java.lang.String[], java.util.Map)
public abstract List<Map<String,Object>> execQuietMapCmdList(String cmdName, String[] cmdArgs, Map<String,Object> inMap) throws P4JavaException
IOptionsServer
Basically equivalent to execMapCmd with temporary disabling of any ICommandCallback calls and / or listeners; this turns out to be useful for various reasons we won't go into here...
execQuietMapCmdList
in interface IOptionsServer
cmdName
- the command to be issued; must be non-null, and correspond to a Perforce
command recognized by P4Java and defined in CmdSpec.cmdArgs
- the array of command arguments (options and file arguments, etc.) to be
sent to the Perforce server. These must be in the form used by the corresponding
p4 command line interpreter. Ignored if null.inMap
- an optional map to be sent to the server as standard input, using the
Python map format (-G) form. You must remember to issue the relevant
command-specific option to enable this if needed.
P4JavaException
- if an error occurs processing this method and its parametersIOptionsServer.execQuietMapCmdList(java.lang.String, java.lang.String[], java.util.Map)
public abstract InputStream execStreamCmd(String cmdName, String[] cmdArgs) throws ConnectionException, RequestException, AccessException
IServer
This method is intended for low-level commands in the spirit and format of the p4 command line interpreter, and offers a simple way to issue commands to the associated Perforce server without the overhead of the more abstract Java interfaces and methods.
Note that this method is intended for things like getting file contents, and may have unpredictable results on commands not originally expected to return i/o streams.
Note that this method does not allow you to set "usage" options for the command; these may be added later. Note also that although option arguments passed to this method must be in a form recognized by P4Java (as defined by the CmdSpec enum), that does not mean the method is being implemented by the interpreter -- the actual implementation depends on the options used to get the server object in the first place from the server factory.
execStreamCmd
in interface IServer
cmdName
- the command to be issued; must be non-null, and correspond to a Perforce
command recognized by P4Java and defined in CmdSpec.cmdArgs
- the array of command arguments (options and file arguments, etc.) to be
sent to the Perforce server. These must be in the form used by the corresponding
p4 command line interpreter. Ignored if null.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.execStreamCmd(java.lang.String, java.lang.String[])
public abstract InputStream execStreamCmd(String cmdName, String[] cmdArgs, Map<String,Object> inMap) throws P4JavaException
IOptionsServer
This method is intended for low-level commands in the spirit and format of the p4 command line interpreter, and offers a simple way to issue commands to the associated Perforce server without the overhead of the more abstract Java interfaces and methods.
Note that this method is intended for things like getting file contents, and may have unpredictable results on commands not originally expected to return i/o streams.
Note that this method does not allow you to set "usage" options for the command; these may be added later. Note also that although option arguments passed to this method must be in a form recognized by P4Java (as defined by the CmdSpec enum), that does not mean the method is being implemented by the interpreter -- the actual implementation depends on the options used to get the server object in the first place from the server factory.
execStreamCmd
in interface IOptionsServer
cmdName
- the command to be issued; must be non-null, and correspond to a Perforce
command recognized by P4Java and defined in CmdSpec.cmdArgs
- the array of command arguments (options and file arguments, etc.) to be
sent to the Perforce server. These must be in the form used by the corresponding
p4 command line interpreter. Ignored if null.inMap
- an optional map to be sent to the server as standard input, using the
Python map format (-G) form. You must remember to issue the relevant
command-specific option to enable this if needed.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the caller
P4JavaException
IOptionsServer.execStreamCmd(java.lang.String, java.lang.String[], java.util.Map)
public abstract InputStream execInputStringStreamCmd(String cmdName, String[] cmdArgs, String inString) throws P4JavaException
IOptionsServer
This method is intended for low-level commands in the spirit and format of the p4 command line interpreter, and offers a simple way to issue commands to the associated Perforce server without the overhead of the more abstract Java interfaces and methods.
Note that this method is intended for things like getting file contents, and may have unpredictable results on commands not originally expected to return i/o streams.
Note that this method does not allow you to set "usage" options for the command; these may be added later. Note also that although option arguments passed to this method must be in a form recognized by the p4 command line interpreter, that does not mean the method is being implemented by the interpreter -- the actual implementation depends on the options used to get the server object in the first place from the server factory.
execInputStringStreamCmd
in interface IOptionsServer
cmdName
- the command to be issued; must be non-null, and correspond to a Perforce
command recognized by P4Java and defined in CmdSpec.cmdArgs
- the array of command arguments (options and file arguments, etc.) to be
sent to the Perforce server. These must be in the form used by the corresponding
p4 command line interpreter. Ignored if null.inString
- an optional string to be sent to the server as standard input unchanged
(this must be in the format expected by the server, typically as required
when using the "-i" flag to the p4 command line app for the same command).
You must remember to issue the relevant
command-specific option to enable this if needed.
P4JavaException
- if an error occurs processing this method and its parameterscom.perforce.p4java.server.IOptionsServer#execInputStringStreamCmd(java.lang.String, java.lang.String)
public abstract InputStream execQuietStreamCmd(String cmdName, String[] cmdArgs) throws ConnectionException, RequestException, AccessException
IServer
Basically equivalent to execStreamCmd with temporary disabling of any ICommandCallback calls and / or listeners; this turns out to be useful for various reasons we won't go into here...
execQuietStreamCmd
in interface IServer
cmdName
- the command to be issued; must be non-null, and correspond to a Perforce
command recognized by P4Java and defined in CmdSpec.cmdArgs
- the array of command arguments (options and file arguments, etc.) to be
sent to the Perforce server. These must be in the form used by the corresponding
p4 command line interpreter. Ignored if null.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIServer.execQuietStreamCmd(java.lang.String, java.lang.String[])
public abstract void execStreamingMapCommand(String cmdName, String[] cmdArgs, Map<String,Object> inMap, IStreamingCallback callback, int key) throws P4JavaException
IServer
Streaming commands allow users to get each result from a suitably-issued command as it comes in from the server, rather than waiting for the entire command method to complete (and getting the results back as a completed List or Map or whatever).
The results are sent to the user using the IStreamingCallback handleResult method; see the IStreamingCallback Javadoc for details. The payload passed to handleResult is usually the raw map gathered together deep in the RPC protocol layer, and the user is assumed to have the knowledge and technology to be able to parse it and use it suitably in much the same way as a user unpacks or processes the results from the other low-level exec methods like execMapCommand.
NOTE: 'streaming' here has nothing at all to do with Perforce 'streams', which are (or will be) implemented elsewhere.
execStreamingMapCommand
in interface IServer
cmdName
- the command to be issued; must be non-null, and correspond to a Perforce
command recognized by P4Java and defined in CmdSpec.cmdArgs
- the array of command arguments (options and file arguments, etc.) to be
sent to the Perforce server. These must be in the form used by the corresponding
p4 command line interpreter. Ignored if null.inMap
- an optional map to be sent to the server as standard input, using the
Python map format (-G) form. You must remember to issue the relevant
command-specific option to enable this if needed.callback
- a non-null IStreamingCallback to be used to process the incoming
results.key
- an opaque integer key that is passed to the IStreamingCallback callback
methods to identify the action as being associated with this specific
call.
P4JavaException
- if an error occurs processing this method and its parameters.IServer.execStreamingMapCommand(java.lang.String, java.lang.String[], java.util.Map, com.perforce.p4java.server.callback.IStreamingCallback, int)
@Deprecated public abstract void execInputStringStreamingMapComd(String cmdName, String[] cmdArgs, String inString, IStreamingCallback callback, int key) throws P4JavaException
execInputStringStreamingMapCmd(java.lang.String, java.lang.String[], java.lang.String, com.perforce.p4java.server.callback.IStreamingCallback, int)
IServer
Streaming commands allow users to get each result from a suitably-issued command as it comes in from the server, rather than waiting for the entire command method to complete (and getting the results back as a completed List or Map or whatever).
The results are sent to the user using the IStreamingCallback handleResult method; see the IStreamingCallback Javadoc for details. The payload passed to handleResult is usually the raw map gathered together deep in the RPC protocol layer, and the user is assumed to have the knowledge and technology to be able to parse it and use it suitably in much the same way as a user unpacks or processes the results from the other low-level exec methods like execMapCommand.
NOTE: 'streaming' here has nothing at all to do with Perforce 'streams', which are (or will be) implemented elsewhere.
execInputStringStreamingMapComd
in interface IServer
cmdName
- the command to be issued; must be non-null, and correspond to a Perforce
command recognized by P4Java and defined in CmdSpec.cmdArgs
- the array of command arguments (options and file arguments, etc.) to be
sent to the Perforce server. These must be in the form used by the corresponding
p4 command line interpreter. Ignored if null.inString
- an optional string to be sent to the server as standard input unchanged
(this must be in the format expected by the server, typically as required
when using the "-i" flag to the p4 command line app for the same command).
You must remember to issue the relevant
command-specific option to enable this if needed.callback
- a non-null IStreamingCallback to be used to process the incoming
results.key
- an opaque integer key that is passed to the IStreamingCallback callback
methods to identify the action as being associated with this specific
call.
P4JavaException
- if an error occurs processing this method and its parameters.IServer.execInputStringStreamingMapComd(java.lang.String, java.lang.String[], java.lang.String, com.perforce.p4java.server.callback.IStreamingCallback, int)
public abstract void execInputStringStreamingMapCmd(String cmdName, String[] cmdArgs, String inString, IStreamingCallback callback, int key) throws P4JavaException
IOptionsServer
Streaming commands allow users to get each result from a suitably-issued command as it comes in from the server, rather than waiting for the entire command method to complete (and getting the results back as a completed List or Map or whatever).
The results are sent to the user using the IStreamingCallback handleResult method; see the IStreamingCallback Javadoc for details. The payload passed to handleResult is usually the raw map gathered together deep in the RPC protocol layer, and the user is assumed to have the knowledge and technology to be able to parse it and use it suitably in much the same way as a user unpacks or processes the results from the other low-level exec methods like execMapCommand.
NOTE: 'streaming' here has nothing at all to do with Perforce 'streams', which are (or will be) implemented elsewhere.
execInputStringStreamingMapCmd
in interface IOptionsServer
cmdName
- the command to be issued; must be non-null, and correspond to a Perforce
command recognized by P4Java and defined in CmdSpec.cmdArgs
- the array of command arguments (options and file arguments, etc.) to be
sent to the Perforce server. These must be in the form used by the corresponding
p4 command line interpreter. Ignored if null.inString
- an optional string to be sent to the server as standard input unchanged
(this must be in the format expected by the server, typically as required
when using the "-i" flag to the p4 command line app for the same command).
You must remember to issue the relevant
command-specific option to enable this if needed.callback
- a non-null IStreamingCallback to be used to process the incoming
results.key
- an opaque integer key that is passed to the IStreamingCallback callback
methods to identify the action as being associated with this specific
call.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.execInputStringStreamingMapCmd(java.lang.String, java.lang.String[], java.lang.String, com.perforce.p4java.server.callback.IStreamingCallback, int)
public abstract void setAuthTicket(String userName, String authTicket)
IOptionsServer
setAuthTicket
in interface IOptionsServer
userName
- non-null Perforce user nameauthTicket
- possibly-null Perforce authentication ticketIOptionsServer.setAuthTicket(java.lang.String, java.lang.String)
public abstract String getAuthTicket(String userName)
IOptionsServer
getAuthTicket
in interface IOptionsServer
userName
- non-null Perforce user name
IOptionsServer.getAuthTicket(java.lang.String)
public abstract void setTicketsFilePath(String ticketsFilePath)
IOptionsServer
setTicketsFilePath
in interface IOptionsServer
ticketsFilePath
- non-null Perforce auth tickets file pathIOptionsServer.setTicketsFilePath(java.lang.String)
public abstract String getTicketsFilePath()
IOptionsServer
getTicketsFilePath
in interface IOptionsServer
IOptionsServer.getTicketsFilePath()
public abstract void setTrustFilePath(String trustFilePath)
IOptionsServer
setTrustFilePath
in interface IOptionsServer
trustFilePath
- non-null Perforce trust file pathIOptionsServer.setTrustFilePath(java.lang.String)
public abstract String getTrustFilePath()
IOptionsServer
getTrustFilePath
in interface IOptionsServer
IOptionsServer.getTrustFilePath()
public abstract String getTrust() throws P4JavaException
IOptionsServer
Note that this fingerprint is generated from the connection, it may not be the same as the one (if any) stored in the trust file.
getTrust
in interface IOptionsServer
P4JavaException
- if an error occurs processing this method and its
parameters.IOptionsServer.getTrust()
public abstract String addTrust(TrustOptions opts) throws P4JavaException
IOptionsServer
Note that an exception would be thrown if there is an identity change detected. If you want to trust the new key use the 'force' option.
addTrust
in interface IOptionsServer
opts
- TrustOptions object describing optional parameters; if null,
no options are set.
P4JavaException
- if an error occurs processing this method and its
parameters.IOptionsServer.addTrust(com.perforce.p4java.option.server.TrustOptions)
public abstract String addTrust(String fingerprintValue) throws P4JavaException
IOptionsServer
addTrust
in interface IOptionsServer
fingerprintValue
- non-null fingerprint value to be added.
P4JavaException
- if an error occurs processing this method and its
parameters.IOptionsServer.addTrust(java.lang.String)
public abstract String addTrust(String fingerprintValue, TrustOptions opts) throws P4JavaException
IOptionsServer
addTrust
in interface IOptionsServer
fingerprintValue
- non-null fingerprint value to be added.opts
- TrustOptions object describing optional parameters; if null,
no options are set.
P4JavaException
- if an error occurs processing this method and its
parameters.IOptionsServer.addTrust(java.lang.String, com.perforce.p4java.option.server.TrustOptions)
public abstract String removeTrust() throws P4JavaException
IOptionsServer
removeTrust
in interface IOptionsServer
P4JavaException
- if an error occurs processing this method and its
parameters.IOptionsServer.removeTrust()
public abstract String removeTrust(TrustOptions opts) throws P4JavaException
IOptionsServer
removeTrust
in interface IOptionsServer
opts
- TrustOptions object describing optional parameters; if null,
no options are set.
P4JavaException
- if an error occurs processing this method and its
parameters.IOptionsServer.removeTrust(com.perforce.p4java.option.server.TrustOptions)
public abstract List<Fingerprint> getTrusts() throws P4JavaException
IOptionsServer
getTrusts
in interface IOptionsServer
P4JavaException
- if an error occurs processing this method and its
parameters.IOptionsServer.getTrusts()
public abstract List<Fingerprint> getTrusts(TrustOptions opts) throws P4JavaException
IOptionsServer
getTrusts
in interface IOptionsServer
opts
- TrustOptions object describing optional parameters; if null,
no options are set.
P4JavaException
- if an error occurs processing this method and its
parameters.IOptionsServer.getTrusts(com.perforce.p4java.option.server.TrustOptions)
protected boolean isSecure()
protected void setSecure(boolean secure)
public String getClientName()
public String getWorkingDirectory()
IServer
getWorkingDirectory
in interface IServer
public void setWorkingDirectory(String dirPath)
IServer
Note: no checking is done at call time for correctness (or otherwise) of the passed-in path.
setWorkingDirectory
in interface IServer
dirPath
- absolute path of directory to be used, or nullpublic void setClientName(String clientName)
protected int getServerVersion() throws ConnectionException
ConnectionException
protected String getInfoServerAddress()
protected int parseVersionString(String versionString)
protected int getRandomInt()
public static boolean isRunningOnWindows()
protected String getDefaultP4TicketsFile()
protected String getDefaultP4TrustFile()
protected List<IChangelist> processInterchangeMaps(List<Map<String,Object>> resultMaps, boolean showFiles) throws ConnectionException, AccessException, RequestException
ConnectionException
AccessException
RequestException
protected boolean isDontWriteTicket(String cmd, String[] cmdArgs)
public List<IFileLineMatch> getMatchingLines(List<IFileSpec> fileSpecs, String pattern, MatchingLinesOptions options) throws P4JavaException
IOptionsServer
getMatchingLines
in interface IOptionsServer
fileSpecs
- file specs to search for matching linespattern
- non-null string pattern to be passed to the grep commandoptions
- - Options to grep command
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getMatchingLines(java.util.List, java.lang.String, com.perforce.p4java.option.server.MatchingLinesOptions)
public List<IFileLineMatch> getMatchingLines(List<IFileSpec> fileSpecs, String pattern, List<String> infoLines, MatchingLinesOptions options) throws P4JavaException
IOptionsServer
This method allows the user to retrieve useful info and warning message lines the Perforce server may generate in response to things like encountering a too-long line, etc., by passing in a non-null infoLines parameter.
getMatchingLines
in interface IOptionsServer
fileSpecs
- file specs to search for matching linespattern
- non-null string pattern to be passed to the grep commandinfoLines
- if not null, any "info" lines returned from the server
(i.e. warnings about exceeded line lengths, etc.) will be put
into the passed-in list in the order they are received.options
- - Options to grep command
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getMatchingLines(java.util.List, java.lang.String, java.util.List, com.perforce.p4java.option.server.MatchingLinesOptions)
public List<IObliterateResult> obliterateFiles(List<IFileSpec> fileSpecs, ObliterateFilesOptions opts) throws P4JavaException
IOptionsServer
Obliterate retrieves the disk space used by the obliterated files in the archive and clears the files from the metadata that is maintained by the server. Files in client workspaces are not physically affected, but they are no longer under Perforce control.
By default, obliterate displays a preview of the results. To execute the operation, you must specify the -y flag (opts.executeObliterate). Obliterate requires 'admin' access, which is granted by 'p4 protect'.
The "obliterate" command returns an IOblterateResult for each file passed into the command. Each IObliterateResult object contains a summary of various types of records deleted (or added) and a non-null list of returned filespecs have the equivalent of purgeFile and purgeRev output in the depotPath and endRevision fileds of the associated filespecs, and that no other file spec fields are valid. Sometimes, the server doesn't return any "purgeFile" and "purgeRev" values.
Note: error and info messages are stored in filespec objects.
obliterateFiles
in interface IOptionsServer
fileSpecs
- non-null list of files to be obliteratedopts
- possibly-null ObliterateFilesOptions object specifying method options.
P4JavaException
- if an error occurs processing this method and its parametersIOptionsServer.obliterateFiles(java.util.List, com.perforce.p4java.option.server.ObliterateFilesOptions)
public List<IStreamSummary> getStreams(List<String> streamPaths, GetStreamsOptions opts) throws P4JavaException
IOptionsServer
Note that the IStreamSummary objects returned here do not have stream paths. You must call the getStream method on a specific stream to get valid paths for a stream.
getStreams
in interface IOptionsServer
streamPaths
- if specified, the list of streams is limited to those
matching the supplied list of stream paths, of the form //depotname/streamname
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getStreams(java.util.List streamPaths, com.perforce.p4java.option.server.GetStreamsOptions)
public String createStream(IStream stream) throws P4JavaException
IOptionsServer
createStream
in interface IOptionsServer
stream
- non-null IStream object representing the stream to be created.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.createStream(com.perforce.p4java.core.IStream)
public IStream getStream(String streamPath) throws P4JavaException
IOptionsServer
getStream
in interface IOptionsServer
streamPath
- non-null stream's path in a stream depot, of the form //depotname/streamname
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getStream(java.lang.String)
public IStream getStream(String streamPath, GetStreamOptions opts) throws P4JavaException
IOptionsServer
getStream
in interface IOptionsServer
streamPath
- non-null stream's path in a stream depot, of the form //depotname/streamnameopts
- GetStreamOptions object describing optional parameters;
if null, no options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getStream(java.lang.String, com.perforce.p4java.option.server.GetStreamOptions)
public String updateStream(IStream stream, StreamOptions opts) throws P4JavaException
IOptionsServer
updateStream
in interface IOptionsServer
stream
- non-null stream spec to be updated.opts
- StreamOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.com.perforce.p4java.server.IOptioinsServer#updateStream(com.perforce.p4java.core.IStream, com.perforce.p4java.option.server.StreamOptions)
public String deleteStream(String streamPath, StreamOptions opts) throws P4JavaException
IOptionsServer
deleteStream
in interface IOptionsServer
streamPath
- non-null stream's path in a stream depot, of the form //depotname/streamnameopts
- StreamOptions object describing optional parameters; if null, no
options are set.
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.deleteStream(java.lang.String, com.perforce.p4java.option.server.StreamOptions)
public IStreamIntegrationStatus getStreamIntegrationStatus(String stream, StreamIntegrationStatusOptions opts) throws P4JavaException
IOptionsServer
Pending integrations are shown only if they are expected by the stream; that is, only if they are warranted by the stream's type and its fromParent/toParent flow options. (See 'p4 help stream'.)
getStreamIntegrationStatus
in interface IOptionsServer
stream
- the stream's path in a stream depot, of the form //depotname/streamname.opts
- StreamIntegrationStatusOptions object describing optional parameters;
if null, no options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getStreamIntegrationStatus(java.lang.String, com.perforce.p4java.option.server.StreamIntegrationStatusOptions)
public ILogTail getLogTail(LogTailOptions opts) throws P4JavaException
IOptionsServer
The data is returned in the tagged field 'data', in blocks of the size specified by the blocksize parameter. The 'offset' field contains the start of the next block, which can be used with -s to request the next batch of error log data.
Note that this command requires that the user be an operator or have 'super' access, which is granted by 'p4 protect'.
getLogTail
in interface IOptionsServer
opts
- LogTailOptions object describing optional parameters;
if null, no options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.getLogTail(com.perforce.p4java.option.server.LogTailOptions)
public List<IFileSpec> duplicateRevisions(IFileSpec fromFile, IFileSpec toFile, DuplicateRevisionsOptions opts) throws P4JavaException
IOptionsServer
Duplicate revisions as if they always existed. All aspects of the source revisions are mirrored to the target revisions, including changelist number, date, attributes, and contents. The target revision must not already exist and the target file must not be opened (for any operation) on any client.
Note that integration records are duplicated as well. 'p4 duplicate' followed by a 'p4 obliterate' (of the source revisions) is in effect a deep rename operation, with any source revision in client workspace or labels forgotten. The full semantics of this operation are found in the main 'p4 help duplicate' documentation.
duplicateRevisions
in interface IOptionsServer
fromFile
- non-null source file.toFile
- non-null target file.opts
- possibly-null CopyFilesOptions object specifying method options.
P4JavaException
- if an error occurs processing this method and its parameters.com.perforce.p4java.server.IOptionsServer#duplicateRevisions(com.perforce.p4java.core.file.IFileSpec, com.perforce.p4java.core.file.IFileSpec, com.perforce.p4java.option.DuplicateRevisionsOptions)
public String unload(UnloadOptions opts) throws P4JavaException
IOptionsServer
Note that by default, users can only unload their own clients or labels. The -f flag requires 'admin' access, which is granted by 'p4 protect'. The full semantics of this operation are found in the main 'p4 help unload' documentation.
unload
in interface IOptionsServer
opts
- possibly-null UnloadOptions object specifying method options.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.unload(com.perforce.p4java.option.server.UnloadOptions)
public String reload(ReloadOptions opts) throws P4JavaException
IOptionsServer
Note that by default, users can only unload their own clients or labels. The -f flag requires 'admin' access, which is granted by 'p4 protect'. The full semantics of this operation are found in the main 'p4 help unload' documentation.
reload
in interface IOptionsServer
opts
- possibly-null ReloadOptions object specifying method options.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.reload(com.perforce.p4java.option.server.ReloadOptions)
public InputStream getTriggersTable() throws P4JavaException
IOptionsServer
This method require that the user have 'super' access granted by 'p4 protect'.
getTriggersTable
in interface IOptionsServer
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getTriggersTable()
public List<ITriggerEntry> getTriggerEntries() throws P4JavaException
IOptionsServer
This method require that the user have 'super' access granted by 'p4 protect'.
getTriggerEntries
in interface IOptionsServer
P4JavaException
- if any error occurs in the processing of this method.IOptionsServer.getTriggerEntries()
public String createTriggerEntries(List<ITriggerEntry> entryList) throws P4JavaException
IOptionsServer
This method require that the user have 'super' access granted by 'p4 protect'.
Warning: this will overwrite the existing triggers table data.
createTriggerEntries
in interface IOptionsServer
entryList
- non-null list of trigger entries.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.createTriggerEntries(java.util.List)
public String updateTriggerEntries(List<ITriggerEntry> entryList) throws P4JavaException
IOptionsServer
This method require that the user have 'super' access granted by 'p4 protect'.
Warning: this will overwrite the existing triggers table data.
updateTriggerEntries
in interface IOptionsServer
entryList
- non-null list of trigger entries.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.updateTriggerEntries(java.util.List)
public List<IExtendedFileSpec> verifyFiles(List<IFileSpec> fileSpecs, VerifyFilesOptions opts) throws P4JavaException
IOptionsServer
This method require that the user be an operator or have 'admin' access, which is granted by 'p4 protect'.
verifyFiles
in interface IOptionsServer
fileSpecs
- filespecs to be processed; if null or empty, an empty list
is returned.opts
- VerifyFilesOptions object describing optional parameters; if null,
no options are set.
P4JavaException
- if an error occurs processing this method and its parameters.IOptionsServer.verifyFiles(java.util.List, com.perforce.p4java.option.server.VerifyFilesOptions)
public ISSOCallback getSSOCallback()
public String getSSOKey()
public UsageOptions getUsageOptions()
IOptionsServer
getUsageOptions
in interface IOptionsServer
public Server setUsageOptions(UsageOptions usageOptions)
IOptionsServer
setUsageOptions
in interface IOptionsServer
usageOptions
- non-null UsageOptions object to associate with this server.
public boolean isNonCheckedSyncs()
public void setNonCheckedSyncs(boolean nonCheckedSyncs)
public boolean isEnableTracking()
public void setEnableTracking(boolean enableTracking)
public boolean isEnableProgress()
public void setEnableProgress(boolean enableProgress)
public boolean isQuietMode()
public void setQuietMode(boolean quietMode)
public String getIgnoreFileName()
public void setIgnoreFileName(String ignoreFileName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |