public interface IServer extends IHelixCommandExecutor, IAttributeDelegator, IBranchDelegator, IBranchesDelegator, IChangeDelegator, IChangesDelegator, IClientDelegator, IClientsDelegator, IConfigureDelegator, ICounterDelegator, ICountersDelegator, IDBSchemaDelegator, IDepotDelegator, IDepotsDelegator, IReposDelegator, IDescribeDelegator, IDiff2Delegator, IDirsDelegator, IDiskspaceDelegator, IDuplicateDelegator, IExportDelegator, IFileAnnotateDelegator, IFileLogDelegator, IFilesDelegator, IFixDelegator, IFixesDelegator, IFstatDelegator, IGrepDelegator, IGroupDelegator, IGroupsDelegator, IInfoDelegator, IIntegratedDelegator, IInterchangesDelegator, IStatDelegator, IJobDelegator, IJobsDelegator, IJobSpecDelegator, IJournalWaitDelegator, IKeyDelegator, IKeysDelegator, ILabelDelegator, ILabelsDelegator, ILoginDelegator, ILogoutDelegator, ILogTailDelegator, IMonitorDelegator, IMoveDelegator, IObliterateDelegator, IOpenedDelegator, IPasswdDelegator, IPrintDelegator, IPropertyDelegator, IProtectDelegator, IProtectsDelegator, IReloadDelegator, IRenameUserDelegator, IReviewDelegator, IReviewsDelegator, ISearchDelegator, ISizesDelegator, IStreamDelegator, IStreamsDelegator, ITagDelegator, ITriggersDelegator, IUnloadDelegator, IUserDelegator, IUsersDelegator, IVerifyDelegator, IGraphListTreeDelegator, ICommitDelegator, IGraphRevListDelegator, IGraphCommitLogDelegator, IGraphReceivePackDelegator, IListDelegator, IGraphShowRefDelegator, ILogin2Delegator, ISpecDelegator, ILicenseDelegator, IExtensionDelegator, IStreamlogDelegator, IRenameClientDelegator
This is the main interface for Perforce services that are typically Perforce client workspace-independent, or that affect entire Perforce depots or servers. Some of these services are also available through various client, job, changelist, etc., interfaces methods, but in general, most Perforce services are always available through methods on this interface as well.
IServer interfaces for specific Perforce servers are issued by the P4Javs server factory class, ServerFactory; the factory can return interfaces that use a small variety of communication protocols to access the Perforce server.
ServerFactory
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTRIBUTE_STREAM_MAP_KEY |
static java.lang.String |
IN_MAP_USE_TAGS_KEY
Property key for overriding the default tagged/non-tagged behavior of a
command.
|
Modifier and Type | Method and Description |
---|---|
void |
connect()
Connect to the Perforce server associated with this server object.
|
java.lang.String |
createUserGroup(IUserGroup group)
Create a new Perforce user group on the Perforce server.
|
java.lang.String |
deleteUserGroup(IUserGroup group)
Delete a Perforce user group from the Perforce server.
|
void |
disconnect()
Disconnect from this Perforce server.
|
java.util.Map<java.lang.String,java.lang.Object>[] |
execInputStringMapCmd(java.lang.String cmdName,
java.lang.String[] cmdArgs,
java.lang.String inString)
Issue an arbitrary P4Java command to the Perforce server and return the
results as a map.
|
void |
execInputStringStreamingMapComd(java.lang.String cmdName,
java.lang.String[] cmdArgs,
java.lang.String inString,
IStreamingCallback callback,
int key)
Deprecated.
|
java.util.Map<java.lang.String,java.lang.Object>[] |
execMapCmd(java.lang.String cmdName,
java.lang.String[] cmdArgs,
java.util.Map<java.lang.String,java.lang.Object> inMap)
Issue an arbitrary P4Java command to the Perforce server and return the
results as a map.
|
java.util.Map<java.lang.String,java.lang.Object>[] |
execQuietMapCmd(java.lang.String cmdName,
java.lang.String[] cmdArgs,
java.util.Map<java.lang.String,java.lang.Object> inMap)
Issue an arbitrary P4Java command to the Perforce server and return the
results as a map without invoking any command callbacks.
|
java.io.InputStream |
execQuietStreamCmd(java.lang.String cmdName,
java.lang.String[] cmdArgs)
Issue an arbitrary P4Java command to the Perforce server and get the
results as a stream without invoking any command callbacks.
|
void |
execStreamingMapCommand(java.lang.String cmdName,
java.lang.String[] cmdArgs,
java.util.Map<java.lang.String,java.lang.Object> inMap,
IStreamingCallback callback,
int key)
Issue a streaming map command to the Perforce server, using an optional
map for any input expected by the server (such as label or job specs,
etc.).
|
void |
execStreamingMapCommand(java.lang.String cmdName,
java.lang.String[] cmdArgs,
java.util.Map<java.lang.String,java.lang.Object> inMap,
IStreamingCallback callback,
int key,
IParallelCallback parallelCallback)
Issue a parallelised streaming map command to the Perforce server, using an optional
map for any input expected by the server (such as label or job specs,
etc.).
|
java.lang.String |
getAuthTicket()
Return the current Perforce authentication ticket being used by this
server, if any.
|
java.lang.String |
getAuthTicket(java.lang.String userName)
Return the Perforce authentication ticket for specified user.
|
java.lang.String |
getAuthTicket(java.lang.String userName,
java.lang.String serverId)
Return the Perforce authentication ticket for specified user.
|
java.io.InputStream |
getChangelistDiffs(int id,
DiffType diffType)
Get an InputStream onto the file diffs associated with a specific
submitted changelist.
|
java.lang.String |
getCharsetName()
Get the current charset name for the server connection.
|
java.util.List<IFileSpec> |
getCommitFiles(java.lang.String repo,
java.lang.String commit) |
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`.
|
int |
getGenericCode(java.util.Map<java.lang.String,java.lang.Object> map) |
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(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.lang.String[] |
getKnownCharsets()
Return an array of strings representing "known" charsets (e.g.
|
java.util.Properties |
getProperties()
Return the Java properties associated with this 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.
|
int |
getSeverityCode(java.util.Map<java.lang.String,java.lang.Object> map) |
ServerStatus |
getStatus()
Return the current status of this server object.
|
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.lang.String |
getUserName()
Return the user name currently associated with this server, if any.
|
java.lang.String |
getWorkingDirectory()
Get the underlying server's notion of the current working directory.
|
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 |
isLoginNotRequired(java.lang.String msgStr) |
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 callback)
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.
|
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 |
setClientPath(java.lang.String clientPath)
Set the Perforce P4CLIENTPATH - directories the client can access.
|
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 |
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.
|
boolean |
supportsSmartMove()
Return true IFF the underlying Perforce server supports the new 2009.1
and later "smart move" command.
|
boolean |
supportsUnicode()
Return true if the underlying Perforce server supports Unicode (and is
connected).
|
java.lang.String |
updateUserGroup(IUserGroup group,
boolean updateIfOwner)
Update a Perforce user group on the Perforce server.
|
execMapCmdList, execMapCmdList, execMapCmdList, execStreamCmd, execStreamCmdForBuffer, getErrorOrInfoStr, getErrorStr, getInfoStr, handleErrorStr, handleFileErrorStr, isAuthFail, isInfoMessage
setFileAttributes, setFileAttributes, unsetFileAttribute, unsetFileAttributes
createBranchSpec, deleteBranchSpec, deleteBranchSpec, getBranchSpec, getBranchSpec, updateBranchSpec
getBranchSpecs, getBranchSpecs
deletePendingChangelist, deletePendingChangelist, getChangelist, getChangelist
getChangelists, getChangelists, getChangelists
createClient, createTempClient, deleteClient, deleteClient, getClient, getClient, getClientTemplate, getClientTemplate, getClientTemplate, switchClientView, switchStreamView, updateClient, updateClient, updateClient
getClients, getClients
setOrUnsetServerConfigurationValue, showServerConfiguration
deleteCounter, getCounter, getCounter, setCounter, setCounter
getCounters, getCounters, getCounters
getDbSchema
createDepot, deleteDepot, getDepot
getDepots, getDepots
getRepos, getRepos, getRepos
getChangelistDiffs, getChangelistDiffsStream, getChangelistExtendedFiles, getChangelistExtendedFiles, getChangelistFiles, getChangelistFiles, getShelvedFiles, getShelvedFiles
getFileDiffs, getFileDiffs, getFileDiffsStream, getServerFileDiffs
getDirectories, getDirectories
getDiskSpace
duplicateRevisions
getExportRecords, getExportRecords, getStreamingExportRecords
getFileAnnotations, getFileAnnotations
getRevisionHistory, getRevisionHistory
getDepotFiles, getDepotFiles
fixJobs, fixJobs
getFixes, getFixList
getExtendedFiles, getExtendedFiles
getMatchingLines, getMatchingLines
createUserGroup, deleteUserGroup, getUserGroup, updateUserGroup
getUserGroups
getServerInfo
getSubmittedIntegrations, getSubmittedIntegrations
getInterchanges, getInterchanges
getStreamIntegrationStatus
createJob, deleteJob, getJob, updateJob
getJobs, getJobs
getJobSpec
journalWait
deleteKey, getKey, setKey
getKeys
createLabel, deleteLabel, deleteLabel, getLabel, updateLabel
getLabels, getLabels
getLoginStatus, isDontWriteTicket, login, login, login, login, login
logout, logout
getLogTail
getServerProcesses, getServerProcesses
moveFile, moveFile
obliterateFiles
getOpenedFiles, getOpenedFiles
changePassword
getFileContents, getFileContents, getFileContents
deleteProperty, getProperty, setProperty
createProtectionEntries, getProtectionsTable, updateProtectionEntries
getProtectionEntries, getProtectionEntries
reload
renameUser
getReviewChangelists
getReviews, getReviews
searchJobs
getFileSizes
createStream, deleteStream, getStream, getStream, updateStream
getStreams
tagFiles, tagFiles
createTriggerEntries, getTriggerEntries, getTriggersTable, updateTriggerEntries
unload
createUser, createUser, deleteUser, deleteUser, getUser, updateUser, updateUser
getUsers, getUsers
verifyFiles
getGraphListTree
getBlobObject, getCommitObject, getCommitObject, getGraphCommitLogList, getGraphObject
getGraphRevList
getGraphCommitLogList
doGraphReceivePack
getListData, getListData
getGraphShowRefs
getLogin2Status, getLogin2Status, login2, login2, login2CheckAuth, login2InitAuth, login2ListMethods
getSpec, updateSpec, updateSpecString
getLicense, getLimits, getValidServerIPMACAddress, updateLicense
createExtensionConfig, deleteExtension, getExtensionConfig, installExtension, listExtensions, packageExtension, sampleExtension, updateExtensionConfig
getStreamlog
renameClient
static final java.lang.String ATTRIBUTE_STREAM_MAP_KEY
static final java.lang.String IN_MAP_USE_TAGS_KEY
int getServerVersion() throws ConnectionException
NOTE: has the side effect of setting the server impl's serverVersion field.
ConnectionException
- on errorvoid connect() throws ConnectionException, AccessException, RequestException, ConfigException
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.
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 occursjava.lang.String createUserGroup(IUserGroup group) throws ConnectionException, RequestException, AccessException
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.java.lang.String deleteUserGroup(IUserGroup group) throws ConnectionException, RequestException, AccessException
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.void disconnect() throws ConnectionException, AccessException
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.
ConnectionException
- on errorAccessException
- on errorjava.util.Map<java.lang.String,java.lang.Object>[] execInputStringMapCmd(java.lang.String cmdName, java.lang.String[] cmdArgs, java.lang.String inString) throws P4JavaException
This method is intended for low-level commands in the spirit and format of the p4 command line interpreter, and offers a simple way to issue commands to the associated Perforce server without the overhead of the more abstract Java interfaces and methods.
No guidance is given here on the format of the returned map; however, it produces the same output as the p4 command line interpreter in -G (Python map) mode.
Note that this method does not allow you to set "usage" options for the command; these may be added later. Note also that although option arguments passed to this method must be in a form recognized by the p4 command line interpreter, that does not mean the method is being implemented by the interpreter -- the actual implementation depends on the options used to get the server object in the first place from the server factory.
cmdName
- the command to be issued; must be non-null, and correspond to
a Perforce command recognized by P4Java and defined in
CmdSpec.cmdArgs
- the array of command arguments (options and file arguments,
etc.) to be sent to the Perforce server. These must be in the
form used by the corresponding p4 command line interpreter.
Ignored if null.inString
- an optional string to be sent to the server as standard input
unchanged (this must be in the format expected by the server,
typically as required when using the "-i" flag to the p4
command line app for the same command). You must remember to
issue the relevant command-specific option to enable this if
needed.P4JavaException
- if an error occurs processing this method and its parameters@Deprecated void execInputStringStreamingMapComd(java.lang.String cmdName, java.lang.String[] cmdArgs, java.lang.String inString, IStreamingCallback callback, int key) throws P4JavaException
IOptionsServer.execInputStringStreamingMapCmd(java.lang.String, java.lang.String[], java.lang.String, com.perforce.p4java.server.callback.IStreamingCallback, int)
Streaming commands allow users to get each result from a suitably-issued command as it comes in from the server, rather than waiting for the entire command method to complete (and getting the results back as a completed List or Map or whatever).
The results are sent to the user using the IStreamingCallback handleResult method; see the IStreamingCallback Javadoc for details. The payload passed to handleResult is usually the raw map gathered together deep in the RPC protocol layer, and the user is assumed to have the knowledge and technology to be able to parse it and use it suitably in much the same way as a user unpacks or processes the results from the other low-level exec methods like execMapCommand.
NOTE: 'streaming' here has nothing at all to do with Perforce 'streams', which are (or will be) implemented elsewhere.
cmdName
- the command to be issued; must be non-null, and correspond to
a Perforce command recognized by P4Java and defined in
CmdSpec.cmdArgs
- the array of command arguments (options and file arguments,
etc.) to be sent to the Perforce server. These must be in the
form used by the corresponding p4 command line interpreter.
Ignored if null.inString
- an optional string to be sent to the server as standard input
unchanged (this must be in the format expected by the server,
typically as required when using the "-i" flag to the p4
command line app for the same command). You must remember to
issue the relevant command-specific option to enable this if
needed.callback
- a non-null IStreamingCallback to be used to process the
incoming results.key
- an opaque integer key that is passed to the IStreamingCallback
callback methods to identify the action as being associated
with this specific call.P4JavaException
- if an error occurs processing this method and its parameters.java.util.Map<java.lang.String,java.lang.Object>[] execMapCmd(java.lang.String cmdName, java.lang.String[] cmdArgs, java.util.Map<java.lang.String,java.lang.Object> inMap) throws ConnectionException, RequestException, AccessException
This method is intended for low-level commands in the spirit and format of the p4 command line interpreter, and offers a simple way to issue commands to the associated Perforce server without the overhead of the more abstract Java interfaces and methods.
No guidance is given here on the format of the returned map; however, it produces the same output as the p4 command line interpreter in -G (Python map) mode.
Note that this method does not allow you to set "usage" options for the command; these may be added later. Note also that although option arguments passed to this method must be in a form recognized by the p4 command line interpreter, that does not mean the method is being implemented by the interpreter -- the actual implementation depends on the options used to get the server object in the first place from the server factory.
cmdName
- the command to be issued; must be non-null, and correspond to
a Perforce command recognized by P4Java and defined in
CmdSpec.cmdArgs
- the array of command arguments (options and file arguments,
etc.) to be sent to the Perforce server. These must be in the
form used by the corresponding p4 command line interpreter.
Ignored if null.inMap
- an optional map to be sent to the server as standard input,
using the Python map format (-G) form. You must remember to
issue the relevant command-specific option to enable this if
needed.ConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerjava.util.Map<java.lang.String,java.lang.Object>[] execQuietMapCmd(java.lang.String cmdName, java.lang.String[] cmdArgs, java.util.Map<java.lang.String,java.lang.Object> inMap) throws ConnectionException, RequestException, AccessException
Basically equivalent to execMapCmd with temporary disabling of any ICommandCallback calls and / or listeners; this turns out to be useful for various reasons we won't go into here...
cmdName
- the command to be issued; must be non-null, and correspond to
a Perforce command recognized by P4Java and defined in
CmdSpec.cmdArgs
- the array of command arguments (options and file arguments,
etc.) to be sent to the Perforce server. These must be in the
form used by the corresponding p4 command line interpreter.
Ignored if null.inMap
- an optional map to be sent to the server as standard input,
using the Python map format (-G) form. You must remember to
issue the relevant command-specific option to enable this if
needed.ConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerjava.io.InputStream execQuietStreamCmd(java.lang.String cmdName, java.lang.String[] cmdArgs) throws ConnectionException, RequestException, AccessException
Basically equivalent to execStreamCmd with temporary disabling of any ICommandCallback calls and / or listeners; this turns out to be useful for various reasons we won't go into here...
cmdName
- the command to be issued; must be non-null, and correspond to
a Perforce command recognized by P4Java and defined in
CmdSpec.cmdArgs
- the array of command arguments (options and file arguments,
etc.) to be sent to the Perforce server. These must be in the
form used by the corresponding p4 command line interpreter.
Ignored if null.ConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callervoid execStreamingMapCommand(java.lang.String cmdName, java.lang.String[] cmdArgs, java.util.Map<java.lang.String,java.lang.Object> inMap, IStreamingCallback callback, int key) throws P4JavaException
Streaming commands allow users to get each result from a suitably-issued command as it comes in from the server, rather than waiting for the entire command method to complete (and getting the results back as a completed List or Map or whatever).
The results are sent to the user using the IStreamingCallback handleResult method; see the IStreamingCallback Javadoc for details. The payload passed to handleResult is usually the raw map gathered together deep in the RPC protocol layer, and the user is assumed to have the knowledge and technology to be able to parse it and use it suitably in much the same way as a user unpacks or processes the results from the other low-level exec methods like execMapCommand.
NOTE: 'streaming' here has nothing at all to do with Perforce 'streams', which are (or will be) implemented elsewhere.
cmdName
- the command to be issued; must be non-null, and correspond to
a Perforce command recognized by P4Java and defined in
CmdSpec.cmdArgs
- the array of command arguments (options and file arguments,
etc.) to be sent to the Perforce server. These must be in the
form used by the corresponding p4 command line interpreter.
Ignored if null.inMap
- an optional map to be sent to the server as standard input,
using the Python map format (-G) form. You must remember to
issue the relevant command-specific option to enable this if
needed.callback
- a non-null IStreamingCallback to be used to process the
incoming results.key
- an opaque integer key that is passed to the IStreamingCallback
callback methods to identify the action as being associated
with this specific call.P4JavaException
- if an error occurs processing this method and its parameters.void execStreamingMapCommand(java.lang.String cmdName, java.lang.String[] cmdArgs, java.util.Map<java.lang.String,java.lang.Object> inMap, IStreamingCallback callback, int key, IParallelCallback parallelCallback) throws P4JavaException
Streaming commands allow users to get each result from a suitably-issued command as it comes in from the server, rather than waiting for the entire command method to complete (and getting the results back as a completed List or Map or whatever).
The results are sent to the user using the IStreamingCallback handleResult method; see the IStreamingCallback Javadoc for details. The payload passed to handleResult is usually the raw map gathered together deep in the RPC protocol layer, and the user is assumed to have the knowledge and technology to be able to parse it and use it suitably in much the same way as a user unpacks or processes the results from the other low-level exec methods like execMapCommand.
NOTE: 'streaming' here has nothing at all to do with Perforce 'streams', which are (or will be) implemented elsewhere.
cmdName
- the command to be issued; must be non-null, and correspond to
a Perforce command recognized by P4Java and defined in
CmdSpec.cmdArgs
- the array of command arguments (options and file arguments,
etc.) to be sent to the Perforce server. These must be in the
form used by the corresponding p4 command line interpreter.
Ignored if null.inMap
- an optional map to be sent to the server as standard input,
using the Python map format (-G) form. You must remember to
issue the relevant command-specific option to enable this if
needed.callback
- a non-null IStreamingCallback to be used to process the
incoming results.key
- an opaque integer key that is passed to the IStreamingCallback
callback methods to identify the action as being associated
with this specific call.parallelCallback
- IParallelCallback used to parallelise the taskP4JavaException
- on errorjava.lang.String getAuthTicket()
java.lang.String getAuthTicket(java.lang.String userName)
userName
- non-null Perforce user namejava.lang.String getAuthTicket(java.lang.String userName, java.lang.String serverId)
userName
- non-null Perforce user nameserverId
- non-null Perforce server's auth.id/IP:portboolean isLoginNotRequired(java.lang.String msgStr)
java.io.InputStream getChangelistDiffs(int id, DiffType diffType) throws ConnectionException, RequestException, AccessException
This is one of the guaranteed "live" method on this interface, and will return the diff output as it exists when called (rather than when the underlying implementation object was created). This can be an expensive method to evaluate, and can generate reams and reams (and reams) of output, so don't use it willy-nilly.
Note that unlike the corresponding command-line command, which keeps going in the face of errors by moving on to the next file (or whatever), any errors encountered in this method will cause an exception from this method at the first error, so plan accordingly....
id
- the ID of the target 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 callerjava.util.List<IFileSpec> getCommitFiles(java.lang.String repo, java.lang.String commit) throws ConnectionException, RequestException, AccessException
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 callerjava.lang.String getCharsetName()
int getGenericCode(java.util.Map<java.lang.String,java.lang.Object> map)
java.util.List<IChangelist> getInterchanges(IFileSpec fromFile, IFileSpec toFile, boolean showFiles, boolean longDesc, int maxChangelistId) throws ConnectionException, RequestException, AccessException
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.
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 callerjava.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
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.
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 callerjava.lang.String[] getKnownCharsets()
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.
java.util.Properties getProperties()
int getServerVersionNumber()
int getSeverityCode(java.util.Map<java.lang.String,java.lang.Object> map)
ServerStatus getStatus()
java.util.List<IUserGroup> getUserGroups(java.lang.String userOrGroupName, boolean indirect, boolean displayValues, int maxGroups) throws ConnectionException, RequestException, AccessException
Note that the Perforce server considers it an error to have both indirect and displayValues parameters set true; this will cause the server to throw a RequestException with an appropriate usage message.
userOrGroupName
- if non-null, restrict the list to the specified group or
username.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.java.lang.String getUserName()
java.lang.String getWorkingDirectory()
IClient getCurrentClient()
boolean isCaseSensitive()
boolean isConnected()
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.
ICommandCallback registerCallback(ICommandCallback callback)
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.
callback
- ICommandCallback object to be registered; if null, command
callbacks are disabled.IProgressCallback registerProgressCallback(IProgressCallback callback)
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.
callback
- IProgressCallback object to be registered; if null, progress
callbacks are disabled.void registerSSOCallback(ISSOCallback callback, java.lang.String ssoKey)
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.
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 callbackvoid registerBrowserCallback(IBrowserCallback browserCallback)
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.
browserCallback
- BrowserCallback object to be registered; if null, browser
callbacks are disabled.void setAuthTicket(java.lang.String authTicket)
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.
authTicket
- possibly-null Perforce authentication ticketvoid setCurrentServerInfo(IServerInfo info)
info
- possibly-null Perforce server informationIServerInfo getCurrentServerInfo()
boolean setCharsetName(java.lang.String charsetName) throws java.nio.charset.UnsupportedCharsetException
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.void setCurrentClient(IClient client) throws ConnectionException, RequestException, AccessException
client
- client objectConnectionException
- 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 callervoid setUserName(java.lang.String userName)
Note that the auth ticket (if available) for this user will also be set to this server instance.
userName
- Perforce user name; can be null, which is interpreted as
"don't associate a user name with this server".void setWorkingDirectory(java.lang.String dirPath)
Note: no checking is done at call time for correctness (or otherwise) of the passed-in path.
dirPath
- absolute path of directory to be used, or nullvoid setClientPath(java.lang.String clientPath)
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.
clientPath
- client pathboolean supportsSmartMove() throws ConnectionException, RequestException, AccessException
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 callerboolean supportsUnicode() throws ConnectionException, RequestException, AccessException
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 callerjava.lang.String updateUserGroup(IUserGroup group, boolean updateIfOwner) throws ConnectionException, RequestException, AccessException
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.