idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
4,800
public synchronized PacketTransportEndpoint createEndpoint ( ) throws JMSException { if ( closed || transport . isClosed ( ) ) throw new FFMQException ( "Transport is closed" , "TRANSPORT_CLOSED" ) ; PacketTransportEndpoint endpoint = new PacketTransportEndpoint ( nextEndpointId ++ , this ) ; registeredEndpoints . put ...
Create a new transport endpoint
4,801
public static String replaceDoubleSingleQuotes ( String value ) { int idx = value . indexOf ( "''" ) ; if ( idx == - 1 ) return value ; int len = value . length ( ) ; int pos = 0 ; StringBuilder sb = new StringBuilder ( len ) ; while ( idx != - 1 ) { if ( idx > pos ) { sb . append ( value . substring ( pos , idx ) ) ; ...
Replace double single quotes in the target string
4,802
public static Number parseNumber ( String numberAsString ) throws InvalidSelectorException { if ( numberAsString == null ) return null ; try { if ( numberAsString . indexOf ( '.' ) != - 1 || numberAsString . indexOf ( 'e' ) != - 1 || numberAsString . indexOf ( 'E' ) != - 1 ) { return new Double ( numberAsString ) ; } e...
Parse a number as string
4,803
public static SagaType startsNewSaga ( final Class < ? extends Saga > sagaClass ) { checkNotNull ( sagaClass , "The type of the saga has to be defined." ) ; SagaType sagaType = new SagaType ( ) ; sagaType . startsNew = true ; sagaType . sagaClass = sagaClass ; return sagaType ; }
Creates a type indicating to start a complete new saga .
4,804
public static SagaType continueSaga ( final Class < ? extends Saga > sagaClass ) { checkNotNull ( sagaClass , "The type of the saga has to be defined." ) ; SagaType sagaType = new SagaType ( ) ; sagaType . startsNew = false ; sagaType . sagaClass = sagaClass ; return sagaType ; }
Creates a type continuing a saga with an instance key that has yet to be defined .
4,805
private AbstractMessage fetchNext ( ) throws JMSException { if ( nextMessage != null ) return nextMessage ; nextMessage = localQueue . browse ( cursor , parsedSelector ) ; if ( nextMessage == null ) close ( ) ; return nextMessage ; }
Fetch the next browsable message in the associated queue
4,806
public KEY readKey ( final MESSAGE message , final LookupContext context ) { return extractFunction . key ( message , context ) ; }
Read the saga instance key from the provided message .
4,807
public static AbstractMessage makeInternalCopy ( Message srcMessage ) throws JMSException { if ( srcMessage instanceof AbstractMessage ) { AbstractMessage msg = ( AbstractMessage ) srcMessage ; if ( msg . isInternalCopy ( ) ) return msg ; AbstractMessage dup = duplicate ( srcMessage ) ; dup . setInternalCopy ( true ) ;...
Create an internal copy of the message if necessary
4,808
public static AbstractMessage normalize ( Message srcMessage ) throws JMSException { if ( srcMessage instanceof AbstractMessage ) return ( AbstractMessage ) srcMessage ; return duplicate ( srcMessage ) ; }
Convert the message to native type if necessary
4,809
public static AbstractMessage duplicate ( Message srcMessage ) throws JMSException { AbstractMessage msgCopy ; if ( srcMessage instanceof AbstractMessage ) msgCopy = ( ( AbstractMessage ) srcMessage ) . copy ( ) ; else if ( srcMessage instanceof TextMessage ) msgCopy = duplicateTextMessage ( ( TextMessage ) srcMessage ...
Create an independant copy of the given message
4,810
private void fastadd ( int wo , int off ) { this . buffer . add ( off - this . sizeinwords ) ; this . buffer . add ( wo ) ; this . sizeinwords = off + 1 ; }
same as add but without updating the cardinality counter strictly for internal use .
4,811
public Iterator < Integer > iterator ( ) { final IntIterator under = this . getIntIterator ( ) ; return new Iterator < Integer > ( ) { public boolean hasNext ( ) { return under . hasNext ( ) ; } public Integer next ( ) { return new Integer ( under . next ( ) ) ; } public void remove ( ) { throw new UnsupportedOperation...
Allow you to iterate over the set bits .
4,812
public IntIterator getIntIterator ( ) { return new IntIterator ( ) { int wordindex ; int i = 0 ; IntArray buf ; int currentword ; public IntIterator init ( IntArray b ) { this . buf = b ; this . wordindex = this . buf . get ( this . i ) ; this . currentword = this . buf . get ( this . i + 1 ) ; return this ; } public b...
Build a fast iterator over the set bits .
4,813
public SparseBitmap and ( SparseBitmap o ) { SparseBitmap a = new SparseBitmap ( ) ; and2by2 ( a , this , o ) ; return a ; }
Compute the bit - wise logical and with another bitmap .
4,814
public static void and2by2 ( BitmapContainer container , SparseBitmap bitmap1 , SparseBitmap bitmap2 ) { int it1 = 0 ; int it2 = 0 ; int p1 = bitmap1 . buffer . get ( it1 ) , p2 = bitmap2 . buffer . get ( it2 ) ; int buff ; while ( true ) { if ( p1 < p2 ) { if ( it1 + 2 >= bitmap1 . buffer . size ( ) ) break ; it1 += 2...
Computes the bit - wise logical exclusive and of two bitmaps .
4,815
public SparseBitmap or ( SparseBitmap o ) { SparseBitmap a = new SparseBitmap ( ) ; or2by2 ( a , this , o ) ; return a ; }
Computes the bit - wise logical or with another bitmap .
4,816
public static void or2by2 ( BitmapContainer container , SparseBitmap bitmap1 , SparseBitmap bitmap2 ) { int it1 = 0 ; int it2 = 0 ; int p1 = bitmap1 . buffer . get ( it1 ) ; int p2 = bitmap2 . buffer . get ( it2 ) ; if ( ( it1 < bitmap1 . buffer . size ( ) ) && ( it2 < bitmap2 . buffer . size ( ) ) ) while ( true ) { i...
Computes the bit - wise logical or of two bitmaps .
4,817
public SparseBitmap xor ( SparseBitmap o ) { SparseBitmap a = new SparseBitmap ( ) ; xor2by2 ( a , this , o ) ; return a ; }
Computes the bit - wise logical exclusive or with another bitmap .
4,818
public static SparseBitmap and ( SparseBitmap ... bitmaps ) { if ( bitmaps . length == 0 ) return new SparseBitmap ( ) ; else if ( bitmaps . length == 1 ) return bitmaps [ 0 ] ; else if ( bitmaps . length == 2 ) return bitmaps [ 0 ] . and ( bitmaps [ 1 ] ) ; PriorityQueue < SparseBitmap > pq = new PriorityQueue < Spars...
Computes the bit - wise and aggregate over several bitmaps .
4,819
public SkippableIterator getSkippableIterator ( ) { return new SkippableIterator ( ) { int pos = 0 ; int p = 0 ; public SkippableIterator init ( ) { this . p = SparseBitmap . this . buffer . get ( 0 ) ; return this ; } public void advance ( ) { this . pos += 2 ; if ( this . pos < SparseBitmap . this . buffer . size ( )...
Gets the skippable iterator .
4,820
public static boolean match ( SkippableIterator o1 , SkippableIterator o2 ) { while ( o1 . getCurrentWordOffset ( ) != o2 . getCurrentWordOffset ( ) ) { if ( o1 . getCurrentWordOffset ( ) < o2 . getCurrentWordOffset ( ) ) { o1 . advanceUntil ( o2 . getCurrentWordOffset ( ) ) ; if ( ! o1 . hasValue ( ) ) return false ; ...
Synchronize two iterators
4,821
public int cardinality ( ) { int answer = 0 ; for ( int k = 0 ; k < this . buffer . size ( ) ; k += 2 ) { answer += Integer . bitCount ( this . buffer . get ( k + 1 ) ) ; } return answer ; }
Compute the cardinality .
4,822
Collection < Exception > finish ( ) { return Lists . reverse ( finishers ) . stream ( ) . flatMap ( f -> f . get ( ) . map ( Stream :: of ) . orElse ( Stream . empty ( ) ) ) . collect ( Collectors . toList ( ) ) ; }
Call finishers on all started modules .
4,823
public Collection < Exception > error ( final Object message , final Throwable error ) { return Lists . reverse ( errorHandlers ) . stream ( ) . flatMap ( f -> f . apply ( message , error ) . map ( Stream :: of ) . orElse ( Stream . empty ( ) ) ) . collect ( Collectors . toList ( ) ) ; }
Execute error method on started modules .
4,824
private static Optional < Exception > tryExecute ( final Runnable runnable , final SagaModule module ) { Exception executionException ; try { runnable . run ( ) ; executionException = null ; } catch ( Exception ex ) { executionException = ex ; LOG . error ( "Error executing function on module {}" , module , ex ) ; } re...
Executes the provided runnable without throwing possible exceptions .
4,825
protected void fillSettings ( Settings settings ) { settings . setStringProperty ( "name" , name ) ; settings . setIntProperty ( "persistentStore.initialBlockCount" , initialBlockCount ) ; settings . setIntProperty ( "persistentStore.maxBlockCount" , maxBlockCount ) ; settings . setIntProperty ( "persistentStore.autoEx...
Append nodes to the XML definition
4,826
public void registerConsumer ( LocalMessageConsumer consumer ) { consumersLock . writeLock ( ) . lock ( ) ; try { localConsumers . add ( consumer ) ; } finally { consumersLock . writeLock ( ) . unlock ( ) ; } }
Register a message consumer on this queue
4,827
public void unregisterConsumer ( LocalMessageConsumer consumer ) { consumersLock . writeLock ( ) . lock ( ) ; try { localConsumers . remove ( consumer ) ; } finally { consumersLock . writeLock ( ) . unlock ( ) ; } }
Unregister a message listener
4,828
public static File [ ] getDescriptorFiles ( File definitionDir , final String prefix , final String suffix ) { return definitionDir . listFiles ( new FileFilter ( ) { public boolean accept ( File pathname ) { if ( ! pathname . isFile ( ) || ! pathname . canRead ( ) ) return false ; String name = pathname . getName ( ) ...
Find all descriptor files with the given prefix in a target folder
4,829
public static String getShortClassName ( Class < ? > clazz ) { String className = clazz . getName ( ) ; int idx = className . lastIndexOf ( '.' ) ; return ( idx == - 1 ? className : className . substring ( idx + 1 ) ) ; }
Get the short name of the given class
4,830
public static String getCallerMethodName ( int offset ) { StackTraceElement [ ] stack = new Exception ( ) . getStackTrace ( ) ; return stack [ offset + 1 ] . getMethodName ( ) ; }
Get the name of the caller method
4,831
public void close ( ) { if ( ! manageSockets ) throw new IllegalStateException ( "Cannot close an un-managed socket factory" ) ; synchronized ( createdSockets ) { Iterator < ServerSocket > sockets = createdSockets . iterator ( ) ; while ( sockets . hasNext ( ) ) { ServerSocket socket = sockets . next ( ) ; try { socket...
Cleanup sockets created by this factory
4,832
private KeyReader tryGetKeyReader ( final Class < ? extends Saga > sagaClazz , final Object message ) { KeyReader reader ; try { Optional < KeyReader > cachedReader = knownReaders . get ( SagaMessageKey . forMessage ( sagaClazz , message ) , ( ) -> { KeyReader foundReader = findReader ( sagaClazz , message ) ; return O...
Does not throw an exception when accessing the loading cache for key readers .
4,833
private KeyReader findReaderMatchingExactType ( final Iterable < KeyReader > readers , final Class < ? > messageType ) { KeyReader messageKeyReader = null ; for ( KeyReader reader : readers ) { if ( reader . getMessageClass ( ) . equals ( messageType ) ) { messageKeyReader = reader ; break ; } } return messageKeyReader...
Search for reader based on message class .
4,834
private Collection < KeyReader > findReader ( final Class < ? extends Saga > sagaClazz , final Class < ? > messageClazz ) { Saga saga = sagaProviderFactory . createProvider ( sagaClazz ) . get ( ) ; Collection < KeyReader > readers = saga . keyReaders ( ) ; if ( readers == null ) { readers = new ArrayList < > ( ) ; } r...
Search for a reader based on saga type .
4,835
public static void checkQueueName ( String queueName ) throws JMSException { if ( queueName == null ) throw new FFMQException ( "Queue name is not set" , "INVALID_DESTINATION_NAME" ) ; if ( queueName . length ( ) > FFMQConstants . MAX_QUEUE_NAME_SIZE ) throw new FFMQException ( "Queue name '" + queueName + "' is too lo...
Check the validity of a queue name
4,836
public static void checkTopicName ( String topicName ) throws JMSException { if ( topicName == null ) throw new FFMQException ( "Topic name is not set" , "INVALID_DESTINATION_NAME" ) ; if ( topicName . length ( ) > FFMQConstants . MAX_TOPIC_NAME_SIZE ) throw new FFMQException ( "Topic name '" + topicName + "' is too lo...
Check the validity of a topic name
4,837
protected void writeTo ( JournalFile journalFile ) throws JournalException { journalFile . writeByte ( type ) ; journalFile . writeLong ( transactionId ) ; }
Write the operation to the given journal file
4,838
public AbstractDescriptor read ( File descriptorFile , Class < ? extends AbstractXMLDescriptorHandler > handlerClass ) throws JMSException { if ( ! descriptorFile . canRead ( ) ) throw new FFMQException ( "Can't read descriptor file : " + descriptorFile . getAbsolutePath ( ) , "FS_ERROR" ) ; log . debug ( "Parsing desc...
Read and parse an XML descriptor file
4,839
private InvocationMethod tryGetMethod ( final InvokerKey key ) { InvocationMethod invocationMethod = null ; try { invocationMethod = invocationMethods . get ( key ) ; } catch ( Exception ex ) { LOG . warn ( "Error fetching method to invoke method {}" , key , ex ) ; } return invocationMethod ; }
Finds the method to invoke without causing an exception .
4,840
protected void remoteInit ( ) throws JMSException { CreateConsumerQuery query = new CreateConsumerQuery ( ) ; query . setConsumerId ( id ) ; query . setSessionId ( session . getId ( ) ) ; query . setDestination ( destination ) ; query . setMessageSelector ( messageSelector ) ; query . setNoLocal ( noLocal ) ; transport...
Initialize the remote endpoint for this consumer
4,841
private void prefetchFromDestination ( ) throws JMSException { if ( closed ) return ; if ( traceEnabled ) log . trace ( "#" + id + " Prefetching more from destination " + destination ) ; PrefetchQuery query = new PrefetchQuery ( ) ; query . setSessionId ( session . getId ( ) ) ; query . setConsumerId ( id ) ; transport...
Prefetch messages from destination
4,842
public static String replaceSystemProperties ( String value ) { if ( value == null || value . length ( ) == 0 ) return value ; StringBuilder sb = new StringBuilder ( ) ; int pos = 0 ; int start ; while ( ( start = value . indexOf ( "${" , pos ) ) != - 1 ) { if ( start > pos ) sb . append ( value . substring ( pos , sta...
Replace system properties in the given string value
4,843
public JournalBuilder setArchived ( File to ) { if ( ! to . exists ( ) ) { throw new IllegalArgumentException ( "<" + to + "> does not exist" ) ; } if ( ! to . isDirectory ( ) ) { throw new IllegalArgumentException ( "<" + to + "> is not a directory" ) ; } this . directoryArchive = to ; return this ; }
Set the directory used to archive cleaned up log files also enabling archiving .
4,844
public PacketTransport createPacketTransport ( String id , URI transportURI , Settings settings ) throws PacketTransportException { String protocol = transportURI . getScheme ( ) ; if ( protocol == null ) protocol = PacketTransportType . TCP ; if ( protocol . equals ( PacketTransportType . TCP ) || protocol . equals ( ...
Create a packet transport instance to handle the given URI
4,845
public synchronized T borrow ( ) throws JMSException { if ( closed ) throw new ObjectPoolException ( "Object pool is closed" ) ; int availableCount = available . size ( ) ; if ( availableCount > 0 ) return available . remove ( availableCount - 1 ) ; if ( all . size ( ) < maxSize ) return extendPool ( ) ; switch ( exhau...
Borrow an object from the pool
4,846
public synchronized void release ( T poolObject ) { if ( closed ) return ; if ( pendingWaits > 0 ) { available . add ( poolObject ) ; notifyAll ( ) ; } else { if ( available . size ( ) >= maxIdle ) { all . remove ( poolObject ) ; internalDestroyPoolObject ( poolObject ) ; } else available . add ( poolObject ) ; } }
Return an object to the pool
4,847
public void close ( ) { synchronized ( closeLock ) { if ( closed ) return ; closed = true ; } synchronized ( this ) { Iterator < T > allObjects = all . iterator ( ) ; while ( allObjects . hasNext ( ) ) { T poolObject = allObjects . next ( ) ; internalDestroyPoolObject ( poolObject ) ; } all . clear ( ) ; available . cl...
Close the pool destroying all objects
4,848
public final void wakeUpMessageListener ( ) { try { while ( ! closed ) { synchronized ( session . deliveryLock ) { AbstractMessage message = receiveFromDestination ( 0 , true ) ; if ( message == null ) break ; message . ensureDeserializationLevel ( MessageSerializationLevel . FULL ) ; message . setSession ( session ) ;...
Wake up the consumer message listener
4,849
public static < MESSAGE , KEY > KeyReader < MESSAGE , KEY > forMessage ( final Class < MESSAGE > messageClass , final KeyExtractFunction < MESSAGE , KEY > extractFunction ) { return FunctionKeyReader . create ( messageClass , extractFunction ) ; }
Create a new key reader for a specific message class .
4,850
public final void dispatch ( AbstractMessage message ) throws JMSException { LocalConnection conn = ( LocalConnection ) getConnection ( ) ; if ( conn . isSecurityEnabled ( ) ) { Destination destination = message . getJMSDestination ( ) ; if ( destination instanceof Queue ) { String queueName = ( ( Queue ) destination )...
Called from producers when sending a message
4,851
public final void rollbackUndelivered ( List < String > undeliveredMessageIDs ) throws JMSException { externalAccessLock . readLock ( ) . lock ( ) ; try { checkNotClosed ( ) ; rollbackUpdates ( false , true , undeliveredMessageIDs ) ; } finally { externalAccessLock . readLock ( ) . unlock ( ) ; } }
Rollback undelivered get operations in this session
4,852
public MessageConsumer createConsumer ( IntegerID consumerId , Destination destination , String messageSelector , boolean noLocal ) throws JMSException { externalAccessLock . readLock ( ) . lock ( ) ; try { checkNotClosed ( ) ; LocalMessageConsumer consumer = new LocalMessageConsumer ( engine , this , destination , mes...
Create a consumer with the given id
4,853
protected final void deleteQueue ( String queueName ) throws JMSException { transactionSet . removeUpdatesForQueue ( queueName ) ; engine . deleteQueue ( queueName ) ; }
Delete a queue
4,854
public synchronized void register ( String clientID ) throws InvalidClientIDException { if ( ! clientIDs . add ( clientID ) ) { log . error ( "Client ID already exists : " + clientID ) ; throw new InvalidClientIDException ( "Client ID already exists : " + clientID ) ; } log . debug ( "Registered clientID : " + clientID...
Register a new client ID
4,855
protected void sync ( ) throws JournalException { try { flushBuffer ( ) ; switch ( storageSyncMethod ) { case StorageSyncMethod . FD_SYNC : output . getFD ( ) . sync ( ) ; break ; case StorageSyncMethod . CHANNEL_FORCE_NO_META : channel . force ( false ) ; break ; default : throw new JournalException ( "Unsupported syn...
Force file content sync to disk
4,856
public void closeAndDelete ( ) throws JournalException { close ( ) ; if ( ! file . delete ( ) ) if ( file . exists ( ) ) throw new JournalException ( "Cannot delete journal file : " + file . getAbsolutePath ( ) ) ; }
Close and delete the journal file
4,857
public File closeAndRecycle ( ) throws JournalException { File recycledFile = new File ( file . getAbsolutePath ( ) + RECYCLED_SUFFIX ) ; if ( ! file . renameTo ( recycledFile ) ) throw new JournalException ( "Cannot rename journal file " + file . getAbsolutePath ( ) + " to " + recycledFile . getAbsolutePath ( ) ) ; tr...
Close and recycle the journal file
4,858
public static synchronized NIOTcpMultiplexer getMultiplexer ( ) throws PacketTransportException { if ( multiplexer == null ) multiplexer = new NIOTcpMultiplexer ( getSettings ( ) , true ) ; return multiplexer ; }
Get the multiplexer singleton instance
4,859
public static synchronized AsyncTaskManager getAsyncTaskManager ( ) throws JMSException { if ( asyncTaskManager == null ) { int threadPoolMinSize = getSettings ( ) . getIntProperty ( FFMQCoreSettings . ASYNC_TASK_MANAGER_DELIVERY_THREAD_POOL_MINSIZE , 0 ) ; int threadPoolMaxIdle = getSettings ( ) . getIntProperty ( FFM...
Get the async . task manager singleton instance
4,860
public void unsubscribe ( String clientID , String subscriptionName ) throws JMSException { String subscriberID = clientID + "-" + subscriptionName ; subscriptionsLock . writeLock ( ) . lock ( ) ; try { LocalTopicSubscription subscription = subscriptionMap . get ( subscriberID ) ; if ( subscription == null ) return ; i...
Unsubscribe all durable consumers for a given client ID and subscription name
4,861
public static JSONObject getJSONObject ( HttpPost request , Integer method , HashMap < String , String > params ) throws JSONException { switch ( method ) { case METHOD_PUT : case METHOD_DELETE : case METHOD_POST : return doPostRequest ( request , params ) ; default : throw new RuntimeException ( "Wrong http method req...
Get JSON response for POST
4,862
private static JSONObject doPostRequest ( HttpPost httpPost , HashMap < String , String > params ) throws JSONException { JSONObject json = null ; HttpClient postClient = HttpClientBuilder . create ( ) . build ( ) ; HttpResponse response ; try { response = postClient . execute ( httpPost ) ; if ( response . getStatusLi...
Execute POST request
4,863
private static JSONObject doGetRequest ( HttpGet httpGet ) throws JSONException { JSONObject json = null ; HttpClient httpClient = HttpClientBuilder . create ( ) . build ( ) ; HttpResponse response ; try { response = httpClient . execute ( httpGet ) ; if ( response . getStatusLine ( ) . getStatusCode ( ) == 200 ) { Htt...
Execute GET request
4,864
public JSONObject actions ( String reference , HashMap < String , String > params ) throws JSONException { return oClient . post ( "/offers/v1/contractors/offers/" + reference , params ) ; }
Run a specific action
4,865
public JSONObject getOwned ( String freelancerReference , HashMap < String , String > params ) throws JSONException { return oClient . get ( "/finreports/v2/financial_account_owner/" + freelancerReference , params ) ; }
Generate Financial Reports for an owned Account
4,866
public JSONObject invite ( String jobKey , HashMap < String , String > params ) throws JSONException { return oClient . post ( "/hr/v1/jobs/" + jobKey + "/candidates" , params ) ; }
Invite to Interview
4,867
public JSONObject create ( HashMap < String , String > params ) throws JSONException { return oClient . post ( "/hr/v3/fp/milestones" , params ) ; }
Create a new Milestone
4,868
public JSONObject submitBonus ( String teamReference , HashMap < String , String > params ) throws JSONException { return oClient . post ( "/hr/v2/teams/" + teamReference + "/adjustments" , params ) ; }
Submit a Custom Payment
4,869
public void onNewIntent ( Intent intent ) { super . onNewIntent ( intent ) ; Uri uri = intent . getData ( ) ; if ( uri != null && uri . getScheme ( ) . equals ( OAUTH_CALLBACK_SCHEME ) ) { String verifier = uri . getQueryParameter ( OAuth . OAUTH_VERIFIER ) ; new UpworkRetrieveAccessTokenTask ( ) . execute ( verifier )...
Callback once we are done with the authorization of this app
4,870
public JSONObject getByContract ( String contractId , String ts ) throws JSONException { return oClient . get ( "/team/v3/snapshots/contracts/" + contractId + "/" + ts ) ; }
Get snapshot info by specific contract
4,871
public JSONObject updateByContract ( String contractId , String ts , HashMap < String , String > params ) throws JSONException { return oClient . put ( "/team/v3/snapshots/contracts/" + contractId + "/" + ts , params ) ; }
Update snapshot by specific contract
4,872
public JSONObject deleteByContract ( String contractId , String ts ) throws JSONException { return oClient . delete ( "/team/v3/snapshots/contracts/" + contractId + "/" + ts ) ; }
Delete snapshot by specific contract
4,873
@ SuppressWarnings ( "unchecked" ) public < T > T lookup ( final String id ) { for ( final IdentifiableController controller : identifiables ) { if ( controller . getId ( ) . equals ( id ) ) { return ( T ) controller ; } } throw new IllegalArgumentException ( "Could not find a controller with the ID '" + id + "'" ) ; }
Returns a controller instance with the given ID .
4,874
public JSONObject getByContract ( String contract , String date , HashMap < String , String > params ) throws JSONException { return oClient . get ( "/team/v3/workdiaries/contracts/" + contract + "/" + date , params ) ; }
Get Work Diary by Contract
4,875
private JSONObject _getByType ( String company , String team , String code ) throws JSONException { String url = "" ; if ( code != null ) { url = "/" + code ; } return oClient . get ( "/otask/v1/tasks/companies/" + company + "/teams/" + team + "/tasks" + url ) ; }
Get by type
4,876
public JSONObject requestApproval ( HashMap < String , String > params ) throws JSONException { return oClient . post ( "/hr/v3/fp/submissions" , params ) ; }
Freelancer submits work for the client to approve
4,877
public JSONObject approve ( String submissionId , HashMap < String , String > params ) throws JSONException { return oClient . put ( "/hr/v3/fp/submissions/" + submissionId + "/approve" , params ) ; }
Approve an existing Submission
4,878
public HashMap < String , String > getAccessTokenSet ( String verifier ) { try { mOAuthProvider . retrieveAccessToken ( mOAuthConsumer , verifier ) ; } catch ( OAuthException e ) { e . printStackTrace ( ) ; } return setTokenWithSecret ( mOAuthConsumer . getToken ( ) , mOAuthConsumer . getTokenSecret ( ) ) ; }
Get access token - secret pair
4,879
public final HashMap < String , String > setTokenWithSecret ( String aToken , String aSecret ) { HashMap < String , String > token = new HashMap < String , String > ( ) ; accessToken = aToken ; accessSecret = aSecret ; mOAuthConsumer . setTokenWithSecret ( accessToken , accessSecret ) ; token . put ( "token" , accessTo...
Setup access token and secret for OAuth client
4,880
public JSONObject get ( String url , HashMap < String , String > params ) throws JSONException { return sendGetRequest ( url , METHOD_GET , params ) ; }
Send signed OAuth GET request
4,881
public JSONObject post ( String url , HashMap < String , String > params ) throws JSONException { return sendPostRequest ( url , METHOD_POST , params ) ; }
Send signed OAuth POST request
4,882
public JSONObject put ( String url ) throws JSONException { return sendPostRequest ( url , METHOD_PUT , new HashMap < String , String > ( ) ) ; }
Send signed OAuth PUT request
4,883
public JSONObject delete ( String url , HashMap < String , String > params ) throws JSONException { return sendPostRequest ( url , METHOD_DELETE , params ) ; }
Send signed OAuth DELETE request
4,884
private String _getAuthorizationUrl ( String oauthCallback ) { String url = null ; try { url = mOAuthProvider . retrieveRequestToken ( mOAuthConsumer , oauthCallback ) ; } catch ( OAuthException e ) { e . printStackTrace ( ) ; } return url ; }
Get authorization URL use provided callback URL
4,885
private JSONObject sendGetRequest ( String url , Integer type , HashMap < String , String > params ) throws JSONException { String fullUrl = getFullUrl ( url ) ; HttpGet request = new HttpGet ( fullUrl ) ; if ( params != null ) { URI uri ; String query = "" ; try { URIBuilder uriBuilder = new URIBuilder ( request . get...
Send signed GET OAuth request
4,886
private JSONObject sendPostRequest ( String url , Integer type , HashMap < String , String > params ) throws JSONException { String fullUrl = getFullUrl ( url ) ; HttpPost request = new HttpPost ( fullUrl ) ; switch ( type ) { case METHOD_PUT : case METHOD_DELETE : String oValue ; if ( type == METHOD_PUT ) { oValue = "...
Send signed POST OAuth request
4,887
public JSONObject getByFreelancersTeam ( String freelancerTeamReference , HashMap < String , String > params ) throws JSONException { return oClient . get ( "/finreports/v2/provider_teams/" + freelancerTeamReference + "/billings" , params ) ; }
Generate Billing Reports for a Specific Freelancer s Team
4,888
public JSONObject getByFreelancersCompany ( String freelancerCompanyReference , HashMap < String , String > params ) throws JSONException { return oClient . get ( "/finreports/v2/provider_companies/" + freelancerCompanyReference + "/billings" , params ) ; }
Generate Billing Reports for a Specific Freelancer s Company
4,889
public JSONObject getByBuyersTeam ( String buyerTeamReference , HashMap < String , String > params ) throws JSONException { return oClient . get ( "/finreports/v2/buyer_teams/" + buyerTeamReference + "/billings" , params ) ; }
Generate Billing Reports for a Specific Buyer s Team
4,890
public JSONObject getByBuyersCompany ( String buyerCompanyReference , HashMap < String , String > params ) throws JSONException { return oClient . get ( "/finreports/v2/buyer_companies/" + buyerCompanyReference + "/billings" , params ) ; }
Generate Billing Reports for a Specific Buyer s Company
4,891
public JSONObject getByCompany ( String company , String fromDate , String tillDate , HashMap < String , String > params ) throws JSONException { return oClient . get ( "/team/v3/workdays/companies/" + company + "/" + fromDate + "," + tillDate , params ) ; }
Get Workdays by Company
4,892
public JSONObject getByContract ( String contract , String fromDate , String tillDate , HashMap < String , String > params ) throws JSONException { return oClient . get ( "/team/v3/workdays/contracts/" + contract + "/" + fromDate + "," + tillDate , params ) ; }
Get Workdays by Contract
4,893
public JSONObject postJob ( HashMap < String , String > params ) throws JSONException { return oClient . post ( "/hr/v2/jobs" , params ) ; }
Post a new job
4,894
public JSONObject editJob ( String key , HashMap < String , String > params ) throws JSONException { return oClient . put ( "/hr/v2/jobs/" + key , params ) ; }
Edit existent job
4,895
public JSONObject deleteJob ( String key , HashMap < String , String > params ) throws JSONException { return oClient . delete ( "/hr/v2/jobs/" + key , params ) ; }
Delete existent job
4,896
public JSONObject getList ( HashMap < String , String > params ) throws JSONException { return oClient . get ( "/offers/v1/clients/offers" , params ) ; }
Get list of offers
4,897
public JSONObject getSpecific ( String reference , HashMap < String , String > params ) throws JSONException { return oClient . get ( "/offers/v1/clients/offers/" + reference , params ) ; }
Get specific offer
4,898
public JSONObject getByAgency ( String company , String agency , HashMap < String , String > params ) throws JSONException { return _getByType ( company , null , agency , params , false ) ; }
Generating Agency Specific Reports
4,899
public JSONObject getByCompany ( String company , HashMap < String , String > params ) throws JSONException { return _getByType ( company , null , null , params , false ) ; }
Generating Company Wide Reports