Class DocSignProvider

  • Direct Known Subclasses:
    DocuSignTool

    public abstract class DocSignProvider
    extends java.lang.Object
    Document signing interface. For example use DocSignProvider p = DocSignProvider.getInstance(DocSignProvider.PROVIDER_DOCUSIGN)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PROVIDER_DOCUSIGN
      Document signing provider name
      static java.lang.String STATUS_CANCELED
      The sender canceled the envelope before it was completed
      static java.lang.String STATUS_COMPLETED
      Completed once all of the recipients have completed their actions
      static java.lang.String STATUS_DECLINED
      A signer has declined to sign
      static java.lang.String STATUS_DELIVERED
      Document delivered to signer
      static java.lang.String STATUS_FAILURE
      Document not delivered (auto-respond, invalid email...)
      static java.lang.String STATUS_SENT
      Document sent
      static java.lang.String STATUS_SIGNED
      Document signed
      static java.lang.String STATUS_TIMEOUT
      Timeout of a signature
      static java.lang.String STATUS_UNKNOWN
      Unknown status
    • Constructor Summary

      Constructors 
      Constructor Description
      DocSignProvider()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract DocSignProvider.DocSignAccount authent​(Grant g)
      Manage the provider authent to get account infos
      abstract boolean cancelDocument​(DocSignProvider.DocSignAccount account, java.lang.String envelopeId, java.lang.String voidedReason)
      Cancel an envelope
      abstract DocSignProvider.DocSignStatus getDocument​(Grant g, java.lang.String envelopeId, boolean withDocs)
      Call with current document status
      DocSignProvider.DocSignStatus getDocument​(java.lang.String envelopeId, boolean withDocs)
      Call with current document status
      static DocSignProvider getInstance​(java.lang.String provider)
      Get isolated instance of DocSignProvider
      java.lang.String send​(DocSignProvider.DocSignAccount account, java.lang.String subject, java.lang.String pdfPath, java.lang.String pdfName, java.lang.String signerEmail, java.lang.String signerName, java.lang.String signerAnchor, java.lang.String object)
      Send one document to one signer
      java.lang.String send​(DocSignProvider.DocSignAccount account, java.lang.String subject, java.util.List<java.lang.String> pdfPaths, java.util.List<java.lang.String> pdfNames, java.util.List<java.lang.String> signerEmails, java.util.List<java.lang.String> signerNames, java.util.List<java.util.List<java.lang.String>> signerAnchors, java.util.List<java.util.List<java.lang.String>> initialAnchors, java.lang.String object)
      Send documents to signers
      abstract java.lang.String send​(DocSignProvider.DocSignAccount account, java.lang.String subject, java.util.List<java.lang.String> pdfPaths, java.util.List<java.lang.String> pdfNames, java.util.List<java.lang.String> signerEmails, java.util.List<java.lang.String> signerNames, java.util.List<java.util.List<java.lang.String>> signerAnchors, java.util.List<java.util.List<java.lang.String>> initialAnchors, java.util.List<java.util.List<java.lang.String>> stampAnchors, java.lang.String object)
      Send documents to signers
      static void webhook​(DocSignProvider.DocSignStatus data)
      Web-hook callback: call the web hook of target object from public servlet
      void webhook​(java.io.InputStream in)
      Web-hook callback: call the web hook of target object from public servlet
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PROVIDER_DOCUSIGN

        public static final java.lang.String PROVIDER_DOCUSIGN
        Document signing provider name
        See Also:
        Constant Field Values
      • STATUS_SENT

        public static final java.lang.String STATUS_SENT
        Document sent
        See Also:
        Constant Field Values
      • STATUS_DELIVERED

        public static final java.lang.String STATUS_DELIVERED
        Document delivered to signer
        See Also:
        Constant Field Values
      • STATUS_FAILURE

        public static final java.lang.String STATUS_FAILURE
        Document not delivered (auto-respond, invalid email...)
        See Also:
        Constant Field Values
      • STATUS_TIMEOUT

        public static final java.lang.String STATUS_TIMEOUT
        Timeout of a signature
        See Also:
        Constant Field Values
      • STATUS_DECLINED

        public static final java.lang.String STATUS_DECLINED
        A signer has declined to sign
        See Also:
        Constant Field Values
      • STATUS_CANCELED

        public static final java.lang.String STATUS_CANCELED
        The sender canceled the envelope before it was completed
        See Also:
        Constant Field Values
      • STATUS_SIGNED

        public static final java.lang.String STATUS_SIGNED
        Document signed
        See Also:
        Constant Field Values
      • STATUS_COMPLETED

        public static final java.lang.String STATUS_COMPLETED
        Completed once all of the recipients have completed their actions
        See Also:
        Constant Field Values
      • STATUS_UNKNOWN

        public static final java.lang.String STATUS_UNKNOWN
        Unknown status
        See Also:
        Constant Field Values
    • Constructor Detail

      • DocSignProvider

        public DocSignProvider()
    • Method Detail

      • send

        public final java.lang.String send​(DocSignProvider.DocSignAccount account,
                                           java.lang.String subject,
                                           java.lang.String pdfPath,
                                           java.lang.String pdfName,
                                           java.lang.String signerEmail,
                                           java.lang.String signerName,
                                           java.lang.String signerAnchor,
                                           java.lang.String object)
        Send one document to one signer
        Parameters:
        account - API account data
        subject - Email subject
        pdfPath - Path to PDF document
        pdfName - Name of file
        signerEmail - Signer email
        signerName - Signer full name
        signerAnchor - Anchor to localize the signature
        object - Related object for callback
        Returns:
        envelope ID to store for further usage (web-hook or call)
      • send

        public java.lang.String send​(DocSignProvider.DocSignAccount account,
                                     java.lang.String subject,
                                     java.util.List<java.lang.String> pdfPaths,
                                     java.util.List<java.lang.String> pdfNames,
                                     java.util.List<java.lang.String> signerEmails,
                                     java.util.List<java.lang.String> signerNames,
                                     java.util.List<java.util.List<java.lang.String>> signerAnchors,
                                     java.util.List<java.util.List<java.lang.String>> initialAnchors,
                                     java.lang.String object)
        Send documents to signers
        Parameters:
        account - API account data
        subject - Email subject (truncated to 100)
        pdfPaths - Paths to PDF document
        pdfNames - Names of file
        signerEmails - Signers email
        signerNames - Signers full name
        signerAnchors - Anchors to localize the signature per document and signer (null if none)
        initialAnchors - Optional anchors to localize the initials per document and signer (null if none)
        object - Related object with hook "docuSign"
        Returns:
        envelope ID to store for further usage (web-hook or call)
      • send

        public abstract java.lang.String send​(DocSignProvider.DocSignAccount account,
                                              java.lang.String subject,
                                              java.util.List<java.lang.String> pdfPaths,
                                              java.util.List<java.lang.String> pdfNames,
                                              java.util.List<java.lang.String> signerEmails,
                                              java.util.List<java.lang.String> signerNames,
                                              java.util.List<java.util.List<java.lang.String>> signerAnchors,
                                              java.util.List<java.util.List<java.lang.String>> initialAnchors,
                                              java.util.List<java.util.List<java.lang.String>> stampAnchors,
                                              java.lang.String object)
        Send documents to signers
        Parameters:
        account - API account data
        subject - Email subject (truncated to 100)
        pdfPaths - Paths to PDF document
        pdfNames - Names of file
        signerEmails - Signers email
        signerNames - Signers full name
        signerAnchors - Anchors to localize the signature per document and signer (null if none)
        initialAnchors - Optional anchors to localize the initials per document and signer (null if none)
        stampAnchors - Optional anchor to localize the stamps per document and signer (null if none)
        object - Related object with hook "docuSign"
        Returns:
        envelope ID to store for further usage (web-hook or call)
      • cancelDocument

        public abstract boolean cancelDocument​(DocSignProvider.DocSignAccount account,
                                               java.lang.String envelopeId,
                                               java.lang.String voidedReason)
        Cancel an envelope
        Parameters:
        account - API account
        envelopeId - DocuSign envelop ID
        voidedReason - Optional reason
        Returns:
        true if successful
      • webhook

        public void webhook​(java.io.InputStream in)
                     throws java.io.IOException
        Web-hook callback: call the web hook of target object from public servlet
        Parameters:
        in - Input stream
        Throws:
        java.io.IOException
      • webhook

        public static void webhook​(DocSignProvider.DocSignStatus data)
        Web-hook callback: call the web hook of target object from public servlet
        Parameters:
        data - Event data
      • getDocument

        public final DocSignProvider.DocSignStatus getDocument​(java.lang.String envelopeId,
                                                               boolean withDocs)
        Call with current document status
        Parameters:
        envelopeId - Envelope ID
        withDocs - Get the joined files (slower)
        Returns:
        DocuSign status
      • getDocument

        public abstract DocSignProvider.DocSignStatus getDocument​(Grant g,
                                                                  java.lang.String envelopeId,
                                                                  boolean withDocs)
        Call with current document status
        Parameters:
        g - Grant
        envelopeId - Envelope ID
        withDocs - Get the joined files (slower)
        Returns:
        DocuSign status
      • authent

        public abstract DocSignProvider.DocSignAccount authent​(Grant g)
                                                        throws javax.security.auth.login.LoginException
        Manage the provider authent to get account infos
        Parameters:
        g - Grant
        Throws:
        javax.security.auth.login.LoginException
      • getInstance

        public static DocSignProvider getInstance​(java.lang.String provider)
        Get isolated instance of DocSignProvider
        Parameters:
        provider - PROVIDER_*
        Returns:
        Isolated instance of DocSignProvider