CSharp XD* and Client API Architecture and Plan

From Direct Project
Jump to navigation Jump to search

Overview


The Direct Client operates on a high-level API based on an object model representation of DocumentPackage and Document, with specific properties corresponding to XD* metadata attributes, and a lower level API based on the ebXML representation of the ebRIM.

At either level, the Client API needs to accomplish three actions:

  1. Identify, by Direct address, which mechanism (SMTP + RFC5322 + XDM or XDR) should be used to for transport
  2. Assemble the package
  3. Send the package



Transport Resolution


The Client works off an interface for transport resolution:

public interface ITransportResolver
{

    public ITransport<T> Resolve( NHINDirectAddress address );

}


Provides a configured ITransport<T> instance.

public interface ITransport<T>
{
   public IPackager Packager;
   public void Send( T obj );
}


That is, given an address, tell me the transport for that address, and let me use the transport to send the underlying package.

Package Assembly


public interface IPackager<T>
{
    T Package(DocumentPackage package);
    DocumentPackage Unpackage( T obj );
}



Plan


  1. An XDM Zip File packager exists. It needs some additional work:
    1. Doesn't create file extension for documents (ideally, default file extensions based on content type)
    2. DocumentMetadata assumes text is binary encoded in UTF-8 but no checking is done for text items in the XDM package (ideally, would detect encoding or support pluggable encodings)
    3. Only supports one submission set on unpackage
  2. We need an XDR SOAP packager/unpackager and sender
  3. We need an RFC 5322 packager and unpackager
    1. Needs to detect if there's an XDM attachment
  4. Need to write the transport resolver and plug it into the configuration back-end
  5. Need to write the transport mechanisms