Exemple #1
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((clientProperties == null) ? 0 : clientProperties.hashCode());
   return result;
 }
 public int hashCode() {
   int result = 17;
   result = result * 37 + ((xaDataSourceClass == null) ? 0 : xaDataSourceClass.hashCode());
   result = result * 37 + xaProps.hashCode();
   result = result * 37 + ((userName == null) ? 0 : userName.hashCode());
   result = result * 37 + ((password == null) ? 0 : password.hashCode());
   result = result * 37 + transactionIsolation;
   return result;
 }
 @Override
 public int hashCode() {
   int result = properties != null ? properties.hashCode() : 0;
   result = 31 * result + (jmxDomain != null ? jmxDomain.hashCode() : 0);
   result = 31 * result + (allowDuplicateDomains != null ? allowDuplicateDomains.hashCode() : 0);
   result = 31 * result + (cacheManagerName != null ? cacheManagerName.hashCode() : 0);
   result =
       31 * result
           + (mBeanServerLookupInstance != null ? mBeanServerLookupInstance.hashCode() : 0);
   result = 31 * result + (enabled ? 1 : 0);
   return result;
 }
 @Override
 public int hashCode() {
   int result = (debug ? 1 : 0);
   result = 31 * result + (userAgent != null ? userAgent.hashCode() : 0);
   result = 31 * result + (user != null ? user.hashCode() : 0);
   result = 31 * result + (password != null ? password.hashCode() : 0);
   result = 31 * result + (useSSL ? 1 : 0);
   result = 31 * result + (prettyDebug ? 1 : 0);
   result = 31 * result + (gzipEnabled ? 1 : 0);
   result = 31 * result + (httpProxyHost != null ? httpProxyHost.hashCode() : 0);
   result = 31 * result + (httpProxyUser != null ? httpProxyUser.hashCode() : 0);
   result = 31 * result + (httpProxyPassword != null ? httpProxyPassword.hashCode() : 0);
   result = 31 * result + httpProxyPort;
   result = 31 * result + httpConnectionTimeout;
   result = 31 * result + httpReadTimeout;
   result = 31 * result + httpStreamingReadTimeout;
   result = 31 * result + httpRetryCount;
   result = 31 * result + httpRetryIntervalSeconds;
   result = 31 * result + maxTotalConnections;
   result = 31 * result + defaultMaxPerRoute;
   result = 31 * result + (oAuthConsumerKey != null ? oAuthConsumerKey.hashCode() : 0);
   result = 31 * result + (oAuthConsumerSecret != null ? oAuthConsumerSecret.hashCode() : 0);
   result = 31 * result + (oAuthAccessToken != null ? oAuthAccessToken.hashCode() : 0);
   result = 31 * result + (oAuthAccessTokenSecret != null ? oAuthAccessTokenSecret.hashCode() : 0);
   result = 31 * result + (oAuthRequestTokenURL != null ? oAuthRequestTokenURL.hashCode() : 0);
   result = 31 * result + (oAuthAuthorizationURL != null ? oAuthAuthorizationURL.hashCode() : 0);
   result = 31 * result + (oAuthAccessTokenURL != null ? oAuthAccessTokenURL.hashCode() : 0);
   result = 31 * result + (oAuthAuthenticationURL != null ? oAuthAuthenticationURL.hashCode() : 0);
   result = 31 * result + (restBaseURL != null ? restBaseURL.hashCode() : 0);
   result = 31 * result + (searchBaseURL != null ? searchBaseURL.hashCode() : 0);
   result = 31 * result + (streamBaseURL != null ? streamBaseURL.hashCode() : 0);
   result = 31 * result + (userStreamBaseURL != null ? userStreamBaseURL.hashCode() : 0);
   result = 31 * result + (siteStreamBaseURL != null ? siteStreamBaseURL.hashCode() : 0);
   result = 31 * result + (uploadBaseURL != null ? uploadBaseURL.hashCode() : 0);
   result = 31 * result + (dispatcherImpl != null ? dispatcherImpl.hashCode() : 0);
   result = 31 * result + asyncNumThreads;
   result = 31 * result + (includeRTsEnabled ? 1 : 0);
   result = 31 * result + (includeEntitiesEnabled ? 1 : 0);
   result = 31 * result + (jsonStoreEnabled ? 1 : 0);
   result = 31 * result + (mbeanEnabled ? 1 : 0);
   result = 31 * result + (userStreamRepliesAllEnabled ? 1 : 0);
   result = 31 * result + (mediaProvider != null ? mediaProvider.hashCode() : 0);
   result = 31 * result + (mediaProviderAPIKey != null ? mediaProviderAPIKey.hashCode() : 0);
   result =
       31 * result + (mediaProviderParameters != null ? mediaProviderParameters.hashCode() : 0);
   result = 31 * result + (clientVersion != null ? clientVersion.hashCode() : 0);
   result = 31 * result + (clientURL != null ? clientURL.hashCode() : 0);
   result = 31 * result + (IS_DALVIK ? 1 : 0);
   result = 31 * result + (IS_GAE ? 1 : 0);
   result = 31 * result + (requestHeaders != null ? requestHeaders.hashCode() : 0);
   return result;
 }
Exemple #5
0
  public static SessionAndTransport getSessionAndTransport(Properties props, Authenticator auth)
      throws MessagingException {
    String key = "" + props.hashCode();

    // Session
    SessionAndTransport sat = null;
    Stack<SessionAndTransport> satStack = getSATStack(key);
    sat = pop(satStack);

    // when sat still valid return it
    if (sat != null) {
      if (sat.lastAccess + MAX_AGE > System.currentTimeMillis()) {
        return sat.touch();
      }
      disconnect(sat.transport);
    }

    return new SessionAndTransport(key, props, auth);
  }