All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.anaptecs.jeaf.services.usermanagement.UserManagementService Maven / Gradle / Ivy

There is a newer version: 1.8.0
Show newest version
/*
 * anaptecs GmbH, Ricarda-Huch-Str. 71, 72760 Reutlingen, Germany
 * 
 * Copyright 2004 - 2019. All rights reserved.
 */
package com.anaptecs.jeaf.services.usermanagement;

import java.util.List;

import com.anaptecs.jeaf.core.api.Service;
import com.anaptecs.jeaf.core.api.ServiceObjectID;
import com.anaptecs.jeaf.core.api.jaas.UserPrincipal;
import com.anaptecs.jeaf.xfun.api.errorhandling.FailureMessage;

/**
 * Service provides basic operations mainly for the current user.
 * 
 * @author JEAF Generator
 * @version JEAF Release 1.4.x
 */
public interface UserManagementService extends Service {
  /**
   * Method returns the person with the passed id. An object with the passed id must exist.
   * 
   * 
   * @param pPersonID Id of the person that should be returned. The parameter must not be null.
   * 
   * @param pLoadStrategy Load strategy defines the associations of the person object that should also be loaded and
   * returned. The parameter may be null. In this case no associations to other objects will be set for the returned
   * person object.
   * 
   * @return {@link Person} Person with the passed id. The associations of the object are set according to the passed
   * load strategy. The method never returns null.
   * 
   */
  Person getPerson( ServiceObjectID pPersonID, PersonLoadStrategy pLoadStrategy );

  /**
   * Method updates the passed person the passed data. Besides the attributes of the person also its addresses will be
   * updated. This means that edited addresses will be updated, added address will be created and removed addresses will
   * be deleted.
   * 
   * 
   * @param pPerson Person that should be updated. The parameter must not be null.
   * 
   * @param pLoadStrategy Load strategy defines the associations of the person object that should also be loaded and
   * returned. The parameter may be null. In this case no associations to other objects will be set for the returned
   * person object.
   * 
   * @return {@link Person} Person object that was updated with the passed data. The associations of the returned object
   * are set according to the passed load strategy. The method never returns null.
   * 
   */
  Person updatePerson( Person pPerson, PersonLoadStrategy pLoadStrategy );

  /**
   * Method creates a new person from the passed object.
   * 
   * 
   * @param pPerson Person service object whose data should be used to create a new persistent Person object. All
   * addresses of the passed object are also created by the method. If the passed object references a organizational
   * unit it will be added as child to this unit. The parameter must not be null.
   * 
   * @param pParentUnit Organization unit that is the parent of the user. The parameter may be null.
   * 
   * @param pLoadStrategy Load strategy defines the associations of the person object that should also be loaded and
   * returned. The parameter may be null. In this case no associations to other objects will be set for the returned
   * person object.
   * 
   * @return {@link Person}
   */
  Person createPerson( Person pPerson, OrganizationalUnit pParentUnit, PersonLoadStrategy pLoadStrategy );

  /**
   * Method deletes the passed person. The object that should be deleted must exist. This also deletes all addresses of
   * the person and its owned permissions.
   * 
   * 
   * @param pPerson Person object that should be deleted. The parameter must not be null.
   * 
   */
  void deletePerson( Person pPerson );

  /**
   * Method searches persons by the passed query criteria. As defined by class PersonQuery all the passed query criteria
   * are conjuncted by a logical AND.
   * 
   * 
   * @param pPersonQuery Query object describing the criteria that are used to find person objects. The parameter must
   * not be null, but may have no criteria set.
   * 
   * @param pLoadStrategy Load strategy defines the associations of the person object that should also be loaded and
   * returned. The parameter may be null. In this case no associations to other objects will be set for the returned
   * person object.
   * 
   * @return {@link Person} List with all person objects that were found by the passed query. The associations of the
   * returned objects are set according to the passed load strategy. The method never returns null.
   * 
   */
  List queryPersons( PersonQuery pPersonQuery, PersonLoadStrategy pLoadStrategy );

  /**
   * Method returns the person object to the currently logged in user.
   * 
   * 
   * @param pLoadStrategy Load strategy defines the associations of the person object that should also be loaded and
   * returned. The parameter may be null. In this case no associations to other objects will be set for the returned
   * person object.
   * 
   * @return {@link Person} Person object of the currently logged in user. The associations of the returned object are
   * set according to the passed load strategy. The method never returns null.
   * 
   */
  Person getCurrentPerson( PersonLoadStrategy pLoadStrategy );

