public abstract class Server extends HelixCommandExecutor implements IServerControl, IOptionsServer
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.
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.String> |
authTickets
Storage for user auth tickets.
|
protected IBrowserCallback |
browserCallback |
protected java.lang.Object |
browserVersion |
protected boolean |
caseSensitive |
protected java.lang.String |
charsetName |
protected IClient |
client |
protected java.lang.String |
clientName |
protected java.lang.String |
clientPath |
protected java.lang.String |
clientUnsetName
Used when we have no client set.
|
protected ICommandCallback |
commandCallback |
protected boolean |
connected |
protected static java.lang.String |
CORE_AUTH_FAIL_STRING_1
Signals access (login) needed
|
protected static java.lang.String |
CORE_AUTH_FAIL_STRING_2
Signals access (login) needed
|
protected static java.lang.String |
CORE_AUTH_FAIL_STRING_3
Signals ticket has expired
|
protected static java.lang.String |
CORE_AUTH_FAIL_STRING_4
Signals ticket has expired
|
static java.lang.String |
DEFAULT_STATUS_FIELD_NAME |
protected boolean |
enableAndmaps |
protected boolean |
enableGraph |
protected boolean |
enableProgress |
protected boolean |
enableStreams |
protected boolean |
enableTracking |
protected java.lang.String |
ignoreFileName |
static java.lang.String |
IMPL_COMMENTS_FIELD_NAME |
static java.lang.String |
IMPL_TYPE_FIELD_NAME |
protected boolean |
loginOnConnect |
static java.lang.String |
MINIMUM_SUPPORTED_SERVER_LEVEL_FIELD_NAME |
protected int |
minimumSupportedServerVersion |
protected java.util.concurrent.atomic.AtomicInteger |
nextCmdCallBackKey |
protected java.util.concurrent.atomic.AtomicInteger |
nextProgressCallbackKey |
protected boolean |
nonCheckedSyncs |
protected P4Charset |
p4Charset |
static java.lang.String |
P4IGNORE_ENV_VAR |
static java.lang.String |
P4TICKETS_DEFAULT_OTHER |
static java.lang.String |
P4TICKETS_DEFAULT_WINDOWS |
static java.lang.String |
P4TICKETS_ENV_VAR |
static java.lang.String |
P4TRUST_DEFAULT_OTHER |
static java.lang.String |
P4TRUST_DEFAULT_WINDOWS |
static java.lang.String |
P4TRUST_ENV_VAR |
protected java.lang.String |
password |
protected IProgressCallback |
progressCallback |
protected java.util.Properties |
props |
static java.lang.String |
PROTOCOL_NAME_FIELD_NAME |
protected boolean |
quietMode |
protected java.util.Random |
rand
Useful source of random integers, etc.
|
protected java.lang.String |
rsh |
protected static boolean |
runningOnWindows |
static java.lang.String |
SCREEN_NAME_FIELD_NAME |
protected boolean |
secure |
protected java.lang.String |
serverAddress |
protected java.lang.String |
serverHost |
protected IServerInfo |
serverInfo |
protected int |
serverPort |
protected IServerAddress.Protocol |
serverProtocol |
protected int |
serverVersion |
protected boolean |
setupOnConnect |
protected ISSOCallback |
ssoCallback |
protected java.lang.String |
ssoKey |
protected ServerStatus |
status |
protected java.lang.String |
tmpDirName |
protected static java.lang.String |
UNKNOWN_SERVER_HOST |
protected static int |
UNKNOWN_SERVER_PORT |
protected static int |
UNKNOWN_SERVER_VERSION |
protected UsageOptions |
usageOptions |
protected boolean |
useAuthMemoryStore |
protected java.lang.String |
userName |
ATTRIBUTE_STREAM_MAP_KEY, IN_MAP_USE_TAGS_KEY
Constructor and Description |
---|
Server() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
changePassword(java.lang.String oldPassword,
java.lang.String newPassword,
java.lang.String userName)
Change a user's password on the server.
|
void |
connect()
Connect to the Perforce server associated with this server object.
|
java.lang.String |
createBranchSpec(IBranchSpec branchSpec)
TODO: This should be moved up to Server and changed to delegate to
createBranchSpec with an options class.
|
java.lang.String |
createClient(IClient newClient) |
java.lang.String |
createDepot(IDepot newDepot)
Create a new depot in the repository.
|
java.lang.String |
createExtensionConfig(IExtension extension,
java.lang.String namespace,
java.lang.String instanceConfig)
Creates/updates an extension's global/instance config.
|
IJob |
createJob(java.util.Map<java.lang.String,java.lang.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).
|
java.lang.String |
createLabel(ILabel label)
Create a new Perforce label in the Perforce server.
|
java.lang.String |
createProtectionEntries(java.util.List<IProtectionEntry> entryList)
Create or replace the protections table data on the Perforce server with
these new protection entries.
|
java.lang.String |
createStream(IStream stream)
Create a new stream in the repository.
|
void |
createTempClient(IClient newClient) |
java.lang.String |
createTriggerEntries(java.util.List<ITriggerEntry> entryList)
Create or replace the triggers table data on the Perforce server with
these new trigger entries.
|
java.lang.String |
createUser(IUser user,
boolean force)
Create a new Perforce user on the Perforce server.
|
java.lang.String |
createUser(IUser user,
UpdateUserOptions opts)
Create a new Perforce user on the Perforce server.
|
java.lang.String |
createUserGroup(IUserGroup group)
Create a new Perforce user group on the Perforce server.
|
java.lang.String |
createUserGroup(IUserGroup group,
UpdateUserGroupOptions opts)
Create a new Perforce user group on the Perforce server.
|
java.lang.String |
deleteBranchSpec(java.lang.String branchSpecName,
boolean force)
Deprecated.
|
java.lang.String |
deleteBranchSpec(java.lang.String branchSpecName,
DeleteBranchSpecOptions opts)
Delete a named Perforce branch spec from the Perforce server.
|
java.lang.String |
deleteClient(java.lang.String clientName,
boolean force) |
java.lang.String |
deleteClient(java.lang.String clientName,
DeleteClientOptions opts)
Delete a Perforce client from a Perforce server.
|
void |
deleteCounter(java.lang.String counterName,
boolean perforceCounter) |
java.lang.String |
deleteDepot(java.lang.String name)
Delete a named depot from the repository.
|
java.lang.String |
deleteExtension(java.lang.String namespace,
java.lang.String extnName)
Deletes an extension along with all of its configuration.
|
java.lang.String |
deleteJob(java.lang.String jobId)
Delete a job from the Perforce server.
|
java.lang.String |
deleteKey(java.lang.String keyName)
Delete a key on a Perforce server.
|
java.lang.String |
deleteLabel(java.lang.String labelName,
boolean force)
Delete a named Perforce label from the Perforce server.
|
java.lang.String |
deleteLabel(java.lang.String labelName,
DeleteLabelOptions opts)
Delete a named Perforce label from the Perforce server.
|
java.lang.String |
deletePendingChangelist(int id)
Delete a pending Perforce changelist.
|
java.lang.String |
deletePendingChangelist(int id,
ChangelistOptions opts)
Delete a pending Perforce changelist.
|
java.lang.String |
deleteProperty(java.lang.String name,
PropertyOptions opts)
Deletes a property value from the Perforce server.
|
java.lang.String |
deleteStream(java.lang.String streamPath,
StreamOptions opts)
Delete a Perforce stream spec from the Perforce server.
|
java.lang.String |
deleteUser(java.lang.String userName,
boolean force)
Delete a named Perforce user from the Perforce server.
|
java.lang.String |
deleteUser(java.lang.String userName,
UpdateUserOptions opts)
Delete a named Perforce user from the Perforce server
|
java.lang.String |
deleteUserGroup(IUserGroup group)
Delete a Perforce user group from the Perforce server.
|
java.lang.String |
deleteUserGroup(IUserGroup group,
UpdateUserGroupOptions opts)
Delete a Perforce user group from the Perforce server.
|
void |
disconnect()
Disconnect from this Perforce server.
|
void |
doGraphReceivePack(GraphReceivePackOptions options) |
java.util.List<IFileSpec> |
duplicateRevisions(IFileSpec fromFile,
IFileSpec toFile,
DuplicateRevisionsOptions opts)
Duplicate revisions with integration history (unsupported).
|
java.util.List<IFix> |
fixJobs(java.util.List<java.lang.String> jobIds,
int changeListId,
FixJobsOptions opts)
Mark each named job as being fixed by the changelist number given with
changeListId.
|
java.util.List<IFix> |
fixJobs(java.util.List<java.lang.String> jobIds,
int changeListId,
java.lang.String status,
boolean delete)
Mark each named job as being fixed by the changelist number given with
changeListId.
|
java.lang.String |
getAuthTicket()
Return the current Perforce authentication ticket being used by this
server, if any.
|
java.io.InputStream |
getBlobObject(java.lang.String repo,
java.lang.String sha)
Usage: cat-file -n {repo} blob {object-sha}
|
IBranchSpec |
getBranchSpec(java.lang.String name)
Get the branch spec for the given name.
|
IBranchSpec |
getBranchSpec(java.lang.String name,
GetBranchSpecOptions opts)
Get a specific named Perforce branch spec from the Perforce server.
|
java.util.List<IBranchSpecSummary> |
getBranchSpecs(GetBranchSpecsOptions opts)
Get a list of all summary Perforce branch specs known to the Perforce
server.
|
java.util.List<IBranchSpecSummary> |
getBranchSpecs(java.lang.String userName,
java.lang.String nameFilter,
int maxReturns)
Old style getBranchSpecs api call.
|
IBrowserCallback |
getBrowserCallback() |
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.
|
java.io.InputStream |
getChangelistDiffs(int id,
DiffType diffType)
Get an InputStream onto the file diffs associated with a specific
submitted changelist.
|
java.io.InputStream |
getChangelistDiffs(int id,
GetChangelistDiffsOptions opts)
Get an InputStream onto the file diffs associated with a specific
submitted changelist.
|
java.io.InputStream |
getChangelistDiffsStream(int id,
DescribeOptions options)
Get an InputStream onto the file diffs associated with a specific
submitted changelist.
|
java.util.List<IExtendedFileSpec> |
getChangelistExtendedFiles(int id)
Get an extended list of the Perforce depot files associated with a Perforce
changelist.
|
java.util.List<IExtendedFileSpec> |
getChangelistExtendedFiles(int id,
int max)
Get an extended list of the Perforce depot files associated with a Perforce
changelist.
|
java.util.List<IFileSpec> |
getChangelistFiles(int id)
Get a list of the Perforce depot files associated with a Perforce
changelist.
|
java.util.List<IFileSpec> |
getChangelistFiles(int id,
int max)
Get a list of the Perforce depot files associated with a Perforce
changelist.
|
java.util.List<IChangelistSummary> |
getChangelists(int maxMostRecent,
java.util.List<IFileSpec> fileSpecs,
java.lang.String clientName,
java.lang.String userName,
boolean includeIntegrated,
boolean submittedOnly,
boolean pendingOnly,
boolean longDesc)
Gets the changelists.
|
java.util.List<IChangelistSummary> |
getChangelists(int maxMostRecent,
java.util.List<IFileSpec> fileSpecs,
java.lang.String clientName,
java.lang.String userName,
boolean includeIntegrated,
IChangelist.Type type,
boolean longDesc)
Gets the changelists.
|
java.util.List<IChangelistSummary> |
getChangelists(java.util.List<IFileSpec> fileSpecs,
GetChangelistsOptions opts)
Get a list of Perforce changelist summary objects from the Perforce server.
|
java.lang.String |
getCharsetName()
Get the current charset name for the server connection.
|
IClient |
getClient(IClientSummary clientSummary) |
IClient |
getClient(java.lang.String clientName) |
java.lang.String |
getClientName() |
java.lang.String |
getClientPath() |
java.util.List<IClientSummary> |
getClients(GetClientsOptions opts)
Get a list of IClientSummary objects for all Perforce clients known to this Perforce
server.
|
java.util.List<IClientSummary> |
getClients(java.lang.String userName,
java.lang.String nameFilter,
int maxResults)
Get a list of IClientSummary objects for all Perforce clients known to this Perforce
server.
|
IClient |
getClientTemplate(java.lang.String clientName) |
IClient |
getClientTemplate(java.lang.String clientName,
boolean allowExistent) |
IClient |
getClientTemplate(java.lang.String clientName,
GetClientTemplateOptions opts)
Get a template of a non-existent named Perforce client.
|
java.util.List<IFileSpec> |
getCommitFiles(java.lang.String repo,
java.lang.String commit) |
ICommit |
getCommitObject(java.lang.String sha)
Usage: cat-file commit {object-sha}
|
ICommit |
getCommitObject(java.lang.String sha,
java.lang.String repo)
Usage: cat-file -n {repo} commit {object-sha}
|
java.lang.String |
getCounter(java.lang.String counterName) |
java.lang.String |
getCounter(java.lang.String counterName,
CounterOptions opts)
Get the value of a named Perforce counter from the Perforce server.
|
java.util.Map<java.lang.String,java.lang.String> |
getCounters()
This is here to allow access via both IOptionsServer and IServer, the underlying
delegator implementation provides the concrete method.
|
java.util.Map<java.lang.String,java.lang.String> |
getCounters(CounterOptions opts)
Deprecated.
|
java.util.Map<java.lang.String,java.lang.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.
|
IServerInfo |
getCurrentServerInfo()
Get the server's Info object without calling `p4 info`.
|
java.util.List<IDbSchema> |
getDbSchema(java.util.List<java.lang.String> tableSpecs)
Gets the db schema.
|
protected java.lang.String |
getDefaultP4TicketsFile()
Get default p4tickets file for the running OS
|
protected java.lang.String |
getDefaultP4TrustFile()
Get default p4trust file for the running OS
|
IDepot |
getDepot(java.lang.String name)
Get an individual depot by name.
|
java.util.List<IFileSpec> |
getDepotFiles(java.util.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).
|
java.util.List<IFileSpec> |
getDepotFiles(java.util.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).
|
java.util.List<IDepot> |
getDepots()
Gets the depots.
|
java.util.List<IDepot> |
getDepots(GetDepotsOptions opts)
Gets depots with type and namefilter
|
java.util.List<IFileSpec> |
getDirectories(java.util.List<IFileSpec> fileSpecs,
boolean clientOnly,
boolean deletedOnly,
boolean haveListOnly)
List any directories matching the passed-in file specifications
and other options.
|
java.util.List<IFileSpec> |
getDirectories(java.util.List<IFileSpec> fileSpecs,
GetDirectoriesOptions opts)
List any directories matching the passed-in file specifications.
|
java.util.List<IDiskSpace> |
getDiskSpace(java.util.List<java.lang.String> filesystems)
Get a list of disk space information about the current availability of
disk space on the server.
|
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
getExportRecords(boolean useJournal,
long maxRecs,
int sourceNum,
long offset,
boolean format,
java.lang.String journalPrefix,
java.lang.String filter)
Get a list of exported journal or checkpoint records (admin / superuser
command).
|
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
getExportRecords(ExportRecordsOptions opts)
Get a list of exported journal or checkpoint records (admin / superuser
command).
|
java.util.List<IExtendedFileSpec> |
getExtendedFiles(java.util.List<IFileSpec> fileSpecs,
GetExtendedFilesOptions opts)
Return a list of everything Perforce knows about a set of Perforce files.
|
java.util.List<IExtendedFileSpec> |
getExtendedFiles(java.util.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.
|
Extension |
getExtensionConfig(java.lang.String namespace,
java.lang.String name,
java.lang.String instanceName)
Retrieves an extension/config.
|
java.util.List<IFileAnnotation> |
getFileAnnotations(java.util.List<IFileSpec> fileSpecs,
DiffType wsOpts,
boolean allResults,
boolean useChangeNumbers,
boolean followBranches) |
java.util.List<IFileAnnotation> |
getFileAnnotations(java.util.List<IFileSpec> fileSpecs,
GetFileAnnotationsOptions opts)
Get a list of revision annotations for the specified files.
|
java.io.InputStream |
getFileContents(java.util.List<IFileSpec> fileSpecs,
boolean allrevs,
boolean noHeaderLine) |
java.io.InputStream |
getFileContents(java.util.List<IFileSpec> fileSpecs,
GetFileContentsOptions opts)
Return an InputStream onto the contents of one or more revisions of one or more Perforce depot
file contents.
|
java.util.List<IFileDiff> |
getFileDiffs(IFileSpec file1,
IFileSpec file2,
java.lang.String branchSpecName,
DiffType diffType,
boolean quiet,
boolean includeNonTextDiffs,
boolean gnuDiffs)
Run diff on the Perforce server of two files in the depot.
|
java.util.List<IFileDiff> |
getFileDiffs(IFileSpec file1,
IFileSpec file2,
java.lang.String branchSpecName,
GetFileDiffsOptions opts)
Run diff on the Perforce server of two files in the depot.
|
java.io.InputStream |
getFileDiffsStream(IFileSpec file1,
IFileSpec file2,
java.lang.String branchSpecName,
GetFileDiffsOptions opts)
Run diff on the Perforce server of two files in the depot.
|
java.util.List<IFileSize> |
getFileSizes(java.util.List<IFileSpec> fileSpecs,
GetFileSizesOptions opts)
Gets a list of file sizes for one or more files in the depot.
|
java.util.List<IFix> |
getFixes(java.util.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.
|
java.util.List<IFix> |
getFixList(java.util.List<IFileSpec> fileSpecs,
int changeListId,
java.lang.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.
|
java.util.List<ICommit> |
getGraphCommitLogList(GraphCommitLogOptions options)
Usage: log -n {repo} {object-sha}
|
java.util.List<IGraphListTree> |
getGraphListTree(java.lang.String sha)
Usage: ls-tree {tree-sha}
|
IGraphObject |
getGraphObject(java.lang.String sha)
Usage: cat-file -t {object-sha}
|
java.util.List<IRevListCommit> |
getGraphRevList(GraphRevListOptions options)
Returns a list of revisions given the options
|
java.util.List<IGraphRef> |
getGraphShowRefs(GraphShowRefOptions opts)
Usage: show-ref [ -a -n {repo} -u {user} -t {type} -m {max} ]
|
java.lang.String |
getIgnoreFileName() |
protected java.lang.String |
getInfoServerAddress()
Get the server address entry from the p4 info.
|
java.util.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).
|
java.util.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.
|
java.util.List<IChangelist> |
getInterchanges(java.lang.String branchSpecName,
java.util.List<IFileSpec> fromFileList,
java.util.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).
|
java.util.List<IChangelist> |
getInterchanges(java.lang.String branchSpecName,
java.util.List<IFileSpec> fromFileList,
java.util.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(java.lang.String jobId)
Get a specific job.
|
java.util.List<IJob> |
getJobs(java.util.List<IFileSpec> fileSpecs,
GetJobsOptions opts)
Return a list of Perforce jobs.
|
java.util.List<IJob> |
getJobs(java.util.List<IFileSpec> fileSpecs,
int maxJobs,
boolean longDescriptions,
boolean reverseOrder,
boolean includeIntegrated,
java.lang.String jobView)
Return a list of Perforce jobs.
|
IJobSpec |
getJobSpec()
Return the Perforce jobspec associated with this Perforce server.
|
java.lang.String |
getKey(java.lang.String keyName)
Get the value of a named Perforce key from the Perforce server.
|
java.util.Map<java.lang.String,java.lang.String> |
getKeys(GetKeysOptions opts)
Get a map of the Perforce server's keys.
|
java.lang.String[] |
getKnownCharsets()
Return an array of strings representing "known" charsets (e.g.
|
ILabel |
getLabel(java.lang.String labelName)
Get a specific named Perforce label.
|
java.util.List<ILabelSummary> |
getLabels(java.util.List<IFileSpec> fileList,
GetLabelsOptions opts)
Get a list of Perforce labels, optionally tied to a specific set of files.
|
java.util.List<ILabelSummary> |
getLabels(java.lang.String user,
int maxLabels,
java.lang.String nameFilter,
java.util.List<IFileSpec> fileList)
Get a list of Perforce labels, optionally tied to a specific set of
files.
|
ILicense |
getLicense() |
ILicenseLimits |
getLimits() |
ListData |
getListData(java.util.List<IFileSpec> fileSpecs,
ListOptions options)
Usage: list [-l label [-d]] [-C] [-M] files..
|
ListData |
getListData(java.util.List<IFileSpec> fileSpecs,
ListOptions options,
java.lang.String clientName)
Internal use only.
|
java.lang.String |
getLogin2Status()
Return a string indicating the current 2fa login status; corresponds to the
'p4 login2 -s' command.
|
java.lang.String |
getLogin2Status(IUser user)
Return a string indicating the current 2fa login status; corresponds to the
'p4 login2 -s' command.
|
java.lang.String |
getLoginStatus()
Return a string indicating the current login status; corresponds to the
p4 login -s command.
|
ILogTail |
getLogTail(LogTailOptions opts)
Gets the log tail.
|
java.util.List<IFileLineMatch> |
getMatchingLines(java.util.List<IFileSpec> fileSpecs,
java.lang.String pattern,
java.util.List<java.lang.String> infoLines,
MatchingLinesOptions options)
Get list of matching lines in the specified file specs.
|
java.util.List<IFileLineMatch> |
getMatchingLines(java.util.List<IFileSpec> fileSpecs,
java.lang.String pattern,
MatchingLinesOptions options)
Get list of matching lines in the specified file specs.
|
java.util.List<IFileSpec> |
getOpenedFiles(java.util.List<IFileSpec> fileSpecs,
boolean allClients,
java.lang.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.
|
java.util.List<IFileSpec> |
getOpenedFiles(java.util.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 java.lang.String[] |
getPreferredPathArray(java.lang.String[] preamble,
java.util.List<IFileSpec> specList) |
static java.lang.String[] |
getPreferredPathArray(java.lang.String[] preamble,
java.util.List<IFileSpec> specList,
boolean annotate) |
java.util.Properties |
getProperties()
Return the Java properties associated with this server.
|
java.util.List<IProperty> |
getProperty(GetPropertyOptions opts)
Gets a list of one or more property values from the Perforce server.
|
java.util.List<IProtectionEntry> |
getProtectionEntries(boolean allUsers,
java.lang.String hostName,
java.lang.String userName,
java.lang.String groupName,
java.util.List<IFileSpec> fileList)
Get a list of Perforce protection entries for the passed-in arguments.
|
java.util.List<IProtectionEntry> |
getProtectionEntries(java.util.List<IFileSpec> fileList,
GetProtectionEntriesOptions opts)
Get a list of Perforce protection entries for the passed-in arguments.
|
java.io.InputStream |
getProtectionsTable()
Get an InputStream onto the entries of the Perforce protections table.
|
protected int |
getRandomInt() |
java.util.List<IRepo> |
getRepos()
Gets the repos.
|
java.util.List<IRepo> |
getRepos(ReposOptions options)
Get the repos with filter options
|
java.util.List<IRepo> |
getRepos(java.lang.String clientName)
Gets the repos mapped within the client's view.
|
java.util.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.
|
java.util.List<IUserSummary> |
getReviews(int changelistId,
java.util.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.
|
java.util.List<IUserSummary> |
getReviews(java.util.List<IFileSpec> fileSpecs,
GetReviewsOptions opts)
Get a list of all users who have subscribed to review the named files.
|
java.util.Map<IFileSpec,java.util.List<IFileRevisionData>> |
getRevisionHistory(java.util.List<IFileSpec> fileSpecs,
GetRevisionHistoryOptions opts)
Get the revision history data for one or more Perforce files.
|
java.util.Map<IFileSpec,java.util.List<IFileRevisionData>> |
getRevisionHistory(java.util.List<IFileSpec> fileSpecs,
int maxRevs,
boolean contentHistory,
boolean includeInherited,
boolean longOutput,
boolean truncatedLongOutput)
Get the revision history data for one or more Perforce files.
|
abstract IServerAddress |
getServerAddressDetails() |
java.io.InputStream |
getServerFileDiffs(IFileSpec file1,
IFileSpec file2,
java.lang.String branchSpecName,
DiffType diffType,
boolean quiet,
boolean includeNonTextDiffs,
boolean gnuDiffs)
Run diff on the Perforce server of two files in the depot.
|
IServerInfo |
getServerInfo()
Gets the server info.
|
java.util.List<IServerProcess> |
getServerProcesses()
Return a list of Perforce server processes active on the Perforce server.
|
java.util.List<IServerProcess> |
getServerProcesses(GetServerProcessesOptions opts)
Return a list of Perforce server processes active on the Perforce server.
|
int |
getServerVersion()
Try to get the Perforce server version.
|
int |
getServerVersionNumber()
Get the Perforce version number of the Perforce server associated with
this IServer object, if any.
|
java.util.List<IFileSpec> |
getShelvedFiles(int changelistId)
Get a list of shelved files associated with a Perforce pending
changelist.
|
java.util.List<IFileSpec> |
getShelvedFiles(int changelistId,
int max)
Get a list of shelved files associated with a Perforce pending
changelist.
|
java.util.Map<java.lang.String,java.lang.Object> |
getSpec(CustomSpec type)
Usage: p4 spec [ -o ] type
|
ISSOCallback |
getSSOCallback() |
java.lang.String |
getSSOKey() |
ServerStatus |
getStatus()
Return the current status of this server object.
|
IStream |
getStream(java.lang.String streamPath)
Get an individual stream by stream path.
|
IStream |
getStream(java.lang.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(java.lang.String stream,
StreamIntegrationStatusOptions opts)
Get a stream's cached integration status with respect to its parent.
|
java.util.Map<java.lang.String,java.util.List<IStreamlog>> |
getStreamlog(java.util.List<java.lang.String> streamPaths,
StreamlogOptions opts)
List the revision history of the specified stream specs, from the most
recent revision to the first.
|
java.util.List<IStreamSummary> |
getStreams(java.util.List<java.lang.String> streamPaths,
GetStreamsOptions opts)
Get a list of all summary Perforce streams known to the Perforce server.
|
java.util.List<IFileSpec> |
getSubmittedIntegrations(java.util.List<IFileSpec> fileSpecs,
GetSubmittedIntegrationsOptions opts)
Get a list of submitted integrations for the passed-in filespecs.
|
java.util.List<IFileSpec> |
getSubmittedIntegrations(java.util.List<IFileSpec> fileSpecs,
java.lang.String branchSpec,
boolean reverseMappings)
Get a list of submitted integrations for the passed-in filespecs.
|
java.util.List<ITriggerEntry> |
getTriggerEntries()
Get a list of Perforce trigger entries.
|
java.io.InputStream |
getTriggersTable()
Get an InputStream onto the entries of the Perforce triggers table.
|
UsageOptions |
getUsageOptions()
Get the UsageOptions object associated with this server.
|
IUser |
getUser(java.lang.String userName)
Get the user details of a specific Perforce user from the Perforce
server.
|
IUserGroup |
getUserGroup(java.lang.String name)
Get the named Perforce user group.
|
java.util.List<IUserGroup> |
getUserGroups(java.lang.String userOrGroupName,
boolean indirect,
boolean displayValues,
int maxGroups)
Get a list of Perforce user groups from the server.
|
java.util.List<IUserGroup> |
getUserGroups(java.lang.String userOrGroupName,
GetUserGroupsOptions opts)
Get a list of Perforce user groups from the server.
|
java.lang.String |
getUserName()
Return the user name currently associated with this server, if any.
|
java.util.List<IUserSummary> |
getUsers(java.util.List<java.lang.String> userList,
GetUsersOptions opts)
Get a list of Perforce users known to this Perforce server.
|
java.util.List<IUserSummary> |
getUsers(java.util.List<java.lang.String> userList,
int maxUsers)
Get a list of Perforce users known to this Perforce server.
|
java.lang.String |
getWorkingDirectory()
Get the underlying server's notion of the current working directory.
|
static java.lang.String |
guardNull(java.lang.String str) |
IFileSpec |
handleFileReturn(java.util.Map<java.lang.String,java.lang.Object> map)
Deprecated.
|
IFileSpec |
handleFileReturn(java.util.Map<java.lang.String,java.lang.Object> map,
IClient client)
Deprecated.
|
ServerStatus |
init(java.lang.String host,
int port,
java.util.Properties props)
Convenience method for init(host, port, props, null).
|
ServerStatus |
init(java.lang.String host,
int port,
java.util.Properties props,
UsageOptions opts)
Convenience method for init(host, port, props, opts, secure).
|
ServerStatus |
init(java.lang.String host,
int port,
java.util.Properties properties,
UsageOptions opts,
boolean secure)
Convenience method for init(host, port, props, opts, secure, null).
|
ServerStatus |
init(java.lang.String host,
int port,
java.util.Properties props,
UsageOptions opts,
boolean secure,
java.lang.String rsh)
Initialize the server.
|
ExtensionSummary |
installExtension(java.lang.String extnPackageName,
boolean allowUnsigned)
Installs extension on p4 server.
|
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.
|
boolean |
isDontWriteTicket(java.lang.String cmd,
java.lang.String[] cmdArgs)
Special case handling of the "-p" flag for the "p4 login" command.
|
boolean |
isEnableProgress() |
boolean |
isEnableTracking() |
boolean |
isNonCheckedSyncs() |
boolean |
isQuietMode() |
static boolean |
isRunningOnWindows() |
protected boolean |
isSecure()
Check if the server is secure (SSL) or not.
|
protected boolean |
isUnicode() |
void |
journalWait(JournalWaitOptions opts)
Turns on/off journal-wait.
|
java.util.List<ExtensionSummary> |
listExtensions(java.lang.String type)
Lists extensions or configs based on type.
|
void |
login(IUser user,
java.lang.StringBuffer ticket,
LoginOptions opts)
Log another user in to Perforce by obtaining a session ticket for that
user.
|
void |
login(java.lang.String password)
Convenience method for login(password, false).
|
void |
login(java.lang.String password,
boolean allHosts)
Log the current user (if any) in to a Perforce server, optionally
arranging to be logged in for all hosts.
|
void |
login(java.lang.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(java.lang.String password,
java.lang.StringBuffer ticket,
LoginOptions opts)
Log the current user (if any) in to a Perforce server using.
|
java.lang.String |
login2(IUser user,
Login2Options opts)
Validate user second factor authentication.
|
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
login2(Login2Options opts,
java.lang.String user)
Generic access method for Login2, to bypass the non-interactive clients methods.
|
java.lang.String |
login2CheckAuth(java.lang.String auth,
boolean persist)
For non-interactive clients.
|
java.lang.String |
login2InitAuth(java.lang.String method)
For non-interactive clients.
|
java.util.Map<java.lang.String,java.lang.String> |
login2ListMethods()
For non-interactive clients.
|
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.
|
java.util.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).
|
java.util.List<IFileSpec> |
moveFile(int changelistId,
boolean listOnly,
boolean noClientMove,
java.lang.String fileType,
IFileSpec fromFile,
IFileSpec toFile)
Move a file already opened for edit or add (the fromFile) to the
destination file (the toFile).
|
java.util.List<IObliterateResult> |
obliterateFiles(java.util.List<IFileSpec> fileSpecs,
ObliterateFilesOptions opts)
Obliterate permanently remove files and their history from the server.
|
java.lang.String |
packageExtension(java.lang.String dirName)
Packages the extension.
|
protected int |
parseVersionString(java.lang.String versionString)
Return the major version number (e.g.
|
static java.lang.String[] |
populatePathArray(java.lang.String[] pathArray,
int start,
java.util.List<IFileSpec> fileSpecList) |
void |
registerBrowserCallback(IBrowserCallback browserCallback)
Register a Perforce browser callback to launch the browser for a given
url for this server.
|
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.
|
void |
registerSSOCallback(ISSOCallback callback,
java.lang.String ssoKey)
Register a Perforce Single Sign On (SSO) callback and key for this
server.
|
java.lang.String |
reload(ReloadOptions opts)
Reload an unloaded client or label.
|
java.lang.String |
renameUser(java.lang.String oldUserName,
java.lang.String newUserName)
Completely renames a user, modifying all database records which mention
the user.
|
java.lang.String |
sampleExtension(java.lang.String extnName)
Creates sample extension with the given name.
|
java.util.List<java.lang.String> |
searchJobs(java.lang.String words,
SearchJobsOptions opts)
Search for jobs that contain the specified words in the search engine's
index.
|
void |
setAuthTicket(java.lang.String authTicket)
Set the server's Perforce authentication ticket to the passed-in string.
|
boolean |
setCharsetName(java.lang.String charsetName)
Set the Perforce server's charset to the passed-in charset name.
|
void |
setClientName(java.lang.String clientName) |
void |
setClientPath(java.lang.String clientPath)
Set the Perforce P4CLIENTPATH - directories the client can access.
|
void |
setCounter(java.lang.String counterName,
java.lang.String value,
boolean perforceCounter) |
java.lang.String |
setCounter(java.lang.String counterName,
java.lang.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 |
setCurrentServerInfo(IServerInfo info)
Set the server's Info object without calling `p4 info`.
|
void |
setEnableProgress(boolean enableProgress) |
void |
setEnableTracking(boolean enableTracking) |
java.util.List<IFileSpec> |
setFileAttributes(java.util.List<IFileSpec> files,
java.util.Map<java.lang.String,java.lang.String> attributes,
SetFileAttributesOptions opts)
Set file attributes on one or more files (unsupported).
|
java.util.List<IFileSpec> |
setFileAttributes(java.util.List<IFileSpec> files,
java.lang.String attributeName,
java.io.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(java.lang.String ignoreFileName) |
java.lang.String |
setKey(java.lang.String keyName,
java.lang.String value,
KeyOptions opts)
Create, set or delete a key on a Perforce server.
|
void |
setNonCheckedSyncs(boolean nonCheckedSyncs) |
java.lang.String |
setOrUnsetServerConfigurationValue(java.lang.String name,
java.lang.String value)
Set or unset a specific names server configuration variable.
|
java.lang.String |
setProperty(java.lang.String name,
java.lang.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.
|
Server |
setUsageOptions(UsageOptions usageOptions)
Set the UsageOptions object associated with this server.
|
void |
setUserName(java.lang.String userName)
Set the Perforce user name to be used with this server.
|
void |
setWorkingDirectory(java.lang.String dirPath)
Set the Perforce server's idea of each command's working directory.
|
java.util.List<ServerConfigurationValue> |
showServerConfiguration(java.lang.String serverName,
java.lang.String variableName)
Show server configuration values.
|
boolean |
supportsUnicode()
Return true if the underlying Perforce server supports Unicode (and is
connected).
|
java.lang.String |
switchClientView(java.lang.String templateClientName,
java.lang.String targetClientName,
SwitchClientViewOptions opts)
Switch the target client spec's view without invoking the editor.
|
java.lang.String |
switchStreamView(java.lang.String streamPath,
java.lang.String targetClientName,
SwitchClientViewOptions opts)
Switch the target client spec's view without invoking the editor.
|
java.util.List<IFileSpec> |
tagFiles(java.util.List<IFileSpec> fileSpecs,
java.lang.String labelName,
boolean listOnly,
boolean delete)
Tag files with a Perforce label.
|
java.util.List<IFileSpec> |
tagFiles(java.util.List<IFileSpec> fileSpecs,
java.lang.String labelName,
TagFilesOptions opts) |
java.lang.String |
unload(UnloadOptions opts)
Unloads a client or label to the unload depot.
|
java.util.List<IFileSpec> |
unsetFileAttribute(java.util.List<IFileSpec> files,
java.lang.String attribute,
SetFileAttributesOptions opts)
Unset file attributes on one or more files (unsupported).
|
java.util.List<IFileSpec> |
unsetFileAttributes(java.util.List<IFileSpec> files,
java.util.List<java.lang.String> attributes,
SetFileAttributesOptions opts)
Set file attributes on one.
|
java.lang.String |
updateBranchSpec(IBranchSpec branchSpec)
Update the data fields in an existing branch spec.
|
java.lang.String |
updateClient(IClient client) |
java.lang.String |
updateClient(IClient client,
boolean force)
Update an existing Perforce client on the current Perforce server.
|
java.lang.String |
updateClient(IClient client,
UpdateClientOptions opts)
Update an existing Perforce client on the current Perforce server.
|
java.lang.String |
updateExtensionConfig(IExtension extension,
java.lang.String namespace,
java.lang.String instanceConfig)
Updates an extension's global/instance config.
|
java.lang.String |
updateJob(IJob job)
Update a Perforce job on the Perforce server.
|
java.lang.String |
updateLabel(ILabel label)
Update an existing Perforce label in the Perforce server.
|
java.lang.String |
updateLicense(ILicense license) |
java.lang.String |
updateProtectionEntries(java.util.List<IProtectionEntry> entryList)
Replace the protections table data on the Perforce server with these new
protection entries.
|
java.lang.String |
updateSpec(CustomSpec type,
java.util.Map<java.lang.String,java.lang.Object> spec)
Usage: p4 spec [ -i ] type
|
java.lang.String |
updateSpecString(CustomSpec type,
java.lang.String spec)
Usage: p4 spec [ -i ] type
|
java.lang.String |
updateStream(IStream stream,
StreamOptions opts)
Update a Perforce stream spec on the Perforce server.
|
java.lang.String |
updateTriggerEntries(java.util.List<ITriggerEntry> entryList)
Replace the triggers table data on the Perforce server with these new
triggers entries.
|
java.lang.String |
updateUser(IUser user,
boolean force)
Update a Perforce user on the Perforce server.
|
java.lang.String |
updateUser(IUser user,
UpdateUserOptions opts)
Update a Perforce user on the Perforce server.
|
java.lang.String |
updateUserGroup(IUserGroup group,
boolean updateIfOwner)
Update a Perforce user group on the Perforce server.
|
java.lang.String |
updateUserGroup(IUserGroup group,
UpdateUserGroupOptions opts)
Update a Perforce user group on the Perforce server.
|
java.util.List<IExtendedFileSpec> |
verifyFiles(java.util.List<IFileSpec> fileSpecs,
VerifyFilesOptions opts)
Verify that the server archives are intact.
|
execMapCmdList, handleErrorStr, handleFileErrorStr
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addTrust, addTrust, addTrust, execInputStringMapCmdList, execInputStringMapCmdList, execInputStringStreamCmd, execInputStringStreamingMapCmd, execMapCmdList, execQuietMapCmdList, execStreamCmd, getAuthId, getTicketsFilePath, getTrust, getTrustFilePath, getTrusts, getTrusts, removeTrust, removeTrust, setAuthTicket, setAuthTicket, setTicketsFilePath, setTrustFilePath
execInputStringMapCmd, execInputStringStreamingMapComd, execMapCmd, execQuietMapCmd, execQuietStreamCmd, execStreamingMapCommand, execStreamingMapCommand, getAuthTicket, getAuthTicket, getGenericCode, getSeverityCode, isLoginNotRequired, supportsSmartMove
execMapCmdList, execMapCmdList, execMapCmdList, execStreamCmd, getErrorOrInfoStr, getErrorStr, getInfoStr, handleErrorStr, handleFileErrorStr, isAuthFail, isInfoMessage
public static final java.lang.String SCREEN_NAME_FIELD_NAME
public static final java.lang.String IMPL_COMMENTS_FIELD_NAME
public static final java.lang.String IMPL_TYPE_FIELD_NAME
public static final java.lang.String MINIMUM_SUPPORTED_SERVER_LEVEL_FIELD_NAME
public static final java.lang.String PROTOCOL_NAME_FIELD_NAME
public static final java.lang.String DEFAULT_STATUS_FIELD_NAME
public static final java.lang.String P4TICKETS_ENV_VAR
public static final java.lang.String P4TICKETS_DEFAULT_WINDOWS
public static final java.lang.String P4TICKETS_DEFAULT_OTHER
public static final java.lang.String P4TRUST_ENV_VAR
public static final java.lang.String P4TRUST_DEFAULT_WINDOWS
public static final java.lang.String P4TRUST_DEFAULT_OTHER
public static final java.lang.String P4IGNORE_ENV_VAR
protected static final java.lang.String CORE_AUTH_FAIL_STRING_1
protected static final java.lang.String CORE_AUTH_FAIL_STRING_2
protected static final java.lang.String CORE_AUTH_FAIL_STRING_3
protected static final java.lang.String CORE_AUTH_FAIL_STRING_4
protected static final int UNKNOWN_SERVER_VERSION
protected static final java.lang.String UNKNOWN_SERVER_HOST
protected static final int UNKNOWN_SERVER_PORT
protected static boolean runningOnWindows
protected UsageOptions usageOptions
protected ServerStatus status
protected java.util.Properties props
protected IServerInfo serverInfo
protected java.lang.String serverAddress
protected boolean caseSensitive
protected int serverVersion
protected java.lang.String serverHost
protected int serverPort
protected IServerAddress.Protocol serverProtocol
protected java.lang.String userName
protected java.lang.String password
protected java.util.Map<java.lang.String,java.lang.String> authTickets
protected IClient client
protected java.lang.String clientName
protected java.lang.String clientPath
protected java.lang.String clientUnsetName
protected boolean setupOnConnect
protected boolean loginOnConnect
protected ICommandCallback commandCallback
protected IProgressCallback progressCallback
protected ISSOCallback ssoCallback
protected IBrowserCallback browserCallback
protected java.lang.String ssoKey
protected java.lang.String charsetName
protected P4Charset p4Charset
protected boolean connected
protected int minimumSupportedServerVersion
protected java.lang.String tmpDirName
protected java.util.concurrent.atomic.AtomicInteger nextCmdCallBackKey
protected java.util.concurrent.atomic.AtomicInteger nextProgressCallbackKey
protected boolean nonCheckedSyncs
protected boolean enableStreams
protected boolean enableAndmaps
protected boolean enableGraph
protected boolean enableTracking
protected boolean enableProgress
protected boolean quietMode
protected boolean secure
protected boolean useAuthMemoryStore
protected java.lang.String ignoreFileName
protected java.lang.String rsh
protected java.lang.Object browserVersion
protected java.util.Random rand
public static java.lang.String guardNull(java.lang.String str)
public static java.lang.String[] getPreferredPathArray(java.lang.String[] preamble, java.util.List<IFileSpec> specList)
public static java.lang.String[] getPreferredPathArray(java.lang.String[] preamble, java.util.List<IFileSpec> specList, boolean annotate)
public static java.lang.String[] populatePathArray(java.lang.String[] pathArray, int start, java.util.List<IFileSpec> fileSpecList)
public static boolean isRunningOnWindows()
public java.lang.String getCharsetName()
IServer
getCharsetName
in interface IServer
public java.lang.String getClientName()
public void setClientName(java.lang.String clientName)
public java.lang.String getClientPath()
public void setClientPath(java.lang.String clientPath)
IServer
A list of directories to which Perforce applications are permitted to write. Any attempt by a Perforce application to access or modify files outside these areas of the filesystem will result in an error message. To specify more than one directory, separate the directories with semicolons.
setClientPath
in interface IServer
clientPath
- client pathpublic java.lang.String getIgnoreFileName()
public void setIgnoreFileName(java.lang.String ignoreFileName)
public ServerStatus getStatus()
IServer
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 java.util.List<IRevListCommit> getGraphRevList(GraphRevListOptions options) throws P4JavaException
getGraphRevList
in interface IGraphRevListDelegator
options
- graph Revision List OptionsP4JavaException
- API errorspublic java.util.List<ICommit> getGraphCommitLogList(GraphCommitLogOptions options) throws P4JavaException
ICommitDelegator
getGraphCommitLogList
in interface ICommitDelegator
getGraphCommitLogList
in interface IGraphCommitLogDelegator
options
- graph log optionsP4JavaException
- API errorpublic void doGraphReceivePack(GraphReceivePackOptions options) throws P4JavaException
doGraphReceivePack
in interface IGraphReceivePackDelegator
P4JavaException
public ListData getListData(java.util.List<IFileSpec> fileSpecs, ListOptions options) throws P4JavaException
getListData
in interface IListDelegator
fileSpecs
- List of file specsoptions
- Command optionsP4JavaException
- API errorspublic ListData getListData(java.util.List<IFileSpec> fileSpecs, ListOptions options, java.lang.String clientName) throws P4JavaException
Use IClient.getListData to restrict list to client view.
getListData
in interface IListDelegator
fileSpecs
- List of file specsoptions
- Command optionsP4JavaException
- API errorspublic java.lang.String getUserName()
IServer
getUserName
in interface IServer
public void setUserName(java.lang.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".public boolean isCaseSensitive()
IServer
isCaseSensitive
in interface IServer
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
public boolean isEnableProgress()
public void setEnableProgress(boolean enableProgress)
public boolean isEnableTracking()
public void setEnableTracking(boolean enableTracking)
public boolean isNonCheckedSyncs()
public void setNonCheckedSyncs(boolean nonCheckedSyncs)
public boolean isQuietMode()
public void setQuietMode(boolean quietMode)
protected boolean isSecure()
protected void setSecure(boolean secure)
secure
- securepublic int getServerVersion() throws ConnectionException
IServer
NOTE: has the side effect of setting the server impl's serverVersion field.
getServerVersion
in interface IServer
ConnectionException
- on errorpublic void setCurrentServerInfo(IServerInfo info)
IServer
setCurrentServerInfo
in interface IServer
info
- possibly-null Perforce server informationpublic IServerInfo getCurrentServerInfo()
IServer
getCurrentServerInfo
in interface IServer
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 callerRequestException
- if the Perforce server encounters an error during its
processing of the requestConfigException
- if local I/O exception occurspublic 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
- on errorAccessException
- on errorpublic java.lang.String getAuthTicket()
IServer
getAuthTicket
in interface IServer
public void setAuthTicket(java.lang.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 ticketpublic java.lang.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
public java.util.Properties getProperties()
IServer
getProperties
in interface IServer
public int getServerVersionNumber()
IServer
getServerVersionNumber
in interface IServer
public java.lang.String getWorkingDirectory()
IServer
getWorkingDirectory
in interface IServer
public void setWorkingDirectory(java.lang.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 IClient getCurrentClient()
IServer
getCurrentClient
in interface IServer
public void setCurrentClient(IClient client)
IServer
setCurrentClient
in interface IServer
client
- client objectpublic 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.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.public void registerSSOCallback(ISSOCallback callback, java.lang.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 callbackpublic void registerBrowserCallback(IBrowserCallback browserCallback)
IServer
See the IBrowserCallback Javadoc comments for an explanation of the browser callback feature; note that only one browser callback can be active and registered for a given P4server object at any one time.
registerBrowserCallback
in interface IServer
browserCallback
- BrowserCallback object to be registered; if null, browser
callbacks are disabled.public boolean setCharsetName(java.lang.String charsetName) throws java.nio.charset.UnsupportedCharsetException
IServer
setCharsetName
in interface IServer
charsetName
- charset name; if null, resets the charset to "no charset".java.nio.charset.UnsupportedCharsetException
- if the Perforce server doesn't support or recognize the
charset name.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 requestAccessException
- if the Perforce server denies access to the callerpublic ServerStatus init(java.lang.String host, int port, java.util.Properties properties, 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 methodproperties
- 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.secure
- secure optionConfigException
- 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).public ServerStatus init(java.lang.String host, int port, java.util.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).public ServerStatus init(java.lang.String host, int port, java.util.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 methodprops
- 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).protected java.lang.String getDefaultP4TicketsFile()
protected java.lang.String getDefaultP4TrustFile()
protected java.lang.String getInfoServerAddress()
protected int parseVersionString(java.lang.String versionString)
versionString
- versionStringprotected int getRandomInt()
public ISSOCallback getSSOCallback()
public java.lang.String getSSOKey()
public IBrowserCallback getBrowserCallback()
protected boolean isUnicode()
public java.util.List<IFileSpec> unsetFileAttribute(java.util.List<IFileSpec> files, java.lang.String attribute, SetFileAttributesOptions opts) throws P4JavaException
IAttributeDelegator
unsetFileAttribute
in interface IAttributeDelegator
files
- non-null list of files to be affectedattribute
- attribute to remove from perforceopts
- SetFileAttributesOptions object describing optional
parameters; if null, no options are set.P4JavaException
- if an error occurs processing this method and its parameters.public java.util.List<IFileSpec> unsetFileAttributes(java.util.List<IFileSpec> files, java.util.List<java.lang.String> attributes, SetFileAttributesOptions opts) throws P4JavaException
IAttributeDelegator
unsetFileAttributes
in interface IAttributeDelegator
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.public java.util.List<IFileSpec> setFileAttributes(java.util.List<IFileSpec> files, java.util.Map<java.lang.String,java.lang.String> attributes, SetFileAttributesOptions opts) throws P4JavaException
IAttributeDelegator
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 IAttributeDelegator
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.public java.util.List<IFileSpec> setFileAttributes(java.util.List<IFileSpec> files, @Nonnull java.lang.String attributeName, @Nonnull java.io.InputStream inStream, SetFileAttributesOptions opts) throws P4JavaException
IAttributeDelegator
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 IAttributeDelegator
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.public java.util.List<IBranchSpecSummary> getBranchSpecs(GetBranchSpecsOptions opts) throws P4JavaException
IBranchesDelegator
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 IBranchesDelegator
opts
- object describing optional parameters; if null, no options are
set.P4JavaException
- if any error occurs in the processing of this method.public java.util.List<IBranchSpecSummary> getBranchSpecs(java.lang.String userName, java.lang.String nameFilter, int maxReturns) throws ConnectionException, RequestException, AccessException
IBranchesDelegator
getBranchSpecs
in interface IBranchesDelegator
userName
- user namenameFilter
- name filtermaxReturns
- maximum resultsConnectionException
- connection errorsRequestException
- server request errorsAccessException
- access restrictionspublic IBranchSpec getBranchSpec(java.lang.String name, GetBranchSpecOptions opts) throws P4JavaException
IBranchDelegator
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 IBranchDelegator
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.public java.lang.String deleteBranchSpec(java.lang.String branchSpecName, DeleteBranchSpecOptions opts) throws P4JavaException
IBranchDelegator
deleteBranchSpec
in interface IBranchDelegator
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.public IBranchSpec getBranchSpec(java.lang.String name) throws ConnectionException, RequestException, AccessException
IBranchDelegator
getBranchSpec
in interface IBranchDelegator
name
- the name of the branchConnectionException
- when there is an error talking to the Helix serverRequestException
- when there is a problem with the data provided in the requestAccessException
- when access to the branch command is not authorisedpublic java.lang.String createBranchSpec(@Nonnull IBranchSpec branchSpec) throws ConnectionException, RequestException, AccessException
IBranchDelegator
createBranchSpec
in interface IBranchDelegator
branchSpec
- the spec object containing the branch data fields.ConnectionException
- when there is an error talking to the Helix serverRequestException
- when there is a problem with the data provided in the requestAccessException
- when access to the branch command is not authorisedpublic java.lang.String updateBranchSpec(@Nonnull IBranchSpec branchSpec) throws ConnectionException, RequestException, AccessException
IBranchDelegator
updateBranchSpec
in interface IBranchDelegator
branchSpec
- the branch dataConnectionException
- when there is an error talking to the Helix serverRequestException
- when there is a problem with the data provided in the requestAccessException
- when access to the branch command is not authorised@Deprecated public java.lang.String deleteBranchSpec(java.lang.String branchSpecName, boolean force) throws ConnectionException, RequestException, AccessException
IBranchDelegator
deleteBranchSpec
in interface IBranchDelegator
branchSpecName
- the name of the spec to deleteforce
- whether to force the operation throughConnectionException
- when there is an error talking to the Helix serverRequestException
- when there is a problem with the data provided in the requestAccessException
- when access to the branch command is not authorisedpublic java.lang.String deletePendingChangelist(int id) throws ConnectionException, RequestException, AccessException
IChangeDelegator
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 IChangeDelegator
id
- the ID of the Perforce pending changelist to be deleted.ConnectionException
- the connection exceptionRequestException
- the request exceptionAccessException
- the access exceptionpublic IChangelist getChangelist(int id) throws ConnectionException, RequestException, AccessException
IChangeDelegator
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 IChangeDelegator
id
- the Perforce changelist ID; if id is IChangelist.DEFAULT, get
the default changelist for the current client (if available)ConnectionException
- the connection exceptionRequestException
- the request exceptionAccessException
- the access exceptionpublic java.lang.String deletePendingChangelist(int id, ChangelistOptions opts) throws P4JavaException
IChangeDelegator
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 IChangeDelegator
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 methodpublic IChangelist getChangelist(int id, ChangelistOptions opts) throws P4JavaException
IChangeDelegator
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 IChangeDelegator
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 methodpublic java.util.List<IChangelistSummary> getChangelists(int maxMostRecent, java.util.List<IFileSpec> fileSpecs, java.lang.String clientName, java.lang.String userName, boolean includeIntegrated, IChangelist.Type type, boolean longDesc) throws ConnectionException, RequestException, AccessException
IChangesDelegator
getChangelists
in interface IChangesDelegator
maxMostRecent
- the max most recentfileSpecs
- the file specsclientName
- the client nameuserName
- the user nameincludeIntegrated
- the include integratedtype
- the typelongDesc
- the long descConnectionException
- the connection exceptionRequestException
- the request exceptionAccessException
- the access exceptionpublic java.util.List<IChangelistSummary> getChangelists(int maxMostRecent, java.util.List<IFileSpec> fileSpecs, java.lang.String clientName, java.lang.String userName, boolean includeIntegrated, boolean submittedOnly, boolean pendingOnly, boolean longDesc) throws ConnectionException, RequestException, AccessException
IChangesDelegator
getChangelists
in interface IChangesDelegator
maxMostRecent
- the max most recentfileSpecs
- the file specsclientName
- the client nameuserName
- the user nameincludeIntegrated
- the include integratedsubmittedOnly
- the submitted onlypendingOnly
- the pending onlylongDesc
- the long descConnectionException
- the connection exceptionRequestException
- the request exceptionAccessException
- the access exceptionpublic java.util.List<IChangelistSummary> getChangelists(java.util.List<IFileSpec> fileSpecs, GetChangelistsOptions opts) throws P4JavaException
IChangesDelegator
getChangelists
in interface IChangesDelegator
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 methodpublic java.io.InputStream getChangelistDiffs(int id, GetChangelistDiffsOptions opts) throws P4JavaException
IDescribeDelegator
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 IDescribeDelegator
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.public java.io.InputStream getChangelistDiffsStream(int id, DescribeOptions options) throws ConnectionException, RequestException, AccessException
IDescribeDelegator
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 IDescribeDelegator
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 requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<IFileSpec> getShelvedFiles(int changelistId) throws P4JavaException
IDescribeDelegator
getShelvedFiles
in interface IDescribeDelegator
changelistId
- numeric pending changelist identifierP4JavaException
- if an error occurs processing this method and its parameters.public java.util.List<IFileSpec> getShelvedFiles(int changelistId, int max) throws P4JavaException
IDescribeDelegator
getShelvedFiles
in interface IDescribeDelegator
changelistId
- numeric pending changelist identifiermax
- limit the number of files returnedP4JavaException
- if an error occurs processing this method and its parameters.public java.io.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 requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<IFileSpec> getChangelistFiles(int id) throws ConnectionException, RequestException, AccessException
IDescribeDelegator
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 IDescribeDelegator
id
- numeric changelist identifierConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<IFileSpec> getChangelistFiles(int id, int max) throws ConnectionException, RequestException, AccessException
IDescribeDelegator
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 IDescribeDelegator
id
- numeric changelist identifiermax
- limit the number of files returnedConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<IExtendedFileSpec> getChangelistExtendedFiles(int id) throws ConnectionException, RequestException, AccessException
IDescribeDelegator
The IExtendedFileSpec 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.
getChangelistExtendedFiles
in interface IDescribeDelegator
id
- numeric changelist identifierConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<IExtendedFileSpec> getChangelistExtendedFiles(int id, int max) throws ConnectionException, RequestException, AccessException
IDescribeDelegator
The IExtendedFileSpec 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.
getChangelistExtendedFiles
in interface IDescribeDelegator
id
- numeric changelist identifiermax
- limit the number of files returnedConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<IFileSpec> getCommitFiles(java.lang.String repo, java.lang.String commit) throws ConnectionException, RequestException, AccessException
getCommitFiles
in interface IServer
repo
- the graph repocommit
- the commit SHAConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.lang.String setOrUnsetServerConfigurationValue(@Nonnull java.lang.String name, @Nullable java.lang.String value) throws P4JavaException
IConfigureDelegator
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.
setOrUnsetServerConfigurationValue
in interface IConfigureDelegator
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.public java.util.List<ServerConfigurationValue> showServerConfiguration(java.lang.String serverName, java.lang.String variableName) throws P4JavaException
IConfigureDelegator
Note: you must be an admin or super user for this command to work.
showServerConfiguration
in interface IConfigureDelegator
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.public java.util.List<IDbSchema> getDbSchema(java.util.List<java.lang.String> tableSpecs) throws P4JavaException
IDBSchemaDelegator
getDbSchema
in interface IDBSchemaDelegator
tableSpecs
- the table specsP4JavaException
- the p4 java exceptionpublic IClient getClient(java.lang.String clientName) throws ConnectionException, RequestException, AccessException
getClient
in interface IClientDelegator
ConnectionException
RequestException
AccessException
public IClient getClient(@Nonnull IClientSummary clientSummary) throws ConnectionException, RequestException, AccessException
getClient
in interface IClientDelegator
ConnectionException
RequestException
AccessException
public IClient getClientTemplate(java.lang.String clientName) throws ConnectionException, RequestException, AccessException
getClientTemplate
in interface IClientDelegator
ConnectionException
RequestException
AccessException
public IClient getClientTemplate(java.lang.String clientName, boolean allowExistent) throws ConnectionException, RequestException, AccessException
getClientTemplate
in interface IClientDelegator
ConnectionException
RequestException
AccessException
public IClient getClientTemplate(java.lang.String clientName, GetClientTemplateOptions opts) throws P4JavaException
IClientDelegator
getClientTemplate
in interface IClientDelegator
clientName
- Not blank 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.public java.util.List<IChangelist> getInterchanges(IFileSpec fromFile, IFileSpec toFile, GetInterchangesOptions opts) throws P4JavaException
IInterchangesDelegator
getInterchanges
in interface IInterchangesDelegator
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.public java.util.List<IChangelist> getInterchanges(java.lang.String branchSpecName, java.util.List<IFileSpec> fromFileList, java.util.List<IFileSpec> toFileList, GetInterchangesOptions opts) throws P4JavaException
IInterchangesDelegator
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 IInterchangesDelegator
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.public java.util.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 numberConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<IChangelist> getInterchanges(java.lang.String branchSpecName, java.util.List<IFileSpec> fromFileList, java.util.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.biDirectional
- if true, bi-directional optionConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.lang.String createClient(@Nonnull IClient newClient) throws ConnectionException, RequestException, AccessException
createClient
in interface IClientDelegator
ConnectionException
RequestException
AccessException
public void createTempClient(@Nonnull IClient newClient) throws ConnectionException, RequestException, AccessException
createTempClient
in interface IClientDelegator
ConnectionException
RequestException
AccessException
public java.lang.String updateClient(@Nonnull IClient client) throws ConnectionException, RequestException, AccessException
updateClient
in interface IClientDelegator
ConnectionException
RequestException
AccessException
public java.lang.String updateClient(IClient client, boolean force) throws ConnectionException, RequestException, AccessException
IClientDelegator
updateClient
in interface IClientDelegator
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
- on errorRequestException
- if any error occurs in the processing of this method.AccessException
- on errorpublic java.lang.String updateClient(IClient client, UpdateClientOptions opts) throws P4JavaException
IClientDelegator
updateClient
in interface IClientDelegator
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.public java.lang.String deleteClient(java.lang.String clientName, boolean force) throws ConnectionException, RequestException, AccessException
deleteClient
in interface IClientDelegator
ConnectionException
RequestException
AccessException
public java.lang.String deleteClient(java.lang.String clientName, DeleteClientOptions opts) throws P4JavaException
IClientDelegator
deleteClient
in interface IClientDelegator
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.public java.lang.String switchClientView(java.lang.String templateClientName, java.lang.String targetClientName, SwitchClientViewOptions opts) throws P4JavaException
IClientDelegator
switchClientView
in interface IClientDelegator
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.public java.lang.String switchStreamView(java.lang.String streamPath, java.lang.String targetClientName, SwitchClientViewOptions opts) throws P4JavaException
IClientDelegator
switchStreamView
in interface IClientDelegator
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.public java.util.List<IClientSummary> getClients(GetClientsOptions opts) throws P4JavaException
IClientsDelegator
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 IClientsDelegator
opts
- GetClientsOptions object describing optional parameters; if null, no options are
set.P4JavaException
- if any error occurs in the processing of this method.public java.util.List<IClientSummary> getClients(java.lang.String userName, java.lang.String nameFilter, int maxResults) throws ConnectionException, RequestException, AccessException
IClientsDelegator
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 IClientsDelegator
userName
- user namenameFilter
- limits output to clients whose name matches the nameFilter pattern.
Corresponds to -enameFilter flagmaxResults
- If greater than zero, limit output to the first maxResults number of
clients.ConnectionException
- on errorRequestException
- on errorAccessException
- on errorpublic java.lang.String getCounter(java.lang.String counterName) throws ConnectionException, RequestException, AccessException
getCounter
in interface ICounterDelegator
ConnectionException
RequestException
AccessException
public java.lang.String getCounter(java.lang.String counterName, CounterOptions opts) throws P4JavaException
ICounterDelegator
Note that despite their name, counters can be any value, not just a number; hence the string return value here.
getCounter
in interface ICounterDelegator
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.public void setCounter(java.lang.String counterName, java.lang.String value, boolean perforceCounter) throws ConnectionException, RequestException, AccessException
setCounter
in interface ICounterDelegator
ConnectionException
RequestException
AccessException
public java.lang.String setCounter(java.lang.String counterName, java.lang.String value, CounterOptions opts) throws P4JavaException
ICounterDelegator
setCounter
in interface ICounterDelegator
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.public void deleteCounter(java.lang.String counterName, boolean perforceCounter) throws ConnectionException, RequestException, AccessException
deleteCounter
in interface ICounterDelegator
ConnectionException
RequestException
AccessException
public java.util.Map<java.lang.String,java.lang.String> getCounters(GetCountersOptions opts) throws P4JavaException
ICountersDelegator
getCounters
in interface ICountersDelegator
opts
- GetCountersOptions object describing optional parameters; if
null, no options are set.P4JavaException
- if an error occurs processing this method and its parameters.@Deprecated public java.util.Map<java.lang.String,java.lang.String> getCounters(CounterOptions opts) throws P4JavaException
ICountersDelegator
getCounters
in interface ICountersDelegator
opts
- CounterOptions object describing optional parameters; if null,
no options are set.P4JavaException
- if an error occurs processing this method and its parameters.public java.util.Map<java.lang.String,java.lang.String> getCounters() throws ConnectionException, RequestException, AccessException
ICountersDelegator
getCounters
in interface ICountersDelegator
ConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerIServer
public ServerStatus init(java.lang.String host, int port, java.util.Properties props, UsageOptions opts, boolean secure, java.lang.String rsh) 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.secure
- indicates whether the server is secure (SSL) or not.rsh
- the 'rsh' mode server launch command.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).public java.lang.String createDepot(@Nonnull IDepot newDepot) throws P4JavaException
IDepotDelegator
createDepot
in interface IDepotDelegator
newDepot
- non-null IDepot object representing the depot to be created.P4JavaException
- if any error occurs in the processing of this method.public java.lang.String deleteDepot(java.lang.String name) throws P4JavaException
IDepotDelegator
deleteDepot
in interface IDepotDelegator
name
- non-null IDepot object representing the depot to be deletedP4JavaException
- if any error occurs in the processing of this method.public IDepot getDepot(java.lang.String name) throws P4JavaException
IDepotDelegator
getDepot
in interface IDepotDelegator
name
- non-null name of the depot to be retrieved.P4JavaException
- if any error occurs in the processing of this method.public java.util.List<IDepot> getDepots() throws ConnectionException, RequestException, AccessException
IDepotsDelegator
getDepots
in interface IDepotsDelegator
ConnectionException
- the connection exceptionRequestException
- the request exceptionAccessException
- the access exceptionpublic java.util.List<IDepot> getDepots(GetDepotsOptions opts) throws P4JavaException
IDepotsDelegator
getDepots
in interface IDepotsDelegator
opts
- optionsP4JavaException
- on errorpublic java.util.List<IRepo> getRepos() throws ConnectionException, RequestException, AccessException
IReposDelegator
getRepos
in interface IReposDelegator
ConnectionException
- the connection exceptionRequestException
- the request exceptionAccessException
- the access exceptionpublic java.util.List<IRepo> getRepos(ReposOptions options) throws P4JavaException
IReposDelegator
getRepos
in interface IReposDelegator
options
- Repos filter optionsP4JavaException
- an api exceptionpublic java.util.List<IRepo> getRepos(java.lang.String clientName) throws ConnectionException, RequestException, AccessException
IReposDelegator
getRepos
in interface IReposDelegator
clientName
- the name of the client workspaceConnectionException
- on errorRequestException
- on errorAccessException
- on errorpublic java.util.List<IFileDiff> getFileDiffs(IFileSpec file1, IFileSpec file2, java.lang.String branchSpecName, GetFileDiffsOptions opts) throws P4JavaException
IDiff2Delegator
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 IDiff2Delegator
file1
- (optional, with a branch view) source file IFileSpecfile2
- (optional, with a branch view) target 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.public java.io.InputStream getFileDiffsStream(IFileSpec file1, IFileSpec file2, java.lang.String branchSpecName, GetFileDiffsOptions opts) throws P4JavaException
IDiff2Delegator
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 IDiff2Delegator
file1
- (optional, with a branch view) source file IFileSpecfile2
- (optional, with a branch view) target 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.public java.util.List<IFileDiff> getFileDiffs(IFileSpec file1, IFileSpec file2, java.lang.String branchSpecName, DiffType diffType, boolean quiet, boolean includeNonTextDiffs, boolean gnuDiffs) throws ConnectionException, RequestException, AccessException
IDiff2Delegator
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 IDiff2Delegator
file1
- optional first file IFileSpecfile2
- optional second file IFileSpecbranchSpecName
- optional branch spec namediffType
- diff typequiet
- 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 requestAccessException
- if the Perforce server denies access to the callerpublic java.io.InputStream getServerFileDiffs(IFileSpec file1, IFileSpec file2, java.lang.String branchSpecName, DiffType diffType, boolean quiet, boolean includeNonTextDiffs, boolean gnuDiffs) throws ConnectionException, RequestException, AccessException
IDiff2Delegator
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 IDiff2Delegator
file1
- optional first file IFileSpecfile2
- optional second file IFileSpecbranchSpecName
- optional branch spec namediffType
- diff typequiet
- 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 requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<IDiskSpace> getDiskSpace(java.util.List<java.lang.String> filesystems) throws P4JavaException
IDiskspaceDelegator
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 IDiskspaceDelegator
filesystems
- if not null, specify a list of Perforce named filesystem(s).P4JavaException
- if an error occurs processing this method and its parameters.public java.util.List<IFileSpec> duplicateRevisions(IFileSpec fromFile, IFileSpec toFile, DuplicateRevisionsOptions opts) throws P4JavaException
IDuplicateDelegator
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 IDuplicateDelegator
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.public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getExportRecords(ExportRecordsOptions opts) throws P4JavaException
IExportDelegator
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 IExportDelegator
opts
- ExportRecordsOptions object describing optional parameters; if null, no options
are set.P4JavaException
- if an error occurs processing this method and its parameters.public void getStreamingExportRecords(ExportRecordsOptions opts, @Nonnull IStreamingCallback callback, int key) throws P4JavaException
IExportDelegator
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 IExportDelegator
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.public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getExportRecords(boolean useJournal, long maxRecs, int sourceNum, long offset, boolean format, java.lang.String journalPrefix, java.lang.String filter) throws ConnectionException, RequestException, AccessException
IExportDelegator
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 IExportDelegator
useJournal
- *If true, specifies a journal number and optional offset position (journal
number/offset) from which to start exporting. Corresponds to the '-j
token' flag.
If false, specifies a checkpoint number and optional offset position (checkpoint number#offset) from which to start exporting. Corresponds to the '-c token' flag.
maxRecs
- If greater than zero, limits the number of lines (records) exported.
Corresponds to the '-l lines' flag.sourceNum
- If positive, specifies a journal or checkpoint number. Corresponds to the
'token' part of the '-j token' and '-c token' flags.
The '-j token' flag specifies a journal number and optional position (in the form: journal number/offset) from which to start exporting. The -c token flag specifies a checkpoint number and optional position (in the form: checkpoint number#offset) from which to start exporting.
offset
- If positive, specifies a journal or checkpoint optional offset position
(journal number/offset or checkpoint number#offset) from which to start
exporting.format
- If true, formats non-textual datatypes appropriately. Corresponds to the
'-f' flag.journalPrefix
- If non-null, specifies a file name prefix to match the one used with 'p4d
-jc prefix'. Corresponds to the '-J' flag.filter
- If non-null, limits output to records that match the filter pattern.
Corresponds to the '-F' flag.ConnectionException
- on errorRequestException
- on errorAccessException
- on errorpublic java.util.List<IFileAnnotation> getFileAnnotations(java.util.List<IFileSpec> fileSpecs, @Nonnull DiffType wsOpts, boolean allResults, boolean useChangeNumbers, boolean followBranches) throws ConnectionException, RequestException, AccessException
getFileAnnotations
in interface IFileAnnotateDelegator
fileSpecs
- non-null list of file specs to be annotated.wsOpts
- If non-null, use the DiffType
value to determine whitespace
options.allResults
- If true, include both deleted files and lines no longer present
at the head revision; corresponds to the -a flag.useChangeNumbers
- If true, annotate with change numbers rather than revision numbers
with each line; correspond to the -c flag.followBranches
- If true, follow branches; corresponds to the -f flag.ConnectionException
- connection errorsRequestException
- server request errorsAccessException
- access restrictionspublic java.util.List<IFileAnnotation> getFileAnnotations(java.util.List<IFileSpec> fileSpecs, GetFileAnnotationsOptions opts) throws P4JavaException
IFileAnnotateDelegator
getFileAnnotations
in interface IFileAnnotateDelegator
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.public java.util.Map<IFileSpec,java.util.List<IFileRevisionData>> getRevisionHistory(java.util.List<IFileSpec> fileSpecs, GetRevisionHistoryOptions opts) throws P4JavaException
IFileLogDelegator
getRevisionHistory
in interface IFileLogDelegator
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.public java.util.Map<IFileSpec,java.util.List<IFileRevisionData>> getRevisionHistory(java.util.List<IFileSpec> fileSpecs, int maxRevs, boolean contentHistory, boolean includeInherited, boolean longOutput, boolean truncatedLongOutput) throws ConnectionException, AccessException
IFileLogDelegator
getRevisionHistory
in interface IFileLogDelegator
fileSpecs
- fileSpecs to be processed; if null or empty, an empty Map is
returned.maxRevs
- If positive, displays at most 'maxRevs' revisions per file of the
file[rev] argument specified. Corresponds to -m.contentHistory
- If true, display file content history instead of file name
history. Corresponds to -h.includeInherited
- If true, causes inherited file history to be displayed as well.
Corresponds to -i.longOutput
- If true, produces long output with the full text of the changelist
descriptions. Corresponds to -l.truncatedLongOutput
- If true, produces long output with the full text of the changelist
descriptions truncated to 250 characters. Corresponds to -L.ConnectionException
- on errorAccessException
- on errorpublic java.util.List<IFileSpec> getDirectories(@Nonnull java.util.List<IFileSpec> fileSpecs, boolean clientOnly, boolean deletedOnly, boolean haveListOnly) throws ConnectionException, AccessException
IDirsDelegator
getDirectories
in interface IDirsDelegator
fileSpecs
- the file specsclientOnly
- the client onlydeletedOnly
- the deleted onlyhaveListOnly
- the have list onlyConnectionException
- the connection exceptionAccessException
- the access exceptionpublic java.util.List<IFileSpec> getDirectories(java.util.List<IFileSpec> fileSpecs, GetDirectoriesOptions opts) throws P4JavaException
IDirsDelegator
getDirectories
in interface IDirsDelegator
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.public java.util.List<IFileSpec> getDepotFiles(@Nonnull java.util.List<IFileSpec> fileSpecs, boolean allRevs) throws ConnectionException, AccessException
IFilesDelegator
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 IFilesDelegator
fileSpecs
- the file specsallRevs
- the all revsConnectionException
- the connection exceptionAccessException
- the access exceptionpublic java.util.List<IFileSpec> getDepotFiles(@Nonnull java.util.List<IFileSpec> fileSpecs, GetDepotFilesOptions opts) throws P4JavaException
IFilesDelegator
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 IFilesDelegator
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.public java.util.List<IFix> fixJobs(java.util.List<java.lang.String> jobIds, int changeListId, java.lang.String status, boolean delete) throws ConnectionException, RequestException, AccessException
IFixDelegator
fixJobs
in interface IFixDelegator
jobIds
- non-null non-empty list of affected job IDs.changeListId
- changelist ID for affected changelist.status
- the statusdelete
- whether to delete.ConnectionException
- the connection exceptionRequestException
- the request exceptionAccessException
- the access exceptionpublic java.util.List<IFix> fixJobs(@Nonnull java.util.List<java.lang.String> jobIds, int changeListId, FixJobsOptions opts) throws P4JavaException
IFixDelegator
fixJobs
in interface IFixDelegator
jobIds
- 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.public java.util.List<IFix> getFixList(java.util.List<IFileSpec> fileSpecs, int changeListId, java.lang.String jobId, boolean includeIntegrations, int maxFixes) throws ConnectionException, RequestException, AccessException
IFixesDelegator
Note that this method (unlike the main file list methods) throws an exception and stops at the first encountered error.
getFixList
in interface IFixesDelegator
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 fixesConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<IFix> getFixes(java.util.List<IFileSpec> fileSpecs, GetFixesOptions opts) throws P4JavaException
IFixesDelegator
Note that this method (unlike the main file list methods) throws an exception and stops at the first encountered error.
getFixes
in interface IFixesDelegator
fileSpecs
- if given, restrict output to fixes associated with these filesopts
- FixListOptions object describing optional parameters; if null,
no options are setP4JavaException
- if any error occurs in the processing of this method.public java.util.List<IExtendedFileSpec> getExtendedFiles(java.util.List<IFileSpec> fileSpecs, int maxFiles, int sinceChangelist, int affectedByChangelist, FileStatOutputOptions outputOptions, FileStatAncilliaryOptions ancilliaryOptions) throws ConnectionException, AccessException
IFstatDelegator
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 IFstatDelegator
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
usedConnectionException
- if the Perforce server is unreachable or is not connected.AccessException
- if the Perforce server denies access to the callerpublic java.util.List<IExtendedFileSpec> getExtendedFiles(java.util.List<IFileSpec> fileSpecs, GetExtendedFilesOptions opts) throws P4JavaException
IFstatDelegator
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 IFstatDelegator
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.public java.util.List<IFileLineMatch> getMatchingLines(java.util.List<IFileSpec> fileSpecs, java.lang.String pattern, MatchingLinesOptions options) throws P4JavaException
IGrepDelegator
getMatchingLines
in interface IGrepDelegator
fileSpecs
- file specs to search for matching linespattern
- non-null string pattern to be passed to the grep commandoptions
- - Options to grep commandP4JavaException
- if any error occurs in the processing of this method.public java.util.List<IFileLineMatch> getMatchingLines(@Nonnull java.util.List<IFileSpec> fileSpecs, @Nonnull java.lang.String pattern, @Nullable java.util.List<java.lang.String> infoLines, MatchingLinesOptions options) throws P4JavaException
IGrepDelegator
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 IGrepDelegator
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 commandP4JavaException
- if any error occurs in the processing of this method.public IServerInfo getServerInfo() throws ConnectionException, RequestException, AccessException
IInfoDelegator
getServerInfo
in interface IInfoDelegator
ConnectionException
- the connection exceptionRequestException
- the request exceptionAccessException
- the access exceptionpublic java.lang.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.public java.lang.String createUserGroup(IUserGroup group, UpdateUserGroupOptions opts) throws P4JavaException
IGroupDelegator
createUserGroup
in interface IGroupDelegator
group
- non-null IUserGroup to be created.opts
- which create options to be appliedConnectionException
- 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
public java.lang.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.public java.lang.String deleteUserGroup(IUserGroup group, UpdateUserGroupOptions opts) throws P4JavaException
IGroupDelegator
deleteUserGroup
in interface IGroupDelegator
group
- non-null group to be deleted.opts
- which delete options to be appliedConnectionException
- 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
public IUserGroup getUserGroup(java.lang.String name) throws ConnectionException, RequestException, AccessException
IGroupDelegator
getUserGroup
in interface IGroupDelegator
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.public java.lang.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.public java.lang.String updateUserGroup(IUserGroup group, UpdateUserGroupOptions opts) throws P4JavaException
IGroupDelegator
updateUserGroup
in interface IGroupDelegator
group
- non-null user group to be updated.opts
- which update options to be appliedConnectionException
- 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
public java.util.List<IUserGroup> getUserGroups(java.lang.String userOrGroupName, GetUserGroupsOptions opts) throws P4JavaException
IGroupsDelegator
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 IGroupsDelegator
userOrGroupName
- if non-null, restrict the list to the specified group or
username.opts
- GetUserGroupsOptions object describing optional parameters; if
null, no options are setP4JavaException
- if any error occurs in the processing of this method.public java.util.List<IUserGroup> getUserGroups(java.lang.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.public java.util.List<IFileSpec> getSubmittedIntegrations(java.util.List<IFileSpec> fileSpecs, java.lang.String branchSpec, boolean reverseMappings) throws ConnectionException, RequestException, AccessException
IIntegratedDelegator
getSubmittedIntegrations
in interface IIntegratedDelegator
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 requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<IFileSpec> getSubmittedIntegrations(java.util.List<IFileSpec> fileSpecs, GetSubmittedIntegrationsOptions opts) throws P4JavaException
IIntegratedDelegator
getSubmittedIntegrations
in interface IIntegratedDelegator
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.public IStreamIntegrationStatus getStreamIntegrationStatus(java.lang.String stream, StreamIntegrationStatusOptions opts) throws P4JavaException
IStatDelegator
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 IStatDelegator
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.public IJob createJob(@Nonnull java.util.Map<java.lang.String,java.lang.Object> fieldMap) throws ConnectionException, RequestException, AccessException
IJobDelegator
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 IJobDelegator
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 requestAccessException
- if the Perforce server denies access to the callerpublic java.lang.String deleteJob(java.lang.String jobId) throws ConnectionException, RequestException, AccessException
IJobDelegator
deleteJob
in interface IJobDelegator
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 requestAccessException
- if the Perforce server denies access to the callerpublic IJob getJob(java.lang.String jobId) throws ConnectionException, RequestException, AccessException
IJobDelegator
getJob
in interface IJobDelegator
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 requestAccessException
- if the Perforce server denies access to the callerpublic java.lang.String updateJob(@Nonnull IJob job) throws ConnectionException, RequestException, AccessException
IJobDelegator
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 IJobDelegator
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 requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<IJob> getJobs(java.util.List<IFileSpec> fileSpecs, int maxJobs, boolean longDescriptions, boolean reverseOrder, boolean includeIntegrated, java.lang.String jobView) throws ConnectionException, RequestException, AccessException
IJobsDelegator
Note that this method (unlike the main file list methods) throws an exception and stops at the first encountered error.
getJobs
in interface IJobsDelegator
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 requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<IJob> getJobs(java.util.List<IFileSpec> fileSpecs, GetJobsOptions opts) throws P4JavaException
IJobsDelegator
Note that this method (unlike the main file list methods) throws an exception and stops at the first encountered error.
getJobs
in interface IJobsDelegator
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.public IJobSpec getJobSpec() throws ConnectionException, RequestException, AccessException
IJobSpecDelegator
getJobSpec
in interface IJobSpecDelegator
ConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.lang.String deleteKey(java.lang.String keyName) throws P4JavaException
IKeyDelegator
deleteKey
in interface IKeyDelegator
keyName
- non-null key name.P4JavaException
- if an error occurs processing this method and its parameters.public java.lang.String setKey(java.lang.String keyName, java.lang.String value, KeyOptions opts) throws P4JavaException
IKeyDelegator
setKey
in interface IKeyDelegator
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.public java.lang.String getKey(java.lang.String keyName) throws P4JavaException
IKeyDelegator
getKey
in interface IKeyDelegator
keyName
- non-null key name.P4JavaException
- if an error occurs processing this method and its parameters.public java.util.Map<java.lang.String,java.lang.String> getKeys(GetKeysOptions opts) throws P4JavaException
IKeysDelegator
getKeys
in interface IKeysDelegator
opts
- GetKeysOptions object describing optional parameters; if null,
no options are set.P4JavaException
- if an error occurs processing this method and its parameters.public java.lang.String createLabel(@Nonnull ILabel label) throws ConnectionException, RequestException, AccessException
ILabelDelegator
createLabel
in interface ILabelDelegator
label
- non-null ILabel to be savedConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.lang.String deleteLabel(java.lang.String labelName, boolean force) throws ConnectionException, RequestException, AccessException
ILabelDelegator
deleteLabel
in interface ILabelDelegator
labelName
- non-null label nameforce
- if true, forces the deletion of any label; normally labels can
only be deleted by their ownerConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.lang.String deleteLabel(java.lang.String labelName, DeleteLabelOptions opts) throws P4JavaException
ILabelDelegator
deleteLabel
in interface ILabelDelegator
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.public ILabel getLabel(java.lang.String labelName) throws ConnectionException, RequestException, AccessException
ILabelDelegator
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 ILabelDelegator
labelName
- non-null label nameConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.lang.String updateLabel(@Nonnull ILabel label) throws ConnectionException, RequestException, AccessException
ILabelDelegator
updateLabel
in interface ILabelDelegator
label
- non-null ILabel to be updatedConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<ILabelSummary> getLabels(java.lang.String user, int maxLabels, java.lang.String nameFilter, java.util.List<IFileSpec> fileList) throws ConnectionException, RequestException, AccessException
ILabelsDelegator
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 ILabelsDelegator
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
filesConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<ILabelSummary> getLabels(java.util.List<IFileSpec> fileList, GetLabelsOptions opts) throws P4JavaException
ILabelsDelegator
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 ILabelsDelegator
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.public void journalWait(JournalWaitOptions opts) throws P4JavaException
IJournalWaitDelegator
Note that this method uses a deep undoc 'p4 journalwait [-i]' command.
journalWait
in interface IJournalWaitDelegator
opts
- JournalWaitOptions object describing optional parameters; if null, no options are
set.P4JavaException
- if an error occurs processing this method and its parameters.public java.lang.String getLoginStatus() throws P4JavaException
ILoginDelegator
getLoginStatus
in interface ILoginDelegator
P4JavaException
- if any errors occur during the processing of this command.public void login(java.lang.String password) throws ConnectionException, RequestException, AccessException, ConfigException
ILoginDelegator
login
in interface ILoginDelegator
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 requestAccessException
- if the Perforce server denies access to the callerConfigException
- if the p4tickets file could not be updated successfullypublic void login(java.lang.String password, boolean allHosts) throws ConnectionException, RequestException, AccessException, ConfigException
ILoginDelegator
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...).
login
in interface ILoginDelegator
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 requestAccessException
- if the Perforce server denies access to the callerConfigException
- if the p4tickets file could not be updated successfullypublic void login(java.lang.String password, LoginOptions opts) throws P4JavaException
ILoginDelegator
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 ILoginDelegator
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.public void login(java.lang.String password, java.lang.StringBuffer ticket, LoginOptions opts) throws P4JavaException
ILoginDelegator
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 ILoginDelegator
password
- Perforce actuallPassword; can be null if no actuallPassword 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.public void login(@Nonnull IUser user, java.lang.StringBuffer ticket, LoginOptions opts) throws P4JavaException
ILoginDelegator
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 ILoginDelegator
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.public boolean isDontWriteTicket(java.lang.String cmd, java.lang.String[] cmdArgs)
ILoginDelegator
isDontWriteTicket
in interface ILoginDelegator
cmd
- the cmdcmdArgs
- the cmd argspublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> login2(Login2Options opts, java.lang.String user) throws P4JavaException
ILogin2Delegator
login2
in interface ILogin2Delegator
opts
- Login2Optionsuser
- non-null Perforce user; login request is for this specified
user, requires 'super' permission.P4JavaException
- if any errors occur during the processing of this command.public java.lang.String getLogin2Status() throws P4JavaException
ILogin2Delegator
getLogin2Status
in interface ILogin2Delegator
P4JavaException
- if any errors occur during the processing of this command.public java.lang.String getLogin2Status(IUser user) throws P4JavaException
ILogin2Delegator
getLogin2Status
in interface ILogin2Delegator
user
- Specifying a username requires 'super' access, which is granted by 'p4 protect'.P4JavaException
- if any errors occur during the processing of this command.public java.util.Map<java.lang.String,java.lang.String> login2ListMethods() throws P4JavaException
ILogin2Delegator
login2ListMethods
in interface ILogin2Delegator
P4JavaException
- if any errors occur during the processing of this command.public java.lang.String login2InitAuth(java.lang.String method) throws P4JavaException
ILogin2Delegator
login2InitAuth
in interface ILogin2Delegator
method
- Second factor authentication method, chosen from the list provided by 'list-methods'.P4JavaException
- if any errors occur during the processing of this command.public java.lang.String login2CheckAuth(java.lang.String auth, boolean persist) throws P4JavaException
ILogin2Delegator
login2CheckAuth
in interface ILogin2Delegator
auth
- The answer to the second factor authorization prompt.persist
- Persist the second factor authorization even after the user's ticket has expired.P4JavaException
- if any errors occur during the processing of this command.public java.lang.String login2(IUser user, Login2Options opts) throws P4JavaException
ILogin2Delegator
login2
in interface ILogin2Delegator
user
- Specifying a username requires 'super' access, which is granted by 'p4 protect'.opts
- Login2OptionsP4JavaException
- if any errors occur during the processing of this command.public void logout() throws ConnectionException, RequestException, AccessException, ConfigException
ILogoutDelegator
logout
in interface ILogoutDelegator
ConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerConfigException
- if the p4tickets file could not be updated successfullypublic void logout(LoginOptions opts) throws P4JavaException
ILogoutDelegator
logout
in interface ILogoutDelegator
opts
- currently ignored; can be null.P4JavaException
- if any error occurs in the processing of this method.public java.util.List<IServerProcess> getServerProcesses() throws ConnectionException, RequestException, AccessException
IMonitorDelegator
getServerProcesses
in interface IMonitorDelegator
ConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<IServerProcess> getServerProcesses(GetServerProcessesOptions opts) throws P4JavaException
IMonitorDelegator
getServerProcesses
in interface IMonitorDelegator
opts
- GetServerProcessesOptions
object describing optional parameters; if
null, no options are set.P4JavaException
- if an error occurs processing this method and its parameters.public ILogTail getLogTail(LogTailOptions opts) throws P4JavaException
ILogTailDelegator
getLogTail
in interface ILogTailDelegator
opts
- the optsP4JavaException
- the p4 java exceptionpublic java.util.List<IFileSpec> getOpenedFiles(java.util.List<IFileSpec> fileSpecs, boolean allClients, java.lang.String clientName, int maxFiles, int changeListId) throws ConnectionException, AccessException
IOpenedDelegator
The returned list can be modified with the other arguments as described below.
getOpenedFiles
in interface IOpenedDelegator
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 callerpublic java.util.List<IFileSpec> getOpenedFiles(java.util.List<IFileSpec> fileSpecs, OpenedFilesOptions opts) throws P4JavaException
IOpenedDelegator
getOpenedFiles
in interface IOpenedDelegator
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.public java.util.List<IFileSpec> moveFile(int changelistId, boolean listOnly, boolean noClientMove, java.lang.String fileType, @Nonnull IFileSpec fromFile, @Nonnull IFileSpec toFile) throws ConnectionException, RequestException, AccessException
IMoveDelegator
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 IMoveDelegator
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 requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<IFileSpec> moveFile(@Nonnull IFileSpec fromFile, @Nonnull IFileSpec toFile, @Nullable MoveFileOptions opts) throws P4JavaException
IMoveDelegator
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 IMoveDelegator
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.public java.util.List<IObliterateResult> obliterateFiles(@Nonnull java.util.List<IFileSpec> fileSpecs, ObliterateFilesOptions opts) throws P4JavaException
IObliterateDelegator
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 IObliterateResult 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 IObliterateDelegator
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 parameterspublic java.lang.String changePassword(java.lang.String oldPassword, java.lang.String newPassword, java.lang.String userName) throws P4JavaException
IPasswdDelegator
Note: setting the 'newPassword' to null or empty will delete the password.
changePassword
in interface IPasswdDelegator
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.public java.io.InputStream getFileContents(java.util.List<IFileSpec> fileSpecs, GetFileContentsOptions opts) throws P4JavaException
IPrintDelegator
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 IPrintDelegator
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.public java.io.InputStream getFileContents(java.util.List<IFileSpec> fileSpecs, boolean allrevs, boolean noHeaderLine) throws ConnectionException, RequestException, AccessException
getFileContents
in interface IPrintDelegator
ConnectionException
RequestException
AccessException
public java.lang.String setProperty(java.lang.String name, java.lang.String value, PropertyOptions opts) throws P4JavaException
IPropertyDelegator
This method require that the user have 'admin' access granted by 'p4 protect'.
setProperty
in interface IPropertyDelegator
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.public java.util.List<IProperty> getProperty(GetPropertyOptions opts) throws P4JavaException
IPropertyDelegator
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 IPropertyDelegator
opts
- GetPropertyOptions object describing optional parameters; if
null, no options are set.P4JavaException
- if an error occurs processing this method and its parameters.public java.lang.String deleteProperty(java.lang.String name, PropertyOptions opts) throws P4JavaException
IPropertyDelegator
This method require that the user have 'admin' access granted by 'p4 protect'.
deleteProperty
in interface IPropertyDelegator
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.public java.lang.String createProtectionEntries(@Nonnull java.util.List<IProtectionEntry> entryList) throws P4JavaException
IProtectDelegator
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 IProtectDelegator
entryList
- non-null list of protection entries.P4JavaException
- if an error occurs processing this method and its parameters.public java.lang.String updateProtectionEntries(@Nonnull java.util.List<IProtectionEntry> entryList) throws P4JavaException
IProtectDelegator
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 IProtectDelegator
entryList
- non-null list of protection entries.P4JavaException
- if an error occurs processing this method and its parameters.public java.io.InputStream getProtectionsTable() throws P4JavaException
IProtectDelegator
getProtectionsTable
in interface IProtectDelegator
P4JavaException
- if any error occurs in the processing of this method.public java.util.List<IProtectionEntry> getProtectionEntries(java.util.List<IFileSpec> fileList, GetProtectionEntriesOptions opts) throws P4JavaException
IProtectsDelegator
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 IProtectsDelegator
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.public java.util.List<IProtectionEntry> getProtectionEntries(boolean allUsers, java.lang.String hostName, java.lang.String userName, java.lang.String groupName, java.util.List<IFileSpec> fileList) throws ConnectionException, RequestException, AccessException
IProtectsDelegator
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 IProtectsDelegator
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.public java.lang.String reload(ReloadOptions opts) throws P4JavaException
IReloadDelegator
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 IReloadDelegator
opts
- possibly-null ReloadOptions object specifying method options.P4JavaException
- if an error occurs processing this method and its parameters.public java.lang.String renameUser(java.lang.String oldUserName, java.lang.String newUserName) throws P4JavaException
IRenameUserDelegator
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 IRenameUserDelegator
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.public java.util.List<IReviewChangelist> getReviewChangelists(GetReviewChangelistsOptions opts) throws P4JavaException
IReviewDelegator
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 IReviewDelegator
opts
- GetReviewChangelistsOptions object describing optional
parameters; if null, no options are set.P4JavaException
- if any error occurs in the processing of this method.public java.util.List<IUserSummary> getReviews(int changelistId, java.util.List<IFileSpec> fileSpecs) throws ConnectionException, RequestException, AccessException
IReviewsDelegator
Note that the returned IUserSummary objects will have null access and update dates associated with them.
getReviews
in interface IReviewsDelegator
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 requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<IUserSummary> getReviews(java.util.List<IFileSpec> fileSpecs, GetReviewsOptions opts) throws P4JavaException
IReviewsDelegator
Note that the returned IUserSummary objects will have null access and update dates associated with them.
getReviews
in interface IReviewsDelegator
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.public java.util.List<java.lang.String> searchJobs(java.lang.String words, SearchJobsOptions opts) throws P4JavaException
ISearchDelegator
Note that this is an 'undoc' Perforce command.
See also 'p4 help index'.
searchJobs
in interface ISearchDelegator
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.public java.util.List<IFileSize> getFileSizes(java.util.List<IFileSpec> fileSpecs, GetFileSizesOptions opts) throws P4JavaException
ISizesDelegator
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 ISizesDelegator
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.public java.lang.String createStream(@Nonnull IStream stream) throws P4JavaException
IStreamDelegator
createStream
in interface IStreamDelegator
stream
- non-null IStream object representing the stream to be created.P4JavaException
- if any error occurs in the processing of this method.public IStream getStream(@Nonnull java.lang.String streamPath) throws P4JavaException
IStreamDelegator
getStream
in interface IStreamDelegator
streamPath
- non-null stream's path in a stream depot, of the form
//depotname/streamnameP4JavaException
- if any error occurs in the processing of this method.public IStream getStream(java.lang.String streamPath, GetStreamOptions opts) throws P4JavaException
IStreamDelegator
getStream
in interface IStreamDelegator
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.public java.lang.String updateStream(IStream stream, StreamOptions opts) throws P4JavaException
IStreamDelegator
updateStream
in interface IStreamDelegator
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.public java.lang.String deleteStream(java.lang.String streamPath, StreamOptions opts) throws P4JavaException
IStreamDelegator
deleteStream
in interface IStreamDelegator
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.public java.util.List<IStreamSummary> getStreams(java.util.List<java.lang.String> streamPaths, GetStreamsOptions opts) throws P4JavaException
IStreamsDelegator
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 IStreamsDelegator
streamPaths
- if specified, the list of streams is limited to those matching
the supplied list of stream paths, of the form
//depotname/streamnameopts
- object describing optional parameters; if null, no options are
set.P4JavaException
- if any error occurs in the processing of this method.public java.util.List<IFileSpec> tagFiles(java.util.List<IFileSpec> fileSpecs, java.lang.String labelName, boolean listOnly, boolean delete) throws ConnectionException, RequestException, AccessException
ITagDelegator
tagFiles
in interface ITagDelegator
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 requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<IFileSpec> tagFiles(java.util.List<IFileSpec> fileSpecs, java.lang.String labelName, TagFilesOptions opts) throws P4JavaException
tagFiles
in interface ITagDelegator
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.public java.lang.String createTriggerEntries(@Nonnull java.util.List<ITriggerEntry> entryList) throws P4JavaException
ITriggersDelegator
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 ITriggersDelegator
entryList
- non-null list of trigger entries.P4JavaException
- if an error occurs processing this method and its parameters.public java.util.List<ITriggerEntry> getTriggerEntries() throws P4JavaException
ITriggersDelegator
This method require that the user have 'super' access granted by 'p4 protect'.
getTriggerEntries
in interface ITriggersDelegator
P4JavaException
- if any error occurs in the processing of this method.public java.lang.String updateTriggerEntries(@Nonnull java.util.List<ITriggerEntry> entryList) throws P4JavaException
ITriggersDelegator
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 ITriggersDelegator
entryList
- non-null list of trigger entries.P4JavaException
- if an error occurs processing this method and its parameters.public java.io.InputStream getTriggersTable() throws P4JavaException
ITriggersDelegator
This method require that the user have 'super' access granted by 'p4 protect'.
getTriggersTable
in interface ITriggersDelegator
P4JavaException
- if any error occurs in the processing of this method.public java.lang.String createUser(@Nonnull IUser user, boolean force) throws ConnectionException, RequestException, AccessException
IUserDelegator
createUser
in interface IUserDelegator
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 requestAccessException
- if the Perforce server denies access to the callerpublic java.lang.String createUser(@Nonnull IUser user, UpdateUserOptions opts) throws P4JavaException
IUserDelegator
createUser
in interface IUserDelegator
user
- non-null IUser defining the new user to be created.opts
- UpdateUserOptions object describing optional parameters; if
null, no options are setP4JavaException
- if any error occurs in the processing of this method.public java.lang.String updateUser(@Nonnull IUser user, UpdateUserOptions opts) throws P4JavaException
IUserDelegator
updateUser
in interface IUserDelegator
user
- non-null IUser defining the new user to be updated.opts
- UpdateUserOptions object describing optional parameters; if
null, no options are setP4JavaException
- if any error occurs in the processing of this method.public java.lang.String updateUser(@Nonnull IUser user, boolean force) throws ConnectionException, RequestException, AccessException
IUserDelegator
updateUser
in interface IUserDelegator
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 requestAccessException
- if the Perforce server denies access to the callerpublic java.lang.String deleteUser(java.lang.String userName, boolean force) throws ConnectionException, RequestException, AccessException
IUserDelegator
deleteUser
in interface IUserDelegator
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 requestAccessException
- if the Perforce server denies access to the callerpublic java.lang.String deleteUser(java.lang.String userName, UpdateUserOptions opts) throws P4JavaException
IUserDelegator
deleteUser
in interface IUserDelegator
userName
- non-null name of the user to be deleted.opts
- UpdateUserOptions object describing optional parameters; if
null, no options are setP4JavaException
- if any error occurs in the processing of this method.public IUser getUser(java.lang.String userName) throws ConnectionException, RequestException, AccessException
IUserDelegator
getUser
in interface IUserDelegator
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 requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<IUserSummary> getUsers(java.util.List<java.lang.String> userList, int maxUsers) throws ConnectionException, RequestException, AccessException
IUsersDelegator
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 IUsersDelegator
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 requestAccessException
- if the Perforce server denies access to the callerpublic java.util.List<IUserSummary> getUsers(java.util.List<java.lang.String> userList, GetUsersOptions opts) throws P4JavaException
IUsersDelegator
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 IUsersDelegator
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
setP4JavaException
- if any error occurs in the processing of this method.public java.lang.String unload(UnloadOptions opts) throws P4JavaException
IUnloadDelegator
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 IUnloadDelegator
opts
- possibly-null UnloadOptions object specifying method options.P4JavaException
- if an error occurs processing this method and its parameters.public java.util.List<IExtendedFileSpec> verifyFiles(java.util.List<IFileSpec> fileSpecs, VerifyFilesOptions opts) throws P4JavaException
IVerifyDelegator
This method require that the user be an operator or have 'admin' access, which is granted by 'p4 protect'.
verifyFiles
in interface IVerifyDelegator
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.public java.util.List<IGraphListTree> getGraphListTree(java.lang.String sha) throws P4JavaException
getGraphListTree
in interface IGraphListTreeDelegator
sha
- graph SHAP4JavaException
- API errorspublic java.util.List<IGraphRef> getGraphShowRefs(GraphShowRefOptions opts) throws P4JavaException
getGraphShowRefs
in interface IGraphShowRefDelegator
opts
- graph Show Ref OptionsP4JavaException
- API errorspublic java.util.Map<java.lang.String,java.lang.Object> getSpec(CustomSpec type) throws P4JavaException
getSpec
in interface ISpecDelegator
type
- spec type, ('job' or 'stream') to be updated.P4JavaException
- if any error occurs in the processing of this method.public java.lang.String updateSpec(CustomSpec type, java.util.Map<java.lang.String,java.lang.Object> spec) throws P4JavaException
updateSpec
in interface ISpecDelegator
type
- spec type, ('job' or 'stream') to be updated.spec
- updated spec as a map.P4JavaException
- if any error occurs in the processing of this method.public java.lang.String updateSpecString(CustomSpec type, java.lang.String spec) throws P4JavaException
updateSpecString
in interface ISpecDelegator
type
- spec type, ('job' or 'stream') to be updated.spec
- updated spec as a String.P4JavaException
- if any error occurs in the processing of this method.public ILicenseLimits getLimits() throws P4JavaException
getLimits
in interface ILicenseDelegator
P4JavaException
public ILicense getLicense() throws P4JavaException
getLicense
in interface ILicenseDelegator
P4JavaException
public java.lang.String updateLicense(ILicense license) throws P4JavaException
updateLicense
in interface ILicenseDelegator
P4JavaException
public java.lang.String sampleExtension(java.lang.String extnName) throws P4JavaException
IExtensionDelegator
sampleExtension
in interface IExtensionDelegator
extnName
- - name of the extensionP4JavaException
- on errorpublic java.lang.String packageExtension(java.lang.String dirName) throws P4JavaException
IExtensionDelegator
packageExtension
in interface IExtensionDelegator
dirName
- - Directory name containing main.lua and manifest.json for the extensionP4JavaException
- on errorpublic ExtensionSummary installExtension(java.lang.String extnPackageName, boolean allowUnsigned) throws P4JavaException
IExtensionDelegator
installExtension
in interface IExtensionDelegator
extnPackageName
- - Name of the extension package file. For ex. p4java-obliterate-extn.p4-extensionallowUnsigned
- if trueP4JavaException
- on errorpublic java.lang.String createExtensionConfig(IExtension extension, java.lang.String namespace, java.lang.String instanceConfig) throws P4JavaException
IExtensionDelegator
createExtensionConfig
in interface IExtensionDelegator
extension
- extensionnamespace
- name spaceinstanceConfig
- - If provided, creates/updates this instance config.P4JavaException
- on errorpublic java.lang.String updateExtensionConfig(IExtension extension, java.lang.String namespace, java.lang.String instanceConfig) throws P4JavaException
IExtensionDelegator
updateExtensionConfig
in interface IExtensionDelegator
extension
- extensionnamespace
- name spaceinstanceConfig
- - If provided updates this instance config.P4JavaException
- on errorpublic java.util.List<ExtensionSummary> listExtensions(java.lang.String type) throws P4JavaException
IExtensionDelegator
listExtensions
in interface IExtensionDelegator
type
- - Can be "extensions" or "configs"P4JavaException
- on errorpublic java.lang.String deleteExtension(java.lang.String namespace, java.lang.String extnName) throws P4JavaException
IExtensionDelegator
deleteExtension
in interface IExtensionDelegator
namespace
- name spaceextnName
- extension nameP4JavaException
- on errorpublic Extension getExtensionConfig(java.lang.String namespace, java.lang.String name, java.lang.String instanceName) throws P4JavaException
IExtensionDelegator
getExtensionConfig
in interface IExtensionDelegator
namespace
- name spacename
- extension nameinstanceName
- Optional, only required for instance configP4JavaException
- on errorpublic ICommit getCommitObject(java.lang.String sha) throws P4JavaException
getCommitObject
in interface ICommitDelegator
sha
- graph SHAP4JavaException
- API errorspublic ICommit getCommitObject(java.lang.String sha, java.lang.String repo) throws P4JavaException
getCommitObject
in interface ICommitDelegator
sha
- graph SHArepo
- graph repoP4JavaException
- API errorspublic java.io.InputStream getBlobObject(java.lang.String repo, java.lang.String sha) throws P4JavaException
getBlobObject
in interface ICommitDelegator
repo
- graph reposha
- graph SHAP4JavaException
- API errorspublic IGraphObject getGraphObject(java.lang.String sha) throws P4JavaException
getGraphObject
in interface ICommitDelegator
sha
- graph SHAP4JavaException
- API errors@Deprecated public IFileSpec handleFileReturn(java.util.Map<java.lang.String,java.lang.Object> map) throws AccessException, ConnectionException
ResultListBuilder
map
- mapAccessException
- on errorConnectionException
- on error@Deprecated public IFileSpec handleFileReturn(java.util.Map<java.lang.String,java.lang.Object> map, IClient client) throws AccessException, ConnectionException
ResultListBuilder
map
- mapclient
- clientAccessException
- on errorConnectionException
- on errorpublic abstract IServerAddress getServerAddressDetails()
public java.util.Map<java.lang.String,java.util.List<IStreamlog>> getStreamlog(java.util.List<java.lang.String> streamPaths, StreamlogOptions opts) throws P4JavaException
IStreamlogDelegator
getStreamlog
in interface IStreamlogDelegator
streamPaths
- Stream paths to get history.opts
- Command options.P4JavaException
- on errorStreamlogOptions(java.lang.String...)
,
IStreamlog