org.nuiton.wikitty
Class WikittyImportExportService

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

public class WikittyImportExportService
extends java.lang.Object

Import/export service.

Version:
$Revision$ Last update: $Date$ by : $Author$
Author:
poussin

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

Field Detail

MAX_IMPORT_EXPORT_THREAD

protected static final int MAX_IMPORT_EXPORT_THREAD
number of thread used to import/export task

See Also:
Constant Field Values

EXPORT_DIRECTORY

protected static final java.lang.String EXPORT_DIRECTORY
directory path where export asynchronous file are stored

See Also:
Constant Field Values

EXPORT_URL

protected static final java.lang.String EXPORT_URL
url used by client to retrieve export file when job is ended

See Also:
Constant Field Values

importExportExecutor

protected java.util.concurrent.ExecutorService importExportExecutor
Executor that do import export task


importExportTask

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


ws

protected WikittyService ws

securityToken

protected java.lang.String securityToken
Constructor Detail

WikittyImportExportService

public WikittyImportExportService(java.lang.String securityToken,
                                  WikittyService ws)
Method Detail

getWikittyService

public WikittyService getWikittyService()

syncImport

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

syncImportFromUri

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

asyncImportFromUri

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

asyncExportAllByExample

public java.lang.String asyncExportAllByExample(WikittyImportExportService.FORMAT format,
                                                BusinessEntityWikitty e)
Asynchronous export by example.

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

syncExportAllByExample

public java.lang.String syncExportAllByExample(WikittyImportExportService.FORMAT format,
                                               BusinessEntityWikitty e)
Synchronous export by example.

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

asyncExportAllByCriteria

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

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

syncExportAllByCriteria

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

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

infoJob

public JobState infoJob(java.lang.String jobId)
Return job information.

Parameters:
jobId - job id
Returns:
job state

cancelJob

public void cancelJob(java.lang.String jobId)

freeJobResource

public void freeJobResource(java.lang.String jobId)


Copyright © 2009-2010 CodeLutin. All Rights Reserved.