idx
int64 0
41.2k
| question
stringlengths 74
4.21k
| target
stringlengths 5
888
|
---|---|---|
40,500 |
public static String pathMatch ( String pathSpec , String path ) { char c = pathSpec . charAt ( 0 ) ; if ( c == '/' ) { if ( pathSpec . length ( ) == 1 ) return path ; if ( pathSpec . equals ( path ) ) return path ; if ( pathSpec . endsWith ( "/*" ) && pathSpec . regionMatches ( 0 , path , 0 , pathSpec . length ( ) - 2 ) ) return path . substring ( 0 , pathSpec . length ( ) - 2 ) ; if ( path . startsWith ( pathSpec ) && path . charAt ( pathSpec . length ( ) ) == ';' ) return path ; } else if ( c == '*' ) { if ( path . regionMatches ( path . length ( ) - ( pathSpec . length ( ) - 1 ) , pathSpec , 1 , pathSpec . length ( ) - 1 ) ) return path ; } return null ; }
|
Return the portion of a path that matches a path spec .
|
40,501 |
public static String pathInfo ( String pathSpec , String path ) { char c = pathSpec . charAt ( 0 ) ; if ( c == '/' ) { if ( pathSpec . length ( ) == 1 ) return null ; if ( pathSpec . equals ( path ) ) return null ; if ( pathSpec . endsWith ( "/*" ) && pathSpec . regionMatches ( 0 , path , 0 , pathSpec . length ( ) - 2 ) ) { if ( path . length ( ) == pathSpec . length ( ) - 2 ) return null ; return path . substring ( pathSpec . length ( ) - 2 ) ; } } return null ; }
|
Return the portion of a path that is after a path spec .
|
40,502 |
public static String relativePath ( String base , String pathSpec , String path ) { String info = pathInfo ( pathSpec , path ) ; if ( info == null ) info = path ; if ( info . startsWith ( "./" ) ) info = info . substring ( 2 ) ; if ( base . endsWith ( "/" ) ) if ( info . startsWith ( "/" ) ) path = base + info . substring ( 1 ) ; else path = base + info ; else if ( info . startsWith ( "/" ) ) path = base + info ; else path = base + "/" + info ; return path ; }
|
Relative path .
|
40,503 |
public static void ignore ( Log log , Throwable th ) { if ( log . isTraceEnabled ( ) ) log . trace ( IGNORED , th ) ; }
|
Ignore an exception unless trace is enabled . This works around the problem that log4j does not support the trace level .
|
40,504 |
public int verify ( RRset set , Cache cache ) { Iterator sigs = set . sigs ( ) ; if ( Options . check ( "verbosesec" ) ) System . out . print ( "Verifying " + set . getName ( ) + "/" + Type . string ( set . getType ( ) ) + ": " ) ; if ( ! sigs . hasNext ( ) ) { if ( Options . check ( "verbosesec" ) ) System . out . println ( "Insecure" ) ; return DNSSEC . Insecure ; } while ( sigs . hasNext ( ) ) { RRSIGRecord sigrec = ( RRSIGRecord ) sigs . next ( ) ; if ( verifySIG ( set , sigrec , cache ) == DNSSEC . Secure ) { if ( Options . check ( "verbosesec" ) ) System . out . println ( "Secure" ) ; return DNSSEC . Secure ; } } if ( Options . check ( "verbosesec" ) ) System . out . println ( "Failed" ) ; return DNSSEC . Failed ; }
|
Attempts to verify an RRset . This does not modify the set .
|
40,505 |
public int readU16 ( ) throws WireParseException { require ( 2 ) ; int b1 = array [ pos ++ ] & 0xFF ; int b2 = array [ pos ++ ] & 0xFF ; return ( ( b1 << 8 ) + b2 ) ; }
|
Reads an unsigned 16 bit value from the stream as an int .
|
40,506 |
public long readU32 ( ) throws WireParseException { require ( 4 ) ; int b1 = array [ pos ++ ] & 0xFF ; int b2 = array [ pos ++ ] & 0xFF ; int b3 = array [ pos ++ ] & 0xFF ; int b4 = array [ pos ++ ] & 0xFF ; return ( ( ( long ) b1 << 24 ) + ( b2 << 16 ) + ( b3 << 8 ) + b4 ) ; }
|
Reads an unsigned 32 bit value from the stream as a long .
|
40,507 |
private static long simulate ( long bytesPerSecond , long latency , int bytes , long timeTaken , boolean roundUp ) { if ( bytesPerSecond <= 0 ) { return 0 ; } double d = ( ( double ) bytes / bytesPerSecond ) * 1000 ; long expectedTime = ( long ) ( roundUp ? Math . ceil ( d ) : Math . floor ( d ) ) + latency ; long diff = expectedTime - timeTaken ; if ( diff > 0 ) { StreamManager . threadSleep ( diff ) ; } return diff ; }
|
to adjust the waiting time
|
40,508 |
public static X509Certificate mitmDuplicateCertificate ( final X509Certificate originalCert , final PublicKey newPubKey , final X509Certificate caCert , final PrivateKey caPrivateKey , Set < String > extensionOidsNotToCopy ) throws CertificateParsingException , SignatureException , InvalidKeyException , CertificateException , NoSuchAlgorithmException , NoSuchProviderException { if ( extensionOidsNotToCopy == null ) { extensionOidsNotToCopy = new HashSet < String > ( ) ; } X509V3CertificateGenerator v3CertGen = new X509V3CertificateGenerator ( ) ; v3CertGen . setSubjectDN ( originalCert . getSubjectX500Principal ( ) ) ; v3CertGen . setSignatureAlgorithm ( CertificateCreator . SIGN_ALGO ) ; v3CertGen . setPublicKey ( newPubKey ) ; v3CertGen . setNotAfter ( originalCert . getNotAfter ( ) ) ; v3CertGen . setNotBefore ( originalCert . getNotBefore ( ) ) ; v3CertGen . setIssuerDN ( caCert . getSubjectX500Principal ( ) ) ; v3CertGen . setSerialNumber ( originalCert . getSerialNumber ( ) ) ; Set < String > critExts = originalCert . getCriticalExtensionOIDs ( ) ; if ( critExts != null ) { for ( String oid : critExts ) { if ( ! clientCertOidsNeverToCopy . contains ( oid ) && ! extensionOidsNotToCopy . contains ( oid ) ) { v3CertGen . copyAndAddExtension ( new DERObjectIdentifier ( oid ) , true , originalCert ) ; } } } Set < String > nonCritExs = originalCert . getNonCriticalExtensionOIDs ( ) ; if ( nonCritExs != null ) { for ( String oid : nonCritExs ) { if ( ! clientCertOidsNeverToCopy . contains ( oid ) && ! extensionOidsNotToCopy . contains ( oid ) ) { v3CertGen . copyAndAddExtension ( new DERObjectIdentifier ( oid ) , false , originalCert ) ; } } } v3CertGen . addExtension ( X509Extensions . SubjectKeyIdentifier , false , new SubjectKeyIdentifierStructure ( newPubKey ) ) ; v3CertGen . addExtension ( X509Extensions . AuthorityKeyIdentifier , false , new AuthorityKeyIdentifierStructure ( caCert . getPublicKey ( ) ) ) ; X509Certificate cert = v3CertGen . generate ( caPrivateKey , "BC" ) ; return cert ; }
|
This method creates an X509v3 certificate based on an an existing certificate . It attempts to create as faithful a copy of the existing certificate as possible by duplicating all certificate extensions .
|
40,509 |
public static X509Certificate mitmDuplicateCertificate ( final X509Certificate originalCert , final PublicKey newPubKey , final X509Certificate caCert , final PrivateKey caPrivateKey ) throws CertificateParsingException , SignatureException , InvalidKeyException , CertificateExpiredException , CertificateNotYetValidException , CertificateException , NoSuchAlgorithmException , NoSuchProviderException { return mitmDuplicateCertificate ( originalCert , newPubKey , caCert , caPrivateKey , clientCertDefaultOidsNotToCopy ) ; }
|
Convenience method for the most common case of certificate duplication .
|
40,510 |
public static void copyThread ( InputStream in , OutputStream out ) { try { instance ( ) . run ( new Job ( in , out ) ) ; } catch ( InterruptedException e ) { log . warn ( LogSupport . EXCEPTION , e ) ; } }
|
Copy Stream in to Stream out until EOF or exception . in own thread
|
40,511 |
public static void copyThread ( Reader in , Writer out ) { try { instance ( ) . run ( new Job ( in , out ) ) ; } catch ( InterruptedException e ) { log . warn ( LogSupport . EXCEPTION , e ) ; } }
|
Copy Stream in to Stream out until EOF or exception in own thread
|
40,512 |
public static void copy ( Reader in , Writer out , long byteCount ) throws IOException { char buffer [ ] = new char [ bufferSize ] ; int len = bufferSize ; if ( byteCount >= 0 ) { while ( byteCount > 0 ) { if ( byteCount < bufferSize ) len = in . read ( buffer , 0 , ( int ) byteCount ) ; else len = in . read ( buffer , 0 , bufferSize ) ; if ( len == - 1 ) break ; byteCount -= len ; out . write ( buffer , 0 , len ) ; } } else { while ( true ) { len = in . read ( buffer , 0 , bufferSize ) ; if ( len == - 1 ) break ; out . write ( buffer , 0 , len ) ; } } }
|
Copy Reader to Writer for byteCount bytes or until EOF or exception .
|
40,513 |
static public TSIG fromString ( String str ) { String [ ] parts = str . split ( "[:/]" ) ; if ( parts . length < 2 || parts . length > 3 ) throw new IllegalArgumentException ( "Invalid TSIG key " + "specification" ) ; if ( parts . length == 3 ) return new TSIG ( parts [ 0 ] , parts [ 1 ] , parts [ 2 ] ) ; else return new TSIG ( HMAC_MD5 , parts [ 0 ] , parts [ 1 ] ) ; }
|
Creates a new TSIG object with the hmac - md5 algorithm which can be used to sign or verify a message .
|
40,514 |
public void setTimeZone ( TimeZone tz ) { setTzFormatString ( tz ) ; if ( _locale != null ) { _tzFormat = new SimpleDateFormat ( _tzFormatString , _locale ) ; _minFormat = new SimpleDateFormat ( _minFormatString , _locale ) ; } else if ( _dfs != null ) { _tzFormat = new SimpleDateFormat ( _tzFormatString , _dfs ) ; _minFormat = new SimpleDateFormat ( _minFormatString , _dfs ) ; } else { _tzFormat = new SimpleDateFormat ( _tzFormatString ) ; _minFormat = new SimpleDateFormat ( _minFormatString ) ; } _tzFormat . setTimeZone ( tz ) ; _minFormat . setTimeZone ( tz ) ; _lastSeconds = - 1 ; _lastMinutes = - 1 ; }
|
Set the timezone .
|
40,515 |
public synchronized String format ( long inDate ) { long seconds = inDate / 1000 ; if ( seconds < _lastSeconds || _lastSeconds > 0 && seconds > _lastSeconds + __hitWindow ) { _misses ++ ; if ( _misses < __MaxMisses ) { Date d = new Date ( inDate ) ; return _tzFormat . format ( d ) ; } } else if ( _misses > 0 ) _misses -- ; if ( _lastSeconds == seconds && ! _millis ) return _lastResult ; Date d = new Date ( inDate ) ; long minutes = seconds / 60 ; if ( _lastMinutes != minutes ) { _lastMinutes = minutes ; _secFormatString = _minFormat . format ( d ) ; int i ; int l ; if ( _millis ) { i = _secFormatString . indexOf ( "ss.SSS" ) ; l = 6 ; } else { i = _secFormatString . indexOf ( "ss" ) ; l = 2 ; } _secFormatString0 = _secFormatString . substring ( 0 , i ) ; _secFormatString1 = _secFormatString . substring ( i + l ) ; } _lastSeconds = seconds ; StringBuffer sb = new StringBuffer ( _secFormatString . length ( ) ) ; synchronized ( sb ) { sb . append ( _secFormatString0 ) ; int s = ( int ) ( seconds % 60 ) ; if ( s < 10 ) sb . append ( '0' ) ; sb . append ( s ) ; if ( _millis ) { long millis = inDate % 1000 ; if ( millis < 10 ) sb . append ( ".00" ) ; else if ( millis < 100 ) sb . append ( ".0" ) ; else sb . append ( '.' ) ; sb . append ( millis ) ; } sb . append ( _secFormatString1 ) ; _lastResult = sb . toString ( ) ; } return _lastResult ; }
|
Format a date according to our stored formatter .
|
40,516 |
public List getOptions ( int code ) { if ( options == null ) return Collections . EMPTY_LIST ; List list = null ; for ( Iterator it = options . iterator ( ) ; it . hasNext ( ) ; ) { Option opt = ( Option ) it . next ( ) ; if ( opt . code == code ) { if ( list == null ) list = new ArrayList ( ) ; list . add ( opt . data ) ; } } if ( list == null ) return Collections . EMPTY_LIST ; return list ; }
|
Gets all options in the OPTRecord with a specific code . This returns a list of byte arrays .
|
40,517 |
protected HttpConnection createConnection ( Socket socket ) throws IOException { HttpConnection c = new HttpConnection ( this , socket . getInetAddress ( ) , socket . getInputStream ( ) , socket . getOutputStream ( ) , socket ) ; return c ; }
|
Create an HttpConnection instance . This method can be used to override the connection instance .
|
40,518 |
public void persistConnection ( HttpConnection connection ) { try { Socket socket = ( Socket ) ( connection . getConnection ( ) ) ; if ( _lowResourcePersistTimeMs > 0 && isLowOnResources ( ) ) { socket . setSoTimeout ( _lowResourcePersistTimeMs ) ; connection . setThrottled ( true ) ; } else connection . setThrottled ( false ) ; } catch ( Exception e ) { LogSupport . ignore ( log , e ) ; } }
|
Persist the connection . This method is called by the HttpConnection in order to prepare a connection to be persisted . For this implementation if the listener is low on resources the connection read timeout is set to lowResourcePersistTimeMs . The customizeRequest method is used to reset this to the normal value after a request has been read .
|
40,519 |
public void resetStream ( ) throws IllegalStateException { if ( ( _deChunker != null && _deChunker . _chunkSize > 0 ) || _realIn . getByteLimit ( ) > 0 ) throw new IllegalStateException ( "Unread input" ) ; if ( log . isTraceEnabled ( ) ) log . trace ( "resetStream()" ) ; in = _realIn ; if ( _deChunker != null ) _deChunker . resetStream ( ) ; _chunking = false ; _realIn . setByteLimit ( - 1 ) ; }
|
Reset the stream . Turn chunking off and disable all filters .
|
40,520 |
public void setContentLength ( int len ) { if ( _chunking && len >= 0 && getExpectContinues ( ) == null ) throw new IllegalStateException ( "Chunking" ) ; _realIn . setByteLimit ( len ) ; }
|
Set the content length . Only this number of bytes can be read before EOF is returned .
|
40,521 |
public void fetchMetadata ( final String uuid , final DataSetMetadataCallback listener ) throws Exception { final DataSetMetadata metadata = clientDataSetManager . getDataSetMetadata ( uuid ) ; if ( metadata != null ) { listener . callback ( metadata ) ; } else if ( dataSetLookupServices != null ) { if ( remoteMetadataMap . containsKey ( uuid ) ) { listener . callback ( remoteMetadataMap . get ( uuid ) ) ; } else { dataSetLookupServices . call ( ( DataSetMetadata result ) -> { if ( result == null ) { listener . notFound ( ) ; } else { remoteMetadataMap . put ( uuid , result ) ; listener . callback ( result ) ; } } , ( message , throwable ) -> { return listener . onError ( new ClientRuntimeError ( throwable ) ) ; } ) . lookupDataSetMetadata ( uuid ) ; } } else { listener . notFound ( ) ; } }
|
Fetch the metadata instance for the specified data set .
|
40,522 |
public DataSetMetadata getMetadata ( String uuid ) { DataSetMetadata metadata = clientDataSetManager . getDataSetMetadata ( uuid ) ; if ( metadata != null ) { return metadata ; } return remoteMetadataMap . get ( uuid ) ; }
|
Get the cached metadata instance for the specified data set .
|
40,523 |
public void exportDataSetCSV ( final DataSetLookup request , final DataSetExportReadyCallback listener ) throws Exception { if ( dataSetLookupServices != null ) { if ( clientDataSetManager . getDataSet ( request . getDataSetUUID ( ) ) != null ) { DataSet dataSet = clientDataSetManager . lookupDataSet ( request ) ; dataSetExportServices . call ( new RemoteCallback < Path > ( ) { public void callback ( Path csvFilePath ) { listener . exportReady ( csvFilePath ) ; } } , new ErrorCallback < Message > ( ) { public boolean error ( Message message , Throwable throwable ) { listener . onError ( new ClientRuntimeError ( throwable ) ) ; return true ; } } ) . exportDataSetCSV ( dataSet ) ; } else { try { dataSetExportServices . call ( new RemoteCallback < Path > ( ) { public void callback ( Path csvFilePath ) { listener . exportReady ( csvFilePath ) ; } } , new ErrorCallback < Message > ( ) { public boolean error ( Message message , Throwable throwable ) { listener . onError ( new ClientRuntimeError ( throwable ) ) ; return true ; } } ) . exportDataSetCSV ( request ) ; } catch ( Exception e ) { listener . onError ( new ClientRuntimeError ( e ) ) ; } } } else { listener . onError ( new ClientRuntimeError ( CommonConstants . INSTANCE . exc_no_client_side_data_export ( ) ) ) ; } }
|
Export a data set specified by a data set lookup request to CSV format .
|
40,524 |
public void exportDataSetExcel ( final DataSetLookup request , final DataSetExportReadyCallback listener ) throws Exception { if ( dataSetLookupServices != null ) { if ( clientDataSetManager . getDataSet ( request . getDataSetUUID ( ) ) != null ) { DataSet dataSet = clientDataSetManager . lookupDataSet ( request ) ; try { dataSetExportServices . call ( new RemoteCallback < Path > ( ) { public void callback ( Path excelFilePath ) { listener . exportReady ( excelFilePath ) ; } } ) . exportDataSetExcel ( dataSet ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } else { try { dataSetExportServices . call ( new RemoteCallback < Path > ( ) { public void callback ( Path excelFilePath ) { listener . exportReady ( excelFilePath ) ; } } , new ErrorCallback < Message > ( ) { public boolean error ( Message message , Throwable throwable ) { listener . onError ( new ClientRuntimeError ( throwable ) ) ; return true ; } } ) . exportDataSetExcel ( request ) ; } catch ( Exception e ) { listener . onError ( new ClientRuntimeError ( e ) ) ; } } } else { listener . onError ( new ClientRuntimeError ( CommonConstants . INSTANCE . exc_no_client_side_data_export ( ) ) ) ; } }
|
Export a data set specified by a data set lookup request to Excel format .
|
40,525 |
public void newDataSet ( DataSetProviderType type , RemoteCallback < DataSetDef > callback ) throws Exception { dataSetDefServices . call ( callback ) . createDataSetDef ( type ) ; }
|
Creates a brand new data set definition for the provider type specified
|
40,526 |
public void lookupDataSet ( final DataSetDef def , final DataSetLookup request , final DataSetReadyCallback listener ) throws Exception { if ( dataSetLookupServices != null ) { try { dataSetLookupServices . call ( new RemoteCallback < DataSet > ( ) { public void callback ( DataSet result ) { if ( result == null ) { listener . notFound ( ) ; } else { listener . callback ( result ) ; } } } , new ErrorCallback < Message > ( ) { public boolean error ( Message message , Throwable throwable ) { return listener . onError ( new ClientRuntimeError ( throwable ) ) ; } } ) . lookupDataSet ( def , request ) ; } catch ( Exception e ) { listener . onError ( new ClientRuntimeError ( e ) ) ; } } else { listener . notFound ( ) ; } }
|
Process the specified data set lookup request for a given definition .
|
40,527 |
public void lookupDataSet ( final DataSetLookup request , final DataSetReadyCallback listener ) throws Exception { if ( clientDataSetManager . getDataSet ( request . getDataSetUUID ( ) ) != null ) { DataSet dataSet = clientDataSetManager . lookupDataSet ( request ) ; listener . callback ( dataSet ) ; } else if ( dataSetLookupServices != null ) { fetchMetadata ( request . getDataSetUUID ( ) , new DataSetMetadataCallback ( ) { public void callback ( DataSetMetadata metatada ) { DataSetDef dsetDef = metatada . getDefinition ( ) ; int estimatedSize = metatada . getEstimatedSize ( ) / 1000 ; boolean isPushable = dsetDef != null && dsetDef . isPushEnabled ( ) && estimatedSize < dsetDef . getPushMaxSize ( ) ; if ( pushRemoteDataSetEnabled && isPushable ) { DataSetPushHandler pushHandler = pushRequestMap . get ( request . getDataSetUUID ( ) ) ; if ( pushHandler == null ) { pushHandler = new DataSetPushHandler ( metatada ) ; DataSetLookup lookupSourceDataSet = new DataSetLookup ( request . getDataSetUUID ( ) ) ; _lookupDataSet ( lookupSourceDataSet , pushHandler ) ; } pushHandler . registerLookup ( request , listener ) ; } else { _lookupDataSet ( request , listener ) ; } } public void notFound ( ) { listener . notFound ( ) ; } public boolean onError ( final ClientRuntimeError error ) { return listener . onError ( error ) ; } } ) ; } else { listener . notFound ( ) ; } }
|
Process the specified data set lookup request .
|
40,528 |
void onFilterLabelRemoved ( String columnId , int row ) { super . filterUpdate ( columnId , row ) ; if ( ! displayerSettings . isFilterSelfApplyEnabled ( ) ) { updateVisualization ( ) ; } }
|
Filter label set component notifications
|
40,529 |
public void onFilterEnabled ( Displayer displayer , DataSetGroup groupOp ) { view . gotoFirstPage ( ) ; super . onFilterEnabled ( displayer , groupOp ) ; }
|
Reset the current navigation status on filter requests from external displayers
|
40,530 |
public void editOn ( ) { editOn = true ; for ( Displayer displayer : displayerCoordinator . getDisplayerList ( ) ) { displayer . setRefreshOn ( false ) ; } }
|
Turn on the edition of the perspective
|
40,531 |
public void onFilterEnabled ( Displayer displayer , DataSetGroup groupOp ) { String firstColumnId = dataSet . getColumnByIndex ( 0 ) . getId ( ) ; List < Integer > currentFilter = super . filterIndexes ( firstColumnId ) ; if ( currentFilter . isEmpty ( ) ) { if ( firstColumnId . equals ( groupOp . getColumnGroup ( ) . getColumnId ( ) ) ) { columnSelectionMap . put ( groupOp . getColumnGroup ( ) . getColumnId ( ) , groupOp . getSelectedIntervalList ( ) ) ; } super . onFilterEnabled ( displayer , groupOp ) ; } }
|
KEEP IN SYNC THE CURRENT SELECTION WITH ANY EXTERNAL FILTER
|
40,532 |
public void onFilterEnabled ( Displayer displayer , DataSetGroup groupOp ) { currentPage = 1 ; super . onFilterEnabled ( displayer , groupOp ) ; }
|
Reset the current navigation status on filter requests from external displayers .
|
40,533 |
public void onValueRestricted ( final String value ) { this . restrictedColumns . add ( value ) ; setEditorEnabled ( value , false , DataSetEditorConstants . INSTANCE . columnIsUsedInFilter ( ) ) ; }
|
Set the column that cannot be removed from the list as it s used by the filter .
|
40,534 |
public void onValueUnRestricted ( final String value ) { this . restrictedColumns . remove ( value ) ; if ( listEditor . getList ( ) . size ( ) == 1 ) { setEditorEnabled ( 0 , false , DataSetEditorConstants . INSTANCE . dataSetMustHaveAtLeastOneColumn ( ) ) ; } else { setEditorEnabled ( value , true , null ) ; } }
|
Set the column that can be removed again from the list as it s no longer used by the filter .
|
40,535 |
private boolean checkSingleColumnEditorDisabled ( ) { final int size = listEditor . getList ( ) . size ( ) ; final boolean hasEditors = ! listEditor . getEditors ( ) . isEmpty ( ) ; if ( size == 1 && hasEditors ) { setEditorEnabled ( 0 , false , DataSetEditorConstants . INSTANCE . dataSetMustHaveAtLeastOneColumn ( ) ) ; return true ; } return false ; }
|
Checks that if only single column used in data set - > it cannot be unselected .
|
40,536 |
private boolean checkMultipleColumnsEditorEnabled ( ) { final int size = listEditor . getList ( ) . size ( ) ; if ( size == 2 && ! listEditor . getEditors ( ) . isEmpty ( ) ) { final String cId = listEditor . getEditors ( ) . get ( 0 ) . id ( ) . getValue ( ) ; if ( ! restrictedColumns . contains ( cId ) ) { setEditorEnabled ( 0 , true , null ) ; } return true ; } return false ; }
|
Checks that if multiple columns are used in data set - > the column editors must be enabed if the columns are not are restricted .
|
40,537 |
public void setDisplayerSetting ( DisplayerAttributeDef displayerAttributeDef , String value ) { settings . put ( getSettingPath ( displayerAttributeDef ) , value ) ; }
|
Generic setter method
|
40,538 |
public void removeDisplayerSetting ( DisplayerAttributeGroupDef displayerAttributeGroup ) { for ( DisplayerAttributeDef attributeDef : displayerAttributeGroup . getChildren ( ) ) { settings . remove ( getSettingPath ( attributeDef ) ) ; } }
|
Generic remove method
|
40,539 |
public void draw ( ) { if ( googleRenderer == null ) { getPresenter ( ) . showError ( new ClientRuntimeError ( "Google renderer not set" ) ) ; } else if ( ! getPresenter ( ) . isDrawn ( ) ) { List < Displayer > displayerList = new ArrayList < Displayer > ( ) ; displayerList . add ( getPresenter ( ) ) ; googleRenderer . draw ( displayerList ) ; } }
|
GCharts drawing is performed asynchronously
|
40,540 |
void draw ( final DisplayerListener displayerListener ) { tableDisplayer . addListener ( displayerListener ) ; view . setDisplayer ( tableDisplayer ) ; tableDisplayer . draw ( ) ; }
|
Show the table displayer .
|
40,541 |
public void onPlugInAdded ( final PluginAdded event ) { Plugin plugin = event . getPlugin ( ) ; if ( isRuntimePerspective ( plugin ) ) { pluginMap . put ( plugin . getName ( ) , plugin ) ; perspectivesChangedEvent . fire ( new PerspectivePluginsChangedEvent ( ) ) ; } }
|
Sync up both the internals plugin & widget registry
|
40,542 |
public DataSetEditWorkflow edit ( final DataSetProviderType type ) { final boolean isSQL = type != null && DataSetProviderType . SQL . equals ( type ) ; final boolean isBean = type != null && DataSetProviderType . BEAN . equals ( type ) ; final boolean isCSV = type != null && DataSetProviderType . CSV . equals ( type ) ; final boolean isEL = type != null && DataSetProviderType . ELASTICSEARCH . equals ( type ) ; Class workflowClass = null ; if ( isSQL ) { workflowClass = SQLDataSetEditWorkflow . class ; } else if ( isCSV ) { workflowClass = CSVDataSetEditWorkflow . class ; } else if ( isBean ) { workflowClass = BeanDataSetEditWorkflow . class ; } else if ( isEL ) { workflowClass = ElasticSearchDataSetEditWorkflow . class ; } return ( DataSetEditWorkflow ) beanManager . lookupBean ( workflowClass ) . newInstance ( ) ; }
|
Obtain the bean for editing a data set definition for a given type .
|
40,543 |
public static String join ( Collection strings , String delimiter ) { StringBuilder builder = new StringBuilder ( ) ; Iterator < String > iter = strings . iterator ( ) ; while ( iter . hasNext ( ) ) { builder . append ( iter . next ( ) ) ; if ( ! iter . hasNext ( ) ) { break ; } builder . append ( delimiter ) ; } return builder . toString ( ) ; }
|
Joins a collection of string with a given delimiter .
|
40,544 |
public void draw ( ) { if ( displayerSettings == null ) { getView ( ) . errorMissingSettings ( ) ; } else if ( dataSetHandler == null ) { getView ( ) . errorMissingHandler ( ) ; } else if ( ! isDrawn ( ) ) { try { drawn = true ; getView ( ) . showLoading ( ) ; beforeLoad ( ) ; beforeDataSetLookup ( ) ; dataSetHandler . lookupDataSet ( new DataSetReadyCallback ( ) { public void callback ( DataSet result ) { try { dataSet = result ; afterLoad ( ) ; afterDataSetLookup ( result ) ; createVisualization ( ) ; getView ( ) . showVisualization ( ) ; String id = getDisplayerId ( ) ; if ( ! StringUtils . isBlank ( id ) ) { getView ( ) . setId ( id ) ; } afterDraw ( ) ; } catch ( Exception e ) { showError ( new ClientRuntimeError ( e ) ) ; } } public void notFound ( ) { getView ( ) . errorDataSetNotFound ( displayerSettings . getDataSetLookup ( ) . getDataSetUUID ( ) ) ; } public boolean onError ( final ClientRuntimeError error ) { showError ( error ) ; return false ; } } ) ; } catch ( Exception e ) { showError ( new ClientRuntimeError ( e ) ) ; } } }
|
Draw the displayer by executing first the lookup call to retrieve the target data set
|
40,545 |
public void redraw ( ) { if ( ! isDrawn ( ) ) { draw ( ) ; } else { try { beforeLoad ( ) ; beforeDataSetLookup ( ) ; dataSetHandler . lookupDataSet ( new DataSetReadyCallback ( ) { public void callback ( DataSet result ) { try { dataSet = result ; afterDataSetLookup ( result ) ; updateVisualization ( ) ; afterRedraw ( ) ; } catch ( Exception e ) { showError ( new ClientRuntimeError ( e ) ) ; } } public void notFound ( ) { String uuid = displayerSettings . getDataSetLookup ( ) . getDataSetUUID ( ) ; getView ( ) . errorDataSetNotFound ( uuid ) ; handleError ( "Data set not found: " + uuid ) ; } public boolean onError ( final ClientRuntimeError error ) { showError ( error ) ; return false ; } } ) ; } catch ( Exception e ) { showError ( new ClientRuntimeError ( e ) ) ; } } }
|
Just reload the data set and make the current displayer to redraw .
|
40,546 |
public List < Interval > filterIntervals ( String columnId ) { List < Interval > selected = columnSelectionMap . get ( columnId ) ; if ( selected == null ) { return new ArrayList < > ( ) ; } return selected ; }
|
Get the current filter intervals for the given data set column .
|
40,547 |
public Interval filterInterval ( String columnId , int idx ) { List < Interval > selected = columnSelectionMap . get ( columnId ) ; if ( selected != null && ! selected . isEmpty ( ) ) { for ( Interval interval : selected ) { if ( interval . getIndex ( ) == idx ) { return interval ; } } } return null ; }
|
Get the current filter interval matching the specified index
|
40,548 |
public List < Integer > filterIndexes ( String columnId ) { List < Integer > result = new ArrayList < > ( ) ; List < Interval > selected = columnSelectionMap . get ( columnId ) ; if ( selected == null ) { return result ; } for ( Interval interval : selected ) { result . add ( interval . getIndex ( ) ) ; } return result ; }
|
Get the current filter selected interval indexes for the given data set column .
|
40,549 |
public void filterUpdate ( String columnId , int row , Integer maxSelections ) { if ( displayerSettings . isFilterEnabled ( ) ) { List < Interval > selectedIntervals = columnSelectionMap . get ( columnId ) ; Interval intervalFiltered = filterInterval ( columnId , row ) ; if ( intervalFiltered != null ) { selectedIntervals . remove ( intervalFiltered ) ; if ( ! selectedIntervals . isEmpty ( ) ) { filterApply ( columnId , selectedIntervals ) ; } else { filterReset ( columnId ) ; } } else if ( selectedIntervals == null ) { Interval intervalSelected = dataSetHandler . getInterval ( columnId , row ) ; if ( intervalSelected != null ) { selectedIntervals = new ArrayList < > ( ) ; selectedIntervals . add ( intervalSelected ) ; columnSelectionMap . put ( columnId , selectedIntervals ) ; filterApply ( columnId , selectedIntervals ) ; } } else { Interval intervalSelected = dataSetHandler . getInterval ( columnId , row ) ; if ( intervalSelected != null ) { if ( displayerSettings . isFilterSelfApplyEnabled ( ) ) { selectedIntervals = new ArrayList < > ( ) ; columnSelectionMap . put ( columnId , selectedIntervals ) ; } selectedIntervals . add ( intervalSelected ) ; if ( maxSelections != null && maxSelections > 0 && selectedIntervals . size ( ) >= maxSelections ) { filterReset ( columnId ) ; } else { filterApply ( columnId , selectedIntervals ) ; } } } } }
|
Updates the current filter values for the given data set column .
|
40,550 |
public void filterApply ( String columnId , List < Interval > intervalList ) { if ( displayerSettings . isFilterEnabled ( ) ) { DataSetGroup groupOp = dataSetHandler . getGroupOperation ( columnId ) ; groupOp . setSelectedIntervalList ( intervalList ) ; if ( displayerSettings . isFilterNotificationEnabled ( ) ) { for ( DisplayerListener listener : listenerList ) { listener . onFilterEnabled ( this , groupOp ) ; } } if ( displayerSettings . isFilterSelfApplyEnabled ( ) ) { dataSetHandler . drillDown ( groupOp ) ; redraw ( ) ; } } }
|
Filter the values of the given column .
|
40,551 |
public void filterApply ( DataSetFilter filter ) { if ( displayerSettings . isFilterEnabled ( ) ) { this . currentFilter = filter ; if ( displayerSettings . isFilterNotificationEnabled ( ) ) { for ( DisplayerListener listener : listenerList ) { listener . onFilterEnabled ( this , filter ) ; } } if ( displayerSettings . isFilterSelfApplyEnabled ( ) ) { dataSetHandler . filter ( filter ) ; redraw ( ) ; } } }
|
Apply the given filter
|
40,552 |
public void filterUpdate ( DataSetFilter filter ) { if ( displayerSettings . isFilterEnabled ( ) ) { DataSetFilter oldFilter = currentFilter ; this . currentFilter = filter ; if ( displayerSettings . isFilterNotificationEnabled ( ) ) { for ( DisplayerListener listener : listenerList ) { listener . onFilterUpdate ( this , oldFilter , filter ) ; } } if ( displayerSettings . isFilterSelfApplyEnabled ( ) ) { dataSetHandler . unfilter ( oldFilter ) ; dataSetHandler . filter ( filter ) ; redraw ( ) ; } } }
|
Updates the current filter values for the given data set column . Any previous filter is reset .
|
40,553 |
public void filterReset ( String columnId ) { if ( displayerSettings . isFilterEnabled ( ) ) { columnSelectionMap . remove ( columnId ) ; DataSetGroup groupOp = dataSetHandler . getGroupOperation ( columnId ) ; if ( displayerSettings . isFilterNotificationEnabled ( ) ) { for ( DisplayerListener listener : listenerList ) { listener . onFilterReset ( this , Arrays . asList ( groupOp ) ) ; } } if ( displayerSettings . isFilterSelfApplyEnabled ( ) ) { dataSetHandler . drillUp ( groupOp ) ; redraw ( ) ; } } }
|
Clear any filter on the given column .
|
40,554 |
public void filterReset ( ) { if ( displayerSettings . isFilterEnabled ( ) ) { List < DataSetGroup > groupOpList = new ArrayList < DataSetGroup > ( ) ; for ( String columnId : columnSelectionMap . keySet ( ) ) { DataSetGroup groupOp = dataSetHandler . getGroupOperation ( columnId ) ; groupOpList . add ( groupOp ) ; } columnSelectionMap . clear ( ) ; if ( displayerSettings . isFilterNotificationEnabled ( ) ) { for ( DisplayerListener listener : listenerList ) { if ( currentFilter != null ) { listener . onFilterReset ( this , currentFilter ) ; } listener . onFilterReset ( this , groupOpList ) ; } } if ( displayerSettings . isFilterSelfApplyEnabled ( ) ) { boolean applied = false ; if ( currentFilter != null ) { if ( dataSetHandler . unfilter ( currentFilter ) ) { applied = true ; } } for ( DataSetGroup groupOp : groupOpList ) { if ( dataSetHandler . drillUp ( groupOp ) ) { applied = true ; } } if ( applied ) { redraw ( ) ; } } if ( currentFilter != null ) { currentFilter = null ; } } }
|
Clear any filter .
|
40,555 |
private void hideLoadingPopup ( ) { final Element e = RootPanel . get ( "loading" ) . getElement ( ) ; new Animation ( ) { protected void onUpdate ( double progress ) { e . getStyle ( ) . setOpacity ( 1.0 - progress ) ; } protected void onComplete ( ) { e . getStyle ( ) . setVisibility ( Style . Visibility . HIDDEN ) ; } } . run ( 500 ) ; }
|
Fade out the Loading application pop - up
|
40,556 |
public Image getSnapshot ( ) { String code = getBase64Image ( nativeCanvas ) ; if ( code == null ) return null ; Image image = new Image ( code ) ; return image ; }
|
Creates snapshot of current state of chart as image
|
40,557 |
protected static void printDataSet ( DataSet dataSet ) { final String SPACER = "| \t |" ; if ( dataSet == null ) System . out . println ( "DataSet is null" ) ; if ( dataSet . getRowCount ( ) == 0 ) System . out . println ( "DataSet is empty" ) ; List < DataColumn > dataSetColumns = dataSet . getColumns ( ) ; int colColunt = dataSetColumns . size ( ) ; int rowCount = dataSet . getRowCount ( ) ; System . out . println ( "********************************************************************************************************************************************************" ) ; for ( int row = 0 ; row < rowCount ; row ++ ) { System . out . print ( SPACER ) ; for ( int col = 0 ; col < colColunt ; col ++ ) { Object value = dataSet . getValueAt ( row , col ) ; String colId = dataSet . getColumnByIndex ( col ) . getId ( ) ; System . out . print ( colId + ": " + value ) ; System . out . print ( SPACER ) ; } System . out . println ( "" ) ; } System . out . println ( "********************************************************************************************************************************************************" ) ; }
|
Helper method to print to standard output the dataset values .
|
40,558 |
public void draw ( final List < Displayer > displayerList ) { Set < ChartPackage > packageList = EnumSet . noneOf ( ChartPackage . class ) ; for ( Displayer displayer : displayerList ) { try { GoogleDisplayer googleDisplayer = ( GoogleDisplayer ) displayer ; packageList . add ( _packageTypes . get ( googleDisplayer . getDisplayerSettings ( ) . getType ( ) ) ) ; } catch ( ClassCastException e ) { } } ChartPackage [ ] packageArray = new ChartPackage [ packageList . size ( ) ] ; int i = 0 ; for ( ChartPackage pkg : packageList ) { packageArray [ i ++ ] = pkg ; } ChartLoader chartLoader = new ChartLoader ( packageArray ) ; chartLoader . loadApi ( new Runnable ( ) { public void run ( ) { for ( Displayer displayer : displayerList ) { try { GoogleDisplayer googleDisplayer = ( GoogleDisplayer ) displayer ; googleDisplayer . ready ( ) ; } catch ( ClassCastException e ) { } } } } ) ; }
|
In Google the renderer mechanism is asynchronous .
|
40,559 |
public static Class < ? > getImplementationClassOfLocalName ( final String sLocalName ) { final EUBLTRDocumentType eDocType = getDocumentTypeOfLocalName ( sLocalName ) ; return eDocType == null ? null : eDocType . getImplementationClass ( ) ; }
|
Get the domain object class of the passed document element local name .
|
40,560 |
public static EUBLTRDocumentType getDocumentTypeOfImplementationClass ( final Class < ? > aImplClass ) { if ( aImplClass == null ) return null ; return ArrayHelper . findFirst ( EUBLTRDocumentType . values ( ) , eDocType -> eDocType . getImplementationClass ( ) . equals ( aImplClass ) ) ; }
|
Get the UBLTR document type matching the passed implementation class .
|
40,561 |
public static Schema getSchemaOfLocalName ( final String sLocalName ) { final EUBLTRDocumentType eDocType = getDocumentTypeOfLocalName ( sLocalName ) ; return eDocType == null ? null : eDocType . getSchema ( ) ; }
|
Get the XSD Schema object for the UBLTR document type of the passed document element local name .
|
40,562 |
public static Schema getSchemaOfImplementationClass ( final Class < ? > aImplClass ) { final EUBLTRDocumentType eDocType = getDocumentTypeOfImplementationClass ( aImplClass ) ; return eDocType == null ? null : eDocType . getSchema ( ) ; }
|
Get the XSD Schema object for the UBLTR document type of the passed implementation class .
|
40,563 |
public static Class < ? > getImplementationClassOfNamespace ( final String sNamespace ) { final EUBL21DocumentType eDocType = getDocumentTypeOfNamespace ( sNamespace ) ; return eDocType == null ? null : eDocType . getImplementationClass ( ) ; }
|
Get the domain object class of the passed namespace .
|
40,564 |
public static Schema getSchemaOfNamespace ( final String sNamespace ) { final EUBL21DocumentType eDocType = getDocumentTypeOfNamespace ( sNamespace ) ; return eDocType == null ? null : eDocType . getSchema ( ) ; }
|
Get the XSD Schema object for the UBL 2 . 1 document type of the passed namespace .
|
40,565 |
protected String getRoot ( ) { JsonObject result = ( ( JsonObject ) new JsonParser ( ) . parse ( raw ) ) ; String root = null ; for ( Map . Entry < String , JsonElement > member : result . entrySet ( ) ) { root = member . getKey ( ) ; } return root ; }
|
Get the name of the root JSON result
|
40,566 |
protected void attachSecurityInfo ( HttpRequestBase request ) throws IOException , URISyntaxException { if ( ! SECURITY_ENDPOINT_DOES_NOT_EXIST . equals ( securityToken ) ) { try { if ( securityToken == null ) { HttpGet httpGet = new HttpGet ( getWsapiUrl ( ) + SECURITY_TOKEN_URL ) ; httpGet . addHeader ( BasicScheme . authenticate ( credentials , "utf-8" , false ) ) ; GetResponse getResponse = new GetResponse ( doRequest ( httpGet ) ) ; JsonObject operationResult = getResponse . getObject ( ) ; JsonPrimitive securityTokenPrimitive = operationResult . getAsJsonPrimitive ( SECURITY_TOKEN_KEY ) ; securityToken = securityTokenPrimitive . getAsString ( ) ; } request . setURI ( new URIBuilder ( request . getURI ( ) ) . addParameter ( SECURITY_TOKEN_PARAM_KEY , securityToken ) . build ( ) ) ; } catch ( IOException e ) { securityToken = SECURITY_ENDPOINT_DOES_NOT_EXIST ; } } }
|
Attach the security token parameter to the request .
|
40,567 |
public CreateResponse create ( CreateRequest request ) throws IOException { return new CreateResponse ( client . doPost ( request . toUrl ( ) , request . getBody ( ) ) ) ; }
|
Create the specified object .
|
40,568 |
public UpdateResponse update ( UpdateRequest request ) throws IOException { return new UpdateResponse ( client . doPost ( request . toUrl ( ) , request . getBody ( ) ) ) ; }
|
Update the specified object .
|
40,569 |
public CollectionUpdateResponse updateCollection ( CollectionUpdateRequest request ) throws IOException { return new CollectionUpdateResponse ( client . doPost ( request . toUrl ( ) , request . getBody ( ) ) ) ; }
|
Update the specified collection . Note that this method is only usable with WSAPI versions 2 . 0 and above .
|
40,570 |
public DeleteResponse delete ( DeleteRequest request ) throws IOException { return new DeleteResponse ( client . doDelete ( request . toUrl ( ) ) ) ; }
|
Delete the specified object .
|
40,571 |
public QueryResponse query ( QueryRequest request ) throws IOException { QueryResponse queryResponse = new QueryResponse ( client . doGet ( request . toUrl ( ) ) ) ; if ( queryResponse . wasSuccessful ( ) ) { int receivedRecords = request . getPageSize ( ) ; while ( receivedRecords < request . getLimit ( ) && ( receivedRecords + request . getStart ( ) - 1 ) < queryResponse . getTotalResultCount ( ) ) { QueryRequest pageRequest = request . clone ( ) ; pageRequest . setStart ( receivedRecords + request . getStart ( ) ) ; QueryResponse pageResponse = new QueryResponse ( client . doGet ( pageRequest . toUrl ( ) ) ) ; if ( pageResponse . wasSuccessful ( ) ) { JsonArray results = queryResponse . getResults ( ) ; results . addAll ( pageResponse . getResults ( ) ) ; receivedRecords += pageRequest . getPageSize ( ) ; } } } return queryResponse ; }
|
Query for objects matching the specified request . By default one page of data will be returned . Paging will automatically be performed if a limit is set on the request .
|
40,572 |
public GetResponse get ( GetRequest request ) throws IOException { return new GetResponse ( client . doGet ( request . toUrl ( ) ) ) ; }
|
Get the specified object .
|
40,573 |
public static QueryFilter and ( QueryFilter ... queryFilters ) { QueryFilter result = null ; for ( QueryFilter q : queryFilters ) { result = result == null ? q : result . and ( q ) ; } return result ; }
|
Get a query filter that is the ANDed combination of the specified filters .
|
40,574 |
public static QueryFilter or ( QueryFilter ... queryFilters ) { QueryFilter result = null ; for ( QueryFilter q : queryFilters ) { result = result == null ? q : result . or ( q ) ; } return result ; }
|
Get a query filter that is the ORed combination of the specified filters .
|
40,575 |
public String getBody ( ) { JsonObject wrapper = new JsonObject ( ) ; wrapper . add ( type , obj ) ; return gsonBuilder . create ( ) . toJson ( wrapper ) ; }
|
Get the JSON encoded string representation of the object to be created .
|
40,576 |
public static String getRelativeRef ( String ref ) { Matcher matcher = match ( ref ) ; return matcher != null ? String . format ( "/%s/%s" , matcher . group ( 1 ) , matcher . group ( 2 ) ) : null ; }
|
Create a relative ref url from the specified ref
|
40,577 |
public static String getTypeFromRef ( String ref ) { Matcher matcher = match ( ref ) ; return matcher != null ? matcher . group ( 1 ) : null ; }
|
Get the type from the specified ref url
|
40,578 |
public static String getOidFromRef ( String ref ) { Matcher matcher = match ( ref ) ; return matcher != null ? matcher . group ( 2 ) : null ; }
|
Get the ObjectID from the specified ref url
|
40,579 |
public void addParam ( String name , String value ) { getParams ( ) . add ( new BasicNameValuePair ( name , value ) ) ; }
|
Add the specified parameter to this request .
|
40,580 |
public void setProxy ( URI proxy ) { this . getParams ( ) . setParameter ( ConnRoutePNames . DEFAULT_PROXY , new HttpHost ( proxy . getHost ( ) , proxy . getPort ( ) , proxy . getScheme ( ) ) ) ; }
|
Set the unauthenticated proxy server to use . By default no proxy is configured .
|
40,581 |
public String doPost ( String url , String body ) throws IOException { HttpPost httpPost = new HttpPost ( getWsapiUrl ( ) + url ) ; httpPost . setEntity ( new StringEntity ( body , "utf-8" ) ) ; return doRequest ( httpPost ) ; }
|
Perform a post against the WSAPI
|
40,582 |
public String doPut ( String url , String body ) throws IOException { HttpPut httpPut = new HttpPut ( getWsapiUrl ( ) + url ) ; httpPut . setEntity ( new StringEntity ( body , "utf-8" ) ) ; return doRequest ( httpPut ) ; }
|
Perform a put against the WSAPI
|
40,583 |
public String doDelete ( String url ) throws IOException { HttpDelete httpDelete = new HttpDelete ( getWsapiUrl ( ) + url ) ; return doRequest ( httpDelete ) ; }
|
Perform a delete against the WSAPI
|
40,584 |
public String doGet ( String url ) throws IOException { HttpGet httpGet = new HttpGet ( getWsapiUrl ( ) + url ) ; return doRequest ( httpGet ) ; }
|
Perform a get against the WSAPI
|
40,585 |
public FormElementController addElement ( FormElementController element , int position ) { if ( element instanceof FormSectionController ) { throw new IllegalArgumentException ( "Sub-sections are not supported" ) ; } if ( elements . containsKey ( element . getName ( ) ) ) { throw new IllegalArgumentException ( "Element with that name already exists" ) ; } else { elements . put ( element . getName ( ) , element ) ; orderedElements . add ( position , element ) ; return element ; } }
|
Adds a form element to this section . Note that sub - sections are not supported .
|
40,586 |
public FormElementController removeElement ( String name ) { FormElementController element = elements . remove ( name ) ; orderedElements . remove ( element ) ; return element ; }
|
Removes the form element with the specified name from this section .
|
40,587 |
public void setIsRequired ( boolean required ) { if ( ! required ) { validators . remove ( REQUIRED_FIELD_VALIDATOR ) ; } else if ( ! isRequired ( ) ) { validators . add ( REQUIRED_FIELD_VALIDATOR ) ; } }
|
Sets whether this field is required to have user input .
|
40,588 |
private Set < Object > retrieveModelValues ( ) { Set < Object > modelValues = ( Set < Object > ) getModel ( ) . getValue ( getName ( ) ) ; if ( modelValues == null ) { modelValues = new HashSet < > ( ) ; } return modelValues ; }
|
Returns the values hold in the model .
|
40,589 |
public int getNumberOfElements ( ) { int count = 0 ; for ( FormSectionController section : getSections ( ) ) { count += section . getElements ( ) . size ( ) ; } return count ; }
|
Returns the total number of elements in this form not including sections .
|
40,590 |
public List < ValidationError > validateInput ( ) { List < ValidationError > errors = new ArrayList < ValidationError > ( ) ; for ( FormSectionController section : getSections ( ) ) { for ( FormElementController element : section . getElements ( ) ) { if ( element instanceof LabeledFieldController ) { LabeledFieldController field = ( LabeledFieldController ) element ; errors . addAll ( field . validateInput ( ) ) ; } } } return errors ; }
|
Returns a list of validation errors of the form s input
|
40,591 |
protected void recreateViews ( ) { ViewGroup containerView = ( ViewGroup ) getActivity ( ) . findViewById ( R . id . form_elements_container ) ; formController . recreateViews ( containerView ) ; }
|
Recreates the views for all the elements that are in the form . This method needs to be called when field are dynamically added or removed
|
40,592 |
public File download ( String pathToFile , String extension ) { return fileDownloadRequest . download ( pathToFile , extension ) ; }
|
Download file from Selenium Node .
|
40,593 |
private void refreshAccessToken ( ) { final Long expiresIn = credential . getExpiresInSeconds ( ) ; String accessToken = credential . getAccessToken ( ) ; if ( accessToken == null || expiresIn != null && expiresIn <= 60 ) { try { credential . refreshToken ( ) ; accessToken = credential . getAccessToken ( ) ; } catch ( final IOException e ) { log . error ( "Failed to fetch access token" , e ) ; } } if ( accessToken != null ) { this . accessToken = accessToken ; } }
|
Refresh the Google Cloud API access token if necessary .
|
40,594 |
private < T > PubsubFuture < T > get ( final String operation , final String path , final ResponseReader < T > responseReader ) { return request ( operation , HttpMethod . GET , path , responseReader ) ; }
|
Make a GET request .
|
40,595 |
private < T > PubsubFuture < T > post ( final String operation , final String path , final Object payload , final ResponseReader < T > responseReader ) { return request ( operation , HttpMethod . POST , path , payload , responseReader ) ; }
|
Make a POST request .
|
40,596 |
private < T > PubsubFuture < T > put ( final String operation , final String path , final Object payload , final ResponseReader < T > responseReader ) { return request ( operation , HttpMethod . PUT , path , payload , responseReader ) ; }
|
Make a PUT request .
|
40,597 |
private < T > PubsubFuture < T > delete ( final String operation , final String path , final ResponseReader < T > responseReader ) { return request ( operation , HttpMethod . DELETE , path , responseReader ) ; }
|
Make a DELETE request .
|
40,598 |
public CompletableFuture < String > publish ( final String topic , final Message message ) { final TopicQueue queue = topics . computeIfAbsent ( topic , TopicQueue :: new ) ; final CompletableFuture < String > future = queue . send ( message ) ; listener . publishingMessage ( this , topic , message , future ) ; return future ; }
|
Publish a message on a specific topic .
|
40,599 |
public int topicQueueSize ( final String topic ) { final TopicQueue topicQueue = this . topics . get ( topic ) ; return topicQueue == null ? 0 : topicQueue . queue . size ( ) ; }
|
Get the current queue size for the given topic name . Returns 0 if the topic does not exist .
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.