  /**
   * Method returns the user account with the passed login name.
   * 
   * 
   * @param pLoginName Login name of the user account that should be returned. The name must exactly match with the
   * existing user account.
   * 
   * @param pLoadStrategy Load strategy can be used to define which associations of the user account service object
   * should also be returned. The parameter may be null. In this case no associations of the user account will be loaded
   * and returned.
   * 
   * @return {@link UserAccount} UserAccount for the passed user id. The method returns null if no user account with the
   * passed user id exists. The returned objects has all associations set as defined by the passed load strategy.
   * 
   */
  UserAccount getUserAccount( String pLoginName, UserAccountLoadStrategy pLoadStrategy );

  /**
   * Method returns the user account with the passed service object id.
   * 
   * 
   * @param pUserAccountOID ServiceObjectID of the user account that should be returned. The parameter must not be null.
   * 
   * @param pLoadStrategy Load strategy can be used to define which associations of the user account service object
   * should also be returned. The parameter may be null. In this case no associations of the user account will be loaded
   * and returned.
   * 
   * @return {@link UserAccount} User account for the passed service object id. The method never returns null.
   * 
   */
  UserAccount getUserAccount( ServiceObjectID pUserAccountOID, UserAccountLoadStrategy pLoadStrategy );

  /**
   * Method creates a new user account from the passed object. Therefore the associated person to which the created
   * account should belong has to be set. The created user account will have the default role as defined for the user
   * management assigned.
   * 
   * 
   * @param pUserAccount User account that should be created. The parameter must not be null and must reference an
   * existing person object.
   * 
   * @param pPassword Initial password of the created user account. The parameter must not be null and must comply with
   * the defined password rules.
   * 
   * @param pLoadStrategy Load strategy can be used to define which associations of the user account service object
   * should also be returned. The parameter may be null. In this case no associations of the user account will be loaded
   * and returned.
   * 
   * @return {@link UserAccount} Created user account. According to the passed load strategy associations to depending
   * objects are also set.
   * 
   */
  UserAccount createUserAccount( UserAccount pUserAccount, String pPassword, UserAccountLoadStrategy pLoadStrategy );

  /**
   * Method deletes the passed user account.
   * 
   * 
   * @param pUserAccount User account that should be deleted. The parameter must not be null.
   * 
   */
  void deleteUserAccount( UserAccount pUserAccount );

  /**
   * Method searches for all user accounts that match the passed query criteria. If the passed query object defines more
   * than one criteria they are conjuncted by a logical AND.
   * 
   * 
   * @param pUserAccountQuery Query criteria which are used to find the user accounts. All criterias are conjuncted by a
   * logical AND. The parameter must not be null.
   * 
   * @return {@link UserInfo}
   */
  List queryUserAccounts( UserAccountQuery pUserAccountQuery );

  /**
   * Method returns the UserAccount object representing the current user.
   * 
   * 
   * @param pLoadStrategy Load strategy can be used to define which associations of the user account service object
   * should also be returned. The parameter may be null. In this case no associations of the user account will be loaded
   * and returned.
   * 
   * @return {@link UserAccount} UserAccount service object describing the current user. Depending on the passed load
   * strategy associations of the returned user account service object will be set or not. The method never returns
   * null.
   * 
   */
  UserAccount getCurrentUserAccount( UserAccountLoadStrategy pLoadStrategy );

  /**
   * Method locks the passed account. If the account is already locked, nothing will happen.
   * 
   * 
   * @param pAccount UserAccount that should be locked. The parameter must not be null.
   * 
   * @param pLoadStrategy Load strategy can be used to define which associations of the user account service object
   * should also be returned. The parameter may be null. In this case no associations of the user account will be loaded
   * and returned.
   * 
   * @return {@link UserAccount} Updated user account object. According to the definitions of the passed load strategy
   * associations to depending objects are also set.
   * 
   */
  UserAccount lockUserAccount( UserAccount pAccount, UserAccountLoadStrategy pLoadStrategy );

