Package com.fifa.connectservicebus.sdk
Class FifaConnectServiceBusClientImpl
- java.lang.Object
-
- com.fifa.connectservicebus.sdk.BaseFifaConnectServiceBusClient
-
- com.fifa.connectservicebus.sdk.FifaConnectServiceBusClientImpl
-
- All Implemented Interfaces:
FifaConnectServiceBusClient
public class FifaConnectServiceBusClientImpl extends BaseFifaConnectServiceBusClient implements FifaConnectServiceBusClient
-
-
Field Summary
-
Fields inherited from class com.fifa.connectservicebus.sdk.BaseFifaConnectServiceBusClient
logger, responseHandler
-
-
Constructor Summary
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(String messageId, String lockToken)Deletes a previously locked message (see peekLock method).booleangetUseEncryption()Gets encryption flagMessagepeekLock()Gets and locks a message without deleting it from the queue.MessagepeekLock(int timeout)Gets and locks a message without deleting it from the queue.protected MessageprocessPeekLockResponseMessage(com.microsoft.rest.ServiceResponse response, int successStatusCode, String action, String messagePropertiesString, String brokerPropertiesString)voidsend(String recipient, byte[] content)Sends a message to a specified recipient via Message Bus.voidsend(String recipient, byte[] content, String action, Map<String,String> properties)Sends a message to a specified recipient via Message Bus.voidsetUseEncryption(boolean value)Sets encryption flag.voidunlock(String messageId, String lockToken)Unlocks a previously locked message.-
Methods inherited from class com.fifa.connectservicebus.sdk.BaseFifaConnectServiceBusClient
ConfigureRetrofit, createAuthenticationService, createAuthenticationService, handleRestClientException
-
-
-
-
Constructor Detail
-
FifaConnectServiceBusClientImpl
public FifaConnectServiceBusClientImpl(Messages messageOperations, MessageCryptographyService cryptographyService, Logger logger)
-
FifaConnectServiceBusClientImpl
public FifaConnectServiceBusClientImpl(ConnectServiceBusEnvironment environment, ClientCredentials clientCredentials, MessageCryptographyService cryptographyService, Logger logger)
-
FifaConnectServiceBusClientImpl
public FifaConnectServiceBusClientImpl(ConnectServiceBusEnvironment environment, ClientCredentials clientCredentials, PrivateKeyStorage privateKeyStorage, Logger logger)
-
FifaConnectServiceBusClientImpl
public FifaConnectServiceBusClientImpl(ConnectServiceBusEnvironment environment, ClientCredentials clientCredentials, PrivateKeyStorage privateKeyStorage, Logger logger, ProxySettings proxySettings)
-
FifaConnectServiceBusClientImpl
public FifaConnectServiceBusClientImpl(ConnectServiceBusEnvironment environment, ClientCredentials clientCredentials, PrivateKeyStorage privateKeyStorage, Logger logger, ProxySettings proxySettings, ExecutorService executorService)
-
FifaConnectServiceBusClientImpl
public FifaConnectServiceBusClientImpl(ConnectServiceBusEnvironment environment, AuthenticationService authenticationService, MessageCryptographyService cryptographyService, Logger logger)
-
FifaConnectServiceBusClientImpl
public FifaConnectServiceBusClientImpl(ConnectServiceBusEnvironment environment, AuthenticationService authenticationService, MessageCryptographyService cryptographyService, Logger logger, ProxySettings proxySettings)
-
-
Method Detail
-
setUseEncryption
public void setUseEncryption(boolean value)
Sets encryption flag.- Specified by:
setUseEncryptionin interfaceFifaConnectServiceBusClient- Parameters:
value-
-
getUseEncryption
public boolean getUseEncryption()
Gets encryption flag- Specified by:
getUseEncryptionin interfaceFifaConnectServiceBusClient- Returns:
- boolean
-
send
public void send(String recipient, byte[] content, String action, Map<String,String> properties) throws FifaConnectServiceBusException, AuthenticationException, UnauthorizedException, PublicCertificateNotFoundException, CryptographyException, QueueNotFoundException
Sends a message to a specified recipient via Message Bus.- Specified by:
sendin interfaceFifaConnectServiceBusClient- Parameters:
recipient- Recipient, usually MA to receive the message.content- Message body.action- Name of the actions.properties- Additional properties of the message.- Throws:
FifaConnectServiceBusExceptionAuthenticationExceptionUnauthorizedExceptionCryptographyExceptionQueueNotFoundExceptionPublicCertificateNotFoundExceptionTooManyRequestsException
-
send
public void send(String recipient, byte[] content) throws FifaConnectServiceBusException, AuthenticationException, UnauthorizedException, PublicCertificateNotFoundException, CryptographyException, QueueNotFoundException
Sends a message to a specified recipient via Message Bus.- Specified by:
sendin interfaceFifaConnectServiceBusClient- Parameters:
recipient- Recipient, usually MA to receive the message.content- Message body.- Throws:
FifaConnectServiceBusExceptionAuthenticationExceptionUnauthorizedExceptionCryptographyExceptionQueueNotFoundExceptionPublicCertificateNotFoundExceptionTooManyRequestsException
-
peekLock
public Message peekLock(int timeout) throws FifaConnectServiceBusException, AuthenticationException, UnauthorizedException, CryptographyException, QueueNotFoundException
Gets and locks a message without deleting it from the queue. If message is not deleted within configured time it's automatically unlocked and visible for other recipients.- Specified by:
peekLockin interfaceFifaConnectServiceBusClient- Parameters:
timeout- Defines how long a request waits before returning that there is no message in the queue.- Throws:
FifaConnectServiceBusExceptionAuthenticationExceptionUnauthorizedExceptionCryptographyExceptionQueueNotFoundExceptionTooManyRequestsException
-
peekLock
public Message peekLock() throws FifaConnectServiceBusException, AuthenticationException, UnauthorizedException, CryptographyException, QueueNotFoundException
Gets and locks a message without deleting it from the queue. If message is not deleted within configured time it's automatically unlocked and visible for other recipients.
-
delete
public void delete(String messageId, String lockToken) throws FifaConnectServiceBusException, AuthenticationException, UnauthorizedException
Deletes a previously locked message (see peekLock method).- Specified by:
deletein interfaceFifaConnectServiceBusClient- Parameters:
messageId- Message id retrieved from peekLock method.lockToken- Lock token id retrieved from peekLock method.- Throws:
FifaConnectServiceBusExceptionAuthenticationExceptionUnauthorizedExceptionTooManyRequestsException
-
unlock
public void unlock(String messageId, String lockToken) throws FifaConnectServiceBusException, AuthenticationException, UnauthorizedException
Unlocks a previously locked message. The message is returned to the queue and can be fetched using peekLock or receive method.- Specified by:
unlockin interfaceFifaConnectServiceBusClient- Parameters:
messageId- Message id retrieved from peekLock method.lockToken- Lock token id retrieved from peekLock method.- Throws:
FifaConnectServiceBusExceptionAuthenticationExceptionUnauthorizedExceptionTooManyRequestsException
-
processPeekLockResponseMessage
protected Message processPeekLockResponseMessage(com.microsoft.rest.ServiceResponse response, int successStatusCode, String action, String messagePropertiesString, String brokerPropertiesString) throws FifaConnectServiceBusException
- Throws:
FifaConnectServiceBusException
-
-