idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
134,400 | private void createProxy ( final Class < L > listenerInterface , final ClassLoader classLoader ) { proxy = listenerInterface . cast ( Proxy . newProxyInstance ( classLoader , new Class [ ] { listenerInterface } , createInvocationHandler ( ) ) ) ; } | Create the proxy object . |
134,401 | @ GwtIncompatible ( "incompatible method" ) public final String translate ( final CharSequence input ) { if ( input == null ) { return null ; } try { final StringWriter writer = new StringWriter ( input . length ( ) * 2 ) ; translate ( input , writer ) ; return writer . toString ( ) ; } catch ( final IOException ioe ) ... | Helper for non - Writer usage . |
134,402 | @ GwtIncompatible ( "incompatible method" ) private static boolean memberEquals ( final Class < ? > type , final Object o1 , final Object o2 ) { if ( o1 == o2 ) { return true ; } if ( o1 == null || o2 == null ) { return false ; } if ( type . isArray ( ) ) { return arrayMemberEquals ( type . getComponentType ( ) , o1 , ... | Helper method for checking whether two objects of the given type are equal . This method is used to compare the parameters of two annotation instances . |
134,403 | @ GwtIncompatible ( "incompatible method" ) private static boolean arrayMemberEquals ( final Class < ? > componentType , final Object o1 , final Object o2 ) { if ( componentType . isAnnotation ( ) ) { return annotationArrayMemberEquals ( ( Annotation [ ] ) o1 , ( Annotation [ ] ) o2 ) ; } if ( componentType . equals ( ... | Helper method for comparing two objects of an array type . |
134,404 | @ GwtIncompatible ( "incompatible method" ) private static boolean annotationArrayMemberEquals ( final Annotation [ ] a1 , final Annotation [ ] a2 ) { if ( a1 . length != a2 . length ) { return false ; } for ( int i = 0 ; i < a1 . length ; i ++ ) { if ( ! equals ( a1 [ i ] , a2 [ i ] ) ) { return false ; } } return tru... | Helper method for comparing two arrays of annotations . |
134,405 | private static int arrayMemberHash ( final Class < ? > componentType , final Object o ) { if ( componentType . equals ( Byte . TYPE ) ) { return Arrays . hashCode ( ( byte [ ] ) o ) ; } if ( componentType . equals ( Short . TYPE ) ) { return Arrays . hashCode ( ( short [ ] ) o ) ; } if ( componentType . equals ( Intege... | Helper method for generating a hash code for an array . |
134,406 | public static StrMatcher charSetMatcher ( final char ... chars ) { if ( chars == null || chars . length == 0 ) { return NONE_MATCHER ; } if ( chars . length == 1 ) { return new CharMatcher ( chars [ 0 ] ) ; } return new CharSetMatcher ( chars ) ; } | Constructor that creates a matcher from a set of characters . |
134,407 | public static StrMatcher charSetMatcher ( final String chars ) { if ( StringUtils . isEmpty ( chars ) ) { return NONE_MATCHER ; } if ( chars . length ( ) == 1 ) { return new CharMatcher ( chars . charAt ( 0 ) ) ; } return new CharSetMatcher ( chars . toCharArray ( ) ) ; } | Constructor that creates a matcher from a string representing a set of characters . |
134,408 | public static StrMatcher stringMatcher ( final String str ) { if ( StringUtils . isEmpty ( str ) ) { return NONE_MATCHER ; } return new StringMatcher ( str ) ; } | Constructor that creates a matcher from a string . |
134,409 | public final void evaluate ( ) { final LemmatizerEvaluator evaluator = new LemmatizerEvaluator ( this . lemmatizer ) ; try { evaluator . evaluate ( this . testSamples ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } System . out . println ( evaluator . getWordAccuracy ( ) ) ; } | Evaluate and print word accuracy . |
134,410 | private static String modify ( final String str , final String [ ] set , final boolean expect ) { final CharSet chars = CharSet . getInstance ( set ) ; final StringBuilder buffer = new StringBuilder ( str . length ( ) ) ; final char [ ] chrs = str . toCharArray ( ) ; for ( final char chr : chrs ) { if ( chars . contain... | Implementation of delete and keep |
134,411 | private static boolean deepEmpty ( final String [ ] strings ) { if ( strings != null ) { for ( final String s : strings ) { if ( StringUtils . isNotEmpty ( s ) ) { return false ; } } } return true ; } | Determines whether or not all the Strings in an array are empty or not . |
134,412 | private int readArgumentIndex ( final String pattern , final ParsePosition pos ) { final int start = pos . getIndex ( ) ; seekNonWs ( pattern , pos ) ; final StringBuilder result = new StringBuilder ( ) ; boolean error = false ; for ( ; ! error && pos . getIndex ( ) < pattern . length ( ) ; next ( pos ) ) { char c = pa... | Read the argument index from the current format element |
134,413 | private String parseFormatDescription ( final String pattern , final ParsePosition pos ) { final int start = pos . getIndex ( ) ; seekNonWs ( pattern , pos ) ; final int text = pos . getIndex ( ) ; int depth = 1 ; for ( ; pos . getIndex ( ) < pattern . length ( ) ; next ( pos ) ) { switch ( pattern . charAt ( pos . get... | Parse the format component of a format element . |
134,414 | private boolean containsElements ( final Collection < ? > coll ) { if ( coll == null || coll . isEmpty ( ) ) { return false ; } for ( final Object name : coll ) { if ( name != null ) { return true ; } } return false ; } | Learn whether the specified Collection contains non - null elements . |
134,415 | public WnsNotificationResponse pushTile ( String channelUri , WnsTile tile ) throws WnsException { return this . pushTile ( channelUri , null , tile ) ; } | Pushes a tile to channelUri |
134,416 | public WnsNotificationResponse pushTile ( String channelUri , WnsNotificationRequestOptional optional , WnsTile tile ) throws WnsException { return this . client . push ( xmlResourceBuilder , channelUri , tile , this . retryPolicy , optional ) ; } | Pushes a tile to channelUri using optional headers |
134,417 | public List < WnsNotificationResponse > pushTile ( List < String > channelUris , WnsTile tile ) throws WnsException { return this . pushTile ( channelUris , null , tile ) ; } | Pushes a tile to channelUris |
134,418 | public WnsNotificationResponse pushToast ( String channelUri , WnsToast toast ) throws WnsException { return this . pushToast ( channelUri , null , toast ) ; } | Pushes a toast to channelUri |
134,419 | public WnsNotificationResponse pushToast ( String channelUri , WnsNotificationRequestOptional optional , WnsToast toast ) throws WnsException { return this . client . push ( xmlResourceBuilder , channelUri , toast , this . retryPolicy , optional ) ; } | Pushes a toast to channelUri using optional headers |
134,420 | public List < WnsNotificationResponse > pushToast ( List < String > channelUris , WnsToast toast ) throws WnsException { return this . pushToast ( channelUris , null , toast ) ; } | Pushes a toast to channelUris |
134,421 | public WnsNotificationResponse pushBadge ( String channelUri , WnsNotificationRequestOptional optional , WnsBadge badge ) throws WnsException { return this . client . push ( xmlResourceBuilder , channelUri , badge , this . retryPolicy , optional ) ; } | Pushes a badge to channelUri using optional headers |
134,422 | public List < WnsNotificationResponse > pushBadge ( List < String > channelUris , WnsBadge badge ) throws WnsException { return this . pushBadge ( channelUris , null , badge ) ; } | Pushes a badge to channelUris |
134,423 | public WnsNotificationResponse pushRaw ( String channelUri , WnsNotificationRequestOptional optional , WnsRaw raw ) throws WnsException { return this . client . push ( rawResourceBuilder , channelUri , raw , this . retryPolicy , optional ) ; } | Pushes a raw message to channelUri using optional headers |
134,424 | public List < WnsNotificationResponse > pushRaw ( List < String > channelUris , WnsRaw raw ) throws WnsException { return this . pushRaw ( channelUris , null , raw ) ; } | Pushes a raw message to channelUris |
134,425 | public void render ( File outputDirectory , ApplicationTemplate applicationTemplate , File applicationDirectory , Renderer renderer , Map < String , String > options , Map < String , String > typeAnnotations ) throws IOException { options = fixOptions ( options ) ; buildRenderer ( outputDirectory , applicationTemplate ... | Renders a Roboconf application into a given format . |
134,426 | private IRenderer buildRenderer ( File outputDirectory , ApplicationTemplate applicationTemplate , File applicationDirectory , Renderer renderer , Map < String , String > typeAnnotations ) { IRenderer result = null ; switch ( renderer ) { case HTML : result = new HtmlRenderer ( outputDirectory , applicationTemplate , a... | Builds the right renderer . |
134,427 | public static void save ( File f , Application app ) throws IOException { Properties properties = new Properties ( ) ; if ( ! Utils . isEmptyOrWhitespaces ( app . getDisplayName ( ) ) ) properties . setProperty ( APPLICATION_NAME , app . getDisplayName ( ) ) ; if ( ! Utils . isEmptyOrWhitespaces ( app . getDescription ... | Saves an application descriptor . |
134,428 | public static void addResourceAfterAngularJS ( String library , String resource ) { FacesContext ctx = FacesContext . getCurrentInstance ( ) ; UIViewRoot v = ctx . getViewRoot ( ) ; Map < String , Object > viewMap = v . getViewMap ( ) ; @ SuppressWarnings ( "unchecked" ) Map < String , String > resourceMap = ( Map < St... | Registers a JS file that needs to be include in the header of the HTML file but after jQuery and AngularJS . |
134,429 | public Collection < InstanceContextBean > apply ( Collection < InstanceContextBean > instances ) { final ArrayList < InstanceContextBean > result = new ArrayList < InstanceContextBean > ( ) ; for ( InstanceContextBean instance : instances ) { boolean installerMatches = this . installerName == null || this . installerNa... | Applies this filter to the given instances . |
134,430 | protected String acquireIpAddress ( TargetHandlerParameters parameters , String machineId ) { String result = null ; String ips = parameters . getTargetProperties ( ) . get ( IP_ADDRESSES ) ; ips = ips == null ? "" : ips ; for ( String ip : Utils . splitNicely ( ips , "," ) ) { if ( Utils . isEmptyOrWhitespaces ( ip ) ... | Acquires an IP address among available ones . |
134,431 | private InstanceContext findAgentContext ( Application application , Instance instance ) { Instance scopedInstance = InstanceHelpers . findScopedInstance ( instance ) ; return new InstanceContext ( application , scopedInstance ) ; } | Builds an instance context corresponding to an agent . |
134,432 | public static < T extends Serializable > byte [ ] serializeObject ( T object ) throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; ObjectOutputStream out = new ObjectOutputStream ( os ) ; out . writeObject ( object ) ; return os . toByteArray ( ) ; } | Serializes an object . |
134,433 | public static < T extends Serializable > T deserializeObject ( byte [ ] bytes , Class < T > clazz ) throws IOException , ClassNotFoundException { ByteArrayInputStream is = new ByteArrayInputStream ( bytes ) ; ObjectInputStream deserializer = new ObjectInputStream ( is ) ; return clazz . cast ( deserializer . readObject... | Deserializes an object . |
134,434 | static void checkErrors ( Collection < RoboconfError > errors , Logger logger ) throws InvalidApplicationException { if ( RoboconfErrorHelpers . containsCriticalErrors ( errors ) ) throw new InvalidApplicationException ( errors ) ; Collection < RoboconfError > warnings = RoboconfErrorHelpers . findWarnings ( errors ) ;... | A method to check errors . |
134,435 | private ManagedApplication createNewApplication ( String name , String description , ApplicationTemplate tpl , File configurationDirectory ) throws AlreadyExistingException , IOException { this . logger . info ( "Creating application " + name + " from template " + tpl + "..." ) ; if ( Utils . isEmptyOrWhitespaces ( nam... | Creates a new application from a template . |
134,436 | private static String getFileExtension ( final String filename ) { String extension = "" ; int i = filename . lastIndexOf ( '.' ) ; int p = Math . max ( filename . lastIndexOf ( '/' ) , filename . lastIndexOf ( '\\' ) ) ; if ( i > p ) extension = filename . substring ( i + 1 ) ; return extension ; } | Get the file name extension from its name . |
134,437 | public static Graphs loadGraph ( File graphFile , File graphDirectory , ApplicationLoadResult alr ) { FromGraphDefinition fromDef = new FromGraphDefinition ( graphDirectory ) ; Graphs graph = fromDef . buildGraphs ( graphFile ) ; alr . getParsedFiles ( ) . addAll ( fromDef . getProcessedImports ( ) ) ; if ( ! fromDef .... | Loads a graph file . |
134,438 | public static InstancesLoadResult loadInstances ( File instancesFile , File rootDirectory , Graphs graph , String applicationName ) { InstancesLoadResult result = new InstancesLoadResult ( ) ; INST : { if ( ! instancesFile . exists ( ) ) { RoboconfError error = new RoboconfError ( ErrorCode . PROJ_MISSING_INSTANCE_EP )... | Loads instances from a file . |
134,439 | public static void writeInstances ( File targetFile , Collection < Instance > rootInstances ) throws IOException { FileDefinition def = new FromInstances ( ) . buildFileDefinition ( rootInstances , targetFile , false , true ) ; ParsingModelIo . saveRelationsFile ( def , false , "\n" ) ; } | Writes all the instances into a file . |
134,440 | public static AbstractLifeCycleManager build ( Instance instance , String appName , IAgentClient messagingClient ) { AbstractLifeCycleManager result ; switch ( instance . getStatus ( ) ) { case DEPLOYED_STARTED : result = new DeployedStarted ( appName , messagingClient ) ; break ; case DEPLOYED_STOPPED : result = new D... | Builds the right handler depending on the current instance s state . |
134,441 | public void updateStateFromImports ( Instance impactedInstance , PluginInterface plugin , Import importChanged , InstanceStatus statusChanged ) throws IOException , PluginException { boolean haveAllImports = ImportHelpers . hasAllRequiredImports ( impactedInstance , this . logger ) ; if ( haveAllImports ) { if ( impact... | Updates the status of an instance based on the imports . |
134,442 | public static void copyInstanceResources ( Instance instance , Map < String , byte [ ] > fileNameToFileContent ) throws IOException { File dir = InstanceHelpers . findInstanceDirectoryOnAgent ( instance ) ; Utils . createDirectory ( dir ) ; if ( fileNameToFileContent != null ) { for ( Map . Entry < String , byte [ ] > ... | Copies the resources of an instance on the disk . |
134,443 | public static void executeScriptResources ( File scriptsDir ) throws IOException { if ( scriptsDir . isDirectory ( ) ) { List < File > scriptFiles = Utils . listAllFiles ( scriptsDir ) ; Logger logger = Logger . getLogger ( AgentUtils . class . getName ( ) ) ; for ( File script : scriptFiles ) { if ( script . getName (... | Executes a script resource on a given instance . |
134,444 | public static void deleteInstanceResources ( Instance instance ) throws IOException { File dir = InstanceHelpers . findInstanceDirectoryOnAgent ( instance ) ; Utils . deleteFilesRecursively ( dir ) ; } | Deletes the resources for a given instance . |
134,445 | public static Map < String , byte [ ] > collectLogs ( String karafData ) throws IOException { Map < String , byte [ ] > logFiles = new HashMap < > ( 2 ) ; if ( ! Utils . isEmptyOrWhitespaces ( karafData ) ) { String [ ] names = { "karaf.log" , "roboconf.log" } ; for ( String name : names ) { File log = new File ( karaf... | Collect the main log files into a map . |
134,446 | public static void injectConfigurations ( String karafEtc , String applicationName , String scopedInstancePath , String domain , String ipAddress ) { File injectionDir = new File ( karafEtc , INJECTED_CONFIGS_DIR ) ; if ( injectionDir . isDirectory ( ) ) { for ( File source : Utils . listAllFiles ( injectionDir , ".cfg... | Generates configuration files from templates . |
134,447 | private void cleanupAfterView ( ) { FacesContext ctx = FacesContext . getCurrentInstance ( ) ; ResponseWriter orig = ( ResponseWriter ) ctx . getAttributes ( ) . get ( ORIGINAL_WRITER ) ; assert ( null != orig ) ; ctx . setResponseWriter ( orig ) ; } | Copied from com . sun . faces . context . PartialViewContextImpl . |
134,448 | public static File findTemplateDirectory ( ApplicationTemplate tpl , File configurationDirectory ) { StringBuilder sb = new StringBuilder ( TEMPLATES ) ; sb . append ( "/" ) ; sb . append ( tpl . getName ( ) ) ; if ( ! Utils . isEmptyOrWhitespaces ( tpl . getVersion ( ) ) ) { sb . append ( " - " ) ; sb . append ( tpl .... | Finds the directory that contains the files for an application template . |
134,449 | public static void saveInstances ( Application app ) { File targetFile = new File ( app . getDirectory ( ) , Constants . PROJECT_DIR_INSTANCES + "/" + INSTANCES_FILE ) ; try { Utils . createDirectory ( targetFile . getParentFile ( ) ) ; RuntimeModelIo . writeInstances ( targetFile , app . getRootInstances ( ) ) ; } cat... | Saves the instances into a file . |
134,450 | public static InstancesLoadResult restoreInstances ( ManagedApplication ma ) { File sourceFile = new File ( ma . getDirectory ( ) , Constants . PROJECT_DIR_INSTANCES + "/" + INSTANCES_FILE ) ; Graphs graphs = ma . getApplication ( ) . getTemplate ( ) . getGraphs ( ) ; InstancesLoadResult result ; if ( sourceFile . exis... | Restores instances and set them in the application . |
134,451 | public static File findIcon ( String name , String qualifier , File configurationDirectory ) { if ( configurationDirectory == null ) return null ; File root ; if ( ! Utils . isEmptyOrWhitespaces ( qualifier ) ) { ApplicationTemplate tpl = new ApplicationTemplate ( name ) . version ( qualifier ) ; root = ConfigurationUt... | Finds the icon associated with an application template . |
134,452 | public static void loadApplicationBindings ( Application app ) { File descDir = new File ( app . getDirectory ( ) , Constants . PROJECT_DIR_DESC ) ; File appBindingsFile = new File ( descDir , APP_BINDINGS_FILE ) ; Logger logger = Logger . getLogger ( ConfigurationUtils . class . getName ( ) ) ; Properties props = Util... | Loads the application bindings into an application . |
134,453 | public static void saveApplicationBindings ( Application app ) { File descDir = new File ( app . getDirectory ( ) , Constants . PROJECT_DIR_DESC ) ; File appBindingsFile = new File ( descDir , APP_BINDINGS_FILE ) ; Map < String , String > format = new HashMap < > ( ) ; for ( Map . Entry < String , Set < String > > entr... | Saves the application bindings into the DM s directory . |
134,454 | protected ParsingError error ( ErrorCode errorCode , ErrorDetails ... details ) { return new ParsingError ( errorCode , this . context . getCommandFile ( ) , this . line , details ) ; } | A shortcut method to create a parsing error with relevant information . |
134,455 | public static List < String > getPropertyValues ( AbstractBlockHolder holder , String propertyName ) { List < String > result = new ArrayList < > ( ) ; for ( BlockProperty p : holder . findPropertiesBlockByName ( propertyName ) ) { result . addAll ( Utils . splitNicely ( p . getValue ( ) , ParsingConstants . PROPERTY_S... | Gets and splits property values separated by a comma . |
134,456 | public static Map < String , String > getData ( AbstractBlockHolder holder ) { BlockProperty p = holder . findPropertyBlockByName ( ParsingConstants . PROPERTY_INSTANCE_DATA ) ; Map < String , String > result = new HashMap < > ( ) ; String propertyValue = p == null ? null : p . getValue ( ) ; for ( String s : Utils . s... | Gets and splits data separated by a comma . |
134,457 | public synchronized void setHttpServerIp ( final String serverIp ) { this . httpServerIp = serverIp ; this . dmClient . setHttpServerIp ( serverIp ) ; this . logger . finer ( "Server IP set to " + this . httpServerIp ) ; } | Getters and Setters |
134,458 | private void resetClients ( boolean shutdown ) { final List < HttpAgentClient > clients ; synchronized ( this ) { clients = new ArrayList < > ( this . agentClients ) ; this . agentClients . clear ( ) ; } for ( HttpAgentClient client : clients ) { try { final ReconfigurableClient < ? > reconfigurable = client . getRecon... | Closes messaging clients or requests a replacement to the reconfigurable client . |
134,459 | public void handlerAppears ( IMonitoringHandler handler ) { if ( handler != null ) { this . logger . info ( "Monitoring handler '" + handler . getName ( ) + "' is now available." ) ; this . handlers . add ( handler ) ; listHandlers ( this . handlers , this . logger ) ; } } | This method is invoked by iPojo every time a new monitoring handler appears . |
134,460 | public void handlerDisappears ( IMonitoringHandler handler ) { if ( handler == null ) { this . logger . info ( "An invalid monitoring handler is removed." ) ; } else { this . handlers . remove ( handler ) ; this . logger . info ( "Monitoring handler '" + handler . getName ( ) + "' is not available anymore." ) ; } listH... | This method is invoked by iPojo every time a monitoring handler disappears . |
134,461 | public static void listHandlers ( List < IMonitoringHandler > handlers , Logger logger ) { if ( handlers . isEmpty ( ) ) { logger . info ( "No monitoring handler was found." ) ; } else { StringBuilder sb = new StringBuilder ( "Available monitoring handlers: " ) ; for ( Iterator < IMonitoringHandler > it = handlers . it... | This method lists the available handlers and logs them . |
134,462 | public String validate ( ) { String result = null ; if ( this . messagingConfiguration == null || this . messagingConfiguration . isEmpty ( ) ) result = "The message configuration cannot be null or empty." ; else if ( this . messagingConfiguration . get ( MessagingConstants . MESSAGING_TYPE_PROPERTY ) == null ) result ... | Validates this bean . |
134,463 | public static AgentProperties readIaasProperties ( String rawProperties , Logger logger ) throws IOException { Properties props = Utils . readPropertiesQuietly ( rawProperties , logger ) ; return readIaasProperties ( props ) ; } | Creates a new bean from raw properties that will be parsed . |
134,464 | public static AgentProperties readIaasProperties ( Properties props ) throws IOException { File msgResourcesDirectory = new File ( System . getProperty ( "java.io.tmpdir" ) , "roboconf-messaging" ) ; props = UserDataHelpers . processUserData ( props , msgResourcesDirectory ) ; AgentProperties result = new AgentProperti... | Creates a new bean from properties . |
134,465 | private static String updatedField ( Properties props , String fieldName ) { String property = props . getProperty ( fieldName ) ; if ( property != null ) property = property . replace ( "\\:" , ":" ) ; return property ; } | Gets a property and updates it to prevent escaped characters . |
134,466 | public static Message deserializeObject ( byte [ ] bytes ) throws IOException , ClassNotFoundException { ByteArrayInputStream is = new ByteArrayInputStream ( bytes ) ; ObjectInputStream deserializer = new ObjectInputStream ( is ) ; return ( Message ) deserializer . readObject ( ) ; } | Deserializes a message . |
134,467 | public static Map < String , String > buildHeaders ( String reqCorsHeader , String requestUri ) { Map < String , String > result = new LinkedHashMap < > ( ) ; result . put ( CORS_ALLOW_ORIGIN , requestUri ) ; result . put ( CORS_ALLOW_METHODS , VALUE_ALLOWED_METHODS ) ; result . put ( CORS_ALLOW_CREDENTIALS , VALUE_ALL... | Finds the right headers to set on the response to prevent CORS issues . |
134,468 | public static Version parseVersion ( String rawVersion ) { Version result = null ; Matcher m = Pattern . compile ( "^(\\d+)\\.(\\d+)(\\.\\d+)?([.-].+)?$" ) . matcher ( rawVersion ) ; if ( m . find ( ) ) { result = new Version ( Integer . parseInt ( m . group ( 1 ) ) , Integer . parseInt ( m . group ( 2 ) ) , m . group ... | Creates a version object from a string . |
134,469 | public static boolean containsCriticalErrors ( Collection < ? extends RoboconfError > errors ) { boolean result = false ; for ( RoboconfError error : errors ) { if ( ( result = error . getErrorCode ( ) . getLevel ( ) == ErrorLevel . SEVERE ) ) break ; } return result ; } | Determines whether a collection of errors contains at least one critical error . |
134,470 | public static Collection < RoboconfError > findWarnings ( Collection < ? extends RoboconfError > errors ) { Collection < RoboconfError > result = new ArrayList < > ( ) ; for ( RoboconfError error : errors ) { if ( error . getErrorCode ( ) . getLevel ( ) == ErrorLevel . WARNING ) result . add ( error ) ; } return result... | Finds all the warnings among a collection of Roboconf errors . |
134,471 | public static void filterErrors ( Collection < ? extends RoboconfError > errors , ErrorCode ... errorCodes ) { List < ErrorCode > codesToSkip = new ArrayList < > ( ) ; codesToSkip . addAll ( Arrays . asList ( errorCodes ) ) ; Collection < RoboconfError > toRemove = new ArrayList < > ( ) ; for ( RoboconfError error : er... | Filters errors by removing those associated with specific error codes . |
134,472 | private void renderApplication ( ) throws IOException { StringBuilder sb = new StringBuilder ( ) ; sb . append ( renderDocumentTitle ( ) ) ; sb . append ( renderPageBreak ( ) ) ; sb . append ( renderParagraph ( this . messages . get ( "intro" ) ) ) ; sb . append ( renderPageBreak ( ) ) ; sb . append ( renderDocumentInd... | Renders an applicationTemplate . |
134,473 | private void renderRecipe ( ) throws IOException { StringBuilder sb = new StringBuilder ( ) ; if ( ! Constants . GENERATED . equalsIgnoreCase ( this . applicationTemplate . getName ( ) ) ) { sb . append ( renderDocumentTitle ( ) ) ; sb . append ( renderPageBreak ( ) ) ; sb . append ( renderParagraph ( this . messages .... | Renders a recipe . |
134,474 | private StringBuilder renderFacets ( ) throws IOException { StringBuilder sb = new StringBuilder ( ) ; if ( ! this . applicationTemplate . getGraphs ( ) . getFacetNameToFacet ( ) . isEmpty ( ) ) { sb . append ( renderTitle1 ( this . messages . get ( "facets" ) ) ) ; sb . append ( renderParagraph ( this . messages . get... | Renders information about the facets . |
134,475 | private Object renderApplicationDescription ( ) throws IOException { String s ; if ( this . locale == null && ! Utils . isEmptyOrWhitespaces ( this . applicationTemplate . getDescription ( ) ) ) s = this . applicationTemplate . getDescription ( ) ; else s = readCustomInformation ( this . applicationDirectory , DocConst... | Renders the application s description . |
134,476 | private void saveImage ( final Component comp , DiagramType type , AbstractRoboconfTransformer transformer , StringBuilder sb ) throws IOException { String baseName = comp . getName ( ) + "_" + type ; String relativePath = "png/" + baseName + ".png" ; if ( this . options . containsKey ( DocConstants . OPTION_GEN_IMAGES... | Generates and saves an image . |
134,477 | private String readCustomInformation ( File applicationDirectory , String prefix , String suffix ) throws IOException { StringBuilder sb = new StringBuilder ( ) ; sb . append ( prefix ) ; if ( this . locale != null ) sb . append ( "_" + this . locale ) ; sb . append ( suffix ) ; sb . insert ( 0 , "/" ) ; sb . insert ( ... | Reads user - specified information from the project . |
134,478 | private List < String > convertImports ( Collection < ImportedVariable > importedVariables ) { List < String > result = new ArrayList < > ( ) ; for ( ImportedVariable var : importedVariables ) { String componentOrFacet = VariableHelpers . parseVariableName ( var . getName ( ) ) . getKey ( ) ; String s = applyLink ( var... | Converts imports to a human - readable text . |
134,479 | private List < String > convertExports ( Map < String , String > exports ) { List < String > result = new ArrayList < > ( ) ; for ( Map . Entry < String , String > entry : exports . entrySet ( ) ) { String componentOrFacet = VariableHelpers . parseVariableName ( entry . getKey ( ) ) . getKey ( ) ; String s = Utils . is... | Converts exports to a human - readable text . |
134,480 | private List < String > getImportComponents ( Component component ) { List < String > result = new ArrayList < > ( ) ; Map < String , Boolean > map = ComponentHelpers . findComponentDependenciesFor ( component ) ; for ( Map . Entry < String , Boolean > entry : map . entrySet ( ) ) { String s = applyLink ( entry . getKe... | Converts component dependencies to a human - readable text . |
134,481 | private String renderListAsLinks ( List < String > names ) { List < String > newNames = new ArrayList < > ( ) ; for ( String s : names ) newNames . add ( applyLink ( s , s ) ) ; return renderList ( newNames ) ; } | Renders a list as a list of links . |
134,482 | public void uploadZippedApplicationTemplate ( File applicationFile ) throws ManagementWsException , IOException { if ( applicationFile == null || ! applicationFile . exists ( ) || ! applicationFile . isFile ( ) ) throw new IOException ( "Expected an existing file as parameter." ) ; this . logger . finer ( "Loading an a... | Uploads a ZIP file and loads its application template . |
134,483 | public void loadUnzippedApplicationTemplate ( String localFilePath ) throws ManagementWsException { this . logger . finer ( "Loading an application from a local directory: " + localFilePath ) ; WebResource path = this . resource . path ( UrlConstants . APPLICATIONS ) . path ( "templates" ) . path ( "local" ) ; if ( loc... | Loads an application template from a directory located on the DM s file system . |
134,484 | public Application createApplication ( String applicationName , String templateName , String templateQualifier ) throws ManagementWsException { this . logger . finer ( "Creating application " + applicationName + " from " + templateName + " - " + templateQualifier + "..." ) ; ApplicationTemplate tpl = new ApplicationTem... | Creates an application from a template . |
134,485 | public List < Application > listApplications ( String exactName ) throws ManagementWsException { if ( exactName != null ) this . logger . finer ( "List/finding the application named " + exactName + "." ) ; else this . logger . finer ( "Listing all the applications." ) ; WebResource path = this . resource . path ( UrlCo... | Lists applications . |
134,486 | public void shutdownApplication ( String applicationName ) throws ManagementWsException { this . logger . finer ( "Removing application " + applicationName + "..." ) ; WebResource path = this . resource . path ( UrlConstants . APPLICATIONS ) . path ( applicationName ) . path ( "shutdown" ) ; ClientResponse response = t... | Shutdowns an application . |
134,487 | public static String fileTypeAsString ( int fileType ) { String result ; switch ( fileType ) { case AGGREGATOR : result = "aggregator" ; break ; case GRAPH : result = "graph" ; break ; case INSTANCE : result = "intsnace" ; break ; case UNDETERMINED : result = "undetermined" ; break ; default : result = "unknown" ; brea... | Transforms a file type into a string . |
134,488 | public static RbcfInfo findInstances ( Manager manager , String applicationName , String scopedInstancePath , PrintStream out ) { ManagedApplication ma = null ; List < Instance > scopedInstances = new ArrayList < > ( ) ; Instance scopedInstance ; if ( ( ma = manager . applicationMngr ( ) . findManagedApplicationByName ... | Finds instances for a given application . |
134,489 | static NovaApi novaApi ( Map < String , String > targetProperties ) throws TargetException { validate ( targetProperties ) ; return ContextBuilder . newBuilder ( PROVIDER_NOVA ) . endpoint ( targetProperties . get ( API_URL ) ) . credentials ( identity ( targetProperties ) , targetProperties . get ( PASSWORD ) ) . buil... | Creates a JCloud context for Nova . |
134,490 | static SwiftApi swiftApi ( Map < String , String > targetProperties ) throws TargetException { validate ( targetProperties ) ; return ContextBuilder . newBuilder ( PROVIDER_SWIFT ) . endpoint ( targetProperties . get ( API_URL ) ) . credentials ( identity ( targetProperties ) , targetProperties . get ( PASSWORD ) ) . b... | Creates a JCloud context for Swift . |
134,491 | static void validate ( Map < String , String > targetProperties ) throws TargetException { checkProperty ( API_URL , targetProperties ) ; checkProperty ( IMAGE_NAME , targetProperties ) ; checkProperty ( TENANT_NAME , targetProperties ) ; checkProperty ( FLAVOR_NAME , targetProperties ) ; checkProperty ( SECURITY_GROUP... | Validates the basic target properties . |
134,492 | static void validateAll ( Map < String , String > targetProperties , String appName , String instanceName ) throws TargetException { validate ( targetProperties ) ; Set < String > mountPoints = new HashSet < > ( ) ; Set < String > volumeNames = new HashSet < > ( ) ; for ( String s : findStorageIds ( targetProperties ) ... | Validates the target properties including storage ones . |
134,493 | static String findStorageProperty ( Map < String , String > targetProperties , String storageId , String propertyPrefix ) { String property = propertyPrefix + storageId ; String value = targetProperties . get ( property ) ; return Utils . isEmptyOrWhitespaces ( value ) ? DEFAULTS . get ( propertyPrefix ) : value . trim... | Finds a storage property for a given storage ID . |
134,494 | static String expandVolumeName ( String nameTemplate , String appName , String instanceName ) { String name = nameTemplate . replace ( TPL_VOLUME_NAME , instanceName ) ; name = name . replace ( TPL_VOLUME_APP , appName ) ; name = name . replaceAll ( "[\\W_-]" , "-" ) ; return name ; } | Updates a volume name by replacing template variables . |
134,495 | public BlockProperty findPropertyBlockByName ( String propertyName ) { BlockProperty result = null ; for ( AbstractBlock region : this . innerBlocks ) { if ( region . getInstructionType ( ) == PROPERTY && propertyName . equals ( ( ( BlockProperty ) region ) . getName ( ) ) ) { result = ( BlockProperty ) region ; break ... | Finds a property by its name among the ones this instance owns . |
134,496 | public List < BlockProperty > findPropertiesBlockByName ( String propertyName ) { List < BlockProperty > result = new ArrayList < > ( ) ; for ( AbstractBlock region : this . innerBlocks ) { if ( region . getInstructionType ( ) == PROPERTY && propertyName . equals ( ( ( BlockProperty ) region ) . getName ( ) ) ) { resul... | Finds properties by name among the ones this instance owns . |
134,497 | public static Map . Entry < String , String > decodeIconUrl ( String path ) { if ( path . startsWith ( "/" ) ) path = path . substring ( 1 ) ; String name = null , version = null ; String [ ] parts = path . split ( "/" ) ; switch ( parts . length ) { case 2 : name = parts [ 0 ] ; break ; case 3 : name = parts [ 0 ] ; v... | Decodes an URL path to extract a name and a potential version . |
134,498 | public static String findIconUrl ( AbstractApplication app ) { StringBuilder sb = new StringBuilder ( ) ; File iconFile = findIcon ( app ) ; if ( iconFile != null ) { sb . append ( "/" ) ; sb . append ( app . getName ( ) ) ; if ( app instanceof ApplicationTemplate ) { sb . append ( "/" ) ; sb . append ( ( ( Application... | Finds the URL to access the icon of an application or templates . |
134,499 | public static String writeConfigurationFile ( FileDefinition relationsFile , boolean writeComments , String lineSeparator ) { return new FileDefinitionSerializer ( lineSeparator ) . write ( relationsFile , writeComments ) ; } | Writes a model into a string . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.