Package org.cilogon.oauth2.servlet.util
Class DBServiceClient
- java.lang.Object
-
- org.cilogon.oauth2.servlet.util.DBServiceClient
-
public class DBServiceClient extends Object
This class is a client that talks to a AbstractDBService.Created by Jeff Gaynor
on 5/21/12 at 1:43 PM
-
-
Field Summary
Fields Modifier and Type Field Description protected org.oa4mp.delegation.common.storage.clients.ClientApprovalKeys
clientApprovalKeys
protected org.oa4mp.delegation.common.storage.clients.ClientKeys
clientKeys
protected IDPKeys
idpKeys
protected TwoFactorSerializationKeys
tfKeys
protected UserKeys
userKeys
-
Constructor Summary
Constructors Constructor Description DBServiceClient(String host, String tokenKey)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description edu.uiuc.ncsa.security.storage.XMLMap
addIdps(List<IdentityProvider> idps)
protected String[][]
convertIdpsToArray(List<IdentityProvider> idps)
protected String[][]
createRequest(edu.uiuc.ncsa.security.storage.XMLMap map)
edu.uiuc.ncsa.security.storage.XMLMap
createUser(UserMultiID umk, String idp, String idpDisplayName, String firstName, String lastName, String email, String affiliation, String displayName, String organizationalUnit)
protected String[][]
createUserRequest(UserMultiID umk, String idp)
protected String[][]
createUserRequest(UserMultiID umk, String idp, String idpDisplayName, String firstName, String lastName, String email, String affilation, String displayName, String organizationalUnit)
Create a request from whatever information is provided.edu.uiuc.ncsa.security.storage.XMLMap
doGet(String action, edu.uiuc.ncsa.security.storage.XMLMap map)
protected edu.uiuc.ncsa.security.storage.XMLMap
doGet(String action, String[][] args)
static String
encode(String x)
List<IdentityProvider>
getAllIdps()
edu.uiuc.ncsa.security.storage.XMLMap
getLastArchivedUser(edu.uiuc.ncsa.security.core.Identifier userUid)
edu.uiuc.ncsa.security.storage.XMLMap
getPortalParameters(String token)
DBServiceSerializer
getSerializer()
edu.uiuc.ncsa.security.util.ssl.SSLConfiguration
getSslConfiguration()
TwoFactorInfo
getTwoFactorInfo(edu.uiuc.ncsa.security.core.Identifier userUid)
edu.uiuc.ncsa.security.storage.XMLMap
getUser(edu.uiuc.ncsa.security.core.Identifier userUid)
edu.uiuc.ncsa.security.storage.XMLMap
getUser(User user)
Convenience method to get a user with new information.edu.uiuc.ncsa.security.storage.XMLMap
getUser(UserMultiID umk, String idp)
edu.uiuc.ncsa.security.storage.XMLMap
getUser(UserMultiID umk, String idp, String idpDisplayName, String firstName, String lastName, String email, String affiliation, String displayName, String organizationalUnit)
edu.uiuc.ncsa.security.core.Identifier
getUserId(UserMultiID umk, String idp)
boolean
hasUser(edu.uiuc.ncsa.security.core.Identifier id)
boolean
hasUser(UserMultiID umk, String idp)
String
host(String... x)
protected String[][]
pairwiseStringArray(ArrayList<String> arg)
Takes a long list of Strings and turns it into a string array suitable for thedoGet(String, String[][])
method.boolean
removeUser(edu.uiuc.ncsa.security.core.Identifier userUid)
void
setSslConfiguration(edu.uiuc.ncsa.security.util.ssl.SSLConfiguration sslConfiguration)
void
setTwoFactorInfo(TwoFactorInfo tfi)
edu.uiuc.ncsa.security.storage.XMLMap
updateUser(UserMultiID umk, String idp, String idpDisplayName, String firstName, String lastName, String email, String affiliation, String displayName, String organizationalUnit)
-
-
-
Field Detail
-
userKeys
protected UserKeys userKeys
-
idpKeys
protected IDPKeys idpKeys
-
tfKeys
protected TwoFactorSerializationKeys tfKeys
-
clientKeys
protected org.oa4mp.delegation.common.storage.clients.ClientKeys clientKeys
-
clientApprovalKeys
protected org.oa4mp.delegation.common.storage.clients.ClientApprovalKeys clientApprovalKeys
-
-
Method Detail
-
getSslConfiguration
public edu.uiuc.ncsa.security.util.ssl.SSLConfiguration getSslConfiguration()
-
setSslConfiguration
public void setSslConfiguration(edu.uiuc.ncsa.security.util.ssl.SSLConfiguration sslConfiguration)
-
doGet
public edu.uiuc.ncsa.security.storage.XMLMap doGet(String action, edu.uiuc.ncsa.security.storage.XMLMap map)
-
encode
public static String encode(String x) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
convertIdpsToArray
protected String[][] convertIdpsToArray(List<IdentityProvider> idps) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
getSerializer
public DBServiceSerializer getSerializer()
-
getUser
public edu.uiuc.ncsa.security.storage.XMLMap getUser(UserMultiID umk, String idp)
-
pairwiseStringArray
protected String[][] pairwiseStringArray(ArrayList<String> arg)
Takes a long list of Strings and turns it into a string array suitable for thedoGet(String, String[][])
method. This assumes an array list of strings of the form key1,value1, key2,value2,... and returns a 2xn array of the form {{key1,value},{key2,value2},...}- Parameters:
arg
-- Returns:
-
createUserRequest
protected String[][] createUserRequest(UserMultiID umk, String idp)
-
createRequest
protected String[][] createRequest(edu.uiuc.ncsa.security.storage.XMLMap map)
-
createUserRequest
protected String[][] createUserRequest(UserMultiID umk, String idp, String idpDisplayName, String firstName, String lastName, String email, String affilation, String displayName, String organizationalUnit)
Create a request from whatever information is provided.- Parameters:
umk
-idp
-idpDisplayName
-firstName
-lastName
-email
-- Returns:
-
updateUser
public edu.uiuc.ncsa.security.storage.XMLMap updateUser(UserMultiID umk, String idp, String idpDisplayName, String firstName, String lastName, String email, String affiliation, String displayName, String organizationalUnit) throws IOException
- Throws:
IOException
-
getUser
public edu.uiuc.ncsa.security.storage.XMLMap getUser(User user)
Convenience method to get a user with new information. This is, in effect, an update method if the user changes.- Parameters:
user
-- Returns:
-
getUser
public edu.uiuc.ncsa.security.storage.XMLMap getUser(UserMultiID umk, String idp, String idpDisplayName, String firstName, String lastName, String email, String affiliation, String displayName, String organizationalUnit)
-
getUser
public edu.uiuc.ncsa.security.storage.XMLMap getUser(edu.uiuc.ncsa.security.core.Identifier userUid)
-
createUser
public edu.uiuc.ncsa.security.storage.XMLMap createUser(UserMultiID umk, String idp, String idpDisplayName, String firstName, String lastName, String email, String affiliation, String displayName, String organizationalUnit)
-
setTwoFactorInfo
public void setTwoFactorInfo(TwoFactorInfo tfi)
-
getTwoFactorInfo
public TwoFactorInfo getTwoFactorInfo(edu.uiuc.ncsa.security.core.Identifier userUid)
-
getUserId
public edu.uiuc.ncsa.security.core.Identifier getUserId(UserMultiID umk, String idp) throws IOException
- Throws:
IOException
-
removeUser
public boolean removeUser(edu.uiuc.ncsa.security.core.Identifier userUid)
-
hasUser
public boolean hasUser(edu.uiuc.ncsa.security.core.Identifier id)
-
hasUser
public boolean hasUser(UserMultiID umk, String idp)
-
addIdps
public edu.uiuc.ncsa.security.storage.XMLMap addIdps(List<IdentityProvider> idps) throws IOException
- Throws:
IOException
-
getAllIdps
public List<IdentityProvider> getAllIdps()
-
getLastArchivedUser
public edu.uiuc.ncsa.security.storage.XMLMap getLastArchivedUser(edu.uiuc.ncsa.security.core.Identifier userUid)
-
getPortalParameters
public edu.uiuc.ncsa.security.storage.XMLMap getPortalParameters(String token)
-
-