idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
37,300 | public static ChangeRequestAttribute createChangeRequestAttribute ( boolean changeIP , boolean changePort ) { ChangeRequestAttribute attribute = new ChangeRequestAttribute ( ) ; attribute . setAddressChanging ( changeIP ) ; attribute . setPortChanging ( changePort ) ; return attribute ; } | Creates a ChangeRequestAttribute with the specified flag values . | 55 | 12 |
37,301 | public static ChangedAddressAttribute createChangedAddressAttribute ( TransportAddress address ) { ChangedAddressAttribute attribute = new ChangedAddressAttribute ( ) ; attribute . setAddress ( address ) ; return attribute ; } | Creates a changedAddressAttribute of the specified type and with the specified address and port | 39 | 17 |
37,302 | public static ErrorCodeAttribute createErrorCodeAttribute ( byte errorClass , byte errorNumber , String reasonPhrase ) throws StunException { ErrorCodeAttribute attribute = new ErrorCodeAttribute ( ) ; attribute . setErrorClass ( errorClass ) ; attribute . setErrorNumber ( errorNumber ) ; attribute . setReasonPhrase ( ... | Creates an ErrorCodeAttribute with the specified error class number and reason phrase . | 100 | 16 |
37,303 | public static ErrorCodeAttribute createErrorCodeAttribute ( char errorCode , String reasonPhrase ) throws IllegalArgumentException { ErrorCodeAttribute attribute = new ErrorCodeAttribute ( ) ; attribute . setErrorCode ( errorCode ) ; attribute . setReasonPhrase ( reasonPhrase == null ? ErrorCodeAttribute . getDefaultRe... | Creates an ErrorCodeAttribute with the specified error code and reason phrase . | 88 | 15 |
37,304 | public static MappedAddressAttribute createMappedAddressAttribute ( TransportAddress address ) { MappedAddressAttribute attribute = new MappedAddressAttribute ( ) ; attribute . setAddress ( address ) ; return attribute ; } | Creates a MappedAddressAttribute of the specified type and with the specified address and port | 43 | 18 |
37,305 | public static ReflectedFromAttribute createReflectedFromAttribute ( TransportAddress address ) { ReflectedFromAttribute attribute = new ReflectedFromAttribute ( ) ; attribute . setAddress ( address ) ; return attribute ; } | Creates a ReflectedFromAddressAttribute of the specified type and with the specified address and port | 43 | 19 |
37,306 | public static ResponseAddressAttribute createResponseAddressAttribute ( TransportAddress address ) { ResponseAddressAttribute attribute = new ResponseAddressAttribute ( ) ; attribute . setAddress ( address ) ; return attribute ; } | Creates a ResponseFromAddressAttribute of the specified type and with the specified address and port | 39 | 18 |
37,307 | public static SourceAddressAttribute createSourceAddressAttribute ( TransportAddress address ) { SourceAddressAttribute attribute = new SourceAddressAttribute ( ) ; attribute . setAddress ( address ) ; return attribute ; } | Creates a SourceFromAddressAttribute of the specified type and with the specified address and port | 39 | 18 |
37,308 | public static XorRelayedAddressAttribute createXorRelayedAddressAttribute ( TransportAddress address , byte [ ] tranID ) { XorRelayedAddressAttribute attribute = new XorRelayedAddressAttribute ( ) ; // TODO shouldn't we be XORing the address before setting it? attribute . setAddress ( address , tranID ) ; return attrib... | Creates a XorRelayedAddressAttribute of the specified type and with the specified address and port . | 78 | 21 |
37,309 | public static XorPeerAddressAttribute createXorPeerAddressAttribute ( TransportAddress address , byte [ ] tranID ) { XorPeerAddressAttribute attribute = new XorPeerAddressAttribute ( ) ; // TODO shouldn't we be XORing the address before setting it? attribute . setAddress ( address , tranID ) ; return attribute ; } | Creates a XorPeerAddressAttribute of the specified type and with the specified address and port | 78 | 20 |
37,310 | public static UsernameAttribute createUsernameAttribute ( byte username [ ] ) { UsernameAttribute attribute = new UsernameAttribute ( ) ; attribute . setUsername ( username ) ; return attribute ; } | Create a UsernameAttribute . | 38 | 5 |
37,311 | public static ChannelNumberAttribute createChannelNumberAttribute ( char channelNumber ) { ChannelNumberAttribute attribute = new ChannelNumberAttribute ( ) ; attribute . setChannelNumber ( channelNumber ) ; return attribute ; } | Create a ChannelNumberAttribute . | 41 | 6 |
37,312 | public static RealmAttribute createRealmAttribute ( byte realm [ ] ) { RealmAttribute attribute = new RealmAttribute ( ) ; attribute . setRealm ( realm ) ; return attribute ; } | Create a RealmAttribute . | 38 | 5 |
37,313 | public static NonceAttribute createNonceAttribute ( byte nonce [ ] ) { NonceAttribute attribute = new NonceAttribute ( ) ; attribute . setNonce ( nonce ) ; return attribute ; } | Create a NonceAttribute . | 43 | 6 |
37,314 | public static SoftwareAttribute createSoftwareAttribute ( byte software [ ] ) { SoftwareAttribute attribute = new SoftwareAttribute ( ) ; attribute . setSoftware ( software ) ; return attribute ; } | Create a SoftwareAttribute . | 36 | 5 |
37,315 | public static EvenPortAttribute createEvenPortAttribute ( boolean rFlag ) { EvenPortAttribute attribute = new EvenPortAttribute ( ) ; attribute . setRFlag ( rFlag ) ; return attribute ; } | Create a EventAttribute . | 41 | 5 |
37,316 | public static LifetimeAttribute createLifetimeAttribute ( int lifetime ) { LifetimeAttribute attribute = new LifetimeAttribute ( ) ; attribute . setLifetime ( lifetime ) ; return attribute ; } | Create a LifetimeAttribute . | 38 | 5 |
37,317 | public static RequestedTransportAttribute createRequestedTransportAttribute ( byte protocol ) { RequestedTransportAttribute attribute = new RequestedTransportAttribute ( ) ; attribute . setRequestedTransport ( protocol ) ; return attribute ; } | Create a RequestedTransportAttribute . | 49 | 8 |
37,318 | public static ReservationTokenAttribute createReservationTokenAttribute ( byte token [ ] ) { ReservationTokenAttribute attribute = new ReservationTokenAttribute ( ) ; attribute . setReservationToken ( token ) ; return attribute ; } | Create a ReservationTokenAttribute . | 46 | 7 |
37,319 | public static ControlledAttribute createIceControlledAttribute ( long tieBreaker ) { ControlledAttribute attribute = new ControlledAttribute ( ) ; attribute . setTieBreaker ( tieBreaker ) ; return attribute ; } | Creates an Controlled Attribute object with the specified tie - breaker value | 43 | 14 |
37,320 | public static PriorityAttribute createPriorityAttribute ( long priority ) throws IllegalArgumentException { PriorityAttribute attribute = new PriorityAttribute ( ) ; attribute . setPriority ( priority ) ; return attribute ; } | Creates a Priority attribute with the specified priority value | 41 | 10 |
37,321 | public static ControllingAttribute createIceControllingAttribute ( long tieBreaker ) { ControllingAttribute attribute = new ControllingAttribute ( ) ; attribute . setTieBreaker ( tieBreaker ) ; return attribute ; } | Creates an Controlling Attribute with the specified tie - breaker value | 46 | 14 |
37,322 | public static DestinationAddressAttribute createDestinationAddressAttribute ( TransportAddress address ) { DestinationAddressAttribute attribute = new DestinationAddressAttribute ( ) ; attribute . setAddress ( address ) ; return attribute ; } | Creates a DestinationFromAddressAttribute of the specified type and with the specified address and port | 40 | 18 |
37,323 | public void bind ( boolean isLocal , int port ) throws IOException { try { // Open this channel with UDP Manager on first available address this . selectionKey = udpManager . open ( this ) ; this . dataChannel = ( DatagramChannel ) this . selectionKey . channel ( ) ; } catch ( IOException e ) { throw new SocketExceptio... | Binds the channel to an address and port | 123 | 9 |
37,324 | public void parse ( byte [ ] data ) throws ParseException { Text text = new Text ( ) ; text . strain ( data , 0 , data . length ) ; init ( text ) ; } | Reads descriptor from binary data | 41 | 6 |
37,325 | public Set < Integer > getConnections ( String endpointId ) { return Collections . unmodifiableSet ( this . entries . get ( endpointId ) ) ; } | Gets the list of currently registered connections in the Call . | 34 | 12 |
37,326 | public boolean addConnection ( String endpointId , int connectionId ) { boolean added = this . entries . put ( endpointId , connectionId ) ; if ( added && log . isDebugEnabled ( ) ) { int left = this . entries . get ( endpointId ) . size ( ) ; log . debug ( "Call " + getCallIdHex ( ) + " registered connection " + Integ... | Registers a connection in the call . | 114 | 8 |
37,327 | public boolean removeConnection ( String endpointId , int connectionId ) { boolean removed = this . entries . remove ( endpointId , connectionId ) ; if ( removed && log . isDebugEnabled ( ) ) { int left = this . entries . get ( endpointId ) . size ( ) ; log . debug ( "Call " + getCallIdHex ( ) + " unregistered connecti... | Unregisters a connection from the call . | 115 | 9 |
37,328 | public Set < Integer > removeConnections ( String endpointId ) { Set < Integer > removed = this . entries . removeAll ( endpointId ) ; if ( ! removed . isEmpty ( ) && log . isDebugEnabled ( ) ) { log . debug ( "Call " + getCallIdHex ( ) + " unregistered connections " + Arrays . toString ( convertToHex ( removed ) ) + "... | Unregisters all connections that belong to an endpoint . | 101 | 11 |
37,329 | private MgcpConnection createRemoteConnection ( int callId , ConnectionMode mode , MgcpEndpoint endpoint , CrcxContext context ) throws MgcpConnectionException { // Create connection MgcpConnection connection = endpoint . createConnection ( callId , false ) ; // TODO set call agent String localDescription = connection ... | Creates a new Remote Connection . | 104 | 7 |
37,330 | private MgcpConnection createLocalConnection ( int callId , MgcpEndpoint endpoint ) throws MgcpConnectionException { MgcpConnection connection = endpoint . createConnection ( callId , true ) ; connection . open ( null ) ; return connection ; } | Creates a new Local Connection . | 55 | 7 |
37,331 | public RTPFormats negotiateAudio ( SessionDescription sdp , RTPFormats formats ) { this . audio . clean ( ) ; MediaDescriptorField descriptor = sdp . getAudioDescriptor ( ) ; descriptor . getFormats ( ) . intersection ( formats , this . audio ) ; return this . audio ; } | Negotiates the audio formats to be used in the call . | 69 | 13 |
37,332 | public RTPFormats negotiateVideo ( SessionDescription sdp , RTPFormats formats ) { this . video . clean ( ) ; MediaDescriptorField descriptor = sdp . getVideoDescriptor ( ) ; descriptor . getFormats ( ) . intersection ( formats , this . video ) ; return this . video ; } | Negotiates the video formats to be used in the call . | 69 | 13 |
37,333 | public RTPFormats negotiateApplication ( SessionDescription sdp , RTPFormats formats ) { this . application . clean ( ) ; MediaDescriptorField descriptor = sdp . getApplicationDescriptor ( ) ; descriptor . getFormats ( ) . intersection ( formats , this . application ) ; return this . application ; } | Negotiates the application formats to be used in the call . | 69 | 13 |
37,334 | private static RtcpSenderReport buildSenderReport ( RtpStatistics statistics , boolean padding ) { /* * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * header |V=2|P| RC | PT=SR=200 | length | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+... | Builds a packet containing an RTCP Sender Report . | 789 | 13 |
37,335 | private static RtcpReceiverReport buildReceiverReport ( RtpStatistics statistics , boolean padding ) { RtcpReceiverReport report = new RtcpReceiverReport ( padding , statistics . getSsrc ( ) ) ; long ssrc = statistics . getSsrc ( ) ; // Add receiver reports for each registered member List < Long > members = statistics ... | Builds a packet containing an RTCP Receiver Report | 163 | 11 |
37,336 | public static RtcpPacket buildReport ( RtpStatistics statistics ) { // TODO Validate padding boolean padding = false ; // Build the initial report packet RtcpReport report ; if ( statistics . hasSent ( ) ) { report = buildSenderReport ( statistics , padding ) ; } else { report = buildReceiverReport ( statistics , paddi... | Builds a packet containing an RTCP Report . | 124 | 11 |
37,337 | public static RtcpPacket buildBye ( RtpStatistics statistics ) { // TODO Validate padding boolean padding = false ; // Build the initial report packet RtcpReport report ; if ( statistics . hasSent ( ) ) { report = buildSenderReport ( statistics , padding ) ; } else { report = buildReceiverReport ( statistics , padding ... | Builds a packet containing an RTCP BYE message . | 164 | 13 |
37,338 | public void addLocalCandidates ( List < LocalCandidateWrapper > candidatesWrapper ) { for ( LocalCandidateWrapper candidateWrapper : candidatesWrapper ) { addLocalCandidate ( candidateWrapper , false ) ; } sortCandidates ( ) ; } | Registers a collection of local candidates to the component . | 56 | 11 |
37,339 | private void addLocalCandidate ( LocalCandidateWrapper candidateWrapper , boolean sort ) { IceCandidate candidate = candidateWrapper . getCandidate ( ) ; // Configure the candidate before registration candidate . setPriority ( calculatePriority ( candidate ) ) ; synchronized ( this . localCandidates ) { if ( ! this . l... | Attempts to registers a local candidate . | 104 | 7 |
37,340 | private Enumeration < NetworkInterface > getNetworkInterfaces ( ) throws HarvestException { try { return NetworkInterface . getNetworkInterfaces ( ) ; } catch ( SocketException e ) { throw new HarvestException ( "Could not retrieve list of available Network Interfaces." , e ) ; } } | Finds all Network interfaces available on this server . | 61 | 10 |
37,341 | private boolean useNetworkInterface ( NetworkInterface networkInterface ) throws HarvestException { try { return ! networkInterface . isLoopback ( ) && networkInterface . isUp ( ) ; } catch ( SocketException e ) { throw new HarvestException ( "Could not evaluate whether network interface is loopback." , e ) ; } } | Decides whether a certain network interface can be used as a host candidate . | 66 | 15 |
37,342 | private List < InetAddress > findAddresses ( ) throws HarvestException { // Stores found addresses List < InetAddress > found = new ArrayList < InetAddress > ( 3 ) ; // Retrieve list of available network interfaces Enumeration < NetworkInterface > interfaces = getNetworkInterfaces ( ) ; while ( interfaces . hasMoreElem... | Finds available addresses that will be used to gather candidates from . | 217 | 13 |
37,343 | private DatagramChannel openUdpChannel ( InetAddress localAddress , int port , Selector selector ) throws IOException { DatagramChannel channel = DatagramChannel . open ( ) ; channel . configureBlocking ( false ) ; // Register selector for reading operations channel . register ( selector , SelectionKey . OP_READ | Sele... | Opens a datagram channel and binds it to an address . | 97 | 13 |
37,344 | private boolean gatherCandidate ( IceComponent component , InetAddress address , int startingPort , RtpPortManager portManager , Selector selector ) { // Recursion stop criteria if ( startingPort == portManager . peek ( ) ) { return false ; } // Gather the candidate using current port try { int port = portManager . cur... | Gathers a candidate and registers it in the respective ICE Component . A datagram channel will be bound to the local candidate address . | 189 | 27 |
37,345 | public byte [ ] process ( byte [ ] media ) { frame ++ ; float [ ] new_speech = new float [ media . length ] ; short [ ] shortMedia = Util . byteArrayToShortArray ( media ) ; for ( int i = 0 ; i < LD8KConstants . L_FRAME ; i ++ ) { new_speech [ i ] = ( float ) shortMedia [ i ] ; } preProc . pre_process ( new_speech , LD... | Perform compression . | 184 | 4 |
37,346 | public void exclude ( String formatName ) { for ( int i = 0 ; i < count ; i ++ ) { md [ i ] . exclude ( formatName ) ; } } | Excludes specified formats from descriptor . | 37 | 7 |
37,347 | public boolean contains ( String encoding ) { if ( encoding . equalsIgnoreCase ( "sendrecv" ) || encoding . equalsIgnoreCase ( "fmtp" ) || encoding . equalsIgnoreCase ( "audio" ) || encoding . equalsIgnoreCase ( "AS" ) || encoding . equalsIgnoreCase ( "IP4" ) ) { return true ; } for ( int i = 0 ; i < count ; i ++ ) { i... | Checks that specified format is described by this sdp . | 117 | 12 |
37,348 | private void cancelSignals ( ) { Iterator < String > keys = this . signals . keySet ( ) . iterator ( ) ; while ( keys . hasNext ( ) ) { cancelSignal ( keys . next ( ) ) ; } } | Cancels any ongoing signal . | 51 | 7 |
37,349 | public static boolean isInRangeV4 ( byte [ ] network , byte [ ] subnet , byte [ ] ipAddress ) { if ( network . length != 4 || subnet . length != 4 || ipAddress . length != 4 ) return false ; return compareByteValues ( network , subnet , ipAddress ) ; } | Checks whether ipAddress is in IPV4 network with specified subnet | 67 | 15 |
37,350 | public static boolean isInRangeV6 ( byte [ ] network , byte [ ] subnet , byte [ ] ipAddress ) { if ( network . length != 16 || subnet . length != 16 || ipAddress . length != 16 ) return false ; return compareByteValues ( network , subnet , ipAddress ) ; } | Checks whether ipAddress is in IPV6 network with specified subnet | 67 | 15 |
37,351 | private static boolean compareByteValues ( byte [ ] network , byte [ ] subnet , byte [ ] ipAddress ) { for ( int i = 0 ; i < network . length ; i ++ ) if ( ( network [ i ] & subnet [ i ] ) != ( ipAddress [ i ] & subnet [ i ] ) ) return false ; return true ; } | Checks whether ipAddress is in network with specified subnet by comparing byte logical end values | 77 | 18 |
37,352 | public static IPAddressType getAddressType ( String ipAddress ) { if ( IPAddressUtil . isIPv4LiteralAddress ( ipAddress ) ) return IPAddressType . IPV4 ; if ( IPAddressUtil . isIPv6LiteralAddress ( ipAddress ) ) return IPAddressType . IPV6 ; return IPAddressType . INVALID ; } | Gets IP address type | 88 | 5 |
37,353 | public void start ( ) { synchronized ( LOCK ) { if ( ! this . active ) { this . active = true ; logger . info ( "Starting UDP Manager" ) ; try { generateTasks ( ) ; logger . info ( "Initialized UDP interface[" + inet + "]: bind address=" + bindAddress ) ; } catch ( IOException e ) { logger . error ( "An error occurred ... | Starts polling the network . | 103 | 6 |
37,354 | public void stop ( ) { synchronized ( LOCK ) { if ( this . active ) { this . active = false ; logger . info ( "Stopping UDP Manager" ) ; stopTasks ( ) ; closeSelectors ( ) ; cleanResources ( ) ; logger . info ( "UDP Manager has stopped" ) ; } } } | Stops polling the network . | 70 | 6 |
37,355 | public IceMediaStream getMediaStream ( String streamName ) { IceMediaStream mediaStream ; synchronized ( mediaStreams ) { mediaStream = this . mediaStreams . get ( streamName ) ; } return mediaStream ; } | Gets a media stream by name | 47 | 7 |
37,356 | public void harvest ( RtpPortManager portManager ) throws HarvestException , NoCandidatesGatheredException { // Initialize the selector if necessary if ( this . selector == null || ! this . selector . isOpen ( ) ) { try { this . selector = Selector . open ( ) ; } catch ( IOException e ) { throw new HarvestException ( "... | Gathers all available candidates and sets the components of each media stream . | 130 | 15 |
37,357 | private void fireCandidatePairSelectedEvent ( ) { // Stop the ICE Agent this . stop ( ) ; // Fire the event to all listener List < IceEventListener > listeners ; synchronized ( this . iceListeners ) { listeners = new ArrayList < IceEventListener > ( this . iceListeners ) ; } SelectedCandidatesEvent event = new Selected... | Fires an event when all candidate pairs are selected . | 105 | 11 |
37,358 | public void getPayload ( byte [ ] buff , int offset ) { buffer . position ( FIXED_HEADER_SIZE ) ; buffer . get ( buff , offset , buffer . limit ( ) - FIXED_HEADER_SIZE ) ; } | Reads the data transported by RTP in a packet for example audio samples or compressed video data . | 52 | 20 |
37,359 | public void wrap ( boolean mark , int payloadType , int seqNumber , long timestamp , long ssrc , byte [ ] data , int offset , int len ) { buffer . clear ( ) ; buffer . rewind ( ) ; //no extensions, paddings and cc buffer . put ( ( byte ) 0x80 ) ; byte b = ( byte ) ( payloadType ) ; if ( mark ) { b = ( byte ) ( b | 0x80... | Encapsulates data into the packet for transmission via RTP . | 350 | 13 |
37,360 | public int getExtensionLength ( ) { if ( ! getExtensionBit ( ) ) return 0 ; //the extension length comes after the RTP header, the CSRC list, and //after two bytes in the extension header called "defined by profile" int extLenIndex = FIXED_HEADER_SIZE + getCsrcCount ( ) * 4 + 2 ; return ( ( buffer . get ( extLenIndex )... | Returns the length of the extensions currently added to this packet . | 107 | 12 |
37,361 | public void grow ( int delta ) { if ( delta == 0 ) { return ; } int newLen = buffer . limit ( ) + delta ; if ( newLen <= buffer . capacity ( ) ) { // there is more room in the underlying reserved buffer memory buffer . limit ( newLen ) ; return ; } else { // create a new bigger buffer ByteBuffer newBuffer = buffer . is... | Grow the internal packet buffer . | 139 | 7 |
37,362 | public MgcpEndpoint registerEndpoint ( String namespace ) throws UnrecognizedMgcpNamespaceException { // Get correct endpoint provider MgcpEndpointProvider < ? > provider = this . providers . get ( namespace ) ; if ( provider == null ) { throw new UnrecognizedMgcpNamespaceException ( "Namespace " + namespace + " is unr... | Registers a new endpoint . | 212 | 6 |
37,363 | public void unregisterEndpoint ( String endpointId ) throws MgcpEndpointNotFoundException { MgcpEndpoint endpoint = this . endpoints . remove ( endpointId ) ; if ( endpoint == null ) { throw new MgcpEndpointNotFoundException ( "Endpoint " + endpointId + " not found" ) ; } endpoint . forget ( ( MgcpMessageObserver ) thi... | Unregisters an active endpoint . | 155 | 7 |
37,364 | public void offer ( Event event ) { sequence += event . toString ( ) ; //check pattern matching if ( patterns != null && sequence . length ( ) > 0 ) { for ( int i = 0 ; i < patterns . length ; i ++ ) { if ( sequence . matches ( patterns [ i ] ) ) { listener . patternMatches ( i , sequence ) ; //nullify sequence; sequen... | Queues next event to the buffer . | 141 | 8 |
37,365 | private int getMax ( double data [ ] ) { int idx = 0 ; double max = data [ 0 ] ; for ( int i = 1 ; i < data . length ; i ++ ) { if ( max < data [ i ] ) { max = data [ i ] ; idx = i ; } } return idx ; } | Searches maximum value in the specified array . | 71 | 10 |
37,366 | private String getTone ( double f [ ] , double F [ ] ) { int fm = getMax ( f ) ; boolean fd = true ; for ( int i = 0 ; i < f . length ; i ++ ) { if ( fm == i ) { continue ; } double r = f [ fm ] / ( f [ i ] + 1E-15 ) ; if ( r < threshold ) { fd = false ; break ; } } if ( ! fd ) { return null ; } int Fm = getMax ( F ) ;... | Searches DTMF tone . | 213 | 8 |
37,367 | @ Override public void setMessageType ( char indicationType ) throws IllegalArgumentException { /* * old TURN DATA indication type is an indication despite 0x0115 & * 0x0110 indicates STUN error response type */ if ( ! isIndicationType ( indicationType ) && indicationType != StunMessage . OLD_DATA_INDICATION ) { throw ... | Checks whether indicationType is a valid indication type and if yes sets it as the type of this instance . | 114 | 22 |
37,368 | public void run ( ) { if ( this . isActive ) { try { perform ( ) ; //notify listener if ( this . listener != null ) { this . listener . onTerminate ( ) ; } } catch ( Exception e ) { logger . error ( "Could not execute task " + this . taskId + ": " + e . getMessage ( ) , e ) ; if ( this . listener != null ) { listener .... | call should not be synchronized since can run only once in queue cycle | 102 | 13 |
37,369 | public byte [ ] encode ( ) { char type = getAttributeType ( ) ; byte binValue [ ] = new byte [ HEADER_LENGTH + getDataLength ( ) ] ; // Type binValue [ 0 ] = ( byte ) ( type >> 8 ) ; binValue [ 1 ] = ( byte ) ( type & 0x00FF ) ; // Length binValue [ 2 ] = ( byte ) ( getDataLength ( ) >> 8 ) ; binValue [ 3 ] = ( byte ) ... | Returns a binary representation of this attribute . | 122 | 8 |
37,370 | public void push ( String symbol ) { long now = System . currentTimeMillis ( ) ; if ( ! symbol . equals ( lastSymbol ) || ( now - lastActivity > interdigitInterval ) ) { lastActivity = now ; lastSymbol = symbol ; detectorImpl . fireEvent ( symbol ) ; } else lastActivity = now ; } | Handles inter digit intervals . | 73 | 6 |
37,371 | protected void queue ( DtmfEventImpl evt ) { if ( queue . size ( ) == size ) { queue . poll ( ) ; } queue . offer ( evt ) ; logger . info ( String . format ( "(%s) Buffer size: %d" , detectorImpl . getName ( ) , queue . size ( ) ) ) ; } | Queues specified event . | 75 | 5 |
37,372 | public void flush ( ) { logger . info ( String . format ( "(%s) Flush, buffer size: %d" , detectorImpl . getName ( ) , queue . size ( ) ) ) ; while ( queue . size ( ) > 0 ) detectorImpl . fireEvent ( queue . poll ( ) ) ; } | Flushes the buffer content . | 68 | 6 |
37,373 | public Date getCreationTime ( ) { calendar . set ( Calendar . YEAR , 1904 ) ; calendar . set ( Calendar . MONTH , Calendar . JANUARY ) ; calendar . set ( Calendar . DATE , 1 ) ; calendar . set ( Calendar . HOUR_OF_DAY , 0 ) ; calendar . set ( Calendar . MINUTE , 0 ) ; calendar . set ( Calendar . SECOND , 0 ) ; calendar... | Gets the creation time of this presentation . | 114 | 9 |
37,374 | public String generateFingerprint ( String hashFunction ) { try { this . hashFunction = hashFunction ; org . bouncycastle . crypto . tls . Certificate chain = TlsUtils . loadCertificateChain ( certificateResources ) ; Certificate certificate = chain . getCertificateAt ( 0 ) ; return TlsUtils . fingerprint ( this . hash... | Gets the fingerprint of the Certificate associated to the server . | 114 | 12 |
37,375 | public void getCipherStream ( BlockCipher aesCipher , byte [ ] out , int length , byte [ ] iv ) { System . arraycopy ( iv , 0 , cipherInBlock , 0 , 14 ) ; int ctr ; for ( ctr = 0 ; ctr < length / BLKLEN ; ctr ++ ) { // compute the cipher stream cipherInBlock [ 14 ] = ( byte ) ( ( ctr & 0xFF00 ) >> 8 ) ; cipherInBlock [... | Computes the cipher stream for AES CM mode . See section 4 . 1 . 1 in RFC3711 for detailed description . | 255 | 25 |
37,376 | private void processComponents ( MAPDialogImpl mapDialogImpl , Component [ ] components ) { // Now let us decode the Components for ( Component c : components ) { doProcessComponent ( mapDialogImpl , c ) ; } } | private service methods | 47 | 3 |
37,377 | private void fireTCAbortACNNotSupported ( Dialog tcapDialog , MAPExtensionContainer mapExtensionContainer , ApplicationContextName alternativeApplicationContext , boolean returnMessageOnError ) throws MAPException { if ( this . getTCAPProvider ( ) . getPreviewMode ( ) ) { return ; } if ( tcapDialog . getApplicationCont... | Issue TC - U - ABORT with the abort reason = application - content - name - not - supported | 430 | 21 |
37,378 | protected void fireTCAbortUser ( Dialog tcapDialog , MAPUserAbortChoice mapUserAbortChoice , MAPExtensionContainer mapExtensionContainer , boolean returnMessageOnError ) throws MAPException { if ( this . getTCAPProvider ( ) . getPreviewMode ( ) ) { return ; } if ( tcapDialog . getApplicationContextName ( ) == null ) //... | Issue TC - U - ABORT with the ABRT apdu with MAPUserAbortInfo userInformation | 389 | 21 |
37,379 | protected void fireTCAbortProvider ( Dialog tcapDialog , MAPProviderAbortReason mapProviderAbortReason , MAPExtensionContainer mapExtensionContainer , boolean returnMessageOnError ) throws MAPException { if ( this . getTCAPProvider ( ) . getPreviewMode ( ) ) { return ; } if ( tcapDialog . getApplicationContextName ( ) ... | Issue TC - U - ABORT with the ABRT apdu with MAPProviderAbortInfo userInformation | 385 | 21 |
37,380 | protected void fireTCAbortV1 ( Dialog tcapDialog , boolean returnMessageOnError ) throws MAPException { if ( this . getTCAPProvider ( ) . getPreviewMode ( ) ) { return ; } TCUserAbortRequest tcUserAbort = this . getTCAPProvider ( ) . getDialogPrimitiveFactory ( ) . createUAbort ( tcapDialog ) ; if ( returnMessageOnErro... | Issue TC - U - ABORT without any apdu - for MAP V1 | 145 | 16 |
37,381 | protected void startInitialAlignment ( boolean resetTxOffset ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( String . format ( "(%s) Starting initial alignment" , name ) ) ; } // Comment from Oleg: this is done initialy to setup correct spot in tx // buffer: dunno, I just believe, for now. if ( resetTxOffset ... | should not be used | 159 | 4 |
37,382 | private void processRx ( byte [ ] buff , int len ) { int i = 0 ; // start HDLC alg while ( i < len ) { while ( rxState . bits <= 24 && i < len ) { int b = buff [ i ++ ] & 0xff ; hdlc . fasthdlc_rx_load_nocheck ( rxState , b ) ; if ( rxState . state == 0 ) { // octet counting mode nCount = ( nCount + 1 ) % 16 ; if ( nCo... | Handles received data . | 521 | 5 |
37,383 | private void countFrame ( ) { if ( state == MTP2_ALIGNED_READY || state == MTP2_INSERVICE ) { dCount = ( dCount + 1 ) % 256 ; // decrement error countor for each 256 frames if ( dCount == 0 && eCount > 0 ) { eCount -- ; } } } | Increment number of received frames decrement error monitor countor for each 256 good frames . | 75 | 18 |
37,384 | public static void main ( String [ ] args ) throws Throwable { String homeDir = getHomeDir ( args ) ; System . setProperty ( TRACE_PARSER_HOME , homeDir ) ; String dataDir = homeDir + File . separator + "data" + File . separator ; System . setProperty ( TRACE_PARSER_DATA , dataDir ) ; if ( ! initLOG4JProperties ( homeD... | private int httpPort = - 1 ; | 284 | 8 |
37,385 | protected void encode ( ByteBuffer txBuffer ) { txBuffer . position ( 4 ) ; // Length int txBuffer . put ( data ) ; int length = txBuffer . position ( ) ; txBuffer . rewind ( ) ; txBuffer . putInt ( length ) ; txBuffer . position ( length ) ; } | Encodes this message . The protocol is first 4 bytes are length of this command followed by the byte stream of command | 65 | 23 |
37,386 | public void initializeMessageNumbering ( SccpConnDt2MessageImpl msg ) { sendSequenceNumber = getNextSequenceNumber ( ) ; msg . setSequencing ( sendSequenceNumber , sendSequenceNumberExpectedAtInput ) ; inputWindow . setLowerEdge ( sendSequenceNumberExpectedAtInput ) ; } | IT DT2 AK | 71 | 4 |
37,387 | public boolean checkInputMessageNumbering ( SccpConnectionImpl conn , SequenceNumber sendSequenceNumber , SequenceNumber receiveSequenceNumber ) throws Exception { if ( sendSequenceNumber != null ) { if ( expectingFirstMessageInputAfterInit && ! sendSequenceNumber . equals ( new SequenceNumberImpl ( 0 ) ) ) { // local ... | if true then message can be accepted | 402 | 7 |
37,388 | public void reinitialize ( ) { inputWindow = new SccpFlowControlWindow ( new SequenceNumberImpl ( 0 ) , maximumWindowSize ) ; outputWindow = new SccpFlowControlWindow ( new SequenceNumberImpl ( 0 ) , maximumWindowSize ) ; sendSequenceNumberExpectedAtInput = new SequenceNumberImpl ( 0 ) ; // inputWindow.setLowerEdge(sen... | after connection establishing and on connection reset | 134 | 7 |
37,389 | private void rebind ( Object stack ) throws NamingException { if ( jndiName != null ) { Context ctx = new InitialContext ( ) ; String [ ] tokens = jndiName . split ( "/" ) ; for ( int i = 0 ; i < tokens . length - 1 ; i ++ ) { if ( tokens [ i ] . trim ( ) . length ( ) > 0 ) { try { ctx = ( Context ) ctx . lookup ( toke... | Binds trunk object to the JNDI under the jndiName . | 152 | 16 |
37,390 | private void unbind ( String jndiName ) throws NamingException { InitialContext initialContext = new InitialContext ( ) ; initialContext . unbind ( jndiName ) ; } | Unbounds object under specified name . | 40 | 8 |
37,391 | public void handleHeartbeat ( Heartbeat hrtBeat ) { HeartbeatAck hrtBeatAck = ( HeartbeatAck ) this . aspFactoryImpl . messageFactory . createMessage ( MessageClass . ASP_STATE_MAINTENANCE , MessageType . HEARTBEAT_ACK ) ; hrtBeatAck . setHeartbeatData ( hrtBeat . getHeartbeatData ( ) ) ; this . aspFactoryImpl . write ... | If we receive Heartbeat we send back response | 105 | 9 |
37,392 | protected void reset ( ) { for ( RouteMap . Entry < String , RouteAsImpl > e = this . route . head ( ) , end = this . route . tail ( ) ; ( e = e . getNext ( ) ) != end ; ) { String key = e . getKey ( ) ; RouteAsImpl routeAs = e . getValue ( ) ; routeAs . setM3uaManagement ( this . m3uaManagement ) ; routeAs . reset ( )... | Reset the routeTable . Called after the persistance state of route is read from xml file . | 254 | 20 |
37,393 | public Message createMessage ( ByteBuffer buffer ) { if ( ! isHeaderReady ) { int len = Math . min ( MESSAGE_HEADER_SIZE - pos , buffer . remaining ( ) ) ; buffer . get ( header , pos , len ) ; // update cursor postion in the header's buffer pos += len ; // header completed? isHeaderReady = pos == header . length ; if ... | The received buffer may not have necessary bytes to decode a message . Instance of this factory keeps data locally till next set of data is received and a message can be successfully decoded | 399 | 36 |
37,394 | protected void encodeMandatoryVariableParameters ( Map < Integer , ISUPParameter > parameters , ByteArrayOutputStream bos , boolean isOptionalPartPresent ) throws ParameterException { try { byte [ ] pointers = null ; // complicated if ( ! mandatoryVariablePartPossible ( ) ) { // we ommit pointer to this part, go straig... | takes care of endoding parameters - poniters and actual parameters . | 588 | 16 |
37,395 | protected int decodeMandatoryParameters ( ISUPParameterFactory parameterFactory , byte [ ] b , int index ) throws ParameterException { int localIndex = index ; if ( b . length - index >= 3 ) { try { byte [ ] cic = new byte [ 2 ] ; cic [ 0 ] = b [ index ++ ] ; cic [ 1 ] = b [ index ++ ] ; this . cic = new CircuitIdentif... | Unfortunelty this cant be generic can it? | 283 | 12 |
37,396 | protected int decodeMandatoryVariableParameters ( ISUPParameterFactory parameterFactory , byte [ ] b , int index ) throws ParameterException { // FIXME: possibly this should also be per msg, since if msg lacks // proper parameter, decoding wotn pick this up and will throw // some bad output, which wont give a clue abou... | decodes ptrs and returns offset from passed index value to first optional parameter parameter | 378 | 16 |
37,397 | private boolean addIncomingInvokeId ( Long invokeId ) { synchronized ( this . incomingInvokeList ) { if ( this . incomingInvokeList . contains ( invokeId ) ) return false ; else { this . incomingInvokeList . add ( invokeId ) ; return true ; } } } | Adding the new incoming invokeId into incomingInvokeList list | 63 | 12 |
37,398 | public void resetTimer ( Long invokeId ) throws TCAPException { try { this . dialogLock . lock ( ) ; int index = getIndexFromInvokeId ( invokeId ) ; InvokeImpl invoke = operationsSent [ index ] ; if ( invoke == null ) { throw new TCAPException ( "No operation with this ID" ) ; } invoke . startTimer ( ) ; } finally { th... | TC - TIMER - RESET | 94 | 7 |
37,399 | public static String hexDump ( String label , byte [ ] bytes ) { final int modulo = 16 ; final int brk = modulo / 2 ; int indent = ( label == null ) ? 0 : label . length ( ) ; StringBuffer sb = new StringBuffer ( indent + 1 ) ; while ( indent > 0 ) { sb . append ( " " ) ; indent -- ; } String ind = sb . toString ( ) ; ... | Construct a String containing a hex - dump of a byte array | 554 | 12 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.