Interface IOptionsServer
- All Superinterfaces:
IAttributeDelegator,IBranchDelegator,IBranchesDelegator,IChangeDelegator,IChangesDelegator,IClientDelegator,IClientsDelegator,ICommitDelegator,IConfigureDelegator,ICounterDelegator,ICountersDelegator,IDBSchemaDelegator,IDepotDelegator,IDepotsDelegator,IDescribeDelegator,IDiff2Delegator,IDirsDelegator,IDiskspaceDelegator,IDuplicateDelegator,IExportDelegator,IExtensionDelegator,IFileAnnotateDelegator,IFileLogDelegator,IFilesDelegator,IFixDelegator,IFixesDelegator,IFstatDelegator,IGraphCommitLogDelegator,IGraphListTreeDelegator,IGraphReceivePackDelegator,IGraphRevListDelegator,IGraphShowRefDelegator,IGrepDelegator,IGroupDelegator,IGroupsDelegator,IHelixCommandExecutor,IInfoDelegator,IIntegratedDelegator,IInterchangesDelegator,IJobDelegator,IJobsDelegator,IJobSpecDelegator,IJournalWaitDelegator,IKeyDelegator,IKeysDelegator,ILabelDelegator,ILabelsDelegator,ILicenseDelegator,IListDelegator,ILogin2Delegator,ILoginDelegator,ILogoutDelegator,ILogTailDelegator,IMonitorDelegator,IMoveDelegator,IObliterateDelegator,IOpenedDelegator,IPasswdDelegator,IPrintDelegator,IPropertyDelegator,IProtectDelegator,IProtectsDelegator,IReloadDelegator,IRenameClientDelegator,IRenameUserDelegator,IReposDelegator,IReviewDelegator,IReviewsDelegator,ISearchDelegator,IServer,ISizesDelegator,ISpecDelegator,IStatDelegator,IStreamDelegator,IStreamlogDelegator,IStreamsDelegator,ITagDelegator,ITriggersDelegator,IUnloadDelegator,IUserDelegator,IUsersDelegator,IVerifyDelegator
- All Known Subinterfaces:
IStreamingServer
- All Known Implementing Classes:
NtsServerImpl,OneShotServerImpl,RpcServer,Server
Note that unless otherwise noted, individual method options objects can be null; if they're null, the individual method Javadoc will spell out what default options apply (if any) in that case.
Note that in individual method Javadoc comments below, all method "throws" clauses are assumed to throw the normal complement of RequestException, ConnectionException, and AccessException with their usual semantics unless otherwise noted. The three standard P4JavaException classes and the broad causes for their being thrown are:
ConnectionException if the Perforce server is unreachable or is not
connected.
RequestException if the Perforce server encounters an error during
its processing of the request.
AccessException if the Perforce server denies access to the caller.
-
Field Summary
Fields inherited from interface com.perforce.p4java.server.IServer
ATTRIBUTE_STREAM_MAP_KEY, IN_MAP_USE_TAGS_KEY -
Method Summary
Modifier and TypeMethodDescriptionaddTrust(TrustOptions opts) Approve and add the fingerprint for the Perforce SSL connection.Approve and add the specified fingerprint for the Perforce SSL connection.addTrust(String fingerprintValue, TrustOptions opts) Approve and add the specified fingerprint or replacement for the Perforce SSL connection.execInputStringMapCmdList(String cmdName, String[] cmdArgs, String inString) Issue an arbitrary P4Java command to the Perforce server and return the results as a list of maps.execInputStringMapCmdList(String cmdName, String[] cmdArgs, String inString, IFilterCallback filterCallback) Issue an arbitrary P4Java command to the Perforce server and return the results as a list of maps.execInputStringStreamCmd(String cmdName, String[] cmdArgs, String inString) Issue an arbitrary P4Java command to the Perforce server and return the results as a stream.voidexecInputStringStreamingMapCmd(String cmdName, String[] cmdArgs, String inString, IStreamingCallback callback, int key) Issue a streaming map command to the Perforce server, using an optional string for any input expected by the server (such as label or job specs, etc.).execMapCmdList(String cmdName, String[] cmdArgs, IFilterCallback filterCallback, IParallelCallback parallelCallback) Issue an arbitrary P4Java command to the Perforce server and return the results as a list of maps.Issue an arbitrary P4Java command to the Perforce server and return the results as a list of maps without invoking any command callbacks.Issue an arbitrary P4Java command to the Perforce server and get the results as a stream.Return the Perforce Server's authId.Returns the list of all Global Option for a serverReturn the Perforce authentication tickets file path.getTrust()Return the fingerprint for the Perforce SSL connection.Return the Perforce trust file path.List all fingerprints in the trust file.getTrusts(TrustOptions opts) List all fingerprints or replacements in the trust file.Get the UsageOptions object associated with this server.Remove the fingerprint for the Perforce SSL connection.removeTrust(TrustOptions opts) Remove the fingerprint or replacement for the Perforce SSL connection.voidsetAuthTicket(String userName, String authTicket) Set the server's Perforce authentication ticket for the specified user to the passed-in string.voidsetAuthTicket(String userName, String serverId, String authTicket) Set the server's Perforce authentication ticket for the specified user to the passed-in string.voidSet Global Option for perforce commandsvoidsetTicketsFilePath(String ticketsFilePath) Set the Perforce authentication tickets file path.voidsetTrustFilePath(String trustFilePath) Set the Perforce trust file path.setUsageOptions(UsageOptions opts) Set the UsageOptions object associated with this server.Methods inherited from interface com.perforce.p4java.server.delegator.IAttributeDelegator
setFileAttributes, setFileAttributes, unsetFileAttribute, unsetFileAttributesMethods inherited from interface com.perforce.p4java.server.delegator.IBranchDelegator
createBranchSpec, deleteBranchSpec, deleteBranchSpec, getBranchSpec, getBranchSpec, updateBranchSpecMethods inherited from interface com.perforce.p4java.server.delegator.IBranchesDelegator
getBranchSpecs, getBranchSpecsMethods inherited from interface com.perforce.p4java.server.delegator.IChangeDelegator
deletePendingChangelist, deletePendingChangelist, getChangelist, getChangelistMethods inherited from interface com.perforce.p4java.server.delegator.IChangesDelegator
getChangelists, getChangelists, getChangelistsMethods inherited from interface com.perforce.p4java.server.delegator.IClientDelegator
createClient, createTempClient, deleteClient, deleteClient, getClient, getClient, getClientTemplate, getClientTemplate, getClientTemplate, switchClientView, switchStreamView, updateClient, updateClient, updateClientMethods inherited from interface com.perforce.p4java.server.delegator.IClientsDelegator
getClients, getClientsMethods inherited from interface com.perforce.p4java.server.delegator.ICommitDelegator
getBlobObject, getCommitObject, getCommitObject, getGraphCommitLogList, getGraphObjectMethods inherited from interface com.perforce.p4java.server.delegator.IConfigureDelegator
setOrUnsetServerConfigurationValue, showServerConfigurationMethods inherited from interface com.perforce.p4java.server.delegator.ICounterDelegator
deleteCounter, getCounter, getCounter, setCounter, setCounterMethods inherited from interface com.perforce.p4java.server.delegator.ICountersDelegator
getCounters, getCounters, getCountersMethods inherited from interface com.perforce.p4java.server.delegator.IDBSchemaDelegator
getDbSchemaMethods inherited from interface com.perforce.p4java.server.delegator.IDepotDelegator
createDepot, deleteDepot, getDepotMethods inherited from interface com.perforce.p4java.server.delegator.IDepotsDelegator
getDepots, getDepotsMethods inherited from interface com.perforce.p4java.server.delegator.IDescribeDelegator
getChangelistDiffs, getChangelistDiffsStream, getChangelistExtendedFiles, getChangelistExtendedFiles, getChangelistFiles, getChangelistFiles, getShelvedFiles, getShelvedFilesMethods inherited from interface com.perforce.p4java.server.delegator.IDiff2Delegator
getFileDiffs, getFileDiffs, getFileDiffsStream, getServerFileDiffsMethods inherited from interface com.perforce.p4java.server.delegator.IDirsDelegator
getDirectories, getDirectoriesMethods inherited from interface com.perforce.p4java.server.delegator.IDiskspaceDelegator
getDiskSpaceMethods inherited from interface com.perforce.p4java.server.delegator.IDuplicateDelegator
duplicateRevisionsMethods inherited from interface com.perforce.p4java.server.delegator.IExportDelegator
getExportRecords, getExportRecords, getStreamingExportRecordsMethods inherited from interface com.perforce.p4java.server.delegator.IExtensionDelegator
createExtensionConfig, deleteExtension, getExtensionConfig, installExtension, listExtensions, packageExtension, sampleExtension, updateExtensionConfigMethods inherited from interface com.perforce.p4java.server.delegator.IFileAnnotateDelegator
getFileAnnotations, getFileAnnotationsMethods inherited from interface com.perforce.p4java.server.delegator.IFileLogDelegator
getRevisionHistory, getRevisionHistoryMethods inherited from interface com.perforce.p4java.server.delegator.IFilesDelegator
getDepotFiles, getDepotFilesMethods inherited from interface com.perforce.p4java.server.delegator.IFixDelegator
fixJobs, fixJobsMethods inherited from interface com.perforce.p4java.server.delegator.IFixesDelegator
getFixes, getFixListMethods inherited from interface com.perforce.p4java.server.delegator.IFstatDelegator
getExtendedFiles, getExtendedFilesMethods inherited from interface com.perforce.p4java.server.delegator.IGraphCommitLogDelegator
getGraphCommitLogListMethods inherited from interface com.perforce.p4java.server.delegator.IGraphListTreeDelegator
getGraphListTreeMethods inherited from interface com.perforce.p4java.server.delegator.IGraphReceivePackDelegator
doGraphReceivePackMethods inherited from interface com.perforce.p4java.server.delegator.IGraphRevListDelegator
getGraphRevListMethods inherited from interface com.perforce.p4java.server.delegator.IGraphShowRefDelegator
getGraphShowRefsMethods inherited from interface com.perforce.p4java.server.delegator.IGrepDelegator
getMatchingLines, getMatchingLinesMethods inherited from interface com.perforce.p4java.server.delegator.IGroupDelegator
createUserGroup, deleteUserGroup, getUserGroup, updateUserGroupMethods inherited from interface com.perforce.p4java.server.delegator.IGroupsDelegator
getUserGroupsMethods inherited from interface com.perforce.p4java.server.IHelixCommandExecutor
execMapCmdList, execMapCmdList, execMapCmdList, execStreamCmd, execStreamCmdForBuffer, getErrorOrInfoStr, getErrorStr, getInfoStr, handleErrorStr, handleFileErrorStr, isAuthFail, isInfoMessageMethods inherited from interface com.perforce.p4java.server.delegator.IInfoDelegator
getServerInfoMethods inherited from interface com.perforce.p4java.server.delegator.IIntegratedDelegator
getSubmittedIntegrations, getSubmittedIntegrationsMethods inherited from interface com.perforce.p4java.server.delegator.IInterchangesDelegator
getInterchanges, getInterchangesMethods inherited from interface com.perforce.p4java.server.delegator.IJobDelegator
createJob, deleteJob, getJob, updateJobMethods inherited from interface com.perforce.p4java.server.delegator.IJobsDelegator
getJobs, getJobsMethods inherited from interface com.perforce.p4java.server.delegator.IJobSpecDelegator
getJobSpecMethods inherited from interface com.perforce.p4java.server.delegator.IJournalWaitDelegator
journalWaitMethods inherited from interface com.perforce.p4java.server.delegator.IKeyDelegator
deleteKey, getKey, setKey, setMultipleKeyValuePairMethods inherited from interface com.perforce.p4java.server.delegator.IKeysDelegator
getKeysMethods inherited from interface com.perforce.p4java.server.delegator.ILabelDelegator
createLabel, deleteLabel, deleteLabel, getLabel, updateLabelMethods inherited from interface com.perforce.p4java.server.delegator.ILabelsDelegator
getLabels, getLabelsMethods inherited from interface com.perforce.p4java.server.delegator.ILicenseDelegator
getLicense, getLimits, getValidServerIPMACAddress, updateLicenseMethods inherited from interface com.perforce.p4java.impl.mapbased.server.cmd.IListDelegator
getListData, getListDataMethods inherited from interface com.perforce.p4java.server.delegator.ILogin2Delegator
getLogin2Status, getLogin2Status, login2, login2, login2CheckAuth, login2InitAuth, login2ListMethodsMethods inherited from interface com.perforce.p4java.server.delegator.ILoginDelegator
getLoginStatus, isDontWriteTicket, login, login, login, login, loginMethods inherited from interface com.perforce.p4java.server.delegator.ILogoutDelegator
logout, logoutMethods inherited from interface com.perforce.p4java.server.delegator.ILogTailDelegator
getLogTailMethods inherited from interface com.perforce.p4java.server.delegator.IMonitorDelegator
getServerProcesses, getServerProcessesMethods inherited from interface com.perforce.p4java.server.delegator.IMoveDelegator
moveFile, moveFile, moveFileMethods inherited from interface com.perforce.p4java.server.delegator.IObliterateDelegator
obliterateFilesMethods inherited from interface com.perforce.p4java.server.delegator.IOpenedDelegator
getOpenedFiles, getOpenedFilesMethods inherited from interface com.perforce.p4java.server.delegator.IPasswdDelegator
changePasswordMethods inherited from interface com.perforce.p4java.server.delegator.IPrintDelegator
getFileContents, getFileContents, getFileContentsMethods inherited from interface com.perforce.p4java.server.delegator.IPropertyDelegator
deleteProperty, getProperty, setPropertyMethods inherited from interface com.perforce.p4java.server.delegator.IProtectDelegator
createProtectionEntries, getProtectionsTable, updateProtectionEntriesMethods inherited from interface com.perforce.p4java.server.delegator.IProtectsDelegator
getProtectionEntries, getProtectionEntriesMethods inherited from interface com.perforce.p4java.server.delegator.IReloadDelegator
reloadMethods inherited from interface com.perforce.p4java.server.delegator.IRenameClientDelegator
renameClientMethods inherited from interface com.perforce.p4java.server.delegator.IRenameUserDelegator
renameUserMethods inherited from interface com.perforce.p4java.server.delegator.IReposDelegator
getRepos, getRepos, getReposMethods inherited from interface com.perforce.p4java.server.delegator.IReviewDelegator
getReviewChangelistsMethods inherited from interface com.perforce.p4java.server.delegator.IReviewsDelegator
getReviews, getReviewsMethods inherited from interface com.perforce.p4java.server.delegator.ISearchDelegator
searchJobsMethods inherited from interface com.perforce.p4java.server.IServer
connect, createUserGroup, deleteUserGroup, disconnect, execInputStringMapCmd, execInputStringStreamingMapComd, execMapCmd, execQuietMapCmd, execQuietStreamCmd, execStreamingMapCommand, execStreamingMapCommand, getAuthTicket, getAuthTicket, getAuthTicket, getChangelistDiffs, getCharsetName, getCommitFiles, getCurrentClient, getCurrentServerInfo, getGenericCode, getInterchanges, getInterchanges, getKnownCharsets, getProperties, getServerVersion, getServerVersionNumber, getSeverityCode, getStatus, getUserGroups, getUserName, getWorkingDirectory, isCaseSensitive, isConnected, isLoginNotRequired, registerBrowserCallback, registerCallback, registerProgressCallback, registerProgressCallback, registerSSOCallback, setAuthTicket, setCharsetName, setClientPath, setCurrentClient, setCurrentServerInfo, setUserName, setWorkingDirectory, supportsSmartMove, supportsUnicode, updateUserGroupMethods inherited from interface com.perforce.p4java.server.delegator.ISizesDelegator
getFileSizesMethods inherited from interface com.perforce.p4java.server.delegator.ISpecDelegator
getSpec, updateSpec, updateSpecStringMethods inherited from interface com.perforce.p4java.server.delegator.IStatDelegator
getStreamIntegrationStatusMethods inherited from interface com.perforce.p4java.server.delegator.IStreamDelegator
convertSparseStream, createStream, deleteStream, getStream, getStream, updateStreamMethods inherited from interface com.perforce.p4java.server.delegator.IStreamlogDelegator
getStreamlogMethods inherited from interface com.perforce.p4java.server.delegator.IStreamsDelegator
getStreamsMethods inherited from interface com.perforce.p4java.server.delegator.ITagDelegator
tagFiles, tagFilesMethods inherited from interface com.perforce.p4java.server.delegator.ITriggersDelegator
createTriggerEntries, getTriggerEntries, getTriggersTable, updateTriggerEntriesMethods inherited from interface com.perforce.p4java.server.delegator.IUnloadDelegator
unloadMethods inherited from interface com.perforce.p4java.server.delegator.IUserDelegator
createUser, createUser, deleteUser, deleteUser, getUser, updateUser, updateUserMethods inherited from interface com.perforce.p4java.server.delegator.IUsersDelegator
getUsers, getUsersMethods inherited from interface com.perforce.p4java.server.delegator.IVerifyDelegator
verifyFiles
-
Method Details
-
execInputStringMapCmdList
List<Map<String,Object>> execInputStringMapCmdList(String cmdName, String[] cmdArgs, String inString) throws P4JavaException Issue an arbitrary P4Java command to the Perforce server and return the results as a list of maps.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.
- Parameters:
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.- Returns:
- a non-null Java Map of results; these results are as returned from issuing the command using the -G option with the p4 command line interpreter.
- Throws:
P4JavaException- if an error occurs processing this method and its parameters- Since:
- 2013.1
-
execInputStringMapCmdList
List<Map<String,Object>> execInputStringMapCmdList(String cmdName, String[] cmdArgs, String inString, IFilterCallback filterCallback) throws P4JavaException Issue an arbitrary P4Java command to the Perforce server and return the results as a list of maps.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.
- Parameters:
cmdName- the command to be issued; must be non-null, and correspond to a Perforce command recognized by P4Java and defined in CmdSpec.cmdArgs- the array of command arguments (options and file arguments, etc.) to be sent to the Perforce server. These must be in the form used by the corresponding p4 command line interpreter. Ignored if null.inString- an optional string to be sent to the server as standard input unchanged (this must be in the format expected by the server, typically as required when using the "-i" flag to the p4 command line app for the same command). You must remember to issue the relevant command-specific option to enable this if needed.filterCallback- an optional filter callback to decide on skipping or keeping individual key/value pairs as part of the results map.- Returns:
- a non-null Java Map of results; these results are as returned from issuing the command using the -G option with the p4 command line interpreter.
- Throws:
P4JavaException- if an error occurs processing this method and its parameters- Since:
- 2013.1
-
execMapCmdList
List<Map<String,Object>> execMapCmdList(String cmdName, String[] cmdArgs, IFilterCallback filterCallback, IParallelCallback parallelCallback) throws P4JavaException Issue an arbitrary P4Java command to the Perforce server and return the results as a list of maps.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.
- Parameters:
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.filterCallback- an optional filter callback to decide on skipping or keeping individual key/value pairs as part of the results map.parallelCallback- an optional parallel sync/submit callback to provide a multi-threaded file transfer implementation.- Returns:
- a non-null Java Map of results; these results are as returned from issuing the command using the -G option with the p4 command line interpreter.
- Throws:
P4JavaException- if an error occurs processing this method and its parameters- Since:
- 2017.1
-
execQuietMapCmdList
List<Map<String,Object>> execQuietMapCmdList(String cmdName, String[] cmdArgs, Map<String, Object> inMap) throws P4JavaExceptionIssue an arbitrary P4Java command to the Perforce server and return the results as a list of maps without invoking any command callbacks.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...
- Parameters:
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.- Returns:
- a non-null Java Map of results; these results are as returned from issuing the command using the -G option with the p4 command line interpreter.
- Throws:
P4JavaException- if an error occurs processing this method and its parameters- Since:
- 2013.1
-
execInputStringStreamingMapCmd
void execInputStringStreamingMapCmd(String cmdName, String[] cmdArgs, String inString, IStreamingCallback callback, int key) throws P4JavaException Issue a streaming map command to the Perforce server, using an optional string for any input expected by the server (such as label or job specs, etc.).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.
- Parameters:
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.- Throws:
P4JavaException- if an error occurs processing this method and its parameters.- Since:
- 2013.1
-
getUsageOptions
UsageOptions getUsageOptions()Get the UsageOptions object associated with this server.- Returns:
- possibly-null UsageOptions object.
-
setUsageOptions
Set the UsageOptions object associated with this server. Note that changing this object (or its contents) while a server is busy can cause issues.- Parameters:
opts- non-null UsageOptions object to associate with this server.- Returns:
- the current server.
-
setAuthTicket
Set the server's Perforce authentication ticket for the specified user to the passed-in string.- Parameters:
userName- non-null Perforce user nameauthTicket- possibly-null Perforce authentication ticket- Since:
- 2011.2
-
setAuthTicket
Set the server's Perforce authentication ticket for the specified user to the passed-in string.- Parameters:
userName- non-null Perforce user nameserverId- possibly-null Perforce server's auth.id/IP:portauthTicket- possibly-null Perforce authentication ticket- Since:
- 2021.2
-
getAuthId
String getAuthId()Return the Perforce Server's authId. This may be: addr:port or clusterId or authId If the connection hasn't been made yet, this could be null.- Returns:
- possibly-null Perforce authentication id
- Since:
- 2016.1
-
setTicketsFilePath
Set the Perforce authentication tickets file path.- Parameters:
ticketsFilePath- non-null Perforce auth tickets file path- Since:
- 2013.1
-
getTicketsFilePath
String getTicketsFilePath()Return the Perforce authentication tickets file path.- Returns:
- possibly-null Perforce auth tickets file path
- Since:
- 2013.1
-
setTrustFilePath
Set the Perforce trust file path.- Parameters:
trustFilePath- non-null Perforce trust file path- Since:
- 2013.1
-
getTrustFilePath
String getTrustFilePath()Return the Perforce trust file path.- Returns:
- possibly-null Perforce trust file path
- Since:
- 2013.1
-
execStreamCmd
InputStream execStreamCmd(String cmdName, String[] cmdArgs, Map<String, Object> inMap) throws P4JavaExceptionIssue an arbitrary P4Java command to the Perforce server and get the results as a stream.This method is intended for low-level commands in the spirit and format of the p4 command line interpreter, and offers a simple way to issue commands to the associated Perforce server without the overhead of the more abstract Java interfaces and methods.
Note that this method is intended for things like getting file contents, and may have unpredictable results on commands not originally expected to return i/o streams.
Note that this method does not allow you to set "usage" options for the command; these may be added later. Note also that although option arguments passed to this method must be in a form recognized by P4Java (as defined by the CmdSpec enum), that does not mean the method is being implemented by the interpreter -- the actual implementation depends on the options used to get the server object in the first place from the server factory.
- Parameters:
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.- Returns:
- an InputStream on the command output. This will never be null, but it may be empty. You must properly close this stream after use or temporary files may be left lying around the VM's java.io.tmpdir area.
- Throws:
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 callerP4JavaException- Since:
- 2013.1
-
execInputStringStreamCmd
InputStream execInputStringStreamCmd(String cmdName, String[] cmdArgs, String inString) throws P4JavaException Issue an arbitrary P4Java command to the Perforce server and return the results as a stream.This method is intended for low-level commands in the spirit and format of the p4 command line interpreter, and offers a simple way to issue commands to the associated Perforce server without the overhead of the more abstract Java interfaces and methods.
Note that this method is intended for things like getting file contents, and may have unpredictable results on commands not originally expected to return i/o streams.
Note that this method does not allow you to set "usage" options for the command; these may be added later. Note also that although option arguments passed to this method must be in a form recognized by the p4 command line interpreter, that does not mean the method is being implemented by the interpreter -- the actual implementation depends on the options used to get the server object in the first place from the server factory.
- Parameters:
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.- Returns:
- an InputStream on the command output. This will never be null, but it may be empty. You must properly close this stream after use or temporary files may be left lying around the VM's java.io.tmpdir area.
- Throws:
P4JavaException- if an error occurs processing this method and its parameters- Since:
- 2013.1
-
getTrust
Return the fingerprint for the Perforce SSL connection.Note that this fingerprint is generated from the connection, it may not be the same as the one (if any) stored in the trust file.
- Returns:
- possibly-null fingerprint for the Perforce SSL connection.
- Throws:
P4JavaException- if an error occurs processing this method and its parameters.- Since:
- 2012.1
-
addTrust
Approve and add the fingerprint for the Perforce SSL connection. The fingerprint or replacement will be stored in the trust file. If the attribute TrustOptions.isReplacement() is true, then the replacement fingerprint will be stored. Otherwise, the normal fingerprint is stored.Note that an exception would be thrown if there is an identity change detected. If you want to trust the new key use the 'force' option.
- Parameters:
opts- TrustOptions object describing optional parameters; if null, no options are set.- Returns:
- non-null result message string from the trust operation; this may include the fingerprint for the Perforce server public key.
- Throws:
P4JavaException- if an error occurs processing this method and its parameters.- Since:
- 2012.1
-
addTrust
Approve and add the specified fingerprint for the Perforce SSL connection. The fingerprint will be stored in the trust file.- Parameters:
fingerprintValue- non-null fingerprint value to be added.- Returns:
- non-null result message string from the trust operation; this may include the fingerprint for the Perforce server public key.
- Throws:
P4JavaException- if an error occurs processing this method and its parameters.- Since:
- 2012.1
-
addTrust
Approve and add the specified fingerprint or replacement for the Perforce SSL connection. The fingerprint or replacement will be stored in the trust file. If the attribute TrustOptions.isReplacement() is true, then the replacement fingerprint will be stored. Otherwise, the normal fingerprint is stored.- Parameters:
fingerprintValue- non-null fingerprint value to be added.opts- TrustOptions object describing optional parameters; if null, no options are set.- Returns:
- non-null result message string from the trust operation; this may include the fingerprint for the Perforce server public key.
- Throws:
P4JavaException- if an error occurs processing this method and its parameters.- Since:
- 2015.1
-
removeTrust
Remove the fingerprint for the Perforce SSL connection. The fingerprint will removed from the trust file.- Returns:
- non-null result message string from the trust operation; this may include the fingerprint for the Perforce server public key.
- Throws:
P4JavaException- if an error occurs processing this method and its parameters.- Since:
- 2012.1
-
removeTrust
Remove the fingerprint or replacement for the Perforce SSL connection. The fingerprint or replacement will removed from the trust file. If the attribute TrustOptions.isReplacement() is true, then the replacement fingerprint will be removed. Otherwise the normal fingerprint is removed.- Parameters:
opts- TrustOptions object describing optional parameters; if null, no options are set.- Returns:
- non-null result message string from the trust operation; this may include the fingerprint for the Perforce server public key.
- Throws:
P4JavaException- if an error occurs processing this method and its parameters.- Since:
- 2015.1
-
getTrusts
List all fingerprints in the trust file.- Returns:
- non-null list of known fingerprints in the trust file.
- Throws:
P4JavaException- if an error occurs processing this method and its parameters.- Since:
- 2012.1
-
getTrusts
List all fingerprints or replacements in the trust file. If the attribute TrustOptions.isReplacement() is true, then replacement fingerprints will be returned. Otherwise, normal fingerprints are returned.- Parameters:
opts- TrustOptions object describing optional parameters; if null, no options are set.- Returns:
- non-null list of fingerprints in the trust file.
- Throws:
P4JavaException- if an error occurs processing this method and its parameters.- Since:
- 2015.1
-
setGlobalOptions
Set Global Option for perforce commands- Parameters:
s- given global options as a list- Since:
- 2025.2
-
getGlobalOptions
Returns the list of all Global Option for a server- Returns:
- non-null list of global options
- Since:
- 2025.2
-