  /**
   * Method changes the password of the current user to the passed value.
   * 
   * 
   * @param pCurrentPasword Current password of the current user. The current password has to be passed in order to
   * avoid the accidentally change of the password. The parameter must not be null.
   * 
   * @param pNewPasword New value for the password of the passed user account. The parameter must not be null and must
   * match the defined password restrictions.
   * 
   * @return {@link Boolean} if the password change was successful true, else false.
   * 
   */
  boolean changePassword( String pCurrentPasword, String pNewPasword );

  /**
   * Method changes the password of the passed user account of the passed value.
   * 
   * 
   * @param pUserAccount User account whose password should be changed. The parameter must not be null.
   * 
   * @param pNewPassword New value for the password of the passed user account. The parameter must not be null and must
   * match the defined password restrictions.
   * 
   */
  void changePassword( UserAccount pUserAccount, String pNewPassword );

  /**
   * Method returns the organizational unit with the passed id. An object with the passed id must exist.
   * 
   * 
   * @param pOrganizationlUnitID ID of the organizational unit that should be returned. The parameter must not be null.
   * 
   * @param pLoadStrategy Load strategy defines the associations of the organizational unit that should also be loaded
   * and returned. The parameter may be null. In this case no associations to other objects will be set for the returned
   * person object.
   * 
   * @return {@link OrganizationalUnit} Organizational unit with the passed id. The associations of the returned object
   * are set according to the passed load strategy. The method never returns null.
   * 
   */
  OrganizationalUnit getOrganizationalUnit( ServiceObjectID pOrganizationlUnitID,
      OrganizationalUnitLoadStrategy pLoadStrategy );

  /**
   * Method creates a new organizational unit from the passed object. If a reference to a parent unit is set, the object
   * will be created as its child. If the unit has child units they will also be created. The name and acronym of the
   * organizational unit must be unique within the organization hierarchy.
   * 
   * 
   * @param pOrganizationalUnit Organizational unit that should be created. The parameter must not be null.
   * 
   * @param pLoadStrategy Load strategy defines the associations of the organizational unit that should also be loaded
   * and returned. The parameter may be null. In this case no associations to other objects will be set for the returned
   * person object.
   * 
   * @return {@link OrganizationalUnit} Created organizational unit. The associations of the returned object are set
   * according to the passed load strategy. The method never returns null.
   * 
   */
  OrganizationalUnit createOrganizationalUnit( OrganizationalUnit pOrganizationalUnit,
      OrganizationalUnitLoadStrategy pLoadStrategy );

  /**
   * Method updates the passed organizational unit to the passed values. Besides the attributes of the organizational
   * unit also its addresses will be updated. This means that edited addresses will be updated, added address will be
   * created and removed addresses will be deleted. The method does not recursively update all objects of the hierarchy.
   * 
   * 
   * @param pOrganizationalUnit OrganizationalUnit that should be updated. The parameter must not be null.
   * 
   * @param pLoadStrategy Load strategy defines the associations of the organizational unit that should also be loaded
   * and returned. The parameter may be null. In this case no associations to other objects will be set for the returned
   * person object.
   * 
   * @return {@link OrganizationalUnit} Updates organizational unit. The association of the returned object are set
   * according to the passed load strategy. The method never returns null.
   * 
   */
  OrganizationalUnit updateOrganizationalUnit( OrganizationalUnit pOrganizationalUnit,
      OrganizationalUnitLoadStrategy pLoadStrategy );

  /**
   * Method deletes the passed organizational unit and all its child elements.
   * 
   * 
   * @param pOrganizationalUnit Organizational unit that should be deleted. If the object has child elements such as
   * persons or other organizational units they are deleted too. The parameter must not be null.
   * 
   */
  void deleteOrganizationalUnit( OrganizationalUnit pOrganizationalUnit );

  /**
   * Method queries all organizational units based on the passed query criteria. If the query object has more than one
   * attribute set they are conjuncted by a logical AND.
   * 
   * 
   * @param pOrganizationalUnitQuery Query object defining all the criteria to build up the query. The parameter must
   * not be null, but may have no criteria set.
   * 
   * @param pLoadStrategy Load strategy defines the associations of the organizational unit that should also be loaded
   * and returned. The parameter may be null. In this case no associations to other objects will be set for the returned
   * person object.
   * 
   * @return {@link OrganizationalUnit}
   */
  List queryOrganizationalUnits( OrganizationalUnitQuery pOrganizationalUnitQuery,
      OrganizationalUnitLoadStrategy pLoadStrategy );

