Class PasswordProviderWrapper

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.apache.sshd.common.config.keys.FilePasswordProvider

        org.apache.sshd.common.config.keys.FilePasswordProvider.ResourceDecodeResult
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​java.util.concurrent.atomic.AtomicInteger> counts  
      private KeyPasswordProvider delegate  
      • Fields inherited from interface org.apache.sshd.common.config.keys.FilePasswordProvider

        EMPTY
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getAttempts()
      Gets the maximum number of attempts to get a password that should be attempted for one identity resource through this provider.
      java.lang.String getPassword​(org.apache.sshd.common.session.SessionContext session, org.apache.sshd.common.NamedResource resource, int attemptIndex)  
      org.apache.sshd.common.config.keys.FilePasswordProvider.ResourceDecodeResult handleDecodeAttemptResult​(org.apache.sshd.common.session.SessionContext session, org.apache.sshd.common.NamedResource resource, int retryIndex, java.lang.String password, java.lang.Exception err)  
      void setAttempts​(int numberOfPasswordPrompts)
      Define the maximum number of attempts to get a password that should be attempted for one identity resource through this provider.
      private URIish toUri​(java.lang.String resourceKey)
      Creates a URIish from a given string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • counts

        private java.util.Map<java.lang.String,​java.util.concurrent.atomic.AtomicInteger> counts
    • Method Detail

      • setAttempts

        public void setAttempts​(int numberOfPasswordPrompts)
        Description copied from interface: RepeatingFilePasswordProvider
        Define the maximum number of attempts to get a password that should be attempted for one identity resource through this provider.
        Specified by:
        setAttempts in interface RepeatingFilePasswordProvider
        Parameters:
        numberOfPasswordPrompts - number of times to ask for a password; IllegalArgumentException may be thrown if <= 0
      • getAttempts

        public int getAttempts()
        Description copied from interface: RepeatingFilePasswordProvider
        Gets the maximum number of attempts to get a password that should be attempted for one identity resource through this provider.
        Specified by:
        getAttempts in interface RepeatingFilePasswordProvider
        Returns:
        the maximum number of attempts to try, always >= 1.
      • getPassword

        public java.lang.String getPassword​(org.apache.sshd.common.session.SessionContext session,
                                            org.apache.sshd.common.NamedResource resource,
                                            int attemptIndex)
                                     throws java.io.IOException
        Specified by:
        getPassword in interface org.apache.sshd.common.config.keys.FilePasswordProvider
        Throws:
        java.io.IOException
      • handleDecodeAttemptResult

        public org.apache.sshd.common.config.keys.FilePasswordProvider.ResourceDecodeResult handleDecodeAttemptResult​(org.apache.sshd.common.session.SessionContext session,
                                                                                                                      org.apache.sshd.common.NamedResource resource,
                                                                                                                      int retryIndex,
                                                                                                                      java.lang.String password,
                                                                                                                      java.lang.Exception err)
                                                                                                               throws java.io.IOException,
                                                                                                                      java.security.GeneralSecurityException
        Specified by:
        handleDecodeAttemptResult in interface org.apache.sshd.common.config.keys.FilePasswordProvider
        Throws:
        java.io.IOException
        java.security.GeneralSecurityException
      • toUri

        private URIish toUri​(java.lang.String resourceKey)
        Creates a URIish from a given string. The CredentialsProvider uses uris as resource identifications.
        Parameters:
        resourceKey - to convert
        Returns:
        the uri