|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IOptionsServer
An extension of the basic IServer interface to provide Options object-based method access to Perforce server functionality and objects.
Note that unless otherwise noted, individual method options objects can be null; if they're null, the individual method Javadoc will spell out what default options apply (if any) in that case.
Note that in individual method Javadoc comments below, all method "throws" clauses are assumed to throw the normal complement of RequestException, ConnectionException, and AccessException with their usual semantics unless otherwise noted. The three standard P4JavaException classes and the broad causes for their being thrown are:
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.
| Method Summary | |
|---|---|
String |
createDepot(IDepot newDepot)
Create a new depot in the repository. |
String |
createUser(IUser user,
UpdateUserOptions opts)
Create a new Perforce user on the Perforce server. |
String |
createUserGroup(IUserGroup group,
UpdateUserGroupOptions opts)
Create a new Perforce user group on the Perforce server. |
String |
deleteBranchSpec(String branchSpecName,
DeleteBranchSpecOptions opts)
Delete a named Perforce branch spec from the Perforce server. |
String |
deleteClient(String clientName,
DeleteClientOptions opts)
Delete a Perforce client from a Perforce server. |
String |
deleteDepot(String name)
Delete a named depot from the repository. |
String |
deleteLabel(String labelName,
DeleteLabelOptions opts)
Delete a named Perforce label from the Perforce server. |
String |
deleteUser(String userName,
UpdateUserOptions opts)
Delete a named Perforce user from the Perforce server |
String |
deleteUserGroup(IUserGroup group,
UpdateUserGroupOptions opts)
Delete a Perforce user group from the Perforce server. |
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<IBranchSpecSummary> |
getBranchSpecs(GetBranchSpecsOptions opts)
Get a list of all summary Perforce branch specs known to the Perforce server. |
InputStream |
getChangelistDiffs(int id,
GetChangelistDiffsOptions opts)
Get an InputStream onto the file diffs associated with a specific submitted changelist. |
List<IChangelistSummary> |
getChangelists(List<IFileSpec> fileSpecs,
GetChangelistsOptions opts)
Get a list of Perforce changelist summary objects from the Perforce server. |
List<IClientSummary> |
getClients(GetClientsOptions opts)
Get a list of IClientSummary objects for all Perforce clients known to this Perforce server. |
IClient |
getClientTemplate(String clientName,
GetClientTemplateOptions opts)
Get a template of a non-existent named Perforce client. |
IDepot |
getDepot(String name)
Get an individual depot by name. |
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<IFileSpec> |
getDirectories(List<IFileSpec> fileSpecs,
GetDirectoriesOptions opts)
List any directories matching the passed-in file specifications. |
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<IFileAnnotation> |
getFileAnnotations(List<IFileSpec> fileSpecs,
GetFileAnnotationsOptions opts)
Get a list of revision annotations for the specified files. |
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,
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<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<IChangelist> |
getInterchanges(IFileSpec fromFile,
IFileSpec toFile,
GetInterchangesOptions opts)
|
List<IChangelist> |
getInterchanges(String branchSpecName,
List<IFileSpec> fromFileList,
List<IFileSpec> toFileList,
GetInterchangesOptions opts)
|
List<IJob> |
getJobs(List<IFileSpec> fileSpecs,
GetJobsOptions opts)
Return a list of Perforce jobs. |
List<ILabelSummary> |
getLabels(List<IFileSpec> fileList,
GetLabelsOptions opts)
Get a list of Perforce labels, optionally tied to a specific set of files. |
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,
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. |
List<IProtectionEntry> |
getProtectionEntries(List<IFileSpec> fileList,
GetProtectionEntriesOptions opts)
Get a list of Perforce protection entries for the passed-in arguments. |
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. |
List<IFileSpec> |
getSubmittedIntegrations(List<IFileSpec> fileSpecs,
GetSubmittedIntegrationsOptions opts)
Get a list of submitted integrations for the passed-in filespecs |
UsageOptions |
getUsageOptions()
Get the UsageOptions object associated with this server. |
List<IUserGroup> |
getUserGroups(String userOrGroupName,
GetUserGroupsOptions opts)
Get a list of Perforce user groups from the server. |
List<IUserSummary> |
getUsers(List<String> userList,
GetUsersOptions opts)
Get a list of Perforce users known to this Perforce server. |
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 |
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). |
String |
setCounter(String counterName,
String value,
CounterOptions opts)
Create, set or delete a counter on a Perforce server. |
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). |
String |
setServerConfigurationValue(String name,
String value)
Set or unset a specific names server configuration variable. |
IOptionsServer |
setUsageOptions(UsageOptions opts)
Set the UsageOptions object associated with this server. |
List<ServerConfigurationValue> |
showServerConfiguration(String serverName,
String variableName)
Show server configuration values. |
List<IFileSpec> |
tagFiles(List<IFileSpec> fileSpecs,
String labelName,
TagFilesOptions opts)
|
String |
updateUser(IUser user,
UpdateUserOptions opts)
Update a Perforce user on the Perforce server. |
String |
updateUserGroup(IUserGroup group,
UpdateUserGroupOptions opts)
Update a Perforce user group on the Perforce server. |
| Method Detail |
|---|
UsageOptions getUsageOptions()
IOptionsServer setUsageOptions(UsageOptions opts)
opts - non-null UsageOptions object to associate with this server.
void login(String password,
LoginOptions opts)
throws P4JavaException
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.
Behaviour 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...).
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.
void logout(LoginOptions opts)
throws P4JavaException
opts - currently ignored; can be null.
P4JavaException - if any error occurs in the processing of this
method.
IDepot getDepot(String name)
throws P4JavaException
name - non-null name of the depot to be retrieved.
P4JavaException - if any error occurs in the processing of this method.
String createDepot(IDepot newDepot)
throws P4JavaException
newDepot - non-null IDepot object representing the depot to be created.
P4JavaException - if any error occurs in the processing of this method.
String deleteDepot(String name)
throws P4JavaException
name - non-null IDepot object representing the depot to be deleted
P4JavaException - if any error occurs in the processing of this method.
List<IFileSpec> getDepotFiles(List<IFileSpec> fileSpecs,
GetDepotFilesOptions opts)
throws P4JavaException
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.
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.
List<IFix> getFixes(List<IFileSpec> fileSpecs,
GetFixesOptions opts)
throws P4JavaException
Note that this method (unlike the main file list methods) throws an exception and stops at the first encountered error.
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.
List<IFileLineMatch> getMatchingLines(List<IFileSpec> fileSpecs,
String pattern,
MatchingLinesOptions options)
throws P4JavaException
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.
List<IFileLineMatch> getMatchingLines(List<IFileSpec> fileSpecs,
String pattern,
List<String> infoLines,
MatchingLinesOptions options)
throws P4JavaException
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.
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.
String createUser(IUser user,
UpdateUserOptions opts)
throws P4JavaException
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.
String updateUser(IUser user,
UpdateUserOptions opts)
throws P4JavaException
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.
String deleteUser(String userName,
UpdateUserOptions opts)
throws P4JavaException
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.
List<IUserSummary> getUsers(List<String> userList,
GetUsersOptions opts)
throws P4JavaException
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.
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.
List<IUserGroup> getUserGroups(String userOrGroupName,
GetUserGroupsOptions opts)
throws P4JavaException
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.
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.
String createUserGroup(IUserGroup group,
UpdateUserGroupOptions opts)
throws P4JavaException
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.
String updateUserGroup(IUserGroup group,
UpdateUserGroupOptions opts)
throws P4JavaException
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.
String deleteUserGroup(IUserGroup group,
UpdateUserGroupOptions opts)
throws P4JavaException
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.
List<IProtectionEntry> getProtectionEntries(List<IFileSpec> fileList,
GetProtectionEntriesOptions opts)
throws P4JavaException
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.
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.
List<IClientSummary> getClients(GetClientsOptions opts)
throws P4JavaException
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.
opts - GetClientsOptions object describing optional parameters; if null, no
options are set.
P4JavaException - if any error occurs in the processing of this method.
List<ILabelSummary> getLabels(List<IFileSpec> fileList,
GetLabelsOptions opts)
throws P4JavaException
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.
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.
String deleteLabel(String labelName,
DeleteLabelOptions opts)
throws P4JavaException
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.
List<IFileSpec> tagFiles(List<IFileSpec> fileSpecs,
String labelName,
TagFilesOptions opts)
throws P4JavaException
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.
List<IBranchSpecSummary> getBranchSpecs(GetBranchSpecsOptions opts)
throws P4JavaException
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.
GetBranchSpecsOptions - object describing optional parameters; if null, no
options are set.
P4JavaException - if any error occurs in the processing of this method.
String deleteBranchSpec(String branchSpecName,
DeleteBranchSpecOptions opts)
throws P4JavaException
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.
IClient getClientTemplate(String clientName,
GetClientTemplateOptions opts)
throws P4JavaException
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.
String deleteClient(String clientName,
DeleteClientOptions opts)
throws P4JavaException
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.
List<IFileAnnotation> getFileAnnotations(List<IFileSpec> fileSpecs,
GetFileAnnotationsOptions opts)
throws P4JavaException
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.
List<IFileSpec> moveFile(IFileSpec fromFile,
IFileSpec toFile,
MoveFileOptions opts)
throws P4JavaException
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.
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.
List<IFileSpec> getDirectories(List<IFileSpec> fileSpecs,
GetDirectoriesOptions opts)
throws P4JavaException
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.
List<IChangelistSummary> getChangelists(List<IFileSpec> fileSpecs,
GetChangelistsOptions opts)
throws P4JavaException
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 method
InputStream getChangelistDiffs(int id,
GetChangelistDiffsOptions opts)
throws P4JavaException
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....
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.
InputStream getFileContents(List<IFileSpec> fileSpecs,
GetFileContentsOptions opts)
throws P4JavaException
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....
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.
Map<IFileSpec,List<IFileRevisionData>> getRevisionHistory(List<IFileSpec> fileSpecs,
GetRevisionHistoryOptions opts)
throws P4JavaException
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.
List<IUserSummary> getReviews(List<IFileSpec> fileSpecs,
GetReviewsOptions opts)
throws P4JavaException
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.
List<IFileSpec> getOpenedFiles(List<IFileSpec> fileSpecs,
OpenedFilesOptions opts)
throws P4JavaException
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.
List<IExtendedFileSpec> getExtendedFiles(List<IFileSpec> fileSpecs,
GetExtendedFilesOptions opts)
throws P4JavaException
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.
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.
List<IFileSpec> getSubmittedIntegrations(List<IFileSpec> fileSpecs,
GetSubmittedIntegrationsOptions opts)
throws P4JavaException
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.
List<IChangelist> getInterchanges(IFileSpec fromFile,
IFileSpec toFile,
GetInterchangesOptions opts)
throws P4JavaException
fromFile - non-null from-file specification.toFile - non-null 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.
List<IChangelist> getInterchanges(String branchSpecName,
List<IFileSpec> fromFileList,
List<IFileSpec> toFileList,
GetInterchangesOptions opts)
throws P4JavaException
branchSpecName - non-null, non-empty branch spec name.fromFileListif - 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.
List<IJob> getJobs(List<IFileSpec> fileSpecs,
GetJobsOptions opts)
throws P4JavaException
Note that this method (unlike the main file list methods) throws an exception and stops at the first encountered error.
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.
List<IFix> fixJobs(List<String> jobIds,
int changelistId,
FixJobsOptions opts)
throws P4JavaException
jobIdList - non-null non-empty list of affected job IDs.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.
InputStream getFileDiffsStream(IFileSpec file1,
IFileSpec file2,
String branchSpecName,
GetFileDiffsOptions opts)
throws P4JavaException
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.
optional - first file IFileSpecfile2 - optional second file IFileSpecbranchSpecName - 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.
List<IFileDiff> getFileDiffs(IFileSpec file1,
IFileSpec file2,
String branchSpecName,
GetFileDiffsOptions opts)
throws P4JavaException
This method corresponds closely to the standard diff2 command, and that command's documentation should be consulted for the overall and detailed semantics.
optional - first file IFileSpecfile2 - optional second file IFileSpecbranchSpecName - 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.
String setCounter(String counterName,
String value,
CounterOptions opts)
throws P4JavaException
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.
List<Map<String,Object>> getExportRecords(ExportRecordsOptions opts)
throws P4JavaException
See the main p4 admin command documentation for full semantics and usage details.
opts - ExportRecordsOptions object describing optional parameters; if null, no
options are set.
P4JavaException - if an error occurs processing this method and its parameters.
List<IFileSpec> setFileAttributes(List<IFileSpec> files,
Map<String,String> attributes,
SetFileAttributesOptions opts)
throws P4JavaException
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.
opts - SetFileAttributesOptions object describing optional parameters; if null, no
options are set.attributes - a non-null Map of attribute name / value pairs; if any value is null,
that attribute is removed.files - non-null list of files to be affected
P4JavaException - if an error occurs processing this method and its parameters.
List<IFileSpec> setFileAttributes(List<IFileSpec> files,
String attributeName,
InputStream inStream,
SetFileAttributesOptions opts)
throws P4JavaException
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.
opts - SetFileAttributesOptions object describing optional parameters; if null, no
options are set.attributeName - the non-null name of the attribute to be set.inStream - non-null InputStream ready for reading the attribute value from.files - non-null list of files to be affected.
P4JavaException - if an error occurs processing this method and its parameters.
List<ServerConfigurationValue> showServerConfiguration(String serverName,
String variableName)
throws P4JavaException
Note: you must be an admin or super user for this command to work.
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.
String setServerConfigurationValue(String name,
String value)
throws P4JavaException
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.
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||