edu.uoc.tfc.j2ee.icampanario.grepresenta.persistence.services.impl
Class EmpowermentQueryServiceDAOImpl

java.lang.Object
  extended by edu.uoc.tfc.j2ee.icampanario.grepresenta.persistence.services.impl.EmpowermentQueryServiceDAOImpl
All Implemented Interfaces:
EmpowermentQueryServiceDAO, java.io.Serializable

@Name(value="empowermentService")
@Scope(value=SESSION)
public class EmpowermentQueryServiceDAOImpl
extends java.lang.Object
implements EmpowermentQueryServiceDAO, java.io.Serializable

Implementación del servicio que gestiona los apoderamientos

Author:
Ismael Campanario Cabrera
See Also:
Serialized Form

Constructor Summary
EmpowermentQueryServiceDAOImpl()
           
 
Method Summary
 void createDocument(Document originalDocument)
          Crea un documento
 boolean createEmpowerment(Empowerment empowerment, java.lang.Long documentId, EmpowermentDocument empoDocument)
          Crea un apoderamiento
 boolean createEmpowermentDocument(Empowerment empowerment, java.lang.Long documentId, EmpowermentDocument empoDocument)
          Crea un documento para un apoderamiento
 java.util.List<State> getAllStates()
          Devuelve todos los estados
 java.util.Properties getConfigurationgr()
          return the configurationgr
 java.util.Map<java.lang.Long,State> getCurrentStateForAllEmpowerment()
          Estados de todos los apoderamientos
 java.util.List<EmpowermentDocument> getDocumentsForEmpowerment(java.lang.Long idEmpowerment)
          Documentos de un apoderamiento
 java.util.List<Empowerment> getEmpowermentAsAttorney(java.lang.String idAttorney)
          Devuelve la lista de apoderamientos para el apoderado indicado
 java.util.List<Empowerment> getEmpowermentsAsGrantor(java.lang.String idGrantor)
          Devuelve la lista de apoderamientos para el poderdante indicado
 javax.persistence.EntityManager getEntityManager()
          get entityManager
 org.jboss.seam.log.Log getLog()
          get log
 java.util.List<Empowerment> getRelatedEmpowerments(java.lang.Long idEmpowerment, java.lang.Long idDocument)
          Apoderamientos relacionados con uno dado
 java.util.Map<java.lang.String,State> getStates()
          get the states
 java.util.List<EmpowermentState> getStatesForEmpowerment(java.lang.Long idEmpowerment)
          Historico de estados para un apoderamiento
 void setConfigurationgr(java.util.Properties configurationgr)
          set the configurationgr
 void setEntityManager(javax.persistence.EntityManager entityManager)
          set entityManager
 void setLog(org.jboss.seam.log.Log log)
          set log
 void setStates(java.util.Map<java.lang.String,State> states)
          set the states
 boolean updateEmpowerment(Empowerment empowerment)
          Modifica un apoderamiento
 boolean updateState(EmpowermentState empowermentStateOld, EmpowermentState empowermentStateNew)
          Modifica el estao anterior y lo pasa a uno nuevo
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmpowermentQueryServiceDAOImpl

public EmpowermentQueryServiceDAOImpl()
Method Detail

createEmpowerment

public boolean createEmpowerment(Empowerment empowerment,
                                 java.lang.Long documentId,
                                 EmpowermentDocument empoDocument)
Crea un apoderamiento

Specified by:
createEmpowerment in interface EmpowermentQueryServiceDAO
Parameters:
empowerment - apoderamiento
documentId - id del documento
empoDocument - documento apoderamiento
Returns:
si se crea o no

createDocument

public void createDocument(Document originalDocument)
                    throws DocumentsManagerException
Crea un documento

Specified by:
createDocument in interface EmpowermentQueryServiceDAO
Parameters:
originalDocument - documento a crear
Throws:
DocumentsManagerException - content exception

createEmpowermentDocument

public boolean createEmpowermentDocument(Empowerment empowerment,
                                         java.lang.Long documentId,
                                         EmpowermentDocument empoDocument)
Crea un documento para un apoderamiento

