Beispiel #1
0
def main():
	'''Start the ECAS Backend.
	'''
	configFile = _parseCommandLine()
	configParser = _getConfig(configFile)
	_setJavaProperties(configParser)

	catalog = GenericFileManagerObjectFactory.getCatalogServiceFromFactory(configParser.get('factories', 'catalog'))
	repo = GenericFileManagerObjectFactory.getRepositoryManagerServiceFromFactory(configParser.get('factories', 'repository'))
	xfer = GenericFileManagerObjectFactory.getDataTransferServiceFromFactory(configParser.get('factories', 'datatransfer'))
	userDB = _getUserDB(configParser.get('policies', 'user'))

	ws = WebServer(1999)
	ws.addDispatcher(FileMgrDispatcher(catalog, repo, xfer, userDB))
	ws.start()
Beispiel #2
0
	def ingestProduct(self, params):
		productHash, metadata, clientXfer = params
		p = Structs.getProductFromXmlRpc(productHash)
		p.setTransferStatus(Product.STATUS_TRANSFER)
		self.catalog.addProduct(p)
		
		m = Metadata()
		m.addMetadata(metadata)
		self.catalog.addMetadata(m, p)
		
		if not clientXfer:
	                versioner = GenericFileManagerObjectFactory.getVersionerFromClassName(p.getProductType().getVersioner())
			versioner.createDataStoreReferences(p, m)
			self.catalog.addProductReferences(p)
			self.xfer.transferProduct(p)
			p.setTransferStatus(Product.STATUS_RECEIVED)
			self.catalog.setProductTranfserStatus(p)
		return Result(None, p.getProductId())