/* (non-Javadoc)
@see com.ibm.wsspi.sib.core.DestinationSession#getDestinationAddress()
552669
public SIDestinationAddress getDestinationAddress()
  {
    if (TraceComponent.isAnyTracingEnabled() && CoreSPIBrowserSession.tc.isEntryEnabled())
    {    
      SibTr.entry(CoreSPIBrowserSession.tc, "getDestinationAddress", this);    
      SibTr.exit(CoreSPIBrowserSession.tc, "getDestinationAddress", _destinationAddress);
    }
    return _destinationAddress;
  }
119195
@Override
    public EndpointReferenceType getAddressWithId(String id) {
        EndpointReferenceType ref = null;

        if (isMultiplexWithAddress()) {
            String address = EndpointReferenceUtils.getAddress(reference);
            ref = EndpointReferenceUtils.duplicate(reference);
            if (address.endsWith("/")) {
                EndpointReferenceUtils.setAddress(ref, address + id);
            } else {
                EndpointReferenceUtils.setAddress(ref, address + "/" + id);
            }
        } else {
            ref = super.getAddressWithId(id);
        }
        return ref;
    }
1361740
public LocalizationDefinition getDestinationLocalizationDefinition(String destinationUuid) throws SINotPossibleInCurrentConfigurationException 
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getDestinationLocalizationDefinition", destinationUuid);

    checkStarted();
    
    LocalizationDefinition localizationDefinition = null;
    DestinationHandler destinationHandler = null;

    try
    {
      destinationHandler = destinationManager.getDestination(new SIBUuid12(destinationUuid), false);
    }
    catch (SITemporaryDestinationNotFoundException e)
    {
      // No FFDC code needed 
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getDestinationLocalizationDefinition", "SINotPossibleInCurrentConfigurationException");
      throw new SINotPossibleInCurrentConfigurationException(e.getMessage());
    }
    
    if(destinationHandler.isPubSub())
    {
      PubSubMessageItemStream pubSubMessageItemStream = destinationHandler.getPublishPoint();
      if (pubSubMessageItemStream != null)
      {
        localizationDefinition = pubSubMessageItemStream.getLocalizationDefinition();
      }
    }    
    else
    {
      PtoPLocalMsgsItemStream ptoPLocalMsgsItemStream = null;
      
      if ((!destinationHandler.isAlias()) && (!destinationHandler.isForeign()))
      {
        ptoPLocalMsgsItemStream = (PtoPLocalMsgsItemStream) destinationHandler.getQueuePoint(messageProcessor.getMessagingEngineUuid());
        if (ptoPLocalMsgsItemStream != null)
        {
          localizationDefinition = ptoPLocalMsgsItemStream.getLocalizationDefinition();
        }
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getDestinationLocalizationDefinition", localizationDefinition);
     
    //TODO - return clone.  Cant do till admin implement clone() method (168499.21)
      
    return localizationDefinition;
  }
555973
@Override
    public InetAddress getHostAddress(Object endPoint)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getHostAddress", endPoint);

        InetAddress address = null;
        if (endPoint instanceof CFEndPoint)
        {
            address = ((CFEndPoint) endPoint).getAddress();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getHostAddress", address);
        return address;
    }
703313
private Destination resolveDestinationName(String name, Session session) throws JMSException {
        if (endpointConfiguration.getDestinationResolver() != null) {
            return endpointConfiguration.getDestinationResolver().resolveDestinationName(session, name, endpointConfiguration.isPubSubDomain());
        }

        return new DynamicDestinationResolver().resolveDestinationName(session, name, endpointConfiguration.isPubSubDomain());
    }
133646
public InetAddress
getAddress() {
	try {
		if (name == null)
			return InetAddress.getByAddress(address);
		else
			return InetAddress.getByAddress(name.toString(),
							address);
	} catch (UnknownHostException e) {
		return null;
	}
}
834614
@Override
    public void sendToExceptionDestination(
                                           SIDestinationAddress address,
                                           SIBusMessage message,
                                           int reason,
                                           String[] inserts,
                                           SITransaction tran,
                                           String alternateUser)
                    throws SIResourceException, SIConnectionLostException, SILimitExceededException,
                    SIErrorException,
                    SINotAuthorizedException,
                    SIIncorrectCallException,
                    SINotPossibleInCurrentConfigurationException
    {
        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
            SibTr.entry(CoreSPIConnection.tc, "sendToExceptionDestination",
                        new Object[] { this, address, alternateUser, message, Integer.valueOf(reason), inserts, tran });

        if (message == null)
        {
            if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
                SibTr.exit(CoreSPIConnection.tc, "sendToExceptionDestination", "SIIncorrectCallException - null msg");
            throw new SIIncorrectCallException(
                            nls_cwsir.getFormattedMessage(
                                                          "SEND_EXCEPTION_DEST_CWSIR0121",
                                                          null,
                                                          null));
        }

        // Get an exception destination instance
        ExceptionDestinationHandlerImpl exDestHandler =
                        new ExceptionDestinationHandlerImpl(address, _messageProcessor);

        exDestHandler.sendToExceptionDestination(message,
                                                 alternateUser,
                                                 (TransactionCommon) tran,
                                                 reason,
                                                 this,
                                                 inserts);

        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
            SibTr.exit(CoreSPIConnection.tc, "sendToExceptionDestination");
    }
265501
@Override
    public SIDestinationAddress createTemporaryDestination(Distribution distribution,
                                                           String destinationPrefix)

                    throws SIConnectionUnavailableException, SIConnectionDroppedException,
                    SIResourceException, SIConnectionLostException, SILimitExceededException,
                    SIErrorException,
                    SINotAuthorizedException,
                    SIInvalidDestinationPrefixException
    {
        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
            SibTr.entry(CoreSPIConnection.tc, "createTemporaryDestination",
                        new Object[] { this, destinationPrefix, distribution });

        // See if this connection has been closed
        checkNotClosed();

        // Check to make sure that the destination prefix is valid. 
        // If it's not, then we can't continue.
        String result = SICoreUtils.isDestinationPrefixValid(destinationPrefix);
        if (!result.equals(SICoreUtils.VALID)) // if its not valid there is something wrong
        {
            if (result.equals(SICoreUtils.MAX_LENGTH_EXCEEDED)) {// prefix length might have been exceeded
                if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
                    SibTr.exit(CoreSPIConnection.tc, "createTemporaryDestination", "SIInvalidDestinationPrefixException");
                throw new SIInvalidDestinationPrefixException(
                                nls.getFormattedMessage(
                                                        "INVALID_DESTINATION_PREFIX_MAX_LENGTH_ERROR_CWSIP0039",
                                                        null,
                                                        null));
            } else { // an invalid character is there in the prefix 

                if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
                    SibTr.exit(CoreSPIConnection.tc, "createTemporaryDestination", "SIInvalidDestinationPrefixException");
                throw new SIInvalidDestinationPrefixException(
                                nls.getFormattedMessage(
                                                        "INVALID_DESTINATION_PREFIX_CHAR_ERROR_CWSIP0040",
                                                        new Object[] { destinationPrefix, result },
                                                        null));
            }
        }

        SIDestinationAddress address = null;

        // Synchronize on the close object, we don't want the connection closing
        // while we try to add the temporary destination.
        synchronized (this)
        {
            // Check authority to create destination
            // If security is disabled then we'll bypass the check
            checkTempDestinationCreation((destinationPrefix == null ? "" : destinationPrefix), distribution);

            // Synchronize on the temporaryDestinations list object so that we can't collide
            // on creations. This will also ensure list integrity.
            synchronized (_temporaryDestinations)
            {
                //pass this on to the destination manager
                try
                {
                    address =
                                    _destinationManager.createTemporaryDestination(distribution, destinationPrefix);
                } catch (SIMPDestinationAlreadyExistsException e)
                {
                    // FFDC
                    FFDCFilter.processException(
                                                e,
                                                "com.ibm.ws.sib.processor.impl.ConnectionImpl.createTemporaryDestination",
                                                "1:3712:1.347.1.25",
                                                this);

                    SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
                                new Object[] {
                                              "com.ibm.ws.sib.processor.impl.ConnectionImpl",
                                              "1:3718:1.347.1.25",
                                              e });

                    // This should never be thrown
                    if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
                        SibTr.exit(CoreSPIConnection.tc, "createTemporaryDestination", "SIErrorException");
                    throw new SIErrorException(
                                    nls.getFormattedMessage(
                                                            "INTERNAL_MESSAGING_ERROR_CWSIP0002",
                                                            new Object[] {
                                                                          "com.ibm.ws.sib.processor.impl.ConnectionImpl",
                                                                          "1:3729:1.347.1.25",
                                                                          e },
                                                            null),
                                    e);
                }

                //add to list
                _temporaryDestinations.add(address.getDestinationName());
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
            SibTr.exit(CoreSPIConnection.tc, "createTemporaryDestination", address);

        return address;
    }
736496
private function _calculateOrderTotalBasedOnBuyerDestinationAddress()
    {
        $response = $this->callStepAndCheckForException('getOrderReferenceDetails');
        
        $this->printResponseToWebpage(
            "printGetOrderReferenceDetailsResponse", array($response)
        );

        $orderTotalPreTaxAndShipping
            = $this->_getPreTaxAndShippingOrderAmountFromQueryParams();
        $shippingType = $this->_getShippingTypeFromQueryParams();
    
        return $this->exampleClass->calculateOrderTotalBasedOnBuyerDetails(
            $response->getGetOrderReferenceDetailsResult()->getOrderReferenceDetails(),
            $orderTotalPreTaxAndShipping,
            $shippingType
        );
    }
92989
@Override
    public Address getAddress(final double longitude, final double latitude) throws IOException {

        final NominatimReverseRequest q = new NominatimReverseRequest();
        q.setQuery(longitude, latitude);
        return this.getAddress(q);
    }
683092
private Set getDestinationLocalitySet (BaseDestinationHandler destinationHandler, Capability capability)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getDestinationLocalitySet",
        new Object[]{destinationHandler, capability});
    
      // Check if the localisation should be deleted
      Set localitySet = null;

      //Get the locality sets as known by admin
      try
      {
          localitySet = _messageProcessor.getSIBDestinationLocalitySet(null, destinationHandler.getUuid().toString(), true);
      }
      catch(SIBExceptionBase e)
      {
        // FFDC
        FFDCFilter.processException(
          e,
          "com.ibm.ws.sib.processor.impl.DestinationChangeListener.getDestinationLocalitySet",
          "1:368:1.45",
          this);
      }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getDestinationLocalitySet", localitySet);

    return localitySet;
  }
1159582
@Override
    public JsDestinationAddress getReplyDestination()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "getReplyDestination");

        if (!_replySet)
        {
            // Create a JsDestinationAddress from the qualifiedName
            QualifiedDestinationName name = definition.getReplyDestination();

            if (name != null)
                _replyDestination = SIMPUtils.createJsDestinationAddress(
                                                                         name.getDestination(),
                                                                         messageProcessor.getMessagingEngineUuid(),
                                                                         name.getBus());

            _replySet = true;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "getReplyDestination", _replyDestination);

        return _replyDestination;
    }
1332093
public String getDestinationName(Destination destination) {
        try {
            if (destination instanceof Queue) {
                return ((Queue) destination).getQueueName();
            } else if (destination instanceof Topic) {
                return ((Topic) destination).getTopicName();
            } else {
                return destination.toString();
            }
        } catch (JMSException e) {
            log.error("Unable to resolve destination name", e);
            return "";
        }
    }
548265
@Override
    public JsDestinationAddress createSystemDestination(String prefix)
                    throws SIResourceException, SIMPDestinationAlreadyExistsException, SIIncorrectCallException
    {
        //prefixes should be unique, 24 chars or less and
        //can contain the characters a-z, A-Z, 0-9, ., /, and %.
        boolean valid = isDestinationPrefixValid(prefix);
        if (!valid)
        {
            throw new SIInvalidDestinationPrefixException(
                            nls.getFormattedMessage(
                                                    "INVALID_DESTINATION_PREFIX_ERROR_CWSIP0023",
                                                    new Object[] { prefix },
                                                    null));
        }

        return _destinationManager.createSystemDestination(prefix);
    }
462620
@Override
    public DestinationType getDestinationType()
    {
        if (tc.isEntryEnabled())
            SibTr.entry(tc, "getDestinationType");

        DestinationType dt = getTarget().getDestinationType();

        if (tc.isEntryEnabled())
            SibTr.exit(tc, "getDestinationType", dt);

        return dt;
    }
875377
public Destination getDestination(String destName)
            throws MessagingException {
        Destination destination = null;
        JMSDestination jmsDest = getJMSDestination(destName);
        if(jmsDest != null) {
            destination = jmsDest.destination;
        }
        return destination;
    }
1094186
@Override
    public String getAddress()
    {
        if (((InetSocketAddress) address.address()).getPort() == 0) {
            return address(address);
        }
        return address.toString();
    }