idx
int64
0
41.2k
question
stringlengths
74
4.04k
target
stringlengths
7
750
19,700
public static List < ConfigObjectRecord > readRecordFromLDAP ( final ChaiEntry ldapEntry , final String attr , final String recordType , final Set guid1 , final Set guid2 ) throws ChaiOperationException , ChaiUnavailableException { if ( ldapEntry == null ) { throw new NullPointerException ( "ldapEntry can not be null" ...
Retreive matching config object records from the directory .
19,701
public static ChaiGroup createGroup ( final String parentDN , final String name , final ChaiProvider provider ) throws ChaiOperationException , ChaiUnavailableException { final String objectCN = findUniqueName ( name , parentDN , provider ) ; final StringBuilder entryDN = new StringBuilder ( ) ; entryDN . append ( "cn=...
Creates a new group entry in the ldap directory . A new groupOfNames object is created . The cn and description ldap attributes are set to the supplied name .
19,702
public static String findUniqueName ( final String baseName , final String containerDN , final ChaiProvider provider ) throws ChaiOperationException , ChaiUnavailableException { char ch ; final StringBuilder cnStripped = new StringBuilder ( ) ; final String effectiveBasename = ( baseName == null ) ? "" : baseName ; for...
Derives a unique entry name for an ldap container . Assumes CN as the naming attribute .
19,703
public static String entryToLDIF ( final ChaiEntry theEntry ) throws ChaiUnavailableException , ChaiOperationException { final StringBuilder sb = new StringBuilder ( ) ; sb . append ( "dn: " ) . append ( theEntry . getEntryDN ( ) ) . append ( "\n" ) ; final Map < String , Map < String , List < String > > > results = th...
Convert to an LDIF format . Useful for debugging or other purposes
19,704
public static DirectoryVendor determineDirectoryVendor ( final ChaiEntry rootDSE ) throws ChaiUnavailableException , ChaiOperationException { final Set < String > interestedAttributes = new HashSet < > ( ) ; for ( final DirectoryVendor directoryVendor : DirectoryVendor . values ( ) ) { interestedAttributes . addAll ( d...
Determines the vendor of a the ldap directory by reading RootDSE attributes .
19,705
static boolean isAuthenticationRelated ( final String message ) { for ( final DirectoryVendor vendor : DirectoryVendor . values ( ) ) { final ErrorMap errorMap = vendor . getVendorFactory ( ) . getErrorMap ( ) ; if ( errorMap . isAuthenticationRelated ( message ) ) { return true ; } } return false ; }
Indicates if the error is related to authentication .
19,706
public void setFilterNot ( final String attributeName , final String value ) { this . setFilter ( attributeName , value ) ; filter = "(!" + filter + ")" ; }
Set up a not exists filter for an attribute name and value pair .
19,707
public void setFilter ( final String attributeName , final String value ) { filter = new FilterSequence ( attributeName , value ) . toString ( ) ; }
Set up a standard filter attribute name and value pair .
19,708
public void setFilterOr ( final Map < String , String > nameValuePairs ) { if ( nameValuePairs == null ) { throw new NullPointerException ( ) ; } if ( nameValuePairs . size ( ) < 1 ) { throw new IllegalArgumentException ( "requires at least one key" ) ; } final List < FilterSequence > filters = new ArrayList < > ( ) ; ...
Set up an OR filter for each map key and value . Consider the following example .
19,709
public static boolean convertStrToBoolean ( final String string ) { return ! ( string == null || string . length ( ) < 1 ) && ( "true" . equalsIgnoreCase ( string ) || "1" . equalsIgnoreCase ( string ) || "yes" . equalsIgnoreCase ( string ) || "y" . equalsIgnoreCase ( string ) ) ; }
Convert a string value to a boolean . If the value is a common positive string value such as 1 true y or yes then TRUE is returned . For any other value or null FALSE is returned .
19,710
public byte [ ] getEncodedValue ( ) { final String characterEncoding = this . chaiConfiguration . getSetting ( ChaiSetting . LDAP_CHARACTER_ENCODING ) ; final byte [ ] password = modifyPassword . getBytes ( Charset . forName ( characterEncoding ) ) ; final byte [ ] dn = modifyDn . getBytes ( Charset . forName ( charact...
Get the BER encoded value for this operation .
19,711
public static void registerTypeConversion ( Conversion < ? > conversion ) { Object [ ] keys = conversion . getTypeKeys ( ) ; if ( keys == null ) { return ; } for ( int i = 0 ; i < keys . length ; i ++ ) { registerTypeConversion ( keys [ i ] , conversion ) ; } }
Register a type conversion object under the specified keys . This method can be used by developers to register custom type conversion objects .
19,712
private static List < Object > getTypeKeys ( Conversion < ? > conversion ) { List < Object > result = new ArrayList < Object > ( ) ; synchronized ( typeConversions ) { Map < Object , Conversion < ? > > map = new HashMap < Object , Conversion < ? > > ( typeConversions ) ; for ( Map . Entry < Object , Conversion < ? > > ...
Discover all the type key mappings for this conversion
19,713
private static Conversion < ? > getTypeConversion ( Object typeKey , Object value ) { if ( typeKey instanceof Class && ( ( Class ) typeKey ) != Object . class && ( ( Class ) typeKey ) . isInstance ( value ) ) { return IDENTITY_CONVERSION ; } return ( value instanceof Convertible ) ? ( ( Convertible ) value ) . getTypeC...
Obtain a conversion for the specified type key and value
19,714
public boolean getScrollableTracksViewportWidth ( ) { Component parent = getParent ( ) ; ComponentUI myui = getUI ( ) ; return parent == null || ( myui . getPreferredSize ( this ) . width <= parent . getSize ( ) . width ) ; }
to preserve the full width of the text
19,715
public int yToLine ( int y ) { FontMetrics fm = this . getFontMetrics ( this . getFont ( ) ) ; int height = fm . getHeight ( ) ; Document doc = this . getDocument ( ) ; int length = doc . getLength ( ) ; Element map = doc . getDefaultRootElement ( ) ; int startLine = map . getElementIndex ( 0 ) ; int endline = map . ge...
Converts a y co - ordinate to a line index .
19,716
public Campaign readFile ( String fileName ) throws Exception { Campaign result = new Campaign ( ) ; DocumentBuilderFactory dbf = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder db = dbf . newDocumentBuilder ( ) ; Document doc = db . parse ( fileName ) ; doc . getDocumentElement ( ) . normalize ( ) ; Element...
Read the xml campaign file
19,717
public boolean execute ( Campaign campaign ) { boolean campaignResult = true ; currentCampaign = campaign ; campaignStartTimeStamp = new Date ( ) ; try { createReport ( ) ; for ( CampaignRun run : currentCampaign . getRuns ( ) ) { if ( TestEngine . isAbortedByUser ( ) ) { break ; } currentTestBed = run . getTestbed ( )...
Executes a campaign
19,718
private void createReport ( ) { CampaignReportManager . getInstance ( ) . startReport ( campaignStartTimeStamp , currentCampaign . getName ( ) ) ; for ( CampaignRun run : currentCampaign . getRuns ( ) ) { CampaignResult result = new CampaignResult ( run . getTestbed ( ) ) ; result . setStatus ( Status . NOT_EXECUTED ) ...
Create a empty report . All campaign run will be Not Executed
19,719
public void open ( ) throws SQLException , ClassNotFoundException { logger . info ( "Using database driver: " + jdbcDriver ) ; Class . forName ( jdbcDriver ) ; logger . info ( "Using database.url: " + jdbcURL ) ; con = DriverManager . getConnection ( jdbcURL , user , password ) ; connected = true ; }
Open a JDBC connection to the database
19,720
public ResultSet executeQuery ( String query ) throws SQLException , ClassNotFoundException { if ( ! connected ) { open ( ) ; } Statement stmt = con . createStatement ( ) ; return stmt . executeQuery ( query ) ; }
Execute the specified query If the SQL connection if not open it will be opened automatically
19,721
public boolean executeCommand ( String query ) throws SQLException , ClassNotFoundException { if ( ! connected ) { open ( ) ; } Statement stmt = con . createStatement ( ) ; return stmt . execute ( query ) ; }
Execute the specified SQL command If the SQL connection if not open it will be opened automatically
19,722
public void doubleClick ( String fileName ) throws QTasteException { try { new Region ( this . rect ) . doubleClick ( fileName ) ; } catch ( Exception ex ) { throw new QTasteException ( ex . getMessage ( ) , ex ) ; } }
Simulates a double click on the specified image of the area .
19,723
public static Type getType ( ) { String osName = System . getProperty ( "os.name" ) . toLowerCase ( ) ; if ( osName . contains ( "windows" ) ) { return Type . WINDOWS ; } else if ( osName . contains ( "linux" ) ) { return Type . LINUX ; } else if ( osName . contains ( "mac" ) ) { return Type . MAC ; } return Type . UNK...
Get OS type .
19,724
public static void copyFiles ( File src , File dest ) throws IOException { if ( src . isDirectory ( ) ) { dest . mkdirs ( ) ; String list [ ] = src . list ( ) ; for ( String fileName : list ) { String dest1 = dest . getPath ( ) + "/" + fileName ; String src1 = src . getPath ( ) + "/" + fileName ; File src1_ = new File ...
The method copyFiles being defined
19,725
public static int collapseJTreeNode ( javax . swing . JTree tree , javax . swing . tree . TreeModel model , Object node , int row , int depth ) { if ( node != null && ! model . isLeaf ( node ) ) { tree . collapseRow ( row ) ; if ( depth != 0 ) { for ( int index = 0 ; row + 1 < tree . getRowCount ( ) && index < model . ...
Expands a given node in a JTree .
19,726
public static String getDocumentAsXmlString ( Document doc ) throws TransformerConfigurationException , TransformerException { DOMSource domSource = new DOMSource ( doc ) ; TransformerFactory tf = TransformerFactory . newInstance ( ) ; try { tf . setAttribute ( "indent-number" , 4 ) ; } catch ( IllegalArgumentException...
Return the XMLDocument formatted as a String
19,727
public boolean connect ( ) { if ( client . isConnected ( ) ) { logger . warn ( "Already connected" ) ; return true ; } try { logger . info ( "Connecting to remote host " + remoteHost ) ; client . connect ( remoteHost ) ; client . rlogin ( localUser , remoteUser , terminalType ) ; writer = new OutputStreamWriter ( clien...
Create a rlogin connection to the specified remote host .
19,728
public boolean reboot ( ) { if ( ! sendCommand ( "reboot" ) ) { return false ; } try { Thread . sleep ( 1000 ) ; } catch ( InterruptedException ex ) { } disconnect ( ) ; try ( Socket socket = new Socket ( ) ) { socket . bind ( null ) ; socket . connect ( new InetSocketAddress ( remoteHost , RLoginClient . DEFAULT_PORT ...
Reboot the remote host by sending the reboot command and check that the remote host is not accessible anymore .
19,729
public boolean sendCommand ( String command ) { if ( writer != null ) { try { logger . info ( "Sending command " + command + " to remote host " + remoteHost ) ; writer . write ( command ) ; writer . write ( '\r' ) ; writer . flush ( ) ; } catch ( IOException e ) { logger . fatal ( "Error while sending command " + comma...
Send the specified command to the remote host
19,730
public void disconnect ( ) { try { if ( client . isConnected ( ) ) { client . disconnect ( ) ; } if ( standardInputReaderThread != null ) { standardInputReaderThread = null ; } if ( outputReaderThread != null ) { outputReaderThread . join ( ) ; outputReaderThread = null ; } writer = null ; } catch ( InterruptedExceptio...
Disconnect the rlogin client from the remote host .
19,731
protected void paintDisabledText ( JLabel pLabel , Graphics pG , String pStr , int pTextX , int pTextY ) { Graphics2D g2 = ( Graphics2D ) pG ; pG . setColor ( Color . GRAY ) ; g2 . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; pG . drawString ( pStr , pTextX , pTextY ) ;...
private static final int SPACE_INC = 12 ;
19,732
public void close ( ) { if ( mWithBody ) { mOut . println ( "</BODY>" ) ; } mOut . println ( "</HTML>" ) ; mOut . close ( ) ; mOut = null ; }
Writes HTML body ending tag if needed and HTML footer and closes file .
19,733
public void printMethodsSummary ( ClassDoc classDoc ) { MethodDoc [ ] methodDocs = TestAPIDoclet . getTestAPIComponentMethods ( classDoc ) ; if ( methodDocs . length > 0 ) { mOut . println ( "<P>" ) ; mOut . println ( "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" CELLSPACING=\"0\" SUMMARY=\"\">" ) ; mOut . prin...
Prints summary of Test API methods excluding old - style verbs in HTML format .
19,734
private String getTypeString ( Type type ) { String typeQualifiedName = type . qualifiedTypeName ( ) . replaceFirst ( "^java\\.lang\\." , "" ) ; typeQualifiedName = typeQualifiedName . replaceFirst ( "^com\\.qspin\\.qtaste\\.testsuite\\.(QTaste\\w*Exception)" , "$1" ) ; String typeDocFileName = null ; if ( typeQualifie...
Returns type string .
19,735
private void printInlineTags ( Tag [ ] tags , ClassDoc classDoc ) { for ( Tag tag : tags ) { if ( ( tag instanceof SeeTag ) && tag . name ( ) . equals ( "@link" ) ) { SeeTag seeTag = ( SeeTag ) tag ; boolean sameClass = seeTag . referencedClass ( ) == classDoc ; String fullClassName = seeTag . referencedClassName ( ) ;...
Prints inline tags in HTML format .
19,736
private void updateSize ( ) { int newLineCount = ActionUtils . getLineCount ( pane ) ; if ( newLineCount == lineCount ) { return ; } lineCount = newLineCount ; int h = ( int ) pane . getPreferredSize ( ) . getHeight ( ) ; int d = ( int ) Math . log10 ( lineCount ) + 1 ; if ( d < 1 ) { d = 1 ; } int w = d * charWidth + ...
Update the size of the line numbers based on the length of the document
19,737
public JScrollPane getScrollPane ( JTextComponent editorPane ) { Container p = editorPane . getParent ( ) ; while ( p != null ) { if ( p instanceof JScrollPane ) { return ( JScrollPane ) p ; } p = p . getParent ( ) ; } return null ; }
Get the JscrollPane that contains an editor pane or null if none .
19,738
public static void copy ( File source , File dest ) throws IOException { if ( dest . isDirectory ( ) ) { dest = new File ( dest + File . separator + source . getName ( ) ) ; } FileChannel in = null , out = null ; try { in = new FileInputStream ( source ) . getChannel ( ) ; out = new FileOutputStream ( dest ) . getChann...
Fast and simple file copy .
19,739
public static String readFileContent ( String filename ) throws FileNotFoundException , IOException { BufferedReader reader = new BufferedReader ( new FileReader ( filename ) ) ; StringBuilder content = new StringBuilder ( ) ; String line ; final String eol = System . getProperty ( "line.separator" ) ; while ( ( line =...
Reads file content .
19,740
public static String [ ] listResourceFiles ( Class < ? > clazz , String resourceDirName ) throws URISyntaxException , IOException { if ( ! resourceDirName . endsWith ( "/" ) ) { resourceDirName = resourceDirName + "/" ; } URL dirURL = clazz . getResource ( resourceDirName ) ; if ( dirURL == null ) { throw new IOExcepti...
List directory files in a resource folder . Not recursive . Works for regular files and also JARs .
19,741
public boolean accept ( File f ) { if ( f != null ) { if ( f . isDirectory ( ) ) { return false ; } String extension = getExtension ( f ) ; if ( extension != null && filters . get ( getExtension ( f ) ) != null ) { return true ; } } return false ; }
Retourne true si le fichier doit etre montre dans le repertoire false s il ne doit pas l etre .
19,742
public String getExtension ( File f ) { if ( f != null ) { String filename = f . getName ( ) ; int i = filename . lastIndexOf ( '.' ) ; if ( i > 0 && i < filename . length ( ) - 1 ) { return filename . substring ( i + 1 ) . toLowerCase ( ) ; } } return null ; }
Retourne l extention du nom du fichier .
19,743
public List < Object > getProperty ( String key ) { List < ? > nodes = fetchNodeList ( key ) ; if ( nodes . size ( ) == 0 ) { return null ; } else { List < Object > list = new ArrayList < > ( ) ; for ( Object node : nodes ) { ConfigurationNode configurationNode = ( ConfigurationNode ) node ; if ( configurationNode . ge...
Fetches the specified property . This task is delegated to the associated expression engine .
19,744
public void loadAddOns ( ) { List < String > addonToLoad = getAddOnClasses ( ) ; for ( File f : new File ( StaticConfiguration . PLUGINS_HOME ) . listFiles ( ) ) { if ( f . isFile ( ) && f . getName ( ) . toUpperCase ( ) . endsWith ( ".JAR" ) ) { AddOnMetadata meta = AddOnMetadata . createAddOnMetadata ( f ) ; if ( met...
Loads and registers all add - ons references in the engine configuration file .
19,745
boolean registerAddOn ( AddOn pAddOn ) { if ( ! mRegisteredAddOns . containsKey ( pAddOn . getAddOnId ( ) ) ) { mRegisteredAddOns . put ( pAddOn . getAddOnId ( ) , pAddOn ) ; if ( pAddOn . hasConfiguration ( ) ) { addConfiguration ( pAddOn . getAddOnId ( ) , pAddOn . getConfigurationPane ( ) ) ; } LOGGER . info ( "The ...
Registers the add - on . If the add - on is not loaded loads it .
19,746
public AddOn getAddOn ( String pAddOnId ) { if ( mRegisteredAddOns . containsKey ( pAddOnId ) ) { return mRegisteredAddOns . get ( pAddOnId ) ; } else { LOGGER . warn ( "Add-on " + pAddOnId + " is not loaded." ) ; return null ; } }
Returns the registered add - on identified by the identifier .
19,747
public Boolean executeCommand ( int timeout , String componentName , Object ... data ) throws QTasteException { setData ( data ) ; long maxTime = System . currentTimeMillis ( ) + 1000 * timeout ; while ( System . currentTimeMillis ( ) < maxTime ) { Stage targetPopup = null ; for ( Stage stage : findPopups ( ) ) { } try...
Commander which sets a value in the input field of a popup .
19,748
public static String tabsToSpaces ( String in , int tabSize ) { StringBuilder buf = new StringBuilder ( ) ; int width = 0 ; for ( int i = 0 ; i < in . length ( ) ; i ++ ) { switch ( in . charAt ( i ) ) { case '\t' : int count = tabSize - ( width % tabSize ) ; width += count ; while ( -- count >= 0 ) { buf . append ( ' ...
Converts tabs to consecutive spaces in the specified string .
19,749
public static String toTitleCase ( String str ) { if ( str . length ( ) == 0 ) { return str ; } else { return Character . toUpperCase ( str . charAt ( 0 ) ) + str . substring ( 1 ) . toLowerCase ( ) ; } }
Converts the specified string to title case by capitalizing the first letter .
19,750
protected String getManifestAttributeValue ( Attributes . Name attributeName ) { try { String value = attributes . getValue ( attributeName ) ; return value != null ? value : "undefined" ; } catch ( NullPointerException e ) { return "undefined" ; } catch ( IllegalArgumentException e ) { logger . error ( "Invalid attrib...
Gets the value of an attribute of the manifest .
19,751
private static String getQTasteRoot ( ) { String qtasteRoot = System . getenv ( "QTASTE_ROOT" ) ; if ( qtasteRoot == null ) { System . err . println ( "QTASTE_ROOT environment variable is not defined" ) ; System . exit ( 1 ) ; } try { qtasteRoot = new File ( qtasteRoot ) . getCanonicalPath ( ) ; } catch ( IOException e...
Get QTaste root directory from QTASTE_ROOT environment variable .
19,752
protected static List < Stage > findPopups ( ) throws QTasteTestFailException { List < Stage > popupFound = new ArrayList < > ( ) ; for ( Stage stage : getStages ( ) ) { Parent root = stage . getScene ( ) . getRoot ( ) ; if ( isAPopup ( stage ) ) { DialogPane dialog = ( DialogPane ) root ; LOGGER . trace ( "Find a popu...
Finds all popups . A Component is a popup if it s a DialogPane modal and not resizable .
19,753
protected boolean activateAndFocusWindow ( Stage window ) { if ( ! window . isFocused ( ) ) { if ( ! window . isShowing ( ) ) { LOGGER . trace ( "cannot activate and focus the window '" + window . getTitle ( ) + "' cause its window is not showing" ) ; return false ; } LOGGER . trace ( "try to activate and focus the win...
Try to activate and focus the stage window .
19,754
protected static List < JDialog > findPopups ( ) { List < JDialog > popupFound = new ArrayList < > ( ) ; for ( Window window : getDisplayableWindows ( ) ) { if ( isAPopup ( window ) ) { JDialog dialog = ( JDialog ) window ; LOGGER . trace ( "Find a popup with the title '" + dialog . getTitle ( ) + "'." ) ; popupFound ....
Finds all popups . A Component is a popup if it s a JDialog modal and not resizable .
19,755
public static String execute ( String fileName , String ... arguments ) throws PyException { return execute ( fileName , true , arguments ) ; }
Executes a python script and return its output .
19,756
public static String execute ( String fileName , boolean redirectOutput , String ... arguments ) throws PyException { Properties properties = new Properties ( ) ; properties . setProperty ( "python.home" , StaticConfiguration . JYTHON_HOME ) ; properties . setProperty ( "python.path" , StaticConfiguration . FORMATTER_D...
Executes a python script returning its output or not .
19,757
public static byte [ ] toNullTerminatedFixedSizeByteArray ( String s , int length ) { if ( s . length ( ) >= length ) { s = s . substring ( 0 , length - 1 ) ; } while ( s . length ( ) < length ) { s += '\0' ; } return s . getBytes ( ) ; }
Converts a string to a null - terminated fixed size byte array .
19,758
public static String fromNullTerminatedByteArray ( byte [ ] array ) { int stringSize = array . length ; for ( int i = 0 ; i < array . length ; i ++ ) { if ( array [ i ] == 0 ) { stringSize = i ; break ; } } return new String ( array , 0 , stringSize ) ; }
Converts a null - terminated byte array into a string .
19,759
public synchronized void register ( ) throws Exception { if ( mbeanName != null ) { throw new Exception ( "Agent already registered" ) ; } mbeanName = new ObjectName ( getClass ( ) . getPackage ( ) . getName ( ) + ":type=" + getClass ( ) . getSimpleName ( ) ) ; logger . info ( "Registering JMX agent " + mbeanName ) ; M...
Register the JMX agent
19,760
public synchronized void unregister ( ) throws Exception { if ( mbeanName == null ) { throw new Exception ( "Agent not registered" ) ; } logger . info ( "Unregistering JMX agent " + mbeanName ) ; ManagementFactory . getPlatformMBeanServer ( ) . unregisterMBean ( mbeanName ) ; logger . info ( "JMX agent " + mbeanName + ...
Unregister the JMX agent
19,761
public synchronized void sendNotification ( PropertyChangeEvent pEvt ) { String oldValue = pEvt . getOldValue ( ) == null ? "null" : pEvt . getOldValue ( ) . toString ( ) ; String newValue = pEvt . getNewValue ( ) == null ? "null" : pEvt . getNewValue ( ) . toString ( ) ; String sourceName = pEvt . getSource ( ) . getC...
Send a JMX notification of a property change event
19,762
public int exec ( String cmd , Map < String , String > env ) throws IOException , InterruptedException { return exec ( cmd , env , System . out , System . err , null ) ; }
Executes the a command specified in parameter .
19,763
public int exec ( String cmd , Map < String , String > env , OutputStream stdout , OutputStream stderr , ByteArrayOutputStream output , File dir ) throws IOException , InterruptedException { if ( output == null ) { output = new ByteArrayOutputStream ( ) ; } try { String [ ] envp ; if ( env != null ) { envp = new String...
Executes the a command specified in the specified directory .
19,764
public static synchronized void generate ( ) { LOGGER . debug ( "Generating documentation of test documentation included in pythonlib directories." ) ; try { IS_RUNNING = true ; List < File > pythonLibDirectories = findPythonLibDirectories ( ROOT_SCRIPT_DIRECTORY ) ; List < File > pythonScriptFiles = findPythonScripts ...
Generates the documentation of scripts located in a pythonlib directory .
19,765
private static List < File > findPythonScripts ( List < File > pythonLibDirectories ) { List < File > scripts = new ArrayList < > ( ) ; for ( File dir : pythonLibDirectories ) { if ( dir . exists ( ) ) { scripts . addAll ( Arrays . asList ( dir . listFiles ( PYTHON_SCRIPT_FILE_FILTER ) ) ) ; } } return scripts ; }
Searches for all python script files contains in the directories .
19,766
public void checkPropertyValueOrTransition ( String propertyValueOrTransition , double maxTime ) throws QTasteDataException , QTasteTestFailException { long beginTime_ms = System . currentTimeMillis ( ) ; long maxTime_ms = Math . round ( maxTime * 1000 ) ; propertyValueOrTransition = propertyValueOrTransition . toLower...
Checks that a property reaches a given value or do a given values transition within given time . If found remove old values from history .
19,767
private synchronized void readObject ( java . io . ObjectInputStream in ) throws IOException , ClassNotFoundException { in . defaultReadObject ( ) ; hash = new Hashtable < > ( ) ; for ( NameValue < N , V > nameValue : order ) { putInHash ( nameValue . name , nameValue . value ) ; } }
and rebuild hash hashtable
19,768
public boolean removeNotificationListener ( String mbeanName , NotificationListener listener ) throws Exception { if ( isConnected ( ) ) { ObjectName objectName = new ObjectName ( mbeanName ) ; mbsc . removeNotificationListener ( objectName , listener , null , null ) ; jmxc . removeConnectionNotificationListener ( list...
Removes listener as notification and connection notification listener .
19,769
public static String getIndent ( String line ) { if ( line == null || line . length ( ) == 0 ) { return "" ; } int i = 0 ; while ( i < line . length ( ) && line . charAt ( i ) == '\t' ) { i ++ ; } return line . substring ( 0 , i ) ; }
Get the indentation of a line of text . This is the subString from beginning of line to the first non - space char
19,770
public void scheduleTask ( PyObject task , double delay ) { mTimer . schedule ( new PythonCallTimerTask ( task ) , Math . round ( delay * 1000 ) ) ; }
Schedules the specified task for execution after the specified delay .
19,771
private static void logAndThrowException ( String message , PyException e ) throws Exception { LOGGER . error ( message , e ) ; throw new Exception ( message + ":\n" + PythonHelper . getMessage ( e ) ) ; }
Logs message and exception and throws Exception .
19,772
protected static String getSubstitutedTemplateContent ( String templateContent , NamesValuesList < String , String > namesValues ) { String templateContentSubst = templateContent ; for ( NameValue < String , String > nameValue : namesValues ) { templateContentSubst = templateContentSubst . replace ( nameValue . name , ...
Substitutes names by values in template and return result .
19,773
public synchronized HTMLEditorKit . Parser getParser ( ) { if ( parser == null ) { try { Class < ? > c = Class . forName ( "javax.swing.text.html.parser.ParserDelegator" ) ; parser = ( HTMLEditorKit . Parser ) c . newInstance ( ) ; } catch ( Exception e ) { } } return parser ; }
Methods that allow customization of the parser and the callback
19,774
private void iorAnalysis ( ) throws DevFailed { if ( ! iorString . startsWith ( "IOR:" ) ) { throw DevFailedUtils . newDevFailed ( "CORBA_ERROR" , iorString + " not an IOR" ) ; } final ORB orb = ORBManager . getOrb ( ) ; final ParsedIOR pior = new ParsedIOR ( ( org . jacorb . orb . ORB ) orb , iorString ) ; final org ....
Make the IOR analyse
19,775
public void analyse_methods ( ) throws DevFailed { this . exe_method = analyse_method_exe ( device_class_name , exe_method_name ) ; if ( state_method_name != null ) this . state_method = analyse_method_state ( device_class_name , state_method_name ) ; }
Analyse the method given at construction time .
19,776
protected Method find_method ( Method [ ] meth_list , String meth_name ) throws DevFailed { int i ; Method meth_found = null ; for ( i = 0 ; i < meth_list . length ; i ++ ) { if ( meth_name . equals ( meth_list [ i ] . getName ( ) ) ) { for ( int j = i + 1 ; j < meth_list . length ; j ++ ) { if ( meth_name . equals ( m...
Retrieve a Method object from a Method list from its name .
19,777
protected int get_tango_type ( Class type_cl ) throws DevFailed { int type = 0 ; if ( type_cl . isArray ( ) == true ) { String type_name = type_cl . getComponentType ( ) . getName ( ) ; if ( type_name . equals ( "byte" ) ) type = Tango_DEVVAR_CHARARRAY ; else if ( type_name . equals ( "short" ) ) type = Tango_DEVVAR_SH...
Get the TANGO type for a command argument .
19,778
public boolean is_allowed ( DeviceImpl dev , Any data_in ) { if ( state_method == null ) return true ; else { try { java . lang . Object [ ] meth_param = new java . lang . Object [ 1 ] ; meth_param [ 0 ] = data_in ; java . lang . Object obj = state_method . invoke ( dev , meth_param ) ; return ( Boolean ) obj ; } catch...
Invoke the command allowed method given at object creation time .
19,779
public static Object extract ( final DeviceData deviceDataArgout ) throws DevFailed { Object argout = null ; switch ( deviceDataArgout . getType ( ) ) { case TangoConst . Tango_DEV_SHORT : argout = Short . valueOf ( deviceDataArgout . extractShort ( ) ) ; break ; case TangoConst . Tango_DEV_USHORT : argout = Integer . ...
Extract data to DeviceData to an Object
19,780
public void setLoggingLevel ( final String deviceName , final int loggingLevel ) { System . out . println ( "set logging level " + deviceName + "-" + LoggingLevel . getLevelFromInt ( loggingLevel ) ) ; logger . debug ( "set logging level to {} on {}" , LoggingLevel . getLevelFromInt ( loggingLevel ) , deviceName ) ; if...
Set the logging level of a device
19,781
public void setRootLoggingLevel ( final int loggingLevel ) { rootLoggingLevel = loggingLevel ; if ( rootLoggerBack != null ) { rootLoggerBack . setLevel ( LoggingLevel . getLevelFromInt ( loggingLevel ) ) ; } }
Set the level of the root logger
19,782
public void setLoggingLevel ( final int loggingLevel , final Class < ? > ... deviceClassNames ) { if ( rootLoggingLevel < loggingLevel ) { setRootLoggingLevel ( loggingLevel ) ; } System . out . println ( "set logging to " + LoggingLevel . getLevelFromInt ( loggingLevel ) ) ; final Logger tangoLogger = LoggerFactory . ...
Set the level of all loggers of JTangoServer
19,783
public void addDeviceAppender ( final String deviceTargetName , final Class < ? > deviceClassName , final String loggingDeviceName ) throws DevFailed { if ( rootLoggerBack != null ) { logger . debug ( "add device appender {} on {}" , deviceTargetName , loggingDeviceName ) ; final DeviceAppender appender = new DeviceApp...
Logging of device sent to logviewer device
19,784
public void addFileAppender ( final String fileName , final String deviceName ) throws DevFailed { if ( rootLoggerBack != null ) { logger . debug ( "add file appender of {} in {}" , deviceName , fileName ) ; final String deviceNameLower = deviceName . toLowerCase ( Locale . ENGLISH ) ; final File f = new File ( fileNam...
Add an file appender for a device
19,785
public void exportAll ( ) throws DevFailed { DatabaseFactory . getDatabase ( ) . loadCache ( serverName , hostName ) ; final DeviceClassBuilder clazz = new DeviceClassBuilder ( AdminDevice . class , Constants . ADMIN_SERVER_CLASS_NAME ) ; deviceClassList . add ( clazz ) ; final DeviceImpl dev = buildDevice ( Constants ...
Build all devices of all classes that are is this executable
19,786
public void exportDevices ( ) throws DevFailed { for ( final Entry < String , Class < ? > > entry : tangoClasses . entrySet ( ) ) { final String tangoClass = entry . getKey ( ) ; final Class < ? > deviceClass = entry . getValue ( ) ; logger . debug ( "loading class {}" , deviceClass . getCanonicalName ( ) ) ; final Dev...
Export all devices except admin device
19,787
public void unexportDevices ( ) throws DevFailed { xlogger . entry ( ) ; final List < DeviceClassBuilder > clazzToRemove = new ArrayList < DeviceClassBuilder > ( ) ; for ( final DeviceClassBuilder clazz : deviceClassList ) { if ( ! clazz . getDeviceClass ( ) . equals ( AdminDevice . class ) ) { for ( final DeviceImpl d...
Unexport all except admin device
19,788
public void update ( ) throws DevFailed { xlogger . entry ( ) ; final Map < String , String [ ] > property = PropertiesUtils . getDeviceProperties ( deviceName ) ; if ( property != null && property . size ( ) != 0 ) { try { propertyMethod . invoke ( businessObject , property ) ; } catch ( final IllegalArgumentException...
update all properties and values of this device
19,789
private synchronized void add ( final String ... attributes ) throws DevFailed { userAttributesNames = new String [ attributes . length ] ; devices = new DeviceProxy [ attributes . length ] ; int i = 0 ; for ( final String attributeName : attributes ) { final String deviceName = TangoUtil . getfullDeviceNameForAttribut...
Add a list of devices in the group or add a list of patterns
19,790
public static Object getWritePart ( final Object array , final AttrWriteType writeType ) { if ( writeType . equals ( AttrWriteType . READ_WRITE ) ) { return Array . get ( array , 1 ) ; } else { return Array . get ( array , 0 ) ; } }
Extract the write part of a scalar attribute
19,791
@ SuppressWarnings ( "unchecked" ) public static < T > T castToType ( final Class < T > type , final Object val ) throws DevFailed { T result ; if ( val == null ) { result = null ; } else if ( type . isAssignableFrom ( val . getClass ( ) ) ) { result = ( T ) val ; } else { LOGGER . debug ( "converting {} to {}" , val ....
Convert an object to another object .
19,792
public static Object extractReadOrWrite ( final Part part , final DeviceAttribute da , final Object readWrite ) throws DevFailed { final Object result ; final int dimRead ; if ( da . getDimY ( ) != 0 ) { dimRead = da . getDimX ( ) * da . getDimY ( ) ; } else { dimRead = da . getDimX ( ) ; } if ( Array . getLength ( rea...
Extract read or write part of a Tango attribute . For spectrum and image
19,793
public Any execute ( DeviceImpl device , Any in_any ) throws DevFailed { Util . out4 . println ( "GetLoggingLevelCmd::execute(): arrived" ) ; String [ ] dvsa = null ; try { dvsa = extract_DevVarStringArray ( in_any ) ; } catch ( DevFailed df ) { Util . out3 . println ( "GetLoggingLevelCmd::execute() ) ; Except . re_th...
Executes the GetLoggingLevelCmd TANGO command
19,794
public static String getFirstFullTangoHost ( ) throws DevFailed { final String TANGO_HOST_ERROR = "API_GetTangoHostFailed" ; String host = getFirstHost ( ) ; try { final InetAddress iadd = InetAddress . getByName ( host ) ; host = iadd . getCanonicalHostName ( ) ; } catch ( final UnknownHostException e ) { throw DevFai...
Returns the TANGO_HOST with full qualified name .
19,795
private Vector get_hierarchy ( ) { synchronized ( this ) { final Vector h = new Vector ( ) ; final Iterator it = elements . iterator ( ) ; while ( it . hasNext ( ) ) { final GroupElement e = ( GroupElement ) it . next ( ) ; if ( e instanceof GroupDeviceElement ) { h . add ( e ) ; } else { h . add ( ( ( Group ) e ) . ge...
Returns the group s hierarchy
19,796
private int get_size_i ( final boolean fwd ) { int size = 0 ; final Iterator it = elements . iterator ( ) ; while ( it . hasNext ( ) ) { final GroupElement e = ( GroupElement ) it . next ( ) ; if ( e instanceof GroupDeviceElement || fwd ) { size += e . get_size ( true ) ; } } return size ; }
Returns the group s size - internal impl
19,797
private boolean add_i ( final GroupElement e ) { if ( e == null || e == this ) { System . out . println ( "Group::add_i::failed to add " + e . get_name ( ) + " (null or self)" ) ; return false ; } final GroupElement ge = find_i ( e . get_name ( ) , e instanceof Group ? false : true ) ; if ( ge != null && ge != this ) {...
Adds an element to the group
19,798
public Any insert ( boolean data ) throws DevFailed { Any out_any = alloc_any ( ) ; out_any . insert_boolean ( data ) ; return out_any ; }
Create a CORBA Any object and insert a boolean data in it .
19,799
public Any insert ( short data ) throws DevFailed { Any out_any = alloc_any ( ) ; out_any . insert_short ( data ) ; return out_any ; }
Create a CORBA Any object and insert a short data in it .