protected Map<String, List<Map<String, Object>>> getConnectionsAttribute(Profile profile) { return profile.getAttribute(CONNECTIONS_ATTRIBUTE_NAME); }
protected Map<String, List<Map<String, Object>>> getConnectionsAttribute(Profile profile) { return profile.getAttribute(CONNECTIONS_ATTRIBUTE_NAME); }
/** * Remove all {@link org.springframework.social.connect.ConnectionData} associated to the specified provider ID. * * @param profile the profile where to remove the data from * @param providerId the provider ID of the connection */ public static void removeConnectionData(Profile profile, String providerId) { Map<String, List<Map<String, Object>>> allConnections = profile.getAttribute(CONNECTIONS_ATTRIBUTE_NAME); if (MapUtils.isNotEmpty(allConnections)) { allConnections.remove(providerId); } }
/** * Remove all {@link ConnectionData} associated to the specified provider ID. * * @param profile the profile where to remove the data from * @param providerId the provider ID of the connection */ public static void removeConnectionData(Profile profile, String providerId) { Map<String, List<Map<String, Object>>> allConnections = profile.getAttribute(CONNECTIONS_ATTRIBUTE_NAME); if (MapUtils.isNotEmpty(allConnections)) { allConnections.remove(providerId); } }
/** * Remove all {@link org.springframework.social.connect.ConnectionData} associated to the specified provider ID. * * @param profile the profile where to remove the data from * @param providerId the provider ID of the connection */ public static void removeConnectionData(Profile profile, String providerId) { Map<String, List<Map<String, Object>>> allConnections = profile.getAttribute(CONNECTIONS_ATTRIBUTE_NAME); if (MapUtils.isNotEmpty(allConnections)) { allConnections.remove(providerId); } }
/** * Remove the {@link ConnectionData} associated to the provider ID and user ID. * * @param providerId the provider ID of the connection * @param providerUserId the provider user ID * @param profile the profile where to remove the data from */ public static void removeConnectionData(String providerId, String providerUserId, Profile profile) { Map<String, List<Map<String, Object>>> allConnections = profile.getAttribute(CONNECTIONS_ATTRIBUTE_NAME); if (MapUtils.isNotEmpty(allConnections)) { List<Map<String, Object>> connectionsForProvider = allConnections.get(providerId); if (CollectionUtils.isNotEmpty(connectionsForProvider)) { for (Iterator<Map<String, Object>> iter = connectionsForProvider.iterator(); iter.hasNext();) { Map<String, Object> connectionDataMap = iter.next(); if (providerUserId.equals(connectionDataMap.get("providerUserId"))) { iter.remove(); } } } } }
/** * Remove the {@link org.springframework.social.connect.ConnectionData} associated to the provider ID and user ID. * * @param providerId the provider ID of the connection * @param providerUserId the provider user ID * @param profile the profile where to remove the data from */ public static void removeConnectionData(String providerId, String providerUserId, Profile profile) { Map<String, List<Map<String, Object>>> allConnections = profile.getAttribute(CONNECTIONS_ATTRIBUTE_NAME); if (MapUtils.isNotEmpty(allConnections)) { List<Map<String, Object>> connectionsForProvider = allConnections.get(providerId); if (CollectionUtils.isNotEmpty(connectionsForProvider)) { for (Iterator<Map<String, Object>> iter = connectionsForProvider.iterator(); iter.hasNext();) { Map<String, Object> connectionDataMap = iter.next(); if (providerUserId.equals(connectionDataMap.get("providerUserId"))) { iter.remove(); } } } } }
/** * Remove the {@link org.springframework.social.connect.ConnectionData} associated to the provider ID and user ID. * * @param providerId the provider ID of the connection * @param providerUserId the provider user ID * @param profile the profile where to remove the data from */ public static void removeConnectionData(String providerId, String providerUserId, Profile profile) { Map<String, List<Map<String, Object>>> allConnections = profile.getAttribute(CONNECTIONS_ATTRIBUTE_NAME); if (MapUtils.isNotEmpty(allConnections)) { List<Map<String, Object>> connectionsForProvider = allConnections.get(providerId); if (CollectionUtils.isNotEmpty(connectionsForProvider)) { for (Iterator<Map<String, Object>> iter = connectionsForProvider.iterator(); iter.hasNext();) { Map<String, Object> connectionDataMap = iter.next(); if (providerUserId.equals(connectionDataMap.get("providerUserId"))) { iter.remove(); } } } } }
/** * Returns the list of {@link org.springframework.social.connect.ConnectionData} associated to the provider ID of * the specified profile * * @param profile the profile that contains the connection data in its attributes * @param providerId the provider ID of the connection * @param encryptor the encryptor used to decrypt the accessToken, secret and refreshToken * * @return the list of connection data for the provider, or empty if no connection data was found */ public static List<ConnectionData> getConnectionData(Profile profile, String providerId, TextEncryptor encryptor) throws CryptoException { Map<String, List<Map<String, Object>>> allConnections = profile.getAttribute(CONNECTIONS_ATTRIBUTE_NAME); if (MapUtils.isNotEmpty(allConnections)) { List<Map<String, Object>> connectionsForProvider = allConnections.get(providerId); if (CollectionUtils.isNotEmpty(connectionsForProvider)) { List<ConnectionData> connectionDataList = new ArrayList<>(connectionsForProvider.size()); for (Map<String, Object> connectionDataMap : connectionsForProvider) { connectionDataList.add(mapToConnectionData(providerId, connectionDataMap, encryptor)); } return connectionDataList; } } return Collections.emptyList(); }
/** * Returns the list of {@link ConnectionData} associated to the provider ID of * the specified profile * * @param profile the profile that contains the connection data in its attributes * @param providerId the provider ID of the connection * @param encryptor the encryptor used to decrypt the accessToken, secret and refreshToken * * @return the list of connection data for the provider, or empty if no connection data was found */ public static List<ConnectionData> getConnectionData(Profile profile, String providerId, TextEncryptor encryptor) throws CryptoException { Map<String, List<Map<String, Object>>> allConnections = profile.getAttribute(CONNECTIONS_ATTRIBUTE_NAME); if (MapUtils.isNotEmpty(allConnections)) { List<Map<String, Object>> connectionsForProvider = allConnections.get(providerId); if (CollectionUtils.isNotEmpty(connectionsForProvider)) { List<ConnectionData> connectionDataList = new ArrayList<>(connectionsForProvider.size()); for (Map<String, Object> connectionDataMap : connectionsForProvider) { connectionDataList.add(mapToConnectionData(providerId, connectionDataMap, encryptor)); } return connectionDataList; } } return Collections.emptyList(); }
/** * Returns the list of {@link org.springframework.social.connect.ConnectionData} associated to the provider ID of * the specified profile * * @param profile the profile that contains the connection data in its attributes * @param providerId the provider ID of the connection * @param encryptor the encryptor used to decrypt the accessToken, secret and refreshToken * * @return the list of connection data for the provider, or empty if no connection data was found */ public static List<ConnectionData> getConnectionData(Profile profile, String providerId, TextEncryptor encryptor) throws CryptoException { Map<String, List<Map<String, Object>>> allConnections = profile.getAttribute(CONNECTIONS_ATTRIBUTE_NAME); if (MapUtils.isNotEmpty(allConnections)) { List<Map<String, Object>> connectionsForProvider = allConnections.get(providerId); if (CollectionUtils.isNotEmpty(connectionsForProvider)) { List<ConnectionData> connectionDataList = new ArrayList<>(connectionsForProvider.size()); for (Map<String, Object> connectionDataMap : connectionsForProvider) { connectionDataList.add(mapToConnectionData(providerId, connectionDataMap, encryptor)); } return connectionDataList; } } return Collections.emptyList(); }
Map<String, List<Map<String, Object>>> allConnections = profile.getAttribute(CONNECTIONS_ATTRIBUTE_NAME); List<Map<String, Object>> connectionsForProvider = null;
Map<String, List<Map<String, Object>>> allConnections = profile.getAttribute(CONNECTIONS_ATTRIBUTE_NAME); List<Map<String, Object>> connectionsForProvider = null;
Map<String, List<Map<String, Object>>> allConnections = profile.getAttribute(CONNECTIONS_ATTRIBUTE_NAME); List<Map<String, Object>> connectionsForProvider = null;