  /**
   * Method adds the passed person to the passed organizational unit.
   * 
   * 
   * @param pPerson Person that should be added to the organizational unit. The parameter must not be null.
   * 
   * @param pOrganizationalUnit Organizational Unit to which the person should be added. The parameter must not be null.
   * 
   */
  void addPersonToOrganizationalUnit( Person pPerson, OrganizationalUnit pOrganizationalUnit );

  /**
   * Method returns all available countries from the database. The reference to all the states of a country is also set.
   * 
   * 
   * @return {@link Country} All existing Countries. Each country has also set all its states. The method never returns
   * null.
   * 
   */
  List getAllCountries( );

  /**
   * Method returns all available address types. The reference to all address subtypes is also set.
   * 
   * 
   * @return {@link AddressType} List with all address types. The address subtypes of each address type is also set. The
   * method never returns null.
   * 
   */
  List getAllAddressTypes( );

  /**
   * 
   * @param pLoginName String for the system wide unique login name of a user. The Parameter may not be null.
   * 
   * @param pActivationToken Token which is used for the activation. If the token is null the userAccount is activated.
   * The Parameter may not be null.
   * 
   * @return {@link UserAccount}
   * @throws {@link UserManagementServiceApplicationException}
   */
  UserAccount activateUserAccount( String pLoginName, String pActivationToken )
    throws UserManagementServiceApplicationException;

  /**
   * The Method gets the address type with the given Name.
   * 
   * 
   * @param pAddressTypeName Gets the address type with the given name. If the addressType doesn't exist return null.
   * 
   * @return {@link AddressType}
   * @throws {@link UserManagementServiceSystemException}
   */
  AddressType getAddressType( String pAddressTypeName ) throws UserManagementServiceSystemException;

  /**
   * Gets the address subtype with to the given address type it belongs to.
   * 
   * 
   * @param pAddressSubtype The address subtype of a Address. The parameter must not be null.
   * 
   * @param pAddressType The address type the address subtype belongs to. The parameter must not be null.
   * 
   * @return {@link AddressSubtype}
   * @throws {@link UserManagementServiceSystemException}
   */
  AddressSubtype getAddressSybtype( String pAddressSubtype, String pAddressType )
    throws UserManagementServiceSystemException;

  /**
   * The method updates a given user account object and according to the LoadStrategy its referenced objects.
   * 
   * 
   * @param pUserAccount The UserAccount which has the new data. The Parameter may not be null.
   * 
   * @param pLoadStrategy Load strategy defines the associations of the user account object that should also be loaded
   * and updated. The parameter may be null. In this case no associations to other objects will be set for the updated
   * user account object.
   * 
   * @return {@link UserAccount}
   */
  UserAccount updateCurrentUserAccount( UserAccount pUserAccount, UserAccountLoadStrategy pLoadStrategy );

  /**
   * Method returns a user info object of the user account with the passed service object id.
   * 
   * 
   * @param pUserAccountOID Service object ID of the user account of which the user info should be returned. The
   * parameter must not be null.
   * 
   * @return {@link UserInfo} User info object describing the user account with the passed id. The method never returns
   * null.
   * 
   */
  UserInfo getUserInfo( ServiceObjectID pUserAccountOID );

  /**
   * Method returns the user info of the current user.
   * 
   * 
   * @return {@link UserInfo} User info of the current user. The method never returns null.
   * 
   */
  UserInfo getUserInfo( );

  /**
   * Method returns a user principal object representing the user account with the passed id.
   * 
   * 
   * @param pUserAccountOID Service-Object-Id of the user account whose user principal should be returned. The parameter
   * must not be null.
   * 
   * @return {@link UserPrincipal} User Principal object representing the user account whose id was passed to the
   * method. The method never returns null.
   * 
   */
  UserPrincipal getUserPrincipal( ServiceObjectID pUserAccountOID );

  /**
   * Method returns all groups which have the current user as owner.
   * 
   * 
   * @return {@link Group} List with the groups the current user owns. The method never returns null.
   * 
   */
  List getGroups( );

