public class SymphonyBasicClient extends java.lang.Object implements SymphonyClient
You must init this class with valid key and session tokens with stored in a SymAuth object. Please note, that the SymAuth expires and must be updated periodically to maintain access to the Symphony network.
Constructor and Description |
---|
SymphonyBasicClient() |
SymphonyBasicClient(ApiVersion apiVersion) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.client.Client |
getAgentHttpClient()
Retrieve the HTTP client for Agent connectivity
|
java.lang.String |
getAgentUrl()
Returns the Agent URL used during initialization
|
AttachmentsClient |
getAttachmentsClient()
Provides instance of the Attachments client
|
SymCache |
getCache(CacheType cacheType)
Return a cache by type
CacheType |
ChatService |
getChatService()
Provides active Chat Service
|
SymphonyClientConfig |
getConfig()
Get SJC configuration
|
ConnectionsClient |
getConnectionsClient()
Provides instance of the Connections client
|
DataFeedClient |
getDataFeedClient()
Provides instance of the DataFeed client
|
javax.ws.rs.client.Client |
getDefaultHttpClient()
Provides the default http client if one is set.
|
SymUser |
getLocalUser()
Returns the local BOT user for the instantiated client.
|
MessagesClient |
getMessagesClient()
Provides instance of the Messages Client
|
MessageService |
getMessageService()
Provides active Message Service
|
java.lang.String |
getName()
Return name of SJC
|
javax.ws.rs.client.Client |
getPodHttpClient()
Retrieve the HTTP client for POD connectivity
|
java.lang.String |
getPodUrl()
Retrieve the POD url.
|
PresenceClient |
getPresenceClient()
Provides instance of the Presence client
|
PresenceService |
getPresenceService() |
RoomMembershipClient |
getRoomMembershipClient()
Provides instance of the Room Membership client
|
RoomService |
getRoomService()
Provides active Room Service
|
ShareClient |
getShareClient()
Provides instance of the Shares client.
|
StreamsClient |
getStreamsClient()
Provides instance of the Streams client
|
SymAuth |
getSymAuth()
Retrieve authorization object.
|
SymphonyApis |
getSymphonyApis()
Convenience in obtaining all underlying language binding APIs
Accessing language bindings directly is discouraged as changes are bound to REST API
|
UsersClient |
getUsersClient()
Provides instance of the Users client
|
void |
init(javax.ws.rs.client.Client podHttpClient,
javax.ws.rs.client.Client agentHttpClient,
SymphonyClientConfig config)
Initialize the SJC with a custom http client for both pod and agent connectivity.
|
void |
init(javax.ws.rs.client.Client httpClient,
SymAuth symAuth,
java.lang.String userEmail,
java.lang.String agentUrl,
java.lang.String podUrl)
Deprecated.
|
void |
init(javax.ws.rs.client.Client httpClient,
SymphonyClientConfig config)
Initialize client with required parameters and custom HTTP client.
|
void |
init(SymAuth symAuth,
java.lang.String userEmail,
java.lang.String agentUrl,
java.lang.String podUrl)
Deprecated.
|
void |
init(SymAuth symAuth,
java.lang.String userEmail,
java.lang.String agentUrl,
java.lang.String podUrl,
boolean disableServices)
Deprecated.
|
void |
init(SymAuth symAuth,
SymphonyClientConfig config)
Initialize client with required parameters.
|
void |
init(SymphonyClientConfig config) |
void |
setAgentHttpClient(javax.ws.rs.client.Client agentHttpClient)
Set the HTTP client for Agent connectivity
|
void |
setAgentUrl(java.lang.String agentUrl) |
void |
setCache(SymCache symCache)
Set a cache for types :
CacheType |
void |
setConfig(SymphonyClientConfig config)
Set SJC configuration
|
void |
setDefaultHttpClient(javax.ws.rs.client.Client defaultHttpClient)
Set a custom Http client to use when connecting to Symphony API's
|
void |
setLocalUser(SymUser localUser) |
void |
setName(java.lang.String name)
Set name of SJC to be used for threading
|
void |
setPodHttpClient(javax.ws.rs.client.Client podHttpClient)
Set the HTTP client for POD connectivity
|
void |
setPodUrl(java.lang.String podUrl) |
void |
setSymAuth(SymAuth symAuth)
Set authorization object
|
void |
shutdown()
Terminates all underlying services and threads.
|
public SymphonyBasicClient()
public SymphonyBasicClient(ApiVersion apiVersion)
public void init(SymphonyClientConfig config) throws InitException, AuthenticationException
init
in interface SymphonyClient
InitException
AuthenticationException
public void setName(java.lang.String name)
setName
in interface SymphonyClient
name
- Used for threadingpublic java.lang.String getName()
getName
in interface SymphonyClient
public void init(javax.ws.rs.client.Client podHttpClient, javax.ws.rs.client.Client agentHttpClient, SymphonyClientConfig config) throws InitException, AuthenticationException
init
in interface SymphonyClient
podHttpClient
- Custom http client to use when connecting to the podagentHttpClient
- Custom http client to use when connecting to the agent serverconfig
- Configuration objectInitException
- Exception from initializationAuthenticationException
- Exception from authorization.public void init(javax.ws.rs.client.Client httpClient, SymphonyClientConfig config) throws InitException, AuthenticationException
SymphonyClient
init
in interface SymphonyClient
httpClient
- Custom http client to use when connecting to Symphony API'sconfig
- Configuration objectInitException
- Failure of a specific service most likely due to connectivity issuesAuthenticationException
- A network exception@Deprecated public void init(SymAuth symAuth, java.lang.String userEmail, java.lang.String agentUrl, java.lang.String podUrl) throws InitException
init
in interface SymphonyClient
symAuth
- Contains valid key and session tokens generated from AuthenticationClient.userEmail
- Email address of the BOTagentUrl
- The Agent URLpodUrl
- The Service URL (in most cases it's the POD URL)InitException
- Failure of a specific service most likely due to connectivity issues@Deprecated public void init(javax.ws.rs.client.Client httpClient, SymAuth symAuth, java.lang.String userEmail, java.lang.String agentUrl, java.lang.String podUrl) throws InitException
init
in interface SymphonyClient
httpClient
- Custom http client to use when initiating the clientsymAuth
- Contains valid key and session tokens generated from AuthenticationClient.userEmail
- Email address of the BOTagentUrl
- The Agent URLpodUrl
- The Service URL (in most cases it's the POD URL)InitException
- Failure of a specific service most likely due to connectivity issues@Deprecated public void init(SymAuth symAuth, java.lang.String userEmail, java.lang.String agentUrl, java.lang.String podUrl, boolean disableServices) throws InitException
init
in interface SymphonyClient
symAuth
- Contains valid key and session tokens generated from AuthenticationClient.userEmail
- Email address of the BOTagentUrl
- The Agent URLpodUrl
- The Service URL (in most cases it's the POD URL)disableServices
- Disable all real-time services (MessageService, RoomService, ChatService)InitException
- Failure of a specific service most likely due to connectivity issuespublic void init(SymAuth symAuth, SymphonyClientConfig config) throws InitException
init
in interface SymphonyClient
symAuth
- Contains valid key and session tokens generated from AuthenticationClient.config
- Symphony client configInitException
- Failure of a specific service most likely due to connectivity issuespublic SymAuth getSymAuth()
SymphonyClient
getSymAuth
in interface SymphonyClient
SymAuth
Authorization object containing session and key tokens. This can return a null value.public void setSymAuth(SymAuth symAuth)
SymphonyClient
setSymAuth
in interface SymphonyClient
symAuth
- Contains valid key and session tokens generated from AuthenticationClient.public java.lang.String getAgentUrl()
SymphonyClient
getAgentUrl
in interface SymphonyClient
public void setAgentUrl(java.lang.String agentUrl)
agentUrl
- Agent URLpublic java.lang.String getPodUrl()
SymphonyClient
getPodUrl
in interface SymphonyClient
public void setPodUrl(java.lang.String podUrl)
podUrl
- Service URL which can be either the Agent URL or POD URLpublic DataFeedClient getDataFeedClient()
SymphonyClient
getDataFeedClient
in interface SymphonyClient
public MessagesClient getMessagesClient()
SymphonyClient
getMessagesClient
in interface SymphonyClient
public MessageService getMessageService()
SymphonyClient
getMessageService
in interface SymphonyClient
public RoomService getRoomService()
SymphonyClient
getRoomService
in interface SymphonyClient
RoomService
public SymUser getLocalUser()
SymphonyClient
getLocalUser
in interface SymphonyClient
SymUser
User representing the BOT identitypublic void setLocalUser(SymUser localUser)
public ChatService getChatService()
SymphonyClient
getChatService
in interface SymphonyClient
ChatService
public PresenceClient getPresenceClient()
SymphonyClient
getPresenceClient
in interface SymphonyClient
PresenceClient
public StreamsClient getStreamsClient()
SymphonyClient
getStreamsClient
in interface SymphonyClient
StreamsClient
public UsersClient getUsersClient()
SymphonyClient
getUsersClient
in interface SymphonyClient
UsersClient
public RoomMembershipClient getRoomMembershipClient()
SymphonyClient
getRoomMembershipClient
in interface SymphonyClient
RoomMembershipClient
public AttachmentsClient getAttachmentsClient()
SymphonyClient
getAttachmentsClient
in interface SymphonyClient
AttachmentsClient
public ConnectionsClient getConnectionsClient()
SymphonyClient
getConnectionsClient
in interface SymphonyClient
ConnectionsClient
public ShareClient getShareClient()
SymphonyClient
getShareClient
in interface SymphonyClient
ShareClient
public javax.ws.rs.client.Client getDefaultHttpClient()
getDefaultHttpClient
in interface SymphonyClient
public void setDefaultHttpClient(javax.ws.rs.client.Client defaultHttpClient)
SymphonyClient
setDefaultHttpClient
in interface SymphonyClient
defaultHttpClient
- Custom HTTP clientpublic void setCache(SymCache symCache) throws SymCacheException
SymphonyClient
CacheType
setCache
in interface SymphonyClient
symCache
- A cacheSymCacheException
- Exception if cache is unknown.public SymCache getCache(CacheType cacheType)
SymphonyClient
CacheType
getCache
in interface SymphonyClient
cacheType
- The type of cache to returnpublic void shutdown()
SymphonyClient
shutdown
in interface SymphonyClient
public javax.ws.rs.client.Client getPodHttpClient()
SymphonyClient
getPodHttpClient
in interface SymphonyClient
public void setPodHttpClient(javax.ws.rs.client.Client podHttpClient)
SymphonyClient
setPodHttpClient
in interface SymphonyClient
podHttpClient
- HttpClient for PODpublic javax.ws.rs.client.Client getAgentHttpClient()
SymphonyClient
getAgentHttpClient
in interface SymphonyClient
public void setAgentHttpClient(javax.ws.rs.client.Client agentHttpClient)
SymphonyClient
setAgentHttpClient
in interface SymphonyClient
agentHttpClient
- HttpClient for Agentpublic SymphonyApis getSymphonyApis()
SymphonyClient
getSymphonyApis
in interface SymphonyClient
public SymphonyClientConfig getConfig()
SymphonyClient
getConfig
in interface SymphonyClient
public void setConfig(SymphonyClientConfig config)
SymphonyClient
setConfig
in interface SymphonyClient
config
- SymphonyClientConfiguration for SJCpublic PresenceService getPresenceService()
getPresenceService
in interface SymphonyClient