All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openas2.Session Maven / Gradle / Ivy

Go to download

Open source implementation of the AS2 standard for signed encrypted and compressed document transfer

There is a newer version: 2.10.1
Show newest version
package org.openas2;

import java.util.Map;

import org.openas2.cert.CertificateFactory;
import org.openas2.partner.PartnershipFactory;
import org.openas2.processor.Processor;


/**
 * The Session interface provides configuration and resource information, and a means for
 * components to access the functionality of other components.
 * The Session has its own lifecycle controlled by two methods {@link #start()} and {@link #stop()}.
 *
 * @author Aaron Silinskas
 * @see Component
 * @see org.openas2.cert.CertificateFactory
 * @see org.openas2.partner.PartnershipFactory
 * @see org.openas2.processor.Processor
 */
public interface Session {

    String DEFAULT_CONTENT_TRANSFER_ENCODING = "binary";
    String LOG_LEVEL_OVERRIDE_KEY = "logging.level.override";

    /**
     * Lifecycle control method.
     *
     * @throws Exception - - Houston we have a problem
     */
    void start() throws Exception;

    /**
     * Lifecycle control method.
     *
     * @throws Exception - - Houston we have a problem
     */
    void stop() throws Exception;

    /**
     * Short-cut method to retrieve a certificate factory.
     *
     * @return the currently registered CertificateFactory component
     * @throws ComponentNotFoundException If a CertificateFactory component has not been
     *                           registered
     * @see CertificateFactory
     * @see Component
     */
    CertificateFactory getCertificateFactory() throws ComponentNotFoundException;

    /**
     * Gets the Component currently registered with an ID
     *
     * @param componentID ID to search for
     * @return the component registered to the ID or null
     * @throws ComponentNotFoundException If a component is not registered with the ID
     */
    Component getComponent(String componentID) throws ComponentNotFoundException;

    /**
     * Return a map of component ID's to Component objects.
     *
     * @return all registered components, mapped by ID
     */
    Map getComponents();

    /**
     * Short-cut method to retrieve a partner factory.
     *
     * @return the currently registered PartnerFactory component
     * @throws ComponentNotFoundException If a PartnerFactory component has not been registered
     * @see PartnershipFactory
     * @see Component
     */
    PartnershipFactory getPartnershipFactory() throws ComponentNotFoundException;

    /**
     * Short-cut method to retrieve a processor.
     *
     * @return the currently registered Processor component
     * @throws ComponentNotFoundException If a Processor component has not been registered
     * @see Processor
     * @see Component
     */
    Processor getProcessor() throws ComponentNotFoundException;

    String getBaseDirectory();

    String getAppVersion();

    String getAppTitle();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy