repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/dsl/ParsingModelIo.java
ParsingModelIo.saveRelationsFile
public static void saveRelationsFile( FileDefinition relationsFile, boolean writeComments, String lineSeparator ) throws IOException { if( relationsFile.getEditedFile() == null ) throw new IOException( "Save operation could not be performed. The model was not loaded from a local file." ); saveRelationsFileInt...
java
public static void saveRelationsFile( FileDefinition relationsFile, boolean writeComments, String lineSeparator ) throws IOException { if( relationsFile.getEditedFile() == null ) throw new IOException( "Save operation could not be performed. The model was not loaded from a local file." ); saveRelationsFileInt...
[ "public", "static", "void", "saveRelationsFile", "(", "FileDefinition", "relationsFile", ",", "boolean", "writeComments", ",", "String", "lineSeparator", ")", "throws", "IOException", "{", "if", "(", "relationsFile", ".", "getEditedFile", "(", ")", "==", "null", "...
Saves the model into the original file. @param relationsFile the relations file @param writeComments true to write comments @param lineSeparator the line separator (if null, the OS' one is used) @throws IOException if the file could not be saved
[ "Saves", "the", "model", "into", "the", "original", "file", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/dsl/ParsingModelIo.java#L87-L94
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/dsl/ParsingModelIo.java
ParsingModelIo.saveRelationsFileInto
public static void saveRelationsFileInto( File targetFile, FileDefinition relationsFile, boolean writeComments, String lineSeparator ) throws IOException { String s = writeConfigurationFile( relationsFile, writeComments, lineSeparator ); Utils.copyStream( new ByteArrayInputStream( s.getBytes( Standard...
java
public static void saveRelationsFileInto( File targetFile, FileDefinition relationsFile, boolean writeComments, String lineSeparator ) throws IOException { String s = writeConfigurationFile( relationsFile, writeComments, lineSeparator ); Utils.copyStream( new ByteArrayInputStream( s.getBytes( Standard...
[ "public", "static", "void", "saveRelationsFileInto", "(", "File", "targetFile", ",", "FileDefinition", "relationsFile", ",", "boolean", "writeComments", ",", "String", "lineSeparator", ")", "throws", "IOException", "{", "String", "s", "=", "writeConfigurationFile", "(...
Saves the model into another file. @param targetFile the target file (may not exist) @param relationsFile the relations file @param writeComments true to write comments @param lineSeparator the line separator (if null, the OS' one is used) @throws IOException if the file could not be saved
[ "Saves", "the", "model", "into", "another", "file", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/dsl/ParsingModelIo.java#L105-L114
train
stephanrauh/AngularFaces
AngularFaces_2.0/AngularFaces-core/src/main/java/de/beyondjava/angularFaces/core/NGWordUtiltites.java
NGWordUtiltites.labelFromCamelCase
public static String labelFromCamelCase(String camel) { StringBuilder label = new StringBuilder(); for (int i = 0; i < camel.length(); i++) { char c = camel.charAt(i); if (Character.isDigit(c)) { if (i > 0 && Character.isAlphabetic(camel.charAt(i - 1))) label.append(" "); } if (c == '_') { ...
java
public static String labelFromCamelCase(String camel) { StringBuilder label = new StringBuilder(); for (int i = 0; i < camel.length(); i++) { char c = camel.charAt(i); if (Character.isDigit(c)) { if (i > 0 && Character.isAlphabetic(camel.charAt(i - 1))) label.append(" "); } if (c == '_') { ...
[ "public", "static", "String", "labelFromCamelCase", "(", "String", "camel", ")", "{", "StringBuilder", "label", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "camel", ".", "length", "(", ")", ";", "i", "...
Converts a camelcase variable name to a human readable text. @param camel the String to be converted @return the hopefully human readable version
[ "Converts", "a", "camelcase", "variable", "name", "to", "a", "human", "readable", "text", "." ]
43d915f004645b1bbbf2625214294dab0858ba01
https://github.com/stephanrauh/AngularFaces/blob/43d915f004645b1bbbf2625214294dab0858ba01/AngularFaces_2.0/AngularFaces-core/src/main/java/de/beyondjava/angularFaces/core/NGWordUtiltites.java#L31-L49
train
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/internal/commands/CommandsExecutor.java
CommandsExecutor.findExecutor
AbstractCommandExecution findExecutor( AbstractCommandInstruction instr ) { AbstractCommandExecution result = null; if( RenameCommandInstruction.class.equals( instr.getClass())) result = new RenameCommandExecution((RenameCommandInstruction) instr); else if( ReplicateCommandInstruction.class.equals( instr.ge...
java
AbstractCommandExecution findExecutor( AbstractCommandInstruction instr ) { AbstractCommandExecution result = null; if( RenameCommandInstruction.class.equals( instr.getClass())) result = new RenameCommandExecution((RenameCommandInstruction) instr); else if( ReplicateCommandInstruction.class.equals( instr.ge...
[ "AbstractCommandExecution", "findExecutor", "(", "AbstractCommandInstruction", "instr", ")", "{", "AbstractCommandExecution", "result", "=", "null", ";", "if", "(", "RenameCommandInstruction", ".", "class", ".", "equals", "(", "instr", ".", "getClass", "(", ")", ")"...
Finds the right executor for an instruction. @param instr a non-null instruction @return an executor, or null if the instruction is not executable
[ "Finds", "the", "right", "executor", "for", "an", "instruction", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/internal/commands/CommandsExecutor.java#L149-L184
train
stephanrauh/AngularFaces
AngularFaces_2.0/AngularFaces-core/src/main/java/de/beyondjava/angularFaces/core/i18n/I18n.java
I18n.convertPropertyFileLineToJSon
private String convertPropertyFileLineToJSon(String line, String json) { if (line==null) return json; String l = line.trim(); if (l.length()==0 || l.startsWith("//")) return json; boolean inString = l.startsWith("\""); String english; String rest; if (inString) { boolean esc = false; int i = 1; ...
java
private String convertPropertyFileLineToJSon(String line, String json) { if (line==null) return json; String l = line.trim(); if (l.length()==0 || l.startsWith("//")) return json; boolean inString = l.startsWith("\""); String english; String rest; if (inString) { boolean esc = false; int i = 1; ...
[ "private", "String", "convertPropertyFileLineToJSon", "(", "String", "line", ",", "String", "json", ")", "{", "if", "(", "line", "==", "null", ")", "return", "json", ";", "String", "l", "=", "line", ".", "trim", "(", ")", ";", "if", "(", "l", ".", "l...
Note this method has a side effect - it also fills the HashMap of translations.
[ "Note", "this", "method", "has", "a", "side", "effect", "-", "it", "also", "fills", "the", "HashMap", "of", "translations", "." ]
43d915f004645b1bbbf2625214294dab0858ba01
https://github.com/stephanrauh/AngularFaces/blob/43d915f004645b1bbbf2625214294dab0858ba01/AngularFaces_2.0/AngularFaces-core/src/main/java/de/beyondjava/angularFaces/core/i18n/I18n.java#L83-L132
train
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/management/Manager.java
Manager.targetAppears
public void targetAppears( TargetHandler targetItf ) { this.defaultTargetHandlerResolver.addTargetHandler( targetItf ); // When a target is deployed, we may also have to update instance states. // Consider as an example when the DM restarts. Targets may be injected // before and after the pojo was started by i...
java
public void targetAppears( TargetHandler targetItf ) { this.defaultTargetHandlerResolver.addTargetHandler( targetItf ); // When a target is deployed, we may also have to update instance states. // Consider as an example when the DM restarts. Targets may be injected // before and after the pojo was started by i...
[ "public", "void", "targetAppears", "(", "TargetHandler", "targetItf", ")", "{", "this", ".", "defaultTargetHandlerResolver", ".", "addTargetHandler", "(", "targetItf", ")", ";", "// When a target is deployed, we may also have to update instance states.", "// Consider as an exampl...
This method is invoked by iPojo every time a new target handler appears. @param targetItf the appearing target handler
[ "This", "method", "is", "invoked", "by", "iPojo", "every", "time", "a", "new", "target", "handler", "appears", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/management/Manager.java#L283-L298
train
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/management/Manager.java
Manager.setTargetResolver
public void setTargetResolver( ITargetHandlerResolver targetHandlerResolver ) { if( targetHandlerResolver == null ) { this.targetConfigurator.setTargetHandlerResolver( this.defaultTargetHandlerResolver ); this.instancesMngr.setTargetHandlerResolver( this.defaultTargetHandlerResolver ); } else { this.targe...
java
public void setTargetResolver( ITargetHandlerResolver targetHandlerResolver ) { if( targetHandlerResolver == null ) { this.targetConfigurator.setTargetHandlerResolver( this.defaultTargetHandlerResolver ); this.instancesMngr.setTargetHandlerResolver( this.defaultTargetHandlerResolver ); } else { this.targe...
[ "public", "void", "setTargetResolver", "(", "ITargetHandlerResolver", "targetHandlerResolver", ")", "{", "if", "(", "targetHandlerResolver", "==", "null", ")", "{", "this", ".", "targetConfigurator", ".", "setTargetHandlerResolver", "(", "this", ".", "defaultTargetHandl...
Sets the target resolver. @param targetHandlerResolver a resolver for target handlers
[ "Sets", "the", "target", "resolver", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/management/Manager.java#L425-L434
train
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/management/Manager.java
Manager.restoreAllInstances
void restoreAllInstances() { // instancesMngr() instead of this.instancesMngr (for unit tests). this.logger.fine( "Restoring all the instance states from the current target handlers." ); for( ManagedApplication ma : this.applicationMngr.getManagedApplications()) { // Build a new snapshot on every loop Lis...
java
void restoreAllInstances() { // instancesMngr() instead of this.instancesMngr (for unit tests). this.logger.fine( "Restoring all the instance states from the current target handlers." ); for( ManagedApplication ma : this.applicationMngr.getManagedApplications()) { // Build a new snapshot on every loop Lis...
[ "void", "restoreAllInstances", "(", ")", "{", "// instancesMngr() instead of this.instancesMngr (for unit tests).", "this", ".", "logger", ".", "fine", "(", "\"Restoring all the instance states from the current target handlers.\"", ")", ";", "for", "(", "ManagedApplication", "ma"...
Restores the states of all the instances from the current target handlers.
[ "Restores", "the", "states", "of", "all", "the", "instances", "from", "the", "current", "target", "handlers", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/management/Manager.java#L614-L625
train
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/management/Manager.java
Manager.restoreInstancesFrom
void restoreInstancesFrom( TargetHandler targetHandler ) { // instancesMngr() instead of this.instancesMngr (for unit tests). this.logger.fine( "Restoring the instance states with the '" + targetHandler.getTargetId() + "' target handler." ); for( ManagedApplication ma : this.applicationMngr.getManagedApplication...
java
void restoreInstancesFrom( TargetHandler targetHandler ) { // instancesMngr() instead of this.instancesMngr (for unit tests). this.logger.fine( "Restoring the instance states with the '" + targetHandler.getTargetId() + "' target handler." ); for( ManagedApplication ma : this.applicationMngr.getManagedApplication...
[ "void", "restoreInstancesFrom", "(", "TargetHandler", "targetHandler", ")", "{", "// instancesMngr() instead of this.instancesMngr (for unit tests).", "this", ".", "logger", ".", "fine", "(", "\"Restoring the instance states with the '\"", "+", "targetHandler", ".", "getTargetId"...
Restores the states of all the instances from a given target handler.
[ "Restores", "the", "states", "of", "all", "the", "instances", "from", "a", "given", "target", "handler", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/management/Manager.java#L631-L637
train
roboconf/roboconf-platform
core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/factory/MessagingClientFactoryRegistry.java
MessagingClientFactoryRegistry.addMessagingClientFactory
public boolean addMessagingClientFactory(IMessagingClientFactory factory) { final String type = factory.getType(); this.logger.fine("Adding messaging client factory: " + type); final boolean result = this.factories.putIfAbsent(type, factory) == null; if (result) notifyListeners(factory, true); return res...
java
public boolean addMessagingClientFactory(IMessagingClientFactory factory) { final String type = factory.getType(); this.logger.fine("Adding messaging client factory: " + type); final boolean result = this.factories.putIfAbsent(type, factory) == null; if (result) notifyListeners(factory, true); return res...
[ "public", "boolean", "addMessagingClientFactory", "(", "IMessagingClientFactory", "factory", ")", "{", "final", "String", "type", "=", "factory", ".", "getType", "(", ")", ";", "this", ".", "logger", ".", "fine", "(", "\"Adding messaging client factory: \"", "+", ...
Adds a messaging client factory to this registry, unless a similar one was already registered. @param factory the messaging client factory to add. @return {@code true} if the factory has been added, {@code false} if a factory with the same type was already registered.
[ "Adds", "a", "messaging", "client", "factory", "to", "this", "registry", "unless", "a", "similar", "one", "was", "already", "registered", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/factory/MessagingClientFactoryRegistry.java#L82-L91
train
roboconf/roboconf-platform
core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/factory/MessagingClientFactoryRegistry.java
MessagingClientFactoryRegistry.removeMessagingClientFactory
public boolean removeMessagingClientFactory(IMessagingClientFactory factory) { final String type = factory.getType(); this.logger.fine("Removing messaging client factory: " + type); final boolean result = this.factories.remove(type, factory); if (result) notifyListeners(factory, false); return result; }
java
public boolean removeMessagingClientFactory(IMessagingClientFactory factory) { final String type = factory.getType(); this.logger.fine("Removing messaging client factory: " + type); final boolean result = this.factories.remove(type, factory); if (result) notifyListeners(factory, false); return result; }
[ "public", "boolean", "removeMessagingClientFactory", "(", "IMessagingClientFactory", "factory", ")", "{", "final", "String", "type", "=", "factory", ".", "getType", "(", ")", ";", "this", ".", "logger", ".", "fine", "(", "\"Removing messaging client factory: \"", "+...
Removes a messaging client factory from this registry. @param factory the messaging client factory to remove. @return {@code true} if the factory has been removed, {@code false} if the factory was not registered.
[ "Removes", "a", "messaging", "client", "factory", "from", "this", "registry", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/factory/MessagingClientFactoryRegistry.java#L98-L107
train
stephanrauh/AngularFaces
AngularFaces_2.0/incubator/AngularFaces-widgets/src/main/java/de/beyondjava/angularFaces/flavors/kendo/puiBody/PuiBody.java
PuiBody.getValueToRender
public static Object getValueToRender(FacesContext context, UIComponent component) { if (component instanceof ValueHolder) { if (component instanceof EditableValueHolder) { EditableValueHolder input = (EditableValueHolder) component; Object submittedValue = input.getSubmittedValue(); ConfigContainer c...
java
public static Object getValueToRender(FacesContext context, UIComponent component) { if (component instanceof ValueHolder) { if (component instanceof EditableValueHolder) { EditableValueHolder input = (EditableValueHolder) component; Object submittedValue = input.getSubmittedValue(); ConfigContainer c...
[ "public", "static", "Object", "getValueToRender", "(", "FacesContext", "context", ",", "UIComponent", "component", ")", "{", "if", "(", "component", "instanceof", "ValueHolder", ")", "{", "if", "(", "component", "instanceof", "EditableValueHolder", ")", "{", "Edit...
This method has been copied from the PrimeFaces 5 project. Algorithm works as follows; - If it's an input component, submitted value is checked first since it'd be the value to be used in case validation errors terminates jsf lifecycle - Finally the value of the component is retrieved from backing bean and if there's ...
[ "This", "method", "has", "been", "copied", "from", "the", "PrimeFaces", "5", "project", "." ]
43d915f004645b1bbbf2625214294dab0858ba01
https://github.com/stephanrauh/AngularFaces/blob/43d915f004645b1bbbf2625214294dab0858ba01/AngularFaces_2.0/incubator/AngularFaces-widgets/src/main/java/de/beyondjava/angularFaces/flavors/kendo/puiBody/PuiBody.java#L141-L163
train
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/management/ManagedApplication.java
ManagedApplication.acknowledgeHeartBeat
public void acknowledgeHeartBeat( Instance scopedInstance ) { String count = scopedInstance.data.get( MISSED_HEARTBEATS ); if( count != null && Integer.parseInt( count ) > THRESHOLD ) this.logger.info( "Agent " + InstanceHelpers.computeInstancePath( scopedInstance ) + " is alive and reachable again." ); ...
java
public void acknowledgeHeartBeat( Instance scopedInstance ) { String count = scopedInstance.data.get( MISSED_HEARTBEATS ); if( count != null && Integer.parseInt( count ) > THRESHOLD ) this.logger.info( "Agent " + InstanceHelpers.computeInstancePath( scopedInstance ) + " is alive and reachable again." ); ...
[ "public", "void", "acknowledgeHeartBeat", "(", "Instance", "scopedInstance", ")", "{", "String", "count", "=", "scopedInstance", ".", "data", ".", "get", "(", "MISSED_HEARTBEATS", ")", ";", "if", "(", "count", "!=", "null", "&&", "Integer", ".", "parseInt", ...
Acknowledges a heart beat. @param scopedInstance a root instance
[ "Acknowledges", "a", "heart", "beat", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/management/ManagedApplication.java#L167-L184
train
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/management/ManagedApplication.java
ManagedApplication.checkStates
public void checkStates( INotificationMngr notificationMngr ) { // Check the status of scoped instances Collection<Instance> scopedInstances = InstanceHelpers.findAllScopedInstances( this.application ); for( Instance scopedInstance : scopedInstances ) { // Never started instances, // or scoped instances t...
java
public void checkStates( INotificationMngr notificationMngr ) { // Check the status of scoped instances Collection<Instance> scopedInstances = InstanceHelpers.findAllScopedInstances( this.application ); for( Instance scopedInstance : scopedInstances ) { // Never started instances, // or scoped instances t...
[ "public", "void", "checkStates", "(", "INotificationMngr", "notificationMngr", ")", "{", "// Check the status of scoped instances", "Collection", "<", "Instance", ">", "scopedInstances", "=", "InstanceHelpers", ".", "findAllScopedInstances", "(", "this", ".", "application",...
Check the scoped instances states with respect to missed heart beats. @param notificationMngr
[ "Check", "the", "scoped", "instances", "states", "with", "respect", "to", "missed", "heart", "beats", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/management/ManagedApplication.java#L191-L218
train
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/internal/utils/DmUtils.java
DmUtils.markScopedInstanceAsNotDeployed
public static void markScopedInstanceAsNotDeployed( Instance scopedInstance, ManagedApplication ma, INotificationMngr notificationMngr, IInstancesMngr instanceMngr ) { scopedInstance.data.remove( Instance.IP_ADDRESS ); scopedInstance.data.remove( Instance.MACHINE_ID ); scopedInstance.data.remove( Ins...
java
public static void markScopedInstanceAsNotDeployed( Instance scopedInstance, ManagedApplication ma, INotificationMngr notificationMngr, IInstancesMngr instanceMngr ) { scopedInstance.data.remove( Instance.IP_ADDRESS ); scopedInstance.data.remove( Instance.MACHINE_ID ); scopedInstance.data.remove( Ins...
[ "public", "static", "void", "markScopedInstanceAsNotDeployed", "(", "Instance", "scopedInstance", ",", "ManagedApplication", "ma", ",", "INotificationMngr", "notificationMngr", ",", "IInstancesMngr", "instanceMngr", ")", "{", "scopedInstance", ".", "data", ".", "remove", ...
Updates a scoped instance and its children to be marked as not deployed. @param scopedInstance a non-null scoped instance @param ma the managed application @param notificationMngr the notification manager (not null) @param instanceMngr the instances manager (not null)
[ "Updates", "a", "scoped", "instance", "and", "its", "children", "to", "be", "marked", "as", "not", "deployed", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/internal/utils/DmUtils.java#L62-L109
train
roboconf/roboconf-platform
miscellaneous/roboconf-doc-generator/src/main/java/net/roboconf/doc/generator/internal/transformers/HierarchicalTransformer.java
HierarchicalTransformer.dealWithMainComponent
private void dealWithMainComponent() { this.typeToLocation.put( this.component, new Point2D.Double( this.hMargin, this.currentHeigth )); int width = H_PADDING + GraphUtils.computeShapeWidth( this.component ); this.maxRowWidth = Math.max( this.maxRowWidth, width ); this.aloneOnRow.add( this.component )...
java
private void dealWithMainComponent() { this.typeToLocation.put( this.component, new Point2D.Double( this.hMargin, this.currentHeigth )); int width = H_PADDING + GraphUtils.computeShapeWidth( this.component ); this.maxRowWidth = Math.max( this.maxRowWidth, width ); this.aloneOnRow.add( this.component )...
[ "private", "void", "dealWithMainComponent", "(", ")", "{", "this", ".", "typeToLocation", ".", "put", "(", "this", ".", "component", ",", "new", "Point2D", ".", "Double", "(", "this", ".", "hMargin", ",", "this", ".", "currentHeigth", ")", ")", ";", "int...
Finds the position for the main component.
[ "Finds", "the", "position", "for", "the", "main", "component", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-doc-generator/src/main/java/net/roboconf/doc/generator/internal/transformers/HierarchicalTransformer.java#L140-L149
train
roboconf/roboconf-platform
miscellaneous/roboconf-doc-generator/src/main/java/net/roboconf/doc/generator/internal/transformers/HierarchicalTransformer.java
HierarchicalTransformer.dealWithOthers
private void dealWithOthers( Collection<AbstractType> others ) { int col = 1; this.currentWidth = this.hMargin; for( AbstractType t : others ) { if( col > this.maxPerLine ) { col = 1; this.currentHeigth += V_PADDING + GraphUtils.SHAPE_HEIGHT; this.currentWidth = this.hMargin; } this.typeTo...
java
private void dealWithOthers( Collection<AbstractType> others ) { int col = 1; this.currentWidth = this.hMargin; for( AbstractType t : others ) { if( col > this.maxPerLine ) { col = 1; this.currentHeigth += V_PADDING + GraphUtils.SHAPE_HEIGHT; this.currentWidth = this.hMargin; } this.typeTo...
[ "private", "void", "dealWithOthers", "(", "Collection", "<", "AbstractType", ">", "others", ")", "{", "int", "col", "=", "1", ";", "this", ".", "currentWidth", "=", "this", ".", "hMargin", ";", "for", "(", "AbstractType", "t", ":", "others", ")", "{", ...
Finds the position of other components. @param others a non-null list of components
[ "Finds", "the", "position", "of", "other", "components", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-doc-generator/src/main/java/net/roboconf/doc/generator/internal/transformers/HierarchicalTransformer.java#L156-L177
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/utils/UriUtils.java
UriUtils.buildNewURI
public static URI buildNewURI( URI referenceUri, String uriSuffix ) throws URISyntaxException { if( uriSuffix == null ) throw new IllegalArgumentException( "The URI suffix cannot be null." ); uriSuffix = uriSuffix.replaceAll( "\\\\", "/" ); URI importUri = null; try { // Absolute URL ? importUri = ur...
java
public static URI buildNewURI( URI referenceUri, String uriSuffix ) throws URISyntaxException { if( uriSuffix == null ) throw new IllegalArgumentException( "The URI suffix cannot be null." ); uriSuffix = uriSuffix.replaceAll( "\\\\", "/" ); URI importUri = null; try { // Absolute URL ? importUri = ur...
[ "public", "static", "URI", "buildNewURI", "(", "URI", "referenceUri", ",", "String", "uriSuffix", ")", "throws", "URISyntaxException", "{", "if", "(", "uriSuffix", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"The URI suffix cannot be null.\""...
Builds an URI from an URI and a suffix. <p> This suffix can be an absolute URL, or a relative path with respect to the first URI. In this case, the suffix is resolved with respect to the URI. </p> <p> If the suffix is already an URL, its is returned.<br> If the suffix is a relative file path and cannot be resolved, an...
[ "Builds", "an", "URI", "from", "an", "URI", "and", "a", "suffix", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/UriUtils.java#L122-L151
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/utils/ProgramUtils.java
ProgramUtils.executeCommand
public static int executeCommand( final Logger logger, final String[] command, final File workingDir, final Map<String,String> environmentVars, final String applicationName, final String scopedInstancePath) throws IOException, InterruptedException { ExecutionResult result = executeCommandWithResul...
java
public static int executeCommand( final Logger logger, final String[] command, final File workingDir, final Map<String,String> environmentVars, final String applicationName, final String scopedInstancePath) throws IOException, InterruptedException { ExecutionResult result = executeCommandWithResul...
[ "public", "static", "int", "executeCommand", "(", "final", "Logger", "logger", ",", "final", "String", "[", "]", "command", ",", "final", "File", "workingDir", ",", "final", "Map", "<", "String", ",", "String", ">", "environmentVars", ",", "final", "String",...
Executes a command on the VM and logs the output. @param logger a logger (not null) @param command a command to execute (not null, not empty) @param workingDir the working directory for the command @param environmentVars a map containing environment variables (can be null) @param applicationName the roboconf applicatio...
[ "Executes", "a", "command", "on", "the", "VM", "and", "logs", "the", "output", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/ProgramUtils.java#L137-L154
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/utils/ProgramUtils.java
ProgramUtils.executeCommand
public static int executeCommand( final Logger logger, final List<String> command, final File workingDir, final Map<String,String> environmentVars, final String applicationName, final String scopedInstanceName) throws IOException, InterruptedException { return executeCommand( logger, command.toArr...
java
public static int executeCommand( final Logger logger, final List<String> command, final File workingDir, final Map<String,String> environmentVars, final String applicationName, final String scopedInstanceName) throws IOException, InterruptedException { return executeCommand( logger, command.toArr...
[ "public", "static", "int", "executeCommand", "(", "final", "Logger", "logger", ",", "final", "List", "<", "String", ">", "command", ",", "final", "File", "workingDir", ",", "final", "Map", "<", "String", ",", "String", ">", "environmentVars", ",", "final", ...
Executes a command on the VM and prints on the console its output. @param command a command to execute (not null, not empty) @param environmentVars a map containing environment variables (can be null) @param logger a logger (not null) @throws IOException if a new process could not be created @throws InterruptedExceptio...
[ "Executes", "a", "command", "on", "the", "VM", "and", "prints", "on", "the", "console", "its", "output", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/ProgramUtils.java#L165-L175
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/utils/DockerfileParser.java
DockerfileParser.dockerfileToCommandList
public static List<DockerCommand> dockerfileToCommandList( File dockerfile ) throws IOException { List<DockerCommand> result = new ArrayList<>(); FileInputStream in = new FileInputStream( dockerfile ); Logger logger = Logger.getLogger( DockerfileParser.class.getName()); BufferedReader br = null; try { br...
java
public static List<DockerCommand> dockerfileToCommandList( File dockerfile ) throws IOException { List<DockerCommand> result = new ArrayList<>(); FileInputStream in = new FileInputStream( dockerfile ); Logger logger = Logger.getLogger( DockerfileParser.class.getName()); BufferedReader br = null; try { br...
[ "public", "static", "List", "<", "DockerCommand", ">", "dockerfileToCommandList", "(", "File", "dockerfile", ")", "throws", "IOException", "{", "List", "<", "DockerCommand", ">", "result", "=", "new", "ArrayList", "<>", "(", ")", ";", "FileInputStream", "in", ...
Parses a dockerfile to a list of commands. @throws IOException @param dockerfile a file @return a list of Docker commands
[ "Parses", "a", "dockerfile", "to", "a", "list", "of", "commands", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/DockerfileParser.java#L59-L84
train
roboconf/roboconf-platform
core/roboconf-dm-rest-services/src/main/java/net/roboconf/dm/rest/services/internal/RestApplication.java
RestApplication.enableCors
public void enableCors( boolean enableCors ) { if( enableCors ) getProperties().put( ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS, ResponseCorsFilter.class.getName()); else getProperties().remove( ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS ); }
java
public void enableCors( boolean enableCors ) { if( enableCors ) getProperties().put( ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS, ResponseCorsFilter.class.getName()); else getProperties().remove( ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS ); }
[ "public", "void", "enableCors", "(", "boolean", "enableCors", ")", "{", "if", "(", "enableCors", ")", "getProperties", "(", ")", ".", "put", "(", "ResourceConfig", ".", "PROPERTY_CONTAINER_RESPONSE_FILTERS", ",", "ResponseCorsFilter", ".", "class", ".", "getName",...
Enables or disables CORS. @param enableCors true to enable it
[ "Enables", "or", "disables", "CORS", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm-rest-services/src/main/java/net/roboconf/dm/rest/services/internal/RestApplication.java#L169-L175
train
roboconf/roboconf-platform
core/roboconf-target-iaas-occi/src/main/java/net/roboconf/target/occi/internal/OcciVMUtils.java
OcciVMUtils.getVMIP
public static String getVMIP(String hostIpPort, String id) throws TargetException { //TODO Expecting more interoperable implem... /compute/urn:uuid:ID for Scalair, /ID for CA ! if(! hostIpPort.endsWith("/compute") && id.startsWith("urn:uuid:")) id = id.substring(9); String vmIp = null; URL url = null; try { ...
java
public static String getVMIP(String hostIpPort, String id) throws TargetException { //TODO Expecting more interoperable implem... /compute/urn:uuid:ID for Scalair, /ID for CA ! if(! hostIpPort.endsWith("/compute") && id.startsWith("urn:uuid:")) id = id.substring(9); String vmIp = null; URL url = null; try { ...
[ "public", "static", "String", "getVMIP", "(", "String", "hostIpPort", ",", "String", "id", ")", "throws", "TargetException", "{", "//TODO Expecting more interoperable implem... /compute/urn:uuid:ID for Scalair, /ID for CA !", "if", "(", "!", "hostIpPort", ".", "endsWith", "...
Retrieves VM IP. @param hostIpPort IP and port of OCCI server (eg. "172.16.225.91:8080") @param id Unique VM ID @return The VM's IP address @throws TargetException
[ "Retrieves", "VM", "IP", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-occi/src/main/java/net/roboconf/target/occi/internal/OcciVMUtils.java#L578-L621
train
roboconf/roboconf-platform
core/roboconf-target-iaas-occi/src/main/java/net/roboconf/target/occi/internal/OcciVMUtils.java
OcciVMUtils.isVMRunning
public static boolean isVMRunning(String hostIpPort, String id) throws TargetException { boolean result = false; String ip = OcciVMUtils.getVMIP(hostIpPort, id); try { InetAddress inet = InetAddress.getByName(ip); result = inet.isReachable(5000); } catch (Exception e) { result = false; final Logge...
java
public static boolean isVMRunning(String hostIpPort, String id) throws TargetException { boolean result = false; String ip = OcciVMUtils.getVMIP(hostIpPort, id); try { InetAddress inet = InetAddress.getByName(ip); result = inet.isReachable(5000); } catch (Exception e) { result = false; final Logge...
[ "public", "static", "boolean", "isVMRunning", "(", "String", "hostIpPort", ",", "String", "id", ")", "throws", "TargetException", "{", "boolean", "result", "=", "false", ";", "String", "ip", "=", "OcciVMUtils", ".", "getVMIP", "(", "hostIpPort", ",", "id", "...
Checks if VM is running. @param hostIpPort @param id @return @throws TargetException
[ "Checks", "if", "VM", "is", "running", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-occi/src/main/java/net/roboconf/target/occi/internal/OcciVMUtils.java#L630-L645
train
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/TargetsMngrImpl.java
TargetsMngrImpl.createTarget
@Override public String createTarget( String targetContent ) throws IOException { // Get the target ID TargetValidator tv = new TargetValidator( targetContent ); tv.validate(); if( RoboconfErrorHelpers.containsCriticalErrors( tv.getErrors())) throw new IOException( "There are errors in the target definitio...
java
@Override public String createTarget( String targetContent ) throws IOException { // Get the target ID TargetValidator tv = new TargetValidator( targetContent ); tv.validate(); if( RoboconfErrorHelpers.containsCriticalErrors( tv.getErrors())) throw new IOException( "There are errors in the target definitio...
[ "@", "Override", "public", "String", "createTarget", "(", "String", "targetContent", ")", "throws", "IOException", "{", "// Get the target ID", "TargetValidator", "tv", "=", "new", "TargetValidator", "(", "targetContent", ")", ";", "tv", ".", "validate", "(", ")",...
CRUD operations on targets
[ "CRUD", "operations", "on", "targets" ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/TargetsMngrImpl.java#L119-L172
train
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/TargetsMngrImpl.java
TargetsMngrImpl.findScriptResourcesForAgent
@Override public Map<String,byte[]> findScriptResourcesForAgent( String targetId ) throws IOException { Map<String,byte[]> result = new HashMap<>( 0 ); File targetDir = new File( findTargetDirectory( targetId ), Constants.PROJECT_SUB_DIR_SCRIPTS ); if( targetDir.isDirectory()){ List<String> exclusionPattern...
java
@Override public Map<String,byte[]> findScriptResourcesForAgent( String targetId ) throws IOException { Map<String,byte[]> result = new HashMap<>( 0 ); File targetDir = new File( findTargetDirectory( targetId ), Constants.PROJECT_SUB_DIR_SCRIPTS ); if( targetDir.isDirectory()){ List<String> exclusionPattern...
[ "@", "Override", "public", "Map", "<", "String", ",", "byte", "[", "]", ">", "findScriptResourcesForAgent", "(", "String", "targetId", ")", "throws", "IOException", "{", "Map", "<", "String", ",", "byte", "[", "]", ">", "result", "=", "new", "HashMap", "...
Finding script resources
[ "Finding", "script", "resources" ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/TargetsMngrImpl.java#L473-L488
train
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/TargetsMngrImpl.java
TargetsMngrImpl.listPossibleTargets
@Override public List<TargetWrapperDescriptor> listPossibleTargets( AbstractApplication app ) { // Find the matching targets based on registered hints String key = new InstanceContext( app ).toString(); String tplKey = null; if( app instanceof Application ) tplKey = new InstanceContext(((Application) app)....
java
@Override public List<TargetWrapperDescriptor> listPossibleTargets( AbstractApplication app ) { // Find the matching targets based on registered hints String key = new InstanceContext( app ).toString(); String tplKey = null; if( app instanceof Application ) tplKey = new InstanceContext(((Application) app)....
[ "@", "Override", "public", "List", "<", "TargetWrapperDescriptor", ">", "listPossibleTargets", "(", "AbstractApplication", "app", ")", "{", "// Find the matching targets based on registered hints", "String", "key", "=", "new", "InstanceContext", "(", "app", ")", ".", "t...
In relation with hints
[ "In", "relation", "with", "hints" ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/TargetsMngrImpl.java#L547-L578
train
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/TargetsMngrImpl.java
TargetsMngrImpl.lockAndGetTarget
@Override public TargetProperties lockAndGetTarget( Application app, Instance scopedInstance ) throws IOException { String instancePath = InstanceHelpers.computeInstancePath( scopedInstance ); String targetId = findTargetId( app, instancePath ); if( targetId == null ) throw new IOException( "No target was f...
java
@Override public TargetProperties lockAndGetTarget( Application app, Instance scopedInstance ) throws IOException { String instancePath = InstanceHelpers.computeInstancePath( scopedInstance ); String targetId = findTargetId( app, instancePath ); if( targetId == null ) throw new IOException( "No target was f...
[ "@", "Override", "public", "TargetProperties", "lockAndGetTarget", "(", "Application", "app", ",", "Instance", "scopedInstance", ")", "throws", "IOException", "{", "String", "instancePath", "=", "InstanceHelpers", ".", "computeInstancePath", "(", "scopedInstance", ")", ...
Atomic operations...
[ "Atomic", "operations", "..." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/TargetsMngrImpl.java#L596-L618
train
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/internal/commands/CreateInstanceCommandExecution.java
CreateInstanceCommandExecution.verify
public static void verify( CommandExecutionContext executionContext, Component component ) throws CommandException { if( executionContext != null && Constants.TARGET_INSTALLER.equalsIgnoreCase( component.getInstallerName()) && executionContext.getMaxVm() > 0 && executionContext.getMaxVm() <= executionCo...
java
public static void verify( CommandExecutionContext executionContext, Component component ) throws CommandException { if( executionContext != null && Constants.TARGET_INSTALLER.equalsIgnoreCase( component.getInstallerName()) && executionContext.getMaxVm() > 0 && executionContext.getMaxVm() <= executionCo...
[ "public", "static", "void", "verify", "(", "CommandExecutionContext", "executionContext", ",", "Component", "component", ")", "throws", "CommandException", "{", "if", "(", "executionContext", "!=", "null", "&&", "Constants", ".", "TARGET_INSTALLER", ".", "equalsIgnore...
Verifies a new VM model can be created according to a given context. @param executionContext @param component @throws CommandException
[ "Verifies", "a", "new", "VM", "model", "can", "be", "created", "according", "to", "a", "given", "context", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/internal/commands/CreateInstanceCommandExecution.java#L85-L94
train
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/internal/commands/CreateInstanceCommandExecution.java
CreateInstanceCommandExecution.update
public static void update( CommandExecutionContext executionContext, Instance createdInstance ) { if( executionContext != null ) { createdInstance.data.put( executionContext.getNewVmMarkerKey(), executionContext.getNewVmMarkerValue()); executionContext.getGlobalVmNumber().incrementAndGet(); executionContext...
java
public static void update( CommandExecutionContext executionContext, Instance createdInstance ) { if( executionContext != null ) { createdInstance.data.put( executionContext.getNewVmMarkerKey(), executionContext.getNewVmMarkerValue()); executionContext.getGlobalVmNumber().incrementAndGet(); executionContext...
[ "public", "static", "void", "update", "(", "CommandExecutionContext", "executionContext", ",", "Instance", "createdInstance", ")", "{", "if", "(", "executionContext", "!=", "null", ")", "{", "createdInstance", ".", "data", ".", "put", "(", "executionContext", ".",...
Updates an instance with context information. @param executionContext @param createdInstance
[ "Updates", "an", "instance", "with", "context", "information", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/internal/commands/CreateInstanceCommandExecution.java#L102-L109
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/model/RecipesValidator.java
RecipesValidator.validateComponentRecipes
public static List<ModelError> validateComponentRecipes( File applicationFilesDirectory, Component component ) { List<ModelError> result; if( "puppet".equalsIgnoreCase( component.getInstallerName())) result = validatePuppetComponent( applicationFilesDirectory, component ); else if( "script".equalsIgnoreCase( ...
java
public static List<ModelError> validateComponentRecipes( File applicationFilesDirectory, Component component ) { List<ModelError> result; if( "puppet".equalsIgnoreCase( component.getInstallerName())) result = validatePuppetComponent( applicationFilesDirectory, component ); else if( "script".equalsIgnoreCase( ...
[ "public", "static", "List", "<", "ModelError", ">", "validateComponentRecipes", "(", "File", "applicationFilesDirectory", ",", "Component", "component", ")", "{", "List", "<", "ModelError", ">", "result", ";", "if", "(", "\"puppet\"", ".", "equalsIgnoreCase", "(",...
Validates the recipes of a component. @param applicationFilesDirectory the application's directory @param component the component @return a non-null list of errors
[ "Validates", "the", "recipes", "of", "a", "component", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/RecipesValidator.java#L93-L104
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/model/RecipesValidator.java
RecipesValidator.checkPuppetFile
private static void checkPuppetFile( File pp, boolean withUpdateParams, Component component, Collection<ModelError> errors ) throws IOException { // Try to use the Puppet validator String[] cmd = { "puppet", "parser", "validate", pp.getAbsolutePath()}; Logger logger = Logger.getLogger( RecipesValidator.class.ge...
java
private static void checkPuppetFile( File pp, boolean withUpdateParams, Component component, Collection<ModelError> errors ) throws IOException { // Try to use the Puppet validator String[] cmd = { "puppet", "parser", "validate", pp.getAbsolutePath()}; Logger logger = Logger.getLogger( RecipesValidator.class.ge...
[ "private", "static", "void", "checkPuppetFile", "(", "File", "pp", ",", "boolean", "withUpdateParams", ",", "Component", "component", ",", "Collection", "<", "ModelError", ">", "errors", ")", "throws", "IOException", "{", "// Try to use the Puppet validator", "String"...
Reads a Puppet script and validates it. @param pp the Puppet script @param withUpdateParams true if update parameters should be present @param component the component @param errors a non-null list of errors @throws IOException if the file content could be read
[ "Reads", "a", "Puppet", "script", "and", "validates", "it", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/RecipesValidator.java#L196-L254
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/utils/ManifestUtils.java
ManifestUtils.findManifestProperty
public static String findManifestProperty( String propertyName ) { String result = null; InputStream is = null; try { is = ManifestUtils.class.getResourceAsStream( "/META-INF/MANIFEST.MF" ); Properties props = new Properties(); props.load( is ); result = findManifestProperty( props, propertyName ); ...
java
public static String findManifestProperty( String propertyName ) { String result = null; InputStream is = null; try { is = ManifestUtils.class.getResourceAsStream( "/META-INF/MANIFEST.MF" ); Properties props = new Properties(); props.load( is ); result = findManifestProperty( props, propertyName ); ...
[ "public", "static", "String", "findManifestProperty", "(", "String", "propertyName", ")", "{", "String", "result", "=", "null", ";", "InputStream", "is", "=", "null", ";", "try", "{", "is", "=", "ManifestUtils", ".", "class", ".", "getResourceAsStream", "(", ...
Finds a property in the MANIFEST file. @param propertyName the property's name @return the property's value, or null if it was not found
[ "Finds", "a", "property", "in", "the", "MANIFEST", "file", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/ManifestUtils.java#L98-L117
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/utils/ManifestUtils.java
ManifestUtils.findManifestProperty
public static String findManifestProperty( Properties props, String propertyName ) { String result = null; for( Map.Entry<Object,Object> entry : props.entrySet()) { if( propertyName.equalsIgnoreCase( String.valueOf( entry.getKey()))) { result = String.valueOf( entry.getValue()); break; } } retur...
java
public static String findManifestProperty( Properties props, String propertyName ) { String result = null; for( Map.Entry<Object,Object> entry : props.entrySet()) { if( propertyName.equalsIgnoreCase( String.valueOf( entry.getKey()))) { result = String.valueOf( entry.getValue()); break; } } retur...
[ "public", "static", "String", "findManifestProperty", "(", "Properties", "props", ",", "String", "propertyName", ")", "{", "String", "result", "=", "null", ";", "for", "(", "Map", ".", "Entry", "<", "Object", ",", "Object", ">", "entry", ":", "props", ".",...
Finds a property in the MANIFEST properties. @param props the properties @param propertyName the property's name @return the property's value, or null if it was not found
[ "Finds", "a", "property", "in", "the", "MANIFEST", "properties", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/ManifestUtils.java#L126-L137
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/errors/ErrorDetails.java
ErrorDetails.applicationTpl
public static ErrorDetails applicationTpl( String tplName, String tplVersion ) { return new ErrorDetails( tplName + " (" + tplVersion + ")", ErrorDetailsKind.APPLICATION_TEMPLATE ); }
java
public static ErrorDetails applicationTpl( String tplName, String tplVersion ) { return new ErrorDetails( tplName + " (" + tplVersion + ")", ErrorDetailsKind.APPLICATION_TEMPLATE ); }
[ "public", "static", "ErrorDetails", "applicationTpl", "(", "String", "tplName", ",", "String", "tplVersion", ")", "{", "return", "new", "ErrorDetails", "(", "tplName", "+", "\" (\"", "+", "tplVersion", "+", "\")\"", ",", "ErrorDetailsKind", ".", "APPLICATION_TEMPL...
Details for an application. @param tplName the template's name @param tplVersion the template's version @return an object with error details
[ "Details", "for", "an", "application", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/errors/ErrorDetails.java#L243-L245
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/errors/ErrorDetails.java
ErrorDetails.exception
public static ErrorDetails exception( Throwable t ) { return new ErrorDetails( Utils.writeExceptionButDoNotUseItForLogging( t ), ErrorDetailsKind.EXCEPTION ); }
java
public static ErrorDetails exception( Throwable t ) { return new ErrorDetails( Utils.writeExceptionButDoNotUseItForLogging( t ), ErrorDetailsKind.EXCEPTION ); }
[ "public", "static", "ErrorDetails", "exception", "(", "Throwable", "t", ")", "{", "return", "new", "ErrorDetails", "(", "Utils", ".", "writeExceptionButDoNotUseItForLogging", "(", "t", ")", ",", "ErrorDetailsKind", ".", "EXCEPTION", ")", ";", "}" ]
Details for an exception. @param t a throwable @return an object with error details
[ "Details", "for", "an", "exception", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/errors/ErrorDetails.java#L373-L375
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/errors/ErrorDetails.java
ErrorDetails.exceptionName
public static ErrorDetails exceptionName( Throwable t ) { return new ErrorDetails( t.getClass().getName(), ErrorDetailsKind.EXCEPTION_NAME ); }
java
public static ErrorDetails exceptionName( Throwable t ) { return new ErrorDetails( t.getClass().getName(), ErrorDetailsKind.EXCEPTION_NAME ); }
[ "public", "static", "ErrorDetails", "exceptionName", "(", "Throwable", "t", ")", "{", "return", "new", "ErrorDetails", "(", "t", ".", "getClass", "(", ")", ".", "getName", "(", ")", ",", "ErrorDetailsKind", ".", "EXCEPTION_NAME", ")", ";", "}" ]
Details for an exception name. @param t a throwable @return an object with error details
[ "Details", "for", "an", "exception", "name", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/errors/ErrorDetails.java#L383-L385
train
roboconf/roboconf-platform
core/roboconf-target-iaas-azure/src/main/java/net/roboconf/target/azure/internal/AzureIaasHandler.java
AzureIaasHandler.buildProperties
static AzureProperties buildProperties( Map<String,String> targetProperties ) throws TargetException { String[] properties = { AzureConstants.AZURE_SUBSCRIPTION_ID, AzureConstants.AZURE_KEY_STORE_FILE, AzureConstants.AZURE_KEY_STORE_PASSWORD, AzureConstants.AZURE_CREATE_CLOUD_SERVICE_TEMPLATE, Az...
java
static AzureProperties buildProperties( Map<String,String> targetProperties ) throws TargetException { String[] properties = { AzureConstants.AZURE_SUBSCRIPTION_ID, AzureConstants.AZURE_KEY_STORE_FILE, AzureConstants.AZURE_KEY_STORE_PASSWORD, AzureConstants.AZURE_CREATE_CLOUD_SERVICE_TEMPLATE, Az...
[ "static", "AzureProperties", "buildProperties", "(", "Map", "<", "String", ",", "String", ">", "targetProperties", ")", "throws", "TargetException", "{", "String", "[", "]", "properties", "=", "{", "AzureConstants", ".", "AZURE_SUBSCRIPTION_ID", ",", "AzureConstants...
Validates the received properties and builds a Java bean from them. @param targetProperties the target properties @return a non-null bean @throws TargetException if properties are invalid
[ "Validates", "the", "received", "properties", "and", "builds", "a", "Java", "bean", "from", "them", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-azure/src/main/java/net/roboconf/target/azure/internal/AzureIaasHandler.java#L253-L299
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/model/ApplicationTemplateDescriptor.java
ApplicationTemplateDescriptor.load
public static ApplicationTemplateDescriptor load( File f ) throws IOException { // Read the file's content String fileContent = Utils.readFileContent( f ); Logger logger = Logger.getLogger( ApplicationTemplateDescriptor.class.getName()); Properties properties = Utils.readPropertiesQuietly( fileContent, logger ...
java
public static ApplicationTemplateDescriptor load( File f ) throws IOException { // Read the file's content String fileContent = Utils.readFileContent( f ); Logger logger = Logger.getLogger( ApplicationTemplateDescriptor.class.getName()); Properties properties = Utils.readPropertiesQuietly( fileContent, logger ...
[ "public", "static", "ApplicationTemplateDescriptor", "load", "(", "File", "f", ")", "throws", "IOException", "{", "// Read the file's content", "String", "fileContent", "=", "Utils", ".", "readFileContent", "(", "f", ")", ";", "Logger", "logger", "=", "Logger", "....
Loads an application template's descriptor. @param f a file @return an application descriptor (not null) @throws IOException if the file could not be read
[ "Loads", "an", "application", "template", "s", "descriptor", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/ApplicationTemplateDescriptor.java#L229-L255
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/model/ApplicationTemplateDescriptor.java
ApplicationTemplateDescriptor.save
public static void save( File f, ApplicationTemplateDescriptor descriptor ) throws IOException { Properties properties = new Properties(); if( descriptor.name != null ) properties.setProperty( APPLICATION_NAME, descriptor.name ); if( descriptor.version != null ) properties.setProperty( APPLICATION_VERSION...
java
public static void save( File f, ApplicationTemplateDescriptor descriptor ) throws IOException { Properties properties = new Properties(); if( descriptor.name != null ) properties.setProperty( APPLICATION_NAME, descriptor.name ); if( descriptor.version != null ) properties.setProperty( APPLICATION_VERSION...
[ "public", "static", "void", "save", "(", "File", "f", ",", "ApplicationTemplateDescriptor", "descriptor", ")", "throws", "IOException", "{", "Properties", "properties", "=", "new", "Properties", "(", ")", ";", "if", "(", "descriptor", ".", "name", "!=", "null"...
Saves an application template's descriptor. @param f the file where the properties will be saved @param descriptor an application descriptor (not null) @throws IOException if the file could not be written
[ "Saves", "an", "application", "template", "s", "descriptor", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/ApplicationTemplateDescriptor.java#L264-L305
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/model/ApplicationTemplateDescriptor.java
ApplicationTemplateDescriptor.getLegacyProperty
static String getLegacyProperty( Properties props, String property, String defaultValue ) { String result = props.getProperty( property, null ); if( result == null ) result = props.getProperty( LEGACY_PREFIX + property, defaultValue ); return result; }
java
static String getLegacyProperty( Properties props, String property, String defaultValue ) { String result = props.getProperty( property, null ); if( result == null ) result = props.getProperty( LEGACY_PREFIX + property, defaultValue ); return result; }
[ "static", "String", "getLegacyProperty", "(", "Properties", "props", ",", "String", "property", ",", "String", "defaultValue", ")", "{", "String", "result", "=", "props", ".", "getProperty", "(", "property", ",", "null", ")", ";", "if", "(", "result", "==", ...
Gets a property value while supporting legacy ones. @param props non-null properties @param property a non-null property name (not legacy) @param defaultValue the default value if the property is not found @return a non-null string if the property was found, the default value otherwise
[ "Gets", "a", "property", "value", "while", "supporting", "legacy", "ones", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/ApplicationTemplateDescriptor.java#L315-L322
train
roboconf/roboconf-platform
miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/ProjectUtils.java
ProjectUtils.createProjectSkeleton
public static void createProjectSkeleton( File targetDirectory, CreationBean creationBean ) throws IOException { if( creationBean.isMavenProject()) createMavenProject( targetDirectory, creationBean ); else createSimpleProject( targetDirectory, creationBean ); }
java
public static void createProjectSkeleton( File targetDirectory, CreationBean creationBean ) throws IOException { if( creationBean.isMavenProject()) createMavenProject( targetDirectory, creationBean ); else createSimpleProject( targetDirectory, creationBean ); }
[ "public", "static", "void", "createProjectSkeleton", "(", "File", "targetDirectory", ",", "CreationBean", "creationBean", ")", "throws", "IOException", "{", "if", "(", "creationBean", ".", "isMavenProject", "(", ")", ")", "createMavenProject", "(", "targetDirectory", ...
Creates a project for Roboconf. @param targetDirectory the directory into which the Roboconf files must be copied @param creationBean the creation properties @throws IOException if something went wrong
[ "Creates", "a", "project", "for", "Roboconf", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/ProjectUtils.java#L91-L97
train
roboconf/roboconf-platform
miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/ProjectUtils.java
ProjectUtils.createRecipeDirectories
public static List<File> createRecipeDirectories( File applicationDirectory ) throws IOException { List<File> result = new ArrayList<> (); ApplicationLoadResult alr = RuntimeModelIo.loadApplicationFlexibly( applicationDirectory ); if( alr.getApplicationTemplate() != null ) { for( Component c : ComponentHelper...
java
public static List<File> createRecipeDirectories( File applicationDirectory ) throws IOException { List<File> result = new ArrayList<> (); ApplicationLoadResult alr = RuntimeModelIo.loadApplicationFlexibly( applicationDirectory ); if( alr.getApplicationTemplate() != null ) { for( Component c : ComponentHelper...
[ "public", "static", "List", "<", "File", ">", "createRecipeDirectories", "(", "File", "applicationDirectory", ")", "throws", "IOException", "{", "List", "<", "File", ">", "result", "=", "new", "ArrayList", "<>", "(", ")", ";", "ApplicationLoadResult", "alr", "...
Creates the recipes directories for a Roboconf components. @param applicationDirectory the application directory @return a non-null list of the created directories @throws IOException if something went wrong
[ "Creates", "the", "recipes", "directories", "for", "a", "Roboconf", "components", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/ProjectUtils.java#L114-L129
train
roboconf/roboconf-platform
miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/ProjectUtils.java
ProjectUtils.createSimpleProject
private static void createSimpleProject( File targetDirectory, CreationBean creationBean ) throws IOException { // Create the directory structure String[] directoriesToCreate = creationBean.isReusableRecipe() ? RR_DIRECTORIES : ALL_DIRECTORIES; for( String s : directoriesToCreate ) { File dir = new File( tar...
java
private static void createSimpleProject( File targetDirectory, CreationBean creationBean ) throws IOException { // Create the directory structure String[] directoriesToCreate = creationBean.isReusableRecipe() ? RR_DIRECTORIES : ALL_DIRECTORIES; for( String s : directoriesToCreate ) { File dir = new File( tar...
[ "private", "static", "void", "createSimpleProject", "(", "File", "targetDirectory", ",", "CreationBean", "creationBean", ")", "throws", "IOException", "{", "// Create the directory structure", "String", "[", "]", "directoriesToCreate", "=", "creationBean", ".", "isReusabl...
Creates a simple project for Roboconf. @param targetDirectory the directory into which the Roboconf files must be copied @param creationBean the creation properties @throws IOException if something went wrong
[ "Creates", "a", "simple", "project", "for", "Roboconf", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/ProjectUtils.java#L138-L159
train
roboconf/roboconf-platform
miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/ProjectUtils.java
ProjectUtils.createMavenProject
private static void createMavenProject( File targetDirectory, CreationBean creationBean ) throws IOException { // Create the directory structure File rootDir = new File( targetDirectory, Constants.MAVEN_SRC_MAIN_MODEL ); String[] directoriesToCreate = creationBean.isReusableRecipe() ? RR_DIRECTORIES : ALL_DIRECT...
java
private static void createMavenProject( File targetDirectory, CreationBean creationBean ) throws IOException { // Create the directory structure File rootDir = new File( targetDirectory, Constants.MAVEN_SRC_MAIN_MODEL ); String[] directoriesToCreate = creationBean.isReusableRecipe() ? RR_DIRECTORIES : ALL_DIRECT...
[ "private", "static", "void", "createMavenProject", "(", "File", "targetDirectory", ",", "CreationBean", "creationBean", ")", "throws", "IOException", "{", "// Create the directory structure", "File", "rootDir", "=", "new", "File", "(", "targetDirectory", ",", "Constants...
Creates a Maven project for Roboconf. @param targetDirectory the directory into which the Roboconf files must be copied @param creationBean the creation properties @throws IOException if something went wrong
[ "Creates", "a", "Maven", "project", "for", "Roboconf", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/ProjectUtils.java#L168-L216
train
roboconf/roboconf-platform
miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/ProjectUtils.java
ProjectUtils.completeProjectCreation
private static void completeProjectCreation( File targetDirectory, String descriptorContent, CreationBean creationBean ) throws IOException { // Create a sample graph file File f = new File( targetDirectory, Constants.PROJECT_DIR_GRAPH + "/" + GRAPH_EP ); InputStream in = ProjectUtils.class.getResource...
java
private static void completeProjectCreation( File targetDirectory, String descriptorContent, CreationBean creationBean ) throws IOException { // Create a sample graph file File f = new File( targetDirectory, Constants.PROJECT_DIR_GRAPH + "/" + GRAPH_EP ); InputStream in = ProjectUtils.class.getResource...
[ "private", "static", "void", "completeProjectCreation", "(", "File", "targetDirectory", ",", "String", "descriptorContent", ",", "CreationBean", "creationBean", ")", "throws", "IOException", "{", "// Create a sample graph file", "File", "f", "=", "new", "File", "(", "...
Completes the creation of a Roboconf project. @param targetDirectory the directory into which the Roboconf files must be copied @param descriptorContent the descriptor's content @param creationBean the creation options @throws IOException if something went wrong
[ "Completes", "the", "creation", "of", "a", "Roboconf", "project", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/ProjectUtils.java#L226-L249
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/model/ParsingError.java
ParsingError.addLineAndFile
private static ErrorDetails[] addLineAndFile( int line, File file, ErrorDetails... details ) { Set<ErrorDetails> updatedDetails = new LinkedHashSet<> (); if( details != null ) updatedDetails.addAll( Arrays.asList( details )); if( file != null ) { updatedDetails.add( file( file )); updatedDetails.add( l...
java
private static ErrorDetails[] addLineAndFile( int line, File file, ErrorDetails... details ) { Set<ErrorDetails> updatedDetails = new LinkedHashSet<> (); if( details != null ) updatedDetails.addAll( Arrays.asList( details )); if( file != null ) { updatedDetails.add( file( file )); updatedDetails.add( l...
[ "private", "static", "ErrorDetails", "[", "]", "addLineAndFile", "(", "int", "line", ",", "File", "file", ",", "ErrorDetails", "...", "details", ")", "{", "Set", "<", "ErrorDetails", ">", "updatedDetails", "=", "new", "LinkedHashSet", "<>", "(", ")", ";", ...
Adds details about the line number and the file. @param line @param file @param details @return a non-null array
[ "Adds", "details", "about", "the", "line", "number", "and", "the", "file", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/ParsingError.java#L117-L129
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/utils/DockerAndScriptUtils.java
DockerAndScriptUtils.buildReferenceMap
public static Map<String,String> buildReferenceMap( Instance instance ) { Map<String,String> result = new HashMap<> (); String instancePath = InstanceHelpers.computeInstancePath( instance ); result.put( ROBOCONF_INSTANCE_NAME, instance.getName()); result.put( ROBOCONF_INSTANCE_PATH, instancePath ); result.p...
java
public static Map<String,String> buildReferenceMap( Instance instance ) { Map<String,String> result = new HashMap<> (); String instancePath = InstanceHelpers.computeInstancePath( instance ); result.put( ROBOCONF_INSTANCE_NAME, instance.getName()); result.put( ROBOCONF_INSTANCE_PATH, instancePath ); result.p...
[ "public", "static", "Map", "<", "String", ",", "String", ">", "buildReferenceMap", "(", "Instance", "instance", ")", "{", "Map", "<", "String", ",", "String", ">", "result", "=", "new", "HashMap", "<>", "(", ")", ";", "String", "instancePath", "=", "Inst...
Builds a map with the variables defined by this class. @param instance a non-null instance @return a non-null map where all the properties here are mapped to their values for this instance
[ "Builds", "a", "map", "with", "the", "variables", "defined", "by", "this", "class", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/DockerAndScriptUtils.java#L59-L71
train
roboconf/roboconf-platform
core/roboconf-agent-monitoring/src/main/java/net/roboconf/agent/monitoring/internal/MonitoringRunnable.java
MonitoringRunnable.extractRuleSections
List<MonitoringHandlerRun> extractRuleSections( File file, String fileContent, Properties params ) { // Find rules sections StringBuilder sb = new StringBuilder(); List<String> sections = new ArrayList<String>(); for( String s : Arrays.asList( fileContent.trim().split( "\n" ))) { s = s.trim(); if( s.leng...
java
List<MonitoringHandlerRun> extractRuleSections( File file, String fileContent, Properties params ) { // Find rules sections StringBuilder sb = new StringBuilder(); List<String> sections = new ArrayList<String>(); for( String s : Arrays.asList( fileContent.trim().split( "\n" ))) { s = s.trim(); if( s.leng...
[ "List", "<", "MonitoringHandlerRun", ">", "extractRuleSections", "(", "File", "file", ",", "String", "fileContent", ",", "Properties", "params", ")", "{", "// Find rules sections", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "List", "<", "...
Reads the file content, extracts rules sections and prepares the handler invocations. @param file @param fileContent @param params @return a non-null list of handler parameters (may be empty)
[ "Reads", "the", "file", "content", "extracts", "rules", "sections", "and", "prepares", "the", "handler", "invocations", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-agent-monitoring/src/main/java/net/roboconf/agent/monitoring/internal/MonitoringRunnable.java#L162-L201
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/model/beans/ApplicationTemplate.java
ApplicationTemplate.setTags
public void setTags( Collection<String> tags ) { synchronized( this.tags ) { this.tags.clear(); if( tags != null ) this.tags.addAll( tags ); } }
java
public void setTags( Collection<String> tags ) { synchronized( this.tags ) { this.tags.clear(); if( tags != null ) this.tags.addAll( tags ); } }
[ "public", "void", "setTags", "(", "Collection", "<", "String", ">", "tags", ")", "{", "synchronized", "(", "this", ".", "tags", ")", "{", "this", ".", "tags", ".", "clear", "(", ")", ";", "if", "(", "tags", "!=", "null", ")", "this", ".", "tags", ...
Replaces all the tags. @param tags a (potentially null) collection of tags
[ "Replaces", "all", "the", "tags", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/beans/ApplicationTemplate.java#L254-L261
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/model/TargetValidator.java
TargetValidator.validate
public void validate() { ErrorDetails details = null; if( this.fileName != null ) details = ErrorDetails.file( this.fileName ); if( this.failed ) { this.errors.add( new ModelError( ErrorCode.REC_TARGET_INVALID_FILE_OR_CONTENT, this.modelObject, details )); } else { String id = this.props.getProperty...
java
public void validate() { ErrorDetails details = null; if( this.fileName != null ) details = ErrorDetails.file( this.fileName ); if( this.failed ) { this.errors.add( new ModelError( ErrorCode.REC_TARGET_INVALID_FILE_OR_CONTENT, this.modelObject, details )); } else { String id = this.props.getProperty...
[ "public", "void", "validate", "(", ")", "{", "ErrorDetails", "details", "=", "null", ";", "if", "(", "this", ".", "fileName", "!=", "null", ")", "details", "=", "ErrorDetails", ".", "file", "(", "this", ".", "fileName", ")", ";", "if", "(", "this", "...
Validates target properties.
[ "Validates", "target", "properties", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/TargetValidator.java#L111-L133
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/model/TargetValidator.java
TargetValidator.parseDirectory
public static List<ModelError> parseDirectory( File directory, Component c ) { // Validate all the properties List<ModelError> result = new ArrayList<> (); Set<String> targetIds = new HashSet<> (); for( File f : Utils.listDirectFiles( directory, Constants.FILE_EXT_PROPERTIES )) { TargetValidator tv = new T...
java
public static List<ModelError> parseDirectory( File directory, Component c ) { // Validate all the properties List<ModelError> result = new ArrayList<> (); Set<String> targetIds = new HashSet<> (); for( File f : Utils.listDirectFiles( directory, Constants.FILE_EXT_PROPERTIES )) { TargetValidator tv = new T...
[ "public", "static", "List", "<", "ModelError", ">", "parseDirectory", "(", "File", "directory", ",", "Component", "c", ")", "{", "// Validate all the properties", "List", "<", "ModelError", ">", "result", "=", "new", "ArrayList", "<>", "(", ")", ";", "Set", ...
Parses a directory with one or several properties files. @param directory an existing directory @return a non-null list of errors
[ "Parses", "a", "directory", "with", "one", "or", "several", "properties", "files", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/TargetValidator.java#L167-L190
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/model/TargetValidator.java
TargetValidator.parseTargetProperties
public static List<ModelError> parseTargetProperties( File projectDirectory, Component c ) { List<ModelError> errors; File dir = ResourceUtils.findInstanceResourcesDirectory( projectDirectory, c ); if( dir.isDirectory() && ! Utils.listAllFiles( dir, Constants.FILE_EXT_PROPERTIES ).isEmpty()) errors = pars...
java
public static List<ModelError> parseTargetProperties( File projectDirectory, Component c ) { List<ModelError> errors; File dir = ResourceUtils.findInstanceResourcesDirectory( projectDirectory, c ); if( dir.isDirectory() && ! Utils.listAllFiles( dir, Constants.FILE_EXT_PROPERTIES ).isEmpty()) errors = pars...
[ "public", "static", "List", "<", "ModelError", ">", "parseTargetProperties", "(", "File", "projectDirectory", ",", "Component", "c", ")", "{", "List", "<", "ModelError", ">", "errors", ";", "File", "dir", "=", "ResourceUtils", ".", "findInstanceResourcesDirectory"...
Parses the target properties for a given component. @param projectDirectory the project's directory @param c a component @return a non-null list of errors
[ "Parses", "the", "target", "properties", "for", "a", "given", "component", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/TargetValidator.java#L199-L210
train
roboconf/roboconf-platform
miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/TextUtils.java
TextUtils.fixSelectionLength
static int fixSelectionLength( String fullText, int selectionOffset, int selectionLength ) { if( selectionLength < 0 ) selectionLength = 0; else if( selectionOffset + selectionLength > fullText.length()) selectionLength = fullText.length() - selectionOffset; for( ; selectionOffset + selectionLength < full...
java
static int fixSelectionLength( String fullText, int selectionOffset, int selectionLength ) { if( selectionLength < 0 ) selectionLength = 0; else if( selectionOffset + selectionLength > fullText.length()) selectionLength = fullText.length() - selectionOffset; for( ; selectionOffset + selectionLength < full...
[ "static", "int", "fixSelectionLength", "(", "String", "fullText", ",", "int", "selectionOffset", ",", "int", "selectionLength", ")", "{", "if", "(", "selectionLength", "<", "0", ")", "selectionLength", "=", "0", ";", "else", "if", "(", "selectionOffset", "+", ...
Fixes the selection length to get the whole line. @param fullText the full text (not null) @param selectionOffset a <b>valid</b> selection offset @param selectionLength the selection length @return a valid selection length (can be zero)
[ "Fixes", "the", "selection", "length", "to", "get", "the", "whole", "line", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/TextUtils.java#L123-L137
train
roboconf/roboconf-platform
core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerMachineConfigurator.java
DockerMachineConfigurator.createImage
void createImage( String imageId ) throws TargetException { // If there is no Dockerfile, this method will do nothing File targetDirectory = this.parameters.getTargetPropertiesDirectory(); String dockerFilePath = this.parameters.getTargetProperties().get( GENERATE_IMAGE_FROM ); if( ! Utils.isEmptyOrWhitespaces...
java
void createImage( String imageId ) throws TargetException { // If there is no Dockerfile, this method will do nothing File targetDirectory = this.parameters.getTargetPropertiesDirectory(); String dockerFilePath = this.parameters.getTargetProperties().get( GENERATE_IMAGE_FROM ); if( ! Utils.isEmptyOrWhitespaces...
[ "void", "createImage", "(", "String", "imageId", ")", "throws", "TargetException", "{", "// If there is no Dockerfile, this method will do nothing", "File", "targetDirectory", "=", "this", ".", "parameters", ".", "getTargetPropertiesDirectory", "(", ")", ";", "String", "d...
Creates an image. @param imageId the image ID @throws TargetException if something went wrong
[ "Creates", "an", "image", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerMachineConfigurator.java#L260-L294
train
roboconf/roboconf-platform
core/roboconf-dm-rest-commons/src/main/java/net/roboconf/dm/rest/commons/security/AuthenticationManager.java
AuthenticationManager.login
public String login( String user, String pwd ) { String token = null; try { this.authService.authenticate( user, pwd ); token = UUID.randomUUID().toString(); Long now = new Date().getTime(); this.tokenToLoginTime.put( token, now ); this.tokenToUsername.put( token, user ); } catch( LoginException...
java
public String login( String user, String pwd ) { String token = null; try { this.authService.authenticate( user, pwd ); token = UUID.randomUUID().toString(); Long now = new Date().getTime(); this.tokenToLoginTime.put( token, now ); this.tokenToUsername.put( token, user ); } catch( LoginException...
[ "public", "String", "login", "(", "String", "user", ",", "String", "pwd", ")", "{", "String", "token", "=", "null", ";", "try", "{", "this", ".", "authService", ".", "authenticate", "(", "user", ",", "pwd", ")", ";", "token", "=", "UUID", ".", "rando...
Authenticates a user and creates a new session. @param user a user name @param pwd a pass word @return a token if authentication worked, null if it failed
[ "Authenticates", "a", "user", "and", "creates", "a", "new", "session", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm-rest-commons/src/main/java/net/roboconf/dm/rest/commons/security/AuthenticationManager.java#L103-L119
train
roboconf/roboconf-platform
core/roboconf-dm-rest-commons/src/main/java/net/roboconf/dm/rest/commons/security/AuthenticationManager.java
AuthenticationManager.isSessionValid
public boolean isSessionValid( final String token, long validityPeriod ) { boolean valid = false; Long loginTime = null; if( token != null ) loginTime = this.tokenToLoginTime.get( token ); if( validityPeriod < 0 ) { valid = loginTime != null; } else if( loginTime != null ) { long now = new Date()....
java
public boolean isSessionValid( final String token, long validityPeriod ) { boolean valid = false; Long loginTime = null; if( token != null ) loginTime = this.tokenToLoginTime.get( token ); if( validityPeriod < 0 ) { valid = loginTime != null; } else if( loginTime != null ) { long now = new Date()....
[ "public", "boolean", "isSessionValid", "(", "final", "String", "token", ",", "long", "validityPeriod", ")", "{", "boolean", "valid", "=", "false", ";", "Long", "loginTime", "=", "null", ";", "if", "(", "token", "!=", "null", ")", "loginTime", "=", "this", ...
Determines whether a session is valid. @param token a token @param validityPeriod the validity period for a session (in seconds, < 0 for unbound) @return true if the session is valid, false otherwise
[ "Determines", "whether", "a", "session", "is", "valid", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm-rest-commons/src/main/java/net/roboconf/dm/rest/commons/security/AuthenticationManager.java#L128-L148
train
stephanrauh/AngularFaces
AngularFaces_2.0/incubator/AngularFaces-widgets/src/main/java/de/beyondjava/angularFaces/flavors/kendo/puiInputText/PuiInputText.java
PuiInputText.processEvent
@Override public void processEvent(SystemEvent event) throws AbortProcessingException { if (!FacesContext.getCurrentInstance().isPostback()) { // if (!(getParent() instanceof Column)) { insertLabelBeforeThisInputField(); insertMessageBehindThisInputField(); } // } }
java
@Override public void processEvent(SystemEvent event) throws AbortProcessingException { if (!FacesContext.getCurrentInstance().isPostback()) { // if (!(getParent() instanceof Column)) { insertLabelBeforeThisInputField(); insertMessageBehindThisInputField(); } // } }
[ "@", "Override", "public", "void", "processEvent", "(", "SystemEvent", "event", ")", "throws", "AbortProcessingException", "{", "if", "(", "!", "FacesContext", ".", "getCurrentInstance", "(", ")", ".", "isPostback", "(", ")", ")", "{", "// if (!(getParent() instan...
Catching the PreRenderViewEvent allows AngularFaces to modify the JSF tree by adding a label and a message.
[ "Catching", "the", "PreRenderViewEvent", "allows", "AngularFaces", "to", "modify", "the", "JSF", "tree", "by", "adding", "a", "label", "and", "a", "message", "." ]
43d915f004645b1bbbf2625214294dab0858ba01
https://github.com/stephanrauh/AngularFaces/blob/43d915f004645b1bbbf2625214294dab0858ba01/AngularFaces_2.0/incubator/AngularFaces-widgets/src/main/java/de/beyondjava/angularFaces/flavors/kendo/puiInputText/PuiInputText.java#L74-L82
train
roboconf/roboconf-platform
core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2MachineConfigurator.java
Ec2MachineConfigurator.associateElasticIp
private boolean associateElasticIp() { String elasticIp = this.targetProperties.get( Ec2Constants.ELASTIC_IP ); if( ! Utils.isEmptyOrWhitespaces( elasticIp )) { this.logger.fine( "Associating an elastic IP with the instance. IP = " + elasticIp ); AssociateAddressRequest associateAddressRequest = new Associat...
java
private boolean associateElasticIp() { String elasticIp = this.targetProperties.get( Ec2Constants.ELASTIC_IP ); if( ! Utils.isEmptyOrWhitespaces( elasticIp )) { this.logger.fine( "Associating an elastic IP with the instance. IP = " + elasticIp ); AssociateAddressRequest associateAddressRequest = new Associat...
[ "private", "boolean", "associateElasticIp", "(", ")", "{", "String", "elasticIp", "=", "this", ".", "targetProperties", ".", "get", "(", "Ec2Constants", ".", "ELASTIC_IP", ")", ";", "if", "(", "!", "Utils", ".", "isEmptyOrWhitespaces", "(", "elasticIp", ")", ...
Associates an elastic IP with the VM. @return true if there is nothing more to do about elastic IP configuration, false otherwise
[ "Associates", "an", "elastic", "IP", "with", "the", "VM", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2MachineConfigurator.java#L207-L217
train
roboconf/roboconf-platform
core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2MachineConfigurator.java
Ec2MachineConfigurator.createVolume
private String createVolume(String storageId, String snapshotId, int size) { String volumeType = Ec2IaasHandler.findStorageProperty(this.targetProperties, storageId, VOLUME_TYPE_PREFIX); if(volumeType == null) volumeType = "standard"; CreateVolumeRequest createVolumeRequest = new CreateVolumeRequest() .withA...
java
private String createVolume(String storageId, String snapshotId, int size) { String volumeType = Ec2IaasHandler.findStorageProperty(this.targetProperties, storageId, VOLUME_TYPE_PREFIX); if(volumeType == null) volumeType = "standard"; CreateVolumeRequest createVolumeRequest = new CreateVolumeRequest() .withA...
[ "private", "String", "createVolume", "(", "String", "storageId", ",", "String", "snapshotId", ",", "int", "size", ")", "{", "String", "volumeType", "=", "Ec2IaasHandler", ".", "findStorageProperty", "(", "this", ".", "targetProperties", ",", "storageId", ",", "V...
Creates volume for EBS. @return volume ID of newly created volume
[ "Creates", "volume", "for", "EBS", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2MachineConfigurator.java#L284-L299
train
roboconf/roboconf-platform
core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2MachineConfigurator.java
Ec2MachineConfigurator.volumeCreated
private boolean volumeCreated(String volumeId) { DescribeVolumesRequest dvs = new DescribeVolumesRequest(); ArrayList<String> volumeIds = new ArrayList<String>(); volumeIds.add(volumeId); dvs.setVolumeIds(volumeIds); DescribeVolumesResult dvsresult = null; try { dvsresult = this.ec2Api.describeVolumes(dv...
java
private boolean volumeCreated(String volumeId) { DescribeVolumesRequest dvs = new DescribeVolumesRequest(); ArrayList<String> volumeIds = new ArrayList<String>(); volumeIds.add(volumeId); dvs.setVolumeIds(volumeIds); DescribeVolumesResult dvsresult = null; try { dvsresult = this.ec2Api.describeVolumes(dv...
[ "private", "boolean", "volumeCreated", "(", "String", "volumeId", ")", "{", "DescribeVolumesRequest", "dvs", "=", "new", "DescribeVolumesRequest", "(", ")", ";", "ArrayList", "<", "String", ">", "volumeIds", "=", "new", "ArrayList", "<", "String", ">", "(", ")...
Checks whether volume is created. @param volumeId the EBS volume ID @return true if volume created, false otherwise
[ "Checks", "whether", "volume", "is", "created", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2MachineConfigurator.java#L306-L319
train
roboconf/roboconf-platform
core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2MachineConfigurator.java
Ec2MachineConfigurator.volumesCreated
private boolean volumesCreated() { for( Map.Entry<String,String> entry : this.storageIdToVolumeId.entrySet()) { String volumeId = entry.getValue(); if(! volumeCreated(volumeId)) return false; } return true; }
java
private boolean volumesCreated() { for( Map.Entry<String,String> entry : this.storageIdToVolumeId.entrySet()) { String volumeId = entry.getValue(); if(! volumeCreated(volumeId)) return false; } return true; }
[ "private", "boolean", "volumesCreated", "(", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "String", ">", "entry", ":", "this", ".", "storageIdToVolumeId", ".", "entrySet", "(", ")", ")", "{", "String", "volumeId", "=", "entry", ".", "...
Checks whether all specified volumes are created. @return true if all volumes created, false otherwise
[ "Checks", "whether", "all", "specified", "volumes", "are", "created", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2MachineConfigurator.java#L325-L331
train
roboconf/roboconf-platform
core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2MachineConfigurator.java
Ec2MachineConfigurator.lookupVolume
private String lookupVolume(String volumeIdOrName) { String ret = null; if(! Utils.isEmptyOrWhitespaces(volumeIdOrName)) { // Lookup by volume ID DescribeVolumesRequest dvs = new DescribeVolumesRequest(Collections.singletonList(volumeIdOrName)); DescribeVolumesResult dvsresult = null; try { dvsres...
java
private String lookupVolume(String volumeIdOrName) { String ret = null; if(! Utils.isEmptyOrWhitespaces(volumeIdOrName)) { // Lookup by volume ID DescribeVolumesRequest dvs = new DescribeVolumesRequest(Collections.singletonList(volumeIdOrName)); DescribeVolumesResult dvsresult = null; try { dvsres...
[ "private", "String", "lookupVolume", "(", "String", "volumeIdOrName", ")", "{", "String", "ret", "=", "null", ";", "if", "(", "!", "Utils", ".", "isEmptyOrWhitespaces", "(", "volumeIdOrName", ")", ")", "{", "// Lookup by volume ID", "DescribeVolumesRequest", "dvs"...
Looks up volume, by ID or Name tag. @param volumeIdOrName the EBS volume ID or Name tag @return The volume ID of 1st matching volume found, null if no volume found
[ "Looks", "up", "volume", "by", "ID", "or", "Name", "tag", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2MachineConfigurator.java#L338-L367
train
roboconf/roboconf-platform
miscellaneous/roboconf-doc-generator/src/main/java/net/roboconf/doc/generator/internal/nls/Messages.java
Messages.get
public String get( String key ) { String result; try { result = this.bundle.getString( key ); } catch( MissingResourceException e ) { result = OOPS + key + '!'; } return result; }
java
public String get( String key ) { String result; try { result = this.bundle.getString( key ); } catch( MissingResourceException e ) { result = OOPS + key + '!'; } return result; }
[ "public", "String", "get", "(", "String", "key", ")", "{", "String", "result", ";", "try", "{", "result", "=", "this", ".", "bundle", ".", "getString", "(", "key", ")", ";", "}", "catch", "(", "MissingResourceException", "e", ")", "{", "result", "=", ...
Finds an internationalized string by key. @param key a non-null key @return a string (never null)
[ "Finds", "an", "internationalized", "string", "by", "key", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-doc-generator/src/main/java/net/roboconf/doc/generator/internal/nls/Messages.java#L67-L78
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/model/beans/Application.java
Application.getExternalExports
public Map<String,String> getExternalExports() { return this.template != null ? this.template.externalExports : new HashMap<String,String>( 0 ); }
java
public Map<String,String> getExternalExports() { return this.template != null ? this.template.externalExports : new HashMap<String,String>( 0 ); }
[ "public", "Map", "<", "String", ",", "String", ">", "getExternalExports", "(", ")", "{", "return", "this", ".", "template", "!=", "null", "?", "this", ".", "template", ".", "externalExports", ":", "new", "HashMap", "<", "String", ",", "String", ">", "(",...
A shortcut method to access the template's external exports mapping. @return a non-null map
[ "A", "shortcut", "method", "to", "access", "the", "template", "s", "external", "exports", "mapping", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/beans/Application.java#L93-L95
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/model/beans/Application.java
Application.replaceApplicationBindings
public boolean replaceApplicationBindings( String externalExportPrefix, Set<String> applicationNames ) { // There is a change if the set do not have the same size or if they do not contain the same // number of element. If no binding had been registered previously, then we only check whether // the new set conta...
java
public boolean replaceApplicationBindings( String externalExportPrefix, Set<String> applicationNames ) { // There is a change if the set do not have the same size or if they do not contain the same // number of element. If no binding had been registered previously, then we only check whether // the new set conta...
[ "public", "boolean", "replaceApplicationBindings", "(", "String", "externalExportPrefix", ",", "Set", "<", "String", ">", "applicationNames", ")", "{", "// There is a change if the set do not have the same size or if they do not contain the same", "// number of element. If no binding h...
Replaces application bindings for a given prefix. @param externalExportPrefix an external export prefix (not null) @param applicationNames a non-null set of application names @return true if bindings were modified, false otherwise
[ "Replaces", "application", "bindings", "for", "a", "given", "prefix", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/beans/Application.java#L192-L215
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/userdata/UserDataHelpers.java
UserDataHelpers.interceptLoadingFiles
static void interceptLoadingFiles( Properties props ) throws IOException { Logger logger = Logger.getLogger( UserDataHelpers.class.getName()); Set<String> keys = props.stringPropertyNames(); for( final String key : keys ) { if( ! key.startsWith( ENCODE_FILE_CONTENT_PREFIX )) continue; String realKey =...
java
static void interceptLoadingFiles( Properties props ) throws IOException { Logger logger = Logger.getLogger( UserDataHelpers.class.getName()); Set<String> keys = props.stringPropertyNames(); for( final String key : keys ) { if( ! key.startsWith( ENCODE_FILE_CONTENT_PREFIX )) continue; String realKey =...
[ "static", "void", "interceptLoadingFiles", "(", "Properties", "props", ")", "throws", "IOException", "{", "Logger", "logger", "=", "Logger", ".", "getLogger", "(", "UserDataHelpers", ".", "class", ".", "getName", "(", ")", ")", ";", "Set", "<", "String", ">"...
Intercepts the properties and loads file contents. @param props non-null properties @throws IOException if files had to be loaded and were not found
[ "Intercepts", "the", "properties", "and", "loads", "file", "contents", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/userdata/UserDataHelpers.java#L204-L229
train
roboconf/roboconf-platform
karaf/roboconf-karaf-prepare/src/main/java/net/roboconf/karaf/prepare/GeneratePreferencesFile.java
GeneratePreferencesFile.run
public void run( String[] args ) throws Exception { // Check the argument if( args.length != 1 ) throw new RuntimeException( "A file path was expected as an argument." ); File targetFile = new File( args[ 0 ]); if( ! targetFile.isFile()) throw new RuntimeException( "File " + targetFile + " does not exis...
java
public void run( String[] args ) throws Exception { // Check the argument if( args.length != 1 ) throw new RuntimeException( "A file path was expected as an argument." ); File targetFile = new File( args[ 0 ]); if( ! targetFile.isFile()) throw new RuntimeException( "File " + targetFile + " does not exis...
[ "public", "void", "run", "(", "String", "[", "]", "args", ")", "throws", "Exception", "{", "// Check the argument", "if", "(", "args", ".", "length", "!=", "1", ")", "throw", "new", "RuntimeException", "(", "\"A file path was expected as an argument.\"", ")", ";...
The real method that does the job. @param args @throws Exception
[ "The", "real", "method", "that", "does", "the", "job", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/karaf/roboconf-karaf-prepare/src/main/java/net/roboconf/karaf/prepare/GeneratePreferencesFile.java#L72-L140
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/model/beans/Component.java
Component.extendComponent
public void extendComponent( Component component ) { if( this.extendedComponent != null ) this.extendedComponent.extendingComponents.remove( this ); component.extendingComponents.add( this ); this.extendedComponent = component; }
java
public void extendComponent( Component component ) { if( this.extendedComponent != null ) this.extendedComponent.extendingComponents.remove( this ); component.extendingComponents.add( this ); this.extendedComponent = component; }
[ "public", "void", "extendComponent", "(", "Component", "component", ")", "{", "if", "(", "this", ".", "extendedComponent", "!=", "null", ")", "this", ".", "extendedComponent", ".", "extendingComponents", ".", "remove", "(", "this", ")", ";", "component", ".", ...
Creates a bi-directional relation between this component and an extended one. @param component a component
[ "Creates", "a", "bi", "-", "directional", "relation", "between", "this", "component", "and", "an", "extended", "one", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/beans/Component.java#L121-L128
train
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/beans/AutonomicApplicationContext.java
AutonomicApplicationContext.findRulesToExecute
public List<Rule> findRulesToExecute() { this.logger.fine( "Looking for rules to execute after an event was recorded for application " + this.app ); List<Rule> result = new ArrayList<> (); long now = System.nanoTime(); /* * For all the rules, find if there are events that should trigger its execution. *...
java
public List<Rule> findRulesToExecute() { this.logger.fine( "Looking for rules to execute after an event was recorded for application " + this.app ); List<Rule> result = new ArrayList<> (); long now = System.nanoTime(); /* * For all the rules, find if there are events that should trigger its execution. *...
[ "public", "List", "<", "Rule", ">", "findRulesToExecute", "(", ")", "{", "this", ".", "logger", ".", "fine", "(", "\"Looking for rules to execute after an event was recorded for application \"", "+", "this", ".", "app", ")", ";", "List", "<", "Rule", ">", "result"...
Finds the rules to execute after an event was recorded. @return a non-null list of rules
[ "Finds", "the", "rules", "to", "execute", "after", "an", "event", "was", "recorded", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/beans/AutonomicApplicationContext.java#L109-L211
train
roboconf/roboconf-platform
core/roboconf-dm-templating/src/main/java/net/roboconf/dm/templating/internal/helpers/AllHelper.java
AllHelper.safeApply
private String safeApply( Collection<InstanceContextBean> instances, Options options, String componentPath ) throws IOException { // Parse the filter. String installerName = (String) options.hash.get( "installer" ); final InstanceFilter filter = InstanceFilter.createFilter( componentPath, installerName ); //...
java
private String safeApply( Collection<InstanceContextBean> instances, Options options, String componentPath ) throws IOException { // Parse the filter. String installerName = (String) options.hash.get( "installer" ); final InstanceFilter filter = InstanceFilter.createFilter( componentPath, installerName ); //...
[ "private", "String", "safeApply", "(", "Collection", "<", "InstanceContextBean", ">", "instances", ",", "Options", "options", ",", "String", "componentPath", ")", "throws", "IOException", "{", "// Parse the filter.", "String", "installerName", "=", "(", "String", ")...
Same as above, but with type-safe arguments. @param instances the instances to which this helper is applied. @param options the options of this helper invocation. @return a string result. @throws IOException if a template cannot be loaded.
[ "Same", "as", "above", "but", "with", "type", "-", "safe", "arguments", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm-templating/src/main/java/net/roboconf/dm/templating/internal/helpers/AllHelper.java#L100-L130
train
roboconf/roboconf-platform
core/roboconf-dm-templating/src/main/java/net/roboconf/dm/templating/internal/helpers/AllHelper.java
AllHelper.descendantInstances
private static Collection<InstanceContextBean> descendantInstances( final InstanceContextBean instance ) { final Collection<InstanceContextBean> result = new ArrayList<InstanceContextBean>(); for (final InstanceContextBean child : instance.getChildren()) { result.add( child ); result.addAll( descendantInstan...
java
private static Collection<InstanceContextBean> descendantInstances( final InstanceContextBean instance ) { final Collection<InstanceContextBean> result = new ArrayList<InstanceContextBean>(); for (final InstanceContextBean child : instance.getChildren()) { result.add( child ); result.addAll( descendantInstan...
[ "private", "static", "Collection", "<", "InstanceContextBean", ">", "descendantInstances", "(", "final", "InstanceContextBean", "instance", ")", "{", "final", "Collection", "<", "InstanceContextBean", ">", "result", "=", "new", "ArrayList", "<", "InstanceContextBean", ...
Returns all the descendant instances of the given instance. @param instance the instance which descendants must be retrieved. @return the descendants of the given instance.
[ "Returns", "all", "the", "descendant", "instances", "of", "the", "given", "instance", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm-templating/src/main/java/net/roboconf/dm/templating/internal/helpers/AllHelper.java#L138-L147
train
vidageek/mirror
src/main/java/net/vidageek/mirror/dsl/Mirror.java
Mirror.reflectClass
public Class<?> reflectClass(final String className) { Preconditions.checkArgument(className != null && className.trim().length() > 0, "className cannot be null or empty"); return provider.getClassReflectionProvider(className).reflectClass(); }
java
public Class<?> reflectClass(final String className) { Preconditions.checkArgument(className != null && className.trim().length() > 0, "className cannot be null or empty"); return provider.getClassReflectionProvider(className).reflectClass(); }
[ "public", "Class", "<", "?", ">", "reflectClass", "(", "final", "String", "className", ")", "{", "Preconditions", ".", "checkArgument", "(", "className", "!=", "null", "&&", "className", ".", "trim", "(", ")", ".", "length", "(", ")", ">", "0", ",", "\...
This method will reflect a Class object that is represented by className. @param className Full qualified name of the class you want to reflect. @return A Class object represented by className. @throws MirrorException if no class on current ClassLoader has class represented by className. @throws IllegalArgumentExcepti...
[ "This", "method", "will", "reflect", "a", "Class", "object", "that", "is", "represented", "by", "className", "." ]
42af9dad8c0d6e5040b75e83dbcee34bc63dd539
https://github.com/vidageek/mirror/blob/42af9dad8c0d6e5040b75e83dbcee34bc63dd539/src/main/java/net/vidageek/mirror/dsl/Mirror.java#L62-L65
train
vidageek/mirror
src/main/java/net/vidageek/mirror/dsl/Mirror.java
Mirror.on
public <T> ClassController<T> on(final Class<T> clazz) { return new DefaultClassController<T>(provider, clazz); }
java
public <T> ClassController<T> on(final Class<T> clazz) { return new DefaultClassController<T>(provider, clazz); }
[ "public", "<", "T", ">", "ClassController", "<", "T", ">", "on", "(", "final", "Class", "<", "T", ">", "clazz", ")", "{", "return", "new", "DefaultClassController", "<", "T", ">", "(", "provider", ",", "clazz", ")", ";", "}" ]
Method to access reflection on clazz. @param clazz Class object to be used. @return A object that allows you to access reflection on class clazz. @throws IllegalArgumentException if clazz is null.
[ "Method", "to", "access", "reflection", "on", "clazz", "." ]
42af9dad8c0d6e5040b75e83dbcee34bc63dd539
https://github.com/vidageek/mirror/blob/42af9dad8c0d6e5040b75e83dbcee34bc63dd539/src/main/java/net/vidageek/mirror/dsl/Mirror.java#L76-L78
train
roboconf/roboconf-platform
core/roboconf-target-jclouds/src/main/java/net/roboconf/target/jclouds/internal/JCloudsHandler.java
JCloudsHandler.jcloudContext
ComputeService jcloudContext( Map<String,String> targetProperties ) throws TargetException { validate( targetProperties ); ComputeServiceContext context = ContextBuilder .newBuilder( targetProperties.get( PROVIDER_ID )) .endpoint( targetProperties.get( ENDPOINT )) .credentials( targetProperties.get( ID...
java
ComputeService jcloudContext( Map<String,String> targetProperties ) throws TargetException { validate( targetProperties ); ComputeServiceContext context = ContextBuilder .newBuilder( targetProperties.get( PROVIDER_ID )) .endpoint( targetProperties.get( ENDPOINT )) .credentials( targetProperties.get( ID...
[ "ComputeService", "jcloudContext", "(", "Map", "<", "String", ",", "String", ">", "targetProperties", ")", "throws", "TargetException", "{", "validate", "(", "targetProperties", ")", ";", "ComputeServiceContext", "context", "=", "ContextBuilder", ".", "newBuilder", ...
Creates a JCloud context. @param targetProperties the target properties @return a non-null object @throws TargetException if the target properties are invalid
[ "Creates", "a", "JCloud", "context", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-jclouds/src/main/java/net/roboconf/target/jclouds/internal/JCloudsHandler.java#L233-L243
train
roboconf/roboconf-platform
core/roboconf-target-jclouds/src/main/java/net/roboconf/target/jclouds/internal/JCloudsHandler.java
JCloudsHandler.validate
static void validate( Map<String,String> targetProperties ) throws TargetException { checkProperty( PROVIDER_ID, targetProperties ); checkProperty( ENDPOINT, targetProperties ); checkProperty( IMAGE_NAME, targetProperties ); checkProperty( SECURITY_GROUP, targetProperties ); checkProperty( IDENTITY, targetPr...
java
static void validate( Map<String,String> targetProperties ) throws TargetException { checkProperty( PROVIDER_ID, targetProperties ); checkProperty( ENDPOINT, targetProperties ); checkProperty( IMAGE_NAME, targetProperties ); checkProperty( SECURITY_GROUP, targetProperties ); checkProperty( IDENTITY, targetPr...
[ "static", "void", "validate", "(", "Map", "<", "String", ",", "String", ">", "targetProperties", ")", "throws", "TargetException", "{", "checkProperty", "(", "PROVIDER_ID", ",", "targetProperties", ")", ";", "checkProperty", "(", "ENDPOINT", ",", "targetProperties...
Validates the target properties. @param targetProperties the properties @throws TargetException if an error occurred during the validation
[ "Validates", "the", "target", "properties", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-jclouds/src/main/java/net/roboconf/target/jclouds/internal/JCloudsHandler.java#L251-L260
train
roboconf/roboconf-platform
core/roboconf-target-embedded/src/main/java/net/roboconf/target/embedded/internal/ConfiguratorOnCreation.java
ConfiguratorOnCreation.updateAgentConfigurationFile
void updateAgentConfigurationFile( TargetHandlerParameters parameters, SSHClient ssh, File tmpDir, Map<String,String> keyToNewValue ) throws IOException { this.logger.fine( "Updating agent parameters on remote host..." ); // Update the agent's configuration file String agentConfigDir = Utils.getVal...
java
void updateAgentConfigurationFile( TargetHandlerParameters parameters, SSHClient ssh, File tmpDir, Map<String,String> keyToNewValue ) throws IOException { this.logger.fine( "Updating agent parameters on remote host..." ); // Update the agent's configuration file String agentConfigDir = Utils.getVal...
[ "void", "updateAgentConfigurationFile", "(", "TargetHandlerParameters", "parameters", ",", "SSHClient", "ssh", ",", "File", "tmpDir", ",", "Map", "<", "String", ",", "String", ">", "keyToNewValue", ")", "throws", "IOException", "{", "this", ".", "logger", ".", "...
Updates the configuration file of an agent. @param parameters @param ssh @param tmpDir @param keyToNewValue @throws IOException
[ "Updates", "the", "configuration", "file", "of", "an", "agent", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-embedded/src/main/java/net/roboconf/target/embedded/internal/ConfiguratorOnCreation.java#L241-L265
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/model/helpers/ImportHelpers.java
ImportHelpers.updateImports
public static void updateImports( Instance instance, Map<String,Collection<Import>> variablePrefixToImports ) { instance.getImports().clear(); if( variablePrefixToImports != null ) instance.getImports().putAll( variablePrefixToImports ); }
java
public static void updateImports( Instance instance, Map<String,Collection<Import>> variablePrefixToImports ) { instance.getImports().clear(); if( variablePrefixToImports != null ) instance.getImports().putAll( variablePrefixToImports ); }
[ "public", "static", "void", "updateImports", "(", "Instance", "instance", ",", "Map", "<", "String", ",", "Collection", "<", "Import", ">", ">", "variablePrefixToImports", ")", "{", "instance", ".", "getImports", "(", ")", ".", "clear", "(", ")", ";", "if"...
Updates the imports of an instance with new values. @param instance the instance whose imports must be updated @param variablePrefixToImports the new imports (can be null)
[ "Updates", "the", "imports", "of", "an", "instance", "with", "new", "values", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/helpers/ImportHelpers.java#L162-L166
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/model/helpers/ImportHelpers.java
ImportHelpers.findImportByExportingInstance
public static Import findImportByExportingInstance( Collection<Import> imports, String exportingInstancePath ) { Import result = null; if( imports != null && exportingInstancePath != null ) { for( Import imp : imports ) { if( exportingInstancePath.equals( imp.getInstancePath())) { result = imp; br...
java
public static Import findImportByExportingInstance( Collection<Import> imports, String exportingInstancePath ) { Import result = null; if( imports != null && exportingInstancePath != null ) { for( Import imp : imports ) { if( exportingInstancePath.equals( imp.getInstancePath())) { result = imp; br...
[ "public", "static", "Import", "findImportByExportingInstance", "(", "Collection", "<", "Import", ">", "imports", ",", "String", "exportingInstancePath", ")", "{", "Import", "result", "=", "null", ";", "if", "(", "imports", "!=", "null", "&&", "exportingInstancePat...
Finds a specific import from the path of the instance that exports it. @param imports a collection of imports (that can be null) @param exportingInstancePath the path of the exporting instance @return an import, or null if none was found
[ "Finds", "a", "specific", "import", "from", "the", "path", "of", "the", "instance", "that", "exports", "it", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/helpers/ImportHelpers.java#L175-L188
train
roboconf/roboconf-platform
core/roboconf-messaging-http/src/main/java/net/roboconf/messaging/http/internal/HttpUtils.java
HttpUtils.httpMessagingConfiguration
public static Map<String,String> httpMessagingConfiguration( String ip, int port ) { final Map<String,String> result = new LinkedHashMap<>(); result.put( MessagingConstants.MESSAGING_TYPE_PROPERTY, HttpConstants.FACTORY_HTTP ); result.put( HttpConstants.HTTP_SERVER_IP, ip == null ? HttpConstants.DEFAULT_IP : ip ...
java
public static Map<String,String> httpMessagingConfiguration( String ip, int port ) { final Map<String,String> result = new LinkedHashMap<>(); result.put( MessagingConstants.MESSAGING_TYPE_PROPERTY, HttpConstants.FACTORY_HTTP ); result.put( HttpConstants.HTTP_SERVER_IP, ip == null ? HttpConstants.DEFAULT_IP : ip ...
[ "public", "static", "Map", "<", "String", ",", "String", ">", "httpMessagingConfiguration", "(", "String", "ip", ",", "int", "port", ")", "{", "final", "Map", "<", "String", ",", "String", ">", "result", "=", "new", "LinkedHashMap", "<>", "(", ")", ";", ...
Return a HTTP messaging configuration for the given parameters. @param agentPort the HTTP server port of the agent.. May be {@code null}. @return the messaging configuration for the given parameters.
[ "Return", "a", "HTTP", "messaging", "configuration", "for", "the", "given", "parameters", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-messaging-http/src/main/java/net/roboconf/messaging/http/internal/HttpUtils.java#L63-L71
train
roboconf/roboconf-platform
miscellaneous/roboconf-dm-rest-client/src/main/java/net/roboconf/dm/rest/client/delegates/PreferencesWsDelegate.java
PreferencesWsDelegate.listPreferences
public List<Preference> listPreferences() { this.logger.finer( "Getting all the preferences." ); WebResource path = this.resource.path( UrlConstants.PREFERENCES ); List<Preference> result = this.wsClient.createBuilder( path ) .accept( MediaType.APPLICATION_JSON ) .get( new GenericType<List<Preference>>...
java
public List<Preference> listPreferences() { this.logger.finer( "Getting all the preferences." ); WebResource path = this.resource.path( UrlConstants.PREFERENCES ); List<Preference> result = this.wsClient.createBuilder( path ) .accept( MediaType.APPLICATION_JSON ) .get( new GenericType<List<Preference>>...
[ "public", "List", "<", "Preference", ">", "listPreferences", "(", ")", "{", "this", ".", "logger", ".", "finer", "(", "\"Getting all the preferences.\"", ")", ";", "WebResource", "path", "=", "this", ".", "resource", ".", "path", "(", "UrlConstants", ".", "P...
Lists all the preferences.
[ "Lists", "all", "the", "preferences", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-dm-rest-client/src/main/java/net/roboconf/dm/rest/client/delegates/PreferencesWsDelegate.java#L66-L81
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/errors/i18n/TranslationBundle.java
TranslationBundle.resolve
public static String resolve( String lang ) { String result; if( ! LANGUAGES.contains( lang )) result = EN; else result = lang; return result; }
java
public static String resolve( String lang ) { String result; if( ! LANGUAGES.contains( lang )) result = EN; else result = lang; return result; }
[ "public", "static", "String", "resolve", "(", "String", "lang", ")", "{", "String", "result", ";", "if", "(", "!", "LANGUAGES", ".", "contains", "(", "lang", ")", ")", "result", "=", "EN", ";", "else", "result", "=", "lang", ";", "return", "result", ...
Resolves a language to a supported translation. @param lang a string (e.g. "en_EN") @return a supported language
[ "Resolves", "a", "language", "to", "a", "supported", "translation", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/errors/i18n/TranslationBundle.java#L101-L110
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/errors/i18n/TranslationBundle.java
TranslationBundle.loadContent
static Map<String,String> loadContent( String lang ) { Map<String,String> result = new LinkedHashMap<> (); try { InputStream in = TranslationBundle.class.getResourceAsStream( "/" + lang + ".json" ); ByteArrayOutputStream os = new ByteArrayOutputStream(); Utils.copyStreamSafely( in, os ); String content...
java
static Map<String,String> loadContent( String lang ) { Map<String,String> result = new LinkedHashMap<> (); try { InputStream in = TranslationBundle.class.getResourceAsStream( "/" + lang + ".json" ); ByteArrayOutputStream os = new ByteArrayOutputStream(); Utils.copyStreamSafely( in, os ); String content...
[ "static", "Map", "<", "String", ",", "String", ">", "loadContent", "(", "String", "lang", ")", "{", "Map", "<", "String", ",", "String", ">", "result", "=", "new", "LinkedHashMap", "<>", "(", ")", ";", "try", "{", "InputStream", "in", "=", "Translation...
Loads content from JSon files. @param lang the language to use @return a non-null map
[ "Loads", "content", "from", "JSon", "files", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/errors/i18n/TranslationBundle.java#L118-L153
train
roboconf/roboconf-platform
core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2IaasHandler.java
Ec2IaasHandler.parseProperties
static void parseProperties( Map<String, String> targetProperties ) throws TargetException { // Quick check String[] properties = { Ec2Constants.EC2_ENDPOINT, Ec2Constants.EC2_ACCESS_KEY, Ec2Constants.EC2_SECRET_KEY, Ec2Constants.AMI_VM_NODE, Ec2Constants.VM_INSTANCE_TYPE, Ec2Constants.SSH_KEY_NA...
java
static void parseProperties( Map<String, String> targetProperties ) throws TargetException { // Quick check String[] properties = { Ec2Constants.EC2_ENDPOINT, Ec2Constants.EC2_ACCESS_KEY, Ec2Constants.EC2_SECRET_KEY, Ec2Constants.AMI_VM_NODE, Ec2Constants.VM_INSTANCE_TYPE, Ec2Constants.SSH_KEY_NA...
[ "static", "void", "parseProperties", "(", "Map", "<", "String", ",", "String", ">", "targetProperties", ")", "throws", "TargetException", "{", "// Quick check", "String", "[", "]", "properties", "=", "{", "Ec2Constants", ".", "EC2_ENDPOINT", ",", "Ec2Constants", ...
Parses the properties and saves them in a Java bean. @param targetProperties the IaaS properties @throws TargetException
[ "Parses", "the", "properties", "and", "saves", "them", "in", "a", "Java", "bean", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2IaasHandler.java#L242-L259
train
roboconf/roboconf-platform
core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2IaasHandler.java
Ec2IaasHandler.createEc2Client
public static AmazonEC2 createEc2Client( Map<String,String> targetProperties ) throws TargetException { parseProperties( targetProperties ); // Configure the IaaS client AWSCredentials credentials = new BasicAWSCredentials( targetProperties.get(Ec2Constants.EC2_ACCESS_KEY), targetProperties.get(Ec2Const...
java
public static AmazonEC2 createEc2Client( Map<String,String> targetProperties ) throws TargetException { parseProperties( targetProperties ); // Configure the IaaS client AWSCredentials credentials = new BasicAWSCredentials( targetProperties.get(Ec2Constants.EC2_ACCESS_KEY), targetProperties.get(Ec2Const...
[ "public", "static", "AmazonEC2", "createEc2Client", "(", "Map", "<", "String", ",", "String", ">", "targetProperties", ")", "throws", "TargetException", "{", "parseProperties", "(", "targetProperties", ")", ";", "// Configure the IaaS client", "AWSCredentials", "credent...
Creates a client for EC2. @param targetProperties the target properties (not null) @return a non-null client @throws TargetException if properties are invalid
[ "Creates", "a", "client", "for", "EC2", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2IaasHandler.java#L268-L281
train
roboconf/roboconf-platform
core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2IaasHandler.java
Ec2IaasHandler.prepareEC2RequestNode
private RunInstancesRequest prepareEC2RequestNode( Map<String,String> targetProperties, String userData ) throws UnsupportedEncodingException { RunInstancesRequest runInstancesRequest = new RunInstancesRequest(); String flavor = targetProperties.get(Ec2Constants.VM_INSTANCE_TYPE); if( Utils.isEmptyOrWhitespaces...
java
private RunInstancesRequest prepareEC2RequestNode( Map<String,String> targetProperties, String userData ) throws UnsupportedEncodingException { RunInstancesRequest runInstancesRequest = new RunInstancesRequest(); String flavor = targetProperties.get(Ec2Constants.VM_INSTANCE_TYPE); if( Utils.isEmptyOrWhitespaces...
[ "private", "RunInstancesRequest", "prepareEC2RequestNode", "(", "Map", "<", "String", ",", "String", ">", "targetProperties", ",", "String", "userData", ")", "throws", "UnsupportedEncodingException", "{", "RunInstancesRequest", "runInstancesRequest", "=", "new", "RunInsta...
Prepares the request. @param targetProperties the target properties @param userData the user data to pass @return a request @throws UnsupportedEncodingException
[ "Prepares", "the", "request", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2IaasHandler.java#L291-L322
train
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/ApplicationTemplateMngrImpl.java
ApplicationTemplateMngrImpl.registerTargets
private Set<String> registerTargets( ApplicationTemplate tpl ) throws IOException, UnauthorizedActionException { // Find all the properties files and register them IOException conflictException = null; Set<String> newTargetIds = new HashSet<> (); Map<Component,Set<String>> componentToTargetIds = new HashMap<>...
java
private Set<String> registerTargets( ApplicationTemplate tpl ) throws IOException, UnauthorizedActionException { // Find all the properties files and register them IOException conflictException = null; Set<String> newTargetIds = new HashSet<> (); Map<Component,Set<String>> componentToTargetIds = new HashMap<>...
[ "private", "Set", "<", "String", ">", "registerTargets", "(", "ApplicationTemplate", "tpl", ")", "throws", "IOException", ",", "UnauthorizedActionException", "{", "// Find all the properties files and register them", "IOException", "conflictException", "=", "null", ";", "Se...
Registers the targets available in this template. @param tpl a template @return a set of target IDs, created from this template @throws IOException @throws UnauthorizedActionException
[ "Registers", "the", "targets", "available", "in", "this", "template", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/ApplicationTemplateMngrImpl.java#L250-L310
train
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/ApplicationTemplateMngrImpl.java
ApplicationTemplateMngrImpl.unregisterTargets
private void unregisterTargets( Set<String> newTargetIds ) { for( String targetId : newTargetIds ) { try { this.targetsMngr.deleteTarget( targetId ); } catch( Exception e ) { this.logger.severe( "A target ID that has just been registered could not be created. That's weird." ); Utils.logException( ...
java
private void unregisterTargets( Set<String> newTargetIds ) { for( String targetId : newTargetIds ) { try { this.targetsMngr.deleteTarget( targetId ); } catch( Exception e ) { this.logger.severe( "A target ID that has just been registered could not be created. That's weird." ); Utils.logException( ...
[ "private", "void", "unregisterTargets", "(", "Set", "<", "String", ">", "newTargetIds", ")", "{", "for", "(", "String", "targetId", ":", "newTargetIds", ")", "{", "try", "{", "this", ".", "targetsMngr", ".", "deleteTarget", "(", "targetId", ")", ";", "}", ...
Unregisters targets. @param newTargetIds a non-null set of target IDs
[ "Unregisters", "targets", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/ApplicationTemplateMngrImpl.java#L317-L328
train
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/beans/InstanceContext.java
InstanceContext.parse
public static InstanceContext parse( String s ) { String name = null, qualifier = null, instancePathOrComponentName = null; if( s != null ) { Matcher m = Pattern.compile( "(.*)::(.*)::(.*)" ).matcher( s ); if( m.matches()) { name = m.group( 1 ).equals( "null" ) ? null : m.group( 1 ); qualifier = m.gr...
java
public static InstanceContext parse( String s ) { String name = null, qualifier = null, instancePathOrComponentName = null; if( s != null ) { Matcher m = Pattern.compile( "(.*)::(.*)::(.*)" ).matcher( s ); if( m.matches()) { name = m.group( 1 ).equals( "null" ) ? null : m.group( 1 ); qualifier = m.gr...
[ "public", "static", "InstanceContext", "parse", "(", "String", "s", ")", "{", "String", "name", "=", "null", ",", "qualifier", "=", "null", ",", "instancePathOrComponentName", "=", "null", ";", "if", "(", "s", "!=", "null", ")", "{", "Matcher", "m", "=",...
Parses a string to resolve a target mapping key. @param s a string (can be null) @return a target mapping key (never null)
[ "Parses", "a", "string", "to", "resolve", "a", "target", "mapping", "key", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/beans/InstanceContext.java#L104-L117
train
roboconf/roboconf-platform
core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/utils/MessagingUtils.java
MessagingUtils.buildTopicNameForAgent
public static String buildTopicNameForAgent( Instance instance ) { Instance scopedInstance = InstanceHelpers.findScopedInstance( instance ); return buildTopicNameForAgent( InstanceHelpers.computeInstancePath( scopedInstance )); }
java
public static String buildTopicNameForAgent( Instance instance ) { Instance scopedInstance = InstanceHelpers.findScopedInstance( instance ); return buildTopicNameForAgent( InstanceHelpers.computeInstancePath( scopedInstance )); }
[ "public", "static", "String", "buildTopicNameForAgent", "(", "Instance", "instance", ")", "{", "Instance", "scopedInstance", "=", "InstanceHelpers", ".", "findScopedInstance", "(", "instance", ")", ";", "return", "buildTopicNameForAgent", "(", "InstanceHelpers", ".", ...
Builds the default topic name for an agent. @param instance an instance managed by the agent @return a non-null string
[ "Builds", "the", "default", "topic", "name", "for", "an", "agent", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/utils/MessagingUtils.java#L51-L54
train
roboconf/roboconf-platform
core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/utils/MessagingUtils.java
MessagingUtils.escapeInstancePath
public static String escapeInstancePath( String instancePath ) { String result; if( Utils.isEmptyOrWhitespaces( instancePath )) result = ""; else result = instancePath.replaceFirst( "^/*", "" ).replaceFirst( "/*$", "" ).replaceAll( "/+", "." ); return result; }
java
public static String escapeInstancePath( String instancePath ) { String result; if( Utils.isEmptyOrWhitespaces( instancePath )) result = ""; else result = instancePath.replaceFirst( "^/*", "" ).replaceFirst( "/*$", "" ).replaceAll( "/+", "." ); return result; }
[ "public", "static", "String", "escapeInstancePath", "(", "String", "instancePath", ")", "{", "String", "result", ";", "if", "(", "Utils", ".", "isEmptyOrWhitespaces", "(", "instancePath", ")", ")", "result", "=", "\"\"", ";", "else", "result", "=", "instancePa...
Removes unnecessary slashes and transforms the others into dots. @param instancePath an instance path @return a non-null string
[ "Removes", "unnecessary", "slashes", "and", "transforms", "the", "others", "into", "dots", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/utils/MessagingUtils.java#L72-L81
train
roboconf/roboconf-platform
core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/utils/MessagingUtils.java
MessagingUtils.buildId
public static String buildId( RecipientKind ownerKind, String domain, String applicationName, String scopedInstancePath ) { StringBuilder sb = new StringBuilder(); sb.append( "[ " ); sb.append( domain ); sb.append( " ] " ); if( ownerKind == RecipientKind.DM ) { sb.append( "DM" ); } else { ...
java
public static String buildId( RecipientKind ownerKind, String domain, String applicationName, String scopedInstancePath ) { StringBuilder sb = new StringBuilder(); sb.append( "[ " ); sb.append( domain ); sb.append( " ] " ); if( ownerKind == RecipientKind.DM ) { sb.append( "DM" ); } else { ...
[ "public", "static", "String", "buildId", "(", "RecipientKind", "ownerKind", ",", "String", "domain", ",", "String", "applicationName", ",", "String", "scopedInstancePath", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "sb", ".", ...
Builds a string identifying a messaging client. @param ownerKind {@link RecipientKind#DM} or {@link RecipientKind#AGENTS} @param domain the domain @param applicationName the application name (only makes sense for agents) @param scopedInstancePath the scoped instance path (only makes sense for agents) @return a non-nul...
[ "Builds", "a", "string", "identifying", "a", "messaging", "client", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/utils/MessagingUtils.java#L92-L112
train
roboconf/roboconf-platform
core/roboconf-target-iaas-openstack/src/main/java/net/roboconf/target/openstack/internal/OpenstackMachineConfigurator.java
OpenstackMachineConfigurator.checkVmIsOnline
private boolean checkVmIsOnline() { String zoneName = OpenstackIaasHandler.findZoneName( this.novaApi, this.targetProperties ); Server server = this.novaApi.getServerApiForZone( zoneName ).get(this.machineId); return Status.ACTIVE.equals(server.getStatus()); }
java
private boolean checkVmIsOnline() { String zoneName = OpenstackIaasHandler.findZoneName( this.novaApi, this.targetProperties ); Server server = this.novaApi.getServerApiForZone( zoneName ).get(this.machineId); return Status.ACTIVE.equals(server.getStatus()); }
[ "private", "boolean", "checkVmIsOnline", "(", ")", "{", "String", "zoneName", "=", "OpenstackIaasHandler", ".", "findZoneName", "(", "this", ".", "novaApi", ",", "this", ".", "targetProperties", ")", ";", "Server", "server", "=", "this", ".", "novaApi", ".", ...
Checks whether a VM is created. @return true if it is online, false otherwise
[ "Checks", "whether", "a", "VM", "is", "created", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-openstack/src/main/java/net/roboconf/target/openstack/internal/OpenstackMachineConfigurator.java#L178-L183
train
roboconf/roboconf-platform
core/roboconf-target-iaas-openstack/src/main/java/net/roboconf/target/openstack/internal/OpenstackMachineConfigurator.java
OpenstackMachineConfigurator.prepareObjectStorage
public boolean prepareObjectStorage() throws TargetException { String domains = this.targetProperties.get( OBJ_STORAGE_DOMAINS ); if( ! Utils.isEmptyOrWhitespaces( domains )) { // Get the Swift API String zoneName = OpenstackIaasHandler.findZoneName( this.novaApi, this.targetProperties ); SwiftApi swiftA...
java
public boolean prepareObjectStorage() throws TargetException { String domains = this.targetProperties.get( OBJ_STORAGE_DOMAINS ); if( ! Utils.isEmptyOrWhitespaces( domains )) { // Get the Swift API String zoneName = OpenstackIaasHandler.findZoneName( this.novaApi, this.targetProperties ); SwiftApi swiftA...
[ "public", "boolean", "prepareObjectStorage", "(", ")", "throws", "TargetException", "{", "String", "domains", "=", "this", ".", "targetProperties", ".", "get", "(", "OBJ_STORAGE_DOMAINS", ")", ";", "if", "(", "!", "Utils", ".", "isEmptyOrWhitespaces", "(", "doma...
Configures the object storage. @return true if the configuration is over @throws TargetException
[ "Configures", "the", "object", "storage", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-openstack/src/main/java/net/roboconf/target/openstack/internal/OpenstackMachineConfigurator.java#L244-L283
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/internal/dsl/parsing/FileDefinitionParser.java
FileDefinitionParser.splitFromInlineComment
String[] splitFromInlineComment( String line ) { String[] result = new String[] { line, "" }; int index = line.indexOf( ParsingConstants.COMMENT_DELIMITER ); if( index >= 0 ) { result[ 0 ] = line.substring( 0, index ); if( ! this.ignoreComments ) { // Find extra spaces before the in-line comment and pu...
java
String[] splitFromInlineComment( String line ) { String[] result = new String[] { line, "" }; int index = line.indexOf( ParsingConstants.COMMENT_DELIMITER ); if( index >= 0 ) { result[ 0 ] = line.substring( 0, index ); if( ! this.ignoreComments ) { // Find extra spaces before the in-line comment and pu...
[ "String", "[", "]", "splitFromInlineComment", "(", "String", "line", ")", "{", "String", "[", "]", "result", "=", "new", "String", "[", "]", "{", "line", ",", "\"\"", "}", ";", "int", "index", "=", "line", ".", "indexOf", "(", "ParsingConstants", ".", ...
Splits the line from the comment delimiter. @param line a string (not null) @return an array of 2 strings <p> Index 0: the line without the in-line comment. Never null.<br> Index 1: the in-line comment (if not null, it starts with a '#' symbol). </p>
[ "Splits", "the", "line", "from", "the", "comment", "delimiter", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/internal/dsl/parsing/FileDefinitionParser.java#L334-L354
train
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/internal/dsl/parsing/FileDefinitionParser.java
FileDefinitionParser.fillIn
private void fillIn() throws IOException { BufferedReader br = null; InputStream in = null; try { in = new FileInputStream( this.definitionFile.getEditedFile()); br = new BufferedReader( new InputStreamReader( in, StandardCharsets.UTF_8 )); String line; while(( line = nextLine( br )) != null ) { ...
java
private void fillIn() throws IOException { BufferedReader br = null; InputStream in = null; try { in = new FileInputStream( this.definitionFile.getEditedFile()); br = new BufferedReader( new InputStreamReader( in, StandardCharsets.UTF_8 )); String line; while(( line = nextLine( br )) != null ) { ...
[ "private", "void", "fillIn", "(", ")", "throws", "IOException", "{", "BufferedReader", "br", "=", "null", ";", "InputStream", "in", "=", "null", ";", "try", "{", "in", "=", "new", "FileInputStream", "(", "this", ".", "definitionFile", ".", "getEditedFile", ...
Parses the file and fills-in the resulting structure. @throws IOException
[ "Parses", "the", "file", "and", "fills", "-", "in", "the", "resulting", "structure", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/internal/dsl/parsing/FileDefinitionParser.java#L574-L636
train
roboconf/roboconf-platform
miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/textactions/CommentAction.java
CommentAction.commentLine
public static String commentLine( String line ) { String result = line; if( ! Utils.isEmptyOrWhitespaces( line ) && ! line.trim().startsWith( ParsingConstants.COMMENT_DELIMITER )) result = ParsingConstants.COMMENT_DELIMITER + line; return result; }
java
public static String commentLine( String line ) { String result = line; if( ! Utils.isEmptyOrWhitespaces( line ) && ! line.trim().startsWith( ParsingConstants.COMMENT_DELIMITER )) result = ParsingConstants.COMMENT_DELIMITER + line; return result; }
[ "public", "static", "String", "commentLine", "(", "String", "line", ")", "{", "String", "result", "=", "line", ";", "if", "(", "!", "Utils", ".", "isEmptyOrWhitespaces", "(", "line", ")", "&&", "!", "line", ".", "trim", "(", ")", ".", "startsWith", "("...
Comments a line. @param line a non-null line @return a non-null line
[ "Comments", "a", "line", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/textactions/CommentAction.java#L47-L55
train
roboconf/roboconf-platform
core/roboconf-dm-rest-services/src/main/java/net/roboconf/dm/rest/services/internal/filters/AuthenticationFilter.java
AuthenticationFilter.cleanPath
static String cleanPath( String path ) { return path .replaceFirst( "^" + ServletRegistrationComponent.REST_CONTEXT + "/", "/" ) .replaceFirst( "^" + ServletRegistrationComponent.WEBSOCKET_CONTEXT + "/", "/" ) .replaceFirst( "\\?.*", "" ); }
java
static String cleanPath( String path ) { return path .replaceFirst( "^" + ServletRegistrationComponent.REST_CONTEXT + "/", "/" ) .replaceFirst( "^" + ServletRegistrationComponent.WEBSOCKET_CONTEXT + "/", "/" ) .replaceFirst( "\\?.*", "" ); }
[ "static", "String", "cleanPath", "(", "String", "path", ")", "{", "return", "path", ".", "replaceFirst", "(", "\"^\"", "+", "ServletRegistrationComponent", ".", "REST_CONTEXT", "+", "\"/\"", ",", "\"/\"", ")", ".", "replaceFirst", "(", "\"^\"", "+", "ServletRe...
Cleans the path by removing the servlet paths and URL parameters. @param path a non-null path @return a non-null path
[ "Cleans", "the", "path", "by", "removing", "the", "servlet", "paths", "and", "URL", "parameters", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm-rest-services/src/main/java/net/roboconf/dm/rest/services/internal/filters/AuthenticationFilter.java#L260-L266
train
roboconf/roboconf-platform
core/roboconf-agent/src/main/java/net/roboconf/agent/internal/PluginProxy.java
PluginProxy.resetAllCounters
public static synchronized void resetAllCounters() { initializeCount.set(0); deployCount.set(0); undeployCount.set(0); startCount.set(0); stopCount.set(0); updateCount.set(0); errorCount.set( 0 ); }
java
public static synchronized void resetAllCounters() { initializeCount.set(0); deployCount.set(0); undeployCount.set(0); startCount.set(0); stopCount.set(0); updateCount.set(0); errorCount.set( 0 ); }
[ "public", "static", "synchronized", "void", "resetAllCounters", "(", ")", "{", "initializeCount", ".", "set", "(", "0", ")", ";", "deployCount", ".", "set", "(", "0", ")", ";", "undeployCount", ".", "set", "(", "0", ")", ";", "startCount", ".", "set", ...
Resets all counters.
[ "Resets", "all", "counters", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-agent/src/main/java/net/roboconf/agent/internal/PluginProxy.java#L63-L71
train
roboconf/roboconf-platform
core/roboconf-agent-monitoring/src/main/java/net/roboconf/agent/monitoring/internal/nagios/LiveStatusClient.java
LiveStatusClient.queryLivestatus
public String queryLivestatus( String nagiosQuery ) throws UnknownHostException, IOException { Socket liveStatusSocket = null; try { this.logger.fine( "About to open a connection through Live Status..." ); liveStatusSocket = new Socket( this.host, this.port ); this.logger.fine( "A connection was establish...
java
public String queryLivestatus( String nagiosQuery ) throws UnknownHostException, IOException { Socket liveStatusSocket = null; try { this.logger.fine( "About to open a connection through Live Status..." ); liveStatusSocket = new Socket( this.host, this.port ); this.logger.fine( "A connection was establish...
[ "public", "String", "queryLivestatus", "(", "String", "nagiosQuery", ")", "throws", "UnknownHostException", ",", "IOException", "{", "Socket", "liveStatusSocket", "=", "null", ";", "try", "{", "this", ".", "logger", ".", "fine", "(", "\"About to open a connection th...
Queries a live status server. @param nagiosQuery the query to pass through a socket (not null) @return the response @throws UnknownHostException @throws IOException
[ "Queries", "a", "live", "status", "server", "." ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-agent-monitoring/src/main/java/net/roboconf/agent/monitoring/internal/nagios/LiveStatusClient.java#L73-L101
train