from Service import Service
from AdaptiveSleeper import AdaptiveSleeper
from Index import Index
from Searchable import Searchable
from Config import MetadataServiceConfig

class InfospaceAgent(Service,AdaptiveSleeper,Searchable):
	"""The base class for all metadata service infospace agents.  Agents follow a Service pattern.  Implementors need to implement the search method of the Searchable interface."""
	
	index = None
	infospace_name = None
	
	def __init__(self,index,infospace_name,config,public_interface=None):
		assert isinstance(config,MetadataServiceConfig)
		assert isinstance(index,Index)
		assert type(infospace_name) is str and len(infospace_name) > 0
		Service.__init__(self,public_interface=public_interface)
		AdaptiveSleeper.__init__(self)
		self.infospace_name = infospace_name
		self.index = index
		self.config = config
