it.sistematica.isharedoc.service.mail
Class PecServiceImpl

java.lang.Object
  extended by it.sistematica.isharedoc.service.mail.PecServiceImpl
All Implemented Interfaces:
PecService

@Service(value="pecService")
public class PecServiceImpl
extends java.lang.Object
implements PecService


Nested Class Summary
static class PecServiceImpl.DatiCert
           
 
Field Summary
(package private)  it.neverworks.data.EntityManager entities
           
(package private)  InstanceService instanceService
           
(package private)  OrganizationService organizationService
           
 
Constructor Summary
PecServiceImpl()
           
 
Method Summary
 java.lang.String generateAnnullamentoXml(MessageInstance messageInstance, java.lang.String motivo, java.lang.String provvedimento)
          Generate annullamento xml.
 java.lang.String generateConfermaXml(MessageInstance messageInstance, java.lang.String protocolNumber, java.util.Date protocolDate)
          Generate conferma xml.
 java.lang.String generateNotificaEccezioneXml(MessageInstance messageInstance, java.lang.String motivo)
          Generate notifica eccezione xml.
 java.lang.String generateSegnaturaXml(MessageInstance messageInstance)
          Generate segnatura xml.
 java.lang.String generateSegnaturaXml(MessageInstance messageInstance, java.util.List<ContactInstance> contactInstances)
          Generate segnatura xml.
 java.util.Map<java.lang.String,java.lang.Object> getVariablesMapFromAnnullamento(java.io.InputStream annullamentoXml, MessageBox.InteroperabilityType interoperabilityType)
          Gets the variables map from annullamento.
 java.util.Map<java.lang.String,java.lang.Object> getVariablesMapFromConfermaRicezione(java.io.InputStream confermaXml, MessageBox.InteroperabilityType interoperabilityType)
          Gets the variables map from conferma ricezione.
 java.util.Map<java.lang.String,java.lang.Object> getVariablesMapFromNotificaEccezione(java.io.InputStream eccezioneXml, MessageBox.InteroperabilityType interoperabilityType)
          Gets the variables map from notifica eccezione.
 java.util.Map<java.lang.String,java.lang.Object> getVariablesMapFromSegnatura(java.io.InputStream segnaturaXml, MessageBox.InteroperabilityType interoperabilityType)
          Gets the variables map from segnatura.
 MessageServiceInstance.XmlAutomationType getXmlAutomationType(java.lang.String xmlFileName)
          Gets the xml automation type.
 java.lang.String getXmlType(java.util.Collection<java.io.File> attachments)
          Gets the xml type.
 java.lang.String getXmlType(it.neverworks.mail.helper.MessageHelper messageHelper)
          Gets the xml type.
 java.lang.String getXmlType(java.util.Vector<java.lang.String> attachments)
          Gets the xml type.
static PecServiceImpl.DatiCert readDaticertFromXml(java.io.InputStream daticert)
           
static Postacert readPostacertFromXml(java.io.InputStream daticert)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instanceService

InstanceService instanceService

entities

it.neverworks.data.EntityManager entities

organizationService

OrganizationService organizationService
Constructor Detail

PecServiceImpl

public PecServiceImpl()
Method Detail

generateSegnaturaXml

public java.lang.String generateSegnaturaXml(MessageInstance messageInstance)
                                      throws javax.xml.bind.JAXBException,
                                             org.xml.sax.SAXException
Description copied from interface: PecService
Generate segnatura xml.

Specified by:
generateSegnaturaXml in interface PecService
Parameters:
messageInstance - the message instance
Returns:
the string
Throws:
javax.xml.bind.JAXBException
org.xml.sax.SAXException

generateSegnaturaXml

public java.lang.String generateSegnaturaXml(MessageInstance messageInstance,
                                             java.util.List<ContactInstance> contactInstances)
                                      throws javax.xml.bind.JAXBException,
                                             org.xml.sax.SAXException
Description copied from interface: PecService
Generate segnatura xml.

Specified by:
generateSegnaturaXml in interface PecService
Parameters:
messageInstance - the message instance
contactInstances - the contact instances
Returns:
the string
Throws:
javax.xml.bind.JAXBException
org.xml.sax.SAXException

generateConfermaXml

public java.lang.String generateConfermaXml(MessageInstance messageInstance,
                                            java.lang.String protocolNumber,
                                            java.util.Date protocolDate)
                                     throws java.lang.Exception
Description copied from interface: PecService
Generate conferma xml.

Specified by:
generateConfermaXml in interface PecService
Parameters:
messageInstance - the message instance
protocolNumber - the protocol number
protocolDate - the protocol date
Returns:
the string
Throws:
java.lang.Exception - the exception

getVariablesMapFromSegnatura

public java.util.Map<java.lang.String,java.lang.Object> getVariablesMapFromSegnatura(java.io.InputStream segnaturaXml,
                                                                                     MessageBox.InteroperabilityType interoperabilityType)
                                                                              throws org.xml.sax.SAXException,
                                                                                     javax.xml.bind.JAXBException,
                                                                                     java.text.ParseException,
                                                                                     java.io.IOException
Description copied from interface: PecService
Gets the variables map from segnatura.

