idx int64 0 41.2k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
38,400 | public static String toCharCount ( final String aString , final int aCount ) { final StringBuilder builder = new StringBuilder ( ) ; final String [ ] words = aString . split ( "\\s" ) ; int count = 0 ; for ( final String word : words ) { count += word . length ( ) ; if ( count < aCount ) { builder . append ( word ) ; if ( ( count += 1 ) < aCount ) { builder . append ( ' ' ) ; } else { builder . append ( EOL ) . append ( DOUBLE_SPACE ) ; count = 2 ; } } else { builder . append ( EOL ) . append ( DOUBLE_SPACE ) . append ( word ) ; count = word . length ( ) + 2 ; } } return builder . toString ( ) ; } | Formats a string with or without line breaks into a string with lines with less than a supplied number of characters per line . |
38,401 | public static String repeat ( final String aValue , final int aRepeatCount ) { final StringBuilder buffer = new StringBuilder ( ) ; for ( int index = 0 ; index < aRepeatCount ; index ++ ) { buffer . append ( aValue ) ; } return buffer . toString ( ) ; } | Creates a new string from the repetition of a supplied value . |
38,402 | public static String read ( final File aFile ) throws IOException { String string = new String ( readBytes ( aFile ) , StandardCharsets . UTF_8 . name ( ) ) ; if ( string . endsWith ( EOL ) ) { string = string . substring ( 0 , string . length ( ) - 1 ) ; } return string ; } | Reads the contents of a file into a string using the UTF - 8 character set encoding . |
38,403 | public static String [ ] trim ( final String ... aStringArray ) { final ArrayList < String > list = new ArrayList < > ( ) ; for ( final String string : aStringArray ) { if ( string != null && ! "" . equals ( string ) ) { list . add ( string ) ; } } return list . toArray ( new String [ 0 ] ) ; } | Removes empty and null strings from a string array . |
38,404 | public static boolean isEmpty ( final String aString ) { boolean result = true ; if ( aString != null ) { for ( int index = 0 ; index < aString . length ( ) ; index ++ ) { if ( ! Character . isWhitespace ( aString . charAt ( index ) ) ) { result = false ; break ; } } } return result ; } | Returns true if the supplied string is null empty or contains nothing but whitespace . |
38,405 | public static String joinKeys ( final Map < String , ? > aMap , final char aSeparator ) { if ( aMap . isEmpty ( ) ) { return "" ; } final Iterator < String > iterator = aMap . keySet ( ) . iterator ( ) ; final StringBuilder buffer = new StringBuilder ( ) ; while ( iterator . hasNext ( ) ) { buffer . append ( iterator . next ( ) ) . append ( aSeparator ) ; } final int length = buffer . length ( ) - 1 ; return buffer . charAt ( length ) == aSeparator ? buffer . substring ( 0 , length ) : buffer . toString ( ) ; } | Turns the keys in a map into a character delimited string . The order is only consistent if the map is sorted . |
38,406 | public static String upcase ( final String aString ) { return aString . substring ( 0 , 1 ) . toUpperCase ( Locale . getDefault ( ) ) + aString . substring ( 1 ) ; } | Upcases a string . |
38,407 | public static String toUpcaseString ( final int aInt ) { switch ( aInt ) { case 1 : return "First" ; case 2 : return "Second" ; case 3 : return "Third" ; case 4 : return "Fourth" ; case 5 : return "Fifth" ; case 6 : return "Sixth" ; case 7 : return "Seventh" ; case 8 : return "Eighth" ; case 9 : return "Ninth" ; case 10 : return "Tenth" ; case 11 : return "Eleventh" ; case 12 : return "Twelveth" ; case 13 : return "Thirteenth" ; case 14 : return "Fourteenth" ; case 15 : return "Fifthteenth" ; case 16 : return "Sixteenth" ; case 17 : return "Seventeenth" ; case 18 : return "Eighteenth" ; case 19 : return "Nineteenth" ; case 20 : return "Twentieth" ; default : throw new UnsupportedOperationException ( LOGGER . getI18n ( MessageCodes . UTIL_046 , aInt ) ) ; } } | Returns an up - cased human - friendly string representation for the supplied int ; for instance 1 becomes First 2 becomes Second etc . |
38,408 | private static String format ( final String aBundleName , final String aMessageKey , final Object ... aVarargs ) { return format ( null , aBundleName , aMessageKey , aVarargs ) ; } | Constructs our I18n exception message using the supplied bundle name . |
38,409 | public static String stripExt ( final String aFileName ) { final int index = aFileName . lastIndexOf ( DOT ) ; if ( index != - 1 ) { return aFileName . substring ( 0 , index ) ; } return aFileName ; } | Return a file name without the dot extension . |
38,410 | public static long getSize ( final File aFile ) { long size = 0 ; if ( aFile != null && aFile . exists ( ) ) { if ( aFile . isDirectory ( ) ) { for ( final File file : aFile . listFiles ( ) ) { size += getSize ( file ) ; } } else { size += aFile . length ( ) ; } } return size ; } | Gets the calculated size of a directory of files . |
38,411 | public static boolean delete ( final File aDir ) { if ( aDir . exists ( ) && aDir . listFiles ( ) != null ) { for ( final File file : aDir . listFiles ( ) ) { if ( file . isDirectory ( ) ) { if ( ! delete ( file ) ) { LOGGER . error ( MessageCodes . UTIL_012 , file ) ; } } else { if ( file . exists ( ) && ! file . delete ( ) ) { LOGGER . error ( MessageCodes . UTIL_012 , file ) ; } } } } else if ( LOGGER . isDebugEnabled ( ) && aDir . listFiles ( ) == null ) { LOGGER . debug ( MessageCodes . UTIL_013 , aDir ) ; } return aDir . delete ( ) ; } | Deletes a directory and all its children . |
38,412 | public static void copy ( final File aFromFile , final File aToFile ) throws IOException { if ( aFromFile . isDirectory ( ) && aToFile . isFile ( ) || aFromFile . isFile ( ) && aToFile . isDirectory ( ) ) { throw new IOException ( LOGGER . getI18n ( MessageCodes . UTIL_037 , aFromFile , aToFile ) ) ; } if ( aFromFile . isDirectory ( ) ) { if ( ! aToFile . exists ( ) && ! aToFile . mkdirs ( ) ) { throw new IOException ( LOGGER . getI18n ( MessageCodes . UTIL_035 , aToFile . getAbsolutePath ( ) ) ) ; } for ( final File file : aFromFile . listFiles ( ) ) { copy ( file , new File ( aToFile , file . getName ( ) ) ) ; } } else { copyFile ( aFromFile , aToFile ) ; } } | Copies a file or directory from one place to another . This copies a file to a file or a directory to a directory . It does not copy a file to a directory . |
38,413 | public static String hash ( final File aFile , final String aAlgorithm ) throws NoSuchAlgorithmException , IOException { final MessageDigest md = MessageDigest . getInstance ( aAlgorithm ) ; final FileInputStream inStream = new FileInputStream ( aFile ) ; final DigestInputStream mdStream = new DigestInputStream ( inStream , md ) ; final byte [ ] bytes = new byte [ 8192 ] ; int bytesRead = 0 ; while ( bytesRead != - 1 ) { bytesRead = mdStream . read ( bytes ) ; } final Formatter formatter = new Formatter ( ) ; for ( final byte bite : md . digest ( ) ) { formatter . format ( "%02x" , bite ) ; } IOUtils . closeQuietly ( mdStream ) ; final String hash = formatter . toString ( ) ; formatter . close ( ) ; return hash ; } | Get a hash for a supplied file . |
38,414 | public static Set < PosixFilePermission > convertToPermissionsSet ( final int aMode ) { final Set < PosixFilePermission > result = EnumSet . noneOf ( PosixFilePermission . class ) ; if ( isSet ( aMode , 0400 ) ) { result . add ( PosixFilePermission . OWNER_READ ) ; } if ( isSet ( aMode , 0200 ) ) { result . add ( PosixFilePermission . OWNER_WRITE ) ; } if ( isSet ( aMode , 0100 ) ) { result . add ( PosixFilePermission . OWNER_EXECUTE ) ; } if ( isSet ( aMode , 040 ) ) { result . add ( PosixFilePermission . GROUP_READ ) ; } if ( isSet ( aMode , 020 ) ) { result . add ( PosixFilePermission . GROUP_WRITE ) ; } if ( isSet ( aMode , 010 ) ) { result . add ( PosixFilePermission . GROUP_EXECUTE ) ; } if ( isSet ( aMode , 04 ) ) { result . add ( PosixFilePermission . OTHERS_READ ) ; } if ( isSet ( aMode , 02 ) ) { result . add ( PosixFilePermission . OTHERS_WRITE ) ; } if ( isSet ( aMode , 01 ) ) { result . add ( PosixFilePermission . OTHERS_EXECUTE ) ; } return result ; } | Converts an file permissions mode integer to a PosixFilePermission set . |
38,415 | public static int convertToInt ( final Set < PosixFilePermission > aPermSet ) { int result = 0 ; if ( aPermSet . contains ( PosixFilePermission . OWNER_READ ) ) { result = result | 0400 ; } if ( aPermSet . contains ( PosixFilePermission . OWNER_WRITE ) ) { result = result | 0200 ; } if ( aPermSet . contains ( PosixFilePermission . OWNER_EXECUTE ) ) { result = result | 0100 ; } if ( aPermSet . contains ( PosixFilePermission . GROUP_READ ) ) { result = result | 040 ; } if ( aPermSet . contains ( PosixFilePermission . GROUP_WRITE ) ) { result = result | 020 ; } if ( aPermSet . contains ( PosixFilePermission . GROUP_EXECUTE ) ) { result = result | 010 ; } if ( aPermSet . contains ( PosixFilePermission . OTHERS_READ ) ) { result = result | 04 ; } if ( aPermSet . contains ( PosixFilePermission . OTHERS_WRITE ) ) { result = result | 02 ; } if ( aPermSet . contains ( PosixFilePermission . OTHERS_EXECUTE ) ) { result = result | 01 ; } return result ; } | Convert a PosixFilePermission set to an integer permissions mode . |
38,416 | private static boolean copyFile ( final File aSourceFile , final File aDestFile ) throws IOException { FileOutputStream outputStream = null ; FileInputStream inputStream = null ; boolean success = true ; if ( aDestFile . exists ( ) && ! aDestFile . delete ( ) ) { success = false ; } if ( success && ! aDestFile . createNewFile ( ) ) { LOGGER . warn ( MessageCodes . UTIL_014 , aDestFile . getAbsolutePath ( ) ) ; success = false ; } if ( success ) { try { final FileChannel source ; outputStream = new FileOutputStream ( aDestFile ) ; inputStream = new FileInputStream ( aSourceFile ) ; source = inputStream . getChannel ( ) ; outputStream . getChannel ( ) . transferFrom ( source , 0 , source . size ( ) ) ; } finally { IOUtils . closeQuietly ( outputStream ) ; IOUtils . closeQuietly ( inputStream ) ; } } if ( success && aDestFile . exists ( ) && aSourceFile . canRead ( ) ) { success = aDestFile . setReadable ( true , true ) ; } if ( success && aDestFile . exists ( ) && aSourceFile . canWrite ( ) ) { success = aDestFile . setWritable ( true , true ) ; } if ( success && aDestFile . exists ( ) && aSourceFile . canExecute ( ) ) { success = aDestFile . setExecutable ( true , true ) ; } if ( ! success && ! aDestFile . delete ( ) && LOGGER . isWarnEnabled ( ) ) { LOGGER . warn ( MessageCodes . UTIL_015 , aDestFile ) ; } return success ; } | Copies a non - directory file from one location to another . |
38,417 | private static void copyMetadata ( final File aFile , final Element aElement ) { final SimpleDateFormat formatter = new SimpleDateFormat ( DATE_FORMAT , Locale . US ) ; final StringBuilder permissions = new StringBuilder ( ) ; final Date date = new Date ( aFile . lastModified ( ) ) ; aElement . setAttribute ( FILE_PATH , aFile . getAbsolutePath ( ) ) ; aElement . setAttribute ( MODIFIED , formatter . format ( date ) ) ; if ( aFile . canRead ( ) ) { permissions . append ( 'r' ) ; } if ( aFile . canWrite ( ) ) { permissions . append ( 'w' ) ; } aElement . setAttribute ( "permissions" , permissions . toString ( ) ) ; } | Copy file metadata into the supplied file element . |
38,418 | public void update ( long throughput ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Received throughput of " + throughput + " on channel - " + this . channel . getComponentName ( ) ) ; } this . throughput = throughput ; } | Method used by the Esper subscriber contract where the payload of the event is passed to the subscriber . In this case the payload is a calculated throughput . |
38,419 | public String get ( final String aMessage , final String ... aArray ) { return StringUtils . format ( super . getString ( aMessage ) , aArray ) ; } | Return a message value with the supplied values integrated into it . |
38,420 | public String get ( final String aMessage , final String aDetail ) { return StringUtils . format ( super . getString ( aMessage ) , aDetail ) ; } | Return a message value with the supplied string integrated into it . |
38,421 | public String get ( final String aMessage , final File ... aFileArray ) { final String [ ] details = new String [ aFileArray . length ] ; for ( int index = 0 ; index < details . length ; index ++ ) { details [ index ] = aFileArray [ index ] . getAbsolutePath ( ) ; } LOGGER . debug ( MessageCodes . UTIL_026 , aMessage , details ) ; return StringUtils . format ( super . getString ( aMessage ) , details ) ; } | Returns the string form of the requested message with the file values integrated into it . |
38,422 | public String get ( final String aMessage , final File aFile ) { return StringUtils . format ( super . getString ( aMessage ) , new String [ ] { aFile . getAbsolutePath ( ) } ) ; } | Returns the string form of the requested message with the file value integrated into it . |
38,423 | public static void zip ( final File aFileSystemDir , final File aOutputZipFile ) throws FileNotFoundException , IOException { zip ( aFileSystemDir , aOutputZipFile , new RegexFileFilter ( WILDCARD ) ) ; } | Recursively zip a file system directory . |
38,424 | public static void zip ( final File aFileSystemDir , final File aOutputZipFile , final FilenameFilter aIncludesFilter , final File ... aIncludesFileList ) throws FileNotFoundException , IOException { final ZipOutputStream zipFileStream = new ZipOutputStream ( new FileOutputStream ( aOutputZipFile ) ) ; final String parentDirPath = aFileSystemDir . getParentFile ( ) . getAbsolutePath ( ) ; dirToZip ( aFileSystemDir , parentDirPath , aIncludesFilter , zipFileStream ) ; for ( final File file : aIncludesFileList ) { final String path = File . separator + aFileSystemDir . getName ( ) + File . separator + file . getName ( ) ; final ZipEntry entry = new ZipEntry ( path ) ; final FileInputStream inFileStream = new FileInputStream ( file ) ; zipFileStream . putNextEntry ( entry ) ; IOUtils . copyStream ( inFileStream , zipFileStream ) ; IOUtils . closeQuietly ( inFileStream ) ; } IOUtils . closeQuietly ( zipFileStream ) ; } | Recursively zip up a file system directory . |
38,425 | @ SuppressWarnings ( "unchecked" ) public ManagedSet parseStatements ( Element element , ParserContext parserContext ) { ManagedSet statements = new ManagedSet ( ) ; NodeList childNodes = element . getChildNodes ( ) ; for ( int i = 0 ; i < childNodes . getLength ( ) ; i ++ ) { Node child = childNodes . item ( i ) ; if ( child . getNodeType ( ) == Node . ELEMENT_NODE ) { Element childElement = ( Element ) child ; String localName = child . getLocalName ( ) ; if ( "statement" . equals ( localName ) ) { BeanDefinition definition = parserContext . getDelegate ( ) . parseCustomElement ( childElement ) ; statements . add ( definition ) ; } else if ( "ref" . equals ( localName ) ) { String ref = childElement . getAttribute ( "bean" ) ; statements . add ( new RuntimeBeanReference ( ref ) ) ; } } } return statements ; } | Parses out the individual statement elements for further processing . |
38,426 | public static void closeQuietly ( final Reader aReader ) { if ( aReader != null ) { try { aReader . close ( ) ; } catch ( final IOException details ) { LOGGER . error ( details . getMessage ( ) , details ) ; } } } | Closes a reader catching and logging any exceptions . |
38,427 | public static void closeQuietly ( final Writer aWriter ) { if ( aWriter != null ) { try { aWriter . close ( ) ; } catch ( final IOException details ) { LOGGER . error ( details . getMessage ( ) , details ) ; } } } | Closes a writer catching and logging any exceptions . |
38,428 | public static void closeQuietly ( final InputStream aInputStream ) { if ( aInputStream != null ) { try { aInputStream . close ( ) ; } catch ( final IOException details ) { LOGGER . error ( details . getMessage ( ) , details ) ; } } } | Closes an input stream catching and logging any exceptions . |
38,429 | public static void closeQuietly ( final ImageInputStream aImageInputStream ) { if ( aImageInputStream != null ) { try { aImageInputStream . close ( ) ; } catch ( final IOException details ) { LOGGER . error ( details . getMessage ( ) , details ) ; } } } | Closes an image input stream catching and logging any exceptions |
38,430 | public static void closeQuietly ( final ImageOutputStream aImageOutputStream ) { if ( aImageOutputStream != null ) { try { aImageOutputStream . close ( ) ; } catch ( final IOException details ) { LOGGER . error ( details . getMessage ( ) , details ) ; } } } | Closes an image output stream catching and logging any exceptions . |
38,431 | public static void closeQuietly ( final OutputStream aOutputStream ) { if ( aOutputStream != null ) { try { aOutputStream . close ( ) ; } catch ( final IOException details ) { LOGGER . error ( details . getMessage ( ) , details ) ; } } } | Closes an output stream catching and logging any exceptions . |
38,432 | public static String toXML ( final Node aNode ) throws TransformerException { try { final TransformerFactory transFactory = TransformerFactory . newInstance ( ) ; final Transformer transformer = transFactory . newTransformer ( ) ; final StringWriter buffer = new StringWriter ( ) ; final DOMSource domSource = new DOMSource ( aNode ) ; final StreamResult streamResult = new StreamResult ( buffer ) ; final String omitDeclaration = OutputKeys . OMIT_XML_DECLARATION ; transformer . setOutputProperty ( omitDeclaration , "yes" ) ; transformer . transform ( domSource , streamResult ) ; return buffer . toString ( ) ; } catch ( final TransformerConfigurationException details ) { throw new I18nRuntimeException ( details ) ; } } | Returns an XML string representation of the supplied node . |
38,433 | public List < String > getFormats ( final String aBaseName ) { Objects . requireNonNull ( aBaseName ) ; return Arrays . asList ( FORMAT ) ; } | Returns a list of formats supported for the supplied base name . |
38,434 | private void setupEPStatements ( ) { for ( EsperStatement statement : statements ) { EPStatement epStatement = epServiceProvider . getEPAdministrator ( ) . createEPL ( statement . getEPL ( ) ) ; statement . setEPStatement ( epStatement ) ; } } | Add the appropriate statements to the esper runtime . |
38,435 | private void configureEPServiceProvider ( ) throws EPException , IOException { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Configuring the Esper Service Provider with name: " + name ) ; } if ( this . configuration != null && this . configuration . exists ( ) ) { Configuration esperConfiguration = new Configuration ( ) ; esperConfiguration = esperConfiguration . configure ( this . configuration . getFile ( ) ) ; epServiceProvider = EPServiceProviderManager . getProvider ( name , esperConfiguration ) ; LOG . info ( "Esper configured with a user-provided configuration" , esperConfiguration ) ; } else { epServiceProvider = EPServiceProviderManager . getProvider ( name ) ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Completed configuring the Esper Service Provider with name: " + name ) ; } } | Configure the Esper Service Provider to create the appropriate Esper Runtime . |
38,436 | public static void setLogLevels ( final int aLogLevel , final String [ ] aLoggerList , final String [ ] aExcludesList , final String ... aIncludesList ) { final ArrayList < String > loggerList = new ArrayList < > ( Arrays . asList ( aLoggerList ) ) ; final Class < ? extends Logger > simpleLogger = LoggerFactory . getLogger ( "org.slf4j.impl.SimpleLogger" ) . getClass ( ) ; if ( aIncludesList != null ) { loggerList . addAll ( Arrays . asList ( aIncludesList ) ) ; } for ( final String loggerName : loggerList ) { if ( aExcludesList != null ) { boolean skip = false ; for ( final String element : aExcludesList ) { if ( loggerName . equals ( element ) ) { skip = true ; break ; } } if ( skip ) { continue ; } } final Logger loggerObject = LoggerFactory . getLogger ( loggerName ) ; final Class < ? extends Logger > loggerClass = loggerObject . getClass ( ) ; if ( simpleLogger . equals ( loggerClass ) ) { try { final Field field = loggerClass . getDeclaredField ( "currentLogLevel" ) ; field . setAccessible ( true ) ; field . setInt ( loggerObject , aLogLevel ) ; if ( loggerObject . isDebugEnabled ( ) ) { LOGGER . debug ( MessageCodes . MVN_012 , loggerName , getLevelName ( aLogLevel ) ) ; } } catch ( NoSuchFieldException | IllegalAccessException details ) { LOGGER . error ( MessageCodes . MVN_011 , details ) ; } } else { LOGGER . warn ( MessageCodes . MVN_010 , loggerName ) ; } } } | Sets the logging level of the supplied loggers optionally excluding some and including others . |
38,437 | public static int getLevelIntCode ( final String aLogLevelName ) { final String levelName = aLogLevelName . trim ( ) . toLowerCase ( Locale . US ) ; if ( "error" . equals ( levelName ) ) { return ERROR_LOG_LEVEL ; } else if ( "warn" . equals ( levelName ) ) { return WARN_LOG_LEVEL ; } else if ( "info" . equals ( levelName ) ) { return INFO_LOG_LEVEL ; } else if ( "debug" . equals ( levelName ) ) { return DEBUG_LOG_LEVEL ; } else if ( "trace" . equals ( levelName ) ) { return TRACE_LOG_LEVEL ; } else { return 0 ; } } | Returns the int of the supplied log level or zero if the supplied name doesn t match a known log level . |
38,438 | public static String decode ( final String aURL , final String aEncoding ) { String urlString = aURL ; String decodedString ; try { do { decodedString = urlString ; urlString = URLDecoder . decode ( decodedString . replaceAll ( "%(?![0-9a-fA-F]{2})" , PERCENT ) , aEncoding ) ; } while ( ! urlString . equals ( decodedString ) ) ; } catch ( final java . io . UnsupportedEncodingException details ) { throw new UnsupportedEncodingException ( details , aEncoding ) ; } if ( LOGGER . isDebugEnabled ( ) && ! aURL . equals ( decodedString ) ) { LOGGER . debug ( MessageCodes . DBG_002 , aURL , decodedString ) ; } return decodedString ; } | Decodes an encoded path . If it has been doubly encoded it is doubly decoded . |
38,439 | public static String encode ( final String aString , final boolean aIgnoreSlashFlag ) { final CharacterIterator iterator = new StringCharacterIterator ( decode ( aString ) ) ; final StringBuilder builder = new StringBuilder ( ) ; for ( char c = iterator . first ( ) ; c != CharacterIterator . DONE ; c = iterator . next ( ) ) { switch ( c ) { case '%' : builder . append ( PERCENT ) ; break ; case '/' : if ( aIgnoreSlashFlag ) { builder . append ( c ) ; } else { builder . append ( "%2F" ) ; } break ; case '?' : builder . append ( "%3F" ) ; break ; case '#' : builder . append ( "%23" ) ; break ; case '[' : builder . append ( "%5B" ) ; break ; case ']' : builder . append ( "%5D" ) ; break ; case '@' : builder . append ( "%40" ) ; break ; default : builder . append ( c ) ; break ; } } return URI . create ( builder . toString ( ) ) . toASCIIString ( ) ; } | Percent - encodes supplied string but only after decoding it completely first . |
38,440 | public void start ( ) { if ( LOG . isInfoEnabled ( ) ) { LOG . info ( "Esper statement [" + epl + "] being started" ) ; } this . epStatement . start ( ) ; if ( LOG . isInfoEnabled ( ) ) { LOG . info ( "Esper statement [" + epl + "] started" ) ; } } | Starts events being collated according to the statement s filter query |
38,441 | public void stop ( ) { if ( LOG . isInfoEnabled ( ) ) { LOG . info ( "Esper statement [" + epl + "] being stopped" ) ; } this . epStatement . stop ( ) ; if ( LOG . isInfoEnabled ( ) ) { LOG . info ( "Esper statement [" + epl + "] stopped" ) ; } } | Stops the underlying native statement from applying its filter query . |
38,442 | private void addEPStatementListener ( UpdateListener listener ) { if ( this . subscriber == null ) { if ( epStatement != null ) { epStatement . addListener ( listener ) ; } } } | Adds an listener to the underlying native EPStatement . |
38,443 | void setEPStatement ( EPStatement epStatement ) { this . epStatement = epStatement ; if ( this . subscriber != null ) { epStatement . setSubscriber ( this . subscriber ) ; } else { for ( UpdateListener listener : listeners ) { epStatement . addListener ( listener ) ; } } } | Sets the native Esper statement . Typically created by an Esper Template . |
38,444 | public boolean filters ( final String aFileExt ) { final String normalizedExt = normalizeExt ( aFileExt ) ; for ( final String extension : myExtensions ) { if ( extension . equals ( normalizedExt ) ) { return true ; } } return false ; } | Returns whether or not the supplied file extension is one that this filter matches . |
38,445 | @ SuppressWarnings ( "unchecked" ) public ManagedSet parseListeners ( Element element , ParserContext parserContext ) { ManagedSet listeners = new ManagedSet ( ) ; NodeList childNodes = element . getChildNodes ( ) ; for ( int i = 0 ; i < childNodes . getLength ( ) ; i ++ ) { Node child = childNodes . item ( i ) ; if ( child . getNodeType ( ) == Node . ELEMENT_NODE ) { Element childElement = ( Element ) child ; String localName = child . getLocalName ( ) ; if ( "bean" . equals ( localName ) ) { BeanDefinitionHolder holder = parserContext . getDelegate ( ) . parseBeanDefinitionElement ( childElement ) ; parserContext . registerBeanComponent ( new BeanComponentDefinition ( holder ) ) ; listeners . add ( new RuntimeBeanReference ( holder . getBeanName ( ) ) ) ; } else if ( "ref" . equals ( localName ) ) { String ref = childElement . getAttribute ( "bean" ) ; listeners . add ( new RuntimeBeanReference ( ref ) ) ; } } } return listeners ; } | Parses out a set of configured esper statement listeners . |
38,446 | protected String getI18n ( final String aMessageKey , final long aLongDetail ) { return StringUtils . normalizeWS ( myBundle . get ( aMessageKey , Long . toString ( aLongDetail ) ) ) ; } | Gets the internationalized value for the supplied message key using a long as additional information . |
38,447 | protected String getI18n ( final String aMessageKey , final int aIntDetail ) { return StringUtils . normalizeWS ( myBundle . get ( aMessageKey , Integer . toString ( aIntDetail ) ) ) ; } | Gets the internationalized value for the supplied message key using an int as additional information . |
38,448 | protected String getI18n ( final String aMessageKey , final String aDetail ) { return StringUtils . normalizeWS ( myBundle . get ( aMessageKey , aDetail ) ) ; } | Gets the internationalized value for the supplied message key using a string as additional information . |
38,449 | protected String getI18n ( final String aMessageKey , final String ... aDetailsArray ) { return StringUtils . normalizeWS ( myBundle . get ( aMessageKey , aDetailsArray ) ) ; } | Gets the internationalized value for the supplied message key using a string array as additional information . |
38,450 | protected String getI18n ( final String aMessageKey , final Exception aException ) { return StringUtils . normalizeWS ( myBundle . get ( aMessageKey , aException . getMessage ( ) ) ) ; } | Gets the internationalized value for the supplied message key using an exception as additional information . |
38,451 | protected String getI18n ( final String aMessageKey , final File aFile ) { return StringUtils . normalizeWS ( myBundle . get ( aMessageKey , aFile . getAbsolutePath ( ) ) ) ; } | Gets the internationalized value for the supplied message key using a file as additional information . |
38,452 | protected String getI18n ( final String aMessageKey , final File ... aFileArray ) { final String [ ] fileNames = new String [ aFileArray . length ] ; for ( int index = 0 ; index < fileNames . length ; index ++ ) { fileNames [ index ] = aFileArray [ index ] . getAbsolutePath ( ) ; } return StringUtils . normalizeWS ( myBundle . get ( aMessageKey , fileNames ) ) ; } | Gets the internationalized value for the supplied message key using a file array as additional information . |
38,453 | protected String getI18n ( final String aMessageKey , final Object ... aObjArray ) { final String [ ] strings = new String [ aObjArray . length ] ; for ( int index = 0 ; index < aObjArray . length ; index ++ ) { if ( aObjArray [ index ] instanceof File ) { strings [ index ] = ( ( File ) aObjArray [ index ] ) . getAbsolutePath ( ) ; } else { strings [ index ] = aObjArray [ index ] . toString ( ) ; } } return StringUtils . normalizeWS ( myBundle . get ( aMessageKey , strings ) ) ; } | Gets the internationalized value for the supplied message key using an object array as additional information . |
38,454 | protected boolean hasI18nKey ( final String aMessageKey ) { return myBundle != null && aMessageKey != null && myBundle . containsKey ( aMessageKey ) ; } | Returns true if this I18N object contains the requested I18N key ; else false . |
38,455 | public static String [ ] getDirs ( ) { final ArrayList < String > list = new ArrayList < > ( ) ; for ( final String filename : System . getProperty ( CLASSPATH ) . split ( DELIMETER ) ) { final File file = new File ( filename ) ; LOGGER . debug ( MessageCodes . UTIL_003 , file , file . isDirectory ( ) ? YES : NO ) ; if ( file . isDirectory ( ) ) { list . add ( file . getAbsolutePath ( ) ) ; } } return list . toArray ( new String [ 0 ] ) ; } | Returns an String array of all the directory names in the system classpath |
38,456 | public static String [ ] getJars ( ) { final ArrayList < String > list = new ArrayList < > ( ) ; final FileExtFileFilter filter = new FileExtFileFilter ( JAR_EXT ) ; for ( final String part : System . getProperty ( CLASSPATH ) . split ( File . pathSeparator ) ) { final File file = new File ( part ) ; if ( filter . accept ( file . getParentFile ( ) , file . getName ( ) ) ) { list . add ( file . getAbsolutePath ( ) ) ; } } return list . toArray ( new String [ 0 ] ) ; } | Returns an String array of all the names of the jars in the system classpath |
38,457 | public boolean initiateOutgoingMessage ( String toUri , String viaNonProxyRoute ) { return initiateOutgoingMessage ( null , toUri , viaNonProxyRoute , null , null , null ) ; } | This basic method is used to initiate an outgoing MESSAGE . |
38,458 | public SipResponse findMostRecentResponse ( int statusCode ) { List < SipResponse > responses = getAllReceivedResponses ( ) ; ListIterator < SipResponse > i = responses . listIterator ( responses . size ( ) ) ; while ( i . hasPrevious ( ) ) { SipResponse resp = i . previous ( ) ; if ( resp . getStatusCode ( ) == statusCode ) { return resp ; } } return null ; } | Finds the last received response with status code matching the given parameter . |
38,459 | public String generateNewTag ( ) { int r = parent . getRandom ( ) . nextInt ( ) ; r = ( r < 0 ) ? 0 - r : r ; return Integer . toString ( r ) ; } | Generates a newly generated unique tag ID . |
38,460 | public SipTransaction sendRequestWithTransaction ( String reqMessage , boolean viaProxy , Dialog dialog ) throws ParseException { Request request = parent . getMessageFactory ( ) . createRequest ( reqMessage ) ; return sendRequestWithTransaction ( request , viaProxy , dialog ) ; } | This basic method sends out a request message as part of a transaction . A test program should use this method when a response to a request is expected . A Request object is constructed from the string passed in . |
38,461 | public SipTransaction sendRequestWithTransaction ( Request request , boolean viaProxy , Dialog dialog ) { return sendRequestWithTransaction ( request , viaProxy , dialog , null ) ; } | This basic method sends out a request message as part of a transaction . A test program should use this method when a response to a request is expected . The Request object passed in must be a fully formed Request with all required content EXCEPT for the Via header branch parameter which cannot be filled in until a client transaction is obtained . That happens in this method . If the Via branch value is set in the request parameter passed to this method it is nulled out by this method so that a new client transaction can be created by the stack . |
38,462 | public boolean sendUnidirectionalResponse ( RequestEvent request , int statusCode , String reasonPhrase , String toTag , Address contact , int expires ) { initErrorInfo ( ) ; if ( ( request == null ) || ( request . getRequest ( ) == null ) ) { setErrorMessage ( "Cannot send response, request information is null" ) ; setReturnCode ( INVALID_ARGUMENT ) ; return false ; } Response response ; try { response = parent . getMessageFactory ( ) . createResponse ( statusCode , request . getRequest ( ) ) ; if ( reasonPhrase != null ) { response . setReasonPhrase ( reasonPhrase ) ; } if ( toTag != null ) { ( ( ToHeader ) response . getHeader ( ToHeader . NAME ) ) . setTag ( toTag ) ; } if ( contact != null ) { response . addHeader ( parent . getHeaderFactory ( ) . createContactHeader ( contact ) ) ; } if ( expires != - 1 ) { response . addHeader ( parent . getHeaderFactory ( ) . createExpiresHeader ( expires ) ) ; } } catch ( Exception ex ) { setException ( ex ) ; setErrorMessage ( "Exception: " + ex . getClass ( ) . getName ( ) + ": " + ex . getMessage ( ) ) ; setReturnCode ( EXCEPTION_ENCOUNTERED ) ; return false ; } return sendUnidirectionalResponse ( response ) ; } | This method sends out a stateless response to the given request . |
38,463 | public Request getRequest ( ) { if ( clientTransaction != null ) { return clientTransaction . getRequest ( ) ; } if ( serverTransaction != null ) { return serverTransaction . getRequest ( ) ; } return null ; } | The user test program MAY call this method to view the javax . sip . message . Request object that created this transaction . However knowledge of JAIN SIP API is required to interpret the Request object . |
38,464 | public static void assertLastOperationSuccess ( String msg , SipActionObject op ) { assertNotNull ( "Null assert object passed in" , op ) ; assertTrue ( msg , op . getErrorMessage ( ) . length ( ) == 0 ) ; } | Asserts that the last SIP operation performed by the given object was successful . Assertion failure output includes the given message text . |
38,465 | public static void assertHeaderPresent ( String msg , SipMessage sipMessage , String header ) { assertNotNull ( "Null assert object passed in" , sipMessage ) ; assertTrue ( msg , sipMessage . getHeaders ( header ) . hasNext ( ) ) ; } | Asserts that the given SIP message contains at least one occurrence of the specified header . Assertion failure output includes the given message text . |
38,466 | public static void assertHeaderNotPresent ( String msg , SipMessage sipMessage , String header ) { assertNotNull ( "Null assert object passed in" , sipMessage ) ; assertFalse ( msg , sipMessage . getHeaders ( header ) . hasNext ( ) ) ; } | Asserts that the given SIP message contains no occurrence of the specified header . Assertion failure output includes the given message text . |
38,467 | public static void assertHeaderContains ( SipMessage sipMessage , String header , String value ) { assertHeaderContains ( null , sipMessage , header , value ) ; } | Asserts that the given SIP message contains at least one occurrence of the specified header and that at least one occurrence of this header contains the given value . The assertion fails if no occurrence of the header contains the value or if the header is not present in the mesage . |
38,468 | public static void assertHeaderContains ( String msg , SipMessage sipMessage , String header , String value ) { assertNotNull ( "Null assert object passed in" , sipMessage ) ; ListIterator < Header > l = sipMessage . getHeaders ( header ) ; while ( l . hasNext ( ) ) { String h = ( ( Header ) l . next ( ) ) . toString ( ) ; if ( h . indexOf ( value ) != - 1 ) { assertTrue ( true ) ; return ; } } fail ( msg ) ; } | Asserts that the given SIP message contains at least one occurrence of the specified header and that at least one occurrence of this header contains the given value . The assertion fails if no occurrence of the header contains the value or if the header is not present in the mesage . Assertion failure output includes the given message text . |
38,469 | public static void assertHeaderNotContains ( SipMessage sipMessage , String header , String value ) { assertHeaderNotContains ( null , sipMessage , header , value ) ; } | Asserts that the given SIP message contains no occurrence of the specified header with the value given or that there is no occurrence of the header in the message . The assertion fails if any occurrence of the header contains the value . |
38,470 | public static void assertResponseReceived ( int statusCode , String method , long sequenceNumber , MessageListener obj ) { assertResponseReceived ( null , statusCode , method , sequenceNumber , obj ) ; } | Asserts that the given message listener object received a response with the indicated status code CSeq method and CSeq sequence number . |
38,471 | public static void assertResponseReceived ( String msg , int statusCode , MessageListener obj ) { assertNotNull ( "Null assert object passed in" , obj ) ; assertTrue ( msg , responseReceived ( statusCode , obj ) ) ; } | Asserts that the given message listener object received a response with the indicated status code . Assertion failure output includes the given message text . |
38,472 | public static boolean responseReceived ( int statusCode , MessageListener messageListener ) { ArrayList < SipResponse > responses = messageListener . getAllReceivedResponses ( ) ; for ( SipResponse r : responses ) { if ( statusCode == r . getStatusCode ( ) ) { return true ; } } return false ; } | Check the given message listener object received a response with the indicated status code . |
38,473 | public static void assertResponseNotReceived ( int statusCode , String method , long sequenceNumber , MessageListener obj ) { assertResponseNotReceived ( null , statusCode , method , sequenceNumber , obj ) ; } | Asserts that the given message listener object has not received a response with the indicated status code CSeq method and sequence number . |
38,474 | public static void assertResponseNotReceived ( String msg , int statusCode , String method , long sequenceNumber , MessageListener obj ) { assertNotNull ( "Null assert object passed in" , obj ) ; assertFalse ( msg , responseReceived ( statusCode , method , sequenceNumber , obj ) ) ; } | Asserts that the given message listener object has not received a response with the indicated status code CSeq method and sequence number . Assertion failure output includes the given message text . |
38,475 | public static void assertRequestReceived ( String method , long sequenceNumber , MessageListener obj ) { assertRequestReceived ( null , method , sequenceNumber , obj ) ; } | Asserts that the given message listener object received a request with the indicated CSeq method and CSeq sequence number . |
38,476 | public static void assertRequestReceived ( String msg , String method , MessageListener obj ) { assertNotNull ( "Null assert object passed in" , obj ) ; assertTrue ( msg , requestReceived ( method , obj ) ) ; } | Asserts that the given message listener object received a request with the indicated request method . Assertion failure output includes the given message text . |
38,477 | public static void assertRequestNotReceived ( String msg , String method , MessageListener obj ) { assertNotNull ( "Null assert object passed in" , obj ) ; assertFalse ( msg , requestReceived ( method , obj ) ) ; } | Asserts that the given message listener object has not received a request with the indicated request method . Assertion failure output includes the given message text . |
38,478 | public static void assertRequestNotReceived ( String method , long sequenceNumber , MessageListener obj ) { assertRequestNotReceived ( null , method , sequenceNumber , obj ) ; } | Asserts that the given message listener object has not received a request with the indicated CSeq method and sequence number . |
38,479 | public static void assertAnswered ( String msg , SipCall call ) { assertNotNull ( "Null assert object passed in" , call ) ; assertTrue ( msg , call . isCallAnswered ( ) ) ; } | Asserts that the given incoming or outgoing call leg was answered . Assertion failure output includes the given message text . |
38,480 | public static void awaitAnswered ( final String msg , final SipCall call ) { await ( ) . until ( new Runnable ( ) { public void run ( ) { assertAnswered ( msg , call ) ; } } ) ; } | Awaits that the given incoming or outgoing call leg was answered . Assertion failure output includes the given message text . |
38,481 | public static void assertNotAnswered ( String msg , SipCall call ) { assertNotNull ( "Null assert object passed in" , call ) ; assertFalse ( msg , call . isCallAnswered ( ) ) ; } | Asserts that the given incoming or outgoing call leg has not been answered . Assertion failure output includes the given message text . |
38,482 | public static void assertBodyPresent ( String msg , SipMessage sipMessage ) { assertNotNull ( "Null assert object passed in" , sipMessage ) ; assertTrue ( msg , sipMessage . getContentLength ( ) > 0 ) ; } | Asserts that the given SIP message contains a body . Assertion failure output includes the given message text . |
38,483 | public static void assertBodyNotPresent ( String msg , SipMessage sipMessage ) { assertNotNull ( "Null assert object passed in" , sipMessage ) ; assertFalse ( msg , sipMessage . getContentLength ( ) > 0 ) ; } | Asserts that the given SIP message contains no body . Assertion failure output includes the given message text . |
38,484 | public static void assertBodyContains ( String msg , SipMessage sipMessage , String value ) { assertNotNull ( "Null assert object passed in" , sipMessage ) ; assertBodyPresent ( msg , sipMessage ) ; String body = new String ( sipMessage . getRawContent ( ) ) ; if ( body . indexOf ( value ) != - 1 ) { assertTrue ( true ) ; return ; } fail ( msg ) ; } | Asserts that the given SIP message contains a body that includes the given value . The assertion fails if a body is not present in the message or is present but doesn t include the value . Assertion failure output includes the given message text . |
38,485 | public static void assertBodyNotContains ( String msg , SipMessage sipMessage , String value ) { assertNotNull ( "Null assert object passed in" , sipMessage ) ; if ( sipMessage . getContentLength ( ) > 0 ) { String body = new String ( sipMessage . getRawContent ( ) ) ; if ( body . indexOf ( value ) != - 1 ) { fail ( msg ) ; } } assertTrue ( true ) ; } | Asserts that the body in the given SIP message does not contain the value given or that there is no body in the message . The assertion fails if the body is present and contains the value . Assertion failure output includes the given message text . |
38,486 | public static void dumpMessage ( String informationalHeader , javax . sip . message . Message msg ) { LOG . trace ( informationalHeader + "{}.......... \n {}" , informationalHeader , msg ) ; ListIterator rhdrs = msg . getHeaders ( RouteHeader . NAME ) ; while ( rhdrs . hasNext ( ) ) { RouteHeader rhdr = ( RouteHeader ) rhdrs . next ( ) ; if ( rhdr != null ) { LOG . trace ( "RouteHeader address: {}" , rhdr . getAddress ( ) . toString ( ) ) ; Iterator i = rhdr . getParameterNames ( ) ; while ( i . hasNext ( ) ) { String parm = ( String ) i . next ( ) ; LOG . trace ( "RouteHeader parameter {}: {}" , parm , rhdr . getParameter ( parm ) ) ; } } } ListIterator rrhdrs = msg . getHeaders ( RecordRouteHeader . NAME ) ; while ( rrhdrs . hasNext ( ) ) { RecordRouteHeader rrhdr = ( RecordRouteHeader ) rrhdrs . next ( ) ; if ( rrhdr != null ) { LOG . trace ( "RecordRouteHeader address: {}" , rrhdr . getAddress ( ) ) ; Iterator i = rrhdr . getParameterNames ( ) ; while ( i . hasNext ( ) ) { String parm = ( String ) i . next ( ) ; LOG . trace ( "RecordRouteHeader parameter {}: {}" , parm , rrhdr . getParameter ( parm ) ) ; } } } } | Outputs to console the provided header string followed by the message . |
38,487 | protected Response createNotifyResponse ( RequestEvent request , int status , String reason , List < Header > additionalHeaders ) { initErrorInfo ( ) ; if ( ( request == null ) || ( request . getRequest ( ) == null ) ) { setReturnCode ( SipSession . INVALID_ARGUMENT ) ; setErrorMessage ( "Null request given for creating NOTIFY response" ) ; return null ; } Request req = request . getRequest ( ) ; String cseqStr = "CSEQ " + ( ( CSeqHeader ) req . getHeader ( CSeqHeader . NAME ) ) . getSeqNumber ( ) ; LOG . trace ( "Creating NOTIFY {} response with status code {}, reason phrase = {}" , cseqStr , status , reason ) ; try { Response response = parent . getMessageFactory ( ) . createResponse ( status , req ) ; if ( reason != null ) { response . setReasonPhrase ( reason ) ; } ( ( ToHeader ) response . getHeader ( ToHeader . NAME ) ) . setTag ( myTag ) ; response . addHeader ( ( ContactHeader ) parent . getContactInfo ( ) . getContactHeader ( ) . clone ( ) ) ; if ( additionalHeaders != null ) { Iterator < Header > i = additionalHeaders . iterator ( ) ; while ( i . hasNext ( ) ) { response . addHeader ( i . next ( ) ) ; } } return response ; } catch ( Exception e ) { setReturnCode ( SipSession . EXCEPTION_ENCOUNTERED ) ; setException ( e ) ; setErrorMessage ( "Exception: " + e . getClass ( ) . getName ( ) + ": " + e . getMessage ( ) ) ; } return null ; } | if returns null returnCode and errorMessage already set |
38,488 | public boolean unregister ( String contact , long timeout ) { initErrorInfo ( ) ; if ( lastRegistrationRequest == null ) { return true ; } Request msg = ( Request ) lastRegistrationRequest . clone ( ) ; try { ExpiresHeader expires = parent . getHeaderFactory ( ) . createExpiresHeader ( 0 ) ; msg . setExpires ( expires ) ; cseq . setSeqNumber ( cseq . getSeqNumber ( ) + 1 ) ; cseq . setMethod ( Request . REGISTER ) ; msg . setHeader ( cseq ) ; if ( contact != null ) { ContactHeader contact_hdr ; if ( ! contact . equals ( "*" ) ) { URI contact_uri = parent . getAddressFactory ( ) . createURI ( contact ) ; Address contact_address = parent . getAddressFactory ( ) . createAddress ( contact_uri ) ; contact_hdr = parent . getHeaderFactory ( ) . createContactHeader ( contact_address ) ; } else { contact_hdr = parent . getHeaderFactory ( ) . createContactHeader ( ) ; } msg . setHeader ( contact_hdr ) ; } Response response = sendRegistrationMessage ( msg , null , null , 30000 ) ; if ( response == null ) { return false ; } clearAuthorizations ( myRegistrationId ) ; lastRegistrationRequest = null ; return true ; } catch ( Exception ex ) { setReturnCode ( EXCEPTION_ENCOUNTERED ) ; setErrorMessage ( "Exception: " + ex . getClass ( ) . getName ( ) + ": " + ex . getMessage ( ) ) ; return false ; } } | This method performs the SIP unregistration process . It returns true if unregistration was successful or no unregistration was needed and false otherwise . Any authorization headers required for the last registration are cleared out . If there was no previous registration this method does not send any messages . |
38,489 | public SipCall createSipCall ( ) { initErrorInfo ( ) ; SipCall call = new SipCall ( this , myAddress ) ; callList . add ( call ) ; return call ; } | This method is used to create a SipCall object for handling one leg of a call . That is it represents an outgoing call leg or an incoming call leg . In a telephone call there are two call legs . The outgoing call leg is the connection from the phone making the call to the telephone network . The incoming call leg is a connection from the telephone network to the phone being called . For a SIP call the outbound leg is the user agent originating the call and the inbound leg is the user agent receiving the call . The test program can use this method to create a SipCall object for handling an incoming call leg or an outgoing call leg . Currently only one SipCall object is supported per SipPhone . In future when more than one SipCall per SipPhone is supported this method can be called multiple times to create multiple call legs on the same SipPhone object . |
38,490 | public SipCall makeCall ( String to , int response , long timeout , String viaNonProxyRoute ) { return makeCall ( to , response , timeout , viaNonProxyRoute , null , null , null ) ; } | This blocking basic method is used to make an outgoing call . It blocks until the specified INVITE response status code is received . The object returned is a SipCall object representing the outgoing call leg ; that is the UAC originating a call to the network . Then you can take subsequent action on the call by making method calls on the SipCall object . |
38,491 | public static String calculateResponse ( String algorithm , String username_value , String realm_value , String passwd , String nonce_value , String nc_value , String cnonce_value , String Method , String digest_uri_value , String entity_body , String qop_value ) { if ( username_value == null || realm_value == null || passwd == null || Method == null || digest_uri_value == null || nonce_value == null ) throw new NullPointerException ( "Null parameter to MessageDigestAlgorithm.calculateResponse()" ) ; String A1 = null ; if ( algorithm == null || algorithm . trim ( ) . length ( ) == 0 || algorithm . trim ( ) . equalsIgnoreCase ( "MD5" ) ) { A1 = username_value + ":" + realm_value + ":" + passwd ; } else { if ( cnonce_value == null || cnonce_value . length ( ) == 0 ) throw new NullPointerException ( "cnonce_value may not be absent for MD5-Sess algorithm." ) ; A1 = H ( username_value + ":" + realm_value + ":" + passwd ) + ":" + nonce_value + ":" + cnonce_value ; } String A2 = null ; if ( qop_value == null || qop_value . trim ( ) . length ( ) == 0 || qop_value . trim ( ) . equalsIgnoreCase ( "auth" ) ) { A2 = Method + ":" + digest_uri_value ; } else { if ( entity_body == null ) entity_body = "" ; A2 = Method + ":" + digest_uri_value + ":" + H ( entity_body ) ; } String request_digest = null ; if ( cnonce_value != null && qop_value != null && ( qop_value . equals ( "auth" ) || ( qop_value . equals ( "auth-int" ) ) ) ) { request_digest = KD ( H ( A1 ) , nonce_value + ":" + nc_value + ":" + cnonce_value + ":" + qop_value + ":" + H ( A2 ) ) ; } else { request_digest = KD ( H ( A1 ) , nonce_value + ":" + H ( A2 ) ) ; } return request_digest ; } | Calculates a response an http authentication response in accordance with rfc2617 . |
38,492 | public String getRequestURI ( ) { if ( ( message == null ) || ( ( ( Request ) message ) . getRequestURI ( ) == null ) ) { return "" ; } return ( ( Request ) message ) . getRequestURI ( ) . toString ( ) ; } | Returns the request URI line of the request message or an empty string if there isn t one . The request URI indicates the user or service to which this request is addressed . |
38,493 | public boolean isSipURI ( ) { if ( ( message == null ) || ( ( ( Request ) message ) . getRequestURI ( ) == null ) ) { return false ; } return ( ( Request ) message ) . getRequestURI ( ) . isSipURI ( ) ; } | Indicates if the request URI in the request message is a URI with a scheme of sip or sips . |
38,494 | public boolean isInvite ( ) { if ( message == null ) { return false ; } return ( ( ( Request ) message ) . getMethod ( ) . equals ( Request . INVITE ) ) ; } | Indicates if the request method is INVITE or not . |
38,495 | public boolean isAck ( ) { if ( message == null ) { return false ; } return ( ( ( Request ) message ) . getMethod ( ) . equals ( Request . ACK ) ) ; } | Indicates if the request method is ACK or not . |
38,496 | public boolean isBye ( ) { if ( message == null ) { return false ; } return ( ( ( Request ) message ) . getMethod ( ) . equals ( Request . BYE ) ) ; } | Indicates if the request method is BYE or not . |
38,497 | public boolean isNotify ( ) { if ( message == null ) { return false ; } return ( ( ( Request ) message ) . getMethod ( ) . equals ( Request . NOTIFY ) ) ; } | Indicates if the request method is NOTIFY or not . |
38,498 | public boolean isSubscribe ( ) { if ( message == null ) { return false ; } return ( ( ( Request ) message ) . getMethod ( ) . equals ( Request . SUBSCRIBE ) ) ; } | Indicates if the request method is SUBSCRIBE or not . |
38,499 | public void schedule ( TimerTask task , Date time ) { timer . schedule ( new TimerTaskWrapper ( task ) , time ) ; } | Schedules the specified task for execution at the specified time . If the time is in the past the task is scheduled for immediate execution . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.