idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
16,900 | public void init ( Object parent , Object record ) { if ( parent instanceof BaseApplet ) m_strInitParam = ( ( BaseApplet ) parent ) . getProperty ( Params . MENU ) ; super . init ( parent , record ) ; } | Initialize this class . If there is a top - level menu = property save it for later . |
16,901 | public FieldList buildFieldList ( ) { FieldList record = ( FieldList ) ClassServiceUtility . getClassService ( ) . makeObjectFromClassName ( Constants . ROOT_PACKAGE + "thin.main.db.Menus" ) ; if ( record != null ) record . init ( this ) ; else return null ; record . setOpenMode ( Constants . OPEN_READ_ONLY ) ; BaseApp... | Build the list of fields that make up the screen . This method creates a new Menus record and links it to the remote MenusSession . |
16,902 | public void setMargin ( Rectangle2D bounds , Direction ... dirs ) { for ( Direction dir : dirs ) { switch ( dir ) { case BOTTOM : combinedTransform . transform ( userBounds . getCenterX ( ) , userBounds . getMinY ( ) , ( x , y ) -> { inverse . transform ( x , y + bounds . getHeight ( ) , this :: updatePoint ) ; } ) ; b... | Enlarges margin in screen coordinates to given directions |
16,903 | public double toScreenX ( double x ) { Point2D src = srcPnt . get ( ) ; Point2D dst = dstPnt . get ( ) ; src . setLocation ( x , 0 ) ; combinedTransform . transform ( src , dst ) ; return dst . getX ( ) ; } | Translates cartesian x - coordinate to screen coordinate . |
16,904 | public double toScreenY ( double y ) { Point2D src = srcPnt . get ( ) ; Point2D dst = dstPnt . get ( ) ; src . setLocation ( 0 , y ) ; combinedTransform . transform ( src , dst ) ; return dst . getY ( ) ; } | Translates cartesian y - coordinate to screen coordinate . |
16,905 | public double fromScreenX ( double x ) { Point2D src = srcPnt . get ( ) ; Point2D dst = dstPnt . get ( ) ; src . setLocation ( x , 0 ) ; inverse . transform ( src , dst ) ; return dst . getX ( ) ; } | Translates screen x - coordinate to cartesian coordinate . |
16,906 | public double fromScreenY ( double y ) { Point2D src = srcPnt . get ( ) ; Point2D dst = dstPnt . get ( ) ; src . setLocation ( 0 , y ) ; inverse . transform ( src , dst ) ; return dst . getY ( ) ; } | Translates screen y - coordinate to cartesian coordinate . |
16,907 | public boolean znodeIsMe ( String path ) { String value = ZKUtils . get ( zk , path ) ; return ( value != null && value == myNodeID ) ; } | Given a path determines whether or not the value of a ZNode is my node ID . |
16,908 | public NodeState join ( ZooKeeperClient injectedClient ) throws InterruptedException { switch ( state . get ( ) ) { case Fresh : connect ( injectedClient ) ; break ; case Shutdown : connect ( injectedClient ) ; break ; case Draining : LOG . warn ( "'join' called while draining; ignoring." ) ; break ; case Started : LOG... | Joins the cluster using a custom zk client claims work and begins operation . |
16,909 | private void connect ( ZooKeeperClient injectedClient ) throws InterruptedException { if ( ! initialized . get ( ) ) { if ( injectedClient == null ) { List < InetSocketAddress > hosts = new ArrayList < InetSocketAddress > ( ) ; for ( String host : config . hosts . split ( "," ) ) { String [ ] parts = host . split ( ":"... | Directs the ZooKeeperClient to connect to the ZooKeeper ensemble and wait for the connection to be established before continuing . |
16,910 | public void stopAndWait ( final long waitTime , final AtomicBoolean stopFlag ) { if ( ! waitInProgress . getAndSet ( true ) ) { stopFlag . set ( true ) ; rejoinExecutor . submit ( new Runnable ( ) { public void run ( ) { balancingPolicy . drainToCount ( 0 , false ) ; try { Thread . sleep ( waitTime ) ; } catch ( Interr... | For handling problematic nodes - drains workers and does not claim work for waitTime seconds |
16,911 | public void completeShutdown ( ) { setState ( NodeState . Shutdown ) ; shutdownAllWorkUnits ( ) ; deleteFromZk ( ) ; if ( claimer != null ) { claimer . interrupt ( ) ; try { claimer . join ( ) ; } catch ( InterruptedException e ) { LOG . warn ( "Shutdown of Claimer interrupted" ) ; } } if ( connectionWatcher != null ) ... | Finalizes the shutdown sequence . Called once the drain operation completes . |
16,912 | void onConnect ( ) throws InterruptedException , IOException { if ( state . get ( ) != NodeState . Fresh ) { if ( previousZKSessionStillActive ( ) ) { LOG . info ( "ZooKeeper session re-established before timeout." ) ; return ; } LOG . warn ( "Rejoined after session timeout. Forcing shutdown and clean startup." ) ; ens... | Primary callback which is triggered upon successful Zookeeper connection . |
16,913 | private void ensureCleanStartup ( ) { forceShutdown ( ) ; ScheduledThreadPoolExecutor oldPool = pool . getAndSet ( createScheduledThreadExecutor ( ) ) ; oldPool . shutdownNow ( ) ; claimedForHandoff . clear ( ) ; workUnitsPeggedToMe . clear ( ) ; state . set ( NodeState . Fresh ) ; } | In the event that the node has been evicted and is reconnecting this method clears out all existing state before relaunching to ensure a clean launch . |
16,914 | private void scheduleRebalancing ( ) { int interval = config . autoRebalanceInterval ; Runnable runRebalance = new Runnable ( ) { public void run ( ) { try { rebalance ( ) ; } catch ( Exception e ) { LOG . error ( "Error running auto-rebalance." , e ) ; } } } ; autoRebalanceFuture = pool . get ( ) . scheduleAtFixedRate... | Schedules auto - rebalancing if auto - rebalancing is enabled . The task is scheduled to run every 60 seconds by default or according to the config . |
16,915 | private void joinCluster ( ) throws InterruptedException , IOException { while ( true ) { NodeInfo myInfo ; try { myInfo = new NodeInfo ( NodeState . Fresh . toString ( ) , zk . get ( ) . getSessionId ( ) ) ; } catch ( ZooKeeperConnectionException e ) { throw ZKException . from ( e ) ; } byte [ ] encoded = JsonUtil . a... | Registers this node with Zookeeper on startup retrying until it succeeds . This retry logic is important in that a node which restarts before Zookeeper detects the previous disconnect could prohibit the node from properly launching . |
16,916 | public void claimWork ( ) throws InterruptedException { if ( state . get ( ) == NodeState . Started && ! waitInProgress . get ( ) && connected . get ( ) ) { balancingPolicy . claimWork ( ) ; } } | Triggers a work - claiming cycle . If smart balancing is enabled claim work based on node and cluster load . If simple balancing is in effect claim by count . |
16,917 | public void requestHandoff ( String workUnit ) throws InterruptedException { LOG . info ( "Requesting handoff for {}." , workUnit ) ; ZKUtils . createEphemeral ( zk , "/" + name + "/handoff-requests/" + workUnit ) ; } | Requests that another node take over for a work unit by creating a ZNode at handoff - requests . This will trigger a claim cycle and adoption . |
16,918 | public void verifyIntegrity ( ) { LinkedHashSet < String > noLongerActive = new LinkedHashSet < String > ( myWorkUnits ) ; noLongerActive . removeAll ( allWorkUnits . keySet ( ) ) ; for ( String workUnit : noLongerActive ) { shutdownWork ( workUnit , true ) ; } for ( String workUnit : myWorkUnits ) { String claimPath =... | Verifies that all nodes are hooked up properly . Shuts down any work units which have been removed from the cluster or have been assigned to another node . |
16,919 | public void shutdownWork ( String workUnit , boolean doLog ) { if ( doLog ) { LOG . info ( "Shutting down {}: {}..." , config . workUnitName , workUnit ) ; } myWorkUnits . remove ( workUnit ) ; claimedForHandoff . remove ( workUnit ) ; balancingPolicy . onShutdownWork ( workUnit ) ; try { listener . shutdownWork ( work... | Shuts down a work unit by removing the claim in ZK and calling the listener . |
16,920 | private boolean setState ( NodeState to ) { try { NodeInfo myInfo = new NodeInfo ( to . toString ( ) , zk . get ( ) . getSessionId ( ) ) ; byte [ ] encoded = JsonUtil . asJSONBytes ( myInfo ) ; ZKUtils . set ( zk , "/" + name + "/nodes/" + myNodeID , encoded ) ; state . set ( to ) ; return true ; } catch ( Exception e ... | Sets the state of the current Ordasity node and notifies others via ZooKeeper . |
16,921 | private boolean previousZKSessionStillActive ( ) { try { byte [ ] json = zk . get ( ) . getData ( String . format ( "/%s/nodes/%s" , name , myNodeID ) , false , null ) ; NodeInfo nodeInfo = JsonUtil . fromJSON ( json , NodeInfo . class ) ; return ( nodeInfo . connectionID == zk . get ( ) . getSessionId ( ) ) ; } catch ... | Determines if another ZooKeeper session is currently active for the current node by comparing the ZooKeeper session ID of the connection stored in NodeState . |
16,922 | public static void updateParticipants ( Encounter encounter ) { if ( encounter == null || encounter . getParticipant ( ) . isEmpty ( ) ) { return ; } RPCParameter params = new RPCParameter ( ) ; for ( EncounterParticipantComponent participant : encounter . getParticipant ( ) ) { String partId = getParticipantId ( parti... | Updates the participants associated with an encounter . |
16,923 | public static Encounter decode ( String vstr ) { String [ ] pcs = StrUtil . split ( vstr , VSTR_DELIM , 4 ) ; long encIEN = NumberUtils . toLong ( pcs [ 3 ] ) ; if ( encIEN > 0 ) { return DomainFactoryRegistry . fetchObject ( Encounter . class , pcs [ 3 ] ) ; } long locIEN = NumberUtils . toLong ( pcs [ 0 ] ) ; Locatio... | Decode encounter from visit string . |
16,924 | public static String encode ( Encounter encounter ) { Location location = ClientUtil . getResource ( encounter . getLocationFirstRep ( ) . getLocation ( ) , Location . class ) ; String locIEN = location . isEmpty ( ) ? "" : location . getIdElement ( ) . getIdPart ( ) ; Date date = encounter . getPeriod ( ) . getStart (... | Encode an encounter to a visit string . |
16,925 | public void plusMonths ( int delta ) { if ( delta != 0 ) { int result = getMonth ( ) - 1 + delta ; setMonth ( Math . floorMod ( result , 12 ) + 1 ) ; plusYears ( Math . floorDiv ( result , 12 ) ) ; } } | Adds delta months . Delta can be negative . Month and year fields are affected . |
16,926 | public void plusDays ( long delta ) { if ( delta != 0 ) { long result = getDay ( ) + delta ; if ( result >= 1 && result <= 28 ) { setDay ( ( int ) result ) ; } else { ZonedDateTime zonedDateTime = ZonedDateTime . from ( this ) ; ZonedDateTime plusDays = zonedDateTime . plusDays ( delta ) ; set ( plusDays ) ; } } } | Adds delta days . Delta can be negative . Month year and day fields are affected . |
16,927 | public void plusHours ( long delta ) { if ( delta != 0 ) { long result = getHour ( ) + delta ; setHour ( ( int ) Math . floorMod ( result , 24 ) ) ; plusDays ( Math . floorDiv ( result , 24 ) ) ; } } | Adds delta hours . Delta can be negative . Month year day and hour fields are affected . |
16,928 | public void plusMinutes ( long delta ) { if ( delta != 0 ) { long result = getMinute ( ) + delta ; setMinute ( ( int ) Math . floorMod ( result , 60 ) ) ; plusHours ( Math . floorDiv ( result , 60 ) ) ; } } | Adds delta minutes . Delta can be negative . Month year day hour and minute fields are affected . |
16,929 | public void plusSeconds ( long delta ) { if ( delta != 0 ) { long result = getSecond ( ) + delta ; setSecond ( ( int ) Math . floorMod ( result , 60 ) ) ; plusMinutes ( Math . floorDiv ( result , 60 ) ) ; } } | Adds delta seconds . Delta can be negative . Month year day hour minute and seconds fields are affected . |
16,930 | public void plusMilliSeconds ( long delta ) { plusNanoSeconds ( Math . floorMod ( delta , 1000 ) * 1000000 ) ; plusSeconds ( Math . floorDiv ( delta , 1000 ) ) ; } | Adds delta milliseconds . Delta can be negative . Month year day hour minute seconds and nanoSecond fields are affected . |
16,931 | public void plusNanoSeconds ( long delta ) { if ( delta != 0 ) { long result = getNanoSecond ( ) + delta ; setNanoSecond ( ( int ) Math . floorMod ( result , 1000000000 ) ) ; plusSeconds ( Math . floorDiv ( result , 1000000000 ) ) ; } } | Adds delta nanoseconds . Delta can be negative . Month year day hour minute seconds and nanoSecond fields are affected . |
16,932 | public static final SimpleMutableDateTime now ( Clock clock ) { ZonedDateTime zdt = ZonedDateTime . now ( clock ) ; SimpleMutableDateTime smt = SimpleMutableDateTime . from ( zdt ) ; return smt ; } | Creates SimpleMutableDateTime and initializes it using given clock . |
16,933 | public static final SimpleMutableDateTime ofEpochMilli ( long millis ) { ZonedDateTime zdt = ZonedDateTime . ofInstant ( Instant . ofEpochMilli ( millis ) , ZoneOffset . UTC ) ; SimpleMutableDateTime smt = SimpleMutableDateTime . from ( zdt ) ; return smt ; } | Creates SimpleMutableDateTime and initializes it using milliseconds from epoch . |
16,934 | public static final SimpleMutableDateTime now ( ZoneId zoneId ) { ZonedDateTime zdt = ZonedDateTime . now ( zoneId ) ; SimpleMutableDateTime smt = SimpleMutableDateTime . from ( zdt ) ; return smt ; } | Creates SimpleMutableDateTime and initializes it to given ZoneId . |
16,935 | protected void setupForWar ( ) { ProtectionDomain protectionDomain = RunWar . class . getProtectionDomain ( ) ; URL location = protectionDomain . getCodeSource ( ) . getLocation ( ) ; String warFilePath = trimToFile ( location . toExternalForm ( ) ) ; File warFile = new File ( warFilePath ) ; if ( ! warFile . exists ( ... | Setup the webapp pointing to the war file that contains this class . |
16,936 | private void addPiece ( String pc , String prefix , StringBuilder sb ) { if ( ! pc . isEmpty ( ) ) { if ( sb . length ( ) > 0 ) { sb . append ( prefix ) ; } sb . append ( pc ) ; } } | Used to build a connection string for display . |
16,937 | private boolean inBaseField ( String strFieldFileName , String [ ] rgstrClassNames ) { for ( int i = 0 ; i < rgstrClassNames . length - 1 ; i ++ ) { if ( strFieldFileName . equals ( rgstrClassNames [ i ] ) ) return true ; } return false ; } | Is this field in my field list already? |
16,938 | private void scanSharedFields ( ) { if ( ! m_bFirstTime ) return ; m_bFirstTime = false ; m_vFieldList = new Vector < FieldSummary > ( ) ; m_iCurrentIndex = 0 ; String strClassName = m_recClassInfo . getField ( ClassInfo . CLASS_NAME ) . toString ( ) ; m_rgstrClasses = this . getBaseRecordClasses ( strClassName ) ; Str... | Build the field list from the concrete and base record classes . |
16,939 | private String [ ] getBaseRecordClasses ( String strClassName ) { ClassInfo recClassInfo = new ClassInfo ( Record . findRecordOwner ( m_recClassInfo ) ) ; String [ ] rgstrClasses = new String [ 0 ] ; Record recFileHdr = new FileHdr ( Record . findRecordOwner ( m_recFileHdr ) ) ; try { String strBaseClass = strClassName... | Get the hierarchy of classes starting with this class name . |
16,940 | private boolean isInRecord ( String [ ] strClassNames , int iClassIndex , String strRecordClass ) { boolean bIsInRecord = false ; for ( int i = 0 ; i <= iClassIndex ; i ++ ) { if ( strClassNames [ i ] . equalsIgnoreCase ( strRecordClass ) ) bIsInRecord = true ; } return bIsInRecord ; } | Is this class one of the base class names for this record? |
16,941 | protected Database databaseForResource ( final TokenProxy < ? , TokenType . Simple > tokenProxy , final Resource resource , final String domain ) throws HodErrorException { final ResourceIdentifier resourceIdentifier = new ResourceIdentifier ( domain , resource . getResource ( ) ) ; final Set < String > parametricField... | Converts the given resource name to a database |
16,942 | public void setPTableRef ( PTable pTable , PhysicalDatabaseParent dbOwner ) { m_pTable = pTable ; if ( pTable == null ) if ( dbOwner != null ) { FieldList record = this . getRecord ( ) ; if ( record != null ) { PDatabase pDatabase = dbOwner . getPDatabase ( record . getDatabaseName ( ) , ThinPhysicalDatabase . MEMORY_T... | Set the raw data table reference . |
16,943 | public void addState ( final String id , final Collection < Attribute > attributes ) { this . stateMap . put ( id , attributes ) ; } | Binds a set of Attribute values to an identifier . |
16,944 | public Collection < String > getIdentifiers ( ) { List < String > keys = new LinkedList < String > ( ) ; keys . addAll ( this . stateMap . keySet ( ) ) ; return keys ; } | Returns a collection containing the same Identifier Strings as this WorldState object . Modifications to the returned Collection do not impact this WorldState . |
16,945 | public static boolean isBetween ( final Interval timeRange , final Interval timeRangeToCheck ) { return ( ( timeRange . getStart ( ) != null && timeRange . getStart ( ) . isBefore ( timeRangeToCheck . getStart ( ) ) ) && ( timeRange . getEnd ( ) != null && timeRange . getEnd ( ) . isAfter ( timeRangeToCheck . getEnd ( ... | Checks if the given time range is between the given time range to check |
16,946 | public static boolean isOverlappingBefore ( final Interval timeRange , final Interval timeRangeToCheck ) { return ( ( timeRange . getStart ( ) != null && timeRange . getStart ( ) . isAfter ( timeRangeToCheck . getStart ( ) ) ) && ( timeRange . getEnd ( ) != null && timeRange . getEnd ( ) . isAfter ( timeRangeToCheck . ... | Checks if the given time range is overlapping before the given time range to check . |
16,947 | public static boolean isOverlappingAfter ( final Interval timeRange , final Interval timeRangeToCheck ) { return ( ( timeRange . getStart ( ) != null && timeRange . getStart ( ) . isBefore ( timeRangeToCheck . getStart ( ) ) ) && ( timeRange . getEnd ( ) != null && timeRange . getEnd ( ) . isBefore ( timeRangeToCheck .... | Checks if the given time range is overlapping after the given time range to check . |
16,948 | private Subquery < TopicToBugzillaBug > getOpenBugzillaSubquery ( ) { final CriteriaBuilder criteriaBuilder = getCriteriaBuilder ( ) ; final Subquery < TopicToBugzillaBug > subQuery = getCriteriaQuery ( ) . subquery ( TopicToBugzillaBug . class ) ; final Root < TopicToBugzillaBug > root = subQuery . from ( TopicToBugzi... | Create a Subquery to check if a topic has open bugs . |
16,949 | public static void print ( Collection coll , PrintStream out , String separator ) { out . print ( format ( coll , separator ) ) ; } | Prints a collection to the given output stream . |
16,950 | public String signDataWithBase64 ( byte [ ] data ) throws InvalidKeyException , NoSuchAlgorithmException , NoSuchProviderException , SignatureException { String res = null ; byte [ ] signature = this . signData ( data ) ; res = Base64 . toBase64String ( signature ) ; return res ; } | Generate the signature with the enrollment private key |
16,951 | public String encryptWithBase64 ( byte [ ] data ) throws NoSuchAlgorithmException , NoSuchProviderException , NoSuchPaddingException , InvalidKeyException , IllegalBlockSizeException , BadPaddingException , InvalidAlgorithmParameterException , InvalidCipherTextException , IOException { byte [ ] cipher = encryptBytes ( ... | Encrypt data with TLS certificate and convert cipher to base64 |
16,952 | public String signAndEncrypt ( byte [ ] data ) throws NoSuchAlgorithmException , NoSuchProviderException , NoSuchPaddingException , InvalidKeyException , IllegalBlockSizeException , BadPaddingException , SignatureException , InvalidAlgorithmParameterException , InvalidCipherTextException , IOException { String dataBase... | Sign and encrypt data then convert cipher to base64 |
16,953 | public String decryptAndVerify ( byte [ ] data ) throws NoSuchAlgorithmException , NoSuchProviderException , NoSuchPaddingException , InvalidKeyException , IllegalBlockSizeException , BadPaddingException , SignatureException , InvalidAlgorithmParameterException , InvalidCipherTextException , IOException { byte [ ] base... | decrypt and verify signature of data |
16,954 | @ SuppressWarnings ( "unchecked" ) public static < T extends View > T get ( View view , int id ) { SparseArray < View > viewHolder = ( SparseArray < View > ) view . getTag ( ) ; if ( viewHolder == null ) { viewHolder = new SparseArray < View > ( ) ; view . setTag ( viewHolder ) ; } View childView = viewHolder . get ( i... | I added a generic return type to reduce the casting noise in client code |
16,955 | public static Area getArea ( Location ... locations ) { if ( locations . length == 2 ) { if ( locations [ 0 ] . getLongitude ( ) == 0.0 && locations [ 1 ] . getLongitude ( ) == 0.0 ) { return getPolar ( locations [ 0 ] . getLatitude ( ) , locations [ 1 ] . getLatitude ( ) ) ; } else { throw new IllegalArgumentException... | Returns area limited by given coordinates . Area must be convex . If exactly 2 locations are given the longitudes must be 0 defining polar area limited by latitudes . |
16,956 | public double getMarkedness ( Area node ) { double fsz = node . getFontSize ( ) / avgfont ; double fwt = node . getFontWeight ( ) ; double fst = node . getFontStyle ( ) ; double ind = getIndentation ( node ) ; double cen = isCentered ( node ) ? 1.0 : 0.0 ; double contrast = getContrast ( node ) ; double cp = 1.0 - ca .... | Computes the markedness of the area . The markedness generally describes the visual importance of the area based on different criteria . |
16,957 | private int isCentered ( Area area , boolean askBefore , boolean askAfter ) { Area parent = area . getParent ( ) ; if ( parent != null ) { int left = area . getX1 ( ) - parent . getX1 ( ) ; int right = parent . getX2 ( ) - area . getX2 ( ) ; int limit = ( int ) ( ( ( left + right ) / 2.0 ) * CENTERING_THRESHOLD ) ; if ... | Tries to guess whether the area is horizontally centered within its parent area |
16,958 | private int lrAligned ( Area a1 , Area a2 ) { if ( a1 . getX1 ( ) == a2 . getX1 ( ) ) return ( a1 . getX2 ( ) == a2 . getX2 ( ) ) ? 2 : 1 ; else if ( a1 . getX2 ( ) == a2 . getX2 ( ) ) return 1 ; else return 0 ; } | Checks if the areas are left - or right - aligned . |
16,959 | private int countAreas ( Area a , Rectangular r ) { int ret = 0 ; for ( int i = 0 ; i < a . getChildCount ( ) ; i ++ ) { Area n = a . getChildAt ( i ) ; if ( a . getTopology ( ) . getPosition ( n ) . intersects ( r ) ) ret ++ ; } return ret ; } | Counts the number of sub - areas in the specified region of the area |
16,960 | public RemoteTable getRemoteTable ( String strRecordName ) throws RemoteException { BaseTransport transport = this . createProxyTransport ( GET_REMOTE_TABLE ) ; transport . addParam ( NAME , strRecordName ) ; String strTableID = ( String ) transport . sendMessageAndGetReply ( ) ; TableProxy tableProxy = ( TableProxy ) ... | Get this table for this session . |
16,961 | public int setUserID ( int iChangeType , boolean bDisplayOption ) { int iErrorCode = DBConstants . NORMAL_RETURN ; int iUserID = - 1 ; if ( this . getOwner ( ) . getRecordOwner ( ) != null ) if ( ( ( BaseApplication ) this . getOwner ( ) . getRecordOwner ( ) . getTask ( ) . getApplication ( ) ) != null ) if ( ( ( BaseA... | Set the user ID . |
16,962 | public void add ( double rad , double weight ) { sin += Math . sin ( rad ) * weight ; cos += Math . cos ( rad ) * weight ; } | Adds angle in radians with weight |
16,963 | public void getGroups ( String startFrom , boolean forward , Collection < Recipient > result ) { List < String > lst = broker . callRPCList ( "RGUTRPC FILGET" , null , 3.8 , startFrom , forward ? 1 : - 1 , MG_SCREEN , 40 ) ; toRecipients ( lst , true , startFrom , result ) ; } | Returns a bolus of mail groups . |
16,964 | public void getUsers ( String startFrom , boolean forward , Collection < Recipient > result ) { List < String > lst = broker . callRPCList ( "RGCWFUSR LOOKUP" , null , startFrom , forward ? 1 : - 1 , null , null , "A" ) ; toRecipients ( lst , false , startFrom , result ) ; } | Returns a bolus of users . |
16,965 | public void getNotifications ( Patient patient , Collection < Notification > result ) { List < String > lst = null ; result . clear ( ) ; if ( patient == null ) { lst = broker . callRPCList ( "RGCWXQ ALRLIST" , null ) ; } else if ( patient != null ) { lst = broker . callRPCList ( "RGCWXQ ALRLIST" , null , patient . get... | Returns notifications for the current user . |
16,966 | public boolean deleteNotification ( Notification notification ) { boolean result = notification . canDelete ( ) ; if ( result ) { broker . callRPC ( "RGCWXQ ALRPP" , notification . getAlertId ( ) ) ; } return result ; } | Delete a notification . |
16,967 | public void forwardNotifications ( Collection < Notification > notifications , Collection < Recipient > recipients , String comment ) { List < String > lst1 = new ArrayList < > ( ) ; for ( Notification notification : notifications ) { lst1 . add ( notification . getAlertId ( ) ) ; } List < Long > lst2 = prepareRecipien... | Forward multiple notifications . |
16,968 | private List < Long > prepareRecipients ( Collection < Recipient > recipients ) { List < Long > lst = new ArrayList < > ( ) ; for ( Recipient recipient : recipients ) { lst . add ( recipient . getIen ( ) ) ; } return lst ; } | Prepares a recipient list for passing to an RPC . |
16,969 | private void toRecipients ( List < String > recipientData , boolean isGroup , String filter , Collection < Recipient > result ) { result . clear ( ) ; for ( String data : recipientData ) { Recipient recipient = new Recipient ( data , isGroup ) ; if ( StringUtils . startsWithIgnoreCase ( recipient . getName ( ) , filter... | Creates a list of recipients from a list of raw data . |
16,970 | public List < String > getNotificationMessage ( Notification notification ) { List < String > message = notification . getMessage ( ) ; if ( message == null ) { message = broker . callRPCList ( "RGCWXQ ALRMSG" , null , notification . getAlertId ( ) ) ; notification . setMessage ( message ) ; } return message ; } | Returns the message associated with a notification fetching it from the server if necessary . |
16,971 | public void getScheduledNotifications ( Collection < ScheduledNotification > result ) { List < String > lst = broker . callRPCList ( "RGCWXQ SCHLIST" , null , scheduledPrefix ) ; result . clear ( ) ; for ( String data : lst ) { result . add ( new ScheduledNotification ( data ) ) ; } } | Returns all scheduled notifications for the current user . |
16,972 | public void getScheduledNotificationRecipients ( ScheduledNotification notification , Collection < Recipient > result ) { List < String > lst = broker . callRPCList ( "RGCWXQ SCHRECIP" , null , notification . getIen ( ) ) ; result . clear ( ) ; for ( String data : lst ) { result . add ( new Recipient ( data ) ) ; } } | Returns a list of recipients associated with a scheduled notification . |
16,973 | public List < String > getScheduledNotificationMessage ( ScheduledNotification notification ) { return broker . callRPCList ( "RGCWXQ SCHMSG" , null , notification . getIen ( ) ) ; } | Returns the message associated with a scheduled notification . |
16,974 | public boolean scheduleNotification ( ScheduledNotification notification , List < String > message , Collection < Recipient > recipients ) { if ( notification . getIen ( ) > 0 ) { deleteScheduledNotification ( notification ) ; } String extraInfo = StrUtil . fromList ( Arrays . asList ( notification . getExtraInfo ( ) )... | Creates a schedule notification . If the notification is replacing an existing one the existing one will be first deleted and a new one created in its place . |
16,975 | protected void addPublicanCommonContentToBook ( final BuildData buildData ) throws BuildProcessingException { final ContentSpec contentSpec = buildData . getContentSpec ( ) ; final String commonContentLocale = buildData . getOutputLocale ( ) ; final String commonContentDirectory = buildData . getBuildOptions ( ) . getC... | Adds the Publican Common_Content files specified by the brand locale and directory location build options . If the Common_Content files don t exist at the directory brand and locale specified then the common brand will be used instead . If the file still don t exist then the files are skipped and will rely on XML XI In... |
16,976 | private static List < String > resolveFields ( final Iterable < ? extends String > fields ) { final List < String > fieldList = new ArrayList < String > ( ) ; for ( final String field : fields ) { Validate . isTrue ( StringUtils . isNotBlank ( field ) , "One of the specified fields was blank" ) ; fieldList . add ( fiel... | Private helper method for setting the field names . It converts colons to underscores and removes any blanks or excess whitespace . Instances are immutable so this method cannot be made public . |
16,977 | private static List < String > resolveValues ( final Iterable < ? extends String > values ) { final List < String > valuesList = new ArrayList < String > ( ) ; for ( final String value : values ) { Validate . notNull ( value , "One of the specified values was null" ) ; valuesList . add ( value ) ; } return valuesList ;... | Private helper method for setting the field values . nulls are not permitted . Instances are immutable so this method cannot be made public . |
16,978 | protected String getValuesString ( ) { final StringBuilder builder = new StringBuilder ( ) ; for ( final String value : values ) { builder . append ( AciURLCodec . getInstance ( ) . encode ( value ) ) . append ( ',' ) ; } if ( builder . length ( ) > 0 ) { builder . deleteCharAt ( builder . length ( ) - 1 ) ; } return b... | Accessor for the specifier s values . The values are URL encoded and separated by commas . |
16,979 | public Stream < T > headStream ( T key , boolean inclusive , boolean parallel ) { return StreamSupport . stream ( headSpliterator ( key , inclusive ) , parallel ) ; } | Returns stream from start to key |
16,980 | public Stream < T > tailStream ( T key , boolean inclusive , boolean parallel ) { return StreamSupport . stream ( tailSpliterator ( key , inclusive ) , parallel ) ; } | Returns stream from key to end |
16,981 | public Spliterator < T > headSpliterator ( T key , boolean inclusive ) { int point = point ( key , ! inclusive ) ; Iterator < T > iterator = subList ( 0 , point ) . iterator ( ) ; return Spliterators . spliterator ( iterator , size ( ) - point , 0 ) ; } | Returns spliterator from start to key |
16,982 | public Iterator < T > headIterator ( T key , boolean inclusive ) { int point = point ( key , ! inclusive ) ; return subList ( 0 , point ) . iterator ( ) ; } | Returns iterator from start to key |
16,983 | public Iterator < T > tailIterator ( T key , boolean inclusive ) { int point = point ( key , inclusive ) ; return subList ( point , size ( ) ) . iterator ( ) ; } | Returns iterator from key to end |
16,984 | public Object stringToBinary ( String tempString ) throws Exception { java . util . Date dateOld = new java . util . Date ( ( long ) this . getValue ( ) ) ; return DateConverter . stringToBinary ( tempString , dateOld , DBConstants . TIME_ONLY_FORMAT ) ; } | Convert this string to this field s binary data format . |
16,985 | public void contextInitialized ( ServletContextEvent sce ) { ServletContext context = sce . getServletContext ( ) ; String propertiesConfig = context . getInitParameter ( PROPERTIES_CONFIG ) ; if ( propertiesConfig == null ) { propertiesConfig = PROPERTIES_CONFIG_DEFAULT ; } SystemProperties config = loadConfiguration ... | Sets properties from the context - param named system . properties . file into System . properties . |
16,986 | private SystemProperties loadConfiguration ( String propertiesConfig , ServletContext context ) throws IllegalStateException { InputStream inStream = null ; try { inStream = getStreamForLocation ( propertiesConfig , context ) ; JAXBContext jaxb = JAXBContext . newInstance ( SystemProperties . class . getPackage ( ) . g... | Loads and returns the configuration . |
16,987 | private InputStream getStreamForLocation ( final String location , final ServletContext context ) throws FileNotFoundException { String fileLocation = StringUtils . replaceVariables ( location , new HashMap < String , Object > ( ) , true ) ; if ( fileLocation . startsWith ( PREFIX_FILE ) ) { return new FileInputStream ... | Returns the InputStream to the supplied file location |
16,988 | private void addProperties ( final SystemProperties config ) { for ( Property property : config . getProperty ( ) ) { String name = property . getName ( ) . trim ( ) ; String value = property . getValue ( ) . trim ( ) ; if ( config . isOverrideProperties ( ) || ( System . getProperty ( name ) == null ) ) { System . set... | Adds properties from the configuration to system properties . |
16,989 | private void addPropertiesFromFile ( final SystemProperties config , final ServletContext context ) { String fileLocation = StringUtils . replaceVariables ( config . getFile ( ) , new HashMap < String , Object > ( ) , true ) ; InputStream inStream = null ; try { inStream = getStreamForLocation ( fileLocation , context ... | Adds properties from the properties file configured in the configuration object . |
16,990 | public Transformer getTransformer ( HttpServletRequest req , ServletTask servletTask , ScreenModel screen ) throws ServletException , IOException { String stylesheet = null ; if ( stylesheet == null ) stylesheet = req . getParameter ( DBParams . TEMPLATE ) ; if ( stylesheet == null ) if ( screen != null ) if ( screen .... | Get or Create a transformer for the specified stylesheet . |
16,991 | public static void sort ( double [ ] data , int rowLength ) { quickSort ( data , 0 , ( data . length - 1 ) / rowLength , rowLength , NATURAL_ROW_COMPARATOR , new double [ rowLength ] , new double [ rowLength ] ) ; } | Sorts rows in 1D array in ascending order comparing each rows column . |
16,992 | public static final < T > boolean contains ( T [ ] array , T item ) { for ( T b : array ) { if ( b . equals ( item ) ) { return true ; } } return false ; } | Returns true if one of arr members equals item |
16,993 | public static final < T > boolean containsOnly ( short [ ] array , T ... items ) { for ( short b : array ) { if ( ! contains ( items , b ) ) { return false ; } } return true ; } | Throws UnsupportedOperationException if one of array members is not one of items |
16,994 | public CatalogMetadataBuilder withTables ( TableMetadata ... tableMetadataList ) { for ( TableMetadata tableMetadata : tableMetadataList ) { tables . put ( tableMetadata . getName ( ) , tableMetadata ) ; } return this ; } | Adds tables to the catalog . |
16,995 | public String getQueueType ( boolean bDefaultIfNone ) { String strQueueType = null ; Record recQueueName = ( ( ReferenceField ) this . getField ( MessageProcessInfo . QUEUE_NAME_ID ) ) . getReference ( ) ; if ( recQueueName != null ) if ( recQueueName . getEditMode ( ) == DBConstants . EDIT_CURRENT ) strQueueType = rec... | Get the queue type for this message process . |
16,996 | public boolean setupMessageHeaderFromCode ( Message trxMessage , String strMessageCode , String strVersion ) { TrxMessageHeader trxMessageHeader = ( TrxMessageHeader ) ( ( BaseMessage ) trxMessage ) . getMessageHeader ( ) ; if ( ( trxMessageHeader == null ) && ( strMessageCode == null ) ) return false ; if ( trxMessage... | SetupMessageHeaderFromCode Method . |
16,997 | public MessageControl getMessageControl ( ) { if ( m_recMessageControl == null ) { RecordOwner recordOwner = this . findRecordOwner ( ) ; m_recMessageControl = new MessageControl ( recordOwner ) ; if ( recordOwner != null ) recordOwner . removeRecord ( m_recMessageControl ) ; this . addListener ( new FreeOnFreeHandler ... | GetMessageControl Method . |
16,998 | public TrxMessageHeader addMessageProperties ( TrxMessageHeader trxMessageHeader ) { Map < String , Object > mapHeaderMessageInfo = trxMessageHeader . getMessageInfoMap ( ) ; Map < String , Object > propMessageProcessInfo = ( ( PropertiesField ) this . getField ( MessageProcessInfo . PROPERTIES ) ) . loadProperties ( )... | AddMessageProperties Method . |
16,999 | public void setDefaultMessageProcessor ( Map < String , Object > mapHeaderMessageInfo ) { if ( mapHeaderMessageInfo . get ( TrxMessageHeader . MESSAGE_PROCESSOR_CLASS ) == null ) { String strMessageInfoTypeCode = ( String ) mapHeaderMessageInfo . get ( TrxMessageHeader . MESSAGE_INFO_TYPE ) ; String strMessageProcessTy... | et the default processor if one is not specified . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.