  /**
   * Method returns the group with the given service Id. The method never returns null.
   * 
   * 
   * @param pGroupID The unique service id a group can be identified with. Parameter may not be null.
   * 
   * @param pLoadStrategy The load strategy to load only the associated objects the user wants to load. Parameter may be
   * null. In that case no association is loaded.
   * 
   * @return {@link Group} The group which was found
   * 
   */
  Group getGroup( ServiceObjectID pGroupID, GroupLoadStrategy pLoadStrategy );

  /**
   * Method creates a new group with the current user as owner.
   * 
   * 
   * @param pGroup The group which shall be created. The parameter may not be null.
   * 
   * @param pLoadStrategy defines the associations which are loaded of the returned group. The parameter may be null. In
   * this case no associations are loaded.
   * 
   * @return {@link Group} The created group. The method never returns null.
   * 
   */
  Group createGroup( Group pGroup, GroupLoadStrategy pLoadStrategy );

  /**
   * Method actualizes a group by the given group data.
   * 
   * 
   * @param pGroup The group object with the new data.
   * 
   * @param pLoadStrategy Load strategy which defines which associations shall be loaded.
   * 
   * @return {@link Group} The updated group.
   * 
   */
  Group updateGroup( Group pGroup, GroupLoadStrategy pLoadStrategy );

  /**
   * Method deletes the given group from the storage.
   * 
   * 
   * @param pGroup The group that will be deleted by this method. The parameter may not be null.
   * 
   */
  void deleteGroup( Group pGroup );

  /**
   * Method returns all existing GroupTypes from the database.
   * 
   * 
   * @return {@link GroupType} The existing GroupTypes.
   * 
   */
  List getAllGroupTypes( );

  /**
   * Links a given person to a given group. The status of this link will be the same as the given link status.
   * 
   * 
   * @param pLinkStatus Provides the status of a link between a group and a person. This status may be 'requested' or
   * 'confirmed'. The parameter may not be null.
   * 
   * @param pPerson The given person a current user will be linked to. The parameter may not be null.
   * 
   * @param pGroup The group of the current user a linked person belongs to. The parameter may not be null.
   * 
   * @return {@link LinkStatusToken} The link status token to identify the link.
   * 
   */
  LinkStatusToken addLinkedPerson( LinkStatus pLinkStatus, Person pPerson, Group pGroup );

  /**
   * Method deletes a person current user link. It doesn't delete the person or the group which are linked.
   * 
   * 
   * @param pPerson The person which belongs to the link. The parameter may not be null.
   * 
   * @param pGroup The group which belongs to the link. The parameter may not be null.
   * 
   */
  void deleteLinkedPerson( Person pPerson, Group pGroup );

  /**
   * Updates the status of a link between a given person and a group. The method checks if the link which is defined by
   * the given person and group belongs to the current user.
   * 
   * 
   * @param pLinkStatus New link status. The parameter may not be null.
   * 
   * @param pPerson
   * @param pGroup Group which belongs to the link that should be updated. The Parameter may not be null.
   * 
   */
  void updateLinkedPerson( LinkStatus pLinkStatus, Person pPerson, Group pGroup );

  /**
   * Method returns all Persons which are linked to the current user and the link has the given status.
   * 
   * 
   * @param pLinkStatus The status of the link between the persons and the current user's groups. The parameter may not
   * be null.
   * 
   * @return {@link UserInfo} List of the found persons which are linked to the current user and the link has the
   * defined status. The method never returns null.
   * 
   */
  List getLinkedPersonsByStatus( LinkStatus pLinkStatus );

  /**
   * Method returns the UserInfo for the given person. The method never returns null.
   * 
   * 
   * @param pPersonList The Persons who hold the information for the UserInfos.
   * 
   * @return {@link UserInfo} List of user infos from the given persons.
   * 
   */
  List getUserInfos( List pPersonList );

  /**
   * Method returns a list of persons who made a contact request to the current user. The method never returns null.
   * 
   * 
   * @return {@link Person} List of Persons who send a request to the current user.
   * 
   */
  List getRequestingContacts( );

  /**
   * Method resets the password with a generated value and sends an email to the email address of the given user account
   * with this value. An informative email will also be sent to the support.
   * 
   * 
   * @param pLoginName The login name of the user whose password will be reset. This parameter must not be null.
   * 
   * @return {@link String}
   * @throws {@link UserManagementServiceApplicationException}
   */
  String resetPassword( String pLoginName ) throws UserManagementServiceApplicationException;

