idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
136,300
public short [ ] loadShortArray ( ) throws IOException { if ( ! _file . exists ( ) || _file . length ( ) == 0 ) { return null ; } Chronos c = new Chronos ( ) ; DataReader r = IOFactory . createDataReader ( _file , _type ) ; try { r . open ( ) ; r . position ( DATA_START_POSITION ) ; short [ ] array = new short [ _array...
Loads the main array .
136,301
public synchronized < T extends EntryValue > void update ( List < Entry < T > > entryList ) throws IOException { Chronos c = new Chronos ( ) ; T [ ] values = EntryUtility . sortEntriesToValues ( entryList ) ; if ( values == null || values . length == 0 ) return ; long maxScn = _arrayHwmScn ; for ( Entry < ? > e : entry...
Apply entries to the array file .
136,302
public void setWaterMarks ( long lwmScn , long hwmScn ) throws IOException { if ( lwmScn <= hwmScn ) { writeHwmScn ( hwmScn ) ; _writer . flush ( ) ; writeLwmScn ( lwmScn ) ; _writer . flush ( ) ; } else { throw new IOException ( "Invalid water marks: lwmScn=" + lwmScn + " hwmScn=" + hwmScn ) ; } }
Sets the water marks of this ArrayFile .
136,303
public synchronized void resetAll ( long value ) throws IOException { if ( _elementSize != 8 ) { throw new IOException ( "Operation aborted: elementSize=" + _elementSize ) ; } _writer . flush ( ) ; _writer . position ( DATA_START_POSITION ) ; for ( int i = 0 ; i < this . _arrayLength ; i ++ ) { _writer . writeLong ( va...
Resets all element values to the specified long value .
136,304
public synchronized void setArrayLength ( int arrayLength , File renameToFile ) throws IOException { if ( arrayLength < 0 ) { throw new IOException ( "Invalid array length: " + arrayLength ) ; } if ( this . _arrayLength == arrayLength ) return ; this . flush ( ) ; long fileLength = DATA_START_POSITION + ( ( long ) arra...
Updates the length of this ArrayFile to the specified value .
136,305
public static Usage getUsage ( String cobolUsage ) { if ( cobolUsage == null ) { return null ; } if ( cobolUsage . equals ( BINARY ) ) { return Usage . BINARY ; } else if ( cobolUsage . equals ( "COMP" ) ) { return Usage . BINARY ; } else if ( cobolUsage . equals ( "COMPUTATIONAL" ) ) { return Usage . BINARY ; } else i...
Get the java enumeration corresponding to a COBOL usage string .
136,306
public static XDMAuditor getAuditor ( ) { AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( XDMAuditor ) ctx . getAuditor ( XDMAuditor . class ) ; }
Get an instance of the XDM auditor from the global context
136,307
public void auditPortableMediaImport ( RFC3881EventOutcomeCodes eventOutcome , String submissionSetUniqueId , String patientId , List < CodedValueType > purposesOfUse ) { if ( ! isAuditorEnabled ( ) ) { return ; } ImportEvent importEvent = new ImportEvent ( false , eventOutcome , new IHETransactionEventTypeCodes . Dist...
Audits a PHI Import event for the IHE XDM Portable Media Importer actor and ITI - 32 Distribute Document Set on Media Transaction .
136,308
public void auditPortableMediaCreate ( RFC3881EventOutcomeCodes eventOutcome , String submissionSetUniqueId , String patientId , List < CodedValueType > purposesOfUse ) { if ( ! isAuditorEnabled ( ) ) { return ; } ExportEvent exportEvent = new ExportEvent ( true , eventOutcome , new IHETransactionEventTypeCodes . Distr...
Audits a PHI Export event for the IHE XDM Portable Media Creator actor ITI - 32 Distribute Document Set on Media transaction .
136,309
public long tick ( ) { long tick = System . currentTimeMillis ( ) ; long diff = tick - _lastTick ; _lastTick = tick ; return diff ; }
Returns the number of milliseconds elapsed since the last call to this function .
136,310
public String translate ( final Reader cobolReader , final String targetNamespace , final String xsltFileName ) throws XsdGenerationException { try { if ( _log . isDebugEnabled ( ) ) { _log . debug ( "Translating with options: {}" , getConfig ( ) . toString ( ) ) ; _log . debug ( "Target namespace: {}" , targetNamespac...
Execute the translation from COBOL to XML Schema .
136,311
public List < CobolDataItem > toModel ( final Reader cobolReader ) throws RecognizerException { return emitModel ( parse ( lex ( clean ( cobolReader ) ) ) ) ; }
Parses a COBOL source into an in - memory model .
136,312
public String clean ( final Reader cobolReader ) throws CleanerException { if ( _log . isDebugEnabled ( ) ) { _log . debug ( "1. Cleaning COBOL source code" ) ; } switch ( getConfig ( ) . getCodeFormat ( ) ) { case FIXED_FORMAT : CobolFixedFormatSourceCleaner fixedCleaner = new CobolFixedFormatSourceCleaner ( getErrorH...
Remove any non COBOL Structure characters from the source .
136,313
public CommonTokenStream lex ( final String cleanedCobolSource ) throws RecognizerException { if ( _log . isDebugEnabled ( ) ) { _log . debug ( "2. Lexing COBOL source code: {}" , cleanedCobolSource ) ; } try { CobolStructureLexer lex = new CobolStructureLexerImpl ( new ANTLRReaderStream ( new StringReader ( cleanedCob...
Apply the lexer to produce a token stream from source .
136,314
public CommonTree parse ( final CommonTokenStream tokens ) throws RecognizerException { if ( _log . isDebugEnabled ( ) ) { _log . debug ( "3. Parsing tokens: {}" , tokens . toString ( ) ) ; } try { CobolStructureParser parser = new CobolStructureParserImpl ( tokens , getErrorHandler ( ) ) ; cobdata_return parserResult ...
Apply Parser to produce an abstract syntax tree from a token stream .
136,315
public List < CobolDataItem > emitModel ( final CommonTree ast ) throws RecognizerException { List < CobolDataItem > cobolDataItems = new ArrayList < CobolDataItem > ( ) ; if ( _log . isDebugEnabled ( ) ) { _log . debug ( "4. Emitting Model from AST: {}" , ( ( ast == null ) ? "null" : ast . toStringTree ( ) ) ) ; } if ...
Generates a model from an Abstract Syntax Tree .
136,316
public static List < String > getNonUniqueCobolNames ( final List < CobolDataItem > cobolDataItems ) { List < String > cobolNames = new ArrayList < String > ( ) ; List < String > nonUniqueCobolNames = new ArrayList < String > ( ) ; for ( CobolDataItem cobolDataItem : cobolDataItems ) { getNonUniqueCobolNames ( cobolDat...
Create a list of COBOL names which are not unique . This is useful when we build complex type names from the COBOL names . Complex type names need to be unique within a target namespace .
136,317
private Socket getTLSSocket ( InetAddress destination , int port ) throws Exception { String key = destination . getHostAddress ( ) + ":" + port ; synchronized ( socketMap ) { Socket socket = socketMap . get ( key ) ; if ( socket == null ) { NodeAuthModuleContext nodeAuthContext = NodeAuthModuleContext . getContext ( )...
Gets the socket tied to the address and port for this transport
136,318
public synchronized void clear ( ) { File [ ] files = mRootDirectory . listFiles ( ) ; if ( files != null ) { for ( File file : files ) { file . delete ( ) ; } } mEntries . clear ( ) ; mTotalSize = 0 ; }
Clears the cache . Deletes all cached files from disk .
136,319
public synchronized Entry get ( String key ) { CacheHeader entry = mEntries . get ( key ) ; if ( entry == null ) { return null ; } File file = getFileForKey ( key ) ; CountingInputStream cis = null ; try { cis = new CountingInputStream ( new BufferedInputStream ( new FileInputStream ( file ) ) ) ; CacheHeader . readHea...
Returns the cache entry with the specified key if it exists null otherwise .
136,320
public synchronized void initialize ( ) { if ( ! mRootDirectory . exists ( ) ) { if ( ! mRootDirectory . mkdirs ( ) ) { throw new IllegalStateException ( "Unable to create cache dir: " + mRootDirectory . getAbsolutePath ( ) ) ; } return ; } File [ ] files = mRootDirectory . listFiles ( ) ; if ( files == null ) { return...
Initializes the DiskBasedCache by scanning for all files currently in the specified root directory . Creates the root directory if necessary .
136,321
public MultipartBuilder addPart ( NetworkRequest part ) { if ( part == null ) { throw new NullPointerException ( "part == null" ) ; } parts . add ( part ) ; return this ; }
Add a part to the body .
136,322
public NetworkRequest build ( ) { if ( parts . isEmpty ( ) ) { throw new IllegalStateException ( "Multipart body must have at least one part." ) ; } MultipartRequest mrb = new MultipartRequest ( type , boundary , parts ) ; Buffer bb = new Buffer ( ) ; try { mrb . writeOrCountBytes ( bb , false ) ; } catch ( IOException...
Assemble the specified parts into a request body .
136,323
protected void addNamespaceContext ( ) { NamespaceMap prefixmap = new NamespaceMap ( ) ; NamespacePrefixList npl = getXsd ( ) . getNamespaceContext ( ) ; if ( npl == null ) { prefixmap . add ( "" , XMLConstants . W3C_XML_SCHEMA_NS_URI ) ; } else { for ( int i = 0 ; i < npl . getDeclaredPrefixes ( ) . length ; i ++ ) { ...
Adds the COXB namespace and associated prefixes to the XML schema .
136,324
public static String getErrorMessage ( final Logger log , final BaseRecognizer recognizer , final RecognitionException e , final String superMessage , final String [ ] tokenNames ) { if ( log . isDebugEnabled ( ) ) { List < ? > stack = BaseRecognizer . getRuleInvocationStack ( e , recognizer . getClass ( ) . getSupercl...
Format an error message as expected by ANTLR . It is basically the same error message that ANTL BaseRecognizer generates with some additional data . Also used to log debugging information .
136,325
public static String makeUserMsg ( final RecognitionException e , final String msg ) { if ( e instanceof NoViableAltException ) { return msg . replace ( "no viable alternative at" , "unrecognized" ) ; } else if ( e instanceof UnwantedTokenException ) { return msg . replace ( "extraneous input" , "unexpected token" ) ; ...
Simplify error message text for end users .
136,326
protected void initIndexPersistableListener ( ) { _index . setPersistableListener ( new PersistableListener ( ) { public void beforePersist ( ) { try { PersistableListener l = _listener ; if ( l != null ) l . beforePersist ( ) ; } catch ( Exception e ) { _logger . error ( "failed on calling beforePersist" , e ) ; } try...
Initialize the Index persistable listener .
136,327
public void populate ( ) throws Exception { for ( int i = 0 , cnt = _partition . getIdCount ( ) ; i < cnt ; i ++ ) { int memberId = _partition . getIdStart ( ) + i ; _partition . set ( memberId , createDataForMember ( memberId ) , System . nanoTime ( ) ) ; } _partition . sync ( ) ; }
Populates the underlying data partition .
136,328
public void doRandomReads ( int readCnt ) { Random rand = new Random ( ) ; int idStart = _partition . getIdStart ( ) ; int idCount = _partition . getIdCount ( ) ; for ( int i = 0 ; i < readCnt ; i ++ ) { int memberId = idStart + rand . nextInt ( idCount ) ; System . out . printf ( "MemberId=%-10d MemberData=%s%n" , mem...
Perform a number of random reads from the underlying data partition .
136,329
public static void main ( String [ ] args ) { try { File homeDir = new File ( args [ 0 ] ) ; int idStart = Integer . parseInt ( args [ 1 ] ) ; int idCount = Integer . parseInt ( args [ 2 ] ) ; KratiDataPartition p = new KratiDataPartition ( homeDir , idStart , idCount ) ; p . populate ( ) ; p . doRandomReads ( 10 ) ; p...
java - Xmx4G krati . examples . KratiDataPartition homeDir idStart idCount
136,330
public synchronized Clock updateHWMark ( String source , long hwm ) { _sourceWaterMarks . saveHWMark ( source , hwm ) ; return current ( ) ; }
Save the high water mark of a given source .
136,331
public static PDQConsumerAuditor getAuditor ( ) { AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( PDQConsumerAuditor ) ctx . getAuditor ( PDQConsumerAuditor . class ) ; }
Get an instance of the PDQ Consumer Auditor from the global context
136,332
public void auditPDQQueryEvent ( RFC3881EventOutcomeCodes eventOutcome , String pixManagerUri , String receivingFacility , String receivingApp , String sendingFacility , String sendingApp , String hl7MessageControlId , String hl7QueryParameters , String [ ] patientIds ) { if ( ! isAuditorEnabled ( ) ) { return ; } audi...
Audits an ITI - 21 Patient Demographics Query event for Patient Demographics Consumer actors .
136,333
public String formatKey ( URI uri ) throws URISyntaxException { if ( uri == null ) { throw new URISyntaxException ( "" , "URI specified is null" ) ; } return formatKey ( uri . getHost ( ) , uri . getPort ( ) ) ; }
Converts a well - formed URI containing a hostname and port into string which allows for lookups in the Security Domain table
136,334
protected void submitSegmentIndexBuffer ( ) { if ( _sibEnabled && ! _sib . isDirty ( ) ) { _sib . setSegmentId ( _segment . getSegmentId ( ) ) ; _sib . setSegmentLastForcedTime ( _segment . getLastForcedTime ( ) ) ; _segmentManager . submit ( _sib ) ; } else { _segmentManager . remove ( _sib ) ; } }
Submit current segment index buffer for asynchronous handling .
136,335
protected void init ( ) { try { _segment = _segmentManager . nextSegment ( ) ; _sib = _segmentManager . openSegmentIndexBuffer ( _segment . getSegmentId ( ) ) ; if ( ! _sibEnabled ) _sib . markAsDirty ( ) ; _log . info ( "Segment " + _segment . getSegmentId ( ) + " online: " + _segment . getStatus ( ) ) ; } catch ( IOE...
Initialize this SimpleDataArray after it is instantiated .
136,336
protected void decrOriginalSegmentLoad ( int index ) { try { long address = getAddress ( index ) ; int segPos = _addressFormat . getOffset ( address ) ; int segInd = _addressFormat . getSegment ( address ) ; int length = _addressFormat . getDataSize ( address ) ; if ( segPos >= Segment . dataStartPosition ) { Segment s...
Decrease the load factor of a Segment based on the specified array index .
136,337
public byte [ ] get ( int index ) { rangeCheck ( index ) ; try { long address = getAddress ( index ) ; int segPos = _addressFormat . getOffset ( address ) ; int segInd = _addressFormat . getSegment ( address ) ; if ( segPos < Segment . dataStartPosition ) return null ; Segment seg = _segmentManager . getSegment ( segIn...
Gets data at a given index .
136,338
public int read ( int index , byte [ ] dst ) { rangeCheck ( index ) ; try { long address = getAddress ( index ) ; int segPos = _addressFormat . getOffset ( address ) ; int segInd = _addressFormat . getSegment ( address ) ; if ( segPos < Segment . dataStartPosition ) return - 1 ; Segment seg = _segmentManager . getSegme...
Reads data bytes at an index into a byte array .
136,339
public int transferTo ( int index , WritableByteChannel channel ) { rangeCheck ( index ) ; try { long address = getAddress ( index ) ; int segPos = _addressFormat . getOffset ( address ) ; int segInd = _addressFormat . getSegment ( address ) ; if ( segPos < Segment . dataStartPosition ) return - 1 ; Segment seg = _segm...
Transfers data at a given index to a writable channel .
136,340
public synchronized void clear ( ) { if ( isOpen ( ) ) { _compactor . clear ( ) ; _addressArray . clear ( ) ; _segmentManager . clear ( ) ; this . init ( ) ; } }
Clears all data stored in this SimpleDataArray . This method is not effective if this SimpleDataArray is not open .
136,341
public synchronized void close ( ) throws IOException { if ( _mode == Mode . CLOSED ) { return ; } _mode = Mode . CLOSED ; try { _compactor . shutdown ( ) ; syncInternal ( ) ; submitSegmentIndexBuffer ( ) ; _compactor . clear ( ) ; _addressArray . close ( ) ; _segmentManager . close ( ) ; } catch ( Exception e ) { _log...
Close to quit from serving requests .
136,342
public synchronized void open ( ) throws IOException { if ( _mode == Mode . OPEN ) { return ; } try { _addressArray . open ( ) ; _segmentManager . open ( ) ; _compactor . start ( ) ; init ( ) ; _mode = Mode . OPEN ; } catch ( Exception e ) { _mode = Mode . CLOSED ; _log . error ( "Failed to open" , e ) ; _compactor . s...
Open to start serving requests .
136,343
protected void fireBeforePersist ( ) { PersistableListener l = _listener ; if ( l != null ) { try { l . beforePersist ( ) ; } catch ( Exception e ) { _log . error ( "failure on calling beforePersist" , e ) ; } } }
Fire beforePersist events to the PersistableListener .
136,344
protected void fireAfterPersist ( ) { PersistableListener l = _listener ; if ( l != null ) { try { l . afterPersist ( ) ; } catch ( Exception e ) { _log . error ( "failure on calling afterPersist" , e ) ; } } }
Fire afterPersist events to the PersistableListener .
136,345
public String cleanFixedLine ( final String line ) { StringBuilder cleanedLine = new StringBuilder ( ) ; int length = line . length ( ) ; for ( int i = 0 ; i < _startColumn - 1 ; i ++ ) { cleanedLine . append ( " " ) ; } if ( length > _startColumn - 1 ) { String areaA = line . substring ( _startColumn - 1 , ( length > ...
Clear sequence numbers in column 1 - 6 and anything beyond column 72 .
136,346
private void freeCompactedSegments ( ) { SegmentManager segManager = _dataArray . getSegmentManager ( ) ; if ( segManager == null ) return ; while ( ! _freeQueue . isEmpty ( ) ) { Segment seg = _freeQueue . remove ( ) ; try { segManager . freeSegment ( seg ) ; } catch ( Exception e ) { _log . error ( "failed to free Se...
Frees segments that were compacted successfully .
136,347
private boolean compact ( ) throws IOException { try { final boolean sibEnabled = _dataArray . isSibEnabled ( ) ; _segTarget = _dataArray . getSegmentManager ( ) . nextSegment ( ) ; for ( Segment seg : _segSourceList ) { if ( ! _enabled ) { try { _updateManager . endUpdate ( _segTarget ) ; } catch ( Exception e ) { _lo...
Compacts a number of source fragmented Segments by moving data into a new target Segment .
136,348
private boolean compact ( Segment segment , SegmentIndexBuffer sibSource , Segment segTarget ) throws IOException { Segment segSource = segment ; int segSourceId = segSource . getSegmentId ( ) ; int segTargetId = segTarget . getSegmentId ( ) ; Chronos c = new Chronos ( ) ; if ( ! segment . canReadFromBuffer ( ) && segm...
Compacts data from the specified source Segment into the specified target Segment .
136,349
public void run ( ) { while ( _enabled ) { if ( _newCycle . compareAndSet ( true , false ) ) { _lock . lock ( ) ; try { reset ( ) ; _state = State . INIT ; _log . info ( "cycle init" ) ; flushSegmentIndexBuffers ( ) ; freeCompactedSegments ( ) ; if ( ! inspect ( ) ) continue ; if ( ! compact ( ) ) continue ; } catch ( ...
Compacting Segments .
136,350
protected ByteBuffer getByteBuffer ( int bufferLength ) { if ( _buffer == null ) { _buffer = ByteBuffer . wrap ( new byte [ bufferLength ] ) ; _log . info ( "ByteBuffer allocated for buffering" ) ; } return _buffer ; }
Gets the buffer for speeding up compaction .
136,351
private void toStringRenames ( final StringBuilder sb ) { if ( getRenamesSubject ( ) != null ) { sb . append ( ',' ) ; sb . append ( "renamesSubject:" + getRenamesSubject ( ) ) ; } if ( getRenamesSubjectRange ( ) != null ) { sb . append ( ',' ) ; sb . append ( "renamesSubjectRange:" + getRenamesSubjectRange ( ) ) ; } }
Pretty printing for a renames entry .
136,352
private void toStringCondition ( final StringBuilder sb ) { if ( getConditionLiterals ( ) . size ( ) > 0 ) { toStringList ( sb , getConditionLiterals ( ) , "conditionLiterals" ) ; } if ( getConditionRanges ( ) . size ( ) > 0 ) { toStringList ( sb , getConditionRanges ( ) , "conditionRanges" ) ; } }
Pretty printing for a condition entry .
136,353
private void toStringList ( final StringBuilder sb , final List < ? > list , final String title ) { sb . append ( ',' ) ; sb . append ( title + ":[" ) ; boolean first = true ; for ( Object child : list ) { if ( ! first ) { sb . append ( "," ) ; } else { first = false ; } sb . append ( child . toString ( ) ) ; } sb . ap...
Adds list elements to a string builder .
136,354
public void reinitValue ( DataReader in , EntryValueInt value ) throws IOException { value . reinit ( in . readInt ( ) , in . readInt ( ) , in . readLong ( ) ) ; }
Read data from stream to populate an EntryValueInt .
136,355
private static void initializeDefaultModules ( SecurityContext context ) { if ( context . isInitialized ( ) ) { return ; } if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "SecurityContext default module initializer starting" ) ; } String moduleName ; for ( int i = 0 ; i < DEFAULT_MODULES . length ; i ++ ) { modul...
Initialize and register the contexts for modules that by default are initialized with the security context
136,356
public void setAuditSourceId ( String sourceId , String enterpriseSiteId ) { setAuditSourceId ( sourceId , enterpriseSiteId , ( RFC3881AuditSourceTypes [ ] ) null ) ; }
Sets a Audit Source Identification block for a given Audit Source ID and Audit Source Enterprise Site ID
136,357
public void setAuditSourceId ( String sourceId , String enterpriseSiteId , RFC3881AuditSourceTypes [ ] typeCodes ) { addAuditSourceIdentification ( sourceId , enterpriseSiteId , typeCodes ) ; }
Sets a Audit Source Identification block for a given Audit Source ID Audit Source Enterprise Site ID and a list of audit source type codes
136,358
public void setRetention ( long duration , TimeUnit timeUnit ) { this . _duration = Math . max ( 1 , duration ) ; this . _timeUnit = timeUnit ; long millis = TimeUnit . MILLISECONDS == timeUnit ? _duration : TimeUnit . MILLISECONDS . convert ( _duration , timeUnit ) ; _timeMillis = Math . max ( millis , MIN_DURATION_MI...
Sets the retention duration period of this policy .
136,359
private void expand ( int i ) { if ( count + i <= buf . length ) { return ; } byte [ ] newbuf = mPool . getBuf ( ( count + i ) * 2 ) ; System . arraycopy ( buf , 0 , newbuf , 0 , count ) ; mPool . returnBuf ( buf ) ; buf = newbuf ; }
Ensures there is enough space in the buffer for the given number of additional bytes .
136,360
protected void checkCobolSourceFile ( final File cobolSourceFile ) throws IOException { if ( cobolSourceFile == null ) { throw new IOException ( "You must provide a COBOL source file" ) ; } if ( ! cobolSourceFile . exists ( ) ) { throw new IOException ( "COBOL source file " + cobolSourceFile + " not found" ) ; } }
make sure the COBOL file is valid .
136,361
protected void checkTarget ( final File target ) throws IOException { if ( target == null ) { throw new IOException ( "You must provide a target directory or file" ) ; } if ( ! target . exists ( ) ) { String extension = FilenameUtils . getExtension ( target . getName ( ) ) ; if ( extension . length ( ) == 0 ) { throw n...
make sure the target folder or file is valid . We consider that target files will have extensions . Its ok for a target file not to exist but target folders must exist .
136,362
protected String getUniqueTargetNamespace ( String targetNamespacePrefix , final String baseName ) throws IOException { if ( targetNamespacePrefix == null || targetNamespacePrefix . length ( ) == 0 ) { return null ; } if ( baseName == null || baseName . length ( ) == 0 ) { throw new IOException ( "No target basename wa...
TargetNamespace if it is not null is completed with the baseName .
136,363
protected void auditQueryEvent ( boolean systemIsSource , IHETransactionEventTypeCodes transaction , RFC3881EventOutcomeCodes eventOutcome , String sourceFacility , String sourceApp , String sourceAltUserId , String sourceNetworkId , String destinationFacility , String destinationApp , String destinationAltUserId , Str...
Audit a QUERY event for PIX and PDQ transactions . Useful for PIX Query PDQ Query and PDVQ Query in the PIX Manager as well as the PIX and PDQ Consumer
136,364
public static AuditorModuleContext getContext ( ) { SecurityContext securityContext = SecurityContextFactory . getSecurityContext ( ) ; if ( ! securityContext . isInitialized ( ) ) { securityContext . initialize ( ) ; } AbstractModuleContext moduleContext = securityContext . getModuleContext ( CONTEXT_ID ) ; if ( null ...
Returns the current singleton instance of the Auditor 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 .
136,365
public AuditMessageSender getSender ( ) { if ( customSender == null ) { String transport = AuditorModuleContext . getContext ( ) . getConfig ( ) . getAuditRepositoryTransport ( ) ; if ( transport . equalsIgnoreCase ( "TLS" ) ) { return new TLSSyslogSenderImpl ( ) ; } else if ( transport . equalsIgnoreCase ( "UDP" ) ) {...
Gets the transport - specific sending instance used to deliver audit messages to their destination
136,366
public IHEAuditor getAuditor ( String className , boolean useContextAuditorRegistry ) { return getAuditor ( AuditorFactory . getAuditorClassForClassName ( className ) , useContextAuditorRegistry ) ; }
Get an IHE Auditor instance from a fully - qualified class name
136,367
public static XDSRegistryAuditor getAuditor ( ) { AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( XDSRegistryAuditor ) ctx . getAuditor ( XDSRegistryAuditor . class ) ; }
Get an instance of the XDS Document Registry Auditor from the global context
136,368
public void auditRegistryQueryEvent ( RFC3881EventOutcomeCodes eventOutcome , String consumerUserId , String consumerUserName , String consumerIpAddress , String registryEndpointUri , String adhocQueryRequestPayload , String patientId ) { if ( ! isAuditorEnabled ( ) ) { return ; } auditQueryEvent ( false , new IHETrans...
Audits an ITI - 16 Registry SQL Query event for XDS . a Document Registry actors .
136,369
public void auditRegistryStoredQueryEvent ( RFC3881EventOutcomeCodes eventOutcome , String consumerUserId , String consumerUserName , String consumerIpAddress , String registryEndpointUri , String storedQueryUUID , String adhocQueryRequestPayload , String homeCommunityId , String patientId , List < CodedValueType > pur...
Audits an ITI - 18 Registry Stored Query event for XDS . a and XDS . b Document Registry actors .
136,370
protected void auditRegisterEvent ( IHETransactionEventTypeCodes transaction , RFC3881EventOutcomeCodes eventOutcome , String repositoryUserId , String repositoryIpAddress , String userName , String registryEndpointUri , String submissionSetUniqueId , String patientId , List < CodedValueType > purposesOfUse , List < Co...
Generically sends audit messages for XDS Document Registry Register Document Set events
136,371
private void fixKeyManagers ( ) { if ( null == keyManagerFactory || null == keyManagerFactory . getKeyManagers ( ) ) { return ; } KeyManager [ ] defaultKeyManagers = keyManagerFactory . getKeyManagers ( ) ; KeyManager [ ] newKeyManagers = new KeyManager [ defaultKeyManagers . length ] ; KeyManager mgr = null ; for ( in...
If a keystore alias is defined then override the key manager assigned to with an alias - sensitive wrapper that selects the proper key from your assigned key alias .
136,372
public void init ( FilterConfig filterConfig ) throws ServletException { super . init ( filterConfig ) ; int reloadTime = readInt ( filterConfig . getInitParameter ( INIT_PARAM_RELOAD_TIME ) , 0 ) ; this . resetTime = readInt ( filterConfig . getInitParameter ( INIT_PARAM_RESET_TIME ) , resetTime ) ; this . cacheKeyFor...
eg . queryString header = X - Requested - By parameter = username . URI is always part of key
136,373
protected String generateCacheKeyForTheRequest ( HttpServletRequest request ) { StringBuilder cacheKey = new StringBuilder ( ) ; cacheKey . append ( request . getRequestURI ( ) ) ; String [ ] keyAttributes = this . cacheKeyFormat . split ( "," ) ; for ( String attr : keyAttributes ) { String keyAttr = attr . trim ( ) ....
Generate the cache key for the specific request by using the cacheKeyFormat init param You can specify comma separated list of attributes that you want to use to build the cache key . URI is by default part of the cache key . Using cacheKeyFormat params you can optionally include following details . - queryString - spe...
136,374
protected void init ( ) throws IOException { try { long lwmScn = _arrayFile . getLwmScn ( ) ; long hwmScn = _arrayFile . getHwmScn ( ) ; if ( hwmScn < lwmScn ) { throw new IOException ( _arrayFile . getAbsolutePath ( ) + " is corrupted: lwmScn=" + lwmScn + " hwmScn=" + hwmScn ) ; } _entryManager . init ( lwmScn , hwmSc...
Loads data from the array file .
136,375
private String chooseClientAliasForKey ( String preferredAlias , String keyType , Principal [ ] issuers , Socket socket ) { String [ ] aliases = getClientAliases ( keyType , issuers ) ; if ( aliases != null && aliases . length > 0 ) { for ( int i = 0 ; i < aliases . length ; i ++ ) { if ( preferredAlias . equals ( alia...
Attempts to find a keystore
136,376
private static String simpleHashOf ( String resourceRealPath ) { if ( resourceRealPath == null ) return null ; File resource = new File ( resourceRealPath ) ; if ( ! resource . exists ( ) ) return null ; long lastModified = resource . lastModified ( ) ; long size = resource . length ( ) ; return String . format ( "%s#%...
Calculates simple hash using file size and last modified time .
136,377
public static String getParentPath ( String path ) { if ( path == null ) return null ; path = path . trim ( ) ; if ( path . endsWith ( PATH_ROOT ) && path . length ( ) > 1 ) { path = path . substring ( 0 , path . length ( ) - 1 ) ; } int lastIndex = path . lastIndexOf ( PATH_ROOT ) ; if ( path . length ( ) > 1 && lastI...
Fast get parent directory using substring
136,378
protected Socket createSocket ( String host , int port ) throws SocketException , UnknownHostException { Socket socket = null ; int retries = 0 ; Throwable cause = null ; while ( retries < CONTEXT . getConfig ( ) . getSocketRetries ( ) ) { try { socket = createSocketFromFactory ( SocketFactory . getDefault ( ) , host ,...
Create non - secure socket for a given URI .
136,379
protected Socket createSocketFromFactory ( SocketFactory factory , String host , int port ) throws IOException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Connecting to " + host + " on port " + port + " (timeout: " + CONTEXT . getConfig ( ) . getConnectTimeout ( ) + " ms) using factory " + factory . getCla...
Creates a new connected socket to a given host and port from a provided Socket Factory .
136,380
public boolean isLineOfCode ( final String line ) { if ( line . length ( ) < getIndicatorAreaPos ( ) + 1 ) { return false ; } if ( line . trim ( ) . length ( ) == 0 ) { return false ; } if ( isComment ( line ) ) { return false ; } String [ ] tokens = line . trim ( ) . split ( "[\\s\\.]+" ) ; if ( tokens . length == 1 &...
Make sure this is a line worth parsing . Ignore empty lines comments and compiler directives .
136,381
public String cleanLine ( final String line ) { String cleanedLine = extendedCleanLine ( line ) ; cleanedLine = ( "a" + cleanedLine ) . trim ( ) . substring ( 1 ) ; return cleanedLine ; }
Remove characters that should not be passed to the lexer .
136,382
protected boolean isArgument ( final String fragment ) { String s = fragment . trim ( ) ; if ( s . length ( ) > 0 ) { return s . charAt ( s . length ( ) - 1 ) != COBOL_DELIMITER ; } return false ; }
Examine characters before an assumed level . If these characters are not terminated by a COBOL delimiter then the level is actually an argument to a previous keyword not an actual level .
136,383
public static ImageListener getImageListener ( final ImageView view , final int defaultImageResId , final int errorImageResId ) { return new ImageListener ( ) { public void onError ( JusError error ) { if ( errorImageResId != 0 ) { view . setImageResource ( errorImageResId ) ; } } public void onResponse ( ImageContaine...
The default implementation of ImageListener which handles basic functionality of showing a default image until the network response is received at which point it will switch to either the actual image or the error image .
136,384
public ImageContainer get ( String requestUrl , final ImageListener listener , final Object tag ) { return get ( requestUrl , listener , 0 , 0 , tag ) ; }
Returns an ImageContainer for the requested URL .
136,385
protected void onGetImageSuccess ( String cacheKey , Bitmap response ) { imageCache . putBitmap ( cacheKey , response ) ; BatchedImageRequest request = inFlightRequests . remove ( cacheKey ) ; if ( request != null ) { request . mResponseBitmap = response ; batchResponse ( cacheKey , request ) ; } }
Handler for when an image was successfully loaded .
136,386
protected void onGetImageError ( String cacheKey , JusError error ) { BatchedImageRequest request = inFlightRequests . remove ( cacheKey ) ; if ( request != null ) { request . setError ( error ) ; batchResponse ( cacheKey , request ) ; } }
Handler for when an image failed to load .
136,387
private void batchResponse ( String cacheKey , BatchedImageRequest request ) { batchedResponses . put ( cacheKey , request ) ; if ( runnable == null ) { runnable = new Runnable ( ) { public void run ( ) { for ( BatchedImageRequest bir : batchedResponses . values ( ) ) { for ( ImageContainer container : bir . mContainer...
Starts the runnable for batched delivery of responses if it is not already started .
136,388
private static String getCacheKey ( String url , int maxWidth , int maxHeight , ScaleType scaleType ) { return "#W" + maxWidth + "#H" + maxHeight + "#S" + scaleType . ordinal ( ) + url ; }
Creates a cache key for use with the L1 cache .
136,389
public static XDSSourceAuditor getAuditor ( ) { AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( XDSSourceAuditor ) ctx . getAuditor ( XDSSourceAuditor . class ) ; }
Get an instance of the XDS Document Source Auditor from the global context
136,390
public void auditProvideAndRegisterDocumentSetEvent ( RFC3881EventOutcomeCodes eventOutcome , String repositoryEndpointUri , String userName , String submissionSetUniqueId , String patientId ) { if ( ! isAuditorEnabled ( ) ) { return ; } auditProvideAndRegisterEvent ( new IHETransactionEventTypeCodes . ProvideAndRegist...
Audits an ITI - 15 Provide And Register Document Set event for XDS . a Document Source actors .
136,391
public void auditProvideAndRegisterDocumentSetBEvent ( RFC3881EventOutcomeCodes eventOutcome , String repositoryEndpointUri , String userName , String submissionSetUniqueId , String patientId , List < CodedValueType > purposesOfUse , List < CodedValueType > userRoles ) { if ( ! isAuditorEnabled ( ) ) { return ; } audit...
Audits an ITI - 41 Provide And Register Document Set - b event for XDS . b Document Source actors .
136,392
protected void auditProvideAndRegisterEvent ( IHETransactionEventTypeCodes transaction , RFC3881EventOutcomeCodes eventOutcome , String repositoryEndpointUri , String userName , String submissionSetUniqueId , String patientId , List < CodedValueType > purposesOfUse , List < CodedValueType > userRoles ) { ExportEvent ex...
Generically sends audit messages for XDS Document Source Provide And Register Document Set events
136,393
public void addNodeActiveParticipant ( String userId , String altUserId , String userName , String networkId ) { addActiveParticipant ( userId , altUserId , userName , true , Collections . singletonList ( new DICOMActiveParticipantRoleIdCodes . Application ( ) ) , networkId ) ; }
Adds an Active Participant representing the node that is performing the authentication
136,394
public static String buildUrlQuery ( String baseUrl , Map < String , String > params ) { if ( baseUrl . isEmpty ( ) || params . isEmpty ( ) ) { return baseUrl ; } else { String query = baseUrl ; query += QUERY_STRING_SEPARATOR ; for ( String key : params . keySet ( ) ) { query += key ; query += PAIR_SEPARATOR ; query +...
Builds the URL String .
136,395
protected void setAuditMessageElements ( EventIdentificationType eventId , ActiveParticipantType [ ] participants , AuditSourceIdentificationType [ ] sourceIds , ParticipantObjectIdentificationType [ ] objectIds ) { AuditMessage auditMessage = getAuditMessage ( ) ; auditMessage . setEventIdentification ( eventId ) ; au...
Clear and set the individual elements of the audit message payload in line with RFC 3881
136,396
protected EventIdentificationType setEventIdentification ( RFC3881EventOutcomeCodes outcome , RFC3881EventActionCodes action , CodedValueType id , CodedValueType [ ] type , List < CodedValueType > purposesOfUse ) { EventIdentificationType eventBlock = new EventIdentificationType ( ) ; eventBlock . setEventID ( id ) ; e...
Create and set an Event Identification block for this audit event message
136,397
protected ActiveParticipantType addActiveParticipant ( String userID , String altUserID , String userName , Boolean userIsRequestor , List < CodedValueType > roleIdCodes , String networkAccessPointID , RFC3881NetworkAccessPointTypeCodes networkAccessPointTypeCode ) { ActiveParticipantType activeParticipantBlock = new A...
Create and add an Active Participant block to this audit event message
136,398
protected AuditSourceIdentificationType addAuditSourceIdentification ( String sourceID , String enterpriseSiteID , RFC3881AuditSourceTypeCodes ... typeCodes ) { AuditSourceIdentificationType sourceBlock = new AuditSourceIdentificationType ( ) ; if ( ! EventUtils . isEmptyOrNull ( typeCodes , true ) ) { sourceBlock . se...
Create and add an Audit Source Identification block to this audit event message
136,399
public ParticipantObjectIdentificationType addParticipantObjectIdentification ( CodedValueType objectIDTypeCode , String objectName , byte [ ] objectQuery , List < TypeValuePairType > objectDetail , String objectID , RFC3881ParticipantObjectTypeCodes objectTypeCode , RFC3881ParticipantObjectTypeRoleCodes objectTypeCode...
Create and add an Participant Object Identification block to this audit event message