org.nuiton.wikitty
Class WikittyProxy

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

public class WikittyProxy
extends Object

Wikitty proxy is used to transform wikitty object used by WikittyService into business objects used by applications.

Version:
$Revision: 285 $ Last update: $Date: 2010-09-08 15:16:09 +0200 (mer., 08 sept. 2010) $ by : $Author: bpoussin $
Author:
poussin

Field Summary
protected  String securityToken
           
protected  WikittyService wikittyService
           
 
Constructor Summary
WikittyProxy()
           
 
Method Summary
 void addLabel(String wikittyId, String label)
           
<E extends BusinessEntityWikitty>
E
cast(BusinessEntityWikitty source, Class<E> target)
          Cast Business objet to another Business Object If source don't have target extension, this extension is added
 void delete(Collection<String> ids)
           
 void delete(String id)
           
 Set<String> findAllAppliedLabels(String wikittyId)
           
<E extends BusinessEntity>
PagedResult<E>
findAllByCriteria(Class<E> clazz, Criteria criteria)
          Search object that correspond to criteria and that have all extension needed by BusinessEntity (clazz).
 PagedResult<Wikitty> findAllByCriteria(Criteria criteria)
           
<E extends BusinessEntityWikitty>
PagedResult<E>
findAllByExample(E e, int firstIndex, int endIndex, String... fieldFacet)
           
 PagedResult<Wikitty> findAllByLabel(String label, int firstIndex, int endIndex)
           
<E extends BusinessEntity>
E
findByCriteria(Class<E> clazz, Criteria criteria)
           
 Wikitty findByCriteria(Criteria criteria)
           
<E extends BusinessEntityWikitty>
E
findByExample(E e)
           
 Wikitty findByLabel(String label)
           
 String getSecurityToken()
           
 WikittyService getWikittyService()
           
<E extends BusinessEntity>
boolean
hasType(Class<E> clazz, String wikittyId)
           
 String login(String login, String password)
           
 void logout()
           
<E extends BusinessEntity>
List<E>
restore(Class<E> clazz, List<String> id)
           
<E extends BusinessEntity>
List<E>
restore(Class<E> clazz, List<String> id, boolean checkExtension)
          Restore wikitty entity with specified id or null if entity can't be be found.
<E extends BusinessEntity>
E
restore(Class<E> clazz, String id)
          Restore wikitty entity with specified id or null if entity can't be found.
<E extends BusinessEntity>
E
restore(Class<E> clazz, String id, boolean checkExtension)
          Restore wikitty entity with specified id or null if entity can't be found.
 Wikitty restore(String id)
          Restore wikitty entity with specified id or null if entity can't be found.
<E extends BusinessEntity>
Map<E,Integer>
restoreChildren(Class<E> clazz, String wikittyId, Criteria filter)
           
<E extends BusinessEntity>
Map<E,Integer>
restoreChildren(Class<E> clazz, String wikittyId, Criteria filter, boolean checkExtension)
           
<E extends BusinessEntity>
Map.Entry<E,Integer>
restoreNode(Class<E> clazz, String wikittyId, Criteria filter)
           
<E extends BusinessEntity>
Map.Entry<E,Integer>
restoreNode(Class<E> clazz, String wikittyId, Criteria filter, boolean checkExtension)
           
 Tree restoreTree(String wikittyId)
           
 Wikitty restoreVersion(String wikittyId, String version)
           
 void setSecurityToken(String securityToken)
           
 void setWikittyService(WikittyService wikittyService)
           
<E extends BusinessEntity>
E
store(E e)
           
<E extends BusinessEntity>
List<E>
store(List<E> objets)
          Store to WikittyService objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wikittyService

protected WikittyService wikittyService

securityToken

protected String securityToken
Constructor Detail

WikittyProxy

public WikittyProxy()
Method Detail

login

public String login(String login,
                    String password)

logout

public void logout()

getSecurityToken

public String getSecurityToken()

setSecurityToken

public void setSecurityToken(String securityToken)

getWikittyService

public WikittyService getWikittyService()

setWikittyService

public void setWikittyService(WikittyService wikittyService)

cast

public <E extends BusinessEntityWikitty> E cast(BusinessEntityWikitty source,
                                                Class<E> target)
Cast Business objet to another Business Object If source don't have target extension, this extension is added

