code: public static synchronized STSSessionCredentialsProvider getSessionCredentialsProvider(AWSCredentials longTermCredentials,
                                                                                             String serviceEndpoint,
                                                                                             ClientConfiguration stsClientConfiguration) {
          Key key = new Key(longTermCredentials.getAWSAccessKeyId(), serviceEndpoint);
          if ( !cache.containsKey(key) ) {
              cache.put(key, new STSSessionCredentialsProvider(longTermCredentials, stsClientConfiguration));
          }
          return cache.get(key);
      }
docs: Gets a session credentials provider for the long-term credentials and
  service endpoint given. These are shared globally to support reuse of
  session tokens.
  
  @param longTermCredentials
  The long-term AWS account credentials used to initiate a
  session.
  @param serviceEndpoint
  The service endpoint for the service the session credentials
  will be used to access.
  @param stsClientConfiguration
  Client configuration for the {@link AWSSecurityTokenService}
  used to fetch session credentials.