Package be.ehealth.business.mycarenetdomaincommons.builders.impl

# Class BlobBuilderImpl

java.lang.Object
be.ehealth.business.mycarenetdomaincommons.builders.impl.BlobBuilderImpl

All Implemented Interfaces:
  `BlobBuilder`, `ConfigurableImplementation`

public class BlobBuilderImpl extends Object implements BlobBuilder
Used to build a `Blob` Implementation for the `BlobBuilder` interface. this builder is configured with the following properties :

- mycarenet.blobbuilder.{projectname}.id with the identifier string to use for the blob contents, ex : 'blob'
- mycarenet.blobbuilder.{projectname}.encodingtype with the encoding to use ex : 'none'
- mycarenet.blobbuilder.{projectname}.contenttype with the type of the content : ex : 'text/xml'

where projectName is either

- the given projectname ( in that case the property mycarenet.blobbuilder.{projectname}.usedefaultproperties should have the value false)
- or "default"

- ## Field Summary

  ### Fields inherited from interface be.ehealth.business.mycarenetdomaincommons.builders.BlobBuilder

  `MESSAGE_NAME_KEY, PLATFORM_NAME_KEY, PROJECT_NAME_KEY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BlobBuilderImpl()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Blob`
  `build(byte[] input)`
  Build a `Blob`
  Properties needed : id, contenttype and encoding type
  `Blob`
  `build(byte[] input, BlobAttributeValues blobAttributes)`
  encodes the given byte array and creates Blob jaxb object.
  `Blob`
  `build(byte[] input, String id)`
  Build a `Blob`
  Properties needed : contenttype and encoding type.
  `Blob`
  `build(byte[] input, String encodingType, String id, String contentType)`
  creates `Blob` with given parameters.
  `Blob`
  `build(byte[] input, String encodingType, String id, String contentType, String messageName)`
  creates `Blob` with given parameters.
  `Blob`
  `build(byte[] input, String encodingType, String id, String contentType, String messageName, String contentEncryption)`
  creates `Blob` with given parameters.
  `Blob`
  `build(byte[] input, String encodingType, String id, String contentType, String messageName, String contentEncryption, String messageVersion)`
  `byte[]`
  `checkAndRetrieveContent(Blob blob)`
  Return the content of the blob.
  `void`
  `initialize(Map<String,Object> parameterMap)`
  Project name defined in parameters when the RequestBuilderFactory

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### BlobBuilderImpl

    public BlobBuilderImpl()

- ## Method Details

  - ### initialize

    public void initialize(Map<String,Object> parameterMap) throws TechnicalConnectorException
    Project name defined in parameters when the RequestBuilderFactory
    Specified by:
      `initialize` in interface `ConfigurableImplementation`
    Parameters:
      `parameterMap` - Map with for each propertyString ,the input parameter as Object.
    Throws:
      `TechnicalConnectorException` - if the parameterMap is not correct.
    See Also:
      - `ConfigurableImplementation.initialize(Map)`

  - ### build

    public Blob build(byte[] input) throws InvalidBlobContentConnectorException, TechnicalConnectorException
    Build a `Blob`
    Properties needed : id, contenttype and encoding type
    Specified by:
      `build` in interface `BlobBuilder`
    Parameters:
      `input` - the byte array to encode
    Returns:
    Throws:
      `InvalidBlobContentConnectorException`
      `TechnicalConnectorException`
    See Also:
      - `BlobBuilder.build(byte[])`

  - ### build

    public Blob build(byte[] input, String id) throws InvalidBlobContentConnectorException, TechnicalConnectorException
    Build a `Blob`
    Properties needed : contenttype and encoding type.
    Specified by:
      `build` in interface `BlobBuilder`
    Parameters:
      `input` - the byte array to encode
      `id` - the id given to the blob , needed when using xades
    Returns:
    Throws:
      `InvalidBlobContentConnectorException`
      `TechnicalConnectorException`
    See Also:
      - `BlobBuilder.build(byte[], String)`

  - ### build

    public Blob build(byte[] input, String encodingType, String id, String contentType) throws InvalidBlobContentConnectorException, TechnicalConnectorException
    creates `Blob` with given parameters.
    Specified by:
      `build` in interface `BlobBuilder`
    Parameters:
      `input` -
      `encodingType` -
      `id` -
      `contentType` -
    Returns:
    Throws:
      `TechnicalConnectorException`
      `InvalidBlobContentConnectorException`

  - ### build

    public Blob build(byte[] input, String encodingType, String id, String contentType, String messageName) throws InvalidBlobContentConnectorException, TechnicalConnectorException
    creates `Blob` with given parameters.
    Specified by:
      `build` in interface `BlobBuilder`
    Parameters:
      `input` - the byte array to encode
      `encodingType` - the type of encoding used , see cookbook
      `id` - the id given to the blob , needed when using xades
      `contentType` - the contentType
      `messageName` - the messageName
    Returns:
    Throws:
      `InvalidBlobContentConnectorException`
      `TechnicalConnectorException`
    See Also:
      - `BlobBuilder.build(byte[], String, String, String, String)`

  - ### build

    public Blob build(byte[] input, String encodingType, String id, String contentType, String messageName, String contentEncryption) throws InvalidBlobContentConnectorException, TechnicalConnectorException
    creates `Blob` with given parameters.
    Specified by:
      `build` in interface `BlobBuilder`
    Parameters:
      `input` - the byte array to encode
      `encodingType` - the type of encoding used , see cookbook
      `id` - the id given to the blob , needed when using xades
      `contentType` - the contentType
      `messageName` - the messageName
      `contentEncryption` - the contentEncryption
    Returns:
    Throws:
      `InvalidBlobContentConnectorException`
      `TechnicalConnectorException`
    See Also:
      - `BlobBuilder.build(byte[], String, String, String, String, String)`

  - ### build

    public Blob build(byte[] input, String encodingType, String id, String contentType, String messageName, String contentEncryption, String messageVersion) throws InvalidBlobContentConnectorException, TechnicalConnectorException
    Specified by:
      `build` in interface `BlobBuilder`
    Throws:
      `InvalidBlobContentConnectorException`
      `TechnicalConnectorException`

  - ### build

    public Blob build(byte[] input, BlobAttributeValues blobAttributes) throws TechnicalConnectorException
    Description copied from interface: `BlobBuilder`
    encodes the given byte array and creates Blob jaxb object.
    Specified by:
      `build` in interface `BlobBuilder`
    Parameters:
      `input` - the byte array to encode
      `blobAttributes` - the attributes of the blob element
    Returns:
    Throws:
      `TechnicalConnectorException`

  - ### checkAndRetrieveContent

    public byte[] checkAndRetrieveContent(Blob blob) throws TechnicalConnectorException
    Return the content of the blob.
    Specified by:
      `checkAndRetrieveContent` in interface `BlobBuilder`
    Parameters:
      `blob` -
    Returns:
    Throws:
      `TechnicalConnectorException`
      `InvalidBlobContentConnectorException`