Parameters:
source - business entity source
target - business entity class wanted
Returns:
new instance of object wanted

store

public <E extends BusinessEntity> E store(E e)

store

public <E extends BusinessEntity> List<E> store(List<E> objets)
Store to WikittyService objects.

Type Parameters:
E - object type
Parameters:
objets - list
Returns:
updated objects list

restore

public <E extends BusinessEntity> E restore(Class<E> clazz,
                                            String id,
                                            boolean checkExtension)
Restore wikitty entity with specified id or null if entity can't be found.

Type Parameters:
E - object type
Parameters:
clazz - entity class
id - entity id
checkExtension - if true check that Wikitty result has all extension declared in clazz
Returns:
wikitty entity with specified id or null if entity can't be found

restore

public Wikitty restore(String id)
Restore wikitty entity with specified id or null if entity can't be found.

Parameters:
id - entity id
Returns:
wikitty entity with specified id or null if entity can't be found

restore

public <E extends BusinessEntity> E restore(Class<E> clazz,
                                            String id)
Restore wikitty entity with specified id or null if entity can't be found.

Type Parameters:
E - object type
Parameters:
clazz - entity class
id - entity id
Returns:
wikitty entity with specified id or null if entity can't be found

restore

public <E extends BusinessEntity> List<E> restore(Class<E> clazz,
                                                  List<String> id,
                                                  boolean checkExtension)
Restore wikitty entity with specified id or null if entity can't be be found.

Type Parameters:
E - object type
Parameters:
clazz - entity class
id - entity id
checkExtension - if true check that Wikitty result has all extension
Returns:
wikitty entity with specified id or null if entity can't be found

restore

public <E extends BusinessEntity> List<E> restore(Class<E> clazz,
                                                  List<String> id)

delete

public void delete(String id)

delete

public void delete(Collection<String> ids)

findAllByExample

public <E extends BusinessEntityWikitty> PagedResult<E> findAllByExample(E e,
                                                                         int firstIndex,
                                                                         int endIndex,
                                                                         String... fieldFacet)

findByExample

public <E extends BusinessEntityWikitty> E findByExample(E e)

findAllByCriteria

public <E extends BusinessEntity> PagedResult<E> findAllByCriteria(Class<E> clazz,
                                                                   Criteria criteria)
Search object that correspond to criteria and that have all extension needed by BusinessEntity (clazz). If criteria is null, find all extensions else if criteria is empty return nothing.

Type Parameters:
E - object type
Parameters:
clazz - entity class
criteria - criteria
Returns:
paged result

findAllByCriteria

public PagedResult<Wikitty> findAllByCriteria(Criteria criteria)

findByCriteria

public <E extends BusinessEntity> E findByCriteria(Class<E> clazz,
                                                   Criteria criteria)

findByCriteria

public Wikitty findByCriteria(Criteria criteria)

addLabel

public void addLabel(String wikittyId,
                     String label)

findAllByLabel

public PagedResult<Wikitty> findAllByLabel(String label,
                                           int firstIndex,
                                           int endIndex)

findByLabel

public Wikitty findByLabel(String label)

findAllAppliedLabels

public Set<String> findAllAppliedLabels(String wikittyId)

restoreTree

public Tree restoreTree(String wikittyId)

restoreNode

public <E extends BusinessEntity> Map.Entry<E,Integer> restoreNode(Class<E> clazz,
                                                                   String wikittyId,
                                                                   Criteria filter)

restoreNode

public <E extends BusinessEntity> Map.Entry<E,Integer> restoreNode(Class<E> clazz,
                                                                   String wikittyId,
                                                                   Criteria filter,
                                                                   boolean checkExtension)

restoreChildren

public <E extends BusinessEntity> Map<E,Integer> restoreChildren(Class<E> clazz,
                                                                 String wikittyId,
                                                                 Criteria filter)

restoreChildren

public <E extends BusinessEntity> Map<E,Integer> restoreChildren(Class<E> clazz,
                                                                 String wikittyId,
                                                                 Criteria filter,
                                                                 boolean checkExtension)

restoreVersion

public Wikitty restoreVersion(String wikittyId,
                              String version)

hasType

public <E extends BusinessEntity> boolean hasType(Class<E> clazz,
                                                  String wikittyId)


Copyright © 2009-2010 CodeLutin. All Rights Reserved.