org.nuiton.wikitty.addons
Class WikittyImportExportService

java.lang.Object
  extended by org.nuiton.wikitty.addons.WikittyImportExportService

public class WikittyImportExportService
extends Object

Import/export service.

Version:
$Revision: 1136 $ Last update: $Date: 2011-08-12 16:24:03 +0200 (Fri, 12 Aug 2011) $ by : $Author: tchemit $
Author:
poussin

Nested Class Summary
static class WikittyImportExportService.FORMAT
           
 
Field Summary
protected  String exportDirectory
          directory path where export asynchronous file are stored
protected  String exportPublicURL
          url used by client to retrieve export file when job is ended
protected  ExecutorService importExportExecutor
          Executor that do import export task
protected  Map<String,Future<String>> importExportTask
          contains all import or export task, key is job id send to client
protected  String securityToken
           
protected  WikittyService ws
           
 
Constructor Summary
WikittyImportExportService(org.nuiton.util.ApplicationConfig config, String securityToken, WikittyService ws)
           
 
Method Summary
 String asyncExportAllByCriteria(WikittyImportExportService.FORMAT format, Criteria criteria)
          Asynchronous export by criteria.
 String asyncExportAllByExample(WikittyImportExportService.FORMAT format, BusinessEntityImpl e)
          Asynchronous export by example.
 String asyncImportFromUri(WikittyImportExportService.FORMAT format, String uri)
           
 void cancelJob(String jobId)
           
 void freeJobResource(String jobId)
           
 String getExportDirectory()
           
 String getExportPublicURL()
           
 WikittyService getWikittyService()
           
 JobState infoJob(String jobId)
          Return job information.
 String syncExportAllByCriteria(WikittyImportExportService.FORMAT format, Criteria criteria)
          Synchronous export by criteria.
 void syncExportAllByCriteria(WikittyImportExportService.FORMAT format, Criteria criteria, Writer writer)
          Synchronous export by criteria.
 String syncExportAllByExample(WikittyImportExportService.FORMAT format, BusinessEntityImpl e)
          Synchronous export by example.
 void syncExportAllByExample(WikittyImportExportService.FORMAT format, BusinessEntityImpl e, Writer writer)
          Synchronous export by example.
 void syncImport(WikittyImportExportService.FORMAT format, Reader reader)
           
 void syncImport(WikittyImportExportService.FORMAT format, String s)
           
 void syncImportFromUri(WikittyImportExportService.FORMAT format, String uri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

exportDirectory

protected String exportDirectory
directory path where export asynchronous file are stored


exportPublicURL

protected String exportPublicURL
url used by client to retrieve export file when job is ended


importExportExecutor

protected ExecutorService importExportExecutor
Executor that do import export task


importExportTask

protected Map<String,Future<String>> importExportTask
contains all import or export task, key is job id send to client


ws

protected WikittyService ws

securityToken

protected String securityToken
Constructor Detail

WikittyImportExportService

public WikittyImportExportService(org.nuiton.util.ApplicationConfig config,
                                  String securityToken,
                                  WikittyService ws)
Method Detail

getWikittyService

public WikittyService getWikittyService()

getExportDirectory

public String getExportDirectory()

getExportPublicURL

public String getExportPublicURL()

syncImport

public void syncImport(WikittyImportExportService.FORMAT format,
                       String s)

syncImport

public void syncImport(WikittyImportExportService.FORMAT format,
                       Reader reader)

syncImportFromUri

public void syncImportFromUri(WikittyImportExportService.FORMAT format,
                              String uri)

asyncImportFromUri

public String asyncImportFromUri(WikittyImportExportService.FORMAT format,
                                 String uri)

asyncExportAllByExample

public String asyncExportAllByExample(WikittyImportExportService.FORMAT format,
                                      BusinessEntityImpl e)
Asynchronous export by example.

Parameters:
format - export format
e - sample
Returns:
job id

syncExportAllByExample

public String syncExportAllByExample(WikittyImportExportService.FORMAT format,
                                     BusinessEntityImpl e)
Synchronous export by example.

Parameters:
format - export format
e - sample
Returns:
export string

syncExportAllByExample

public void syncExportAllByExample(WikittyImportExportService.FORMAT format,
                                   BusinessEntityImpl e,
                                   Writer writer)
Synchronous export by example.

Parameters:
format - export format
e - sample

asyncExportAllByCriteria

public String asyncExportAllByCriteria(WikittyImportExportService.FORMAT format,
                                       Criteria criteria)
Asynchronous export by criteria.

Parameters:
format - export format
criteria - criteria
Returns:
export as string

syncExportAllByCriteria

public String syncExportAllByCriteria(WikittyImportExportService.FORMAT format,
                                      Criteria criteria)
Synchronous export by criteria.

Parameters:
format - export format
criteria - criteria
Returns:
export as string

syncExportAllByCriteria

public void syncExportAllByCriteria(WikittyImportExportService.FORMAT format,
                                    Criteria criteria,
                                    Writer writer)
Synchronous export by criteria.

Parameters:
format - export format
criteria - criteria

infoJob

public JobState infoJob(String jobId)
Return job information.

Parameters:
jobId - job id
Returns:
job state

cancelJob

public void cancelJob(String jobId)

freeJobResource

public void freeJobResource(String jobId)


Copyright © 2009-2012 CodeLutin. All Rights Reserved.