Class ClientBuilder

java.lang.Object
com.avoka.tm.svc.ClientBuilder

public class ClientBuilder extends Object

Provides a Client value object builder class.

Examples Link icon

Please find the Client builder examples below.

Create a Client and assign a form space Link icon

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 Link icon

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. Link icon

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. Link icon

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 Details Link icon

  • Method Details Link icon

    • setName Link icon

      public ClientBuilder setName(String clientName)
      Set the client name parameter.
      Parameters:
      clientName - client name
      Returns:
      the client service
    • setNameToUpdate Link icon

      public ClientBuilder setNameToUpdate(String updateClientName)
      Set the client name parameter to be updated.
      Parameters:
      updateClientName - client name to be updated
      Returns:
      the client service
      Since:
      24.4.0
    • setCode Link icon

      public ClientBuilder setCode(String clientCode)
      Set the client code parameter.
      Parameters:
      clientCode - client code
      Returns:
      the client service
    • setCodeToUpdate Link icon

      public ClientBuilder setCodeToUpdate(String updateClientCode)
      Set the client code parameter to be updated.
      Parameters:
      updateClientCode - client code to be updated
      Returns:
      the client service
      Since:
      24.4.0
    • setDescription Link icon

      public ClientBuilder setDescription(String description)
      Set the description parameter.
      Parameters:
      description - client description
      Returns:
      the client service
    • setEmailService Link icon

      public ClientBuilder setEmailService(String emailService)
      Set the emailService parameter.
      Parameters:
      emailService - client code
      Returns:
      the client service
    • setStatus Link icon

      public ClientBuilder setStatus(String status)
      Set the client status parameter.
      Parameters:
      status - client status
      Returns:
      the client service
    • setSpaceNames Link icon

      public ClientBuilder setSpaceNames(Set<String> spaceNames)
      Set the client space names
      Parameters:
      spaceNames - the client space names the client should be assigned to
      Returns:
      the client service
    • addSpaceName Link icon

      public ClientBuilder addSpaceName(String spaceName)
      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 Link icon

      public ClientBuilder removeSpaceName(String spaceName)
      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 Link icon

      public Client create() throws IllegalAccessException
      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 Link icon

      public Client update() throws IllegalAccessException
      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 Link icon

      public Client createOrUpdate() throws IllegalAccessException
      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