idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
12,700 | 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 . |
12,701 | 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 . |
12,702 | 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 |
12,703 | 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 |
12,704 | 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 . |
12,705 | 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 |
12,706 | 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 |
12,707 | 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 |
12,708 | 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 |
12,709 | 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 |
12,710 | protected ActiveParticipantType addActiveParticipant ( String userID , String altUserID , String userName , Boolean userIsRequestor , List < CodedValueType > roleIdCodes , String networkAccessPointID ) { return addActiveParticipant ( userID , altUserID , userName , userIsRequestor , roleIdCodes , networkAccessPointID ,... | Create and add an Active Participant block to this audit event message but automatically determine the Network Access Point ID Type Code |
12,711 | protected RFC3881NetworkAccessPointTypeCodes getNetworkAccessPointCodeFromAddress ( String address ) { if ( EventUtils . isEmptyOrNull ( address ) ) { return null ; } if ( address . matches ( "^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$" ) ) { return RFC3881NetworkAccessPointTypeCodes . IP_ADDRESS ; } return RF... | Attempt to determine the proper Active Participant Network Access Point Type Code from a given string . |
12,712 | public static XCPDInitiatingGatewayAuditor getAuditor ( ) { AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( XCPDInitiatingGatewayAuditor ) ctx . getAuditor ( XCPDInitiatingGatewayAuditor . class ) ; } | Get an instance of the XCPD Initiating Gateway Auditor from the global context |
12,713 | public void auditXCPDQueryEvent ( RFC3881EventOutcomeCodes eventOutcome , String sourceUserId , String humanRequestorUserId , CodedValueType humanRequestorRoleIdCode , String XCPDRGUri , String homeCommunityId , String queryByParameter , List < CodedValueType > purposesOfUse ) { if ( ! isAuditorEnabled ( ) ) { return ;... | Audits an ITI - 55 Cross Gateway Patient Discovery event for XCPD Initiating Gateway actors . |
12,714 | public static SVSConsumerAuditor getAuditor ( ) { AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( SVSConsumerAuditor ) ctx . getAuditor ( SVSConsumerAuditor . class ) ; } | Get an instance of the SVS Consumer Auditor from the global context |
12,715 | public void auditRetrieveValueSetEvent ( RFC3881EventOutcomeCodes eventOutcome , String repositoryEndpointUri , String valueSetUniqueId , String valueSetName , String valueSetVersion , List < CodedValueType > purposesOfUse , List < CodedValueType > userRoles ) { if ( ! isAuditorEnabled ( ) ) { return ; } ImportEvent im... | Audits an ITI - 48 Retrieve Value Set event for SVS Consumer actors . |
12,716 | public static void main ( String [ ] args ) { try { File homeDir = new File ( args [ 0 ] ) ; int initialCapacity = Integer . parseInt ( args [ 1 ] ) ; KratiDataStore store = new KratiDataStore ( homeDir , initialCapacity ) ; store . populate ( ) ; store . doRandomReads ( 10 ) ; store . close ( ) ; } catch ( Exception e... | java - Xmx4G krati . examples . KratiDataStore homeDir initialCapacity |
12,717 | protected byte [ ] getTransportPayload ( AuditEventMessage msg ) throws UnsupportedEncodingException { if ( msg == null ) { return null ; } byte [ ] msgBytes = msg . getSerializedMessage ( false ) ; if ( EventUtils . isEmptyOrNull ( msgBytes ) ) { return null ; } StringBuilder sb = new StringBuilder ( ) ; sb . append (... | Serialize format and prepare the message payload body for sending by this transport . This includes adding the syslog message header which is transport independent . |
12,718 | private String getSystemHostName ( ) { if ( EventUtils . isEmptyOrNull ( systemHostName ) ) { try { systemHostName = InetAddress . getLocalHost ( ) . getHostName ( ) ; } catch ( Throwable t ) { systemHostName = "localhost" ; } } return systemHostName ; } | Gets the hostname of the system managing this transport |
12,719 | private long fourByteToLong ( byte [ ] bytes , int offset ) { return ( byteToLong ( bytes [ offset + 0 ] ) + ( byteToLong ( bytes [ offset + 1 ] ) << 8 ) + ( byteToLong ( bytes [ offset + 2 ] ) << 16 ) + ( byteToLong ( bytes [ offset + 3 ] ) << 24 ) ) ; } | Convert 4 bytes from the buffer at offset into a long value . |
12,720 | private void hashMix ( ) { a = subtract ( a , b ) ; a = subtract ( a , c ) ; a = xor ( a , c >> 13 ) ; b = subtract ( b , c ) ; b = subtract ( b , a ) ; b = xor ( b , leftShift ( a , 8 ) ) ; c = subtract ( c , a ) ; c = subtract ( c , b ) ; c = xor ( c , ( b >> 13 ) ) ; a = subtract ( a , b ) ; a = subtract ( a , c ) ;... | Mix up the values in the hash function . |
12,721 | public long hash ( byte [ ] buffer , long initialValue ) { int len , pos ; a = 0x09e3779b9L ; b = 0x09e3779b9L ; c = initialValue ; pos = 0 ; for ( len = buffer . length ; len >= 12 ; len -= 12 ) { a = add ( a , fourByteToLong ( buffer , pos ) ) ; b = add ( b , fourByteToLong ( buffer , pos + 4 ) ) ; c = add ( c , four... | Hash a variable - length key into a 32 - bit value . Every bit of the key affects every bit of the return value . Every 1 - bit and 2 - bit delta achieves avalanche . The best hash table sizes are powers of 2 . |
12,722 | public XmlSchemaComplexType createXmlSchemaComplexType ( final XsdDataItem xsdDataItem ) { XmlSchemaComplexType xmlSchemaComplexType = new XmlSchemaComplexType ( getXsd ( ) , true ) ; XmlSchemaChoice xmlSchemaChoice = null ; XmlSchemaSequence xmlSchemaSequence = new XmlSchemaSequence ( ) ; for ( XsdDataItem child : xsd... | Create an XML schema complex type . We want to use Named complex types so we add them to the XSD directly . We add complex types before their children because its nicer for the XSD layout to list roots before leafs . Redefined and redefining elements are grouped into an XML Schema choice . A choice is created when an e... |
12,723 | public XmlSchemaElement createXmlSchemaElement ( final XsdDataItem xsdDataItem ) { XmlSchemaElement element = new XmlSchemaElement ( getXsd ( ) , false ) ; element . setName ( xsdDataItem . getXsdElementName ( ) ) ; if ( xsdDataItem . getMaxOccurs ( ) != 1 ) { element . setMaxOccurs ( xsdDataItem . getMaxOccurs ( ) ) ;... | Create an XML Schema element from a COBOL data item . |
12,724 | protected void addEnumerationFacets ( final XsdDataItem xsdDataItem , final XmlSchemaSimpleTypeRestriction restriction ) { if ( getConfig ( ) . mapConditionsToFacets ( ) ) { boolean hasValueThru = false ; for ( XsdDataItem child : xsdDataItem . getChildren ( ) ) { if ( child . getDataEntryType ( ) == DataEntryType . CO... | If simple type has conditions attached to it emit enumeration facets . |
12,725 | protected XmlSchemaSimpleType createXmlSchemaSimpleType ( final XmlSchemaSimpleTypeRestriction restriction ) { XmlSchemaSimpleType xmlSchemaSimpleType = new XmlSchemaSimpleType ( getXsd ( ) , false ) ; xmlSchemaSimpleType . setContent ( restriction ) ; return xmlSchemaSimpleType ; } | Create an XML schema simple type from a restriction . |
12,726 | protected XmlSchemaSimpleTypeRestriction createRestriction ( final String xsdTypeName ) { XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction ( ) ; restriction . setBaseTypeName ( new QName ( XMLConstants . W3C_XML_SCHEMA_NS_URI , xsdTypeName ) ) ; return restriction ; } | Create an XML schema restriction . |
12,727 | protected XmlSchemaMaxLengthFacet createMaxLengthFacet ( final int length ) { XmlSchemaMaxLengthFacet xmlSchemaMaxLengthFacet = new XmlSchemaMaxLengthFacet ( ) ; xmlSchemaMaxLengthFacet . setValue ( length ) ; return xmlSchemaMaxLengthFacet ; } | Create an XML schema maxLength facet . |
12,728 | protected XmlSchemaPatternFacet createPatternFacet ( final String pattern ) { XmlSchemaPatternFacet xmlSchemaPatternFacet = new XmlSchemaPatternFacet ( ) ; xmlSchemaPatternFacet . setValue ( pattern ) ; return xmlSchemaPatternFacet ; } | Create an XML schema pattern facet . |
12,729 | protected XmlSchemaEnumerationFacet createEnumerationFacet ( final String conditionValue ) { XmlSchemaEnumerationFacet xmlSchemaEnumerationFacet = new XmlSchemaEnumerationFacet ( ) ; xmlSchemaEnumerationFacet . setValue ( conditionValue ) ; return xmlSchemaEnumerationFacet ; } | Create an XML schema enumeration facet . |
12,730 | protected XmlSchemaTotalDigitsFacet createTotalDigitsFacet ( final int totalDigits ) { XmlSchemaTotalDigitsFacet xmlSchemaTotalDigitsFacet = new XmlSchemaTotalDigitsFacet ( ) ; xmlSchemaTotalDigitsFacet . setValue ( totalDigits ) ; return xmlSchemaTotalDigitsFacet ; } | Create an XML schema totalDigits facet . |
12,731 | protected XmlSchemaFractionDigitsFacet createFractionDigitsFacet ( final int fractionDigits ) { XmlSchemaFractionDigitsFacet xmlSchemaFractionDigitsFacet = new XmlSchemaFractionDigitsFacet ( ) ; xmlSchemaFractionDigitsFacet . setValue ( fractionDigits ) ; return xmlSchemaFractionDigitsFacet ; } | Create an XML schema fractionDigits facet . |
12,732 | protected XmlSchemaMinInclusiveFacet createMinInclusiveFacet ( final String minInclusive ) { XmlSchemaMinInclusiveFacet xmlSchemaMinInclusiveFacet = new XmlSchemaMinInclusiveFacet ( ) ; xmlSchemaMinInclusiveFacet . setValue ( minInclusive ) ; return xmlSchemaMinInclusiveFacet ; } | Create an XML schema minInclusive facet . |
12,733 | protected XmlSchemaMaxInclusiveFacet createMaxInclusiveFacet ( final String maxInclusive ) { XmlSchemaMaxInclusiveFacet xmlSchemaMaxInclusiveFacet = new XmlSchemaMaxInclusiveFacet ( ) ; xmlSchemaMaxInclusiveFacet . setValue ( maxInclusive ) ; return xmlSchemaMaxInclusiveFacet ; } | Create an XML schema maxInclusive facet . |
12,734 | public int read ( SegmentIndexBuffer sib , File sibFile ) throws IOException { check ( sibFile ) ; RandomAccessFile raf = new RandomAccessFile ( sibFile , "r" ) ; FileChannel channel = raf . getChannel ( ) ; readVersion ( channel ) ; int length = sib . read ( channel ) ; length += STORAGE_VERSION_LENGTH ; channel . clo... | Reads from the specified segment index buffer file . |
12,735 | public int write ( SegmentIndexBuffer sib , File sibFile ) throws IOException { create ( sibFile ) ; RandomAccessFile raf = new RandomAccessFile ( sibFile , "rw" ) ; FileChannel channel = raf . getChannel ( ) ; writeVersion ( channel ) ; int length = sib . write ( channel ) ; length += STORAGE_VERSION_LENGTH ; raf . se... | Writes to the specified segment index buffer file . |
12,736 | protected int readVersion ( ReadableByteChannel channel ) throws IOException { ByteBuffer version = ByteBuffer . allocate ( STORAGE_VERSION_LENGTH ) ; int len = channel . read ( version ) ; if ( len < STORAGE_VERSION_LENGTH ) { throw new IOException ( "Invalid Version" ) ; } return version . getInt ( 0 ) ; } | Reads version from readable channel . |
12,737 | protected void writeVersion ( WritableByteChannel channel ) throws IOException { ByteBuffer version = ByteBuffer . allocate ( STORAGE_VERSION_LENGTH ) ; version . putInt ( STORAGE_VERSION ) ; version . flip ( ) ; channel . write ( version ) ; } | Writes the version to writable channel . |
12,738 | protected void create ( File file ) throws IOException { if ( ! file . exists ( ) ) { File dir = file . getParentFile ( ) ; if ( dir . exists ( ) ) file . createNewFile ( ) ; else if ( dir . mkdirs ( ) ) file . createNewFile ( ) ; else throw new IOException ( "Failed to create " + file . getAbsolutePath ( ) ) ; } if ( ... | Creates the specified file if needed . |
12,739 | protected void check ( File file ) throws IOException { if ( ! file . exists ( ) ) { throw new FileNotFoundException ( file . getAbsolutePath ( ) ) ; } if ( file . isDirectory ( ) ) { throw new IOException ( "Cannot open directory " + file . getAbsolutePath ( ) ) ; } } | Checks the existence of the specified file . |
12,740 | public static PAMSourceAuditor getAuditor ( ) { AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( PAMSourceAuditor ) ctx . getAuditor ( PAMSourceAuditor . class ) ; } | Get an instance of the PAM Source Auditor from the global context |
12,741 | public void add ( int pos , long val , long scn ) { if ( _index < _entryCapacity ) { _valArray . get ( _index ++ ) . reinit ( pos , val , scn ) ; maintainScn ( scn ) ; } else { throw new EntryOverflowException ( ) ; } } | Adds data to this Entry . |
12,742 | public final void save ( File file ) throws IOException { _entryFile = file ; Chronos c = new Chronos ( ) ; DataWriter out = new FastDataWriter ( file ) ; try { out . open ( ) ; out . writeLong ( STORAGE_VERSION ) ; out . writeLong ( _minScn ) ; out . writeLong ( _maxScn ) ; out . writeInt ( size ( ) ) ; saveDataSectio... | Saves to a file . |
12,743 | public void load ( File file ) throws IOException { _entryFile = file ; Chronos c = new Chronos ( ) ; ChannelReader in = new ChannelReader ( file ) ; try { in . open ( ) ; long fileVersion = in . readLong ( ) ; if ( fileVersion != STORAGE_VERSION ) { throw new RuntimeException ( "Wrong storage version " + fileVersion +... | Loads an entry from a given file . |
12,744 | public CodedValueType getAuditSourceTypeCode ( ) { if ( EventUtils . isEmptyOrNull ( auditSourceTypeCode ) ) { return null ; } AuditSourceType auditSourceType = auditSourceTypeCode . get ( 0 ) ; CodedValueType codedValueType = new CodedValueType ( ) ; codedValueType . setCode ( auditSourceType . getCode ( ) ) ; codedVa... | Gets the value of the auditSourceTypeCode property . |
12,745 | public void setAuditSourceTypeCode ( CodedValueType auditSourceTypeCode ) { AuditSourceType auditSourceType = new AuditSourceType ( ) ; auditSourceType . setCode ( auditSourceTypeCode . getCode ( ) ) ; auditSourceType . setCodeSystem ( auditSourceTypeCode . getCodeSystem ( ) ) ; auditSourceType . setCodeSystemName ( au... | Sets the value of the auditSourceTypeCode property . |
12,746 | public static int getCacheSize ( Context ctx ) { final DisplayMetrics displayMetrics = ctx . getResources ( ) . getDisplayMetrics ( ) ; final int screenWidth = displayMetrics . widthPixels ; final int screenHeight = displayMetrics . heightPixels ; final int screenBytes = screenWidth * screenHeight * 4 ; return screenBy... | Returns a cache size equal to approximately three screens worth of images . |
12,747 | public static AuditRecordRepositoryAuditor getAuditor ( ) { AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( AuditRecordRepositoryAuditor ) ctx . getAuditor ( AuditRecordRepositoryAuditor . class ) ; } | Get an instance of the Audit Record Repository auditor from the global context |
12,748 | public void auditAuditLogUsed ( RFC3881EventOutcomeCodes eventOutcome , String accessingUser , String accessingProcess , String auditLogUri ) { if ( ! isAuditorEnabled ( ) ) { return ; } AuditLogUsedEvent auditLogUsedEvent = new AuditLogUsedEvent ( eventOutcome ) ; auditLogUsedEvent . setAuditSourceId ( getAuditSourceI... | Audits a DICOM Audit Log Used event for a given User and Process . |
12,749 | public static < T extends EntryValue > void sortEntriesById ( List < Entry < T > > entryList ) { if ( entryList . size ( ) > 0 ) { Collections . sort ( entryList , new Comparator < Entry < ? > > ( ) { public int compare ( Entry < ? > e1 , Entry < ? > e2 ) { long v1 = getEntryId ( e1 . getFile ( ) . getName ( ) ) ; long... | Sort entries in the ascending order of entry log IDs . |
12,750 | public static long getEntryId ( String entryFileName ) { int ind1 = entryFileName . indexOf ( "_" ) + 1 ; if ( ind1 > 0 ) { int ind2 = entryFileName . indexOf ( "_" , ind1 ) ; if ( ind2 > ind1 ) { String str = entryFileName . substring ( ind1 , ind2 ) ; try { return Long . parseLong ( str ) ; } catch ( Exception e ) { ... | Gets the entry ID based on the specified entry file name . |
12,751 | private void send ( byte [ ] msg , DatagramSocket socket , InetAddress destination , int port ) throws Exception { if ( EventUtils . isEmptyOrNull ( msg ) ) { return ; } if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Auditing to " + destination . getHostAddress ( ) + ":" + port ) ; } if ( LOGGER . isDebugEnable... | Send a byte buffer to a designated destination address and port using the datagram socket specified . |
12,752 | private void send ( AuditEventMessage msg , DatagramSocket socket , InetAddress destination , int port ) throws Exception { if ( EventUtils . isEmptyOrNull ( msg ) ) { return ; } int portToUse = getTransportPort ( port ) ; byte [ ] msgBytes = getTransportPayload ( msg ) ; send ( msgBytes , socket , destination , portTo... | Send an audit message to a designated destination address and port using the datagram socket specified . |
12,753 | protected byte [ ] getTransportPayload ( AuditEventMessage msg ) { if ( msg == null ) { return null ; } byte [ ] msgBytes = msg . getSerializedMessage ( false ) ; if ( EventUtils . isEmptyOrNull ( msgBytes ) ) { return null ; } StringBuilder sb = new StringBuilder ( ) ; sb . append ( "<" ) ; sb . append ( TRANSPORT_DEF... | Serialize format and prepare the message payload body for sending by this transport . This includes adding the syslog message header . |
12,754 | protected void loadWaterMarks ( ) throws IOException { if ( file != null && file . exists ( ) ) { try { loadWaterMarks ( file ) ; } catch ( IOException e ) { if ( fileOriginal != null && fileOriginal . exists ( ) ) { loadWaterMarks ( fileOriginal ) ; } } } } | Load water marks from underlying files . |
12,755 | protected void loadWaterMarks ( File waterMarksFile ) throws IOException { Properties p = new Properties ( ) ; FileInputStream fis = new FileInputStream ( waterMarksFile ) ; logger . info ( "Loading " + waterMarksFile ) ; try { p . load ( fis ) ; Enumeration < ? > enm = p . propertyNames ( ) ; while ( enm . hasMoreElem... | Load water marks from an underlying file . |
12,756 | public long getHWMScn ( String source ) { WaterMarkEntry e = sourceWaterMarkMap . get ( source ) ; return ( e == null ) ? 0 : e . getHWMScn ( ) ; } | Gets the high water mark of a source . |
12,757 | public long getLWMScn ( String source ) { WaterMarkEntry e = sourceWaterMarkMap . get ( source ) ; return ( e == null ) ? 0 : e . getLWMScn ( ) ; } | Gets the low water mark of a source . |
12,758 | public void setLWMScn ( String source , long scn ) { WaterMarkEntry e = sourceWaterMarkMap . get ( source ) ; if ( e == null ) { e = new WaterMarkEntry ( source ) ; sourceWaterMarkMap . put ( source , e ) ; } e . setLWMScn ( scn ) ; } | Sets the low water mark of a source |
12,759 | public void setWaterMarks ( String source , long lwmScn , long hwmScn ) { WaterMarkEntry e = sourceWaterMarkMap . get ( source ) ; if ( e == null ) { e = new WaterMarkEntry ( source ) ; sourceWaterMarkMap . put ( source , e ) ; } e . setLWMScn ( lwmScn ) ; e . setHWMScn ( hwmScn ) ; } | Sets the water marks of a source . |
12,760 | public boolean syncWaterMarks ( String source , long lwmScn , long hwmScn ) { setWaterMarks ( source , lwmScn , hwmScn ) ; return flush ( ) ; } | Sets and flushes the water marks of a source . |
12,761 | public boolean syncWaterMarks ( ) { for ( String source : sourceWaterMarkMap . keySet ( ) ) { WaterMarkEntry wmEntry = sourceWaterMarkMap . get ( source ) ; wmEntry . setLWMScn ( wmEntry . getHWMScn ( ) ) ; } return flush ( ) ; } | Sync up low water marks to high water marks for all the sources . |
12,762 | public boolean flush ( ) { boolean ret = true ; PrintWriter out = null ; try { if ( file . exists ( ) ) { if ( fileOriginal . exists ( ) ) { fileOriginal . delete ( ) ; } file . renameTo ( fileOriginal ) ; } out = new PrintWriter ( new FileOutputStream ( file ) ) ; for ( String source : sourceWaterMarkMap . keySet ( ) ... | Flushes low water marks and high water marks for all the sources . |
12,763 | public void clear ( ) { sourceWaterMarkMap . clear ( ) ; flush ( ) ; if ( fileOriginal != null && fileOriginal . exists ( ) ) { fileOriginal . delete ( ) ; } } | Clears SourceWaterMark . |
12,764 | synchronized void loadImageIfNecessary ( final boolean isInLayoutPass ) { int width = getWidth ( ) ; int height = getHeight ( ) ; boolean wrapWidth = false , wrapHeight = false ; if ( getLayoutParams ( ) != null ) { wrapWidth = getLayoutParams ( ) . width == LayoutParams . WRAP_CONTENT ; wrapHeight = getLayoutParams ( ... | Loads the image for the view if it isn t already loaded . |
12,765 | public static PIXManagerAuditor getAuditor ( ) { AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( PIXManagerAuditor ) ctx . getAuditor ( PIXManagerAuditor . class ) ; } | Get an instance of the PIX Manager Auditor from the global context |
12,766 | private String getAnnotations ( final Properties properties , final String stringFromClient ) throws IOException , JDOMException { BufferedReader breader ; KAFDocument kaf ; String kafString = null ; String lang = properties . getProperty ( "language" ) ; String outputFormat = properties . getProperty ( "outputFormat" ... | Get tokens . |
12,767 | public static < T > Class < ? > [ ] resolveGenerics ( Class < T > superType , Class < ? extends T > subType ) { checkNotNull ( superType , "superType should not be null" ) ; checkNotNull ( subType , "subType should not be null" ) ; Class < ? > subTypeWithoutProxy = ProxyUtils . cleanProxy ( subType ) ; return TypeResol... | Resolve generics of a class relatively to a superclass . |
12,768 | @ SuppressWarnings ( "unchecked" ) public static < A extends AggregateRoot < I > , I > Class < I > resolveAggregateIdClass ( Class < A > aggregateRootClass ) { checkNotNull ( aggregateRootClass , "aggregateRootClass should not be null" ) ; return ( Class < I > ) resolveGenerics ( AggregateRoot . class , aggregateRootCl... | Returns the identifier class for an aggregate root class . |
12,769 | public static Class < ? > [ ] getAggregateIdClasses ( Class < ? extends AggregateRoot < ? > > [ ] aggregateRootClasses ) { checkNotNull ( aggregateRootClasses , "aggregateRootClasses should not be null" ) ; Class < ? > [ ] result = new Class < ? > [ aggregateRootClasses . length ] ; for ( int i = 0 ; i < aggregateRootC... | Returns an arrays of all identifier class corresponding the the given array of aggregate root classes . |
12,770 | @ SuppressWarnings ( "unchecked" ) public static < T > Stream < Class < ? extends T > > streamClasses ( Collection < Class < ? > > classes , Class < ? extends T > baseClass ) { return classes . stream ( ) . filter ( ClassPredicates . classIsDescendantOf ( baseClass ) ) . map ( c -> ( Class < T > ) c ) ; } | Checks that classes satisfying a specification are assignable to a base class and return a typed stream of it . |
12,771 | public static Optional < Annotation > getQualifier ( AnnotatedElement annotatedElement ) { AnnotatedElement cleanedAnnotatedElement ; if ( annotatedElement instanceof Class < ? > ) { cleanedAnnotatedElement = ProxyUtils . cleanProxy ( ( Class < ? > ) annotatedElement ) ; } else { cleanedAnnotatedElement = annotatedElem... | Optionally returns the qualifier annotation of a class . |
12,772 | @ SuppressWarnings ( "unchecked" ) public static < T > Optional < Key < T > > resolveDefaultQualifier ( Map < Key < ? > , Class < ? > > bindings , ClassConfiguration < ? > classConfiguration , String property , Class < ? > qualifiedClass , TypeLiteral < T > genericInterface ) { Key < T > key = null ; if ( classConfigur... | Returns the Guice key qualified with the default qualifier configured for the specified class . |
12,773 | @ SuppressWarnings ( "unchecked" ) public static Set < Class < ? extends AggregateRoot < ? > > > includeSuperClasses ( Collection < Class < ? extends AggregateRoot > > aggregateClasses ) { Set < Class < ? extends AggregateRoot < ? > > > results = new HashSet < > ( ) ; for ( Class < ? > aggregateClass : aggregateClasses... | Walks the class hierarchy of each class in the given collection and adds its superclasses to the mix . |
12,774 | public void tokenizeToKAF ( final KAFDocument kaf ) throws IOException { int noSents = 0 ; int noParas = 1 ; List < List < Token > > tokens ; if ( isNoSeg ) { String [ ] sentences = text . toArray ( new String [ text . size ( ) ] ) ; tokens = tokenizer . tokenize ( sentences ) ; } else { final String [ ] sentences = se... | Tokenize document to NAF . |
12,775 | public String tokenizeToText ( ) { final StringBuilder sb = new StringBuilder ( ) ; if ( isNoSeg ) { String [ ] sentences = text . toArray ( new String [ text . size ( ) ] ) ; final List < List < Token > > tokens = tokenizer . tokenize ( sentences ) ; for ( final List < Token > tokSentence : tokens ) { for ( final Toke... | Tokenize and Segment input text . Outputs tokens in running text format one sentence per line . |
12,776 | void packageArtifacts ( final File compileDir , final MavenProject project , final Set < String > bundles ) throws IOException , XCodeException { File mainArtifact = createMainArtifactFile ( project ) ; attachBundle ( compileDir , project , bundles , mainArtifact ) ; final File mainArtifactFile = archiveMainArtifact ( ... | Packages all the artifacts . The main artifact is set and all side artifacts are attached for deployment . |
12,777 | Collection < BindingStrategy > collectFromAggregates ( Collection < Class < ? extends AggregateRoot > > aggregateClasses ) { Collection < BindingStrategy > bindingStrategies = new ArrayList < > ( ) ; Map < Type [ ] , Key < ? > > allGenerics = new HashMap < > ( ) ; for ( Class < ? extends AggregateRoot < ? > > aggregate... | Prepares the binding strategies which bind default repositories . The specificity here is that it could have multiple implementations of default repository i . e . one per persistence . |
12,778 | @ SuppressWarnings ( "unchecked" ) public static < T extends Class < ? > > Map < T , Specification < ? extends T > > classpathRequestForDescendantTypesOf ( ClasspathScanRequestBuilder classpathScanRequestBuilder , Collection < T > interfaces ) { Map < T , Specification < ? extends T > > specsByInterface = new HashMap <... | Builds a ClasspathScanRequest to find all the descendant of the given interfaces . |
12,779 | public final void run ( final String [ ] args ) throws IOException , JDOMException { try { Parameters parameters = cliArgumentsParser . parse ( args ) ; if ( parameters . getStrategy ( ) == Strategy . TOKENIZE ) { annotate ( parameters ) ; } else if ( parameters . getStrategy ( ) == Strategy . SERVER ) { server ( param... | Run the appropriate command based on the command line parameters . |
12,780 | public SortOption add ( String attribute , Direction direction ) { sortedAttributes . add ( new SortedAttribute ( attribute , direction ) ) ; return this ; } | Adds the specified attribute to the list of sorted attributes with the specified direction . |
12,781 | public < T > Comparator < T > buildComparator ( ) { if ( sortedAttributes . isEmpty ( ) ) { return ( o1 , o2 ) -> 0 ; } else { Comparator < T > comparator = null ; for ( SortedAttribute sortedAttribute : sortedAttributes ) { if ( comparator == null ) { comparator = buildComparator ( sortedAttribute ) ; } else { compara... | Builds a comparator allowing the sorting of objects according to the sort criteria . |
12,782 | private int findPartnerNodeId ( Tree < Row > current , Type type ) { switch ( type ) { case JOIN_FIRST : case JOIN_ALL : case WHILE_DO_END : return current . getPrevious ( ) . getContent ( ) . getId ( ) ; case DO_WHILE_BEGIN : return current . getNext ( ) . getContent ( ) . getMainElement ( ) . getId ( ) ; case END_IF ... | Some node producing elements do not define an id themselves but deduce their id based on their block - opening or block - closing partner . E . g . a WHILE_DO_END deduces its id based on its WHILE_DO_BEGIN partner . |
12,783 | protected File zipSubfolder ( File rootDir , String zipSubFolder , String zipFileName , String archiveFolder ) throws MojoExecutionException { int resultCode = 0 ; try { File scriptDirectory = new File ( project . getBuild ( ) . getDirectory ( ) , "scripts" ) . getCanonicalFile ( ) ; scriptDirectory . deleteOnExit ( ) ... | Calls a shell script in order to zip a folder . We have to call a shell script as Java cannot zip symbolic links . |
12,784 | @ RequestMapping ( method = RequestMethod . GET , value = "/workflowInstance/search" , produces = { MediaType . APPLICATION_JSON_VALUE , MediaType . TEXT_XML_VALUE } ) public ResponseEntity < List < WorkflowInstanceRestModel > > findInstances ( @ RequestParam ( required = false ) String label1 , @ RequestParam ( requir... | Searches workflow instance s that match the given criteria . |
12,785 | public SmiSymbol resolveReference ( IdToken idToken , XRefProblemReporter reporter ) { SmiSymbol result = findSymbol ( idToken . getId ( ) ) ; if ( result == null ) { result = findImportedSymbol ( idToken . getId ( ) ) ; } if ( result == null ) { List < SmiSymbol > symbols = getMib ( ) . getSymbols ( ) . findAll ( idTo... | Resolves a reference from within this module to a symbol in the same module an imported module or in the whole mib |
12,786 | public SmiOidNode findByOidPrefix ( int ... oid ) { SmiOidNode parent = getRootNode ( ) ; for ( int subId : oid ) { SmiOidNode result = parent . findChild ( subId ) ; if ( result == null ) { return parent ; } parent = result ; } return null ; } | This method can be used to find the best match for an OID . By comparing the length of the OID of the result and the input OID you can determine how many and which subIds where not matched . |
12,787 | private static void validateReservedVariableNames ( Graph graph , List < String > errors ) { for ( Node node : graph . getNodes ( ) ) { if ( node instanceof BeanAsyncCallActivity ) { validateReservedVariablesFromMapping ( ( ( BeanAsyncCallActivity ) node ) . getResultMapping ( ) , graph , node , errors ) ; } else if ( ... | check through all the node types which use mappings which set Environment attributes |
12,788 | public SmiType createIntegerType ( IdToken idToken , IntKeywordToken intToken , Token applicationTagToken , List < SmiNamedNumber > namedNumbers , List < SmiRange > rangeConstraints ) { if ( idToken == null && intToken . getPrimitiveType ( ) == INTEGER && namedNumbers == null && rangeConstraints == null ) { return SmiC... | and resolve references to INTEGER BITS ... during the XRef phase |
12,789 | public static String asString ( Boolean flag ) { return flag == null ? null : ( flag ? YES_AS_STRING : NO_AS_STRING ) ; } | Converts the given flag into a string of either Y N or null . |
12,790 | public static Boolean asBoolean ( String flag ) { return flag == null ? null : flag . equals ( YES_AS_STRING ) ; } | Converts the given string into a Boolean flag of either true false or null . |
12,791 | protected PListAccessor getInfoPListAccessor ( XCodeContext . SourceCodeLocation location , String configuration , String sdk ) throws MojoExecutionException , XCodeException { File plistFile = getPListFile ( location , configuration , sdk ) ; if ( ! plistFile . isFile ( ) ) { throw new MojoExecutionException ( "The Xc... | Retrieves the Info Plist out of the effective Xcode project settings and returns the accessor to it . |
12,792 | public List < WorkUnit > findNewWorkUnits ( Date now , String clusterName ) { if ( sqlCache == null || ! ObjectUtils . equals ( cachedSqlClusterName , clusterName ) ) { sqlCache = getSql ( clusterName ) ; cachedSqlClusterName = clusterName ; } Object [ ] args = { now } ; return getJdbcTemplate ( ) . query ( sqlCache , ... | Retrieves the list of work units that can be performed at the given date . |
12,793 | @ SuppressWarnings ( "unchecked" ) public static < T extends Tuple > T create ( Object ... objects ) { Class < ? extends Tuple > tupleClass = classOfTuple ( objects . length ) ; try { return ( T ) tupleClass . getMethod ( "fromArray" , Object [ ] . class ) . invoke ( null , new Object [ ] { objects } ) ; } catch ( NoSu... | Builds a tuple from an array of objects . |
12,794 | public static Class < ? extends Tuple > classOfTuple ( int cardinality ) { switch ( cardinality ) { case 1 : return Unit . class ; case 2 : return Pair . class ; case 3 : return Triplet . class ; case 4 : return Quartet . class ; case 5 : return Quintet . class ; case 6 : return Sextet . class ; case 7 : return Septet ... | Returns the tuple class corresponding to the specified cardinality . |
12,795 | @ SuppressWarnings ( "unchecked" ) public static < T > Class < T > [ ] itemClasses ( Tuple tuple ) { Class < ? > [ ] itemClasses = new Class [ tuple . getSize ( ) ] ; int index = 0 ; for ( Object o : tuple ) { itemClasses [ index ++ ] = o . getClass ( ) ; } return ( Class < T > [ ] ) itemClasses ; } | Returns a list containing the classes of the elements of the tuple . |
12,796 | private String buildMessage ( String rawMessage ) { StringBuilder msg = new StringBuilder ( ) ; if ( changeLogName != null ) { msg . append ( changeLogName ) . append ( ": " ) ; } if ( changeSetName != null ) { msg . append ( changeSetName . replace ( changeLogName + "::" , "" ) ) . append ( ": " ) ; } msg . append ( r... | Build a log message with optional data if it exists . |
12,797 | public String toSqlString ( Object value ) { if ( value == null ) { return "null" ; } String val = String . valueOf ( value ) ; if ( value instanceof Integer || value instanceof Float || value instanceof Double || value instanceof Long ) { return val ; } else if ( value instanceof Boolean ) { return "'" + ( ( Boolean )... | Convert value object to sanitized SQL string |
12,798 | private static void createDirectory ( final File directory ) throws MojoExecutionException { try { com . sap . prd . mobile . ios . mios . FileUtils . deleteDirectory ( directory ) ; } catch ( IOException ex ) { throw new MojoExecutionException ( "" , ex ) ; } if ( ! directory . mkdirs ( ) ) throw new MojoExecutionExce... | Creates a directory . If the directory already exists the directory is deleted beforehand . |
12,799 | private Tree < Row > downRight ( Element token ) { return current = current . addChild ( Tree . of ( new Row ( token ) ) ) ; } | Starts a new row one indentation level to the right . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.