Class RpcServer

    • Field Detail

      • DEFAULT_PROG_NAME

        public static final java.lang.String DEFAULT_PROG_NAME
        The default string sent to the Perforce server in the protocol command defining the client's program name. This can be set with the IServer interface.
        See Also:
        Constant Field Values
      • DEFAULT_PROG_VERSION

        public static final java.lang.String DEFAULT_PROG_VERSION
        The default string sent to the Perforce server in the protocol command defining the client's program version. This can be set with the IServer interface.
        See Also:
        Constant Field Values
      • DEFAULT_CLIENT_API_LEVEL

        public static final int DEFAULT_CLIENT_API_LEVEL
        Default Perforce client API level; 81 represents 2016.2 capabilities. Don't change this unless you know what you're doing. Note that this is a default for most commands; some commands dynamically bump up the level for the command's duration.
        See Also:
        Constant Field Values
      • DEFAULT_SERVER_API_LEVEL

        public static final int DEFAULT_SERVER_API_LEVEL
        Default Perforce server API level; 99999 apparently means "whatever...". Don't change this unless you know what you're doing.
        See Also:
        Constant Field Values
      • RPC_TAGS_USED

        public static final boolean RPC_TAGS_USED
        Signifies whether or not we use tagged output. Don't change this unless you like weird incomprehensible errors and days of debugging.
        See Also:
        Constant Field Values
      • RPC_ENABLE_STREAMS

        public static final boolean RPC_ENABLE_STREAMS
        Signifies whether or not the client is capable of handling streams.
        See Also:
        Constant Field Values
      • RPC_ENV_CWD_KEY

        public static final java.lang.String RPC_ENV_CWD_KEY
        The system properties key for the JVM's current directory.
        See Also:
        Constant Field Values
      • RPC_ENV_OS_NAME_KEY

        public static final java.lang.String RPC_ENV_OS_NAME_KEY
        The system properties key for the OS name.
        See Also:
        Constant Field Values
      • RPC_ENV_WINDOWS_PREFIX

        public static final java.lang.String RPC_ENV_WINDOWS_PREFIX
        RPC_ENV_OS_NAME_KEY property value prefix for Windows systems.
        See Also:
        Constant Field Values
      • RPC_ENV_WINDOWS_SPEC

        public static final java.lang.String RPC_ENV_WINDOWS_SPEC
        What we use in the RPC environment packet to signal to the Perforce server that we're a Windows box.
        See Also:
        Constant Field Values
      • RPC_ENV_UNIX_SPEC

        public static final java.lang.String RPC_ENV_UNIX_SPEC
        What we use in the RPC environment packet to signal to the Perforce server that we're a NON-Windows box.
        See Also:
        Constant Field Values
      • RPC_ENV_NOCLIENT_SPEC

        public static final java.lang.String RPC_ENV_NOCLIENT_SPEC
        What we use in the RPC environment packet to signal to the Perforce server that we don't have a client set yet or don't know what it is.
        See Also:
        Constant Field Values
      • RPC_ENV_NOHOST_SPEC

        public static final java.lang.String RPC_ENV_NOHOST_SPEC
        What we use in the RPC environment packet to signal to the Perforce server that we don't have a hostname set yet or don't know what it is.
        See Also:
        Constant Field Values
      • RPC_ENV_NOUSER_SPEC

        public static final java.lang.String RPC_ENV_NOUSER_SPEC
        What we use in the RPC environment packet to signal to the Perforce server that we don't have a client set yet or don't know what it is.
        See Also:
        Constant Field Values
      • TRACE_PREFIX

        public static final java.lang.String TRACE_PREFIX
        What we use as a P4JTracer trace prefix for methods here.
        See Also:
        Constant Field Values
      • RPC_TMP_OUTFILE_STREAM_KEY

        public static final java.lang.String RPC_TMP_OUTFILE_STREAM_KEY
        Used to key temporary output streams in the command environment's state map for things like getFileContents(), etc., using the execStreamCmd method(s).
        See Also:
        Constant Field Values
      • RPC_BYTE_BUFFER_OUTPUT_KEY

        public static final java.lang.String RPC_BYTE_BUFFER_OUTPUT_KEY
        See Also:
        Constant Field Values
      • RPC_TMP_CONVERTER_KEY

        public static final java.lang.String RPC_TMP_CONVERTER_KEY
        Use to key converter to use out of state map
        See Also:
        Constant Field Values
      • localHostName

        protected java.lang.String localHostName
      • clientApiLevel

        protected int clientApiLevel
      • serverApiLevel

        protected int serverApiLevel
      • applicationName

        protected java.lang.String applicationName
      • connectionStart

        protected long connectionStart
      • serverProtocolMap

        protected java.util.Map<java.lang.String,​java.lang.Object> serverProtocolMap
      • serverId

        protected java.lang.String serverId
      • secretKeys

        protected java.util.Map<java.lang.String,​java.lang.String> secretKeys
      • pBufs

        protected java.util.Map<java.lang.String,​java.lang.String> pBufs
      • ticketsFilePath

        protected java.lang.String ticketsFilePath
      • trustFilePath

        protected java.lang.String trustFilePath
      • validatedByChain

        protected boolean validatedByChain
      • validatedByFingerprint

        protected boolean validatedByFingerprint
      • validatedByHostname

        protected boolean validatedByHostname
      • authFileLockTry

        protected int authFileLockTry
      • authFileLockDelay

        protected long authFileLockDelay
      • authFileLockWait

        protected long authFileLockWait
      • cmdMapArgs

        protected java.util.Map<java.lang.String,​java.lang.Object> cmdMapArgs
        The RPC command args before the function name (i.e. "tag")
      • relaxCmdNameValidationChecks

        protected boolean relaxCmdNameValidationChecks
        If true, relax the command name validation checks done in the RPC layer. This is dangerous, and any use of this should only be done if you know what you're doing and you're able to deal with the consequences (which won't be spelled out here).
    • Constructor Detail

      • RpcServer

        public RpcServer()
    • Method Detail

      • isValidatedByChain

        public boolean isValidatedByChain()
        was the server ssl connection validated by chain?
        Returns:
        true if it's an ssl connection with valid chain
      • isValidatedByFingerprint

        public boolean isValidatedByFingerprint()
        was the server ssl connection validated by fingerprint?
        Returns:
        true if it's an ssl connection validated by fingerprint
      • isValidatedByHostname

        public boolean isValidatedByHostname()
        was the server ssl connection validated by hostname match?
        Returns:
        true if it's an ssl connection validated by "cert's CN" == "P4Port's hostname"
      • getApplicationName

        public java.lang.String getApplicationName()
      • setApplicationName

        public void setApplicationName​(java.lang.String applicationName)
      • getAuthCounter

        public RpcUserAuthCounter getAuthCounter()
        Get the RPC user authentication counter.
        Returns:
        RPC user authentication counter
      • getClientApiLevel

        public int getClientApiLevel()
      • setClientApiLevel

        public void setClientApiLevel​(int clientApiLevel)
      • getRpcServerAddress

        public IServerAddress getRpcServerAddress()
        Get the server's address for the RPC connection.
        Returns:
        possibly-null RPC server address
      • setRpcServerAddress

        public void setRpcServerAddress​(IServerAddress rpcServerAddress)
        Set the server's address for the RPC connection.
        Parameters:
        rpcServerAddress - RPC server address
      • getServerAddress

        public java.lang.String getServerAddress()
        Get the server's address field used for storing authentication tickets.
        Returns:
        - possibly null server address
      • getServerHostPort

        public java.lang.String getServerHostPort()
        Get the server's host and port used for the RPC connection.
        Returns:
        - possibly null server host and port
      • getClientCharset

        public java.nio.charset.Charset getClientCharset()
      • isServerUnicode

        public boolean isServerUnicode()
      • getServerId

        public java.lang.String getServerId()
        Get the server's id field used for storing authentication tickets. This id should only be used as a server address portion for entries in a p4 tickets file.
        Returns:
        - possibly null server id
      • setServerId

        public void setServerId​(java.lang.String serverId)
        Set the server's id field used for storing authentication tickets. The id specified here will be used when saving ticket values to a p4 tickets file. This field should only be set to the server id returned as part of a server message.
        Parameters:
        serverId - serverId
      • getTicketsFilePath

        public java.lang.String getTicketsFilePath()
        Description copied from interface: IOptionsServer
        Return the Perforce authentication tickets file path.
        Returns:
        possibly-null Perforce auth tickets file path
      • setTicketsFilePath

        public void setTicketsFilePath​(java.lang.String ticketsFilePath)
        Description copied from interface: IOptionsServer
        Set the Perforce authentication tickets file path.
        Parameters:
        ticketsFilePath - non-null Perforce auth tickets file path
      • getTrustFilePath

        public java.lang.String getTrustFilePath()
        Description copied from interface: IOptionsServer
        Return the Perforce trust file path.
        Returns:
        possibly-null Perforce trust file path
      • setTrustFilePath

        public void setTrustFilePath​(java.lang.String trustFilePath)
        Description copied from interface: IOptionsServer
        Set the Perforce trust file path.
        Parameters:
        trustFilePath - non-null Perforce trust file path
      • isRelaxCmdNameValidationChecks

        protected boolean isRelaxCmdNameValidationChecks()
      • setRelaxCmdNameValidationChecks

        protected void setRelaxCmdNameValidationChecks​(boolean relaxCmdNameValidationChecks)
      • isAuthFail

        @Deprecated
        public boolean isAuthFail​(java.lang.String errStr)
        Parameters:
        errStr - error string
        Returns:
        true if error
      • getInfoStr

        @Deprecated
        public java.lang.String getInfoStr​(java.util.Map<java.lang.String,​java.lang.Object> map)
        Description copied from interface: IHelixCommandExecutor
        Gets the info message from the passed-in Perforce command results map. If no info message found in the results map it returns null.

        Note that the severity code is MessageSeverityCode.E_INFO. Therefore, only message with severity code = MessageSeverityCode.E_INFO will be returned.

        RPC impl errors come across the wire as a map in the form usually like this:

         fmt0=Access for user '%user%' has not been enabled by 'p4 protect'.,
         func=client-Message, user=nouser, code0=822483067
         
        Note that the code0 entry will be used to get the severity level; the fmt0 entry contains the message.

        Parameters:
        map - Perforce command results map
        Returns:
        possibly-null info string
      • isInfoMessage

        @Deprecated
        public boolean isInfoMessage​(java.util.Map<java.lang.String,​java.lang.Object> map)
        Description copied from interface: IHelixCommandExecutor
        Checks if is info message.
        Parameters:
        map - the map
        Returns:
        true, if is info message
      • getErrorStr

        @Deprecated
        public java.lang.String getErrorStr​(java.util.Map<java.lang.String,​java.lang.Object> map)
        Description copied from interface: IHelixCommandExecutor
        Gets the error/fatal message from the passed-in Perforce command results map. If no error/fatal message found in the results map it returns null.

        Note that the minimum severity code is MessageSeverityCode.E_FAILED. Therefore, only message with severity code >= MessageSeverityCode.E_FAILED will be returned.

        RPC impl errors come across the wire as a map in the form usually like this:

         fmt0=Access for user '%user%' has not been enabled by 'p4 protect'.,
         func=client-Message, user=nouser, code0=822483067
         
        Note that the code0 entry will be used to get the severity level; the fmt0 entry contains the message.

        Parameters:
        map - Perforce command results map
        Returns:
        possibly-null error/fatal string
      • setAuthTicket

        @Deprecated
        public void setAuthTicket​(java.lang.String userName,
                                  java.lang.String authTicket)
        Description copied from interface: IOptionsServer
        Set the server's Perforce authentication ticket for the specified user to the passed-in string.

        Parameters:
        userName - non-null Perforce user name
        authTicket - possibly-null Perforce authentication ticket
      • setAuthTicket

        public void setAuthTicket​(java.lang.String userName,
                                  java.lang.String serverId,
                                  java.lang.String authTicket)
        Description copied from interface: IOptionsServer
        Set the server's Perforce authentication ticket for the specified user to the passed-in string.

        Parameters:
        userName - non-null Perforce user name
        serverId - possibly-null Perforce server's auth.id/IP:port
        authTicket - possibly-null Perforce authentication ticket
      • getTrust

        public java.lang.String getTrust()
                                  throws P4JavaException
        Description copied from interface: IOptionsServer
        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.
      • addTrust

        public java.lang.String addTrust​(TrustOptions opts)
                                  throws P4JavaException
        Description copied from interface: IOptionsServer
        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.
      • addTrust

        public java.lang.String addTrust​(java.lang.String fingerprintValue)
                                  throws P4JavaException
        Description copied from interface: IOptionsServer
        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.
      • addTrust

        public java.lang.String addTrust​(java.lang.String fingerprintValue,
                                         TrustOptions options)
                                  throws P4JavaException
        Description copied from interface: IOptionsServer
        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.
        options - 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.
      • removeTrust

        public java.lang.String removeTrust()
                                     throws P4JavaException
        Description copied from interface: IOptionsServer
        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.
      • removeTrust

        public java.lang.String removeTrust​(TrustOptions opts)
                                     throws P4JavaException
        Description copied from interface: IOptionsServer
        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.
      • getTrusts

        public java.util.List<Fingerprint> getTrusts()
                                              throws P4JavaException
        Description copied from interface: IOptionsServer
        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.
      • getTrusts

        public java.util.List<Fingerprint> getTrusts​(TrustOptions opts)
                                              throws P4JavaException
        Description copied from interface: IOptionsServer
        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.
      • getAuthTicket

        @Deprecated
        public java.lang.String getAuthTicket​(java.lang.String userName)
        Description copied from interface: IServer
        Return the Perforce authentication ticket for specified user.
        Parameters:
        userName - non-null Perforce user name
        Returns:
        possibly-null Perforce authentication ticket
      • getAuthTicket

        public java.lang.String getAuthTicket​(java.lang.String userName,
                                              java.lang.String serverId)
        Description copied from interface: IServer
        Return the Perforce authentication ticket for specified user.
        Parameters:
        userName - non-null Perforce user name
        serverId - non-null Perforce server's auth.id/IP:port
        Returns:
        possibly-null Perforce authentication ticket
      • isLoginNotRequired

        public boolean isLoginNotRequired​(java.lang.String msgStr)
      • supportsSmartMove

        public boolean supportsSmartMove()
                                  throws ConnectionException,
                                         RequestException,
                                         AccessException
        Description copied from interface: IServer
        Return true IFF the underlying Perforce server supports the new 2009.1 and later "smart move" command. Note that this returns whether the server can support moves only at the time the server is first created; it's entirely possible for the underlying server to change versions, etc., under the user in the meanitme or over time. In any case, if you do try to run a move command on such a server, the results will be safe, if not entirely what you expected. As of 2010.2 it also possible for the server to be configured to disable the move command, in which case this function will return false.
        Returns:
        true iff the server supports the smart move command.
        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 request
        AccessException - if the Perforce server denies access to the caller
      • init

        public ServerStatus init​(java.lang.String host,
                                 int port,
                                 java.util.Properties properties,
                                 UsageOptions opts,
                                 boolean secure)
                          throws ConfigException,
                                 ConnectionException
        Description copied from interface: IServerControl
        Convenience method for init(host, port, props, opts, secure, null). See init's main Javadoc for full documentation.
        Specified by:
        init in interface IServerControl
        Overrides:
        init in class Server
        Parameters:
        host - the Perforce server hostname or IP address as passed in to the factory method
        port - the Perforce server port number as passed in to the factory method
        properties - the properties passed in to the factory method
        opts - the UsageOptions object to be associated with the server object; if null, the server should construct a new default UsageOptions object.
        secure - secure option
        Returns:
        the resulting status; should be ACTIVE unless otherwise specified
        Throws:
        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).
      • init

        public ServerStatus init​(java.lang.String host,
                                 int port,
                                 java.util.Properties props,
                                 UsageOptions opts)
                          throws ConfigException,
                                 ConnectionException
        Description copied from interface: IServerControl
        Convenience method for init(host, port, props, opts, secure). See init's main Javadoc for full documentation.
        Specified by:
        init in interface IServerControl
        Overrides:
        init in class Server
        Parameters:
        host - the Perforce server hostname or IP address as passed in to the factory method
        port - the Perforce server port number as passed in to the factory method
        props - the properties passed in to the factory method
        opts - the UsageOptions object to be associated with the server object; if null, the server should construct a new default UsageOptions object.
        Returns:
        the resulting status; should be ACTIVE unless otherwise specified
        Throws:
        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).
      • init

        public ServerStatus init​(java.lang.String host,
                                 int port,
                                 java.util.Properties props)
                          throws ConfigException,
                                 ConnectionException
        The default init sets up things like host names, etc., and fails if we can't establish some pretty basic things at connect time. Does not attempt to actually connect to the target Perforce server -- this is left for the connect() call, below.
        Specified by:
        init in interface IServerControl
        Overrides:
        init in class Server
        Parameters:
        host - the Perforce server hostname or IP address as passed in to the factory method
        port - the Perforce server port number as passed in to the factory method
        props - the UsageOptions object to be associated with the server object; if null, the server should construct a new default UsageOptions object.
        Returns:
        the resulting status; should be ACTIVE unless otherwise specified
        Throws:
        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).
      • trustConnectionCheck

        public void trustConnectionCheck​(RpcConnection rpcConnection)
                                  throws ConnectionException
        Check Server Trust

        Certificate Validation depends on RPC_SSL_CLIENT_CERT_VALIDATE_NICK.

        Self-signed certs use only a fingerprint comparison after checking the cert's dates.

        Parameters:
        rpcConnection - rpcConnection
        Throws:
        ConnectionException - on error
      • composeAuthTicketEntryKey

        protected java.lang.String composeAuthTicketEntryKey​(java.lang.String userName,
                                                             java.lang.String serverAddress)
        Compose the key for an auth ticket entry
        Parameters:
        userName - userName
        serverAddress - serverAddress
        Returns:
        key
      • getClientNameForEnv

        protected java.lang.String getClientNameForEnv()
      • getHostForEnv

        protected java.lang.String getHostForEnv()
      • getLanguageForEnv

        protected java.lang.String getLanguageForEnv()
      • getOsTypeForEnv

        protected java.lang.String getOsTypeForEnv()
      • getRpcPacketFieldRule

        protected RpcPacketFieldRule getRpcPacketFieldRule​(java.util.Map<java.lang.String,​java.lang.Object> inMap,
                                                           CmdSpec cmdSpec)
        Get the RPC packet field rule for skipping the charset conversion of a range of RPC packet fields; leave the values as bytes.

        Note: currently only supporting the "export" command.

        Parameters:
        inMap - inMap
        cmdSpec - cmdSpec
        Returns:
        RpcPacketFieldRule
      • getSecretKey

        public java.lang.String getSecretKey()
      • setSecretKey

        public void setSecretKey​(java.lang.String secretKey)
      • getSecretKey

        public java.lang.String getSecretKey​(java.lang.String userName)
      • getPBuf

        public java.lang.String getPBuf​(java.lang.String userName)
      • getUserForEnv

        protected java.lang.String getUserForEnv()
      • loadFingerprint

        public Fingerprint loadFingerprint​(java.lang.String serverKey,
                                           java.lang.String fingerprintUser)
        Get the p4trust entry value for the server IP and port based upon a search of either the file found at PropertyDefs.TRUST_PATH_KEY_SHORT_FORM, PropertyDefs.TRUST_PATH_KEY, the P4TRUST environment variable or the standard p4trust file location for the current OS. Will return null if not found or if an error occurred attempt to lookup the value.
        Parameters:
        serverKey - serverKey
        fingerprintUser - fingerprintUser
        Returns:
        - fingerprint or null if not found.
      • loadFingerprints

        public Fingerprint[] loadFingerprints()
        Get the p4trust entries from the file found at PropertyDefs.TRUST_PATH_KEY_SHORT_FORM, PropertyDefs.TRUST_PATH_KEY, the P4TRUST environment variable or the standard p4trust file location for the current OS. Will return null if nothing found or if an error occurred attempt to lookup the entries.
        Returns:
        - list of fingerprints or null if nothing found.
      • loadTicket

        @Nullable
        public java.lang.String loadTicket​(java.lang.String serverId)
        Get the p4tickets entry value for the current user returned from Server.getUserName() and server address based upon a search of either the file found at PropertyDefs.TICKET_PATH_KEY_SHORT_FORM, PropertyDefs.TICKET_PATH_KEY, the P4TICKETS environment variable or the standard p4tickets file location for the current OS. Will return null if not found or if an error occurred attempt to lookup the value.
        Parameters:
        serverId - serverId
        Returns:
        - ticket value to get used for Server.setAuthTicket(String) or null if not found.
      • loadTicket

        public java.lang.String loadTicket​(java.lang.String serverId,
                                           java.lang.String name)
        Get the p4tickets entry value for the specified user and server address based upon a search of either the file found at PropertyDefs.TICKET_PATH_KEY_SHORT_FORM, PropertyDefs.TICKET_PATH_KEY, the P4TICKETS environment variable or the standard p4tickets file location for the current OS. Will return null if not found or if an error occurred attempt to lookup the value.
        Parameters:
        serverId - serverId
        name - name
        Returns:
        - ticket value to get used for Server.setAuthTicket(String) or null if not found.
      • processCmdCallbacks

        protected void processCmdCallbacks​(int cmdCallBackKey,
                                           long timeTaken,
                                           java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> resultMaps)
      • getErrorOrInfoStr

        @Deprecated
        public java.lang.String getErrorOrInfoStr​(java.util.Map<java.lang.String,​java.lang.Object> map)
        Description copied from interface: IHelixCommandExecutor
        Gets the info/warning/error/fatal message from the passed-in Perforce command results map. If no info/warning/error/fatal message found in the results map it returns null.

        Note that the minimum severity code is MessageSeverityCode.E_INFO. Therefore, only message with severity code >= MessageSeverityCode.E_INFO will be returned.

        RPC impl errors come across the wire as a map in the form usually like this:

         fmt0=Access for user '%user%' has not been enabled by 'p4 protect'.,
         func=client-Message, user=nouser, code0=822483067
         
        Note that the code0 entry will be used to get the severity level; the fmt0 entry contains the message.

        Parameters:
        map - Perforce command results map
        Returns:
        possibly-null info/warning/error/fatal string
      • getSeverityCode

        public int getSeverityCode​(java.util.Map<java.lang.String,​java.lang.Object> map)
      • getGenericCode

        public int getGenericCode​(java.util.Map<java.lang.String,​java.lang.Object> map)
      • getAuthId

        public java.lang.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
      • saveTicket

        @Deprecated
        public void saveTicket​(java.lang.String ticketValue)
                        throws ConfigException
        Save specified auth ticket value as associate with this server's address and configured user returned from Server.getUserName(). This will attempt to write an entry to the p4tickets file either specified as the P4TICKETS environment variable or at the OS specific default location. If the ticket value is null then the current entry in the will be cleared.
        Parameters:
        ticketValue - ticketValue
        Throws:
        ConfigException - on error
      • saveFingerprint

        public void saveFingerprint​(java.lang.String serverIpPort,
                                    java.lang.String fingerprintUser,
                                    java.lang.String fingerprintValue)
                             throws ConfigException
        Save specified fingerprint value as associate with this server's address. This will attempt to write an entry to the p4trust file either specified as the P4TRUST environment variable or at the OS specific default location. If the fingerprint value is null then the current entry will be cleared.
        Parameters:
        serverIpPort - serverIpPort
        fingerprintUser - fingerprintUser
        fingerprintValue - fingerprintValue
        Throws:
        ConfigException - on error
      • saveTicket

        public void saveTicket​(java.lang.String userName,
                               java.lang.String serverId,
                               java.lang.String ticketValue)
                        throws ConfigException
        Save specified auth ticket value as associate with this server's address and user name from the userName parameter. This will attempt to write an entry to the p4tickets file either specified as the P4TICKETS environment variable or at the OS specific default location. If the ticket value is null then the current entry will be cleared.
        Parameters:
        userName - userName
        serverId - serverId
        ticketValue - ticketValue
        Throws:
        ConfigException - on error
      • setSecretKey

        public void setSecretKey​(java.lang.String userName,
                                 java.lang.String secretKey)
      • setPbuf

        public void setPbuf​(java.lang.String userName,
                            java.lang.String pBuf)
      • useTags

        protected boolean useTags​(java.lang.String cmdName,
                                  java.lang.String[] cmdArgs,
                                  java.util.Map<java.lang.String,​java.lang.Object> inMap,
                                  boolean isStreamCmd)
        Allow for per-command use of tags or not. Currently has limited use (only a few commands are anomalous as far as we can tell), but may find more uses generally with experience.

        This is normally used on a per-command (OneShot RPC server) basis. In order to use this on a per-session (NTS RPC server) implementation you must resend the RPC protocol, if the 'useTags' state has changed, prior to sending the command.

        Parameters:
        cmdName - cmdName
        cmdArgs - cmdArgs
        inMap - inMap
        isStreamCmd - isStreamCmd
        Returns:
        RPC_TAGS_USED | false
      • writeInPlace

        protected boolean writeInPlace​(java.lang.String cmdName)
        Return true if we should be performing server -> client file write I/O operations in place for this command.

        See PropertyDefs.WRITE_IN_PLACE_KEY javadoc for the semantics of this.

        Parameters:
        cmdName - non-null command command name string
        Returns:
        true iff we should do a sync in place