private static String validateDestination(
            final JsMessagingEngine messagingEngine, final String busName,
            final String destinationName, final DestinationType destinationType)
            throws NotSupportedException, ResourceAdapterInternalException {

        final String methodName = "validateDestination";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(TRACE, methodName, new Object[] { messagingEngine,
                    busName, destinationName, destinationType });
        }

        /*
         * The destination may contain a null bus name so, for clarity in
         * messages, use the name from the messaging engine if this is the case
         */
        final String resolvedBusName = (((busName == null) || ""
                .equals(busName)) ? messagingEngine.getBusName() : busName);

        final String uuid;

        try {

            /*
             * Obtain destination definition
             */

            final BaseDestinationDefinition destinationDefinition = messagingEngine
                    .getSIBDestination(busName, destinationName);

            /*
             * Foreign destinations are not supported
             */

            if (destinationDefinition.isForeign()) {

                throw new NotSupportedException(NLS.getFormattedMessage(
                        ("FOREIGN_DESTINATION_CWSIV0754"), new Object[] {
                                destinationName, resolvedBusName }, null));

            }

            if (destinationDefinition.isLocal()) {

                /*
                 * Local destinations must be of the correct type
                 */

                final DestinationDefinition localDefinition = (DestinationDefinition) destinationDefinition;

                if (destinationType
                        .equals(localDefinition.getDestinationType())) {

                    uuid = destinationDefinition.getUUID().toString();

                } else {

                    /*
                     * The destination resolved to the wrong type
                     */

                    throw new NotSupportedException(NLS.getFormattedMessage(
                            ("INCORRECT_TYPE_CWSIV0755"), new Object[] {
                                    destinationName, resolvedBusName,
                                    destinationType,
                                    localDefinition.getDestinationType() },
                            null));

                }

            } else if (destinationDefinition.isAlias()) {

                /*
                 * Recursively check an alias destination
                 */

                final DestinationAliasDefinition aliasDefinition = (DestinationAliasDefinition) destinationDefinition;
                uuid = validateDestination(messagingEngine, aliasDefinition
                        .getTargetBus(), aliasDefinition.getTargetName(),
                        destinationType);

            } else {

                /*
                 * Unknown destination type
                 */

                throw new ResourceAdapterInternalException(
                        NLS
                                .getFormattedMessage(
                                        ("UNKNOWN_TYPE_CWSIV0756"),
                                        new Object[] { destinationName,
                                                resolvedBusName }, null));

            }

        } catch (final SIBExceptionDestinationNotFound exception) {

            FFDCFilter.processException(exception, CLASS_NAME + "."
                    + methodName, FFDC_PROBE_1);
            if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled()) {
                SibTr.exception(TRACE, exception);
            }
            throw new NotSupportedException(NLS.getFormattedMessage(
                    ("NOT_FOUND_CWSIV0757"), new Object[] { destinationName,
                            resolvedBusName }, null), exception);

        } catch (final SIBExceptionBase exception) {

            FFDCFilter.processException(exception, CLASS_NAME + "."
                    + methodName, FFDC_PROBE_2);
            if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled()) {
                SibTr.exception(TRACE, exception);
            }
            throw new ResourceAdapterInternalException(NLS
                    .getFormattedMessage(("UNEXPECTED_EXCEPTION_CWSIV0758"),
                            new Object[] { destinationName, resolvedBusName,
                                    exception }, null), exception);

        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(TRACE, methodName, uuid);
        }
        return uuid;

    }
private static String validateDestination ( final JsMessagingEngine messagingEngine , final String busName , final String destinationName , final DestinationType destinationType ) throws NotSupportedException , ResourceAdapterInternalException { final String methodName = "validateDestination" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( TRACE , methodName , new Object [ ] { messagingEngine , busName , destinationName , destinationType } ) ; } final String resolvedBusName = ( ( ( busName == null ) || "" . equals ( busName ) ) ? messagingEngine . getBusName ( ) : busName ) ; final String uuid ; try { final BaseDestinationDefinition destinationDefinition = messagingEngine . getSIBDestination ( busName , destinationName ) ; if ( destinationDefinition . isForeign ( ) ) { throw new NotSupportedException ( NLS . getFormattedMessage ( ( "FOREIGN_DESTINATION_CWSIV0754" ) , new Object [ ] { destinationName , resolvedBusName } , null ) ) ; } if ( destinationDefinition . isLocal ( ) ) { final DestinationDefinition localDefinition = ( DestinationDefinition ) destinationDefinition ; if ( destinationType . equals ( localDefinition . getDestinationType ( ) ) ) { uuid = destinationDefinition . getUUID ( ) . toString ( ) ; } else { throw new NotSupportedException ( NLS . getFormattedMessage ( ( "INCORRECT_TYPE_CWSIV0755" ) , new Object [ ] { destinationName , resolvedBusName , destinationType , localDefinition . getDestinationType ( ) } , null ) ) ; } } else if ( destinationDefinition . isAlias ( ) ) { final DestinationAliasDefinition aliasDefinition = ( DestinationAliasDefinition ) destinationDefinition ; uuid = validateDestination ( messagingEngine , aliasDefinition . getTargetBus ( ) , aliasDefinition . getTargetName ( ) , destinationType ) ; } else { throw new ResourceAdapterInternalException ( NLS . getFormattedMessage ( ( "UNKNOWN_TYPE_CWSIV0756" ) , new Object [ ] { destinationName , resolvedBusName } , null ) ) ; } } catch ( final SIBExceptionDestinationNotFound exception ) { FFDCFilter . processException ( exception , CLASS_NAME + "." + methodName , FFDC_PROBE_1 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEventEnabled ( ) ) { SibTr . exception ( TRACE , exception ) ; } throw new NotSupportedException ( NLS . getFormattedMessage ( ( "NOT_FOUND_CWSIV0757" ) , new Object [ ] { destinationName , resolvedBusName } , null ) , exception ) ; } catch ( final SIBExceptionBase exception ) { FFDCFilter . processException ( exception , CLASS_NAME + "." + methodName , FFDC_PROBE_2 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEventEnabled ( ) ) { SibTr . exception ( TRACE , exception ) ; } throw new ResourceAdapterInternalException ( NLS . getFormattedMessage ( ( "UNEXPECTED_EXCEPTION_CWSIV0758" ) , new Object [ ] { destinationName , resolvedBusName , exception } , null ) , exception ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( TRACE , methodName , uuid ) ; } return uuid ; }
Validates the given destination information with administration.

@param messagingEngine
the messaging engine with which to validate
@param busName
the name of the bus for the destination
@param destinationName
the name of the destination
@param destinationType
the type of the destination
@return the UUID for the destination if valid
@throws NotSupportedException
if the destination does not exist, is foreign, is of the
incorrect type or is an alias to a destination that is not
valid
@throws ResourceAdapterInternalException
if the destination definition is not of a known type of
cannot be obtained