Class FSAccountManager
- java.lang.Object
-
- com.sun.identity.federation.accountmgmt.FSAccountManager
-
public class FSAccountManager extends Object
This class is used for storing & retrieving user account's federation specific information.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FSAccountManagergetInstance(String metaAlias)Gets an Object for FSAccountManager Class.StringgetUserID(FSAccountFedInfoKey fedInfoKey, String orgDN, Map env)Searches user with given combination of ProviderID & Opaque handle in given Organization.StringgetUserID(FSAccountFedInfoKey fedInfoKey, Map env)Searches user with given combination of ProviderID & Opaque handle in Default Organization.StringgetUserID(Map avPair, String orgDN, Map env)Gets the user by using a given search filter.booleanhasAnyActiveFederation(String userID)Returns true If Any Active federation is found where idpRole is true means local deployment worked as SP in that federation and federation is still Active.booleanisFederationActive(String userID, String providerID)Returns true/false if Account's federation Status is Active / Inactive for given providerID.FSAccountFedInforeadAccountFedInfo(String userID, String providerID)Reads Account's federation Info from data store for given providerID and returns value as fedInfo object.FSAccountFedInforeadAccountFedInfo(String userID, String providerID, String nameIDValue)Reads Account's federation Info from data store for given providerID and returns value as fedInfo object.SetreadAllFederatedProviderID(String userID)Reads All Account's federation Info from data store for given user identity and returns a Set of ProviderIDs with which user is federated (FedStatus is Active).SetreadAllFederatedProviderID(String providerID, String userID)Reads All Account's federation Info from data store for given user identity and providerID.voidremoveAccountFedInfo(String userID, FSAccountFedInfo fedInfo)Removes Account's federation Info in data store.voidremoveAccountFedInfo(String userID, FSAccountFedInfoKey fedInfoKey, String providerID)Removes Account's federation Info in data store for given providerID in fedInfo object.voidremoveAccountFedInfoKey(String userID, FSAccountFedInfoKey fedInfoKey)Removes Account's federation Info Key in data store.voidwriteAccountFedInfo(String userID, FSAccountFedInfoKey fedInfoKey, FSAccountFedInfo fedInfo)Stores Account's federation Info in data store.voidwriteAccountFedInfo(String userID, FSAccountFedInfoKey fedInfoKey, FSAccountFedInfo fedInfo, FSAccountFedInfoKey oldFedInfoKey)Stores Account's federation Info in data store.
-
-
-
Method Detail
-
getInstance
public static FSAccountManager getInstance(String metaAlias) throws FSAccountMgmtException
Gets an Object for FSAccountManager Class. Used to instantiate the Class.- Parameters:
metaAlias- meta alias of hosted provider- Returns:
- FSAccountManager Object.
- Throws:
FSAccountMgmtException- if error occurred.
-
writeAccountFedInfo
public void writeAccountFedInfo(String userID, FSAccountFedInfoKey fedInfoKey, FSAccountFedInfo fedInfo) throws FSAccountMgmtException
Stores Account's federation Info in data store.- Parameters:
userID- user idfedInfo- Account federation info as FSAccountFedInfo object.fedInfoKey- Account Fed Info Key which contains NameSpace and opaque handle sent/received.- Throws:
FSAccountMgmtException- if illegal argument passed.
-
removeAccountFedInfo
public void removeAccountFedInfo(String userID, FSAccountFedInfo fedInfo) throws FSAccountMgmtException
Removes Account's federation Info in data store.- Parameters:
userID- user idfedInfo- Account federation info as FSAccountFedInfo object.- Throws:
FSAccountMgmtException- if illegal argument passed. TODO, this may remove the wrong info key, as two SP could federation with same IDP use the one with providerID parameter
-
writeAccountFedInfo
public void writeAccountFedInfo(String userID, FSAccountFedInfoKey fedInfoKey, FSAccountFedInfo fedInfo, FSAccountFedInfoKey oldFedInfoKey) throws FSAccountMgmtException
Stores Account's federation Info in data store.- Parameters:
userID- user idfedInfo- Account federation info as FSAccountFedInfo object.fedInfoKey- Account Fed Info Key which contains NameSpace & opaque handle sent/received.oldFedInfoKey- Account Fed Info Key which contains NameSpace & opaque handle sent/received, which will be removed.- Throws:
FSAccountMgmtException- if illegal argument passed.
-
removeAccountFedInfoKey
public void removeAccountFedInfoKey(String userID, FSAccountFedInfoKey fedInfoKey) throws FSAccountMgmtException
Removes Account's federation Info Key in data store.- Parameters:
userID- user idfedInfoKey- Account Fed Info Key which contains NameSpace & opaque handle sent/received, which will be removed.- Throws:
FSAccountMgmtException- if illegal argument passed.
-
removeAccountFedInfo
public void removeAccountFedInfo(String userID, FSAccountFedInfoKey fedInfoKey, String providerID) throws FSAccountMgmtException
Removes Account's federation Info in data store for given providerID in fedInfo object.- Parameters:
userID- user idfedInfoKey- Account Fed Info Key which contains NameSpace & opaque handle sent/received.providerID- Remote ProviderID value.- Throws:
FSAccountMgmtException- - If Account fed info is not found for given user & given ProviderID.
-
readAccountFedInfo
public FSAccountFedInfo readAccountFedInfo(String userID, String providerID) throws FSAccountMgmtException
Reads Account's federation Info from data store for given providerID and returns value as fedInfo object. Returns null if value not found for given providerID- Parameters:
userID- user ID.providerID- Remote ProviderID value.- Returns:
- Account's federation Info. Null if no Account Federation info value for given providerID.
- Throws:
FSAccountMgmtException- if an error occurred.
-
readAccountFedInfo
public FSAccountFedInfo readAccountFedInfo(String userID, String providerID, String nameIDValue) throws FSAccountMgmtException
Reads Account's federation Info from data store for given providerID and returns value as fedInfo object. Returns null if value not found for given providerID- Parameters:
userID- user ID.providerID- Remote ProviderID value.nameIDValue- fedinfo with this name ID value is to be found.- Returns:
- Account's federation Info. Null if no Account Federation info value for given providerID.
- Throws:
FSAccountMgmtException- if an error occurred.
-
readAllFederatedProviderID
public Set readAllFederatedProviderID(String userID) throws FSAccountMgmtException
Reads All Account's federation Info from data store for given user identity and returns a Set of ProviderIDs with which user is federated (FedStatus is Active).- Parameters:
userID- user identity- Returns:
- Set of ProviderIDs with which user is federated (FedStatus is Active).
- Throws:
FSAccountMgmtException- if an error occurred.
-
readAllFederatedProviderID
public Set readAllFederatedProviderID(String providerID, String userID) throws FSAccountMgmtException
Reads All Account's federation Info from data store for given user identity and providerID. Returns a Set of ProviderIDs with which user is federated (FedStatus is Active).- Parameters:
userID- user identityproviderID- local provider ID- Returns:
- Set of ProviderIDs with which user is federated (FedStatus is Active).
- Throws:
FSAccountMgmtException- if error occurred.
-
isFederationActive
public boolean isFederationActive(String userID, String providerID) throws FSAccountMgmtException
Returns true/false if Account's federation Status is Active / Inactive for given providerID.- Parameters:
userID- user identityproviderID- Remote ProviderID value.- Returns:
- true/false if Account's federation Status is Active / Inactive for given providerID.
- Throws:
FSAccountMgmtException- - If Account fed info is not found for given user & given ProviderID.
-
hasAnyActiveFederation
public boolean hasAnyActiveFederation(String userID) throws FSAccountMgmtException
Returns true If Any Active federation is found where idpRole is true means local deployment worked as SP in that federation and federation is still Active.- Parameters:
userID- user id- Returns:
- true If Any Active federation is found where idpRole is true means local deployment worked as SP in that federation and federation is still Active.
- Throws:
FSAccountMgmtException- - If Account fed info is not found for given user.
-
getUserID
public String getUserID(FSAccountFedInfoKey fedInfoKey, Map env) throws FSAccountMgmtException
Searches user with given combination of ProviderID & Opaque handle in Default Organization.- Parameters:
fedInfoKey- Account Fed Info Key which contains NameSpace & opaque handle sent/received.env- - Extra parameters that can be used for user mapping.- Returns:
- User DN if user found with given combination else returns null. If Some error occurs returns null.
- Throws:
FSAccountMgmtException- - If Unable to get Organization
-
getUserID
public String getUserID(FSAccountFedInfoKey fedInfoKey, String orgDN, Map env) throws FSAccountMgmtException
Searches user with given combination of ProviderID & Opaque handle in given Organization.- Parameters:
fedInfoKey- Account Fed Info Key which contains NameSpace & opaque handle sent/received.orgDN- organization DN.env- Extra parameters that can be used for user mapping.- Returns:
- User DN if user found with given combination else returns null. If Some error occurs returns null.
- Throws:
FSAccountMgmtException- - If Unable to get Organization.
-
getUserID
public String getUserID(Map avPair, String orgDN, Map env) throws FSAccountMgmtException
Gets the user by using a given search filter.- Parameters:
avPair- Attribute Value Pair to be used in finding the user.orgDN- Organization DN.env- Extra parameters that can be used for user mapping.- Throws:
FSAccountMgmtException- if an error occurred.
-
-