Package com.orchestranetworks.service.directory

# Class DirectoryDefaultHelper

java.lang.Object
com.orchestranetworks.service.directory.DirectoryDefaultHelper

public final class DirectoryDefaultHelper extends Object
Helper class that works with `DirectoryDefault` class. Underlying user and role entities managed by this class are persisted in the EBX® repository.

Since:
  5.7.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DirectoryDefaultHelper()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static ProcedureResult`
  `deleteRole(Role aRole, String aTrackingInfoOrNull, DirectoryDefault aDirectory)`
  Deletes the role entity corresponding to the specified role.
  `static ProcedureResult`
  `deleteUser(UserReference aUserReference, String aTrackingInfoOrNull, DirectoryDefault aDirectory)`
  Deletes the user entity corresponding to the specified user reference.
  `static DirectoryDefault.RoleEntity`
  `findRole(Role aRole, DirectoryDefault aDirectory)`
  Returns the role entity corresponding to the specified role if it exists, `null` otherwise.
  `static DirectoryDefault.UserEntity`
  `findUser(UserReference aUserReference, DirectoryDefault aDirectory)`
  Returns the user entity corresponding to the specified user reference if it exists, `null` otherwise.
  `static DirectoryDefault.RoleEntity`
  `newRole(Role aRole)`
  Returns a new role entity whose key is the specified role.
  `static DirectoryDefault.UserEntity`
  `newUser(UserReference aUserReference, DirectoryDefault aDirectory)`
  Returns a new user entity whose key is the specified user reference.
  `static ProcedureResult`
  `saveRole(DirectoryDefault.RoleEntity aRole, String aTrackingInfoOrNull, DirectoryDefault aDirectory)`
  Makes the specified role entity persistent if it does not yet exist in the EBX® repository; updates it if it exists.
  `static ProcedureResult`
  `saveUser(DirectoryDefault.UserEntity aUser, String aTrackingInfoOrNull, DirectoryDefault aDirectory)`
  Makes the specified user entity persistent if it does not exist yet in the EBX® repository; updates it if it exists.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### DirectoryDefaultHelper

    public DirectoryDefaultHelper()

- ## Method Details

  - ### findRole

    public static DirectoryDefault.RoleEntity findRole(Role aRole, DirectoryDefault aDirectory)
    Returns the role entity corresponding to the specified role if it exists, `null` otherwise.
    Throws:
      `IllegalArgumentException` - if the specified role is a built-in role.

  - ### findUser

    public static DirectoryDefault.UserEntity findUser(UserReference aUserReference, DirectoryDefault aDirectory)
    Returns the user entity corresponding to the specified user reference if it exists, `null` otherwise.

  - ### newRole

    public static DirectoryDefault.RoleEntity newRole(Role aRole)
    Returns a new role entity whose key is the specified role. The returned entity is transient; once its properties have been set, the method `saveRole` must be called to make it persistent.
    Throws:
      `IllegalArgumentException` - if the specified role is a built-in role.

  - ### newUser

    public static DirectoryDefault.UserEntity newUser(UserReference aUserReference, DirectoryDefault aDirectory)
    Returns a new user entity whose key is the specified user reference. The returned entity is transient; once its properties have been set, the method `saveUser` must be called to make it persistent.
    See Also:
      - `saveUser(com.orchestranetworks.service.directory.DirectoryDefault.UserEntity, String, DirectoryDefault)`

  - ### saveRole

    public static ProcedureResult saveRole(DirectoryDefault.RoleEntity aRole, String aTrackingInfoOrNull, DirectoryDefault aDirectory)
    Makes the specified role entity persistent if it does not yet exist in the EBX® repository; updates it if it exists.

  - ### saveUser

    public static ProcedureResult saveUser(DirectoryDefault.UserEntity aUser, String aTrackingInfoOrNull, DirectoryDefault aDirectory)
    Makes the specified user entity persistent if it does not exist yet in the EBX® repository; updates it if it exists.

  - ### deleteRole

    public static ProcedureResult deleteRole(Role aRole, String aTrackingInfoOrNull, DirectoryDefault aDirectory)
    Deletes the role entity corresponding to the specified role.
    Throws:
      `IllegalArgumentException` - if the specified role is a built-in role.

  - ### deleteUser

    public static ProcedureResult deleteUser(UserReference aUserReference, String aTrackingInfoOrNull, DirectoryDefault aDirectory)
    Deletes the user entity corresponding to the specified user reference.