  /**
   * Method creates a new organizational unit account from the passed organizational unit account and the additional
   * information. The current user will be the team admin of this organizational unit.
   * 
   * 
   * @param pOrganizationalUnitAccount The organizational unit account that will be created.
   * 
   * @param pLoadStrategy Load strategy defines the associations of the organization unit account object that should
   * also be loaded and returned. The parameter may be null. In this case no associations to other objects will be set
   * for the returned organizational unit account object.
   * 
   * @return {@link OrganizationalUnitAccount}
   */
  OrganizationalUnitAccount createOrganizationalUnitAccount( OrganizationalUnitAccount pOrganizationalUnitAccount,
      OrganizationalUnitAccountLoadStrategy pLoadStrategy );

  /**
   * Method returns the organizational unit account with the passed id. An object with the passed id must exist.
   * 
   * 
   * @param pOrganizationalUnitAccountID The service object ID Of the organizational unit account.
   * 
   * @param pLoadStrategy Load strategy defines the associations of the organization unit account object that should
   * also be loaded and returned. The parameter may be null. In this case no associations to other objects will be set
   * for the returned organizational unit account object.
   * 
   * @return {@link OrganizationalUnitAccount}
   */
  OrganizationalUnitAccount getOrganizationalUnitAccount( ServiceObjectID pOrganizationalUnitAccountID,
      OrganizationalUnitAccountLoadStrategy pLoadStrategy );

  /**
   * Method returns all organization unit types.
   * 
   * 
   * @return {@link OrganizationUnitType} a list of all organization unit types.
   * 
   */
  List getAllOrganizationTypes( );

  /**
   * Method returns the organization unit type with the given name.
   * 
   * 
   * @param pOrganizationUnitTypeName The name of the organizational unit type the method will return.
   * 
   * @return {@link OrganizationUnitType} the organization unit type with the given name.
   * 
   */
  OrganizationUnitType getOrganizationUnitType( String pOrganizationUnitTypeName );

  /**
   * Method returns the user infos of the members of the given group.
   * 
   * 
   * @param pGroup The group whose members will be retrieved. This method just returns the first level members not the
   * members of child groups. The method never returns null.
   * 
   * @return {@link UserInfo}
   */
  List getGroupMemberUserInfos( Group pGroup );

  /**
   * Method updates the given OrganziationalUnitAccount
   * 
   * 
   * @param pOrganizationalUnitAccount The Organizational Unit Account with the data to update
   * 
   * @param pLoadStrategy
   * @return {@link OrganizationalUnitAccount}
   */
  OrganizationalUnitAccount updateOrganizationalUnitAccount( OrganizationalUnitAccount pOrganizationalUnitAccount,
      OrganizationalUnitAccountLoadStrategy pLoadStrategy );

  /**
   * The method returns the group with the given name, which belongs to the given organizational unit. The method may
   * return null if nor group with the given name exits in the organizational unit.
   * 
   * 
   * @param pGroupName The name of the group. The parameter may not be null.
   * 
   * @param pParentUnit The organizational unit the group belongs to. The parameter may not be null.
   * 
   * @return {@link Group} The group with the given name.
   * 
   */
  Group getGroup( String pGroupName, OrganizationalUnit pParentUnit );

  /**
   * Method returns the Group Members of the group with the given Name, that belongs to the OrganizationalUnitAccount.
   * 
   * 
   * @param pOrgUnitAccountOID The OID of the Organizational Unit Account.
   * 
   * @param pGroupName The Name of the group whose members will be retrieved.
   * 
   * @return {@link UserInfo} The group Members of the specified group.
   * 
   */
  List getOrganizationalUnitAccountGroupMembers( ServiceObjectID pOrgUnitAccountOID, String pGroupName );

  /**
   * Method completes a started login process.This means that the user principal and the person. Besides that also the
   * login counter and last login date will be updated.
   * 
   * 
   */
  void completeLogin( );