Specified by:
getVariablesMapFromSegnatura in interface PecService
Parameters:
segnaturaXml - the segnatura xml
interoperabilityType - the interoperability type
Returns:
the variables map from segnatura
Throws:
org.xml.sax.SAXException
javax.xml.bind.JAXBException
java.text.ParseException
java.io.IOException

getVariablesMapFromConfermaRicezione

public java.util.Map<java.lang.String,java.lang.Object> getVariablesMapFromConfermaRicezione(java.io.InputStream confermaXml,
                                                                                             MessageBox.InteroperabilityType interoperabilityType)
                                                                                      throws org.xml.sax.SAXException,
                                                                                             javax.xml.bind.JAXBException,
                                                                                             java.text.ParseException,
                                                                                             java.io.IOException
Description copied from interface: PecService
Gets the variables map from conferma ricezione.

Specified by:
getVariablesMapFromConfermaRicezione in interface PecService
Parameters:
confermaXml - the conferma xml
interoperabilityType - the interoperability type
Returns:
the variables map from conferma ricezione
Throws:
org.xml.sax.SAXException
javax.xml.bind.JAXBException
java.text.ParseException
java.io.IOException

getVariablesMapFromAnnullamento

public java.util.Map<java.lang.String,java.lang.Object> getVariablesMapFromAnnullamento(java.io.InputStream annullamentoXml,
                                                                                        MessageBox.InteroperabilityType interoperabilityType)
                                                                                 throws org.xml.sax.SAXException,
                                                                                        javax.xml.bind.JAXBException,
                                                                                        java.text.ParseException,
                                                                                        java.io.IOException
Description copied from interface: PecService
Gets the variables map from annullamento.

Specified by:
getVariablesMapFromAnnullamento in interface PecService
Parameters:
annullamentoXml - the annullamento xml
interoperabilityType - the interoperability type
Returns:
the variables map from annullamento
Throws:
org.xml.sax.SAXException
javax.xml.bind.JAXBException
java.text.ParseException
java.io.IOException

getVariablesMapFromNotificaEccezione

public java.util.Map<java.lang.String,java.lang.Object> getVariablesMapFromNotificaEccezione(java.io.InputStream eccezioneXml,
                                                                                             MessageBox.InteroperabilityType interoperabilityType)
                                                                                      throws java.lang.Exception
Description copied from interface: PecService
Gets the variables map from notifica eccezione.

Specified by:
getVariablesMapFromNotificaEccezione in interface PecService
Parameters:
eccezioneXml - the annullamento xml
interoperabilityType - the interoperability type
Returns:
the variables map from notifica eccezione
Throws:
java.lang.Exception - the exception

generateNotificaEccezioneXml

public java.lang.String generateNotificaEccezioneXml(MessageInstance messageInstance,
                                                     java.lang.String motivo)
                                              throws java.lang.Exception
Description copied from interface: PecService
Generate notifica eccezione xml.

Specified by:
generateNotificaEccezioneXml in interface PecService
Parameters:
messageInstance - the message instance
motivo - the motivo
Returns:
the string
Throws:
java.lang.Exception - the exception

generateAnnullamentoXml

public java.lang.String generateAnnullamentoXml(MessageInstance messageInstance,
                                                java.lang.String motivo,
                                                java.lang.String provvedimento)
                                         throws java.lang.Exception
Description copied from interface: PecService
Generate annullamento xml.

Specified by:
generateAnnullamentoXml in interface PecService
Parameters:
messageInstance - the message instance
motivo - the motivo
provvedimento - the provvedimento
Returns:
the string
Throws:
java.lang.Exception - the exception

readPostacertFromXml

public static Postacert readPostacertFromXml(java.io.InputStream daticert)
                                      throws javax.mail.internet.AddressException
Throws:
javax.mail.internet.AddressException

readDaticertFromXml

public static PecServiceImpl.DatiCert readDaticertFromXml(java.io.InputStream daticert)
                                                   throws javax.mail.internet.AddressException
Throws:
javax.mail.internet.AddressException

getXmlType

public java.lang.String getXmlType(java.util.Collection<java.io.File> attachments)
                            throws java.lang.Exception
Description copied from interface: PecService
Gets the xml type.

Specified by:
getXmlType in interface PecService
Parameters:
attachments - the attachments
Returns:
the xml type
Throws:
java.lang.Exception - the exception

getXmlType

public java.lang.String getXmlType(it.neverworks.mail.helper.MessageHelper messageHelper)
                            throws java.lang.Exception
Description copied from interface: PecService
Gets the xml type.

Specified by:
getXmlType in interface PecService
Parameters:
messageHelper - the message helper
Returns:
the xml type
Throws:
java.lang.Exception - the exception

getXmlType

public java.lang.String getXmlType(java.util.Vector<java.lang.String> attachments)
                            throws java.lang.Exception
Description copied from interface: PecService
Gets the xml type.

Specified by:
getXmlType in interface PecService
Parameters:
attachments - the attachments
Returns:
the xml type
Throws:
java.lang.Exception - the exception

getXmlAutomationType

public MessageServiceInstance.XmlAutomationType getXmlAutomationType(java.lang.String xmlFileName)
Description copied from interface: PecService
Gets the xml automation type.

Specified by:
getXmlAutomationType in interface PecService
Parameters:
xmlFileName - the xml file name
Returns:
the xml automation type