public class KShieldClient extends Object
Modifier | Constructor and Description |
---|---|
|
KShieldClient(String url)
Construct a new KShieldClient for given KeyShield SSO Server url, given a HttpClient
|
|
KShieldClient(String url,
CloseableHttpClient httpclient,
String... attrs)
Construct a new KShieldClient for given KeyShield SSO Server url, given a HttpClient
|
|
KShieldClient(String url,
String apiKey,
CloseableHttpClient httpclient,
String... attrs)
Construct a new KShieldClient for given KeyShield SSO Server url, given a HttpClient
|
protected |
KShieldClient(URI url,
String apiKey,
CloseableHttpClient httpclient,
String attrs) |
Modifier and Type | Method and Description |
---|---|
protected URI |
createClientMessageUri() |
EnumSet<UserInfo.AuthType> |
getAllowedAuthTypes()
Return allowed authentication types.
|
ResponseLevel |
getResponseLevel() |
UserInfo |
getUserByIP(String remoteIP)
Retrieves UserInfo for a given IP address
|
UserInfo |
getUserByIP(String remoteIP,
String usernameAttribute)
Retrieves UserInfo for a given IP address
|
void |
sendClientMessage(ClientMessage msg)
Sends client message to KeyShield server
|
void |
sendClientMessage(String from,
String to,
String message) |
void |
setAllowedAuthTypes(EnumSet<UserInfo.AuthType> allowAuthTypes)
Set allowed authentication types.
|
void |
setResponseLevel(ResponseLevel extendedResponse) |
public KShieldClient(String url)
url
- URL of KeyShield SSO Server web service (http://hostname:port).IllegalArgumentException
- if url is null, empty or invalidpublic KShieldClient(String url, CloseableHttpClient httpclient, String... attrs)
url
- URL of KeyShield SSO Server web service (http://hostname:port).httpclient
- configured instance of apache HTTP client - for example configured for multithreaded usage, which allows sharing single instance of KShieldClient between multiple threads
Creates default http client if parameter is null.attrs
- Additional attributes retrieved from KeyShield SSO ServerIllegalArgumentException
- if url is null, empty or invalidpublic KShieldClient(String url, String apiKey, CloseableHttpClient httpclient, String... attrs)
url
- URL of KeyShield SSO Server web service (http://hostname:port).apiKey
- API authorization key.httpclient
- configured instance of apache HTTP client - for example configured for multithreaded usage, which allows sharing single instance of KShieldClient between multiple threads
Creates default http client if parameter is null.attrs
- Additional attributes retrieved from KeyShield SSO ServerIllegalArgumentException
- if url is null, empty or invalidprotected KShieldClient(URI url, String apiKey, CloseableHttpClient httpclient, String attrs)
protected URI createClientMessageUri() throws URISyntaxException
URISyntaxException
public EnumSet<UserInfo.AuthType> getAllowedAuthTypes()
UserInfo.AuthType
public ResponseLevel getResponseLevel()
public UserInfo getUserByIP(String remoteIP) throws KShieldClientException
remoteIP
- IP address of workstation for which you want to obtain UserInfoKShieldClientException
public UserInfo getUserByIP(String remoteIP, String usernameAttribute) throws KShieldClientException
remoteIP
- IP address of workstation for which you want to obtain UserInfousernameAttribute
- name of attribute for username, set it to null if you want use screenName instead of usernameKShieldClientException
public void sendClientMessage(ClientMessage msg) throws KShieldClientException
msg
- Message dataKShieldClientException
public void sendClientMessage(String from, String to, String message) throws KShieldClientException
from
- to
- message
- KShieldClientException
public void setAllowedAuthTypes(EnumSet<UserInfo.AuthType> allowAuthTypes)
UserInfo.AuthType
public void setResponseLevel(ResponseLevel extendedResponse)
Copyright © 2013 TDP Ltd. All Rights Reserved.