Class CmisSender

All Implemented Interfaces:
FrankElement, HasApplicationContext, HasName, IConfigurable, IScopeProvider, ISender, ISenderWithParameters, IWithParameters, NameAware, HasKeystore, HasTruststore, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle

@Forward(name="notFound", description="if the requested object could not be found for actions GET, UPDATE and DELETE") public class CmisSender extends AbstractSenderWithParameters implements HasKeystore, HasTruststore
Sender to obtain information from and write to a CMIS application.

When action=get the input (xml string) indicates the id of the document to get. This input is mandatory.

Example:


 <cmis>
     <id>documentId</id>
 </cmis>
 

When action=delete the input (xml string) indicates the id of the document to get. This input is mandatory.

Example:


 <cmis>
     <id>documentId</id>
 </cmis>
 

When action=create the input (xml string) indicates document properties to set. This input is optional.

Example:


 <cmis>
     <name>Offerte</name>
     <objectTypeId>NNB_Geldlening</objectTypeId>
     <mediaType>application/pdf</mediaType>
     <properties>
         <property name="ArrivedAt" type="datetime" formatString="yyyy-MM-dd'T'HH:mm:ss.SSSz">2014-11-27T16:43:01.268+0100</property>
         <property name="ArrivedBy">HDN</property>
         <property name="DocumentType">Geldlening</property>
     </properties>
 </cmis>
 

attributesdescriptiondefault
namemandatory property "cmis:name". If not set the sender attribute fileNameSessionKey is used"[unknown]"
objectTypeIdmandatory property "cmis:objectTypeId""cmis:document"
mediaTypethe MIME type of the document to store"application/octet-stream"
propertycustom document property to set. Possible attributes:
namedescriptiondefault
type
  • string: renders the value
  • datetime: converts the value to a Date, by default using formatString yyyy-MM-dd HH:mm:ss
string
formatStringused in combination with datetimeyyyy-MM-dd HH:mm:ss
 

When action=find the input (xml string) indicates the query to perform.

Example:


 <query>
    <statement>select * from cmis:document</statement>
    <maxItems>10</maxItems>
    <skipCount>0</skipCount>
    <searchAllVersions>true</searchAllVersions>
    <includeAllowableActions>true</includeAllowableActions>
 </query
 

When action=update the input (xml string) indicates document properties to update.

Example:


 <cmis>
    <id>123456789</id>
    <properties>
       <property name="ArrivedAt" type="datetime" formatString="yyyy-MM-dd'T'HH:mm:ss.SSSz">2014-11-27T16:43:01.268+0100</property>
       <property name="ArrivedBy">HDN</property>
       <property name="DocumentType">Geldlening</property>
       <property name="DocumentDetail" isNull="true" />
    </properties>
 </cmis>
 

attributesdescriptiondefault
idmandatory property "cmis:objectId" which indicates the document to update 
propertycustom document property to update. See action=create for possible attributes 

