idx
int64 0
41.2k
| question
stringlengths 83
4.15k
| target
stringlengths 5
715
|
|---|---|---|
4,000
|
static ResourceAddress getLowestTransportLayer ( ResourceAddress transport ) { if ( transport . getTransport ( ) != null ) { return getLowestTransportLayer ( transport . getTransport ( ) ) ; } return transport ; }
|
Method returning lowest transport layer
|
4,001
|
public void handleNotification ( Notification notification , Object handback ) { String notificationType = notification . getType ( ) ; if ( notificationType . equals ( JMXConnectionNotification . OPENED ) ) { managementContext . incrementManagementSessionCount ( ) ; } else if ( notificationType . equals ( JMXConnectionNotification . CLOSED ) ) { managementContext . decrementManagementSessionCount ( ) ; } }
|
NotificationListener support for connection open and closed notifications
|
4,002
|
public HttpChallengeFactory lookup ( String authScheme ) { HttpChallengeFactory result ; if ( authScheme == null ) return null ; result = challengeFactoriesByAuthScheme . get ( authScheme ) ; if ( result == null ) { if ( authScheme . startsWith ( AUTH_SCHEME_APPLICATION_PREFIX ) ) { authScheme = authScheme . replaceFirst ( AUTH_SCHEME_APPLICATION_PREFIX , "" ) ; } result = challengeFactoriesByAuthScheme . get ( authScheme ) ; } return result ; }
|
public until unit test is moved
|
4,003
|
private static ByteBuffer putUnsignedLong ( ByteBuffer buffer , long v ) { buffer . putInt ( 0 ) ; return putUnsignedInt ( buffer , ( int ) v ) ; }
|
Puts an unsigned long .
|
4,004
|
protected void flushQueuedMessages ( IoSession session , AttachedSessionManager attachedSessionManager ) { Queue < Object > messageQueue = getMessageQueue ( session ) ; if ( messageQueue != null ) { flushQueuedMessages ( messageQueue , session , attachedSessionManager ) ; } }
|
called by connect listener in proxy service handler
|
4,005
|
public ChannelFuture joinGroup ( InetAddress multicastAddress , NetworkInterface networkInterface , InetAddress source ) { if ( DetectionUtil . javaVersion ( ) < 7 ) { throw new UnsupportedOperationException ( ) ; } if ( multicastAddress == null ) { throw new NullPointerException ( "multicastAddress" ) ; } if ( networkInterface == null ) { throw new NullPointerException ( "networkInterface" ) ; } try { MembershipKey key ; if ( source == null ) { key = channel . join ( multicastAddress , networkInterface ) ; } else { key = channel . join ( multicastAddress , networkInterface , source ) ; } synchronized ( this ) { if ( memberships == null ) { memberships = new HashMap < InetAddress , List < MembershipKey > > ( ) ; } List < MembershipKey > keys = memberships . get ( multicastAddress ) ; if ( keys == null ) { keys = new ArrayList < MembershipKey > ( ) ; memberships . put ( multicastAddress , keys ) ; } keys . add ( key ) ; } } catch ( Throwable e ) { return failedFuture ( this , e ) ; } return succeededFuture ( this ) ; }
|
Joins the specified multicast group at the specified interface using the specified source .
|
4,006
|
public ChannelFuture leaveGroup ( InetAddress multicastAddress , NetworkInterface networkInterface , InetAddress source ) { if ( DetectionUtil . javaVersion ( ) < 7 ) { throw new UnsupportedOperationException ( ) ; } else { if ( multicastAddress == null ) { throw new NullPointerException ( "multicastAddress" ) ; } if ( networkInterface == null ) { throw new NullPointerException ( "networkInterface" ) ; } synchronized ( this ) { if ( memberships != null ) { List < MembershipKey > keys = memberships . get ( multicastAddress ) ; if ( keys != null ) { Iterator < MembershipKey > keyIt = keys . iterator ( ) ; while ( keyIt . hasNext ( ) ) { MembershipKey key = keyIt . next ( ) ; if ( networkInterface . equals ( key . networkInterface ( ) ) ) { if ( source == null && key . sourceAddress ( ) == null || source != null && source . equals ( key . sourceAddress ( ) ) ) { key . drop ( ) ; keyIt . remove ( ) ; } } } if ( keys . isEmpty ( ) ) { memberships . remove ( multicastAddress ) ; } } } } return succeededFuture ( this ) ; } }
|
Leave the specified multicast group at the specified interface using the specified source .
|
4,007
|
public ChannelFuture block ( InetAddress multicastAddress , InetAddress sourceToBlock ) { try { block ( multicastAddress , NetworkInterface . getByInetAddress ( getLocalAddress ( ) . getAddress ( ) ) , sourceToBlock ) ; } catch ( SocketException e ) { return failedFuture ( this , e ) ; } return succeededFuture ( this ) ; }
|
Block the given sourceToBlock address for the given multicastAddress
|
4,008
|
private JSONArray getAlternativeNames ( Collection < List < ? > > alternativeNames ) { if ( alternativeNames == null || alternativeNames . size ( ) == 0 ) { return null ; } JSONArray altNames = new JSONArray ( ) ; for ( List < ? > altName : alternativeNames ) { String altNameValue = altName . get ( 1 ) . toString ( ) ; altNames . put ( altNameValue ) ; } return altNames ; }
|
Given an AlternativeNames structure return a JSONArray with the name strings .
|
4,009
|
public void startupSessionTimeoutCommand ( ) { if ( initSessionTimeoutCommand . compareAndSet ( false , true ) ) { final Long sessionTimeout = getSessionTimeout ( ) ; if ( sessionTimeout != null && sessionTimeout > 0 ) { if ( scheduledEventslogger . isTraceEnabled ( ) ) { scheduledEventslogger . trace ( "Establishing a session timeout of " + sessionTimeout + " seconds for WebSocket session (" + getId ( ) + ")." ) ; } scheduleCommand ( this . sessionTimeout , sessionTimeout ) ; } } }
|
Start up timer for the session timeout of the WebSocket session
|
4,010
|
public void logout ( ) { if ( loginContext != null ) { try { loginContext . logout ( ) ; if ( logoutLogger . isDebugEnabled ( ) ) { logoutLogger . debug ( "[ws/#" + getId ( ) + "] Logout successful." ) ; } } catch ( LoginException e ) { logoutLogger . trace ( "[ws/#" + getId ( ) + "] Exception occurred logging out of this WebSocket session." , e ) ; } } loginContext = null ; }
|
Log out of the login context associated with this WebSocket session . Used to clean up any login context state that should be cleaned up .
|
4,011
|
public static byte [ ] getOsVersion ( ) { String os = System . getProperty ( "os.name" ) ; if ( os == null || ! os . toUpperCase ( ) . contains ( "WINDOWS" ) ) { return DEFAULT_OS_VERSION ; } byte [ ] osVer = new byte [ 8 ] ; try { Process pr = Runtime . getRuntime ( ) . exec ( "cmd /C ver" ) ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( pr . getInputStream ( ) ) ) ; pr . waitFor ( ) ; String line ; do { line = reader . readLine ( ) ; } while ( ( line != null ) && ( line . length ( ) != 0 ) ) ; reader . close ( ) ; if ( line == null ) { throw new Exception ( ) ; } int pos = line . toLowerCase ( ) . indexOf ( "version" ) ; if ( pos == - 1 ) { throw new Exception ( ) ; } pos += 8 ; line = line . substring ( pos , line . indexOf ( ']' ) ) ; StringTokenizer tk = new StringTokenizer ( line , "." ) ; if ( tk . countTokens ( ) != 3 ) { throw new Exception ( ) ; } writeOSVersion ( Byte . parseByte ( tk . nextToken ( ) ) , Byte . parseByte ( tk . nextToken ( ) ) , Short . parseShort ( tk . nextToken ( ) ) , osVer , 0 ) ; } catch ( Exception ex ) { try { String version = System . getProperty ( "os.version" ) ; writeOSVersion ( Byte . parseByte ( version . substring ( 0 , 1 ) ) , Byte . parseByte ( version . substring ( 2 , 3 ) ) , ( short ) 0 , osVer , 0 ) ; } catch ( Exception ex2 ) { return DEFAULT_OS_VERSION ; } } return osVer ; }
|
Tries to return a valid OS version on Windows systems . If it fails to do so or if we re running on another OS then a fake Windows XP OS version is returned because the protocol uses it .
|
4,012
|
public static int writeSecurityBufferAndUpdatePointer ( ByteArrayOutputStream baos , short len , int pointer ) throws IOException { baos . write ( writeSecurityBuffer ( len , pointer ) ) ; return pointer + len ; }
|
Writes a security buffer and returns the pointer of the position where to write the next security buffer .
|
4,013
|
public static int extractFlagsFromType2Message ( byte [ ] msg ) { byte [ ] flagsBytes = new byte [ 4 ] ; System . arraycopy ( msg , 20 , flagsBytes , 0 , 4 ) ; ByteUtilities . changeWordEndianess ( flagsBytes , 0 , 4 ) ; return ByteUtilities . makeIntFromByte4 ( flagsBytes ) ; }
|
Extracts the NTLM flags from the type 2 message .
|
4,014
|
public static String extractTargetNameFromType2Message ( byte [ ] msg , Integer msgFlags ) throws UnsupportedEncodingException { byte [ ] targetName = readSecurityBufferTarget ( msg , 12 ) ; int flags = msgFlags == null ? extractFlagsFromType2Message ( msg ) : msgFlags ; if ( ByteUtilities . isFlagSet ( flags , FLAG_NEGOTIATE_UNICODE ) ) { return new String ( targetName , "UTF-16LE" ) ; } return new String ( targetName , "ASCII" ) ; }
|
Extracts the target name from the type 2 message .
|
4,015
|
public static byte [ ] extractTargetInfoFromType2Message ( byte [ ] msg , Integer msgFlags ) { int flags = msgFlags == null ? extractFlagsFromType2Message ( msg ) : msgFlags ; if ( ! ByteUtilities . isFlagSet ( flags , FLAG_NEGOTIATE_TARGET_INFO ) ) return null ; int pos = 40 ; return readSecurityBufferTarget ( msg , pos ) ; }
|
Extracts the target information block from the type 2 message .
|
4,016
|
private static void bind ( final NioDatagramChannel channel , final ChannelFuture future , final InetSocketAddress address ) { boolean bound = false ; boolean started = false ; try { channel . getDatagramChannel ( ) . socket ( ) . bind ( address ) ; bound = true ; future . setSuccess ( ) ; fireChannelBound ( channel , address ) ; channel . worker . register ( channel , null ) ; started = true ; } catch ( final Throwable t ) { future . setFailure ( t ) ; fireExceptionCaught ( channel , t ) ; } finally { if ( ! started && bound ) { close ( channel , future ) ; } } }
|
Will bind the DatagramSocket to the passed - in address . Every call bind will spawn a new thread using the that basically in turn
|
4,017
|
public static IoBufferEx doEncode ( IoBufferAllocatorEx < ? > allocator , int flags , WsMessage message ) { IoBufferEx ioBuf = getBytes ( allocator , flags , message ) ; ByteBuffer buf = ioBuf . buf ( ) ; boolean mask = false ; boolean fin = message . isFin ( ) ; int maskValue = 0 ; int remaining = buf . remaining ( ) ; int position = buf . position ( ) ; int offset = 2 + ( mask ? 4 : 0 ) + calculateLengthSize ( remaining ) ; if ( ( ( flags & FLAG_ZERO_COPY ) != 0 ) && ( position >= offset ) ) { if ( ! isCacheEmpty ( message ) ) { throw new IllegalStateException ( "Cache must be empty: flags = " + flags ) ; } ByteBuffer b = buf . duplicate ( ) ; b . position ( position - offset ) ; b . mark ( ) ; byte b1 = ( byte ) ( fin ? 0x80 : 0x00 ) ; byte b2 = ( byte ) ( mask ? 0x80 : 0x00 ) ; b1 = doEncodeOpcode ( b1 , message ) ; b2 |= lenBits ( remaining ) ; b . put ( b1 ) . put ( b2 ) ; doEncodeLength ( b , remaining ) ; if ( mask ) { b . putInt ( maskValue ) ; } b . position ( b . position ( ) + remaining ) ; b . limit ( b . position ( ) ) ; b . reset ( ) ; return allocator . wrap ( b , flags ) ; } else { ByteBuffer b = allocator . allocate ( offset + remaining , flags ) ; int start = b . position ( ) ; byte b1 = ( byte ) ( fin ? 0x80 : 0x00 ) ; byte b2 = ( byte ) ( mask ? 0x80 : 0x00 ) ; b1 = doEncodeOpcode ( b1 , message ) ; b2 |= lenBits ( remaining ) ; b . put ( b1 ) . put ( b2 ) ; doEncodeLength ( b , remaining ) ; if ( mask ) { b . putInt ( maskValue ) ; } if ( ioBuf . isShared ( ) ) { b . put ( buf . duplicate ( ) ) ; } else { int bufPos = buf . position ( ) ; b . put ( buf ) ; buf . position ( bufPos ) ; } b . limit ( b . position ( ) ) ; b . position ( start ) ; return allocator . wrap ( b , flags ) ; } }
|
Encode WebSocket message as a single frame
|
4,018
|
private List < PatternCacheControl > buildPatternsList ( ServiceProperties properties ) { Map < String , PatternCacheControl > patterns = new LinkedHashMap < > ( ) ; List < ServiceProperties > locationsList = properties . getNested ( "location" ) ; if ( locationsList != null && locationsList . size ( ) != 0 ) { for ( ServiceProperties location : locationsList ) { String directiveList = location . get ( "cache-control" ) ; String [ ] patternList = location . get ( "patterns" ) . split ( "\\s+" ) ; for ( String pattern : patternList ) { patterns . put ( pattern , new PatternCacheControl ( pattern , directiveList ) ) ; } } resolvePatternSpecificity ( patterns ) ; return sortByMatchingPatternCount ( patterns ) ; } return new ArrayList < > ( patterns . values ( ) ) ; }
|
Creates the list of PatternCacheControl objects
|
4,019
|
private void resolvePatternSpecificity ( Map < String , PatternCacheControl > patterns ) { List < String > patternList = new ArrayList < > ( ) ; patternList . addAll ( patterns . keySet ( ) ) ; int patternCount = patternList . size ( ) ; for ( int i = 0 ; i < patternCount - 1 ; i ++ ) { String specificPattern = patternList . get ( i ) ; for ( int j = i + 1 ; j < patternCount ; j ++ ) { String generalPattern = patternList . get ( j ) ; checkPatternMatching ( patterns , specificPattern , generalPattern ) ; checkPatternMatching ( patterns , generalPattern , specificPattern ) ; } } }
|
Matches the patterns from the map and determines each pattern s specificity
|
4,020
|
private void checkPatternMatching ( Map < String , PatternCacheControl > patterns , String specificPattern , String generalPattern ) { if ( PatternMatcherUtils . caseInsensitiveMatch ( specificPattern , generalPattern ) ) { PatternCacheControl specificPatternDirective = patterns . get ( specificPattern ) ; PatternCacheControl generalPatternDirective = patterns . get ( generalPattern ) ; generalPatternDirective . incrementMatchingPatternCount ( ) ; ConflictResolverUtils . resolveConflicts ( specificPatternDirective , generalPatternDirective ) ; } }
|
Checks if the first pattern can be included in the second one and resolves directive conflicts if needed
|
4,021
|
private List < PatternCacheControl > sortByMatchingPatternCount ( Map < String , PatternCacheControl > unsortedMap ) { List < PatternCacheControl > list = new ArrayList < > ( unsortedMap . values ( ) ) ; Collections . sort ( list , PATTERN_CACHE_CONTROL_COMPARATOR ) ; return list ; }
|
Sorts the patterns map by the number of matching patterns and returns a list of sorted PatternCacheControl elements . The sorted list is used at request so that a file s URL can be matched to the most specific pattern .
|
4,022
|
private File toFile ( File rootDir , String location ) { File locationFile = rootDir ; if ( location != null ) { URI locationURI = URI . create ( location ) ; locationFile = new File ( locationURI . getPath ( ) ) ; if ( locationURI . getScheme ( ) == null ) { locationFile = new File ( rootDir , location ) ; } else if ( ! "file" . equals ( locationURI . getScheme ( ) ) ) { throw new IllegalArgumentException ( "Unexpected resources directory: " + location ) ; } } return locationFile ; }
|
Converts a location in the gateway configuration file into a file relative to a specified root directory .
|
4,023
|
public LoginContext createLoginContext ( Subject subject , final String username , final char [ ] password ) throws LoginException { final DefaultLoginResult loginResult = new DefaultLoginResult ( ) ; CallbackHandler handler = new CallbackHandler ( ) { public void handle ( Callback [ ] callbacks ) throws IOException , UnsupportedCallbackException { for ( Callback callback : callbacks ) { if ( callback instanceof NameCallback ) { ( ( NameCallback ) callback ) . setName ( username ) ; } else if ( callback instanceof PasswordCallback ) { ( ( PasswordCallback ) callback ) . setPassword ( password ) ; } else if ( callback instanceof LoginResultCallback ) { ( ( LoginResultCallback ) callback ) . setLoginResult ( loginResult ) ; } else { throw new UnsupportedCallbackException ( callback ) ; } } } } ; return createLoginContext ( subject , handler , loginResult ) ; }
|
For login context providers that can abstract their tokens into a username and password this is a utility method that can create the login context based on the provided username and password .
|
4,024
|
protected LoginContext createLoginContext ( Subject subject , CallbackHandler handler , DefaultLoginResult loginResult ) throws LoginException { return new ResultAwareLoginContext ( name , subject , handler , configuration , loginResult ) ; }
|
For login context providers that can abstract their tokens into a subject and a CallbackHandler that understands their token this is a utility method that can be called to construct a create login .
|
4,025
|
protected LoginContext createLoginContext ( CallbackHandler handler , final DefaultLoginResult loginResult ) throws LoginException { return createLoginContext ( null , handler , loginResult ) ; }
|
For login context providers that can abstract their tokens into a CallbackHandler that understands their token this is a utility method that can be called to construct a create login .
|
4,026
|
private void fireMemberAdded ( MemberId newMember ) { GL . debug ( GL . CLUSTER_LOGGER_NAME , "Firing member added for : {}" , newMember ) ; for ( MembershipEventListener listener : membershipEventListeners ) { try { listener . memberAdded ( newMember ) ; } catch ( Throwable e ) { GL . error ( GL . CLUSTER_LOGGER_NAME , "Error in member added event {}" , e ) ; } } }
|
Fire member added event
|
4,027
|
private void fireMemberRemoved ( MemberId exMember ) { GL . debug ( GL . CLUSTER_LOGGER_NAME , "Firing member removed for: {}" , exMember ) ; for ( MembershipEventListener listener : membershipEventListeners ) { try { listener . memberRemoved ( exMember ) ; } catch ( Throwable e ) { GL . error ( GL . CLUSTER_LOGGER_NAME , "Error in member removed event {}" , e ) ; } } }
|
Fire member removed event
|
4,028
|
public ChannelBuffer wrap ( ByteBuffer buffer ) { if ( buffer == null ) { throw new NullPointerException ( "buffer" ) ; } int position = buffer . position ( ) ; int limit = buffer . limit ( ) ; this . order = buffer . order ( ) ; this . buffer = buffer ; this . capacity = buffer . capacity ( ) ; setIndex ( position , limit ) ; return this ; }
|
Creates a new buffer which wraps the specified buffer s slice .
|
4,029
|
private int toInt ( InetAddress inetAddress ) { byte [ ] address = inetAddress . getAddress ( ) ; int result = 0 ; for ( int i = 0 ; i < address . length ; i ++ ) { result <<= 8 ; result |= address [ i ] & BYTE_MASK ; } return result ; }
|
Converts an IP address into an integer
|
4,030
|
private Executor createDefaultExecutor ( int corePoolSize , int maximumPoolSize , long keepAliveTime , TimeUnit unit , ThreadFactory threadFactory , IoEventQueueHandler queueHandler ) { Executor executor = new OrderedThreadPoolExecutor ( corePoolSize , maximumPoolSize , keepAliveTime , unit , threadFactory , queueHandler ) ; return executor ; }
|
Create an OrderedThreadPool executor .
|
4,031
|
private void initEventTypes ( IoEventType ... eventTypes ) { if ( ( eventTypes == null ) || ( eventTypes . length == 0 ) ) { eventTypes = DEFAULT_EVENT_SET ; } this . eventTypes = EnumSet . of ( eventTypes [ 0 ] , eventTypes ) ; if ( this . eventTypes . contains ( IoEventType . SESSION_CREATED ) ) { this . eventTypes = null ; throw new IllegalArgumentException ( IoEventType . SESSION_CREATED + " is not allowed." ) ; } }
|
Create an EnumSet from an array of EventTypes and set the associated eventTypes field .
|
4,032
|
private void init ( Executor executor , boolean manageableExecutor , IoEventType ... eventTypes ) { if ( executor == null ) { throw new NullPointerException ( "executor" ) ; } initEventTypes ( eventTypes ) ; this . executor = executor ; this . manageableExecutor = manageableExecutor ; }
|
Creates a new instance of ExecutorFilter . This private constructor is called by all the public constructor .
|
4,033
|
public void putAll ( Map < ? extends K , ? extends V > newData ) { synchronized ( this ) { Map < K , V > newMap = new HashMap < > ( internalMap ) ; newMap . putAll ( newData ) ; internalMap = newMap ; } }
|
Inserts all the keys and values contained in the provided map to this map .
|
4,034
|
public void doSessionCreated ( SessionManagementBean sessionBean ) throws Exception { SessionMXBean sessionMxBean = managementServiceHandler . getSessionMXBean ( sessionBean . getId ( ) ) ; Map < String , String > userPrincipals = sessionBean . getUserPrincipalMap ( ) ; if ( userPrincipals != null ) { Map < String , Map < String , String > > userData = new HashMap < > ( ) ; userData . put ( sessionMxBean . getObjectName ( ) . toString ( ) , userPrincipals ) ; Notification n2 = new Notification ( SESSION_CREATED , sessionMxBean , managementServiceHandler . nextNotificationSequenceNumber ( ) , System . currentTimeMillis ( ) , "Session Credentials Registered" ) ; n2 . setUserData ( userData ) ; sendNotification ( n2 ) ; } }
|
All of the following are expected to be OFF any session s IO thread .
|
4,035
|
public void doHandshake ( final NextFilter nextFilter ) throws ProxyAuthException { logger . debug ( " doHandshake()" ) ; if ( authHandler != null ) { authHandler . doHandshake ( nextFilter ) ; } else { if ( requestSent ) { throw new ProxyAuthException ( "Authentication request already sent" ) ; } logger . debug ( " sending HTTP request" ) ; HttpProxyRequest req = ( HttpProxyRequest ) getProxyIoSession ( ) . getRequest ( ) ; Map < String , List < String > > headers = req . getHeaders ( ) != null ? req . getHeaders ( ) : new HashMap < > ( ) ; AbstractAuthLogicHandler . addKeepAliveHeaders ( headers ) ; req . setHeaders ( headers ) ; writeRequest ( nextFilter , req ) ; requestSent = true ; } }
|
Performs the handshake processing .
|
4,036
|
public void handleResponse ( final HttpProxyResponse response ) throws ProxyAuthException { if ( ! isHandshakeComplete ( ) && ( "close" . equalsIgnoreCase ( StringUtilities . getSingleValuedHeader ( response . getHeaders ( ) , "Proxy-Connection" ) ) || "close" . equalsIgnoreCase ( StringUtilities . getSingleValuedHeader ( response . getHeaders ( ) , "Connection" ) ) ) ) { getProxyIoSession ( ) . setReconnectionNeeded ( true ) ; } if ( response . getStatusCode ( ) == 407 ) { if ( authHandler == null ) { autoSelectAuthHandler ( response ) ; } authHandler . handleResponse ( response ) ; } else { throw new ProxyAuthException ( "Error: unexpected response code " + response . getStatusLine ( ) + " received from proxy." ) ; } }
|
Handle a HTTP response from the proxy server .
|
4,037
|
public static String acceptHash ( String key ) { try { MessageDigest sha1 = MessageDigest . getInstance ( "SHA-1" ) ; sha1 . update ( key . getBytes ( UTF_8 ) ) ; sha1 . update ( WEBSOCKET_GUID ) ; byte [ ] hash = sha1 . digest ( ) ; byte [ ] output = Base64 . encodeBase64 ( hash ) ; return new String ( output ) ; } catch ( NoSuchAlgorithmException nsae ) { SecurityException se = new SecurityException ( ) ; se . initCause ( nsae ) ; throw se ; } }
|
Compute the Sec - WebSocket - Accept header value as per RFC 6455
|
4,038
|
protected boolean isConnectionOk ( IoSession session ) { SocketAddress remoteAddress = session . getRemoteAddress ( ) ; if ( remoteAddress instanceof InetSocketAddress ) { InetSocketAddress addr = ( InetSocketAddress ) remoteAddress ; long now = System . currentTimeMillis ( ) ; if ( clients . containsKey ( addr . getAddress ( ) . getHostAddress ( ) ) ) { LOGGER . debug ( "This is not a new client" ) ; Long lastConnTime = clients . get ( addr . getAddress ( ) . getHostAddress ( ) ) ; clients . put ( addr . getAddress ( ) . getHostAddress ( ) , now ) ; if ( now - lastConnTime < allowedInterval ) { LOGGER . warn ( "Session connection interval too short" ) ; return false ; } return true ; } clients . put ( addr . getAddress ( ) . getHostAddress ( ) , now ) ; return true ; } return false ; }
|
Method responsible for deciding if a connection is OK to continue
|
4,039
|
public static int getNextAvailable ( int fromPort ) { if ( fromPort < MIN_PORT_NUMBER || fromPort > MAX_PORT_NUMBER ) { throw new IllegalArgumentException ( "Invalid start port: " + fromPort ) ; } for ( int i = fromPort ; i <= MAX_PORT_NUMBER ; i ++ ) { if ( available ( i ) ) { return i ; } } throw new NoSuchElementException ( "Could not find an available port " + "above " + fromPort ) ; }
|
Gets the next available port starting at a port .
|
4,040
|
public static boolean available ( int port ) { if ( port < MIN_PORT_NUMBER || port > MAX_PORT_NUMBER ) { throw new IllegalArgumentException ( "Invalid start port: " + port ) ; } ServerSocket ss = null ; DatagramSocket ds = null ; try { ss = new ServerSocket ( port ) ; ss . setReuseAddress ( true ) ; ds = new DatagramSocket ( port ) ; ds . setReuseAddress ( true ) ; return true ; } catch ( IOException e ) { } finally { if ( ds != null ) { ds . close ( ) ; } if ( ss != null ) { try { ss . close ( ) ; } catch ( IOException e ) { } } } return false ; }
|
Checks to see if a specific port is available .
|
4,041
|
public static String getHost ( String uriString ) { try { URI uri = new URI ( uriString ) ; if ( uri . getHost ( ) == null ) { throw new IllegalArgumentException ( "Invalid URI syntax. Scheme and host must be provided (port number is optional): " + uriString ) ; } if ( uri . getAuthority ( ) . startsWith ( "@" ) && ! uri . getHost ( ) . startsWith ( "@" ) ) { return "@" + uri . getHost ( ) ; } return uri . getHost ( ) ; } catch ( URISyntaxException e ) { try { return ( new NetworkInterfaceURI ( uriString ) ) . getHost ( ) ; } catch ( IllegalArgumentException ne ) { throw new IllegalArgumentException ( ne . getMessage ( ) , ne ) ; } } }
|
Helper method for retrieving host
|
4,042
|
public static String getScheme ( String uriString ) { try { return ( new URI ( uriString ) ) . getScheme ( ) ; } catch ( URISyntaxException e ) { try { return ( new NetworkInterfaceURI ( uriString ) ) . getScheme ( ) ; } catch ( IllegalArgumentException ne ) { throw new IllegalArgumentException ( ne . getMessage ( ) , ne ) ; } } }
|
Helper method for retrieving scheme
|
4,043
|
public static int getPort ( String uriString ) { try { return ( new URI ( uriString ) ) . getPort ( ) ; } catch ( URISyntaxException e ) { try { return ( new NetworkInterfaceURI ( uriString ) ) . getPort ( ) ; } catch ( IllegalArgumentException ne ) { throw new IllegalArgumentException ( ne . getMessage ( ) , ne ) ; } } }
|
Helper method for retrieving port
|
4,044
|
public static String resolve ( String uriInitial , String uriString ) { try { return uriToString ( ( new URI ( uriInitial ) ) . resolve ( uriString ) ) ; } catch ( URISyntaxException e ) { try { return ( new NetworkInterfaceURI ( uriInitial ) ) . resolve ( uriString ) ; } catch ( IllegalArgumentException ne ) { throw new IllegalArgumentException ( ne . getMessage ( ) , ne ) ; } } }
|
Helper method for performing resolve as String
|
4,045
|
public static String modifyURIScheme ( String uri , String newScheme ) { try { URI uriObj = new URI ( uri ) ; return uriToString ( URLUtils . modifyURIScheme ( uriObj , newScheme ) ) ; } catch ( URISyntaxException e ) { try { return ( new NetworkInterfaceURI ( uri ) ) . modifyURIScheme ( newScheme ) ; } catch ( IllegalArgumentException ne ) { throw new IllegalArgumentException ( ne . getMessage ( ) , ne ) ; } } }
|
Helper method for modifying URI scheme
|
4,046
|
public static String modifyURIAuthority ( String uri , String newAuthority ) { try { URI uriObj = new URI ( uri ) ; Pattern pattern = Pattern . compile ( NETWORK_INTERFACE_AUTHORITY ) ; Matcher matcher = pattern . matcher ( newAuthority ) ; String matchedToken = MOCK_HOST ; if ( matcher . find ( ) ) { matchedToken = matcher . group ( 0 ) ; newAuthority = newAuthority . replace ( matchedToken , MOCK_HOST ) ; } URI modifiedURIAuthority = URLUtils . modifyURIAuthority ( uriObj , newAuthority ) ; String uriWithModifiedAuthority = URIUtils . uriToString ( modifiedURIAuthority ) . replace ( MOCK_HOST , matchedToken ) ; return uriWithModifiedAuthority ; } catch ( URISyntaxException e ) { try { return ( new NetworkInterfaceURI ( uri ) ) . modifyURIAuthority ( newAuthority ) ; } catch ( IllegalArgumentException ne ) { throw new IllegalArgumentException ( ne . getMessage ( ) , ne ) ; } } }
|
Helper method for modifying URI authority
|
4,047
|
public static String modifyURIPort ( String uri , int newPort ) { try { URI uriObj = new URI ( uri ) ; return uriToString ( URLUtils . modifyURIPort ( uriObj , newPort ) ) ; } catch ( URISyntaxException e ) { try { return ( new NetworkInterfaceURI ( uri ) ) . modifyURIPort ( newPort ) ; } catch ( IllegalArgumentException ne ) { throw new IllegalArgumentException ( ne . getMessage ( ) , ne ) ; } } }
|
Helper method for modifying URI port
|
4,048
|
public static String modifyURIPath ( String uri , String newPath ) { try { URI uriObj = new URI ( uri ) ; return uriToString ( URLUtils . modifyURIPath ( uriObj , newPath ) ) ; } catch ( URISyntaxException e ) { try { return ( new NetworkInterfaceURI ( uri ) ) . modifyURIPath ( newPath ) ; } catch ( IllegalArgumentException ne ) { throw new IllegalArgumentException ( ne . getMessage ( ) , ne ) ; } } }
|
Helper method for modiffying the URI path
|
4,049
|
private String getCertCN ( X509Certificate x509 ) throws CertificateParsingException { X500Principal principal = x509 . getSubjectX500Principal ( ) ; String subjectName = principal . getName ( ) ; String [ ] fields = subjectName . split ( "," ) ; for ( String field : fields ) { if ( field . startsWith ( "CN=" ) ) { String serverName = field . substring ( 3 ) ; return serverName . toLowerCase ( ) ; } } throw new CertificateParsingException ( "Certificate CN not found" ) ; }
|
Read the CN out of the cert
|
4,050
|
private Collection < String > getCertServerNames ( X509Certificate x509 ) throws CertificateParsingException { Collection < String > serverNames = new LinkedHashSet < > ( ) ; String certCN = getCertCN ( x509 ) ; serverNames . add ( certCN ) ; try { Collection < List < ? > > altNames = x509 . getSubjectAlternativeNames ( ) ; if ( altNames != null ) { for ( List < ? > entry : altNames ) { if ( entry . size ( ) >= 2 ) { Object entryType = entry . get ( 0 ) ; if ( entryType instanceof Integer && ( Integer ) entryType == 2 ) { Object field = entry . get ( 1 ) ; if ( field instanceof String ) { serverNames . add ( ( ( String ) field ) . toLowerCase ( ) ) ; } } } } } } catch ( CertificateParsingException cpe ) { LOGGER . warn ( "Certificate alternative names ignored for certificate " + ( certCN != null ? " " + certCN : "" ) , cpe ) ; } return serverNames ; }
|
Build up the list of server names represented by a certificate
|
4,051
|
public static BitSet decodeBitString ( ByteBuffer buf ) { DerId id = DerId . decode ( buf ) ; if ( ! id . matches ( DerId . TagClass . UNIVERSAL , DerId . EncodingType . PRIMITIVE , ASN1_BIT_STRING_TAG_NUM ) && ! id . matches ( DerId . TagClass . UNIVERSAL , DerId . EncodingType . CONSTRUCTED , ASN1_BIT_STRING_TAG_NUM ) ) { throw new IllegalArgumentException ( "Expected BIT STRING identifier, received " + id ) ; } int len = DerUtils . decodeLength ( buf ) ; if ( buf . remaining ( ) < len ) { throw new IllegalArgumentException ( "Insufficient content for BIT STRING" ) ; } if ( id . getEncodingType ( ) == DerId . EncodingType . PRIMITIVE ) { buf . get ( ) ; len -- ; } int nbits = len * 8 ; BitSet bits = new BitSet ( nbits ) ; for ( int i = 0 ; i < len ; i ++ ) { short next = ( short ) ( 0xff & buf . get ( ) ) ; int bitIndex = ( i + 1 ) * 8 - 1 ; while ( next != 0 ) { if ( ( next & 1 ) == 1 ) { bits . set ( bitIndex ) ; } bitIndex -- ; next >>>= 1 ; } } return bits ; }
|
Decode an ASN . 1 BIT STRING .
|
4,052
|
public static Date decodeGeneralizedTime ( ByteBuffer buf ) { DerId id = DerId . decode ( buf ) ; if ( ! id . matches ( DerId . TagClass . UNIVERSAL , DerId . EncodingType . PRIMITIVE , ASN1_GENERALIZED_TIME_TAG_NUM ) ) { throw new IllegalArgumentException ( "Expected GeneralizedTime identifier, received " + id ) ; } int len = DerUtils . decodeLength ( buf ) ; if ( buf . remaining ( ) < len ) { throw new IllegalArgumentException ( "Insufficient content for GeneralizedTime" ) ; } Date date ; byte [ ] dst = new byte [ len ] ; buf . get ( dst ) ; String iso8601DateString = new String ( dst ) ; Matcher matcher = GENERALIZED_TIME_PATTERN . matcher ( iso8601DateString ) ; if ( matcher . matches ( ) ) { Calendar cal = Calendar . getInstance ( ) ; cal . clear ( ) ; cal . set ( Calendar . YEAR , Integer . parseInt ( matcher . group ( 1 ) ) ) ; cal . set ( Calendar . MONTH , Integer . parseInt ( matcher . group ( 2 ) ) - 1 ) ; cal . set ( Calendar . DAY_OF_MONTH , Integer . parseInt ( matcher . group ( 3 ) ) ) ; cal . set ( Calendar . HOUR_OF_DAY , Integer . parseInt ( matcher . group ( 4 ) ) ) ; cal . set ( Calendar . MINUTE , Integer . parseInt ( matcher . group ( 5 ) ) ) ; cal . set ( Calendar . SECOND , Integer . parseInt ( matcher . group ( 6 ) ) ) ; String fracSecStr = matcher . group ( 7 ) ; if ( fracSecStr != null ) { cal . set ( Calendar . MILLISECOND , ( int ) ( Float . parseFloat ( fracSecStr ) * 1000 ) ) ; } String tzStr = matcher . group ( 8 ) ; if ( tzStr != null ) { cal . setTimeZone ( TimeZone . getTimeZone ( "Z" . equals ( tzStr ) ? "GMT" : "GMT" + tzStr ) ) ; } date = cal . getTime ( ) ; } else { throw new IllegalArgumentException ( "Malformed GeneralizedTime " + iso8601DateString ) ; } return date ; }
|
Decode an ASN . 1 GeneralizedTime .
|
4,053
|
public static String decodeIA5String ( ByteBuffer buf ) { DerId id = DerId . decode ( buf ) ; if ( ! id . matches ( DerId . TagClass . UNIVERSAL , DerId . EncodingType . PRIMITIVE , ASN1_IA5STRING_TAG_NUM ) ) { throw new IllegalArgumentException ( "Expected IA5String identifier, received " + id ) ; } int len = DerUtils . decodeLength ( buf ) ; if ( buf . remaining ( ) < len ) { throw new IllegalArgumentException ( "Insufficient content for IA5String" ) ; } byte [ ] dst = new byte [ len ] ; buf . get ( dst ) ; return new String ( dst ) ; }
|
Decode an ASN . 1 IA5String .
|
4,054
|
public static int decodeInteger ( ByteBuffer buf ) { DerId id = DerId . decode ( buf ) ; if ( ! id . matches ( DerId . TagClass . UNIVERSAL , DerId . EncodingType . PRIMITIVE , ASN1_INTEGER_TAG_NUM ) ) { throw new IllegalArgumentException ( "Expected INTEGER identifier, received " + id ) ; } int len = DerUtils . decodeLength ( buf ) ; if ( buf . remaining ( ) < len ) { throw new IllegalArgumentException ( "Insufficient content for INTEGER" ) ; } int value = 0 ; for ( int i = 0 ; i < len ; i ++ ) { value = ( value << 8 ) + ( 0xff & buf . get ( ) ) ; } return value ; }
|
Decode an ASN . 1 INTEGER .
|
4,055
|
public static short [ ] decodeOctetString ( ByteBuffer buf ) { DerId id = DerId . decode ( buf ) ; if ( ! id . matches ( DerId . TagClass . UNIVERSAL , ASN1_OCTET_STRING_TAG_NUM ) ) { throw new IllegalArgumentException ( "Expected OCTET STRING identifier, received " + id ) ; } int len = DerUtils . decodeLength ( buf ) ; if ( buf . remaining ( ) < len ) { throw new IllegalArgumentException ( "Insufficient content for OCTET STRING" ) ; } short [ ] dst = new short [ len ] ; for ( int i = 0 ; i < len ; i ++ ) { dst [ i ] = ( short ) ( 0xff & buf . get ( ) ) ; } return dst ; }
|
Decode an ASN . 1 OCTET STRING .
|
4,056
|
public static int decodeSequence ( ByteBuffer buf ) { DerId id = DerId . decode ( buf ) ; if ( ! id . matches ( DerId . TagClass . UNIVERSAL , DerId . EncodingType . CONSTRUCTED , ASN1_SEQUENCE_TAG_NUM ) ) { throw new IllegalArgumentException ( "Expected SEQUENCE identifier, received " + id ) ; } int len = DerUtils . decodeLength ( buf ) ; if ( buf . remaining ( ) < len ) { throw new IllegalArgumentException ( "Insufficient content for SEQUENCE" ) ; } return len ; }
|
Decode an ASN . 1 SEQUENCE by reading the identifier and length octets . The remaining data in the buffer is the SEQUENCE .
|
4,057
|
public static int encodeBitString ( BitSet value , int nbits , ByteBuffer buf ) { if ( value == null || nbits < value . length ( ) ) { throw new IllegalArgumentException ( ) ; } int pos = buf . position ( ) ; int contentLength = ( int ) Math . ceil ( nbits / 8.0d ) ; for ( int i = contentLength ; i > 0 ; i -- ) { byte octet = 0 ; for ( int j = ( i - 1 ) * 8 ; j < i * 8 ; j ++ ) { if ( value . get ( j ) ) { octet |= BIT_STRING_MASK [ j % 8 ] ; } } pos -- ; buf . put ( pos , octet ) ; } pos -- ; buf . put ( pos , ( byte ) 0 ) ; contentLength ++ ; buf . position ( buf . position ( ) - contentLength ) ; int headerLength = DerUtils . encodeIdAndLength ( DerId . TagClass . UNIVERSAL , DerId . EncodingType . PRIMITIVE , ASN1_BIT_STRING_TAG_NUM , contentLength , buf ) ; return headerLength + contentLength ; }
|
Encode an ASN . 1 BIT STRING .
|
4,058
|
public static int encodeGeneralizedTime ( Date date , ByteBuffer buf ) { if ( date == null ) { throw new IllegalArgumentException ( ) ; } int pos = buf . position ( ) ; SimpleDateFormat format = new SimpleDateFormat ( GENERALIZED_TIME_FORMAT ) ; format . setTimeZone ( TimeZone . getTimeZone ( "GMT" ) ) ; String value = format . format ( date ) ; byte [ ] data = value . getBytes ( ) ; for ( int i = data . length - 1 ; i >= 0 ; i -- ) { pos -- ; buf . put ( pos , data [ i ] ) ; } buf . position ( buf . position ( ) - data . length ) ; int headerLength = DerUtils . encodeIdAndLength ( DerId . TagClass . UNIVERSAL , DerId . EncodingType . PRIMITIVE , ASN1_GENERALIZED_TIME_TAG_NUM , data . length , buf ) ; return headerLength + data . length ; }
|
Encode an ASN . 1 GeneralizedTime .
|
4,059
|
public static int encodeIA5String ( String value , ByteBuffer buf ) { int pos = buf . position ( ) ; byte [ ] data = ( value == null ) ? new byte [ 0 ] : value . getBytes ( ) ; for ( int i = data . length - 1 ; i >= 0 ; i -- ) { pos -- ; buf . put ( pos , data [ i ] ) ; } buf . position ( buf . position ( ) - data . length ) ; int headerLength = DerUtils . encodeIdAndLength ( DerId . TagClass . UNIVERSAL , DerId . EncodingType . PRIMITIVE , ASN1_IA5STRING_TAG_NUM , data . length , buf ) ; return headerLength + data . length ; }
|
Encode an ASN . 1 IA5String .
|
4,060
|
public static int encodeInteger ( int value , ByteBuffer buf ) { int pos = buf . position ( ) ; int contentLength = 0 ; do { pos -- ; buf . put ( pos , ( byte ) ( value & 0xff ) ) ; value >>>= 8 ; contentLength ++ ; } while ( value != 0 ) ; buf . position ( buf . position ( ) - contentLength ) ; int headerLen = DerUtils . encodeIdAndLength ( DerId . TagClass . UNIVERSAL , DerId . EncodingType . PRIMITIVE , ASN1_INTEGER_TAG_NUM , contentLength , buf ) ; return headerLen + contentLength ; }
|
Encode an ASN . 1 INTEGER .
|
4,061
|
public static int encodeOctetString ( short [ ] octets , ByteBuffer buf ) { if ( octets == null ) { octets = new short [ 0 ] ; } int pos = buf . position ( ) ; for ( int i = octets . length - 1 ; i >= 0 ; i -- ) { pos -- ; buf . put ( pos , ( byte ) octets [ i ] ) ; } buf . position ( buf . position ( ) - octets . length ) ; int headerLength = DerUtils . encodeIdAndLength ( DerId . TagClass . UNIVERSAL , DerId . EncodingType . PRIMITIVE , ASN1_OCTET_STRING_TAG_NUM , octets . length , buf ) ; return headerLength + octets . length ; }
|
Encode an ASN . 1 OCTET STRING .
|
4,062
|
public static int encodeSequence ( int contentLength , ByteBuffer buf ) { int headerLength = DerUtils . encodeIdAndLength ( DerId . TagClass . UNIVERSAL , DerId . EncodingType . CONSTRUCTED , ASN1_SEQUENCE_TAG_NUM , contentLength , buf ) ; return headerLength + contentLength ; }
|
Encode an ASN . 1 SEQUENCE .
|
4,063
|
public static int sizeOfBitString ( BitSet value , int nbits ) { return DerUtils . sizeOf ( ASN1_BIT_STRING_TAG_NUM , ( int ) Math . ceil ( nbits / 8.0d ) + 1 ) ; }
|
Size of an ASN . 1 BIT STRING .
|
4,064
|
public static int sizeOfIA5String ( String value ) { return DerUtils . sizeOf ( ASN1_IA5STRING_TAG_NUM , ( value == null ) ? 0 : value . getBytes ( ) . length ) ; }
|
Size of an ASN . 1 IA5String .
|
4,065
|
public static int sizeOfInteger ( int value ) { int contentLength = 0 ; do { value >>>= 8 ; contentLength ++ ; } while ( value != 0 ) ; return DerUtils . sizeOf ( ASN1_INTEGER_TAG_NUM , contentLength ) ; }
|
Size of an ASN . 1 INTEGER .
|
4,066
|
private byte [ ] pad ( ) { int pos = ( int ) ( msgLength % BYTE_BLOCK_LENGTH ) ; int padLength = ( pos < 56 ) ? ( 64 - pos ) : ( 128 - pos ) ; byte [ ] pad = new byte [ padLength ] ; pad [ 0 ] = ( byte ) 0x80 ; long bits = msgLength << 3 ; int index = padLength - 8 ; for ( int i = 0 ; i < 8 ; i ++ ) { pad [ index ++ ] = ( byte ) ( bits >>> ( i << 3 ) ) ; } return pad ; }
|
Pads the buffer by appending the byte 0x80 then append as many zero bytes as necessary to make the buffer length a multiple of 64 bytes . The last 8 bytes will be filled with the length of the buffer in bits . If there s no room to store the length in bits in the block i . e the block is larger than 56 bytes then an additionnal 64 - bytes block is appended .
|
4,067
|
private static synchronized ProductInfo generateProductInfo ( ) { ProductInfo result = new ProductInfo ( ) ; boolean foundJar = false ; String [ ] pathEntries = System . getProperty ( "java.class.path" ) . split ( System . getProperty ( "path.separator" ) ) ; Map < String , Attributes > products = new TreeMap < > ( Collections . reverseOrder ( ) ) ; HashSet < String > removals = new HashSet < > ( 7 ) ; for ( String pathEntry : pathEntries ) { if ( ! pathEntry . contains ( "gateway.server" ) ) { continue ; } if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( format ( "Found product entry: %s" , pathEntry ) ) ; } Attributes attrs = readAttributes ( pathEntry ) ; if ( ( readProduct ( attrs , products ) || readRemovals ( attrs , removals ) ) ) foundJar = true ; } for ( String removal : removals ) { products . remove ( removal ) ; } if ( foundJar && products . size ( ) != 0 ) { Attributes attrs = products . entrySet ( ) . iterator ( ) . next ( ) . getValue ( ) ; result . setTitle ( attrs . getValue ( IMPLEMENTATION_TITLE ) ) ; result . setVersion ( attrs . getValue ( IMPLEMENTATION_VERSION ) ) ; result . setEdition ( attrs . getValue ( KAAZING_PRODUCT ) ) ; result . setDependencies ( attrs . getValue ( KAAZING_DEPENDENCIES ) ) ; } return result ; }
|
Find the product information from the server JAR MANIFEST files and store it in static variables here for later retrieval .
|
4,068
|
public AmqpTable addInteger ( String key , int value ) { this . add ( key , value , AmqpType . INT ) ; return this ; }
|
Adds an integer entry to the AmqpTable .
|
4,069
|
public AmqpTable addLongString ( String key , String value ) { this . add ( key , value , AmqpType . LONGSTRING ) ; return this ; }
|
Adds a long string entry to the AmqpTable .
|
4,070
|
private SessionTasksQueue getSessionTasksQueue ( IoSession session ) { SessionTasksQueue queue = ( SessionTasksQueue ) session . getAttribute ( TASKS_QUEUE ) ; if ( queue == null ) { queue = new SessionTasksQueue ( ) ; SessionTasksQueue oldQueue = ( SessionTasksQueue ) session . setAttributeIfAbsent ( TASKS_QUEUE , queue ) ; if ( oldQueue != null ) { queue = oldQueue ; } } return queue ; }
|
Get the session s tasks queue .
|
4,071
|
private void print ( Queue < Runnable > queue , IoEvent event ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( "Adding event " ) . append ( event . getType ( ) ) . append ( " to session " ) . append ( event . getSession ( ) . getId ( ) ) ; boolean first = true ; sb . append ( "\nQueue : [" ) ; for ( Runnable elem : queue ) { if ( first ) { first = false ; } else { sb . append ( ", " ) ; } sb . append ( ( ( IoEvent ) elem ) . getType ( ) ) . append ( ", " ) ; } sb . append ( "]\n" ) ; LOGGER . debug ( sb . toString ( ) ) ; }
|
A Helper class used to print the list of events being queued .
|
4,072
|
public static String createAuthorization ( final String username , final String password ) { return new String ( Base64 . encodeBase64 ( ( username + ":" + password ) . getBytes ( ) ) ) ; }
|
Computes the authorization header value .
|
4,073
|
public final void add ( final T session ) { if ( session . isIoAligned ( ) ) { verifyInIoThread ( session , session . getIoThread ( ) ) ; } add0 ( session ) ; }
|
until the processor is created and started
|
4,074
|
static SmushingRulesToApply getRulesToApply ( Integer oldLayout , Integer fullLayout ) { List < SmushingRule > horizontalSmushingRules = new ArrayList < SmushingRule > ( ) ; List < SmushingRule > verticalSmushingRules = new ArrayList < SmushingRule > ( ) ; SmushingRule . Layout horizontalLayout = null ; SmushingRule . Layout verticalLayout = null ; int layout = fullLayout != null ? fullLayout : oldLayout ; for ( Integer codeValue : SmushingRule . getAvailableCodeValues ( ) ) { if ( layout >= codeValue ) { layout = layout - codeValue ; SmushingRule rule = SmushingRule . getByCodeValue ( codeValue ) ; if ( rule . getType ( ) == SmushingRule . Type . HORIZONTAL ) { horizontalLayout = rule . getLayout ( ) ; horizontalSmushingRules . add ( rule ) ; } else if ( rule . getType ( ) == SmushingRule . Type . VERTICAL ) { verticalLayout = rule . getLayout ( ) ; verticalSmushingRules . add ( rule ) ; } } } if ( horizontalLayout == null ) { if ( oldLayout == 0 ) { horizontalLayout = SmushingRule . Layout . FITTING ; horizontalSmushingRules . add ( SmushingRule . HORIZONTAL_FITTING ) ; } else if ( oldLayout == - 1 ) { horizontalLayout = SmushingRule . Layout . FULL_WIDTH ; } } else if ( horizontalLayout == SmushingRule . Layout . CONTROLLED_SMUSHING ) { horizontalSmushingRules . remove ( SmushingRule . HORIZONTAL_SMUSHING ) ; } if ( verticalLayout == null ) { verticalLayout = SmushingRule . Layout . FULL_WIDTH ; } else if ( verticalLayout == SmushingRule . Layout . CONTROLLED_SMUSHING ) { verticalSmushingRules . remove ( SmushingRule . VERTICAL_SMUSHING ) ; } return new SmushingRulesToApply ( horizontalLayout , verticalLayout , horizontalSmushingRules , verticalSmushingRules ) ; }
|
Return definition of smushing logic to be applied .
|
4,075
|
@ SuppressWarnings ( "StatementWithEmptyBody" ) private static int calculateOverlay ( FigletFont figletFont , char [ ] [ ] char1 , char [ ] [ ] char2 ) { if ( figletFont . smushingRulesToApply . getHorizontalLayout ( ) == SmushingRule . Layout . FULL_WIDTH ) { return 0 ; } int maxPotentialOverlay = figletFont . maxLine ; for ( int l = 0 ; l < figletFont . height ; l ++ ) { if ( char1 [ l ] == null ) { char1 [ l ] = new char [ 0 ] ; } char [ ] c1 = char1 [ l ] ; char [ ] c2 = char2 [ l ] ; int c1Length = c1 . length - 1 ; int c2Length = c2 . length - 1 ; int c1EmptyCount ; int c2EmptyCount ; for ( c1EmptyCount = 0 ; c1EmptyCount < c1Length && c1 [ c1Length - c1EmptyCount ] == ' ' ; c1EmptyCount ++ ) { } for ( c2EmptyCount = 0 ; c2EmptyCount < c2Length && c2 [ c2EmptyCount ] == ' ' ; c2EmptyCount ++ ) { } int overlay = c1EmptyCount + c2EmptyCount ; if ( c1EmptyCount <= c1Length && c2EmptyCount <= c2Length ) { if ( figletFont . smushingRulesToApply . getHorizontalLayout ( ) == SmushingRule . Layout . SMUSHING && SmushingRule . HORIZONTAL_SMUSHING . smushes ( c1 [ c1Length - c1EmptyCount ] , c2 [ c2EmptyCount ] , figletFont . hardblank ) || figletFont . smushingRulesToApply . smushesHorizontal ( c1 [ c1Length - c1EmptyCount ] , c2 [ c2EmptyCount ] , figletFont . hardblank ) ) { overlay ++ ; } } if ( overlay < maxPotentialOverlay ) { maxPotentialOverlay = overlay ; } } return maxPotentialOverlay ; }
|
Workouts the amount of characters that can be smushed across all lines .
|
4,076
|
public String getCharLineString ( int c , int l ) { if ( font [ c ] [ l ] == null ) return null ; else { return new String ( font [ c ] [ l ] ) . replace ( hardblank , ' ' ) ; } }
|
Selects a single line from a character .
|
4,077
|
public void close ( ) throws IOException { if ( session != null && session . isConnected ( ) ) { session . disconnect ( ) ; } session = null ; for ( Tunnel tunnel : tunnels ) { tunnel . setAssignedLocalPort ( 0 ) ; } }
|
Closes the underlying ssh session causing all tunnels to be closed .
|
4,078
|
public void open ( ) throws JSchException { if ( isOpen ( ) ) { return ; } session = sessionFactory . newSession ( ) ; logger . debug ( "connecting session" ) ; session . connect ( ) ; for ( Tunnel tunnel : tunnels ) { int assignedPort = 0 ; if ( tunnel . getLocalAlias ( ) == null ) { assignedPort = session . setPortForwardingL ( tunnel . getLocalPort ( ) , tunnel . getDestinationHostname ( ) , tunnel . getDestinationPort ( ) ) ; } else { assignedPort = session . setPortForwardingL ( tunnel . getLocalAlias ( ) , tunnel . getLocalPort ( ) , tunnel . getDestinationHostname ( ) , tunnel . getDestinationPort ( ) ) ; } tunnel . setAssignedLocalPort ( assignedPort ) ; logger . debug ( "added tunnel {}" , tunnel ) ; } logger . info ( "forwarding {}" , this ) ; }
|
Opens a session and connects all of the tunnels .
|
4,079
|
public Session getSession ( ) throws JSchException { if ( session == null || ! session . isConnected ( ) ) { logger . debug ( "getting new session from factory session" ) ; session = sessionFactory . newSession ( ) ; logger . debug ( "connecting session" ) ; session . connect ( ) ; } return session ; }
|
Returns a connected session .
|
4,080
|
private static InputStreamReader decompressWith7Zip ( final String archivePath ) throws ConfigurationException { PATH_PROGRAM_7ZIP = ( String ) config . getConfigParameter ( ConfigurationKeys . PATH_PROGRAM_7ZIP ) ; if ( PATH_PROGRAM_7ZIP == null ) { throw ErrorFactory . createConfigurationException ( ErrorKeys . CONFIGURATION_PARAMETER_UNDEFINED ) ; } try { Runtime runtime = Runtime . getRuntime ( ) ; Process p = runtime . exec ( PATH_PROGRAM_7ZIP + " e " + archivePath + " -so" ) ; return new InputStreamReader ( p . getInputStream ( ) , WIKIPEDIA_ENCODING ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
|
Starts a decompression process using the 7Zip program .
|
4,081
|
private static InputStreamReader decompressWithBZip2 ( final String archivePath ) throws ConfigurationException { Bzip2Archiver archiver = new Bzip2Archiver ( ) ; InputStreamReader reader = null ; try { reader = archiver . getDecompressionStream ( archivePath , WIKIPEDIA_ENCODING ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return reader ; }
|
Starts a decompression process using the BZip2 program .
|
4,082
|
private static InputStreamReader readXMLFile ( final String archivePath ) { try { return new InputStreamReader ( new BufferedInputStream ( new FileInputStream ( archivePath ) ) , WIKIPEDIA_ENCODING ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
|
Creates a reader for the xml file .
|
4,083
|
public static ArticleReaderInterface getTaskReader ( final ArchiveDescription archive ) throws ConfigurationException , ArticleReaderException { Reader reader = null ; switch ( archive . getType ( ) ) { case XML : reader = readXMLFile ( archive . getPath ( ) ) ; break ; case SEVENZIP : reader = decompressWith7Zip ( archive . getPath ( ) ) ; break ; case BZIP2 : reader = decompressWithBZip2 ( archive . getPath ( ) ) ; break ; default : throw ErrorFactory . createArticleReaderException ( ErrorKeys . DELTA_CONSUMERS_TASK_READER_INPUTFACTORY_ILLEGAL_INPUTMODE_VALUE ) ; } if ( MODE_STATISTICAL_OUTPUT ) { return new TimedWikipediaXMLReader ( reader ) ; } return new WikipediaXMLReader ( reader ) ; }
|
Returns an ArticleReader which reads the specified input file .
|
4,084
|
private void createSystemMenu ( ) { JMenu system = new JMenu ( "System" ) ; JMenuItem importConfig = new JMenuItem ( "Import Configuration" ) ; importConfig . addActionListener ( new ActionListener ( ) { public void actionPerformed ( final ActionEvent e ) { controller . loadConfiguration ( ) ; } } ) ; system . add ( importConfig ) ; JMenuItem exportConfig = new JMenuItem ( "Export Configuration" ) ; exportConfig . addActionListener ( new ActionListener ( ) { public void actionPerformed ( final ActionEvent e ) { controller . saveConfiguration ( ) ; } } ) ; system . add ( exportConfig ) ; system . addSeparator ( ) ; JMenuItem defaultConfig = new JMenuItem ( "Reset to default parameters" ) ; defaultConfig . addActionListener ( new ActionListener ( ) { public void actionPerformed ( final ActionEvent e ) { controller . defaultConfiguration ( ) ; } } ) ; system . add ( defaultConfig ) ; system . addSeparator ( ) ; JMenuItem systemClose = new JMenuItem ( "Close" ) ; systemClose . addActionListener ( new ActionListener ( ) { public void actionPerformed ( final ActionEvent e ) { System . exit ( - 1 ) ; } } ) ; system . add ( systemClose ) ; this . add ( system ) ; }
|
Creates the System menu and its menu items .
|
4,085
|
public void setConfigParameter ( final ConfigurationKeys key , Object value ) { if ( key == ConfigurationKeys . LOGGING_PATH_DEBUG || key == ConfigurationKeys . LOGGING_PATH_DIFFTOOL || key == ConfigurationKeys . PATH_OUTPUT_SQL_FILES ) { String v = ( String ) value ; if ( ! v . endsWith ( File . separator ) && v . contains ( File . separator ) ) { value = v + File . separator ; } } this . parameterMap . put ( key , value ) ; }
|
Assigns the given value to the the given key .
|
4,086
|
public Object getConfigParameter ( final ConfigurationKeys configParameter ) { if ( this . parameterMap . containsKey ( configParameter ) ) { return this . parameterMap . get ( configParameter ) ; } return null ; }
|
Returns the value related to the configuration key or null if the key is not contained .
|
4,087
|
public void defaultConfiguration ( ) { clear ( ) ; setConfigParameter ( ConfigurationKeys . VALUE_MINIMUM_LONGEST_COMMON_SUBSTRING , 12 ) ; setConfigParameter ( ConfigurationKeys . COUNTER_FULL_REVISION , 1000 ) ; setConfigParameter ( ConfigurationKeys . LIMIT_TASK_SIZE_REVISIONS , 5000000l ) ; setConfigParameter ( ConfigurationKeys . LIMIT_TASK_SIZE_DIFFS , 1000000l ) ; setConfigParameter ( ConfigurationKeys . LIMIT_SQLSERVER_MAX_ALLOWED_PACKET , 1000000l ) ; setConfigParameter ( ConfigurationKeys . MODE_SURROGATES , SurrogateModes . DISCARD_REVISION ) ; setConfigParameter ( ConfigurationKeys . WIKIPEDIA_ENCODING , StandardCharsets . UTF_8 . toString ( ) ) ; setConfigParameter ( ConfigurationKeys . MODE_OUTPUT , OutputType . BZIP2 ) ; setConfigParameter ( ConfigurationKeys . MODE_DATAFILE_OUTPUT , false ) ; setConfigParameter ( ConfigurationKeys . MODE_ZIP_COMPRESSION_ENABLED , true ) ; setConfigParameter ( ConfigurationKeys . LIMIT_SQL_FILE_SIZE , 1000000000l ) ; setConfigParameter ( ConfigurationKeys . LOGGING_PATH_DIFFTOOL , "logs" ) ; setConfigParameter ( ConfigurationKeys . LOGGING_LOGLEVEL_DIFFTOOL , Level . INFO ) ; setConfigParameter ( ConfigurationKeys . VERIFICATION_DIFF , false ) ; setConfigParameter ( ConfigurationKeys . VERIFICATION_ENCODING , false ) ; setConfigParameter ( ConfigurationKeys . MODE_DEBUG_OUTPUT , false ) ; setConfigParameter ( ConfigurationKeys . MODE_STATISTICAL_OUTPUT , false ) ; Set < Integer > defaultNamespaces = new HashSet < Integer > ( ) ; defaultNamespaces . add ( 0 ) ; defaultNamespaces . add ( 1 ) ; setConfigParameter ( ConfigurationKeys . NAMESPACES_TO_KEEP , defaultNamespaces ) ; this . type = ConfigEnum . DEFAULT ; }
|
Applies the default single thread configuration of the DiffTool to this settings .
|
4,088
|
public void loadConfig ( final String path ) { try { ConfigurationReader reader = new ConfigurationReader ( path ) ; ConfigSettings settings = reader . read ( ) ; clear ( ) ; this . type = settings . type ; this . parameterMap = settings . parameterMap ; this . archives = settings . archives ; } catch ( Exception e ) { e . printStackTrace ( ) ; } }
|
Loads the configuration settings from a file .
|
4,089
|
public static ConfigurationException createConfigurationException ( final ErrorKeys errorId , final String message ) { return new ConfigurationException ( errorId . toString ( ) + ":\r\n" + message ) ; }
|
Creates a ConfigurationException object .
|
4,090
|
public static LoggingException createLoggingException ( final ErrorKeys errorId , final Exception e ) { return new LoggingException ( errorId . toString ( ) , e ) ; }
|
Creates a LoggingException object .
|
4,091
|
public ConfigSettings read ( ) { ConfigSettings config = new ConfigSettings ( ConfigEnum . IMPORT ) ; String name ; Node node ; NodeList list = root . getChildNodes ( ) ; int length = list . getLength ( ) ; for ( int i = 0 ; i < length ; i ++ ) { node = list . item ( i ) ; name = node . getNodeName ( ) . toUpperCase ( ) ; if ( name . equals ( SECTION_MODE ) ) { parseModeConfig ( node , config ) ; } else if ( name . equals ( SECTION_EXTERNALS ) ) { parseExternalsConfig ( node , config ) ; } else if ( name . equals ( SECTION_INPUT ) ) { parseInputConfig ( node , config ) ; } else if ( name . equals ( SECTION_OUTPUT ) ) { parseOutputConfig ( node , config ) ; } else if ( name . equals ( SECTION_CACHE ) ) { parseCacheConfig ( node , config ) ; } else if ( name . equals ( SECTION_LOGGING ) ) { parseLoggingConfig ( node , config ) ; } else if ( name . equals ( SECTION_DEBUG ) ) { parseDebugConfig ( node , config ) ; } else if ( name . equals ( SECTION_FILTER ) ) { parseFilterConfig ( node , config ) ; } } return config ; }
|
Reads the input of the configuration file and parses the into the ConfigSettings object .
|
4,092
|
private void parseFilterConfig ( final Node node , final ConfigSettings config ) { String name ; Node nnode ; final NodeList list = node . getChildNodes ( ) ; final int length = list . getLength ( ) ; for ( int i = 0 ; i < length ; i ++ ) { nnode = list . item ( i ) ; name = nnode . getNodeName ( ) . toUpperCase ( ) ; if ( name . equals ( SUBSECTION_FILTER_NAMESPACES ) ) { parseNamespaceFilterConfig ( nnode , config ) ; } } }
|
Parses the filter parameter section .
|
4,093
|
private void parseNamespaceFilterConfig ( final Node node , final ConfigSettings config ) { String name ; Integer value ; Node nnode ; final NodeList list = node . getChildNodes ( ) ; final int length = list . getLength ( ) ; final Set < Integer > namespaces = new HashSet < Integer > ( ) ; for ( int i = 0 ; i < length ; i ++ ) { nnode = list . item ( i ) ; name = nnode . getNodeName ( ) . toUpperCase ( ) ; if ( name . equals ( NAMESPACE_TO_KEEP ) ) { value = Integer . parseInt ( nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; namespaces . add ( value ) ; } } config . setConfigParameter ( ConfigurationKeys . NAMESPACES_TO_KEEP , namespaces ) ; }
|
Parses the namespaces parameter section . This is the subsection of filter .
|
4,094
|
private void parseModeConfig ( final Node node , final ConfigSettings config ) { String name ; Integer value ; Node nnode ; NodeList list = node . getChildNodes ( ) ; int length = list . getLength ( ) ; for ( int i = 0 ; i < length ; i ++ ) { nnode = list . item ( i ) ; name = nnode . getNodeName ( ) . toUpperCase ( ) ; if ( name . equals ( KEY_VALUE_MINIMUM_LONGEST_COMMON_SUBSTRING ) ) { value = Integer . parseInt ( nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; config . setConfigParameter ( ConfigurationKeys . VALUE_MINIMUM_LONGEST_COMMON_SUBSTRING , value ) ; } else if ( name . equals ( KEY_COUNTER_FULL_REVISION ) ) { value = Integer . parseInt ( nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; config . setConfigParameter ( ConfigurationKeys . COUNTER_FULL_REVISION , value ) ; } } }
|
Parses the mode parameter section .
|
4,095
|
private void parseExternalsConfig ( final Node node , final ConfigSettings config ) { String name , value ; Node nnode ; NodeList list = node . getChildNodes ( ) ; int length = list . getLength ( ) ; for ( int i = 0 ; i < length ; i ++ ) { nnode = list . item ( i ) ; name = nnode . getNodeName ( ) . toUpperCase ( ) ; if ( name . equals ( KEY_SEVENZIP ) ) { value = nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ; value = value . substring ( 1 , value . length ( ) - 1 ) ; config . setConfigParameter ( ConfigurationKeys . PATH_PROGRAM_7ZIP , value ) ; } } }
|
Parses the externals parameter section .
|
4,096
|
private void parseInputConfig ( final Node node , final ConfigSettings config ) { String name , value ; Node nnode ; NodeList list = node . getChildNodes ( ) ; int length = list . getLength ( ) ; for ( int i = 0 ; i < length ; i ++ ) { nnode = list . item ( i ) ; name = nnode . getNodeName ( ) . toUpperCase ( ) ; if ( name . equals ( KEY_WIKIPEDIA_ENCODING ) ) { value = nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ; config . setConfigParameter ( ConfigurationKeys . WIKIPEDIA_ENCODING , value ) ; } else if ( name . equals ( KEY_MODE_SURROGATES ) ) { SurrogateModes oValue = SurrogateModes . parse ( nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; config . setConfigParameter ( ConfigurationKeys . MODE_SURROGATES , oValue ) ; } else if ( name . equals ( SUBSECTION_ARCHIVE ) ) { parseInputArchive ( nnode , config ) ; } } }
|
Parses the input parameter section .
|
4,097
|
private void parseInputArchive ( final Node node , final ConfigSettings config ) { String name ; InputType type = null ; String path = null ; long startPosition = 0 ; Node nnode ; NodeList list = node . getChildNodes ( ) ; int length = list . getLength ( ) ; for ( int i = 0 ; i < length ; i ++ ) { nnode = list . item ( i ) ; name = nnode . getNodeName ( ) . toUpperCase ( ) ; if ( name . equals ( KEY_TYPE ) ) { type = InputType . parse ( nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; } else if ( name . equals ( KEY_PATH ) ) { path = nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ; path = path . substring ( 1 , path . length ( ) - 1 ) ; } else if ( name . equals ( KEY_START ) ) { startPosition = Long . parseLong ( nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; } } if ( type == null || path == null ) { throw new IllegalArgumentException ( "Illegal Archive Description" ) ; } ArchiveDescription archive = new ArchiveDescription ( type , path ) ; if ( startPosition > 0 ) { archive . setStartPosition ( startPosition ) ; } config . add ( archive ) ; }
|
Parses the input archive subsection .
|
4,098
|
private void parseOutputConfig ( final Node node , final ConfigSettings config ) { String name ; Long lValue ; Boolean bValue ; Node nnode ; NodeList list = node . getChildNodes ( ) ; int length = list . getLength ( ) ; for ( int i = 0 ; i < length ; i ++ ) { nnode = list . item ( i ) ; name = nnode . getNodeName ( ) . toUpperCase ( ) ; if ( name . equals ( KEY_OUTPUT_MODE ) ) { OutputType oValue = OutputType . parse ( nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; config . setConfigParameter ( ConfigurationKeys . MODE_OUTPUT , oValue ) ; } else if ( name . equals ( KEY_PATH ) ) { String path = nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ; path = path . substring ( 1 , path . length ( ) - 1 ) ; config . setConfigParameter ( ConfigurationKeys . PATH_OUTPUT_SQL_FILES , path ) ; } else if ( name . equals ( KEY_OUTPUT_DATAFILE ) ) { bValue = Boolean . parseBoolean ( nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; config . setConfigParameter ( ConfigurationKeys . MODE_DATAFILE_OUTPUT , bValue ) ; } else if ( name . equals ( KEY_LIMIT_SQL_FILE_SIZE ) ) { lValue = Long . parseLong ( nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; config . setConfigParameter ( ConfigurationKeys . LIMIT_SQL_FILE_SIZE , lValue ) ; } else if ( name . equals ( KEY_LIMIT_SQL_ARCHIVE_SIZE ) ) { lValue = Long . parseLong ( nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; config . setConfigParameter ( ConfigurationKeys . LIMIT_SQL_ARCHIVE_SIZE , lValue ) ; } else if ( name . equals ( KEY_MODE_ZIP_COMPRESSION_ENABLED ) ) { bValue = Boolean . parseBoolean ( nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; config . setConfigParameter ( ConfigurationKeys . MODE_ZIP_COMPRESSION_ENABLED , bValue ) ; } else if ( name . equals ( KEY_MODE_BINARY_OUTPUT_ENABLED ) ) { bValue = Boolean . parseBoolean ( nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; config . setConfigParameter ( ConfigurationKeys . MODE_BINARY_OUTPUT_ENABLED , bValue ) ; } else if ( name . equals ( SUBSECTION_SQL ) ) { parseSQLConfig ( nnode , config ) ; } } }
|
Parses the output parameter section .
|
4,099
|
private void parseSQLConfig ( final Node node , final ConfigSettings config ) { String name , value ; Node nnode ; NodeList list = node . getChildNodes ( ) ; int length = list . getLength ( ) ; for ( int i = 0 ; i < length ; i ++ ) { nnode = list . item ( i ) ; name = nnode . getNodeName ( ) . toUpperCase ( ) ; if ( name . equals ( KEY_HOST ) ) { value = nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ; config . setConfigParameter ( ConfigurationKeys . SQL_HOST , value ) ; } else if ( name . equals ( KEY_DATABASE ) ) { value = nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ; config . setConfigParameter ( ConfigurationKeys . SQL_DATABASE , value ) ; } else if ( name . equals ( KEY_USER ) ) { value = nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ; config . setConfigParameter ( ConfigurationKeys . SQL_USERNAME , value ) ; } else if ( name . equals ( KEY_PASSWORD ) ) { value = nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ; config . setConfigParameter ( ConfigurationKeys . SQL_PASSWORD , value ) ; } } }
|
Parses the sql parameter section .
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.