Source code for pyams_content_es.interfaces

#
# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#

__docformat__ = 'restructuredtext'


# import standard library

# import interfaces

# import packages
from zope.interface import Interface
from zope.schema import Choice

from pyams_content_es import _


#
# Indexer interfaces
#

INDEXER_NAME = 'ElasticSearch content indexer'
INDEXER_STARTER_KEY = 'pyams_content.es.start_handler'
INDEXER_HANDLER_KEY = 'pyams_content.es.tcp_handler'
INDEXER_AUTH_KEY = 'pyams_content.es.allow_auth'
INDEXER_CLIENTS_KEY = 'pyams_content.es.allow_clients'


#
# Utility interfaces
#

[docs]class IContentIndexerUtility(Interface): """Content indexer utility interface""" zodb_name = Choice(title=_("ZODB connection name"), description=_("Name of ZODB connection defining indexer connection"), required=False, vocabulary="PyAMS ZODB connections") def get_socket(self): """Get 0MQ socket matching utility settings""" def index_document(self, document): """Index given document""" def unindex_document(self, document): """Un-index given document""" def test_process(self): """Send test request to indexer process"""
# # Contents interfaces #
[docs]class IDocumentIndexInfo(Interface): """Document index info"""
[docs]class IDocumentIndexTarget(Interface): """Document index target marker interface"""