Package com.avoka.tm.svc
Class ClientBuilder
java.lang.Object
com.avoka.tm.svc.ClientBuilder
Provides a Client value object builder class.
Examples
Please find the Client builder examples below.
Create a Client and assign a form space
This example shows how to create a Client
object and assign a form space.
import com.avoka.tm.svc.* import com.avoka.tm.vo.* Client client= new ClientBuilder() .setName("client1") .setCode("client1") .setStatus("Active") .addSpaceName("Work Spaces") .setDescription("client1 description") .create()
Create a Client and assign multiple form spaces and an email service
This example shows how to create a Client
object and assign multiple form spaces and an email service.
import com.avoka.tm.svc.* import com.avoka.tm.vo.* def spaceNames = new HashSet(); spaceNames.add("Work Spaces") spaceNames.add("Web Plug-in") Client client= new ClientBuilder() .setName("client1") .setCode("client1") .setStatus("Active") .setSpaceNames(spaceNames) .setEmailService("SMTP Email Service - v1.0.0") .setDescription("client1 description") .create()
Update a Client and add a form space.
The example below shows how to update a Client
and add a form space.
import com.avoka.tm.svc.* import com.avoka.tm.vo.* Client client= new ClientBuilder() .setCode("client1") .addSpaceName("Web Plug-in") .update()
Create or Update a Client and assign/add a form space.
The example below shows how to create or update a Client
and assign/add a form space.
import com.avoka.tm.svc.* import com.avoka.tm.vo.* Client client= new ClientBuilder() .setName("client1") .setCode("client1") .setStatus("Active") .addSpaceName("Work Spaces") .createOrUpdate()
- Since:
- 23.10.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddSpaceName
(String spaceName) Add the form space names the client should be assigned to.create()
Create a new client based on the specified parameters and return the new client value object.Create or update the client specified by the given parameters, and return current client value object.removeSpaceName
(String spaceName) Remove the form space names the client should be assigned to.Set the client code parameter.setDescription
(String description) Set the description parameter.setEmailService
(String emailService) Set the emailService parameter.Set the client name parameter.setSpaceNames
(Set<String> spaceNames) Set the client space namesSet the client status parameter.update()
Update the client specified by the clientCode parameter and return the updated client value object.
-
Constructor Details
-
ClientBuilder
Create a Client service object
-
-
Method Details
-
setName
Set the client name parameter.- Parameters:
clientName
- client name- Returns:
- the client service
-
setCode
Set the client code parameter.- Parameters:
clientCode
- client code- Returns:
- the client service
-
setDescription
Set the description parameter.- Parameters:
description
- client description- Returns:
- the client service
-
setEmailService
Set the emailService parameter.- Parameters:
emailService
- client code- Returns:
- the client service
-
setStatus
Set the client status parameter.- Parameters:
status
- client status- Returns:
- the client service
-
setSpaceNames
Set the client space names- Parameters:
spaceNames
- the client space names the client should be assigned to- Returns:
- the client service
-
addSpaceName
Add the form space names the client should be assigned to.- Parameters:
spaceName
- the form space name the client should be assigned to- Returns:
- the client service
-
removeSpaceName
Remove the form space names the client should be assigned to.- Parameters:
spaceName
- the form space name the client should not be assigned to- Returns:
- the client service
-
create
Create a new client based on the specified parameters and return the new client value object.- Returns:
- the newly created client value object
- Throws:
IllegalAccessException
-
update
Update the client specified by the clientCode parameter and return the updated client value object. This method will throw a IllegalArgumentException if the specified client specified by clientCode parameter was not found.- Returns:
- the update client value object
- Throws:
IllegalAccessException
-
createOrUpdate
Create or update the client specified by the given parameters, and return current client value object. If the client specified by the clientCode is not found then a new client will be created.- Returns:
- create or update the client specified by the given parameters, and return current client value object
- Throws:
IllegalAccessException
-