Package org.springframework.social.connect

Examples of org.springframework.social.connect.ConnectionKey


    }

    private Connection<?> getConnection(String providerId, String providerUserId) {
        List<SocialAuthentication> socialAuthentications = userDao.getSocialAuthentications(providerId, providerUserId);
        if (socialAuthentications.isEmpty()) {
            throw new NoSuchConnectionException(new ConnectionKey(providerId, providerUserId));
        }
        return authToConnection(socialAuthentications.get(0));
    }
View Full Code Here


   */
  @RequestMapping(value="/{providerId}/{providerUserId}", method=RequestMethod.DELETE)
  public RedirectView removeConnection(@PathVariable String providerId, @PathVariable String providerUserId, NativeWebRequest request) {
    ConnectionFactory<?> connectionFactory = connectionFactoryLocator.getConnectionFactory(providerId);
    preDisconnect(connectionFactory, request);
    connectionRepository.removeConnection(new ConnectionKey(providerId, providerUserId));
    postDisconnect(connectionFactory, request);
    return connectionStatusRedirect(providerId, request);
  }
View Full Code Here

  public static DummyConnection<Object> dummy(String provider, String user) {
    return new DummyConnection<Object>(provider, user, new Object());
  }
 
  public DummyConnection(String provider, String user, T api) {
    _key = new ConnectionKey(provider, user);
    _api = api;
  }
View Full Code Here

  public static DummyConnection<Object> dummy(String provider, String user) {
    return new DummyConnection<Object>(provider, user, new Object());
  }
 
  public DummyConnection(String provider, String user, T api) {
    _key = new ConnectionKey(provider, user);
    _api = api;
  }
View Full Code Here

            UserProfile socialMediaProfile = connection.fetchUserProfile();
            dto.setEmail(socialMediaProfile.getEmail());
            dto.setFirstName(socialMediaProfile.getFirstName());
            dto.setLastName(socialMediaProfile.getLastName());

            ConnectionKey providerKey = connection.getKey();
            dto.setSignInProvider(SocialMediaService.valueOf(providerKey.getProviderId().toUpperCase()));
        }

        return dto;
    }
View Full Code Here

  public void setTablePrefix(String tablePrefix) {
    this.tablePrefix = tablePrefix;
  }
 
  public List<String> findUserIdsWithConnection(Connection<?> connection) {
    ConnectionKey key = connection.getKey();
    List<String> localUserIds = jdbcTemplate.queryForList("select userId from " + tablePrefix + "UserConnection where providerId = ? and providerUserId = ?", String.class, key.getProviderId(), key.getProviderUserId());   
    if (localUserIds.size() == 0 && connectionSignUp != null) {
      String newUserId = connectionSignUp.execute(connection);
      if (newUserId != null)
      {
        createConnectionRepository(newUserId).addConnection(connection);
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  public <A> Connection<A> getConnection(Class<A> apiType, String providerUserId) {
    String providerId = getProviderId(apiType);
    return (Connection<A>) getConnection(new ConnectionKey(providerId, providerUserId));
  }
View Full Code Here

    throw new NoSuchConnectionException(connectionKey);
  }

  @SuppressWarnings("unchecked")
  public <A> Connection<A> getConnection(Class<A> apiType, String providerUserId) {
    return (Connection<A>) getConnection(new ConnectionKey(getProviderId(apiType), providerUserId));
  }
View Full Code Here

    return null;
  }

  public void addConnection(Connection<?> connection) {
    try {
      ConnectionKey connectionKey = connection.getKey();
      getConnection(connectionKey);
      throw new DuplicateConnectionException(connectionKey);
    } catch (NoSuchConnectionException e) {
      connections.add(connection.createData().getProviderId(), connection);
    }
View Full Code Here

   * Creates a connection from the data provider.
   * @param data the connection data
   * @param apiAdapter the Service API adapter
   */
  public AbstractConnection(ConnectionData data, ApiAdapter<A> apiAdapter) {
    key = new ConnectionKey(data.getProviderId(), data.getProviderUserId());
    this.apiAdapter = apiAdapter;
    displayName = data.getDisplayName();
    profileUrl = data.getProfileUrl();
    imageUrl = data.getImageUrl();
    valuesInitialized = true;
View Full Code Here

TOP

Related Classes of org.springframework.social.connect.ConnectionKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.