idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
12,500
private boolean isPresent ( CobolOptionalType optionalType ) { if ( optionalType . getDependingOn ( ) != null ) { return getOdoValue ( optionalType . getDependingOn ( ) ) > 0 ; } return true ; }
Check if an optional type is present .
12,501
public boolean isCustomVariable ( CobolPrimitiveType < ? > type , String name ) { if ( type . isCustomVariable ( ) ) { return true ; } if ( customVariables != null && customVariables . contains ( name ) ) { return true ; } if ( customChoiceStrategy != null && customChoiceStrategy . getVariableNames ( ) != null && custo...
A primitive type is a custom variable if it has been marked as so via one of the available mechanisms or is needed to make choice decisions .
12,502
public String getAuditRepositoryTransport ( ) { String transport = getOption ( AUDITOR_AUDIT_REPOSITORY_TRANSPORT_KEY ) ; return ( transport != null ) ? transport : AUDITOR_AUDIT_REPOSITORY_DEFAULT_TRANSPORT ; }
Get the port of the target audit repository
12,503
public void setAuditRepositoryUri ( URI uri ) { setAuditRepositoryHost ( uri . getHost ( ) ) ; setAuditRepositoryPort ( uri . getPort ( ) ) ; setAuditRepositoryTransport ( uri . getScheme ( ) ) ; }
Set the hostname and port of the target audit repository from a well - formed URI
12,504
public static PIXSourceAuditor getAuditor ( ) { AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( PIXSourceAuditor ) ctx . getAuditor ( PIXSourceAuditor . class ) ; }
Get an instance of the PIX Source Auditor from the global context
12,505
public void auditCreatePatientRecordV3Event ( RFC3881EventOutcomeCodes eventOutcome , String pixManagerUri , String receivingFacility , String receivingApp , String sendingFacility , String sendingApp , String hl7MessageId , String patientId , List < CodedValueType > purposesOfUse , List < CodedValueType > userRoles ) ...
Audits an ITI - 44 Patient Identity Feed CREATE PATIENT RECORD event for Patient Identity Source actors .
12,506
public void auditDeletePatientRecordEvent ( RFC3881EventOutcomeCodes eventOutcome , String pixManagerUri , String receivingFacility , String receivingApp , String sendingFacility , String sendingApp , String hl7MessageControlId , String patientId ) { if ( ! isAuditorEnabled ( ) ) { return ; } auditPatientRecordEvent ( ...
Audits an ITI - 8 Patient Identity Feed DELETE PATIENT RECORD event for Patient Identity Source actors .
12,507
public static NodeAuthModuleContext getContext ( ) { SecurityContext securityContext = SecurityContextFactory . getSecurityContext ( ) ; if ( ! securityContext . isInitialized ( ) ) { securityContext . initialize ( ) ; } AbstractModuleContext moduleContext = securityContext . getModuleContext ( CONTEXT_ID ) ; if ( ! ( ...
Returns the current singleton instance of the Node Authentication Module Context from the ThreadLocal cache . If the ThreadLocal cache has not been initialized or does not contain this context then create and initialize module context register in the ThreadLocal and return the new instance .
12,508
protected AddressArray createAddressArray ( File homeDir , int batchSize , int numSyncBatches , boolean indexesCached ) throws Exception { AddressArrayFactory factory = new AddressArrayFactory ( indexesCached ) ; AddressArray addrArray = factory . createDynamicAddressArray ( homeDir , batchSize , numSyncBatches ) ; ret...
Creates an address array file under the specified home directory .
12,509
protected boolean canSplitOnCapacity ( ) { if ( 0 < _split ) { int splitTo = _levelCapacity + _split ; if ( capacity ( ) > splitTo && splitTo >= _levelCapacity ) { return true ; } } return false ; }
Perform split on the current capacity .
12,510
@ SuppressWarnings ( "unchecked" ) public void load ( File propertiesFile ) throws IOException { String paramName ; String paramValue ; Reader reader = new FileReader ( propertiesFile ) ; _properties . load ( reader ) ; reader . close ( ) ; paramName = StoreParams . PARAM_INDEXES_CACHED ; paramValue = _properties . get...
Loads configuration from a properties file .
12,511
public void validate ( ) throws InvalidStoreConfigException { if ( getSegmentFactory ( ) == null ) { throw new InvalidStoreConfigException ( "Segment factory not found" ) ; } if ( getHashFunction ( ) == null ) { throw new InvalidStoreConfigException ( "Store hash function not found" ) ; } if ( getBatchSize ( ) < StoreP...
Checks the validity of this StoreConfig .
12,512
public boolean setProperty ( String pName , String pValue ) { if ( pName == null ) return false ; _properties . setProperty ( pName , pValue ) ; return true ; }
Sets a store configuration property via its name and value .
12,513
public boolean setClass ( String pName , Class < ? > pValue ) { if ( pName == null ) return false ; _properties . setProperty ( pName , pValue . getName ( ) + "" ) ; return true ; }
Sets a class property via a string property name .
12,514
public int getInt ( String pName , int defaultValue ) { String pValue = _properties . getProperty ( pName ) ; return parseInt ( pName , pValue , defaultValue ) ; }
Gets an integer property via a string property name .
12,515
public float getFloat ( String pName , float defaultValue ) { String pValue = _properties . getProperty ( pName ) ; return parseFloat ( pName , pValue , defaultValue ) ; }
Gets a float property via a string property name .
12,516
public double getDouble ( String pName , double defaultValue ) { String pValue = _properties . getProperty ( pName ) ; return parseDouble ( pName , pValue , defaultValue ) ; }
Gets a double property via a string property name .
12,517
public boolean getBoolean ( String pName , boolean defaultValue ) { String pValue = _properties . getProperty ( pName ) ; return parseBoolean ( pName , pValue , defaultValue ) ; }
Gets a boolean property via a string property name .
12,518
public Class < ? > getClass ( String pName , Class < ? > defaultValue ) { String pValue = _properties . getProperty ( pName ) ; return parseClass ( pName , pValue , defaultValue ) ; }
Gets a class property via a string property name .
12,519
public void setSegmentFactory ( SegmentFactory segmentFactory ) { if ( segmentFactory == null ) { throw new IllegalArgumentException ( "Invalid segmentFactory: " + segmentFactory ) ; } this . _segmentFactory = segmentFactory ; this . _properties . setProperty ( PARAM_SEGMENT_FACTORY_CLASS , segmentFactory . getClass ( ...
Sets the segment factory of the target store .
12,520
public static StoreConfig newInstance ( File filePath ) throws IOException { File homeDir ; Properties p = new Properties ( ) ; if ( filePath . exists ( ) ) { if ( filePath . isDirectory ( ) ) { homeDir = filePath ; File propertiesFile = new File ( filePath , CONFIG_PROPERTIES_FILE ) ; if ( propertiesFile . exists ( ) ...
Creates a new instance of StoreConfig .
12,521
private void setAttributesFromUsage ( final Usage usage ) { switch ( usage ) { case BINARY : _cobolType = CobolTypes . BINARY_ITEM ; _xsdType = XsdType . INTEGER ; break ; case NATIVEBINARY : _cobolType = CobolTypes . NATIVE_BINARY_ITEM ; _xsdType = XsdType . INTEGER ; break ; case SINGLEFLOAT : _cobolType = CobolTypes...
Derive XML schema attributes from a COBOL usage clause . This gives a rough approximation of the XSD type because the picture clause usually carries info that needs to be further analyzed to determine a more precise type . If no usage clause we assume there will be a picture clause .
12,522
public static String getXmlCompatibleCobolName ( final String cobolName ) { if ( cobolName != null && cobolName . length ( ) > 0 && Character . isDigit ( cobolName . charAt ( 0 ) ) ) { return SAFE_NAME_PREFIX + cobolName ; } else { return cobolName ; } }
Transform the COBOL name to a valid XML Name . Does not do any beautification other than strictly complying with XML specifications .
12,523
protected void entryRemoved ( boolean evicted , String key , Bitmap oldValue , Bitmap newValue ) { if ( Utils . hasHoneycomb ( ) ) { addToPool ( oldValue ) ; } else { } }
Notify the removed entry that is no longer being cached
12,524
protected int sizeOf ( String key , Bitmap value ) { final int bitmapSize = BitmapLruPool . getBitmapSize ( value ) ; return bitmapSize == 0 ? 1 : bitmapSize ; }
Measure item size in kilobytes rather than units which is more practical for a bitmap cache
12,525
public void saveHWMark ( long endOfPeriod ) { if ( getHWMark ( ) < endOfPeriod ) { try { set ( 0 , get ( 0 ) , endOfPeriod ) ; } catch ( Exception e ) { _logger . error ( "Failed to saveHWMark " + endOfPeriod , e ) ; } } else if ( 0 < endOfPeriod && endOfPeriod < getLWMark ( ) ) { try { _entryManager . sync ( ) ; } cat...
Sync - up the high water mark to a given value .
12,526
public void addNodeActiveParticipant ( String userId , String altUserId , String userName , String networkId ) { addActiveParticipant ( userId , altUserId , userName , false , null , networkId ) ; }
Add an Active Participant to this message representing the node doing the network entry
12,527
public SearchFeed search ( String query , int limit , int offset ) throws GiphyException { SearchFeed feed = null ; HashMap < String , String > params = new HashMap < String , String > ( ) ; params . put ( "api_key" , apiKey ) ; params . put ( "q" , query ) ; if ( limit > 100 ) { params . put ( "limit" , "100" ) ; } el...
Search all Giphy GIFs for a word or phrase and returns a SearchFeed object .
12,528
public SearchGiphy searchByID ( String id ) throws GiphyException { SearchGiphy giphy = null ; HashMap < String , String > params = new HashMap < String , String > ( ) ; params . put ( "api_key" , apiKey ) ; Request request = new Request ( UrlUtil . buildUrlQuery ( IDEndpoint + id , params ) ) ; try { Response response...
Returns a SerachGiphy object .
12,529
public SearchFeed trendSticker ( ) throws GiphyException { SearchFeed feed = null ; HashMap < String , String > params = new HashMap < String , String > ( ) ; params . put ( "api_key" , apiKey ) ; Request request = new Request ( UrlUtil . buildUrlQuery ( TrendingStickerEndpoint , params ) ) ; try { Response response = ...
Fetch GIFs currently trending online . Hand curated by the Giphy editorial team . The data returned mirrors the GIFs showcased on the Giphy homepage . Returns 25 results by default .
12,530
public SearchRandom searchRandomSticker ( String tag ) throws GiphyException { SearchRandom random = null ; HashMap < String , String > params = new HashMap < String , String > ( ) ; params . put ( "api_key" , apiKey ) ; params . put ( "tag" , tag ) ; Request request = new Request ( UrlUtil . buildUrlQuery ( RandomEndp...
Returns a random GIF limited by tag .
12,531
private static int getResizedDimension ( int maxPrimary , int maxSecondary , int actualPrimary , int actualSecondary , ScaleType scaleType ) { if ( ( maxPrimary == 0 ) && ( maxSecondary == 0 ) ) { return actualPrimary ; } if ( scaleType == ScaleType . FIT_XY ) { if ( maxPrimary == 0 ) { return actualPrimary ; } return ...
Scales one side of a rectangle to fit aspect ratio .
12,532
protected boolean isValidString ( CobolContext cobolContext , byte [ ] hostData , int start ) { int length = start + getBytesLen ( ) ; for ( int i = start ; i < length ; i ++ ) { int code = hostData [ i ] & 0xFF ; if ( code != 0 && code < cobolContext . getHostSpaceCharCode ( ) ) { return false ; } } return true ; }
Relatively naive implementation that assumes content is either low - value or a code point greater or equal to the space character .
12,533
private FromHostPrimitiveResult < String > fromHostString ( CobolContext cobolContext , byte [ ] hostData , int start , int bytesLen ) { int spaceCode = cobolContext . getHostSpaceCharCode ( ) ; boolean checkSpace = cobolContext . isTruncateHostStringsTrailingSpaces ( ) ; int end = start + bytesLen ; while ( end > star...
Convert host data to a java String .
12,534
public final static DataReader createDataReader ( File file , IOType type ) { if ( type == IOType . MAPPED ) { if ( file . length ( ) <= Integer . MAX_VALUE ) { return new MappedReader ( file ) ; } else { return new MultiMappedReader ( file ) ; } } else { return new ChannelReader ( file ) ; } }
Creates a new DataReader to read from a file .
12,535
public final static DataWriter createDataWriter ( File file , IOType type ) { if ( type == IOType . MAPPED ) { if ( file . length ( ) <= Integer . MAX_VALUE ) { return new MappedWriter ( file ) ; } else { return new MultiMappedWriter ( file ) ; } } else { return new ChannelWriter ( file ) ; } }
Creates a new DataWriter to write to a file .
12,536
public static XDSConsumerAuditor getAuditor ( ) { AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( XDSConsumerAuditor ) ctx . getAuditor ( XDSConsumerAuditor . class ) ; }
Get an instance of the XDS Document Consumer Auditor from the global context
12,537
public void auditRegistryQueryEvent ( RFC3881EventOutcomeCodes eventOutcome , String registryEndpointUri , String consumerUserName , String adhocQueryRequestPayload , String patientId ) { if ( ! isAuditorEnabled ( ) ) { return ; } auditQueryEvent ( true , new IHETransactionEventTypeCodes . RegistrySQLQuery ( ) , eventO...
Audits an ITI - 16 Registry Query event for XDS . a Document Consumer actors .
12,538
public void auditRegistryStoredQueryEvent ( RFC3881EventOutcomeCodes eventOutcome , String registryEndpointUri , String consumerUserName , String storedQueryUUID , String adhocQueryRequestPayload , String homeCommunityId , String patientId , List < CodedValueType > purposesOfUse , List < CodedValueType > userRoles ) { ...
Audits an ITI - 18 Registry Stored Query event for XDS . a and XDS . b Document Consumer actors .
12,539
public void auditRetrieveDocumentEvent ( RFC3881EventOutcomeCodes eventOutcome , String repositoryRetrieveUri , String userName , String documentUniqueId , String patientId ) { if ( ! isAuditorEnabled ( ) ) { return ; } ImportEvent importEvent = new ImportEvent ( false , eventOutcome , new IHETransactionEventTypeCodes ...
Audits an ITI - 17 Retrieve Document event for XDS . a Document Consumer actors .
12,540
public void auditRetrieveDocumentSetEvent ( RFC3881EventOutcomeCodes eventOutcome , String repositoryEndpointUri , String userName , String [ ] documentUniqueIds , String repositoryUniqueId , String homeCommunityId , String patientId , List < CodedValueType > purposesOfUse , List < CodedValueType > userRoles ) { if ( !...
Audits an ITI - 43 Retrieve Document Set event for XDS . b Document Consumer actors . Sends audit messages for situations when exactly one repository and zero or one community are specified in the transaction .
12,541
public void auditRetrieveDocumentSetEvent ( RFC3881EventOutcomeCodes eventOutcome , String repositoryEndpointUri , String userName , String [ ] documentUniqueIds , String [ ] repositoryUniqueIds , String [ ] homeCommunityIds , String patientId , List < CodedValueType > purposesOfUse , List < CodedValueType > userRoles ...
Audits an ITI - 43 Retrieve Document Set event for XDS . b Document Consumer actors . Sends audit messages for situations when more than one repository and more than one community are specified in the transaction .
12,542
public void addAccessingParticipant ( String userId , String altUserId , String userName , String networkId ) { addActiveParticipant ( userId , altUserId , userName , true , null , networkId ) ; }
Adds the Active Participant of the User or System that accessed the log
12,543
public void addAuditLogIdentity ( String auditLogUri ) { addParticipantObjectIdentification ( new RFC3881ParticipantObjectCodes . RFC3881ParticipantObjectIDTypeCodes . URI ( ) , "Security Audit Log" , null , null , auditLogUri , RFC3881ParticipantObjectTypeCodes . SYSTEM , RFC3881ParticipantObjectTypeRoleCodes . SECURI...
Adds the Participant Object block representing the audit log accessed
12,544
public static XDSRepositoryAuditor getAuditor ( ) { AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( XDSRepositoryAuditor ) ctx . getAuditor ( XDSRepositoryAuditor . class ) ; }
Get an instance of the XDS Document Repository Auditor from the global context
12,545
public void auditRegisterDocumentSetEvent ( RFC3881EventOutcomeCodes eventOutcome , String repositoryUserId , String userName , String registryEndpointUri , String submissionSetUniqueId , String patientId ) { if ( ! isAuditorEnabled ( ) ) { return ; } auditRegisterEvent ( new IHETransactionEventTypeCodes . RegisterDocu...
Audits an ITI - 14 Register Document Set event for XDS . a Document Repository actors .
12,546
public void auditRegisterDocumentSetBEvent ( RFC3881EventOutcomeCodes eventOutcome , String repositoryUserId , String userName , String registryEndpointUri , String submissionSetUniqueId , String patientId , List < CodedValueType > purposesOfUse , List < CodedValueType > userRoles ) { if ( ! isAuditorEnabled ( ) ) { re...
Audits an ITI - 42 Register Document Set - b event for XDS . b Document Repository actors .
12,547
public void auditRetrieveDocumentEvent ( RFC3881EventOutcomeCodes eventOutcome , String consumerIpAddress , String userName , String repositoryRetrieveUri , String documentUniqueId ) { if ( ! isAuditorEnabled ( ) ) { return ; } ExportEvent exportEvent = new ExportEvent ( true , eventOutcome , new IHETransactionEventTyp...
Audits an ITI - 17 Retrieve Document event for XDS . a Document Repository actors .
12,548
public void auditRetrieveDocumentSetEvent ( RFC3881EventOutcomeCodes eventOutcome , String consumerUserId , String consumerUserName , String consumerIpAddress , String repositoryEndpointUri , String [ ] documentUniqueIds , String repositoryUniqueId , String homeCommunityId , List < CodedValueType > purposesOfUse , List...
Audits an ITI - 43 Retrieve Document Set - b event for XDS . b Document Repository actors . Sends audit messages for situations when exactly one repository and zero or one community are specified in the transaction .
12,549
public void auditRetrieveDocumentSetEvent ( RFC3881EventOutcomeCodes eventOutcome , String consumerUserId , String consumerUserName , String consumerIpAddress , String repositoryEndpointUri , String [ ] documentUniqueIds , String [ ] repositoryUniqueIds , String [ ] homeCommunityIds , List < CodedValueType > purposesOf...
Audits an ITI - 43 Retrieve Document Set - b event for XDS . b Document Repository actors . Sends audit messages for situations when more than one repository and more than one community are specified in the transaction .
12,550
protected void auditProvideAndRegisterEvent ( IHETransactionEventTypeCodes transaction , RFC3881EventOutcomeCodes eventOutcome , String sourceUserId , String sourceIpAddress , String userName , String repositoryEndpointUri , String submissionSetUniqueId , String patientId , List < CodedValueType > purposesOfUse , List ...
Generically sends audit messages for XDS Document Repository Provide And Register Document Set events
12,551
public final int getLiveSegmentCount ( ) { int num = 0 ; for ( int i = 0 ; i < _segList . size ( ) ; i ++ ) { if ( _segList . get ( i ) != null ) num ++ ; } return num ; }
Gets the count of live segments managed by this SegmentManager .
12,552
public synchronized boolean freeSegment ( Segment seg ) throws IOException { if ( seg == null ) return false ; int segId = seg . getSegmentId ( ) ; if ( segId < _segList . size ( ) && _segList . get ( segId ) == seg ) { _segList . set ( segId , null ) ; seg . close ( false ) ; if ( segId == ( _segList . size ( ) - 1 ) ...
Frees the specified segment .
12,553
public synchronized Segment nextSegment ( ) throws IOException { Segment seg = nextSegment ( false ) ; File sibFile = getSegmentIndexBufferFile ( seg . getSegmentId ( ) ) ; if ( sibFile . exists ( ) ) { sibFile . delete ( ) ; } return seg ; }
Opens the next segment available for read and write .
12,554
public void flushSegmentIndexBuffers ( ) { SegmentIndexBuffer sib = null ; while ( ( sib = _sibManager . poll ( ) ) != null ) { File sibFile = getSegmentIndexBufferFile ( sib . getSegmentId ( ) ) ; try { _sibManager . getSegmentIndexBufferIO ( ) . write ( sib , sibFile ) ; } catch ( Exception e ) { _log . warn ( "faile...
Flushes accumulated segment index buffers to disk .
12,555
private Segment nextSegment ( boolean newOnly ) throws IOException { int index ; Segment seg ; if ( newOnly ) { index = _segList . size ( ) ; } else { if ( _recycleList . size ( ) > 0 ) { seg = _recycleList . remove ( ) ; seg . reinit ( ) ; _segList . set ( seg . getSegmentId ( ) , seg ) ; _log . info ( "reinit Segment...
Gets the next segment available for read and write .
12,556
private void initSegs ( ) throws IOException { int loaded = 0 ; File [ ] segFiles = listSegmentFiles ( ) ; if ( segFiles . length == 0 ) { return ; } try { for ( int i = 0 ; i < segFiles . length ; i ++ ) { File segFile = segFiles [ i ] ; int segId = Integer . parseInt ( segFile . getName ( ) . substring ( 0 , segFile ...
Initializes the segments managed by this SegmentManager
12,557
private void clearInternal ( boolean clearMeta ) { for ( int segId = 0 , cnt = _segList . size ( ) ; segId < cnt ; segId ++ ) { Segment seg = _segList . get ( segId ) ; if ( seg != null ) { try { if ( seg . getMode ( ) == Segment . Mode . READ_WRITE ) { seg . force ( ) ; } seg . close ( false ) ; } catch ( IOException ...
Clears this SegmentManager .
12,558
protected File [ ] listSegmentFiles ( ) { File segDir = new File ( _segHomePath ) ; File [ ] segFiles = segDir . listFiles ( new FileFilter ( ) { public boolean accept ( File filePath ) { String fileName = filePath . getName ( ) ; if ( fileName . matches ( "^[0-9]+\\.seg$" ) ) { return true ; } return false ; } } ) ; i...
Lists all the segment files managed by this SegmentManager .
12,559
private CharSequence hashContext ( final Object context , final Options options ) throws IOException { Set < Entry < String , Object > > propertySet = options . propertySet ( context ) ; StringBuilder buffer = new StringBuilder ( ) ; Context parent = options . context ; boolean first = true ; for ( Entry < String , Obj...
Iterate over a hash like object .
12,560
private CharSequence iterableContext ( final Iterable < Object > context , final Options options ) throws IOException { StringBuilder buffer = new StringBuilder ( ) ; if ( options . isFalsy ( context ) ) { buffer . append ( options . inverse ( ) ) ; } else { Iterator < Object > iterator = context . iterator ( ) ; int i...
Iterate over an iterable object .
12,561
protected synchronized void switchEntry ( boolean blocking ) throws IOException { if ( ! _entryCompaction . isEmpty ( ) ) { File file = new File ( getDirectory ( ) , getEntryLogName ( _entryCompaction ) ) ; _entryCompaction . save ( file ) ; _entryPool . addToServiceQueue ( _entryCompaction ) ; _entryCompaction = _entr...
Switches to a new entry if the current _entry is not empty .
12,562
protected synchronized void applyEntries ( boolean blocking ) throws IOException { if ( blocking ) { synchronized ( _entryApply ) { List < Entry < V > > entryList = new ArrayList < Entry < V > > ( ) ; while ( _entryPool . getServiceQueueSize ( ) > 0 ) { Entry < V > entry = _entryPool . pollFromService ( ) ; if ( entry ...
Apply accumulated entries to the array file .
12,563
protected List < Entry < V > > loadEntryFiles ( ) { File [ ] files = getDirectory ( ) . listFiles ( ) ; String prefix = getEntryLogPrefix ( ) ; String suffix = getEntryLogSuffix ( ) ; List < Entry < V > > entryList = new ArrayList < Entry < V > > ( ) ; if ( files == null ) return entryList ; for ( File file : files ) {...
Load entry log files from disk into _entryList .
12,564
private List < Entry < V > > filterEntryList ( List < Entry < V > > entryList , long minScn , long maxScn ) { List < Entry < V > > result = new ArrayList < Entry < V > > ( entryList . size ( ) ) ; for ( Entry < V > e : entryList ) { if ( minScn <= e . getMinScn ( ) && e . getMaxScn ( ) <= maxScn ) { result . add ( e ) ...
Filter and select entries from an entry list that only have SCNs no less than the specified lower bound minScn and that only have SCNs no greater than the specified upper bound maxScn .
12,565
private List < Entry < V > > filterEntryListLowerBound ( List < Entry < V > > entryList , long scn ) { List < Entry < V > > result = new ArrayList < Entry < V > > ( entryList . size ( ) ) ; for ( Entry < V > e : entryList ) { if ( scn <= e . getMinScn ( ) ) { result . add ( e ) ; } } return result ; }
Filter and select entries from an entry list that only have SCNs no less than the specified lower bound .
12,566
@ SuppressWarnings ( "unused" ) private List < Entry < V > > filterEntryListUpperBound ( List < Entry < V > > entryList , long scn ) { List < Entry < V > > result = new ArrayList < Entry < V > > ( entryList . size ( ) ) ; for ( Entry < V > e : entryList ) { if ( e . getMaxScn ( ) <= scn ) { result . add ( e ) ; } } ret...
Filter and select entries from an entry list that only have SCNs no greater than the specified upper bound .
12,567
protected void execute ( final File input , final String cobolFileEncoding , final File target , final String targetNamespacePrefix , final String xsltFileName ) throws XsdGenerationException { try { _log . info ( "Started translation from COBOL to XML Schema" ) ; _log . info ( "Taking COBOL from : " + input ...
Translate a single file or all files from an input folder . Place results in the output folder .
12,568
protected String getVersion ( ) throws IOException { InputStream stream = null ; try { Properties version = new Properties ( ) ; stream = Cob2XsdMain . class . getResourceAsStream ( VERSION_FILE_NAME ) ; version . load ( stream ) ; return version . getProperty ( "version" ) ; } finally { if ( stream != null ) { stream ...
Pick up the version from the properties file .
12,569
public void setConfigFile ( final String config ) { if ( config == null ) { throw ( new IllegalArgumentException ( "Configuration file parameter is null" ) ) ; } File file = new File ( config ) ; if ( file . exists ( ) ) { if ( file . isDirectory ( ) ) { throw new IllegalArgumentException ( "Folder " + config + " is no...
Check the config parameter and keep it only if it is valid .
12,570
public static PIXConsumerAuditor getAuditor ( ) { AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( PIXConsumerAuditor ) ctx . getAuditor ( PIXConsumerAuditor . class ) ; }
Get an instance of the PIX Consumer Auditor from the global context
12,571
private static String buildMessage ( String format , Object ... args ) { String msg = ( args == null ) ? format : String . format ( Locale . US , format , args ) ; StackTraceElement [ ] trace = new Throwable ( ) . fillInStackTrace ( ) . getStackTrace ( ) ; String caller = "<unknown>" ; for ( int i = 2 ; i < trace . len...
Formats the caller s provided message and prepends useful info like calling thread ID and method name .
12,572
public V get ( K key ) { if ( key == null ) { return null ; } byte [ ] bytes = _store . get ( _keySerializer . serialize ( key ) ) ; return bytes == null ? null : _valSerializer . deserialize ( bytes ) ; }
Gets an object based on its key from the store .
12,573
public byte [ ] getBytes ( K key ) { if ( key == null ) { return null ; } return _store . get ( _keySerializer . serialize ( key ) ) ; }
Gets an object in the form of byte array from the store .
12,574
public boolean put ( K key , V value ) throws Exception { if ( key == null ) { throw new NullPointerException ( "key" ) ; } if ( value == null ) { return _store . delete ( _keySerializer . serialize ( key ) ) ; } else { return _store . put ( _keySerializer . serialize ( key ) , _valSerializer . serialize ( value ) ) ; ...
Puts an serializable object into the store .
12,575
public boolean delete ( K key ) throws Exception { if ( key == null ) { throw new NullPointerException ( "key" ) ; } return _store . delete ( _keySerializer . serialize ( key ) ) ; }
Deletes an object from the store based on its key .
12,576
public < R extends Request < T > > R setRetryPolicy ( RetryPolicy retryPolicy ) { checkIfActive ( ) ; this . retryPolicy = retryPolicy ; return ( R ) this ; }
Sets the retry policy for this request .
12,577
public < R extends Request < T > > R setRedirectPolicy ( RedirectPolicy redirectPolicy ) { checkIfActive ( ) ; this . redirectPolicy = redirectPolicy ; return ( R ) this ; }
Sets the redirect policy for this request .
12,578
< R extends Request < T > > R setRequestQueue ( RequestQueue requestQueue ) { checkIfActive ( ) ; java . lang . reflect . Method m = null ; if ( ! ( this . getClass ( ) . equals ( Request . class ) ) ) { try { m = this . getClass ( ) . getDeclaredMethod ( "parseNetworkResponse" , NetworkResponse . class ) ; } catch ( N...
Associates this request with the given queue . The request queue will be notified when this request has finished .
12,579
public < R extends Request < T > > R setCacheEntry ( Cache . Entry entry ) { cacheEntry = entry ; return ( R ) this ; }
Annotates this request with an entry retrieved for it from cache . Used for cache coherency support .
12,580
public final Map < String , String > getHeadersMap ( ) { if ( networkRequest != null && networkRequest . headers != null ) { return networkRequest . headers . toMap ( ) ; } return Collections . emptyMap ( ) ; }
Returns a list of extra HTTP headers to go along with this request
12,581
public String getBodyContentType ( ) { if ( networkRequest != null && networkRequest . contentType != null ) { return networkRequest . contentType . toString ( ) ; } return null ; }
Returns the content type of the POST or PUT body .
12,582
public final < R extends Request < T > > R setShouldCache ( boolean shouldCache ) { checkIfActive ( ) ; this . shouldCache = shouldCache ; return ( R ) this ; }
Set whether or not responses to this request should be cached .
12,583
protected Response < T > parseNetworkResponse ( NetworkResponse response ) { T parsed = null ; try { parsed = converterFromResponse . convert ( response ) ; } catch ( Exception e ) { return Response . error ( new ParseError ( e ) ) ; } return Response . success ( parsed , HttpHeaderParser . parseCacheHeaders ( response...
Subclasses can implement this to parse the raw network response and return an appropriate response type . This method will be called from a worker threadId . The response will not be delivered if you return null .
12,584
protected void deliverResponse ( T response ) { synchronized ( responseListeners ) { for ( RequestListener . ResponseListener responseListener : responseListeners ) { responseListener . onResponse ( response ) ; } if ( ! this . response . intermediate ) { responseListeners . clear ( ) ; } } if ( ! this . response . int...
Subclasses must implement this to perform delivery of the parsed response to their listeners . The given response is guaranteed to be non - null ; responses that fail to parse are not delivered .
12,585
public void deliverError ( JusError error ) { synchronized ( errorListeners ) { for ( RequestListener . ErrorListener errorListener : errorListeners ) { errorListener . onError ( error ) ; } errorListeners . clear ( ) ; } synchronized ( responseListeners ) { responseListeners . clear ( ) ; } }
Delivers error message to the ErrorListener that the Request was initialized with .
12,586
public int compareTo ( Request < T > other ) { Priority left = this . getPriority ( ) ; Priority right = other . getPriority ( ) ; return left == right ? this . sequence - other . sequence : right . ordinal ( ) - left . ordinal ( ) ; }
Our comparator sorts from high to low priority and secondarily by sequence number to provide FIFO ordering .
12,587
public String getSystemAltUserId ( ) { if ( ! EventUtils . isEmptyOrNull ( systemAltUserId ) ) { return systemAltUserId ; } systemAltUserId = getConfig ( ) . getSystemAltUserId ( ) ; if ( ! EventUtils . isEmptyOrNull ( systemAltUserId ) ) { return systemAltUserId ; } String processId = null ; try { RuntimeMXBean mx = M...
Get alternate user id for the system s ActiveParticipant in audit messages . This is either set in configuration or the the auditor will attempt to determine it from the JVM s process id .
12,588
public String getSystemNetworkId ( ) { String ipAddress = getConfig ( ) . getSystemIpAddress ( ) ; if ( ! EventUtils . isEmptyOrNull ( ipAddress ) ) { return ipAddress ; } if ( EventUtils . isEmptyOrNull ( systemNetworkAccessPointId ) ) { try { InetAddress localAddress = InetAddress . getLocalHost ( ) ; systemNetworkAc...
Get the system s ActiveParticipant Network ID for use in audit messages . Configuration is the default value used . If no value is set in configuration then Java will attempt to determine your system s IP address . If Java cannot determine your system s IP address then localhost is used .
12,589
public boolean isAuditorEnabled ( ) { if ( ! getConfig ( ) . isAuditorEnabled ( ) ) { return false ; } if ( getConfig ( ) . getDisabledAuditors ( ) . contains ( this . getClass ( ) ) ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Auditor " + this . getClass ( ) . getName ( ) + " is disabled by configuration...
Determines whether this auditor instance is enabled . Checks if global auditing is enabled in configuration and if the auditor instance s class is in the list of auditors specifically disabled by configuration
12,590
public boolean isAuditorEnabledForEventId ( AuditEventMessage msg ) { CodedValueType eventIdCode = msg . getAuditMessage ( ) . getEventIdentification ( ) . getEventID ( ) ; if ( EventUtils . containsCode ( eventIdCode , getConfig ( ) . getDisabledEvents ( ) ) ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "A...
Determines if the event that this audit message represents should be audited or if the auditor is disabled by configuration . Examples of events that may be disabled include Export Import Patient Record Security Alert etc .
12,591
public void auditUserAuthenticationLoginEvent ( RFC3881EventOutcomeCodes outcome , boolean isAuthenticatedSystem , String remoteUserId , String remoteIpAddress , String remoteUserNodeIpAddress ) { auditUserAuthenticationEvent ( outcome , new DICOMEventTypeCodes . Login ( ) , isAuthenticatedSystem , remoteUserId , remot...
Audit a User Authentication - Login Event
12,592
public void auditUserAuthenticationLogoutEvent ( RFC3881EventOutcomeCodes outcome , boolean isAuthenticatedSystem , String remoteUserId , String remoteIpAddress , String remoteUserNodeIpAddress ) { auditUserAuthenticationEvent ( outcome , new DICOMEventTypeCodes . Logout ( ) , isAuthenticatedSystem , remoteUserId , rem...
Audit a User Authentication - Logout Event
12,593
private void addField ( int fieldIndex , XmlSchemaObjectBase xsdSchemaObject , Map < String , Object > fields , RootCompositeType compositeTypes ) { if ( xsdSchemaObject instanceof XmlSchemaElement ) { XmlSchemaElement xsdElement = ( XmlSchemaElement ) xsdSchemaObject ; fields . put ( getFieldName ( xsdElement ) , getP...
Add a field with associated properties to a complex type .
12,594
private void addOptionalProps ( XmlSchemaElement xsdElement , CobolAnnotations cobolAnnotations , Map < String , Object > props ) { String dependingOn = cobolAnnotations . getDependingOn ( ) ; if ( dependingOn != null ) { props . put ( IS_OPTIONAL_PROP_NAME , true ) ; props . put ( DEPENDING_ON_PROP_NAME , odoObjectNam...
Optional items are declared with a minOccurs of 0 and a maxOccurs of one . Usually there is a depending on clause .
12,595
private Map < String , Object > getProps ( XmlSchemaSimpleType xsdSimpleType , final CobolAnnotations cobolAnnotations ) { XmlSchemaSimpleTypeRestriction restriction = ( XmlSchemaSimpleTypeRestriction ) xsdSimpleType . getContent ( ) ; if ( restriction != null && restriction . getBaseTypeName ( ) != null ) { QName xsdT...
Retrieve the properties of a primitive type .
12,596
private < T extends Number > Map < String , Object > getCobolAlphanumType ( List < XmlSchemaFacet > facets ) { Map < String , Object > props = new LinkedHashMap < String , Object > ( ) ; props . put ( COBOL_TYPE_NAME_PROP_NAME , "CobolStringType" ) ; props . put ( CHAR_NUM_PROP_NAME , getMaxLength ( facets ) ) ; props ...
Retrieve the properties of an alphanumeric type .
12,597
private int getMaxLength ( List < XmlSchemaFacet > facets ) { for ( XmlSchemaFacet facet : facets ) { if ( facet instanceof XmlSchemaMaxLengthFacet ) { return Integer . parseInt ( ( String ) ( ( XmlSchemaMaxLengthFacet ) facet ) . getValue ( ) ) ; } } return - 1 ; }
Retrieve the maxLength facet if it exists .
12,598
private < T extends Number > Map < String , Object > getCobolDecimalType ( CobolAnnotations cobolAnnotations , Class < T > clazz ) { String cobolType = cobolAnnotations . getCobolType ( ) ; Map < String , Object > props = new LinkedHashMap < String , Object > ( ) ; switch ( CobolTypes . valueOf ( cobolType ) ) { case Z...
Retrieve the properties of a decimal type .
12,599
private static String getShortTypeName ( Class < ? > javaType ) { String javaTypeName = javaType . getName ( ) ; if ( javaTypeName . startsWith ( "java.lang." ) ) { return javaTypeName . substring ( "java.lang." . length ( ) ) ; } else { return javaTypeName ; } }
For java . lang types strips the package which is not needed in generated java classes .