idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
121,700 | public byte [ ] initDelegation ( GSSCredential credential , Oid mechanism , int lifetime , byte [ ] buf , int off , int len ) throws GSSException { logger . debug ( "Enter initDelegation: " + delegationState ) ; if ( mechanism != null && ! mechanism . equals ( getMech ( ) ) ) { throw new GSSException ( GSSException . B... | Initiate the delegation of a credential . |
121,701 | public static void installSecureRandomProvider ( ) { CoGProperties props = CoGProperties . getDefault ( ) ; String providerName = props . getSecureRandomProvider ( ) ; try { Class providerClass = Class . forName ( providerName ) ; Security . insertProviderAt ( ( Provider ) providerClass . newInstance ( ) , 1 ) ; } catc... | Installs SecureRandom provider . This function is automatically called when this class is loaded . |
121,702 | public static int getCAPathConstraint ( TBSCertificateStructure crt ) throws IOException { X509Extensions extensions = crt . getExtensions ( ) ; if ( extensions == null ) { return - 1 ; } X509Extension proxyExtension = extensions . getExtension ( X509Extension . basicConstraints ) ; if ( proxyExtension != null ) { Basi... | Return CA Path constraint |
121,703 | public static KeyPair generateKeyPair ( String algorithm , int bits ) throws GeneralSecurityException { KeyPairGenerator generator = null ; if ( provider == null ) { generator = KeyPairGenerator . getInstance ( algorithm ) ; } else { generator = KeyPairGenerator . getInstance ( algorithm , provider ) ; } generator . in... | Generates a key pair of given algorithm and strength . |
121,704 | public static TBSCertificateStructure getTBSCertificateStructure ( X509Certificate cert ) throws CertificateEncodingException , IOException { ASN1Primitive obj = toASN1Primitive ( cert . getTBSCertificate ( ) ) ; return TBSCertificateStructure . getInstance ( obj ) ; } | Extracts the TBS certificate from the given certificate . |
121,705 | public static CertPath getCertPath ( X509Certificate [ ] certs ) throws CertificateException { CertificateFactory factory = CertificateFactory . getInstance ( "X.509" ) ; return factory . generateCertPath ( Arrays . asList ( certs ) ) ; } | JGLOBUS - 91 |
121,706 | protected X509Credential createObject ( GlobusResource certSource , GlobusResource keySource ) throws ResourceStoreException { InputStream certIns ; InputStream keyIns ; try { certIns = certSource . getInputStream ( ) ; keyIns = keySource . getInputStream ( ) ; return new X509Credential ( certIns , keyIns ) ; } catch (... | for creation of credential from a file |
121,707 | public HostPort setPassive ( int port , int queue ) throws IOException { if ( serverSocket == null ) { ServerSocketFactory factory = ServerSocketFactory . getDefault ( ) ; serverSocket = factory . createServerSocket ( port , queue ) ; } session . serverMode = Session . SERVER_PASSIVE ; String address = Util . getLocalH... | Start the local server |
121,708 | public void setActive ( HostPort hp ) throws UnknownHostException , ClientException , IOException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "hostport: " + hp . getHost ( ) + " " + hp . getPort ( ) ) ; } session . serverMode = Session . SERVER_ACTIVE ; this . remoteServerAddress = hp ; } | Asynchronous ; return before completion . Connect to the remote server . Any exception that would occure will not be thrown but returned through the local control channel . |
121,709 | public static void exceptionToControlChannel ( Throwable e , String msg , BasicServerControlChannel control ) { java . io . StringWriter writer = new java . io . StringWriter ( ) ; e . printStackTrace ( new java . io . PrintWriter ( writer ) ) ; String stack = writer . toString ( ) ; LocalReply reply = new LocalReply (... | Convert the exception to a negative 451 reply and pipe it to the provided control channel . |
121,710 | public void store ( DataSink sink ) { try { localControlChannel . resetReplyCount ( ) ; TransferContext context = createTransferContext ( ) ; if ( session . serverMode == Session . SERVER_PASSIVE ) { runTask ( createPassiveConnectTask ( sink , context ) ) ; } else { runTask ( createActiveConnectTask ( sink , context ) ... | Asynchronous ; return before completion . Start the incoming transfer and store the file to the supplied data sink . Any exception that would occure will not be thrown but returned through the local control channel . |
121,711 | public void retrieve ( DataSource source ) { try { localControlChannel . resetReplyCount ( ) ; TransferContext context = createTransferContext ( ) ; if ( session . serverMode == Session . SERVER_PASSIVE ) { runTask ( createPassiveConnectTask ( source , context ) ) ; } else { runTask ( createActiveConnectTask ( source ,... | Asynchronous ; return before completion . Start the outgoing transfer reading the data from the supplied data source . Any exception that would occure will not be thrown but returned through the local control channel . |
121,712 | private synchronized void runTask ( Task task ) { if ( taskThread == null ) { taskThread = new TaskThread ( ) ; } taskThread . runTask ( task ) ; } | Use this as an interface to the local manager thread . This submits the task to the thread queue . The thread will perform it when it s ready with other waiting tasks . |
121,713 | private PassiveConnectTask createPassiveConnectTask ( DataSource source , TransferContext context ) { return new PassiveConnectTask ( serverSocket , source , localControlChannel , session , dataChannelFactory , context ) ; } | use these methods to create tasks |
121,714 | public void close ( ) throws IOException { try { this . context . dispose ( ) ; } catch ( GSSException e ) { throw new ChainedIOException ( "dispose failed." , e ) ; } finally { this . socket . close ( ) ; } } | Disposes of the context and closes the connection |
121,715 | public static byte [ ] readSslMessage ( InputStream in ) throws IOException { byte [ ] header = new byte [ 5 ] ; readFully ( in , header , 0 , header . length ) ; int length ; if ( isSSLv3Packet ( header ) ) length = toShort ( header [ 3 ] , header [ 4 ] ) ; else if ( isSSLv2HelloPacket ( header ) ) length = ( ( ( head... | Reads an entire SSL message from the specified input stream . |
121,716 | public static void writeInt ( int v , byte [ ] buf , int off ) { buf [ off ] = ( byte ) ( ( v >>> 24 ) & 0xFF ) ; buf [ off + 1 ] = ( byte ) ( ( v >>> 16 ) & 0xFF ) ; buf [ off + 2 ] = ( byte ) ( ( v >>> 8 ) & 0xFF ) ; buf [ off + 3 ] = ( byte ) ( ( v >>> 0 ) & 0xFF ) ; } | Converts the specified int value into 4 bytes . The bytes are put into the specified byte array at a given offset location . |
121,717 | public void shutdown ( ) { accept = false ; try { _server . close ( ) ; } catch ( Exception e ) { } SocketFactory factory = SocketFactory . getDefault ( ) ; Socket s = null ; try { s = factory . createSocket ( InetAddress . getLocalHost ( ) , getPort ( ) ) ; s . getInputStream ( ) ; } catch ( Exception e ) { } finally ... | Stops the server but does not stop all the client threads |
121,718 | public Binding evaluate ( Map symbolTable ) throws RslEvaluationException { String strValue = _value . evaluate ( symbolTable ) ; return new Binding ( getName ( ) , new Value ( strValue ) ) ; } | Evaluates the variable definition with the specified symbol table . |
121,719 | public String toRSL ( boolean explicitConcat ) { StringBuffer buf = new StringBuffer ( ) ; toRSL ( buf , explicitConcat ) ; return buf . toString ( ) ; } | Returns a RSL representation of this variable definition . |
121,720 | public void toRSL ( StringBuffer buf , boolean explicitConcat ) { buf . append ( "(" ) ; buf . append ( getName ( ) ) ; buf . append ( " " ) ; getValue ( ) . toRSL ( buf , explicitConcat ) ; buf . append ( ")" ) ; } | Produces a RSL representation of this variable definition . |
121,721 | public static void setTimeout ( Stub stub , int timeout ) { if ( stub instanceof org . apache . axis . client . Stub ) { ( ( org . apache . axis . client . Stub ) stub ) . setTimeout ( timeout ) ; } } | Sets connection timeout . |
121,722 | public static void setHTTPVersion ( Stub stub , boolean http10 ) { stub . _setProperty ( MessageContext . HTTP_TRANSPORT_VERSION , ( http10 ) ? HTTPConstants . HEADER_PROTOCOL_V10 : HTTPConstants . HEADER_PROTOCOL_V11 ) ; } | Sets on option on the stub to control what HTTP protocol version should be used . |
121,723 | public GlobusResource getResource ( String location ) { GlobusResource returnResource ; URL resourceURL ; if ( location . startsWith ( "classpath:" ) ) { resourceURL = getClass ( ) . getClassLoader ( ) . getResource ( location . replaceFirst ( "classpath:/" , "" ) ) ; returnResource = new GlobusResource ( resourceURL .... | This method takes a location string and returns a GlobusResource of the corresponding location . This method does not accept any patterns for the location string . |
121,724 | public GlobusResource [ ] getResources ( String locationPattern ) { Vector < GlobusResource > pathsMatchingLocationPattern = new Vector < GlobusResource > ( ) ; String mainPath = "" ; if ( locationPattern . startsWith ( "classpath:" ) ) { String pathUntilWildcard = getPathUntilWildcard ( locationPattern . replaceFirst ... | Finds all the resources that match the Ant - Style locationPattern |
121,725 | private void parseFilesInDirectory ( File currentDirectory , Vector < GlobusResource > pathsMatchingLocationPattern ) { File [ ] directoryContents = null ; if ( currentDirectory . isDirectory ( ) ) { directoryContents = currentDirectory . listFiles ( ) ; } else { directoryContents = new File [ 1 ] ; directoryContents [... | Compares every file s Absolute Path against the locationPattern if they match a GlobusResource is created with the file s Absolute Path and added to pathsMatchingLocationPattern . |
121,726 | private void closeOutgoingSockets ( ) throws ClientException { SocketOperator op = new SocketOperator ( ) { public void operate ( SocketBox sb ) throws Exception { if ( ( ( ManagedSocketBox ) sb ) . isReusable ( ) ) { Socket s = sb . getSocket ( ) ; if ( s != null ) { EBlockImageDCWriter . close ( new DataOutputStream ... | All sockets opened when this server was active should send a special EBlock header before closing . |
121,727 | public void store ( DataSink sink ) { try { localControlChannel . resetReplyCount ( ) ; if ( session . transferMode != GridFTPSession . MODE_EBLOCK ) { EBlockParallelTransferContext context = ( EBlockParallelTransferContext ) createTransferContext ( ) ; context . setEodsTotal ( 0 ) ; if ( session . serverMode == Sessio... | Store the data from the data channel to the data sink . Does not block . If operation fails exception might be thrown via local control channel . |
121,728 | public void retrieve ( DataSource source ) { try { localControlChannel . resetReplyCount ( ) ; if ( session . transferMode != GridFTPSession . MODE_EBLOCK ) { EBlockParallelTransferContext context = ( EBlockParallelTransferContext ) createTransferContext ( ) ; context . setEodsTotal ( 0 ) ; logger . debug ( "starting o... | Retrieve the data from the data source and write to the data channel . This method does not block . If operation fails exception might be thrown via local control channel . |
121,729 | public static Socket authenticate ( Socket simpleSocket , boolean isClientSocket , GSSCredential credential , int protection , DataChannelAuthentication dcau ) throws Exception { GSSContext gssContext = null ; GSSManager manager = ExtendedGSSManager . getInstance ( ) ; if ( isClientSocket ) { gssContext = manager . cre... | authenticate socket . if protection on return authenticated socket wrapped over the original simpleSocket else return original socket . |
121,730 | public void addUrlCopyListener ( UrlCopyListener listener ) { if ( listeners == null ) listeners = new LinkedList ( ) ; listeners . add ( listener ) ; } | Adds url copy listener . |
121,731 | public void setSourceUrl ( GlobusURL source ) throws UrlCopyException { if ( source == null ) { throw new IllegalArgumentException ( "Source url cannot be null" ) ; } checkUrl ( source ) ; srcUrl = source ; } | Sets source url . |
121,732 | public void setDestinationUrl ( GlobusURL dest ) throws UrlCopyException { if ( dest == null ) { throw new IllegalArgumentException ( "Desitination url cannot be null" ) ; } checkUrl ( dest ) ; dstUrl = dest ; } | Sets destination url . |
121,733 | protected GlobusInputStream getInputStream ( ) throws Exception { GlobusInputStream in = null ; String fromP = srcUrl . getProtocol ( ) ; String fromFile = srcUrl . getPath ( ) ; if ( fromP . equalsIgnoreCase ( "file" ) ) { fromFile = URLDecoder . decode ( fromFile ) ; in = new GlobusFileInputStream ( fromFile ) ; } el... | Returns input stream based on the source url |
121,734 | protected GlobusOutputStream getOutputStream ( long size ) throws Exception { GlobusOutputStream out = null ; String toP = dstUrl . getProtocol ( ) ; String toFile = dstUrl . getPath ( ) ; if ( toP . equalsIgnoreCase ( "file" ) ) { toFile = URLDecoder . decode ( toFile ) ; out = new GlobusFileOutputStream ( toFile , ap... | Returns output stream based on the destination url . |
121,735 | private boolean transfer ( long total , GlobusInputStream in , GlobusOutputStream out ) throws IOException { byte [ ] buffer = new byte [ bufferSize ] ; int bytes = 0 ; long totalBytes = total ; long transferedBytes = 0 ; if ( total == - 1 ) { while ( ( bytes = in . read ( buffer ) ) != - 1 ) { out . write ( buffer , 0... | This function performs the actual transfer . |
121,736 | private void thirdPartyTransfer ( ) throws UrlCopyException { logger . debug ( "Trying third party transfer..." ) ; FTPClient srcFTP = null ; FTPClient dstFTP = null ; try { srcFTP = createFTPConnection ( srcUrl , true ) ; dstFTP = createFTPConnection ( dstUrl , false ) ; negotiateDCAU ( srcFTP , dstFTP ) ; srcFTP . se... | This performs thrid party transfer only if source and destination urls are ftp urls . |
121,737 | public String evaluate ( Map symbolTable ) throws RslEvaluationException { String var = null ; if ( symbolTable != null ) { var = ( String ) symbolTable . get ( value ) ; } if ( var == null && defValue != null ) { var = defValue . evaluate ( symbolTable ) ; } if ( var == null ) { throw new RslEvaluationException ( "Var... | Evaluates the variable reference with the specified symbol table . The value of the reference is first looked up in the symbol table . If not found then the default value is used . If the default value is not specified the reference is evaluated to an empty string . |
121,738 | public void toRSL ( StringBuffer buf , boolean explicitConcat ) { buf . append ( "$(" ) ; buf . append ( value ) ; if ( defValue != null ) { buf . append ( " " ) ; defValue . toRSL ( buf , explicitConcat ) ; } buf . append ( ")" ) ; if ( concatValue == null ) return ; if ( explicitConcat ) buf . append ( " # " ) ; conc... | Produces a RSL representation of this variable reference . |
121,739 | public void checkClientTrusted ( X509Certificate [ ] x509Certificates , String authType ) throws CertificateException { CertPath certPath = CertificateUtil . getCertPath ( x509Certificates ) ; try { this . result = this . validator . engineValidate ( certPath , parameters ) ; } catch ( CertPathValidatorException except... | Test if the client is trusted based on the certificate chain . Does not currently support anonymous clients . |
121,740 | public X509Certificate [ ] getAcceptedIssuers ( ) { try { Collection < X509Certificate > trusted = CertificateLoadUtil . getTrustedCertificates ( this . parameters . getTrustStore ( ) , null ) ; return trusted . toArray ( new X509Certificate [ trusted . size ( ) ] ) ; } catch ( KeyStoreException e ) { logger . warn ( "... | Get the collection of trusted certificate issuers . |
121,741 | private static byte [ ] getDecodedPEMObject ( BufferedReader reader ) throws IOException { String line ; StringBuffer buf = new StringBuffer ( ) ; while ( ( line = reader . readLine ( ) ) != null ) { if ( line . indexOf ( "--END" ) != - 1 ) { return Base64 . decode ( buf . toString ( ) . getBytes ( ) ) ; } else { buf .... | Reads Base64 encoded data from the stream and returns its decoded value . The reading continues until the END string is found in the data . Otherwise returns null . |
121,742 | public void saveCertificateChain ( OutputStream out ) throws IOException , CertificateEncodingException { CertificateIOUtil . writeCertificate ( out , this . certChain [ 0 ] ) ; for ( int i = 1 ; i < this . certChain . length ; i ++ ) { if ( this . certChain [ i ] . getSubjectDN ( ) . equals ( certChain [ i ] . getIssu... | COMMENT Used to be key cert cert cert ... which is wrong afaik . must be cert key cert cert ... |
121,743 | public int getCertNum ( ) { for ( int i = this . certChain . length - 1 ; i >= 0 ; i -- ) { if ( ! this . certChain [ i ] . getSubjectDN ( ) . equals ( this . certChain [ i ] . getIssuerDN ( ) ) ) { return i + 1 ; } } return this . certChain . length ; } | Returns the number of certificates in the credential without the self - signed certificates . |
121,744 | public long getTimeLeft ( ) { Date earliestTime = null ; for ( int i = 0 ; i < this . certChain . length ; i ++ ) { Date time = this . certChain [ i ] . getNotAfter ( ) ; if ( earliestTime == null || time . before ( earliestTime ) ) { earliestTime = time ; } } long diff = ( earliestTime . getTime ( ) - System . current... | Returns time left of this credential . The time left of the credential is based on the certificate with the shortest validity time . |
121,745 | public X509Certificate getIdentityCertificate ( ) { try { return BouncyCastleUtil . getIdentityCertificate ( this . certChain ) ; } catch ( CertificateException e ) { logger . debug ( "Error getting certificate identity." , e ) ; return null ; } } | Returns the identity certificate of this credential . The identity certificate is the first certificate in the chain that is not an impersonation proxy certificate . |
121,746 | public int getPathConstraint ( ) { int pathLength = Integer . MAX_VALUE ; try { for ( int i = 0 ; i < this . certChain . length ; i ++ ) { int length = BouncyCastleUtil . getProxyPathConstraint ( this . certChain [ i ] ) ; if ( length == - 1 ) { length = Integer . MAX_VALUE ; } if ( length < pathLength ) { pathLength =... | Returns the path length constraint . The shortest length in the chain of certificates is returned as the credential s path length . |
121,747 | private ServerSocket createServerSocket ( int backlog , InetAddress binAddr ) throws IOException { ServerSocket server = null ; int port = 0 ; while ( true ) { port = this . portRange . getFreePort ( port ) ; try { server = new PrServerSocket ( port , backlog , binAddr ) ; this . portRange . setUsed ( port ) ; return s... | Tries to find first available port within the port range specified . If it finds a free port it first checks if the port is not used by any other server . If it is it keeps looking for a next available port . If none found it throws an exception . If the port is available the server instance is returned . |
121,748 | protected void checkGridFTPSupport ( ) throws IOException , ServerException { FeatureList fl = getFeatureList ( ) ; if ( ! ( fl . contains ( FeatureList . PARALLEL ) && fl . contains ( FeatureList . ESTO ) && fl . contains ( FeatureList . ERET ) && fl . contains ( FeatureList . SIZE ) ) ) { throw new ServerException ( ... | assure that the server supports extended transfer features ; throw exception if not |
121,749 | public void get ( String remoteFileName , File localFile ) throws IOException , ClientException , ServerException { if ( gSession . transferMode == GridFTPSession . MODE_EBLOCK ) { DataSink sink = new FileRandomIO ( new RandomAccessFile ( localFile , "rw" ) ) ; get ( remoteFileName , sink , null ) ; } else { super . ge... | basic compatibility API |
121,750 | public void setChecksum ( ChecksumAlgorithm algorithm , String value ) throws IOException , ServerException { String arguments = algorithm . toFtpCmdArgument ( ) + " " + value ; Command cmd = new Command ( "SCKS" , arguments ) ; try { controlChannel . execute ( cmd ) ; } catch ( UnexpectedReplyCodeException urce ) { th... | Sets the checksum values ahead of the transfer |
121,751 | public String checksum ( ChecksumAlgorithm algorithm , long offset , long length , String file ) throws IOException , ServerException { String arguments = algorithm . toFtpCmdArgument ( ) + " " + String . valueOf ( offset ) + " " + String . valueOf ( length ) + " " + file ; Command cmd = new Command ( "CKSM" , argument... | Computes and returns a checksum of a file . transferred . |
121,752 | public void changeGroup ( String group , String file ) throws IOException , ServerException { String arguments = group + " " + file ; Command cmd = new Command ( "SITE CHGRP" , arguments ) ; try { controlChannel . execute ( cmd ) ; } catch ( UnexpectedReplyCodeException urce ) { throw ServerException . embedUnexpectedR... | Change the Unix group membership of a file . |
121,753 | public void changeModificationTime ( int year , int month , int day , int hour , int min , int sec , String file ) throws IOException , ServerException { DecimalFormat df2 = new DecimalFormat ( "00" ) ; DecimalFormat df4 = new DecimalFormat ( "0000" ) ; String arguments = df4 . format ( year ) + df2 . format ( month ) ... | Change the modification time of a file . |
121,754 | public void createSymbolicLink ( String link_target , String link_name ) throws IOException , ServerException { String arguments = link_target . replaceAll ( " " , "%20" ) + " " + link_name ; Command cmd = new Command ( "SITE SYMLINK" , arguments ) ; try { controlChannel . execute ( cmd ) ; } catch ( UnexpectedReplyCod... | Create a symbolic link on the FTP server . |
121,755 | public void setOid ( String oid ) { if ( oid == null ) { throw new IllegalArgumentException ( i18n . getMessage ( "oidNull" ) ) ; } this . oid = oid ; } | Sets the oid of this extension . |
121,756 | public void addListener ( GramJobListener listener ) { if ( listeners == null ) listeners = new Vector ( ) ; listeners . addElement ( listener ) ; } | Add a listener to the GramJob . The listener will be notified whenever the status of the GramJob changes . |
121,757 | protected void setStatus ( int status ) { if ( this . status == status ) return ; this . status = status ; if ( listeners == null ) return ; int size = listeners . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { GramJobListener listener = ( GramJobListener ) listeners . elementAt ( i ) ; listener . statusChanged ( thi... | Sets the status of the job . User should not call this function . |
121,758 | public void request ( String contact , boolean batch ) throws GramException , GSSException { Gram . request ( contact , this , batch ) ; } | Submits a job to the specified gatekeeper either as an interactive or batch job . Performs limited delegation . |
121,759 | public int signal ( int signal , String arg ) throws GramException , GSSException { return Gram . jobSignal ( this , signal , arg ) ; } | Sends a signal command to the job . |
121,760 | public static String getStatusAsString ( int status ) { if ( status == STATUS_PENDING ) { return "PENDING" ; } else if ( status == STATUS_ACTIVE ) { return "ACTIVE" ; } else if ( status == STATUS_DONE ) { return "DONE" ; } else if ( status == STATUS_FAILED ) { return "FAILED" ; } else if ( status == STATUS_SUSPENDED ) ... | Convert the status of a GramJob from an integer to a string . This method is not typically called by users . |
121,761 | public void registerJob ( GramJob job ) { String id = job . getIDAsString ( ) ; _jobs . put ( id , job ) ; } | Registers gram job to listen for status updates |
121,762 | public void unregisterJob ( GramJob job ) { String id = job . getIDAsString ( ) ; _jobs . remove ( id ) ; } | Unregisters gram job from listening to status updates |
121,763 | public void authorize ( GSSContext context , String host ) throws AuthorizationException { logger . debug ( "Authorization: HOST/SELF" ) ; try { GSSName expected = this . hostAuthz . getExpectedName ( null , host ) ; GSSName target = null ; if ( context . isInitiator ( ) ) { target = context . getTargName ( ) ; } else ... | Performs host authorization . If that fails performs self authorization |
121,764 | public X509Extension add ( X509Extension extension ) { if ( extension == null ) { throw new IllegalArgumentException ( i18n . getMessage ( "extensionNull" ) ) ; } return ( X509Extension ) this . extensions . put ( extension . getOid ( ) , extension ) ; } | Adds a X509Extension object to this set . |
121,765 | public X509Extension get ( String oid ) { if ( oid == null ) { throw new IllegalArgumentException ( i18n . getMessage ( "oidNull" ) ) ; } return ( X509Extension ) this . extensions . get ( oid ) ; } | Retrieves X509Extension by given oid . |
121,766 | protected String getHostBasedServiceCN ( boolean last ) { if ( hostBasedServiceCN == null ) { String dn = name . getName ( ) ; int cnStart ; if ( last ) { cnStart = dn . lastIndexOf ( "CN=" ) + 3 ; } else { cnStart = dn . indexOf ( "CN=" ) + 3 ; } if ( cnStart == - 1 ) { return null ; } int cnEnd = dn . indexOf ( "," ,... | Returns the CN corresponding to the host part of the DN |
121,767 | public void concat ( Value value ) { if ( concatValue != null ) { concatValue . concat ( value ) ; } else { concatValue = value ; } } | Appends the specified value to the end of the chain of concatinated values . That is if this value has no concatinated value then set the specified value as the concatinated value . If this value already has a concatinated value then append the specified value to that concatinated value . |
121,768 | public String evaluate ( Map symbolTable ) throws RslEvaluationException { if ( concatValue == null ) { return value ; } else { StringBuffer buf = new StringBuffer ( value ) ; buf . append ( concatValue . evaluate ( symbolTable ) ) ; return buf . toString ( ) ; } } | Evaluates the value with the specified symbol table . In this case the function just returns the string representation of the actual value . No symbol table lookups are performed . |
121,769 | public void toRSL ( StringBuffer buf , boolean explicitConcat ) { if ( explicitConcat ) { buf . append ( quotify ( value ) ) ; } else { buf . append ( value ) ; } if ( concatValue == null ) { return ; } if ( explicitConcat ) { buf . append ( " # " ) ; } concatValue . toRSL ( buf , explicitConcat ) ; } | Produces a RSL representation of this value . |
121,770 | public static void ping ( GSSCredential cred , String resourceManagerContact ) throws GramException , GSSException { ResourceManagerContact rmc = new ResourceManagerContact ( resourceManagerContact ) ; Socket socket = gatekeeperConnect ( cred , rmc , false , false ) ; HttpResponse hd = null ; try { OutputStream out = s... | Performs ping operation on the gatekeeper with specified user credentials . Verifies if the user is authorized to submit a job to that gatekeeper . |
121,771 | public static void request ( String resourceManagerContact , GramJob job ) throws GramException , GSSException { request ( resourceManagerContact , job , false ) ; } | Submits a GramJob to specified gatekeeper as an interactive job . Performs limited delegation . |
121,772 | public static void request ( String resourceManagerContact , GramJob job , boolean batchJob ) throws GramException , GSSException { request ( resourceManagerContact , job , batchJob , true ) ; } | Submits a GramJob to specified gatekeeper as a interactive or batch job . Performs limited delegation . |
121,773 | public static void request ( String resourceManagerContact , GramJob job , boolean batchJob , boolean limitedDelegation ) throws GramException , GSSException { GSSCredential cred = getJobCredentials ( job ) ; String callbackURL = null ; CallbackHandler handler = null ; if ( ! batchJob ) { handler = initCallbackHandler ... | Submits a GramJob to specified gatekeeper as a interactive or batch job . |
121,774 | public static void renew ( GramJob job , GSSCredential newCred ) throws GramException , GSSException { renew ( job , newCred , true ) ; } | Requests that a globus job manager accept newly delegated credentials . Uses limited delegation . |
121,775 | public static void cancel ( GramJob job ) throws GramException , GSSException { GlobusURL jobURL = job . getID ( ) ; if ( jobURL == null ) { throw new GramException ( GramException . ERROR_JOB_CONTACT_NOT_SET ) ; } GSSCredential cred = getJobCredentials ( job ) ; String msg = GRAMProtocol . CANCEL_JOB ( jobURL . getURL... | This function cancels an already running job . |
121,776 | public static int jobSignal ( GramJob job , int signal , String arg ) throws GramException , GSSException { GlobusURL jobURL = job . getID ( ) ; GSSCredential cred = getJobCredentials ( job ) ; String msg = GRAMProtocol . SIGNAL ( jobURL . getURL ( ) , jobURL . getHost ( ) , signal , arg ) ; GatekeeperReply hd = null ;... | This function sends a signal to a job . |
121,777 | public static void unregisterListener ( GramJob job ) throws GramException , GSSException { CallbackHandler handler ; GSSCredential cred = getJobCredentials ( job ) ; handler = initCallbackHandler ( cred ) ; unregisterListener ( job , handler ) ; } | This function unregisters the job from callback listener . The job status will not be updated . |
121,778 | public static void deactivateAllCallbackHandlers ( ) { synchronized ( callbackHandlers ) { Enumeration e = callbackHandlers . elements ( ) ; while ( e . hasMoreElements ( ) ) { CallbackHandler handler = ( CallbackHandler ) e . nextElement ( ) ; handler . shutdown ( ) ; } callbackHandlers . clear ( ) ; } } | Deactivates all callback handlers . |
121,779 | public static CallbackHandler deactivateCallbackHandler ( GSSCredential cred ) { if ( cred == null ) { return null ; } CallbackHandler handler = ( CallbackHandler ) callbackHandlers . remove ( cred ) ; if ( handler == null ) { return null ; } handler . shutdown ( ) ; return handler ; } | Deactivates a callback handler for a given credential . |
121,780 | private static void debug ( String header , GatekeeperReply reply ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( header ) ; logger . trace ( reply . toString ( ) ) ; } } | Debug function for displaying the gatekeeper reply . |
121,781 | private static void debug ( String header , HttpResponse response ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( header ) ; logger . trace ( response . toString ( ) ) ; } } | Debug function for displaying HTTP responses . |
121,782 | private static void debug ( String header , String msg ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( header ) ; logger . trace ( msg ) ; } } | A general debug message that prints the header and msg when the debug level is smaler than 3 |
121,783 | public void decrypt ( byte [ ] password ) throws GeneralSecurityException { if ( ! isEncrypted ( ) ) { return ; } byte [ ] enc = Base64 . decode ( this . encodedKey ) ; SecretKeySpec key = getSecretKey ( password , this . initializationVector . getIV ( ) ) ; Cipher cipher = getCipher ( ) ; cipher . init ( Cipher . DECR... | Decrypts the private key with given password . Does nothing if the key is not encrypted . |
121,784 | public void encrypt ( byte [ ] password ) throws GeneralSecurityException { if ( isEncrypted ( ) ) { return ; } if ( this . encAlg == null ) { setEncryptionAlgorithm ( "DES-EDE3-CBC" ) ; } if ( this . ivData == null ) { generateIV ( ) ; } Key key = getSecretKey ( password , this . initializationVector . getIV ( ) ) ; C... | Encrypts the private key with given password . Does nothing if the key is encrypted already . |
121,785 | public void writeTo ( String file ) throws IOException { File privateKey = FileUtil . createFile ( file ) ; try { privateKey . setReadable ( false , true ) ; privateKey . setWritable ( false , true ) ; } catch ( SecurityException e ) { } PrintWriter p = new PrintWriter ( new FileOutputStream ( privateKey ) ) ; try { p ... | Writes the private key to the specified file in PEM format . If the key was encrypted it will be encoded as an encrypted RSA key . If not it will be encoded as a regular RSA key . |
121,786 | private static boolean objectsEquals ( Object a , Object b ) { return ( a == b ) || ( a != null && a . equals ( b ) ) ; } | Java 7 is adopted |
121,787 | public synchronized void add ( SocketBox sb ) { int status = ( ( ManagedSocketBox ) sb ) . getStatus ( ) ; if ( allSockets . containsKey ( sb ) ) { throw new IllegalArgumentException ( "This socket already exists in the socket pool." ) ; } allSockets . put ( sb , sb ) ; if ( status == ManagedSocketBox . FREE ) { if ( f... | add socketBox to the pool . Depending on its state it will be added to free or busy sockets . |
121,788 | public synchronized void remove ( SocketBox sb ) { int status = ( ( ManagedSocketBox ) sb ) . getStatus ( ) ; if ( ! allSockets . containsKey ( sb ) ) { throw new IllegalArgumentException ( "This socket does not seem to exist in the socket pool." ) ; } allSockets . remove ( sb ) ; if ( status == ManagedSocketBox . FREE... | remove socketBox from the pool remove all references to it |
121,789 | public synchronized void applyToAll ( SocketOperator op ) throws Exception { Enumeration keys = allSockets . keys ( ) ; while ( keys . hasMoreElements ( ) ) { SocketBox myBox = ( SocketBox ) keys . nextElement ( ) ; op . operate ( myBox ) ; } } | Apply the suplied callback to all socketBoxes . |
121,790 | public synchronized void flush ( ) throws IOException { Enumeration keys = allSockets . keys ( ) ; while ( keys . hasMoreElements ( ) ) { SocketBox myBox = ( SocketBox ) keys . nextElement ( ) ; if ( myBox != null ) { myBox . setSocket ( null ) ; } } allSockets . clear ( ) ; freeSockets . clear ( ) ; busySockets . clea... | Forcibly close all sockets and remove them from the pool . |
121,791 | public boolean isDryRun ( ) { String run = getSingle ( "dryrun" ) ; if ( run == null ) return false ; if ( run . equalsIgnoreCase ( "yes" ) ) return true ; return false ; } | Checks if dryryn is enabled . |
121,792 | public void setJobType ( int jobType ) { String type = null ; switch ( jobType ) { case JOBTYPE_SINGLE : type = "single" ; break ; case JOBTYPE_MULTIPLE : type = "multiple" ; break ; case JOBTYPE_MPI : type = "mpi" ; break ; case JOBTYPE_CONDOR : type = "condor" ; break ; } if ( type != null ) { set ( "jobtype" , type ... | Sets a job type . |
121,793 | public int getJobType ( ) { String jobType = getSingle ( "jobtype" ) ; if ( jobType == null ) return - 1 ; if ( jobType . equalsIgnoreCase ( "single" ) ) { return JOBTYPE_SINGLE ; } else if ( jobType . equalsIgnoreCase ( "multiple" ) ) { return JOBTYPE_MULTIPLE ; } else if ( jobType . equalsIgnoreCase ( "mpi" ) ) { ret... | Returns type of the job . |
121,794 | public boolean load ( File file ) throws IOException { InputStream in = null ; try { in = new FileInputStream ( file ) ; this . file = file ; this . lastModified = file . lastModified ( ) ; return load ( in ) ; } finally { if ( in != null ) { try { in . close ( ) ; } catch ( Exception e ) { } } } } | Loads grid map definition from a given file . |
121,795 | public boolean load ( InputStream input ) throws IOException { boolean success = true ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( input ) ) ; Map localMap = new HashMap ( ) ; GridMapEntry entry ; QuotedStringTokenizer tokenizer ; StringTokenizer idTokenizer ; String line ; while ( ( line = re... | Loads grid map file definition from a given input stream . The input stream is not closed in case of an error . |
121,796 | public String getUserID ( String globusID ) { String [ ] ids = getUserIDs ( globusID ) ; if ( ids != null && ids . length > 0 ) { return ids [ 0 ] ; } else { return null ; } } | Returns first local user name mapped to the specified globusID . |
121,797 | public String [ ] getUserIDs ( String globusID ) { if ( globusID == null ) { throw new IllegalArgumentException ( i18n . getMessage ( "globusIdNull" ) ) ; } if ( this . map == null ) { return null ; } GridMapEntry entry = ( GridMapEntry ) this . map . get ( normalizeDN ( globusID ) ) ; return ( entry == null ) ? null :... | Returns local user names mapped to the specified globusID . |
121,798 | public boolean checkUser ( String globusID , String userID ) { if ( globusID == null ) { throw new IllegalArgumentException ( i18n . getMessage ( "glousIdNull" ) ) ; } if ( userID == null ) { throw new IllegalArgumentException ( i18n . getMessage ( "userIdNull" ) ) ; } if ( this . map == null ) { return false ; } GridM... | Checks if a given globus ID is associated with given local user account . |
121,799 | public String getGlobusID ( String userID ) { if ( userID == null ) { throw new IllegalArgumentException ( i18n . getMessage ( "userIdNull" ) ) ; } if ( this . map == null ) { return null ; } Iterator iter = this . map . entrySet ( ) . iterator ( ) ; Map . Entry mapEntry ; GridMapEntry entry ; while ( iter . hasNext ( ... | Returns globus ID associated with the specified local user name . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.