* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace FreeDSx\Ldap\Protocol\ServerProtocolHandler; use FreeDSx\Ldap\Protocol\LdapMessageRequest; use FreeDSx\Ldap\Protocol\Queue\ServerQueue; use FreeDSx\Ldap\Server\RequestContext; use FreeDSx\Ldap\Server\RequestHandler\RequestHandlerInterface; use FreeDSx\Ldap\Server\Token\TokenInterface; /** * Handles search request logic. * * @author Chad Sikorra */ class ServerSearchHandler implements ServerProtocolHandlerInterface { use ServerSearchTrait; /** * @inheritDoc */ public function handleRequest( LdapMessageRequest $message, TokenInterface $token, RequestHandlerInterface $dispatcher, ServerQueue $queue, array $options ): void { $context = new RequestContext( $message->controls(), $token ); $request = $this->getSearchRequestFromMessage($message); $entries = $dispatcher->search( $context, $request ); $this->sendEntriesToClient( $entries, $message, $queue ); } }