idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
37,500
protected boolean isAckReceived ( long cSeq ) { if ( acksReceived == null ) { // http://code.google.com/p/sipservlets/issues/detail?id=152 // if there is no map, it means that the session was already destroyed and it is a retransmission return true ; } Boolean ackReceived = acksReceived . get ( cSeq ) ; if ( logger . i...
check if the ack has been received for the cseq in param it may happen that the ackReceived has been removed already if that s the case it will return true
171
36
37,501
protected void cleanupAcksReceived ( long remoteCSeq ) { List < Long > toBeRemoved = new ArrayList < Long > ( ) ; final Iterator < Entry < Long , Boolean > > cSeqs = acksReceived . entrySet ( ) . iterator ( ) ; while ( cSeqs . hasNext ( ) ) { final Entry < Long , Boolean > entry = cSeqs . next ( ) ; final long cSeq = e...
We clean up the stored acks received when the remoteCSeq in param is greater and that the ackReceived is true
207
27
37,502
public boolean validateCSeq ( MobicentsSipServletRequest sipServletRequest ) { final Request request = ( Request ) sipServletRequest . getMessage ( ) ; final long localCseq = cseq ; final long remoteCSeq = ( ( CSeqHeader ) request . getHeader ( CSeqHeader . NAME ) ) . getSeqNumber ( ) ; final String method = request . ...
CSeq validation should only be done for non proxy applications
632
12
37,503
protected void doMessage ( SipServletRequest request ) throws ServletException , IOException { request . createResponse ( SipServletResponse . SC_OK ) . send ( ) ; Object message = request . getContent ( ) ; String from = request . getFrom ( ) . getURI ( ) . toString ( ) ; logger . info ( "from is " + from ) ; //A user...
This is called by the container when a MESSAGE message arrives .
361
15
37,504
protected void doErrorResponse ( SipServletResponse response ) throws ServletException , IOException { //The receiver of the message probably dropped off. Remove //him from the list. String receiver = response . getTo ( ) . toString ( ) ; removeUser ( receiver ) ; }
This is called by the container when an error is received regarding a sent message including timeouts .
60
19
37,505
private static MimeMultipart getContentAsMimeMultipart ( ContentTypeHeader contentTypeHeader , byte [ ] rawContent ) { // Issue 1123 : http://code.google.com/p/mobicents/issues/detail?id=1123 : Multipart type is supported String delimiter = contentTypeHeader . getParameter ( MULTIPART_BOUNDARY ) ; String start = conten...
Return a mimemultipart from raw Content FIXME Doesn t support nested multipart in the body content
827
22
37,506
public final MobicentsSipSession getSipSession ( ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getSipSession" ) ; } if ( sipSession == null && sessionKey == null ) { sessionKey = getSipSessionKey ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "sessionKey is " + sessionKey ) ; } if ( sessionKey...
Retrieve the sip session implementation
627
6
37,507
protected ModifiableRule retrieveModifiableOverriden ( ) { ModifiableRule overridenRule = null ; //use local var to prevent potential concurent cleanup SipSession session = getSession ( ) ; if ( session != null && session . getServletContext ( ) != null ) { String overridenRuleStr = session . getServletContext ( ) . ge...
Allows to override the System header modifiable rule assignment .
134
11
37,508
protected static String getFullHeaderName ( String headerName ) { String fullName = null ; if ( JainSipUtils . HEADER_COMPACT_2_FULL_NAMES_MAPPINGS . containsKey ( headerName ) ) { fullName = JainSipUtils . HEADER_COMPACT_2_FULL_NAMES_MAPPINGS . get ( headerName ) ; } else { fullName = headerName ; } if ( logger . isDe...
This method tries to resolve header name - meaning if it is compact - it returns full name if its not it returns passed value .
144
26
37,509
public static String getCompactName ( String headerName ) { String compactName = null ; if ( JainSipUtils . HEADER_COMPACT_2_FULL_NAMES_MAPPINGS . containsKey ( headerName ) ) { compactName = JainSipUtils . HEADER_COMPACT_2_FULL_NAMES_MAPPINGS . get ( headerName ) ; } else { // This can be null if there is no mapping!!...
This method tries to determine compact header name - if passed value is compact form it is returned otherwise method tries to find compact name - if it is found string rpresenting compact name is returned otherwise null!!!
184
41
37,510
protected boolean containsRel100 ( Message message ) { ListIterator < SIPHeader > requireHeaders = message . getHeaders ( RequireHeader . NAME ) ; if ( requireHeaders != null ) { while ( requireHeaders . hasNext ( ) ) { if ( REL100_OPTION_TAG . equals ( requireHeaders . next ( ) . getValue ( ) ) ) { return true ; } } }...
we check all the values of Require and Supported headers to make sure the 100rel is present
169
19
37,511
protected void processConcurrencyAnnotation ( Class clazz ) { if ( sipContext . getConcurrencyControlMode ( ) == null ) { Package pack = clazz . getPackage ( ) ; if ( pack != null ) { ConcurrencyControl concurrencyControl = pack . getAnnotation ( ConcurrencyControl . class ) ; if ( concurrencyControl != null ) { if ( l...
Check if the
131
3
37,512
public void sendHeartBeat ( String ipAddress , int port ) throws Exception { MBeanServer mbeanServer = getMBeanServer ( ) ; Set < ObjectName > queryNames = mbeanServer . queryNames ( new ObjectName ( "*:type=Service,*" ) , null ) ; for ( ObjectName objectName : queryNames ) { mbeanServer . invoke ( objectName , "sendHe...
Send a heartbeat to the specified Ip address and port via this listening point . This method can be used to send out a period Double CR - LF for NAT keepalive as defined in RFC5626
158
41
37,513
protected void doRequest ( javax . servlet . sip . SipServletRequest req ) throws javax . servlet . ServletException , java . io . IOException { String m = req . getMethod ( ) ; if ( "INVITE" . equals ( m ) ) doInvite ( req ) ; else if ( "ACK" . equals ( m ) ) doAck ( req ) ; else if ( "OPTIONS" . equals ( m ) ) doOpti...
Invoked to handle incoming requests . This method dispatched requests to one of the doXxx methods where Xxx is the SIP method used in the request . Servlets will not usually need to override this method .
347
43
37,514
protected void doResponse ( javax . servlet . sip . SipServletResponse resp ) throws javax . servlet . ServletException , java . io . IOException { int status = resp . getStatus ( ) ; if ( status < 200 ) { doProvisionalResponse ( resp ) ; } else { if ( status < 300 ) { doSuccessResponse ( resp ) ; } else if ( status < ...
Invoked to handle incoming responses . This method dispatched responses to one of the . Servlets will not usually need to override this method .
113
27
37,515
public static String decode ( String uri ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "uri to decode " + uri ) ; } if ( uri == null ) { // fix by Hauke D. Issue 410 // throw new NullPointerException("uri cannot be null !"); return null ; } //optimization for uri with no escaped chars //fixes https://github...
Decode a path .
613
5
37,516
private void dispatchOutsideContainer ( SipServletRequestImpl sipServletRequest ) throws DispatcherException { final Request request = ( Request ) sipServletRequest . getMessage ( ) ; if ( logger . isInfoEnabled ( ) ) { logger . info ( "Dispatching the request event outside the container" ) ; } //check if the request p...
Dispatch a request outside the container
569
6
37,517
private final MobicentsSipApplicationSession retrieveTargetedApplication ( String targetedApplicationKey ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "retrieveTargetedApplication - targetedApplicationKey=" + targetedApplicationKey ) ; } if ( targetedApplicationKey != null && targetedApplicationKey . length...
Section 15 . 11 . 3 Encode URI Mechanism The container MUST use the encoded URI to locate the targeted SipApplicationSession object . If a valid SipApplicationSession is found the container must determine the name of the application that owns the SipApplicationSession object .
292
55
37,518
private MobicentsSipSession retrieveSipSession ( Dialog dialog ) { if ( dialog != null ) { Iterator < SipContext > iterator = sipApplicationDispatcher . findSipApplications ( ) ; while ( iterator . hasNext ( ) ) { SipContext sipContext = iterator . next ( ) ; SipManager sipManager = sipContext . getSipManager ( ) ; Ite...
Try to find a matching Sip Session to a given dialog
480
12
37,519
public String getBasePath ( ) { String docBase = null ; Container container = this ; while ( container != null ) { if ( container instanceof Host ) break ; container = container . getParent ( ) ; } File file = new File ( getDocBase ( ) ) ; if ( ! file . isAbsolute ( ) ) { if ( container == null ) { docBase = ( new File...
Get base path . Copy pasted from StandardContext Tomcat class
209
13
37,520
private String getNamingContextName ( ) { if ( namingContextName == null ) { Container parent = getParent ( ) ; if ( parent == null ) { namingContextName = getName ( ) ; } else { Stack < String > stk = new Stack < String > ( ) ; StringBuffer buff = new StringBuffer ( ) ; while ( parent != null ) { stk . push ( parent ....
Get naming context full name .
157
6
37,521
public JSONObject jsonify ( ) { JSONObject ret = new JSONObject ( ) ; if ( null != this . _attributesString ) { for ( Map . Entry < ApplicationProperty , CharSequence > entry : this . _attributesString . entrySet ( ) ) { ret . put ( entry . getKey ( ) . propertyName ( ) , entry . getValue ( ) . toString ( ) ) ; } } if ...
Return a JSON representation of this property set object
159
9
37,522
public MobicentsSipSession removeSipSession ( final MobicentsSipSessionKey key ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Removing a sip session with the key : " + key ) ; } return sipSessions . remove ( key ) ; }
Removes a sip session from the manager by its key
65
11
37,523
public MobicentsSipApplicationSession removeSipApplicationSession ( final MobicentsSipApplicationSessionKey key ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Removing a sip application session with the key : " + key ) ; } MobicentsSipApplicationSession sipApplicationSession = sipApplicationSessions . remov...
Removes a sip application session from the manager by its key
148
12
37,524
public MobicentsSipApplicationSession getSipApplicationSession ( final SipApplicationSessionKey key , final boolean create ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getSipApplicationSession with key=" + key ) ; } MobicentsSipApplicationSession sipApplicationSessionImpl = null ; //first we check if the ...
Retrieve a sip application session from its key . If none exists one can enforce the creation through the create parameter to true .
326
25
37,525
public MobicentsSipSession getSipSession ( final SipSessionKey key , final boolean create , final SipFactoryImpl sipFactoryImpl , final MobicentsSipApplicationSession sipApplicationSessionImpl ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getSipSession - key=" + key + ", create=" + create + ", sipApplicati...
Retrieve a sip session from its key . If none exists one can enforce the creation through the create parameter to true . the sip factory cannot be null if create is set to true .
516
37
37,526
public MobicentsSipApplicationSession findSipApplicationSession ( HttpSession httpSession ) { for ( MobicentsSipApplicationSession sipApplicationSessionImpl : sipApplicationSessions . values ( ) ) { if ( sipApplicationSessionImpl . findHttpSession ( httpSession . getId ( ) ) != null ) { return sipApplicationSessionImpl...
Retrieves the sip application session holding the converged http session in parameter
80
15
37,527
public void removeAllSessions ( ) { List < SipSessionKey > sipSessionsToRemove = new ArrayList < SipSessionKey > ( ) ; for ( SipSessionKey sipSessionKey : sipSessions . keySet ( ) ) { sipSessionsToRemove . add ( sipSessionKey ) ; } for ( SipSessionKey sipSessionKey : sipSessionsToRemove ) { removeSipSession ( sipSessio...
Remove the sip sessions and sip application sessions
197
8
37,528
public MobicentsSipApplicationSession createApplicationSession ( SipContext sipContext ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Creating new application session for sip context " + sipContext . getApplicationName ( ) ) ; } //call id not needed anymore since the sipappsessionkey is not a callid anymore...
Creates an application session associated with the context
228
9
37,529
private static void validateCreation ( String method , SipApplicationSession app ) { if ( method . equals ( Request . ACK ) ) { throw new IllegalArgumentException ( "Wrong method to create request with[" + Request . ACK + "]!" ) ; } if ( method . equals ( Request . PRACK ) ) { throw new IllegalArgumentException ( "Wron...
Does basic check for illegal methods wrong state if it finds it throws exception
188
14
37,530
public void init ( ) { defaultApplicationRouterParser . init ( ) ; try { defaultSipApplicationRouterInfos = defaultApplicationRouterParser . parse ( ) ; } catch ( ParseException e ) { log . fatal ( "Impossible to parse the default application router configuration file" , e ) ; throw new IllegalArgumentException ( "Impo...
load the configuration file as defined in appendix C of JSR289
91
13
37,531
public static void pushRunAsIdentity ( final RunAsIdentity principal ) { AccessController . doPrivileged ( new PrivilegedAction < Void > ( ) { @ Override public Void run ( ) { SecurityContext sc = getSecurityContext ( ) ; if ( sc == null ) throw MESSAGES . noSecurityContext ( ) ; sc . setOutgoingRunAs ( principal ) ; r...
Sets the run as identity
90
6
37,532
public static RunAs popRunAsIdentity ( ) { return AccessController . doPrivileged ( new PrivilegedAction < RunAs > ( ) { @ Override public RunAs run ( ) { SecurityContext sc = getSecurityContext ( ) ; if ( sc == null ) throw MESSAGES . noSecurityContext ( ) ; RunAs principal = sc . getOutgoingRunAs ( ) ; sc . setOutgoi...
Removes the run as identity
102
6
37,533
public static String hashString ( String input , int length ) { MessageDigest md ; try { md = MessageDigest . getInstance ( "SHA" ) ; } catch ( NoSuchAlgorithmException e ) { throw new IllegalArgumentException ( "The SHA Algorithm could not be found" , e ) ; } byte [ ] bytes = input . getBytes ( ) ; md . update ( bytes...
Compute hash value of a string
119
7
37,534
@ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; // Commented for http://code.google.com/p/sipservlets/issues/detail?id=168 // When no sip.xml but annotations only, Applicat...
Process web annotations .
412
4
37,535
public void notifySipApplicationSessionListeners ( SipApplicationSessionEventType sipApplicationSessionEventType ) { List < SipApplicationSessionListener > listeners = sipContext . getListeners ( ) . getSipApplicationSessionListeners ( ) ; if ( listeners . size ( ) > 0 ) { ClassLoader oldClassLoader = java . lang . Thr...
Notifies the listeners that a lifecycle event occured on that sip application session
444
16
37,536
public Set < MobicentsSipSession > getSipSessions ( boolean internal ) { Set < MobicentsSipSession > retSipSessions = new HashSet < MobicentsSipSession > ( ) ; if ( sipSessions != null ) { for ( SipSessionKey sipSessionKey : sipSessions ) { MobicentsSipSession sipSession = sipContext . getSipManager ( ) . getSipSession...
to avoid serialization issues
315
5
37,537
public void addServletTimer ( ServletTimer servletTimer ) { if ( servletTimers == null ) { servletTimers = new ConcurrentHashMap < String , ServletTimer > ( 1 ) ; } servletTimers . putIfAbsent ( servletTimer . getId ( ) , servletTimer ) ; }
Add a servlet timer to this application session
72
9
37,538
public void removeServletTimer ( ServletTimer servletTimer , boolean updateAppSessionReadyToInvalidateState ) { if ( servletTimers != null ) { servletTimers . remove ( servletTimer . getId ( ) ) ; } if ( updateAppSessionReadyToInvalidateState ) { updateReadyToInvalidateState ( ) ; } }
Remove a servlet timer from this application session
76
9
37,539
public JSONObject jsonify ( ) { JSONObject ret = new JSONObject ( ) ; ret . put ( "title" , getTitle ( ) ) ; ret . put ( "category" , getCategory ( ) ) ; ret . put ( "subcategory" , getSubCategory ( ) ) ; ret . put ( "description" , getDescription ( ) ) ; if ( null != this . _extraAttributes && ! this . _extraAttribute...
Return a JSON representation of this object
116
7
37,540
private ClientCCASession getRoSession ( ) throws InternalException { return ( ( ISessionFactory ) super . sessionFactory ) . getNewAppSession ( null , roAppId , ClientCCASession . class , null ) ; }
Creates a new Ro Client Session
49
7
37,541
public void clean ( ) { this . sipApplicationSessionAttributeListeners . clear ( ) ; this . sipApplicationSessionBindingListeners . clear ( ) ; this . sipApplicationSessionActivationListeners . clear ( ) ; this . sipApplicationSessionListeners . clear ( ) ; this . sipSessionActivationListeners . clear ( ) ; this . sipS...
Empty vectors to allow garbage collection
191
6
37,542
public void onBranchTerminated ( ) { if ( outgoingRequest != null ) { String txid = ( ( ViaHeader ) outgoingRequest . getMessage ( ) . getHeader ( ViaHeader . NAME ) ) . getBranch ( ) ; proxy . removeTransaction ( txid ) ; } }
This will be called when we are sure this branch will not succeed and we moved on to other branches .
62
21
37,543
public void start ( ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "start" ) ; } if ( started ) { throw new IllegalStateException ( "Proxy branch alredy started!" ) ; } if ( canceled ) { throw new IllegalStateException ( "Proxy branch was cancelled, you must create a new branch!" ) ; } if ( timedOut ) { thro...
After the branch is initialized this method proxies the initial request to the specified destination . Subsequent requests are proxied through proxySubsequentRequest
756
27
37,544
public void cancelTimer ( ) { synchronized ( cTimerLock ) { if ( proxyTimeoutTask != null && proxyBranchTimerStarted ) { proxyTimeoutTask . cancel ( ) ; proxyTimeoutTask = null ; proxyBranchTimerStarted = false ; } } }
Stop the C Timer .
56
6
37,545
public void cancel1xxTimer ( ) { if ( proxy1xxTimeoutTask != null && proxyBranch1xxTimerStarted ) { proxy1xxTimeoutTask . cancel ( ) ; proxy1xxTimeoutTask = null ; proxyBranch1xxTimerStarted = false ; } }
Stop the Extension Timer for 1xx .
60
9
37,546
@ Override public void begin ( String namespaceURI , String name , Attributes attributes ) throws Exception { XMLReader xmlReader = getDigester ( ) . getXMLReader ( ) ; Document doc = documentBuilder . newDocument ( ) ; NodeBuilder builder = null ; if ( nodeType == Node . ELEMENT_NODE ) { Element element = null ; if ( ...
Implemented to replace the content handler currently in use by a NodeBuilder .
260
16
37,547
public T friends_areFriends ( int userId1 , int userId2 ) throws FacebookException , IOException { return this . callMethod ( FacebookMethod . FRIENDS_ARE_FRIENDS , new Pair < String , CharSequence > ( "uids1" , Integer . toString ( userId1 ) ) , new Pair < String , CharSequence > ( "uids2" , Integer . toString ( userI...
Retrieves whether two users are friends .
100
9
37,548
public T profile_getFBML ( Integer userId ) throws FacebookException , IOException { return this . callMethod ( FacebookMethod . PROFILE_GET_FBML , new Pair < String , CharSequence > ( "uid" , Integer . toString ( userId ) ) ) ; }
Gets the FBML for a user s profile including the content for both the profile box and the profile actions .
62
23
37,549
protected void handleFeedImages ( List < Pair < String , CharSequence > > params , Collection < IFeedImage > images ) { if ( images != null && images . size ( ) > 4 ) { throw new IllegalArgumentException ( "At most four images are allowed, got " + Integer . toString ( images . size ( ) ) ) ; } if ( null != images && ! ...
Adds image parameters to a list of parameters
258
8
37,550
public boolean feed_publishTemplatizedAction ( Integer actorId , CharSequence titleTemplate ) throws FacebookException , IOException { if ( null != actorId && actorId != this . _userId ) { throw new IllegalArgumentException ( "Actor ID parameter is deprecated" ) ; } return feed_publishTemplatizedAction ( titleTemplate ...
Publishes a Mini - Feed story describing an action taken by a user and publishes aggregating News Feed stories to the friends of that user . Stories are identified as being combinable if they have matching templates and substituted values .
98
45
37,551
public T groups_getMembers ( Number groupId ) throws FacebookException , IOException { assert ( null != groupId ) ; return this . callMethod ( FacebookMethod . GROUPS_GET_MEMBERS , new Pair < String , CharSequence > ( "gid" , groupId . toString ( ) ) ) ; }
Retrieves the membership list of a group
72
9
37,552
public T events_getMembers ( Number eventId ) throws FacebookException , IOException { assert ( null != eventId ) ; return this . callMethod ( FacebookMethod . EVENTS_GET_MEMBERS , new Pair < String , CharSequence > ( "eid" , eventId . toString ( ) ) ) ; }
Retrieves the membership list of an event
70
9
37,553
public T fql_query ( CharSequence query ) throws FacebookException , IOException { assert ( null != query ) ; return this . callMethod ( FacebookMethod . FQL_QUERY , new Pair < String , CharSequence > ( "query" , query ) ) ; }
Retrieves the results of a Facebook Query Language query
60
11
37,554
public T photos_getTags ( Collection < Long > photoIds ) throws FacebookException , IOException { return this . callMethod ( FacebookMethod . PHOTOS_GET_TAGS , new Pair < String , CharSequence > ( "pids" , delimit ( photoIds ) ) ) ; }
Retrieves the tags for the given set of photos .
65
12
37,555
public T groups_get ( Integer userId , Collection < Long > groupIds ) throws FacebookException , IOException { boolean hasGroups = ( null != groupIds && ! groupIds . isEmpty ( ) ) ; if ( null != userId ) return hasGroups ? this . callMethod ( FacebookMethod . GROUPS_GET , new Pair < String , CharSequence > ( "uid" , us...
Retrieves the groups associated with a user
221
9
37,556
public boolean fbml_refreshRefUrl ( URL url ) throws FacebookException , IOException { return extractBoolean ( this . callMethod ( FacebookMethod . FBML_REFRESH_REF_URL , new Pair < String , CharSequence > ( "url" , url . toString ( ) ) ) ) ; }
Recaches the referenced url .
70
6
37,557
public T users_getInfo ( Collection < Integer > userIds , EnumSet < ProfileField > fields ) throws FacebookException , IOException { // assertions test for invalid params assert ( userIds != null ) ; assert ( fields != null ) ; assert ( ! fields . isEmpty ( ) ) ; return this . callMethod ( FacebookMethod . USERS_GET_IN...
Retrieves the requested info fields for the requested set of users .
127
14
37,558
public int users_getLoggedInUser ( ) throws FacebookException , IOException { T result = this . callMethod ( FacebookMethod . USERS_GET_LOGGED_IN_USER ) ; return extractInt ( result ) ; }
Retrieves the user ID of the user logged in to this API session
51
15
37,559
public int auth_getUserId ( String authToken ) throws FacebookException , IOException { /* * Get the session information if we don't have it; this will populate * the user ID as well. */ if ( null == this . _sessionKey ) auth_getSession ( authToken ) ; return this . _userId ; }
Call this function to get the user ID .
70
9
37,560
public boolean users_hasAppPermission ( CharSequence permission ) throws FacebookException , IOException { return extractBoolean ( this . callMethod ( FacebookMethod . USERS_HAS_APP_PERMISSION , new Pair < String , CharSequence > ( "ext_perm" , permission ) ) ) ; }
Retrieves whether the logged - in user has granted the specified permission to this application .
68
18
37,561
public boolean users_setStatus ( String status ) throws FacebookException , IOException { return extractBoolean ( this . callMethod ( FacebookMethod . USERS_SET_STATUS , new Pair < String , CharSequence > ( "status" , status ) ) ) ; }
Sets the logged - in user s Facebook status . Requires the status_update extended permission .
58
19
37,562
public boolean users_clearStatus ( ) throws FacebookException , IOException { return extractBoolean ( this . callMethod ( FacebookMethod . USERS_SET_STATUS , new Pair < String , CharSequence > ( "clear" , "1" ) ) ) ; }
Clears the logged - in user s Facebook status . Requires the status_update extended permission .
58
19
37,563
public void notifications_send ( Collection < Integer > recipientIds , CharSequence notification ) throws FacebookException , IOException { assert ( null != notification ) ; ArrayList < Pair < String , CharSequence > > args = new ArrayList < Pair < String , CharSequence > > ( 3 ) ; if ( null != recipientIds && ! recipi...
Send a notification message to the specified users on behalf of the logged - in user .
156
17
37,564
public T photos_addTags ( Long photoId , Collection < PhotoTag > tags ) throws FacebookException , IOException { assert ( photoId > 0 ) ; assert ( null != tags && ! tags . isEmpty ( ) ) ; JSONArray jsonTags = new JSONArray ( ) ; for ( PhotoTag tag : tags ) { jsonTags . add ( tag . jsonify ( ) ) ; } return this . callMe...
Adds several tags to a photo .
146
7
37,565
public T events_get ( Integer userId , Collection < Long > eventIds , Long startTime , Long endTime ) throws FacebookException , IOException { ArrayList < Pair < String , CharSequence > > params = new ArrayList < Pair < String , CharSequence > > ( FacebookMethod . EVENTS_GET . numParams ( ) ) ; boolean hasUserId = null...
Returns all visible events according to the filters specified . This may be used to find all events of a user or to query specific eids .
298
28
37,566
public boolean profile_setFBML ( CharSequence fbmlMarkup , Integer userId ) throws FacebookException , IOException { return extractBoolean ( this . callMethod ( FacebookMethod . PROFILE_SET_FBML , new Pair < String , CharSequence > ( "uid" , Integer . toString ( userId ) ) , new Pair < String , CharSequence > ( "markup...
Sets the FBML for a user s profile including the content for both the profile box and the profile actions .
98
23
37,567
public boolean profile_setProfileFBML ( CharSequence fbmlMarkup ) throws FacebookException , IOException { return profile_setFBML ( fbmlMarkup , /* profileActionFbmlMarkup */ null , /* mobileFbmlMarkup */ null , /* profileId */ null ) ; }
Sets the FBML for a profile box on the logged - in user s profile .
67
18
37,568
public boolean profile_setProfileActionFBML ( CharSequence fbmlMarkup ) throws FacebookException , IOException { return profile_setFBML ( /* profileFbmlMarkup */ null , fbmlMarkup , /* mobileFbmlMarkup */ null , /* profileId */ null ) ; }
Sets the FBML for profile actions for the logged - in user .
67
15
37,569
public boolean profile_setMobileFBML ( CharSequence fbmlMarkup ) throws FacebookException , IOException { return profile_setFBML ( /* profileFbmlMarkup */ null , /* profileActionFbmlMarkup */ null , fbmlMarkup , /* profileId */ null ) ; }
Sets the FBML for the logged - in user s profile on mobile devices .
67
17
37,570
public boolean profile_setFBML ( CharSequence profileFbmlMarkup , CharSequence profileActionFbmlMarkup ) throws FacebookException , IOException { return profile_setFBML ( profileFbmlMarkup , profileActionFbmlMarkup , /* mobileFbmlMarkup */ null , /* profileId */ null ) ; }
Sets the FBML for the profile box and profile actions for the logged - in user . Refer to the FBML documentation for a description of the markup and its role in various contexts .
76
38
37,571
public T photos_getAlbums ( Collection < Long > albumIds ) throws FacebookException , IOException { return photos_getAlbums ( null , /*userId*/ albumIds ) ; }
Retrieves album metadata for a list of album IDs .
44
12
37,572
public boolean fbml_refreshImgSrc ( URL imageUrl ) throws FacebookException , IOException { return extractBoolean ( this . callMethod ( FacebookMethod . FBML_REFRESH_IMG_SRC , new Pair < String , CharSequence > ( "url" , imageUrl . toString ( ) ) ) ) ; }
Recaches the image with the specified imageUrl .
76
10
37,573
public String auth_createToken ( ) throws FacebookException , IOException { T d = this . callMethod ( FacebookMethod . AUTH_CREATE_TOKEN ) ; return extractString ( d ) ; }
Call this function and store the result using it to generate the appropriate login url and then to retrieve the session information .
43
23
37,574
public Long marketplace_createListing ( Boolean showOnProfile , MarketplaceListing attrs ) throws FacebookException , IOException { T result = this . callMethod ( FacebookMethod . MARKETPLACE_CREATE_LISTING , new Pair < String , CharSequence > ( "show_on_profile" , showOnProfile ? "1" : "0" ) , new Pair < String , Char...
Create a marketplace listing
144
4
37,575
public boolean marketplace_removeListing ( Long listingId , CharSequence status ) throws FacebookException , IOException { assert MARKETPLACE_STATUS_DEFAULT . equals ( status ) || MARKETPLACE_STATUS_SUCCESS . equals ( status ) || MARKETPLACE_STATUS_NOT_SUCCESS . equals ( status ) : "Invalid status: " + status ; T resul...
Remove a marketplace listing
163
4
37,576
public T marketplace_getSubCategories ( CharSequence category ) throws FacebookException , IOException { return this . callMethod ( FacebookMethod . MARKETPLACE_GET_SUBCATEGORIES , new Pair < String , CharSequence > ( "category" , category ) ) ; }
Get the subcategories available for a category .
63
10
37,577
public boolean pages_isAppAdded ( Long pageId ) throws FacebookException , IOException { return extractBoolean ( this . callMethod ( FacebookMethod . PAGES_IS_APP_ADDED , new Pair < String , CharSequence > ( "page_id" , pageId . toString ( ) ) ) ) ; }
Checks whether a page has added the application
70
9
37,578
public boolean admin_setAppProperties ( ApplicationPropertySet properties ) throws FacebookException , IOException { if ( null == properties || properties . isEmpty ( ) ) { throw new IllegalArgumentException ( "expecting a non-empty set of application properties" ) ; } return extractBoolean ( this . callMethod ( Facebo...
Sets several property values for an application . The properties available are analogous to the ones editable via the Facebook Developer application . A session is not required to use this method .
109
35
37,579
public void init ( ) { // load the configuration file String darConfigurationFileLocation = getDarConfigurationFileLocation ( ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Default Application Router file Location : " + darConfigurationFileLocation ) ; } File darConfigurationFile = null ; // hack to get around sp...
Load the configuration file as defined in JSR289 Appendix C ie as a system property javax . servlet . sip . dar
482
28
37,580
public Map < String , List < ? extends SipApplicationRouterInfo > > parse ( ) throws ParseException { Map < String , List < ? extends SipApplicationRouterInfo > > sipApplicationRoutingInfo = new HashMap < String , List < ? extends SipApplicationRouterInfo > > ( ) ; Iterator darEntriesIterator = properties . entrySet ( ...
Parse the global default application router file from the loaded properties file from the init method
235
17
37,581
public Map < String , List < ? extends SipApplicationRouterInfo > > parse ( String configuration ) throws ParseException { Properties tempProperties = new Properties ( ) ; // tempProperties.load(new StringReader(configuration)); // This needs Java 1.6 ByteArrayInputStream stringStream = new ByteArrayInputStream ( confi...
Same method as above but loads DAR configuration from a string .
137
12
37,582
public Map < String , List < ? extends SipApplicationRouterInfo > > parse ( Properties properties ) throws ParseException { this . properties = properties ; return parse ( ) ; }
Same method as above but loads DAR configuration from properties .
39
11
37,583
protected void registerJMX ( StandardContext ctx ) { ObjectName oname ; String parentName = ctx . getName ( ) ; parentName = ( "" . equals ( parentName ) ) ? "/" : parentName ; String hostName = ctx . getParent ( ) . getName ( ) ; hostName = ( hostName == null ) ? "DEFAULT" : hostName ; String domain = ctx . getDomain ...
copied over from super class changing the JMX name being registered j2eeType is now SipServlet instead of Servlet
339
27
37,584
private void checkHandler ( SipServletRequest request ) { MobicentsSipSession sipSessionImpl = ( MobicentsSipSession ) request . getSession ( ) ; if ( sipSessionImpl . getHandler ( ) == null ) { try { sipSessionImpl . setHandler ( sipContext . getServletHandler ( ) ) ; // ((SipApplicationSessionImpl)sipSessionImpl.getA...
set the handler for this request if none already exists . The handler will be the main servlet of the sip context
144
23
37,585
private BigDecimal round ( BigDecimal amount ) { return new BigDecimal ( amount . movePointRight ( 2 ) . add ( new BigDecimal ( ".5" ) ) . toBigInteger ( ) ) . movePointLeft ( 2 ) ; }
round a positive big decimal to 2 decimal points
55
9
37,586
private long doDiameterCharging ( String sessionId , String userId , Long cost , boolean refund ) { try { logger . info ( "Creating Diameter Charging " + ( refund ? "Refund" : "Debit" ) + " Request UserId[" + userId + "], Cost[" + cost + "]..." ) ; Request req = ( Request ) diameterBaseClient . createAccountingRequest ...
Method for doing the Charging either it s a debit or a refund .
216
15
37,587
public void addSipApplicationListener ( String listener ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "addSipApplicationListener " + getName ( ) ) ; } sipApplicationListeners . add ( listener ) ; fireContainerEvent ( "addSipApplicationListener" , listener ) ; // FIXME - add instance if already started? }
Add a new Listener class name to the set of Listeners configured for this application .
78
18
37,588
public void addAllToCart ( ) { for ( Product item : searchResults ) { Boolean selected = searchSelections . get ( item ) ; if ( selected != null && selected ) { searchSelections . put ( item , false ) ; cart . addProduct ( item , 1 ) ; } } }
Add many items to cart
63
5
37,589
private void postWorkDirectory ( ) { // Acquire (or calculate) the work directory path String workDir = getWorkDir ( ) ; if ( workDir == null || workDir . length ( ) == 0 ) { // Retrieve our parent (normally a host) name String hostName = null ; String engineName = null ; String hostWorkDir = null ; Container parentHos...
Set the appropriate context attribute for our work directory .
589
10
37,590
public static boolean verifySignature ( EnumMap < FacebookParam , CharSequence > params , String secret ) { if ( null == params || params . isEmpty ( ) ) return false ; CharSequence sigParam = params . remove ( FacebookParam . SIGNATURE ) ; return ( null == sigParam ) ? false : verifySignature ( params , secret , sigPa...
Verifies that a signature received matches the expected value . Removes FacebookParam . SIGNATURE from params if present .
85
23
37,591
public static boolean isValidIPV4Address ( String value ) { int periods = 0 ; int i = 0 ; int length = value . length ( ) ; if ( length > 15 ) return false ; char c = 0 ; String word = "" ; for ( i = 0 ; i < length ; i ++ ) { c = value . charAt ( i ) ; if ( c == ' ' ) { periods ++ ; if ( periods > 3 ) return false ; if...
Takes a string and parses it to see if it is a valid IPV4 address .
196
20
37,592
public String extractString ( Object val ) { try { return ( String ) val ; } catch ( ClassCastException cce ) { logException ( cce ) ; return null ; } }
Extracts a String from a result consisting entirely of a String .
39
14
37,593
protected Object parseCallResult ( InputStream data , IFacebookMethod method ) throws FacebookException , IOException { Object json = JSONValue . parse ( new InputStreamReader ( data ) ) ; if ( isDebug ( ) ) { log ( method . methodName ( ) + ": " + ( null != json ? json . toString ( ) : "null" ) ) ; } if ( json instanc...
Parses the result of an API call from JSON into Java Objects .
174
15
37,594
protected URL extractURL ( Object url ) throws IOException { if ( ! ( url instanceof String ) ) { return null ; } return ( null == url || "" . equals ( url ) ) ? null : new URL ( ( String ) url ) ; }
Extracts a URL from a result that consists of a URL only . For JSON that result is simply a String .
53
24
37,595
protected boolean extractBoolean ( Object val ) { try { return ( Boolean ) val ; } catch ( ClassCastException cce ) { logException ( cce ) ; return false ; } }
Extracts a Boolean from a result that consists of a Boolean only .
40
15
37,596
protected Long extractLong ( Object val ) { try { return ( Long ) val ; } catch ( ClassCastException cce ) { logException ( cce ) ; return null ; } }
Extracts a Long from a result that consists of an Long only .
39
15
37,597
public void add ( double lat , double lon , long time , T t , Optional < R > id ) { Info < T , R > info = new Info < T , R > ( lat , lon , time , t , id ) ; add ( info ) ; }
Adds a record to the in - memory store with the given position and time and id .
58
18
37,598
public void add ( Info < T , R > info ) { String hash = GeoHash . encodeHash ( info . lat ( ) , info . lon ( ) ) ; addToMap ( mapByGeoHash , info , hash ) ; addToMapById ( mapById , info , hash ) ; }
Adds a record to the in - memory store with the given position time and id .
65
17
37,599
public static long decodeBase32 ( String hash ) { boolean isNegative = hash . startsWith ( "-" ) ; int startIndex = isNegative ? 1 : 0 ; long base = 1 ; long result = 0 ; for ( int i = hash . length ( ) - 1 ; i >= startIndex ; i -- ) { int j = getCharIndex ( hash . charAt ( i ) ) ; result = result + base * j ; base = b...
Returns the conversion of a base32 geohash to a long .
116
14