  /**
   * Method unlocks the passed account. If the account is already unlocked, nothing will happen.
   * 
   * 
   * @param pAccount UserAccount that should be unlocked. The parameter must not be null.
   * 
   * @param pLoadStrategy Load strategy can be used to define which associations of the user account service object
   * should also be returned. The parameter may be null. In this case no associations of the user account will be loaded
   * and returned.
   * 
   * @return {@link UserAccount} Updated user account object. According to the definitions of the passed load strategy
   * associations to depending objects are also set.
   * 
   */
  UserAccount unlockUserAccount( UserAccount pAccount, UserAccountLoadStrategy pLoadStrategy );

  /**
   * Method creates a new identity provider based on the passed object. The identity provider is owned by the
   * organizational unit account to which the current user belongs to.
   * 
   * 
   * @param pIdentityProvider Definition of the identity provider that should be created. The parameter must not be
   * null.
   * 
   * @return {@link IdentityProvider}
   */
  IdentityProvider createIdentityProvider( IdentityProvider pIdentityProvider );

  /**
   * Method changes the passed identity provider to the passed values. All attributes of an identity provider can be
   * updated. The current user must belong to the organizational unit account to which the identity provider belongs to.
   * 
   * 
   * @param pIdentityProvider Identity provider that should be updated. The parameter must not be null.
   * 
   */
  void updateIdentityProvider( IdentityProvider pIdentityProvider );

  /**
   * Method deletes the passed identity provider. The current user must belong to the organizational unit account to
   * which the identity provider belongs to.
   * 
   * 
   * @param pIdentityProvider Identity Provider that should be deleted. The parameter must not be null.
   * 
   */
  void deleteIdentityProvider( IdentityProvider pIdentityProvider );

  /**
   * Method sets the login provider for the organizational unit account to which the current user belongs.
   * 
   * 
   * @param pLoginProvider Login provider for the current organizational unit account. The parameter may be null. In
   * this case the current login provider will be unset.
   * 
   */
  void setLoginProvider( IdentityProvider pLoginProvider );

  /**
   * Method sets the login provider for the organizational unit account to which the current user belongs.
   * 
   * 
   * @param pDirectoryService Method selects the passed identity provider as directory service. The parameter may be
   * null. In this cases the current directory service will be unset.
   * 
   */
  void setDirectoryService( IdentityProvider pDirectoryService );

  /**
   * Method returns all all identity providers that are available as login provider for the organizational unit account
   * to which the current user belongs to.
   * 
   * 
   * @return {@link IdentityProvider} List with all available login providers. The method never returns an empty list.
   * 
   */
  List getAvailableLoginProviders( );

  /**
   * Method returns all all identity providers that are available as directory service for the organizational unit
   * account to which the current user belongs to.
   * 
   * 
   * @return {@link IdentityProvider} List with all available directory services. The method never returns null but the
   * list may be empty.
   * 
   */
  List getAvailableDirectoryServices( );

  /**
   * Method tests if the passed identity provider can connect to the defined service. The method can be used for
   * existing identity providers as well as for not yet created ones.
   * 
   * 
   * @param pIdentityProvider Identity provider that should be tested. The parameter must not be null.
   * 
   * @return {@link FailureMessage} Description of a may be occurred failure. The method returns null if the test was
   * successful and a failure object in all other cases.
   * 
   */
  FailureMessage testConnection( IdentityProvider pIdentityProvider );

  /**
   * The method gets the login provider of the current user.
   * 
   * 
   * @return {@link IdentityProvider} The identity provider which is used by the current user as login provider.
   * 
   */
  IdentityProvider getCurrentLoginProvider( );

  /**
   * Method gets the current Directory Service of a user.
   * 
   * 
   * @return {@link IdentityProvider} The Identity Provider which is selected as Directory Service for the current user.
   * 
   */
  IdentityProvider getCurrentDirectoryService( );

  /**
   * Updates the status of a link between a person and a group. The status of the link is identified by the given link
   * status token.
   * 
   * 
   * @param pLinkStatus New link status. The parameter may not be null.
   * 
   * @param pLinkStatusToken
   */
  void updateLinkStatusByToken( LinkStatus pLinkStatus, LinkStatusToken pLinkStatusToken );

  /**
   * 
   * @param pLinkStatusToken
   * @return {@link UserAccount}
   */
  UserAccount getLinkedUserAccountByToken( LinkStatusToken pLinkStatusToken );
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy