private static final boolean isDestinationPrefixValid ( String destinationPrefix ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "isDestinationPrefixValid" , destinationPrefix ) ; boolean isValid = true ; // Assume the prefix is valid until we know otherwise. // null indicates that no destination prefix is being used. if ( null != destinationPrefix ) { // Check for the length first. int len = destinationPrefix . length ( ) ; if ( len > 24 ) { isValid = false ; } else { // Cycle through each character in the prefix until we find an invalid character, // or until we come to the end of the string. int along = 0 ; while ( ( along < len ) && isValid ) { char c = destinationPrefix . charAt ( along ) ; if ( ! ( ( ' ' <= c ) && ( ' ' >= c ) ) ) { if ( ! ( ( ' ' <= c ) && ( ' ' >= c ) ) ) { if ( ! ( ( ' ' <= c ) && ( ' ' >= c ) ) ) { if ( ' ' != c && ' ' != c && ' ' != c ) { // This character isn't a valid one... isValid = false ; } } } } // Move along to the next character in the string. along += 1 ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "isDestinationPrefixValid" , Boolean . valueOf ( isValid ) ) ; return isValid ; }
Determines whether a destination prefix for a System destination is valid or not .