Specified by:
createEmpowermentDocument in interface EmpowermentQueryServiceDAO
Parameters:
empowerment - apoderamiento
documentId - id del documento
empoDocument - documento apoderamiento
Returns:
si se ha creado o no

updateEmpowerment

public boolean updateEmpowerment(Empowerment empowerment)
Modifica un apoderamiento

Specified by:
updateEmpowerment in interface EmpowermentQueryServiceDAO
Parameters:
empowerment - apoderamiento
Returns:
si se modifica o no

getEmpowermentAsAttorney

public java.util.List<Empowerment> getEmpowermentAsAttorney(java.lang.String idAttorney)
Devuelve la lista de apoderamientos para el apoderado indicado

Specified by:
getEmpowermentAsAttorney in interface EmpowermentQueryServiceDAO
Parameters:
idAttorney - id del apoderado
Returns:
lista de apoderamientos

getEmpowermentsAsGrantor

public java.util.List<Empowerment> getEmpowermentsAsGrantor(java.lang.String idGrantor)
Devuelve la lista de apoderamientos para el poderdante indicado

Specified by:
getEmpowermentsAsGrantor in interface EmpowermentQueryServiceDAO
Parameters:
idGrantor - id del poderdante
Returns:
lista de apoderamientos

getStatesForEmpowerment

public java.util.List<EmpowermentState> getStatesForEmpowerment(java.lang.Long idEmpowerment)
Historico de estados para un apoderamiento

Specified by:
getStatesForEmpowerment in interface EmpowermentQueryServiceDAO
Parameters:
idEmpowerment - id del apoderamiento
Returns:
listado de estados

getDocumentsForEmpowerment

public java.util.List<EmpowermentDocument> getDocumentsForEmpowerment(java.lang.Long idEmpowerment)
                                                               throws DocumentsManagerException
Documentos de un apoderamiento

Specified by:
getDocumentsForEmpowerment in interface EmpowermentQueryServiceDAO
Parameters:
idEmpowerment - id del apoderamiento
Returns:
listado de documentos
Throws:
DocumentsManagerException - content exception

updateState

public boolean updateState(EmpowermentState empowermentStateOld,
                           EmpowermentState empowermentStateNew)
Modifica el estao anterior y lo pasa a uno nuevo

Specified by:
updateState in interface EmpowermentQueryServiceDAO
Parameters:
empowermentStateOld - estado anterior
empowermentStateNew - estado nuevo
Returns:
si se ha realizado la operacion de forma correcta

getCurrentStateForAllEmpowerment

public java.util.Map<java.lang.Long,State> getCurrentStateForAllEmpowerment()
Estados de todos los apoderamientos

Specified by:
getCurrentStateForAllEmpowerment in interface EmpowermentQueryServiceDAO
Returns:
listado de estados

getAllStates

public java.util.List<State> getAllStates()
Devuelve todos los estados

Specified by:
getAllStates in interface EmpowermentQueryServiceDAO
Returns:
estados

getRelatedEmpowerments

public java.util.List<Empowerment> getRelatedEmpowerments(java.lang.Long idEmpowerment,
                                                          java.lang.Long idDocument)
Apoderamientos relacionados con uno dado

Specified by:
getRelatedEmpowerments in interface EmpowermentQueryServiceDAO
Parameters:
idEmpowerment - id del apoderamiento
idDocument - id del documento
Returns:
listado de documentos

getLog

public org.jboss.seam.log.Log getLog()
get log

Returns:
log

setLog

public void setLog(org.jboss.seam.log.Log log)
set log

Parameters:
log - log

getEntityManager

public javax.persistence.EntityManager getEntityManager()
get entityManager

Returns:
entityManager

setEntityManager

public void setEntityManager(javax.persistence.EntityManager entityManager)
set entityManager

Parameters:
entityManager - entityManager

getStates

public java.util.Map<java.lang.String,State> getStates()
get the states

Returns:
the states

setStates

public void setStates(java.util.Map<java.lang.String,State> states)
set the states

Parameters:
states - the states to set

getConfigurationgr

public java.util.Properties getConfigurationgr()
return the configurationgr

Returns:
the configurationgr

setConfigurationgr

public void setConfigurationgr(java.util.Properties configurationgr)
set the configurationgr

Parameters:
configurationgr - the configurationgr to set