Author:
Peter Leeuwenburgh, Niels Meijer
Specific parameters
authAlias overrides authAlias specified by the attribute authAlias, username overrides username specified by the attribute username, password overrides password specified by the attribute password
  • Field Details

  • Constructor Details

    • CmisSender

      public CmisSender()
  • Method Details

    • configure

      public void configure() throws ConfigurationException
      Description copied from interface: IConfigurable
      Configure this component.

      configure() is called once at startup of the framework in the configure method of the owner of this IConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in the configure(), to improve performance.

      In the case of a container, this will propagate the configure signal to all components that apply.

      Specified by:
      configure in interface IConfigurable
      Overrides:
      configure in class AbstractSenderWithParameters
      Throws:
      ConfigurationException - in case it was not able to configure the component.
    • createCmisSession

      public CloseableCmisSession createCmisSession(ParameterValueList pvl) throws SenderException
      Creates a session during JMV runtime, tries to retrieve parameters and falls back on the defaults when they can't be found
      Throws:
      SenderException
    • getSessionBuilder

      protected CmisSessionBuilder getSessionBuilder()
    • start

      public void start()
      Description copied from interface: ISender
      This method will be called to start the sender. After this method is called the sendMessage method may be called. Purpose of this method is to reduce creating connections to databases etc. in the sendMessage() method.
      Specified by:
      start in interface ISender
      Specified by:
      start in interface org.springframework.context.Lifecycle
      Overrides:
      start in class AbstractSender
    • stop

      public void stop()
      Description copied from interface: ISender
      Stop/close the sender and deallocate resources.
      Specified by:
      stop in interface ISender
      Specified by:
      stop in interface org.springframework.context.Lifecycle
      Overrides:
      stop in class AbstractSender
    • sendMessage

      @Nonnull public SenderResult sendMessage(@Nonnull Message message, @Nonnull PipeLineSession session) throws SenderException, TimeoutException
      Description copied from interface: ISender
      Send a message to some destination (as configured in the Sender object). This method may only be called after the configure() method is called.

      The following table shows the difference between synchronous and a-synchronous senders:

       synchronousa-synchronous
      ISender.isSynchronous() returnstruefalse
      return value of sendMessage() isthe reply-messagethe messageId of the message sent
      the correlationID specified with sendMessage()may be ignoredis sent with the message
      a {link TimeOutException}may be thrown if a timeout occurs waiting for a replyshould not be expected

      Multiple objects may try to call this method at the same time, from different threads. Implementations of this method should therefore be thread-safe, or synchronized.

      Specified by:
      sendMessage in interface ISender
      Throws:
      SenderException
      TimeoutException
    • setAction

      @Mandatory public void setAction(CmisSender.CmisAction action)
      Specifies action to perform
    • setMaxConnections

      public void setMaxConnections(int i)
      The maximum number of concurrent connections
      Default value
      10
    • setTimeout

      public void setTimeout(int i)
      READ_TIMEOUT timeout in MS. Defaults to 10000, inherited from HttpSender#setTimeout.
      Default value
      10000
    • setUrl

      public void setUrl(String url)
      URL to connect to
    • setRepository

      public void setRepository(String repository)
      Repository ID
    • setAuthAlias

      public void setAuthAlias(String authAlias)
      Alias used to obtain credentials for authentication to host
    • setUsername

      public void setUsername(String username)
      Username used in authentication to host
    • setPassword

      public void setPassword(String password)
      Password used in authentication to host
    • setBindingType

      @Mandatory public void setBindingType(CmisSessionBuilder.BindingTypes bindingType)
      BindingType CMIS protocol to use
    • setFileSessionKey

      public void setFileSessionKey(String string)
      If action=create the sessionKey that contains the file to use. If action=get and getProperties=true the sessionKey to store the result in
    • setFilenameSessionKey

      public void setFilenameSessionKey(String string)
      If action=create the session key that contains the name of the file to use. If not set, the value of the property filename from the input message is used
    • setDefaultMediaType

      public void setDefaultMediaType(String string)
      If action=create the mime type used to store the document when it's not set in the input message by a property
      Default value
      'application/octet-stream'
    • setGetProperties

      public void setGetProperties(boolean b)
      (Only used when action=get). If true, the content of the document is put to FileSessionKey and all document properties are put in the result as a xml string
      Default value
      false
    • setGetDocumentContent

      public void setGetDocumentContent(boolean getDocumentContent)
      (Only used when action=get). If true, the attachment for the document is the sender result or, if set, stored in fileSessionKey. If false, only the properties are returned
      Default value
      true
    • setUseRootFolder

      public void setUseRootFolder(boolean b)
      (Only used when action=create). If true, the document is created in the root folder of the repository. Otherwise the document is created in the repository
      Default value
      true
    • setResultOnNotFound

      @Deprecated(forRemoval=true, since="7.9.0") @ConfigurationWarning("configure forward \'notFound\' instead") public void setResultOnNotFound(String string)
      Deprecated, for removal: This API element is subject to removal in a future version.
      (Only used when action=get) result returned when no document was found for the given id (e.g. '[not_found]'). If empty then 'notFound' is returned as forward name
    • setKeepSession

      public void setKeepSession(boolean keepSession)
      If true, the session is not closed at the end and it will be used in the next call
      Default value
      true
    • setOverrideEntryPointWSDL

      public void setOverrideEntryPointWSDL(String overrideEntryPointWSDL)
      Override entrypoint WSDL by reading it from the classpath, overrides url attribute
    • setKeystore

      public void setKeystore(String keystore)
      Description copied from interface: HasKeystore
      Resource url to keystore or certificate. If none specified, the JVMs default keystore will be used.
      Specified by:
      setKeystore in interface HasKeystore
    • getKeystore

      public String getKeystore()
      Specified by:
      getKeystore in interface HasKeystore
    • setKeystoreType

      public void setKeystoreType(KeystoreType keystoreType)
      Description copied from interface: HasKeystore
      Type of keystore
      Specified by:
      setKeystoreType in interface HasKeystore
    • getKeystoreType

      public KeystoreType getKeystoreType()
      Specified by:
      getKeystoreType in interface HasKeystore
    • setKeystoreAuthAlias

      public void setKeystoreAuthAlias(String keystoreAuthAlias)
      Description copied from interface: HasKeystore
      Authentication alias used to obtain keystore password
      Specified by:
      setKeystoreAuthAlias in interface HasKeystore
    • getKeystoreAuthAlias

      public String getKeystoreAuthAlias()
      Specified by:
      getKeystoreAuthAlias in interface HasKeystore
    • setKeystorePassword

      public void setKeystorePassword(String keystorePassword)
      Description copied from interface: HasKeystore
      Default password to access keystore
      Specified by:
      setKeystorePassword in interface HasKeystore
    • getKeystorePassword

      public String getKeystorePassword()
      Specified by:
      getKeystorePassword in interface HasKeystore
    • setKeystoreAlias

      public void setKeystoreAlias(String keystoreAlias)
      Description copied from interface: HasKeystore
      Alias to obtain specific certificate or key in keystore
      Specified by:
      setKeystoreAlias in interface HasKeystore
    • getKeystoreAlias

      public String getKeystoreAlias()
      Specified by:
      getKeystoreAlias in interface HasKeystore
    • setKeystoreAliasAuthAlias

      public void setKeystoreAliasAuthAlias(String keystoreAliasAuthAlias)
      Description copied from interface: HasKeystore
      Authentication alias to authenticate access to certificate or key indicated by keystoreAlias
      Specified by:
      setKeystoreAliasAuthAlias in interface HasKeystore
    • getKeystoreAliasAuthAlias

      public String getKeystoreAliasAuthAlias()
      Specified by:
      getKeystoreAliasAuthAlias in interface HasKeystore
    • setKeystoreAliasPassword

      public void setKeystoreAliasPassword(String keystoreAliasPassword)
      Description copied from interface: HasKeystore
      Default password to authenticate access to certificate or key indicated by keystoreAlias
      Specified by:
      setKeystoreAliasPassword in interface HasKeystore
    • getKeystoreAliasPassword

      public String getKeystoreAliasPassword()
      Specified by:
      getKeystoreAliasPassword in interface HasKeystore
    • setKeyManagerAlgorithm

      public void setKeyManagerAlgorithm(String keyManagerAlgorithm)
      Description copied from interface: HasKeystore
      Key manager algorithm. Can be left empty to use the servers default algorithm
      Specified by:
      setKeyManagerAlgorithm in interface HasKeystore
    • getKeyManagerAlgorithm

      public String getKeyManagerAlgorithm()
      Specified by:
      getKeyManagerAlgorithm in interface HasKeystore
    • setTruststore

      public void setTruststore(String truststore)
      Description copied from interface: HasTruststore
      Resource url to truststore. If none specified, the JVMs default truststore will be used.
      Specified by:
      setTruststore in interface HasTruststore
    • getTruststore

      public String getTruststore()
      Specified by:
      getTruststore in interface HasTruststore
    • setTruststoreType

      public void setTruststoreType(KeystoreType truststoreType)
      Description copied from interface: HasTruststore
      Type of truststore
      Specified by:
      setTruststoreType in interface HasTruststore
    • getTruststoreType

      public KeystoreType getTruststoreType()
      Specified by:
      getTruststoreType in interface HasTruststore
    • setTruststoreAuthAlias

      public void setTruststoreAuthAlias(String truststoreAuthAlias)
      Description copied from interface: HasTruststore
      Authentication alias used to obtain truststore password
      Specified by:
      setTruststoreAuthAlias in interface HasTruststore
    • getTruststoreAuthAlias

      public String getTruststoreAuthAlias()
      Specified by:
      getTruststoreAuthAlias in interface HasTruststore
    • setTruststorePassword

      public void setTruststorePassword(String truststorePassword)
      Description copied from interface: HasTruststore
      Default password to access truststore
      Specified by:
      setTruststorePassword in interface HasTruststore
    • getTruststorePassword

      public String getTruststorePassword()
      Specified by:
      getTruststorePassword in interface HasTruststore
    • setTrustManagerAlgorithm

      public void setTrustManagerAlgorithm(String trustManagerAlgorithm)
      Description copied from interface: HasTruststore
      Trust manager algorithm. Can be left empty to use the servers default algorithm
      Specified by:
      setTrustManagerAlgorithm in interface HasTruststore
    • getTrustManagerAlgorithm

      public String getTrustManagerAlgorithm()
      Specified by:
      getTrustManagerAlgorithm in interface HasTruststore
    • setVerifyHostname

      @Unsafe public void setVerifyHostname(boolean verifyHostname)
      Description copied from interface: HasTruststore
      If true, the hostname in the certificate will be checked against the actual hostname of the peer
      Specified by:
      setVerifyHostname in interface HasTruststore
    • isVerifyHostname

      public boolean isVerifyHostname()
      Specified by:
      isVerifyHostname in interface HasTruststore
    • setAllowSelfSignedCertificates

      @Unsafe public void setAllowSelfSignedCertificates(boolean testModeNoCertificatorCheck)
      Description copied from interface: HasTruststore
      If true, self signed certificates are accepted
      Specified by:
      setAllowSelfSignedCertificates in interface HasTruststore
    • isAllowSelfSignedCertificates

      public boolean isAllowSelfSignedCertificates()
      Specified by:
      isAllowSelfSignedCertificates in interface HasTruststore
    • setIgnoreCertificateExpiredException

      @Unsafe public void setIgnoreCertificateExpiredException(boolean ignoreCertificateExpiredException)
      Description copied from interface: HasTruststore
      If true, CertificateExpiredExceptions are ignored
      Specified by:
      setIgnoreCertificateExpiredException in interface HasTruststore
    • isIgnoreCertificateExpiredException

      public boolean isIgnoreCertificateExpiredException()
      Specified by:
      isIgnoreCertificateExpiredException in interface HasTruststore
    • setProxyHost

      public void setProxyHost(String proxyHost)
      Proxy host url
    • setProxyPort

      public void setProxyPort(int proxyPort)
      Proxy host port
      Default value
      80
    • setProxyAuthAlias

      public void setProxyAuthAlias(String proxyAuthAlias)
      Alias used to obtain credentials for authentication to proxy
    • setProxyUsername

      public void setProxyUsername(String proxyUsername)
      Proxy Username
    • setProxyPassword

      public void setProxyPassword(String proxyPassword)
      Proxy Password