com.sap.core.connectivity.api

## Interface DestinationFactory

-     public interface DestinationFactory

  `DestinationFactory` is used to access the connectivity destinations. An instance of `DestinationFactory` can be accessed using JNDI lookup using the following code snippet :

       javax.naming.Context ctx = new javax.naming.InitialContext();
       DestinationFactory destinationFactory = (DestinationFactory) ctx.lookup(DestinationFactory.JNDI_NAME);

  `DestinationFactory` is registered as an OSGi Service with interface `com.sap.core.connectivity.api.DestinationFactory`. OSGi based components can access it from the OSGi service registry.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `JNDI_NAME` Constant which is used to lookup the `DestinationFactory` from JNDI.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T extends Destination> T` | `getDestination(String destinationName)`

- - ### Field Detail

    - #### JNDI_NAME

          static final String JNDI_NAME

      Constant which is used to lookup the `DestinationFactory` from JNDI.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getDestination

          <T extends Destination> T getDestination(String destinationName)
                                               throws DestinationNotFoundException

      Parameters:
        `destinationName` - the name of the destination. The name must match the following pattern: "^[A-Za-z0-9-_]{1,200}$".
      Returns:
        a destination object, if a destination with the provided name has been configured.
      Throws:
        `DestinationNotFoundException` - if a destination with the provided name is not found.
        `IllegalArgumentException` - if the name doesn't match the pattern or the `Destination` cannot be created due to a configuration issue.
        `IllegalStateException` - if there are problems to get the destination.

Copyright © 2018 SAP. All Rights Reserved.