class ExternalInterfaceServiceImpl implements ExternalInterfaceService {

    @Override
    public ExternalInterface updateExternalInterface(ExternalInterfaceKey externalInterfaceKey, ExternalInterfaceUpdateRequest request)
    {
        // Perform validation and trim.
        validateAndTrimExternalInterfaceKey(externalInterfaceKey);

        // Perform the validation.
        validateExternalInterfaceUpdateRequest(request);

        // Ensure an external interface with the specified external interface name exists.
        ExternalInterfaceEntity externalInterfaceEntity =
            externalInterfaceDaoHelper.getExternalInterfaceEntity(externalInterfaceKey.getExternalInterfaceName());

        // Update and persist the external interface entity.
        updateExternalInterfaceEntity(externalInterfaceEntity, request);

        // Create and return the external interface object from the persisted entity.
        return createExternalInterfaceFromEntity(externalInterfaceEntity);
    }

}