String createNewTemporaryDestinationName ( String destinationPrefix , SIBUuid8 meUuid , Distribution distribution ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewTemporaryDestinationName" , new Object [ ] { destinationPrefix , meUuid , distribution } ) ; if ( destinationPrefix != null ) { if ( destinationPrefix . length ( ) > 12 ) destinationPrefix = destinationPrefix . substring ( 0 , 12 ) ; } else destinationPrefix = "" ; // Get the next available temporary destination count. long count = messageProcessor . nextTick ( ) ; // Suffix is the tempdest count as 8 char hex with leading zeros StringBuffer sb = new StringBuffer ( "0000000000000000" + Long . toHexString ( count ) . toUpperCase ( ) ) ; String uniqueSuffix = sb . substring ( sb . length ( ) - 16 ) . toString ( ) ; String tempPrefix = null ; if ( distribution == Distribution . ONE ) tempPrefix = SIMPConstants . TEMPORARY_QUEUE_DESTINATION_PREFIX ; else tempPrefix = SIMPConstants . TEMPORARY_PUBSUB_DESTINATION_PREFIX ; // Generate the unique name for the temporary destination. String name = tempPrefix + destinationPrefix + SIMPConstants . SYSTEM_DESTINATION_SEPARATOR + meUuid + uniqueSuffix ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewTemporaryDestinationName" , name ) ; return name ; }
Creates a new name for a temporary destination . Uses the Message Store Tick count to generate the unique suffix for the temporary destination