idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
35,600
protected final ProcessorDef [ ] getDefaultProviders ( final ProcessorDef baseDef ) { ProcessorDef extendsDef = getExtends ( ) ; final Vector chain = new Vector ( ) ; while ( extendsDef != null && ! chain . contains ( extendsDef ) ) { chain . addElement ( extendsDef ) ; extendsDef = extendsDef . getExtends ( ) ; } if (...
Creates an chain of objects which provide default values in descending order of significance .
139
16
35,601
public ProcessorDef getExtends ( ) throws BuildException { if ( this . extendsRef != null ) { final Object obj = this . extendsRef . getReferencedObject ( getProject ( ) ) ; if ( ! getClass ( ) . isInstance ( obj ) ) { throw new BuildException ( "Referenced object " + this . extendsRef . getRefId ( ) + " not correct ty...
Gets the ProcessorDef specified by the extends attribute
130
10
35,602
public boolean getRebuild ( final ProcessorDef [ ] defaultProviders , final int index ) { if ( isReference ( ) ) { return ( ( ProcessorDef ) getCheckedRef ( ProcessorDef . class , "ProcessorDef" ) ) . getRebuild ( defaultProviders , index ) ; } if ( this . rebuild != null ) { return this . rebuild . booleanValue ( ) ; ...
Gets a boolean value indicating whether all targets must be rebuilt regardless of dependency analysis .
130
17
35,603
public void setClassname ( final String className ) throws BuildException { Object proc = null ; try { final Class implClass = ProcessorDef . class . getClassLoader ( ) . loadClass ( className ) ; try { final Method getInstance = implClass . getMethod ( "getInstance" ) ; proc = getInstance . invoke ( null ) ; } catch (...
Sets the class name for the adapter . Use the name attribute when the tool is supported .
121
19
35,604
protected void setProcessor ( final Processor processor ) throws BuildException , NullPointerException { if ( processor == null ) { throw new NullPointerException ( "processor" ) ; } if ( isReference ( ) ) { throw super . tooManyAttributes ( ) ; } if ( this . env == null && ! this . newEnvironment ) { this . processor ...
Sets the processor
102
4
35,605
@ Override public void setRefid ( final org . apache . tools . ant . types . Reference ref ) { super . setRefid ( ref ) ; }
Specifies that this element should behave as if the content of the element with the matching id attribute was inserted at this location . If specified no other attributes or child content should be specified other than if unless and description .
35
43
35,606
public void visitFiles ( final FileVisitor visitor ) { final Project p = getProject ( ) ; if ( p == null ) { throw new java . lang . IllegalStateException ( "project must be set before this call" ) ; } if ( isReference ( ) ) { ( ( ProcessorDef ) getCheckedRef ( ProcessorDef . class , "ProcessorDef" ) ) . visitFiles ( v...
This method calls the FileVistor s visit function for every file in the processors definition
280
17
35,607
public String getDataset ( ) { if ( isReference ( ) ) { final LibrarySet master = ( LibrarySet ) getCheckedRef ( LibrarySet . class , "LibrarySet" ) ; return master . getDataset ( ) ; } return this . dataset ; }
Gets the dataset . Used on OS390 if the libs are in a dataset .
59
18
35,608
public LibraryTypeEnum getType ( ) { if ( isReference ( ) ) { final LibrarySet master = ( LibrarySet ) getCheckedRef ( LibrarySet . class , "LibrarySet" ) ; return master . getType ( ) ; } return this . libraryType ; }
Gets preferred library type
59
5
35,609
public void setLibs ( final CUtil . StringArrayBuilder libs ) throws BuildException { if ( isReference ( ) ) { throw tooManyAttributes ( ) ; } this . libnames = libs . getValue ( ) ; // // earlier implementations would warn of suspicious library names // (like libpthread for pthread or kernel.lib for kernel). // visitL...
Comma - separated list of library names without leading prefixes such as lib or extensions such as . so or . a .
104
25
35,610
public ArchEnum getArch ( ) { if ( isReference ( ) ) { final TargetDef refPlatform = ( TargetDef ) getCheckedRef ( TargetDef . class , "TargetDef" ) ; return refPlatform . getArch ( ) ; } return this . arch ; }
Gets arch .
59
4
35,611
public CPUEnum getCpu ( ) { if ( isReference ( ) ) { final TargetDef refPlatform = ( TargetDef ) getCheckedRef ( TargetDef . class , "TargetDef" ) ; return refPlatform . getCpu ( ) ; } return this . cpu ; }
Gets cpu .
61
4
35,612
public OSFamilyEnum getOsfamily ( ) { if ( isReference ( ) ) { final TargetDef refPlatform = ( TargetDef ) getCheckedRef ( TargetDef . class , "TargetDef" ) ; return refPlatform . getOsfamily ( ) ; } return this . osFamily ; }
Gets operating system family .
63
6
35,613
public void setArch ( final ArchEnum value ) { if ( isReference ( ) ) { throw tooManyAttributes ( ) ; } if ( this . cpu != null ) { throw tooManyAttributes ( ) ; } this . arch = value ; }
Sets cpu architecture compiler may use cpu specific instructions .
52
11
35,614
public void setOsfamily ( final OSFamilyEnum value ) { if ( isReference ( ) ) { throw tooManyAttributes ( ) ; } if ( this . cpu != null ) { throw tooManyAttributes ( ) ; } this . osFamily = value ; }
Sets operating system family .
55
6
35,615
public UndefineArgument [ ] getDefines ( ) throws BuildException { if ( isReference ( ) ) { final DefineSet defset = ( DefineSet ) getCheckedRef ( DefineSet . class , "DefineSet" ) ; return defset . getDefines ( ) ; } else { if ( isActive ( ) ) { final UndefineArgument [ ] defs = new UndefineArgument [ this . defineLis...
Returns the defines and undefines in this set .
138
11
35,616
public void setDefine ( final CUtil . StringArrayBuilder defList ) throws BuildException { if ( isReference ( ) ) { throw tooManyAttributes ( ) ; } addDefines ( defList . getValue ( ) , true ) ; }
A comma - separated list of preprocessor macros to define . Use nested define elements to define macro values .
53
21
35,617
@ Override public void setRefid ( final Reference r ) throws BuildException { if ( ! this . defineList . isEmpty ( ) ) { throw tooManyAttributes ( ) ; } super . setRefid ( r ) ; }
Specifies that this element should behave as if the content of the element with the matching id attribute was inserted at this location . If specified no other attributes or child content should be specified other than description .
49
40
35,618
public void setUndefine ( final CUtil . StringArrayBuilder undefList ) throws BuildException { if ( isReference ( ) ) { throw tooManyAttributes ( ) ; } addDefines ( undefList . getValue ( ) , false ) ; }
A comma - separated list of preprocessor macros to undefine .
56
14
35,619
public final String [ ] getAttachedNars ( final AOL aol , final String type ) { final String attachedNars = getProperty ( aol , NarConstants . NAR + "." + type ) ; return attachedNars != null ? attachedNars . split ( "," ) : null ; }
FIXME replace with list of AttachedNarArtifacts
66
11
35,620
public DependencyInfo getDependencyInfo ( final String sourceRelativeName , final String includePathIdentifier ) { DependencyInfo dependInfo = null ; final DependencyInfo [ ] dependInfos = ( DependencyInfo [ ] ) this . dependencies . get ( sourceRelativeName ) ; if ( dependInfos != null ) { for ( final DependencyInfo d...
This method returns a DependencyInfo for the specific source file and include path identifier
127
16
35,621
public boolean needsRebuild ( final CCTask task , final TargetInfo target , final int dependencyDepth ) { // look at any files where the compositeLastModified // is not known, but the includes are known // boolean mustRebuild = false ; final CompilerConfiguration compiler = ( CompilerConfiguration ) target . getConfigu...
Determines if the specified target needs to be rebuilt .
405
12
35,622
@ Override public final void narExecute ( ) throws MojoExecutionException , MojoFailureException { // download the dependencies if needed in local maven repository. List < AttachedNarArtifact > attachedNarArtifacts = getAttachedNarArtifacts ( libraries ) ; downloadAttachedNars ( attachedNarArtifacts ) ; // Warning, for...
Copies the unpacked nar libraries and files into the projects target area
509
14
35,623
public LibrarySet [ ] getActiveLibrarySets ( final LinkerDef [ ] defaultProviders , final int index ) { if ( isReference ( ) ) { return ( ( LinkerDef ) getCheckedRef ( LinkerDef . class , "LinkerDef" ) ) . getActiveUserLibrarySets ( defaultProviders , index ) ; } final Project p = getProject ( ) ; final Vector libsets ...
Returns an array of active library sets for this linker definition .
233
13
35,624
public void setName ( final LinkerEnum name ) throws BuildException { if ( isReference ( ) ) { throw tooManyAttributes ( ) ; } final Linker linker = name . getLinker ( ) ; super . setProcessor ( linker ) ; }
Sets linker type .
57
6
35,625
@ Override public String [ ] getOutputFileNames ( final String inputFile , final VersionInfo versionInfo ) { if ( inputFile . endsWith ( ".cpp" ) ) { return super . getOutputFileNames ( inputFile , versionInfo ) ; } // // if a recognized input file // final String baseName = getBaseOutputName ( inputFile ) ; return new...
Gets output file names .
97
6
35,626
private static PBXObjectRef createPBXBuildFile ( final PBXObjectRef fileRef , final Map settings ) { final Map map = new HashMap ( ) ; map . put ( "fileRef" , fileRef ) ; map . put ( "isa" , "PBXBuildFile" ) ; if ( settings != null ) { map . put ( "settings" , settings ) ; } return new PBXObjectRef ( map ) ; }
Create PBXBuildFile .
94
6
35,627
private static PBXObjectRef createPBXCopyFilesBuildPhase ( final int buildActionMask , final String dstPath , final String dstSubfolderSpec , final List files , final boolean runOnly ) { final Map map = new HashMap ( ) ; map . put ( "isa" , "PBXCopyFilesBuildPhase" ) ; map . put ( "buildActionMask" , NumberFormat . get...
Create a build phase that copies files to a destination .
177
11
35,628
private static PBXObjectRef createPBXFileReference ( final String sourceTree , final String baseDir , final File file ) { final Map map = new HashMap ( ) ; map . put ( "isa" , "PBXFileReference" ) ; final String relPath = CUtil . toUnixPath ( CUtil . getRelativePath ( baseDir , file ) ) ; map . put ( "path" , relPath )...
Create PBXFileReference .
134
6
35,629
private static PBXObjectRef createPBXFrameworksBuildPhase ( final int buildActionMask , final List files , final boolean runOnly ) { final Map map = new HashMap ( ) ; map . put ( "isa" , "PBXFrameworksBuildPhase" ) ; map . put ( "buildActionMask" , NumberFormat . getIntegerInstance ( Locale . US ) . format ( buildActio...
Create PBXFrameworksBuildPhase .
131
7
35,630
private static PBXObjectRef createPBXGroup ( final String name , final String sourceTree , final List children ) { final Map map = new HashMap ( ) ; map . put ( "isa" , "PBXGroup" ) ; map . put ( "name" , name ) ; map . put ( "sourceTree" , sourceTree ) ; map . put ( "children" , children ) ; return new PBXObjectRef ( ...
Create PBXGroup .
96
5
35,631
private static PBXObjectRef createPBXNativeTarget ( final String name , final PBXObjectRef buildConfigurationList , final List buildPhases , final List buildRules , final List dependencies , final String productInstallPath , final String productName , final PBXObjectRef productReference , final String productType ) { f...
Create PBXNativeTarget .
222
6
35,632
private static PBXObjectRef createPBXProject ( final PBXObjectRef buildConfigurationList , final PBXObjectRef mainGroup , final String projectDirPath , final String projectRoot , final List targets ) { final Map map = new HashMap ( ) ; map . put ( "isa" , "PBXProject" ) ; map . put ( "buildConfigurationList" , buildCon...
Create PBXProject .
178
5
35,633
private static PBXObjectRef createPBXSourcesBuildPhase ( final int buildActionMask , final List files , final boolean runOnly ) { final Map map = new HashMap ( ) ; map . put ( "buildActionMask" , String . valueOf ( buildActionMask ) ) ; map . put ( "files" , files ) ; map . put ( "isa" , "PBXSourcesBuildPhase" ) ; map ...
Create PBXSourcesBuildPhase .
121
7
35,634
private static PBXObjectRef createXCBuildConfiguration ( final String name , final Map < String , ? > buildSettings ) { final Map map = new HashMap ( ) ; map . put ( "isa" , "XCBuildConfiguration" ) ; map . put ( "buildSettings" , buildSettings ) ; map . put ( "name" , name ) ; return new PBXObjectRef ( map ) ; }
Create XCBuildConfiguration .
88
6
35,635
private static PBXObjectRef createXCConfigurationList ( final List buildConfigurations ) { final Map map = new HashMap ( ) ; map . put ( "isa" , "XCConfigurationList" ) ; map . put ( "buildConfigurations" , buildConfigurations ) ; return new PBXObjectRef ( map ) ; }
Create XCConfigurationList .
71
6
35,636
private PBXObjectRef addDependency ( final Map objects , final PBXObjectRef project , final List mainGroupChildren , final String baseDir , final DependencyDef dependency ) { if ( dependency . getFile ( ) != null ) { final File xcodeDir = new File ( dependency . getFile ( ) . getAbsolutePath ( ) + ".xcodeproj" ) ; if (...
Adds a dependency to the object graph .
491
8
35,637
private PBXObjectRef addDocumentationGroup ( final Map objects , final String sourceTree ) { final List productsList = new ArrayList ( ) ; final PBXObjectRef products = createPBXGroup ( "Documentation" , sourceTree , productsList ) ; objects . put ( products . getID ( ) , products . getProperties ( ) ) ; return product...
Add documentation group to map of objects .
79
8
35,638
private PBXObjectRef addNativeTarget ( final Map objects , final TargetInfo linkTarget , final PBXObjectRef product , final String projectName , final List < PBXObjectRef > sourceGroupChildren , final List < PBXObjectRef > frameworkBuildFiles ) { final PBXObjectRef buildConfigurations = addNativeTargetConfigurationList...
Add native target to map of objects .
543
8
35,639
private PBXObjectRef addNativeTargetConfigurationList ( final Map objects , final String projectName ) { // // Create a configuration list with // two stock configurations: Debug and Release // final List < PBXObjectRef > configurations = new ArrayList <> ( ) ; final Map debugSettings = new HashMap ( ) ; debugSettings ...
Add native target configuration list .
545
6
35,640
private PBXObjectRef addProduct ( final Map objects , final TargetInfo linkTarget ) { // // create file reference for executable file // forget Ant's location, just place in XCode's default location final PBXObjectRef executable = createPBXFileReference ( "BUILD_PRODUCTS_DIR" , linkTarget . getOutput ( ) . getParent ( ...
Add file reference of product to map of objects .
168
10
35,641
private List < PBXObjectRef > addSources ( final Map objects , final String sourceTree , final String basePath , final Map < String , TargetInfo > targets ) { final List < PBXObjectRef > sourceGroupChildren = new ArrayList <> ( ) ; final List < File > sourceList = new ArrayList <> ( targets . size ( ) ) ; for ( final T...
Add file references for all source files to map of objects .
277
12
35,642
protected void addIncludes ( final String baseDirPath , final File [ ] includeDirs , final Vector < String > args , final Vector < String > relativeArgs , final StringBuffer includePathId , final boolean isSystem ) { for ( final File includeDir : includeDirs ) { args . addElement ( getIncludeDirSwitch ( includeDir . ge...
Adds command - line arguments for include directories .
195
9
35,643
protected int getTotalArgumentLengthForInputFile ( final File outputDir , final String inputFile ) { final int argumentCountPerInputFile = getArgumentCountPerInputFile ( ) ; int len = 0 ; for ( int k = 0 ; k < argumentCountPerInputFile ; k ++ ) { len += getInputFileArgument ( outputDir , inputFile , k ) . length ( ) ; ...
Get total command line length due to the input file .
105
11
35,644
public File getPrototype ( ) { final PrecompileDef ref = getRef ( ) ; if ( ref != null ) { return ref . getPrototype ( ) ; } return this . prototype ; }
Gets prototype source file
43
5
35,645
public void setPrototype ( final File prototype ) { if ( isReference ( ) ) { throw tooManyAttributes ( ) ; } if ( prototype == null ) { throw new NullPointerException ( "prototype" ) ; } this . prototype = prototype ; }
Sets file to precompile .
54
8
35,646
public boolean isSharedLibrary ( ) { final String value = this . outputType . getValue ( ) ; // FREEHEP return value . equals ( "shared" ) || value . equals ( "plugin" ) || value . equals ( "jni" ) ; }
Gets whether the link should produce a shared library .
57
11
35,647
@ Override public void link ( final CCTask task , final File outputFile , final String [ ] sourceFiles , final CommandLineLinkerConfiguration config ) { // // delete any existing library outputFile . delete ( ) ; // // build a new library super . link ( task , outputFile , sourceFiles , config ) ; }
Builds a library .
69
5
35,648
private final < T > Object parseTypeArr ( Converter < T > converter , Class < T > valType , String [ ] arr ) throws Exception { Object objArr = Array . newInstance ( valType , arr . length ) ; for ( int i = 0 ; i < arr . length ; i ++ ) { T item = converter . parseFromString ( valType , null , null , arr [ i ] ) ; Arra...
say hello to arrays of primitives
110
7
35,649
private static String getName ( String name , Field field ) { if ( isEmpty ( name ) ) { name = field . getName ( ) ; } return name ; }
JSON & XML
36
3
35,650
public static SSLContext getInstance ( boolean server ) throws GeneralSecurityException { SSLContext retInstance = null ; if ( server ) { if ( serverInstance == null ) { synchronized ( BogusSslContextFactory . class ) { if ( serverInstance == null ) { try { serverInstance = createBougusServerSslContext ( ) ; } catch ( ...
Get SSLContext singleton .
168
6
35,651
public void messageReceived ( Object message ) { if ( message instanceof Packet ) { try { messageReceived ( conn , ( Packet ) message ) ; } catch ( Exception e ) { log . warn ( "Exception on packet receive" , e ) ; } } else { // raw buffer handling IoBuffer in = ( IoBuffer ) message ; // filter based on current connect...
Received message object router .
753
6
35,652
@ Override public void setConnection ( RTMPConnection conn ) { log . trace ( "Adding connection: {}" , conn ) ; int id = conn . getId ( ) ; if ( id == - 1 ) { log . debug ( "Connection has unsupported id, using session id hash" ) ; id = conn . getSessionId ( ) . hashCode ( ) ; } log . debug ( "Connection id: {} session...
Adds a connection .
117
4
35,653
@ Override public RTMPConnection getConnection ( int clientId ) { log . trace ( "Getting connection by client id: {}" , clientId ) ; for ( RTMPConnection conn : connMap . values ( ) ) { if ( conn . getId ( ) == clientId ) { return connMap . get ( conn . getSessionId ( ) ) ; } } return null ; }
Returns a connection for a given client id .
82
9
35,654
@ Override public RTMPConnection getConnectionBySessionId ( String sessionId ) { log . debug ( "Getting connection by session id: {}" , sessionId ) ; if ( connMap . containsKey ( sessionId ) ) { return connMap . get ( sessionId ) ; } else { log . warn ( "Connection not found for {}" , sessionId ) ; if ( log . isTraceEn...
Returns a connection for a given session id .
123
9
35,655
public RTMPConnection createConnectionInstance ( Class < ? > cls ) throws Exception { RTMPConnection conn = null ; if ( cls == RTMPMinaConnection . class ) { conn = ( RTMPMinaConnection ) cls . newInstance ( ) ; } else if ( cls == RTMPTClientConnection . class ) { conn = ( RTMPTClientConnection ) cls . newInstance ( ) ...
Creates a connection instance based on the supplied type .
244
11
35,656
private IoBuffer encodeInvoke ( String method , Object [ ] params ) { log . debug ( "RemotingClient encodeInvoke - method: {} params: {}" , method , params ) ; IoBuffer result = IoBuffer . allocate ( 1024 ) ; result . setAutoExpand ( true ) ; //force version 3 result . putShort ( ( short ) 3 ) ; // Headers Collection <...
Encode the method call .
455
6
35,657
@ Override protected void processHeaders ( IoBuffer in ) { log . debug ( "RemotingClient processHeaders - buffer limit: {}" , ( in != null ? in . limit ( ) : 0 ) ) ; int version = in . getUnsignedShort ( ) ; // skip log . debug ( "Version: {}" , version ) ; // the version by now, AMF3 is not yet implemented int count =...
Process any headers sent in the response .
599
8
35,658
@ SuppressWarnings ( "unused" ) private static final void dump ( IoBuffer data ) { log . debug ( "Hex: {}" , data . getHexDump ( ) ) ; int pos = data . position ( ) ; byte [ ] bar = new byte [ data . limit ( ) - data . position ( ) ] ; data . get ( bar ) ; log . debug ( "Str {}" , new String ( bar ) ) ; bar = null ; da...
Used for debugging byte stream .
110
6
35,659
private static void completeConnection ( IoSession session , RTMPMinaConnection conn , RTMP rtmp , OutboundHandshake handshake ) { if ( handshake . useEncryption ( ) ) { // set encryption flag the rtmp state rtmp . setEncrypted ( true ) ; // add the ciphers log . debug ( "Adding ciphers to the session" ) ; session . se...
Provides connection completion .
323
5
35,660
@ Override public void setProtocol ( String protocol ) throws Exception { this . protocol = protocol ; if ( "rtmps" . equals ( protocol ) || "rtmpt" . equals ( protocol ) || "rtmpte" . equals ( protocol ) || "rtmfp" . equals ( protocol ) ) { throw new Exception ( "Unsupported protocol specified, please use the correct ...
Sets the RTMP protocol the default is rtmp . If rtmps or rtmpt are required the appropriate client type should be selected .
93
30
35,661
public List < ? > decode ( IoBuffer data ) { log . debug ( "decode - state: {}" , state ) ; if ( closing || state . getState ( ) == RTMP . STATE_DISCONNECTED ) { // Connection is being closed, don't decode any new packets return Collections . EMPTY_LIST ; } readBytes . addAndGet ( data . limit ( ) ) ; buffer . put ( da...
Decode data sent by the client .
111
8
35,662
@ Override public void write ( final Packet packet ) { log . debug ( "write - state: {}" , state ) ; if ( closing || state . getState ( ) == RTMP . STATE_DISCONNECTED ) { // Connection is being closed, don't send any new packets return ; } IoBuffer data ; try { Red5 . setConnectionLocal ( this ) ; data = encoder . enco...
Send RTMP packet down the connection .
190
8
35,663
@ Override public void connect ( String server , int port , String application , IPendingServiceCallback connectCallback ) { log . debug ( "connect server: {} port {} application {} connectCallback {}" , new Object [ ] { server , port , application , connectCallback } ) ; connect ( server , port , makeDefaultConnection...
Connect RTMP client to server s application via given port with given connection callback
82
15
35,664
@ Override public Map < String , Object > makeDefaultConnectionParams ( String server , int port , String application ) { Map < String , Object > params = new ObjectMap <> ( ) ; params . put ( "app" , application ) ; params . put ( "objectEncoding" , Integer . valueOf ( 0 ) ) ; params . put ( "fpad" , Boolean . FALSE )...
Creates the default connection parameters collection . Many implementations of this handler will create a tcUrl if not found it is created with the current server url .
224
30
35,665
@ Override public void connect ( String server , int port , Map < String , Object > connectionParams ) { log . debug ( "connect server: {} port {} connectionParams {}" , new Object [ ] { server , port , connectionParams } ) ; connect ( server , port , connectionParams , null ) ; }
Connect RTMP client to server via given port and with given connection parameters
70
14
35,666
@ Override public IClientSharedObject getSharedObject ( String name , boolean persistent ) { log . debug ( "getSharedObject name: {} persistent {}" , new Object [ ] { name , persistent } ) ; ClientSharedObject result = sharedObjects . get ( name ) ; if ( result != null ) { if ( result . isPersistent ( ) != persistent )...
Connect to client shared object .
139
6
35,667
@ Override public void invoke ( String method , IPendingServiceCallback callback ) { log . debug ( "invoke method: {} params {} callback {}" , new Object [ ] { method , callback } ) ; // get it from the conn manager if ( conn != null ) { conn . invoke ( method , callback ) ; } else { log . info ( "Connection was null" ...
Invoke a method on the server .
121
8
35,668
@ Override public void disconnect ( ) { log . debug ( "disconnect" ) ; if ( conn != null ) { streamDataMap . clear ( ) ; conn . close ( ) ; } else { log . info ( "Connection was null" ) ; } }
Disconnect the first connection in the connection map
56
9
35,669
public void ping ( short pingType , Number streamId , int param ) { conn . ping ( new Ping ( pingType , streamId , param ) ) ; }
Sends a ping .
34
5
35,670
public void handleException ( Throwable throwable ) { log . debug ( "Handle exception: {} with: {}" , throwable . getMessage ( ) , exceptionHandler ) ; if ( exceptionHandler != null ) { exceptionHandler . handleException ( throwable ) ; } else { log . error ( "Connection exception" , throwable ) ; throw new RuntimeExce...
Handle any exceptions that occur .
82
6
35,671
@ Override protected void createHandshakeBytes ( ) { log . trace ( "createHandshakeBytes" ) ; BigInteger bi = new BigInteger ( ( Constants . HANDSHAKE_SIZE * 8 ) , random ) ; handshakeBytes = BigIntegers . asUnsignedByteArray ( bi ) ; // prevent AOOB error that can occur, sometimes if ( handshakeBytes . length < Consta...
Creates the servers handshake bytes
159
6
35,672
private boolean getServerDigestPosition ( ) { boolean result = false ; //log.trace("BigEndian bytes: {}", Hex.encodeHexString(s1)); log . trace ( "Trying algorithm: {}" , algorithm ) ; digestPosServer = getDigestOffset ( algorithm , s1 , 0 ) ; log . debug ( "Server digest position offset: {}" , digestPosServer ) ; if (...
Gets and verifies the server digest .
277
9
35,673
public void initSwfVerification ( String swfFilePath ) { log . info ( "Initializing swf verification for: {}" , swfFilePath ) ; byte [ ] bytes = null ; if ( swfFilePath != null ) { File localSwfFile = new File ( swfFilePath ) ; if ( localSwfFile . exists ( ) && localSwfFile . canRead ( ) ) { log . info ( "Swf file path...
Initialize SWF verification data .
247
7
35,674
public String getScopeValue ( Scope scope ) { logger . debug ( "Enter OAuth2config::getDefaultScope" ) ; return PropertiesConfig . getInstance ( ) . getProperty ( scope . value ( ) ) ; }
Returns the scope value based on the Enum supplied
47
10
35,675
public String prepareUrl ( List < Scope > scopes , String redirectUri , String csrfToken ) throws InvalidRequestException { logger . debug ( "Enter OAuth2config::prepareUrl" ) ; if ( scopes == null || scopes . isEmpty ( ) || redirectUri . isEmpty ( ) || csrfToken . isEmpty ( ) ) { logger . error ( "Invalid request for ...
Prepares URL to call the OAuth2 authorization endpoint using Scope CSRF and redirectURL that is supplied
243
21
35,676
public static Date getCurrentDateTime ( ) throws ParseException { Calendar currentDate = Calendar . getInstance ( ) ; SimpleDateFormat formatter = new SimpleDateFormat ( DATE_yyyyMMddTHHmmssSSSZ ) ; String dateNow = formatter . format ( currentDate . getTime ( ) ) ; return getDateFromString ( dateNow ) ; }
Method to get the current date time Calendar instance
80
9
35,677
public static Date getDateWithPrevDays ( int noOfDays ) throws ParseException { Calendar currentDate = Calendar . getInstance ( ) ; currentDate . add ( Calendar . DATE , - noOfDays ) ; SimpleDateFormat formatter = new SimpleDateFormat ( DATE_yyyyMMddTHHmmssSSSZ ) ; String dateNow = formatter . format ( currentDate . ge...
Method to get the Date instance for the given days to be subtracted to the current date
101
18
35,678
public static String getStringFromDateTime ( Date date ) throws ParseException { SimpleDateFormat formatter = new SimpleDateFormat ( DATE_yyyyMMddTHHmmssSSSZone ) ; return formatter . format ( date ) ; }
Method to convert the given Date to String format
53
9
35,679
public static ICompressor getCompressor ( final String compressFormat ) throws CompressionException { ICompressor compressor = null ; if ( isValidCompressFormat ( compressFormat ) ) { if ( compressFormat . equalsIgnoreCase ( GZIP_COMPRESS_FORMAT ) ) { compressor = new GZIPCompressor ( ) ; } else if ( compressFormat . e...
Method to get the corresponding compressor class for the given compress format
112
12
35,680
public static boolean isValidCompressFormat ( final String compressFormat ) throws CompressionException { if ( ! StringUtils . hasText ( compressFormat ) ) { throw new CompressionException ( "Compress format is either null or empty!" ) ; } else if ( compressFormat . equalsIgnoreCase ( GZIP_COMPRESS_FORMAT ) || compress...
Method to validate whether the given compression format is valid
127
10
35,681
public void executeAsyncInterceptors ( final IntuitMessage intuitMessage ) { this . intuitMessage = intuitMessage ; this . configuration = Config . cloneConfigurationOverrides ( ) ; ExecutorService executorService = Executors . newSingleThreadExecutor ( ) ; executorService . submit ( this ) ; }
Method to execute interceptors in case of Async operations .
70
12
35,682
@ Override public Void call ( ) throws FMSException { CallbackMessage callbackMessage = new CallbackMessage ( ) ; try { // add configuration properties from the caller thread Config . addConfigurationOverrides ( configuration ) ; executeInterceptors ( intuitMessage ) ; } catch ( FMSException e ) { callbackMessage . set...
Callable interface method will be executed
142
7
35,683
public void invalidate ( ) { this . appToken = null ; this . appDBID = null ; this . authorizer = null ; this . intuitServiceType = null ; this . realmID = null ; }
Method to invalidate every fields in context .
46
9
35,684
public String getRequestID ( ) { if ( requestID == null ) { requestID = UUID . randomUUID ( ) . toString ( ) . replace ( "-" , "" ) ; } return requestID ; }
Method to generate unique requestID in the context of context
47
11
35,685
public static IEntitySerializer getSerializer ( final String serializeFormat ) throws SerializationException { IEntitySerializer serializer = null ; if ( isValidSerializeFormat ( serializeFormat ) ) { if ( serializeFormat . equalsIgnoreCase ( XML_SERIALIZE_FORMAT ) ) { serializer = new XMLSerializer ( ) ; } else if ( s...
Method to get the corresponding serialize instance for the given serializer format
117
14
35,686
public static boolean isValidSerializeFormat ( final String serializeFormat ) throws SerializationException { if ( ! StringUtils . hasText ( serializeFormat ) ) { throw new SerializationException ( "serialization format is either null or empty!" ) ; } else if ( serializeFormat . equalsIgnoreCase ( XML_SERIALIZE_FORMAT ...
Method to validate whether the given serialization format is correct
130
11
35,687
public Charge create ( Charge charge ) throws BaseException { logger . debug ( "Enter ChargeService::create" ) ; // prepare API url String apiUrl = requestContext . getBaseUrl ( ) + "charges" . replaceAll ( "\\{format\\}" , "json" ) ; logger . info ( "apiUrl - " + apiUrl ) ; // assign TypeReference for deserialization ...
Method to create Charge
197
4
35,688
public Charge retrieve ( String chargeId ) throws BaseException { logger . debug ( "Enter ChargeService::retrieve" ) ; if ( StringUtils . isBlank ( chargeId ) ) { logger . error ( "IllegalArgumentException {}" , chargeId ) ; throw new IllegalArgumentException ( "chargeId cannot be empty or null" ) ; } // prepare API ur...
Method to retrieve Charge
271
4
35,689
public Expression < Byte > eq ( byte value ) { String valueString = "'" + value + "'" ; return new Expression < Byte > ( this , Operation . eq , valueString ) ; }
Method to construct the equals expression for byte
41
8
35,690
public Expression < Short > eq ( short value ) { String valueString = "'" + value + "'" ; return new Expression < Short > ( this , Operation . eq , valueString ) ; }
Method to construct the equals expression for short
41
8
35,691
public Expression < Integer > eq ( int value ) { String valueString = "'" + value + "'" ; return new Expression < Integer > ( this , Operation . eq , valueString ) ; }
Method to construct the equals expression for integer
41
8
35,692
public Expression < Long > eq ( long value ) { String valueString = "'" + value + "'" ; return new Expression < Long > ( this , Operation . eq , valueString ) ; }
Method to construct the equals expression for long
41
8
35,693
public Expression < Float > eq ( float value ) { String valueString = "'" + value + "'" ; return new Expression < Float > ( this , Operation . eq , valueString ) ; }
Method to construct the equals expression for float
41
8
35,694
public Expression < Double > eq ( double value ) { String valueString = "'" + value + "'" ; return new Expression < Double > ( this , Operation . eq , valueString ) ; }
Method to construct the equals expression for double
41
8
35,695
public Expression < Byte > neq ( byte value ) { String valueString = "'" + value + "'" ; return new Expression < Byte > ( this , Operation . neq , valueString ) ; }
Method to construct the not equals expression for byte
43
9
35,696
public Expression < Short > neq ( short value ) { String valueString = "'" + value + "'" ; return new Expression < Short > ( this , Operation . neq , valueString ) ; }
Method to construct the not equals expression for short
43
9
35,697
public Expression < Integer > neq ( int value ) { String valueString = "'" + value + "'" ; return new Expression < Integer > ( this , Operation . neq , valueString ) ; }
Method to construct the not equals expression for int
43
9
35,698
public Expression < Long > neq ( long value ) { String valueString = "'" + value + "'" ; return new Expression < Long > ( this , Operation . neq , valueString ) ; }
Method to construct the not equals expression for long
43
9
35,699
public Expression < Float > neq ( float value ) { String valueString = "'" + value + "'" ; return new Expression < Float > ( this , Operation . neq , valueString ) ; }
Method to construct the not equals expression for float
43
9