id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
107,800 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java | GeometryCoordinateDimension.convert | public static MultiLineString convert(MultiLineString multiLineString, int dimension) {
int nb = multiLineString.getNumGeometries();
final LineString[] ls = new LineString[nb];
for (int i = 0; i < nb; i++) {
ls[i] = GeometryCoordinateDimension.convert((LineString) multiLineString.get... | java | public static MultiLineString convert(MultiLineString multiLineString, int dimension) {
int nb = multiLineString.getNumGeometries();
final LineString[] ls = new LineString[nb];
for (int i = 0; i < nb; i++) {
ls[i] = GeometryCoordinateDimension.convert((LineString) multiLineString.get... | [
"public",
"static",
"MultiLineString",
"convert",
"(",
"MultiLineString",
"multiLineString",
",",
"int",
"dimension",
")",
"{",
"int",
"nb",
"=",
"multiLineString",
".",
"getNumGeometries",
"(",
")",
";",
"final",
"LineString",
"[",
"]",
"ls",
"=",
"new",
"Lin... | Force the dimension of the MultiLineString and update correctly the coordinate
dimension
@param multiLineString
@param dimension
@return | [
"Force",
"the",
"dimension",
"of",
"the",
"MultiLineString",
"and",
"update",
"correctly",
"the",
"coordinate",
"dimension"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java#L110-L117 |
107,801 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java | GeometryCoordinateDimension.convert | public static Polygon convert(Polygon polygon, int dimension) {
LinearRing shell = GeometryCoordinateDimension.convert(polygon.getExteriorRing(),dimension);
int nbOfHoles = polygon.getNumInteriorRing();
final LinearRing[] holes = new LinearRing[nbOfHoles];
for (int i = 0; i < nbOfHoles; ... | java | public static Polygon convert(Polygon polygon, int dimension) {
LinearRing shell = GeometryCoordinateDimension.convert(polygon.getExteriorRing(),dimension);
int nbOfHoles = polygon.getNumInteriorRing();
final LinearRing[] holes = new LinearRing[nbOfHoles];
for (int i = 0; i < nbOfHoles; ... | [
"public",
"static",
"Polygon",
"convert",
"(",
"Polygon",
"polygon",
",",
"int",
"dimension",
")",
"{",
"LinearRing",
"shell",
"=",
"GeometryCoordinateDimension",
".",
"convert",
"(",
"polygon",
".",
"getExteriorRing",
"(",
")",
",",
"dimension",
")",
";",
"in... | Force the dimension of the Polygon and update correctly the coordinate
dimension
@param polygon
@param dimension
@return | [
"Force",
"the",
"dimension",
"of",
"the",
"Polygon",
"and",
"update",
"correctly",
"the",
"coordinate",
"dimension"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java#L126-L134 |
107,802 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java | GeometryCoordinateDimension.convert | public static LinearRing convert(LineString lineString,int dimension) {
return gf.createLinearRing(convertSequence(lineString.getCoordinates(),dimension));
} | java | public static LinearRing convert(LineString lineString,int dimension) {
return gf.createLinearRing(convertSequence(lineString.getCoordinates(),dimension));
} | [
"public",
"static",
"LinearRing",
"convert",
"(",
"LineString",
"lineString",
",",
"int",
"dimension",
")",
"{",
"return",
"gf",
".",
"createLinearRing",
"(",
"convertSequence",
"(",
"lineString",
".",
"getCoordinates",
"(",
")",
",",
"dimension",
")",
")",
";... | Force the dimension of the LineString and update correctly the coordinate
dimension
@param lineString
@param dimension
@return | [
"Force",
"the",
"dimension",
"of",
"the",
"LineString",
"and",
"update",
"correctly",
"the",
"coordinate",
"dimension"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java#L143-L145 |
107,803 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java | GeometryCoordinateDimension.convert | public static LinearRing convert(LinearRing linearRing,int dimension) {
return gf.createLinearRing(convertSequence(linearRing.getCoordinates(),dimension));
} | java | public static LinearRing convert(LinearRing linearRing,int dimension) {
return gf.createLinearRing(convertSequence(linearRing.getCoordinates(),dimension));
} | [
"public",
"static",
"LinearRing",
"convert",
"(",
"LinearRing",
"linearRing",
",",
"int",
"dimension",
")",
"{",
"return",
"gf",
".",
"createLinearRing",
"(",
"convertSequence",
"(",
"linearRing",
".",
"getCoordinates",
"(",
")",
",",
"dimension",
")",
")",
";... | Force the dimension of the LinearRing and update correctly the coordinate
dimension
@param linearRing
@param dimension
@return | [
"Force",
"the",
"dimension",
"of",
"the",
"LinearRing",
"and",
"update",
"correctly",
"the",
"coordinate",
"dimension"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java#L154-L156 |
107,804 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java | GeometryCoordinateDimension.convertSequence | private static CoordinateArraySequence convertSequence(Coordinate[] cs,int dimension) {
for (int i = 0; i < cs.length; i++) {
Coordinate coord = cs[i];
switch (dimension) {
case 2:
coord.z = Double.NaN;
cs[i]=coord;
... | java | private static CoordinateArraySequence convertSequence(Coordinate[] cs,int dimension) {
for (int i = 0; i < cs.length; i++) {
Coordinate coord = cs[i];
switch (dimension) {
case 2:
coord.z = Double.NaN;
cs[i]=coord;
... | [
"private",
"static",
"CoordinateArraySequence",
"convertSequence",
"(",
"Coordinate",
"[",
"]",
"cs",
",",
"int",
"dimension",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"cs",
".",
"length",
";",
"i",
"++",
")",
"{",
"Coordinate",
"coor... | Create a new CoordinateArraySequence and update its dimension
@param cs a coordinate array
@return a new CoordinateArraySequence | [
"Create",
"a",
"new",
"CoordinateArraySequence",
"and",
"update",
"its",
"dimension"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java#L164-L185 |
107,805 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_CompactnessRatio.java | ST_CompactnessRatio.computeCompacity | public static Double computeCompacity(Geometry geom) {
if(geom == null){
return null;
}
if (geom instanceof Polygon) {
final double circleRadius = Math.sqrt(geom.getArea() / Math.PI);
final double circleCurcumference = 2 * Math.PI * circleRadius;
r... | java | public static Double computeCompacity(Geometry geom) {
if(geom == null){
return null;
}
if (geom instanceof Polygon) {
final double circleRadius = Math.sqrt(geom.getArea() / Math.PI);
final double circleCurcumference = 2 * Math.PI * circleRadius;
r... | [
"public",
"static",
"Double",
"computeCompacity",
"(",
"Geometry",
"geom",
")",
"{",
"if",
"(",
"geom",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"geom",
"instanceof",
"Polygon",
")",
"{",
"final",
"double",
"circleRadius",
"=",
"Mat... | Returns the compactness ratio of the given polygon
@param geom Geometry
@return The compactness ratio of the given polygon | [
"Returns",
"the",
"compactness",
"ratio",
"of",
"the",
"given",
"polygon"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_CompactnessRatio.java#L60-L70 |
107,806 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DArea.java | ST_3DArea.st3darea | public static Double st3darea(Geometry geometry) {
if (geometry == null) {
return null;
}
double area = 0;
for (int idPoly = 0; idPoly < geometry.getNumGeometries(); idPoly++) {
Geometry subGeom = geometry.getGeometryN(idPoly);
if (subGeom instanceof P... | java | public static Double st3darea(Geometry geometry) {
if (geometry == null) {
return null;
}
double area = 0;
for (int idPoly = 0; idPoly < geometry.getNumGeometries(); idPoly++) {
Geometry subGeom = geometry.getGeometryN(idPoly);
if (subGeom instanceof P... | [
"public",
"static",
"Double",
"st3darea",
"(",
"Geometry",
"geometry",
")",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"double",
"area",
"=",
"0",
";",
"for",
"(",
"int",
"idPoly",
"=",
"0",
";",
"idPoly",
"<",
... | Compute the 3D area of a polygon a geometrycollection that contains
polygons
@param geometry
@return | [
"Compute",
"the",
"3D",
"area",
"of",
"a",
"polygon",
"a",
"geometrycollection",
"that",
"contains",
"polygons"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DArea.java#L52-L64 |
107,807 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DArea.java | ST_3DArea.compute3DArea | private static Double compute3DArea(Polygon geometry) {
DelaunayData delaunayData = new DelaunayData();
delaunayData.put(geometry, DelaunayData.MODE.TESSELLATION);
// Do triangulation
delaunayData.triangulate();
return delaunayData.get3DArea();
} | java | private static Double compute3DArea(Polygon geometry) {
DelaunayData delaunayData = new DelaunayData();
delaunayData.put(geometry, DelaunayData.MODE.TESSELLATION);
// Do triangulation
delaunayData.triangulate();
return delaunayData.get3DArea();
} | [
"private",
"static",
"Double",
"compute3DArea",
"(",
"Polygon",
"geometry",
")",
"{",
"DelaunayData",
"delaunayData",
"=",
"new",
"DelaunayData",
"(",
")",
";",
"delaunayData",
".",
"put",
"(",
"geometry",
",",
"DelaunayData",
".",
"MODE",
".",
"TESSELLATION",
... | Compute the 3D area of a polygon
@param geometry
@return | [
"Compute",
"the",
"3D",
"area",
"of",
"a",
"polygon"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/properties/ST_3DArea.java#L72-L78 |
107,808 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_SetSRID.java | ST_SetSRID.setSRID | public static Geometry setSRID(Geometry geometry, Integer srid) throws IllegalArgumentException {
if (geometry == null) {
return null;
}
if (srid == null) {
throw new IllegalArgumentException("The SRID code cannot be null.");
}
Geometry geom = geometry.cop... | java | public static Geometry setSRID(Geometry geometry, Integer srid) throws IllegalArgumentException {
if (geometry == null) {
return null;
}
if (srid == null) {
throw new IllegalArgumentException("The SRID code cannot be null.");
}
Geometry geom = geometry.cop... | [
"public",
"static",
"Geometry",
"setSRID",
"(",
"Geometry",
"geometry",
",",
"Integer",
"srid",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"srid",
"==",
"null",
")",... | Set a new SRID to the geometry
@param geometry
@param srid
@return
@throws IllegalArgumentException | [
"Set",
"a",
"new",
"SRID",
"to",
"the",
"geometry"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/crs/ST_SetSRID.java#L51-L61 |
107,809 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/json/JsonWrite.java | JsonWrite.writeGeoJson | public static void writeGeoJson(Connection connection, String fileName, String tableReference, String encoding) throws IOException, SQLException {
JsonDriverFunction jsonDriver = new JsonDriverFunction();
jsonDriver.exportTable(connection,tableReference, URIUtilities.fileFromString(fileName), ne... | java | public static void writeGeoJson(Connection connection, String fileName, String tableReference, String encoding) throws IOException, SQLException {
JsonDriverFunction jsonDriver = new JsonDriverFunction();
jsonDriver.exportTable(connection,tableReference, URIUtilities.fileFromString(fileName), ne... | [
"public",
"static",
"void",
"writeGeoJson",
"(",
"Connection",
"connection",
",",
"String",
"fileName",
",",
"String",
"tableReference",
",",
"String",
"encoding",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"JsonDriverFunction",
"jsonDriver",
"=",
"new"... | Write the JSON file.
@param connection
@param fileName
@param tableReference
@param encoding
@throws IOException
@throws SQLException | [
"Write",
"the",
"JSON",
"file",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/json/JsonWrite.java#L57-L60 |
107,810 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/type/GeometryTypeFromConstraint.java | GeometryTypeFromConstraint.geometryTypeFromConstraint | public static int geometryTypeFromConstraint(String constraint, int numericPrecision) {
if(constraint.isEmpty() && numericPrecision > GeometryTypeCodes.GEOMETRYZM) {
return GeometryTypeCodes.GEOMETRY;
}
// Use Domain given parameters
if(numericPrecision <= GeometryTypeCodes.G... | java | public static int geometryTypeFromConstraint(String constraint, int numericPrecision) {
if(constraint.isEmpty() && numericPrecision > GeometryTypeCodes.GEOMETRYZM) {
return GeometryTypeCodes.GEOMETRY;
}
// Use Domain given parameters
if(numericPrecision <= GeometryTypeCodes.G... | [
"public",
"static",
"int",
"geometryTypeFromConstraint",
"(",
"String",
"constraint",
",",
"int",
"numericPrecision",
")",
"{",
"if",
"(",
"constraint",
".",
"isEmpty",
"(",
")",
"&&",
"numericPrecision",
">",
"GeometryTypeCodes",
".",
"GEOMETRYZM",
")",
"{",
"r... | Convert H2 constraint string into a OGC geometry type index.
@param constraint SQL Constraint ex: ST_GeometryTypeCode(the_geom) = 5
@param numericPrecision This parameter is available if the user give domain
@return Geometry type code {@link org.h2gis.utilities.GeometryTypeCodes} | [
"Convert",
"H2",
"constraint",
"string",
"into",
"a",
"OGC",
"geometry",
"type",
"index",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/type/GeometryTypeFromConstraint.java#L57-L72 |
107,811 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFDriverFunction.java | DBFDriverFunction.getQuestionMark | public static String getQuestionMark(int count) {
StringBuilder qMark = new StringBuilder();
for (int i = 0; i < count; i++) {
if(i > 0) {
qMark.append(", ");
}
qMark.append("?");
}
return qMark.toString();
} | java | public static String getQuestionMark(int count) {
StringBuilder qMark = new StringBuilder();
for (int i = 0; i < count; i++) {
if(i > 0) {
qMark.append(", ");
}
qMark.append("?");
}
return qMark.toString();
} | [
"public",
"static",
"String",
"getQuestionMark",
"(",
"int",
"count",
")",
"{",
"StringBuilder",
"qMark",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"count",
";",
"i",
"++",
")",
"{",
"if",
"(",
"i"... | Generate the concatenation of ? characters. Used by PreparedStatement.
@param count Number of ? character to generation
@return Value ex: "?, ?, ?" | [
"Generate",
"the",
"concatenation",
"of",
"?",
"characters",
".",
"Used",
"by",
"PreparedStatement",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFDriverFunction.java#L286-L295 |
107,812 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFDriverFunction.java | DBFDriverFunction.getSQLColumnTypes | public static String getSQLColumnTypes(DbaseFileHeader header, boolean isH2Database) throws IOException {
StringBuilder stringBuilder = new StringBuilder();
for(int idColumn = 0; idColumn < header.getNumFields(); idColumn++) {
if(idColumn > 0) {
stringBuilder.append(", ");
... | java | public static String getSQLColumnTypes(DbaseFileHeader header, boolean isH2Database) throws IOException {
StringBuilder stringBuilder = new StringBuilder();
for(int idColumn = 0; idColumn < header.getNumFields(); idColumn++) {
if(idColumn > 0) {
stringBuilder.append(", ");
... | [
"public",
"static",
"String",
"getSQLColumnTypes",
"(",
"DbaseFileHeader",
"header",
",",
"boolean",
"isH2Database",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"stringBuilder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"idColumn",
"="... | Return SQL Columns declaration
@param header DBAse file header
@param isH2Database true if H2 database
@return Array of columns ex: ["id INTEGER", "len DOUBLE"]
@throws IOException | [
"Return",
"SQL",
"Columns",
"declaration"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFDriverFunction.java#L304-L358 |
107,813 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFDriverFunction.java | DBFDriverFunction.dBaseHeaderFromMetaData | public static DbaseFileHeader dBaseHeaderFromMetaData(ResultSetMetaData metaData, List<Integer> retainedColumns) throws SQLException {
DbaseFileHeader dbaseFileHeader = new DbaseFileHeader();
for(int fieldId= 1; fieldId <= metaData.getColumnCount(); fieldId++) {
final String fieldTypeName = ... | java | public static DbaseFileHeader dBaseHeaderFromMetaData(ResultSetMetaData metaData, List<Integer> retainedColumns) throws SQLException {
DbaseFileHeader dbaseFileHeader = new DbaseFileHeader();
for(int fieldId= 1; fieldId <= metaData.getColumnCount(); fieldId++) {
final String fieldTypeName = ... | [
"public",
"static",
"DbaseFileHeader",
"dBaseHeaderFromMetaData",
"(",
"ResultSetMetaData",
"metaData",
",",
"List",
"<",
"Integer",
">",
"retainedColumns",
")",
"throws",
"SQLException",
"{",
"DbaseFileHeader",
"dbaseFileHeader",
"=",
"new",
"DbaseFileHeader",
"(",
")"... | Create a DBF header from the columns specified in parameter.
@param metaData SQL ResultSetMetadata
@param retainedColumns list of column indexes
@return DbfaseFileHeader instance.
@throws SQLException If one or more type are not supported by DBF | [
"Create",
"a",
"DBF",
"header",
"from",
"the",
"columns",
"specified",
"in",
"parameter",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFDriverFunction.java#L367-L383 |
107,814 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemovePoints.java | ST_RemovePoints.removePoint | public static Geometry removePoint(Geometry geometry, Polygon polygon) throws SQLException {
if(geometry == null){
return null;
}
GeometryEditor localGeometryEditor = new GeometryEditor();
PolygonDeleteVertexOperation localBoxDeleteVertexOperation = new PolygonDeleteVertexOpe... | java | public static Geometry removePoint(Geometry geometry, Polygon polygon) throws SQLException {
if(geometry == null){
return null;
}
GeometryEditor localGeometryEditor = new GeometryEditor();
PolygonDeleteVertexOperation localBoxDeleteVertexOperation = new PolygonDeleteVertexOpe... | [
"public",
"static",
"Geometry",
"removePoint",
"(",
"Geometry",
"geometry",
",",
"Polygon",
"polygon",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"GeometryEditor",
"localGeometryEditor",
"=",
... | Remove all vertices that are located within a polygon
@param geometry
@param polygon
@return
@throws SQLException | [
"Remove",
"all",
"vertices",
"that",
"are",
"located",
"within",
"a",
"polygon"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemovePoints.java#L54-L65 |
107,815 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/URIUtilities.java | URIUtilities.getQueryKeyValuePairs | public static Map<String,String> getQueryKeyValuePairs(URI uri) throws UnsupportedEncodingException {
Map<String,String> queryParameters = new HashMap<String, String>();
String query = uri.getRawQuery();
if(query == null) {
// Maybe invalid URI
try {
uri =... | java | public static Map<String,String> getQueryKeyValuePairs(URI uri) throws UnsupportedEncodingException {
Map<String,String> queryParameters = new HashMap<String, String>();
String query = uri.getRawQuery();
if(query == null) {
// Maybe invalid URI
try {
uri =... | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"getQueryKeyValuePairs",
"(",
"URI",
"uri",
")",
"throws",
"UnsupportedEncodingException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"queryParameters",
"=",
"new",
"HashMap",
"<",
"String",
","... | Read the Query part of an URI.
@param uri URI to split
@return Key/Value pairs of query, the key is lowercase and value may be null
@throws java.io.UnsupportedEncodingException | [
"Read",
"the",
"Query",
"part",
"of",
"an",
"URI",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/URIUtilities.java#L50-L83 |
107,816 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/URIUtilities.java | URIUtilities.getConcatenatedParameters | public static String getConcatenatedParameters(Map<String, String> parameters, String... keys) {
StringBuilder keyValues = new StringBuilder();
for(String key : keys) {
String value = parameters.get(key.toLowerCase().trim());
if(value!=null) {
if(keyValues.length(... | java | public static String getConcatenatedParameters(Map<String, String> parameters, String... keys) {
StringBuilder keyValues = new StringBuilder();
for(String key : keys) {
String value = parameters.get(key.toLowerCase().trim());
if(value!=null) {
if(keyValues.length(... | [
"public",
"static",
"String",
"getConcatenatedParameters",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"String",
"...",
"keys",
")",
"{",
"StringBuilder",
"keyValues",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"String",
"k... | Create the Query part of an URI
@param parameters Parameters to read
@param keys map property to read
@return Query part of an URI | [
"Create",
"the",
"Query",
"part",
"of",
"an",
"URI"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/URIUtilities.java#L93-L107 |
107,817 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/URIUtilities.java | URIUtilities.relativize | public static URI relativize(URI base,URI target) {
if(!base.getScheme().equals(target.getScheme())) {
return target;
}
StringBuilder rel = new StringBuilder();
String path = base.getPath();
String separator = "/";
StringTokenizer tokenizer = new StringTokeniz... | java | public static URI relativize(URI base,URI target) {
if(!base.getScheme().equals(target.getScheme())) {
return target;
}
StringBuilder rel = new StringBuilder();
String path = base.getPath();
String separator = "/";
StringTokenizer tokenizer = new StringTokeniz... | [
"public",
"static",
"URI",
"relativize",
"(",
"URI",
"base",
",",
"URI",
"target",
")",
"{",
"if",
"(",
"!",
"base",
".",
"getScheme",
"(",
")",
".",
"equals",
"(",
"target",
".",
"getScheme",
"(",
")",
")",
")",
"{",
"return",
"target",
";",
"}",
... | Enhanced version of URI.relativize, the target can now be in parent folder of base URI.
@param base Base uri, location from where to relativize.
@param target Target uri, final destination of returned URI.
@return Non-absolute URI, or target if target scheme is different than base scheme. | [
"Enhanced",
"version",
"of",
"URI",
".",
"relativize",
"the",
"target",
"can",
"now",
"be",
"in",
"parent",
"folder",
"of",
"base",
"URI",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/URIUtilities.java#L117-L160 |
107,818 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/URIUtilities.java | URIUtilities.fileFromString | public static File fileFromString(String fileName) {
try {
return new File(new URI(fileName).getPath());
} catch (URISyntaxException ex ) {
// Not a valid uri
return new File(fileName);
}
} | java | public static File fileFromString(String fileName) {
try {
return new File(new URI(fileName).getPath());
} catch (URISyntaxException ex ) {
// Not a valid uri
return new File(fileName);
}
} | [
"public",
"static",
"File",
"fileFromString",
"(",
"String",
"fileName",
")",
"{",
"try",
"{",
"return",
"new",
"File",
"(",
"new",
"URI",
"(",
"fileName",
")",
".",
"getPath",
"(",
")",
")",
";",
"}",
"catch",
"(",
"URISyntaxException",
"ex",
")",
"{"... | Get a File from the specified file name.
@param fileName File name using Path or URI
@return File path | [
"Get",
"a",
"File",
"from",
"the",
"specified",
"file",
"name",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/URIUtilities.java#L169-L176 |
107,819 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java | ST_GeometryShadow.shadowLine | private static Geometry shadowLine(LineString lineString, double[] shadowOffset, GeometryFactory factory, boolean doUnion) {
Coordinate[] coords = lineString.getCoordinates();
Collection<Polygon> shadows = new ArrayList<Polygon>();
createShadowPolygons(shadows, coords, shadowOffset, factory);
... | java | private static Geometry shadowLine(LineString lineString, double[] shadowOffset, GeometryFactory factory, boolean doUnion) {
Coordinate[] coords = lineString.getCoordinates();
Collection<Polygon> shadows = new ArrayList<Polygon>();
createShadowPolygons(shadows, coords, shadowOffset, factory);
... | [
"private",
"static",
"Geometry",
"shadowLine",
"(",
"LineString",
"lineString",
",",
"double",
"[",
"]",
"shadowOffset",
",",
"GeometryFactory",
"factory",
",",
"boolean",
"doUnion",
")",
"{",
"Coordinate",
"[",
"]",
"coords",
"=",
"lineString",
".",
"getCoordin... | Compute the shadow for a linestring
@param lineString the input linestring
@param shadowOffset computed according the sun position and the height of
the geometry
@return | [
"Compute",
"the",
"shadow",
"for",
"a",
"linestring"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java#L133-L148 |
107,820 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java | ST_GeometryShadow.shadowPolygon | private static Geometry shadowPolygon(Polygon polygon, double[] shadowOffset, GeometryFactory factory, boolean doUnion) {
Coordinate[] shellCoords = polygon.getExteriorRing().getCoordinates();
Collection<Polygon> shadows = new ArrayList<Polygon>();
createShadowPolygons(shadows, shellCoords, shad... | java | private static Geometry shadowPolygon(Polygon polygon, double[] shadowOffset, GeometryFactory factory, boolean doUnion) {
Coordinate[] shellCoords = polygon.getExteriorRing().getCoordinates();
Collection<Polygon> shadows = new ArrayList<Polygon>();
createShadowPolygons(shadows, shellCoords, shad... | [
"private",
"static",
"Geometry",
"shadowPolygon",
"(",
"Polygon",
"polygon",
",",
"double",
"[",
"]",
"shadowOffset",
",",
"GeometryFactory",
"factory",
",",
"boolean",
"doUnion",
")",
"{",
"Coordinate",
"[",
"]",
"shellCoords",
"=",
"polygon",
".",
"getExterior... | Compute the shadow for a polygon
@param polygon the input polygon
@param shadowOffset computed according the sun position and the height of
the geometry
@return | [
"Compute",
"the",
"shadow",
"for",
"a",
"polygon"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java#L158-L182 |
107,821 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java | ST_GeometryShadow.shadowPoint | private static Geometry shadowPoint(Point point, double[] shadowOffset, GeometryFactory factory) {
Coordinate startCoord = point.getCoordinate();
Coordinate offset = moveCoordinate(startCoord, shadowOffset);
if (offset.distance(point.getCoordinate()) < 10E-3) {
return point;
... | java | private static Geometry shadowPoint(Point point, double[] shadowOffset, GeometryFactory factory) {
Coordinate startCoord = point.getCoordinate();
Coordinate offset = moveCoordinate(startCoord, shadowOffset);
if (offset.distance(point.getCoordinate()) < 10E-3) {
return point;
... | [
"private",
"static",
"Geometry",
"shadowPoint",
"(",
"Point",
"point",
",",
"double",
"[",
"]",
"shadowOffset",
",",
"GeometryFactory",
"factory",
")",
"{",
"Coordinate",
"startCoord",
"=",
"point",
".",
"getCoordinate",
"(",
")",
";",
"Coordinate",
"offset",
... | Compute the shadow for a point
@param point the input point
@param shadowOffset computed according the sun position and the height of
the geometry
@return | [
"Compute",
"the",
"shadow",
"for",
"a",
"point"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java#L192-L201 |
107,822 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java | ST_GeometryShadow.shadowOffset | public static double[] shadowOffset(double azimuth, double altitude, double height) {
double spread = 1 / Math.tan(altitude);
return new double[]{-height * spread * Math.sin(azimuth), -height * spread * Math.cos(azimuth)};
} | java | public static double[] shadowOffset(double azimuth, double altitude, double height) {
double spread = 1 / Math.tan(altitude);
return new double[]{-height * spread * Math.sin(azimuth), -height * spread * Math.cos(azimuth)};
} | [
"public",
"static",
"double",
"[",
"]",
"shadowOffset",
"(",
"double",
"azimuth",
",",
"double",
"altitude",
",",
"double",
"height",
")",
"{",
"double",
"spread",
"=",
"1",
"/",
"Math",
".",
"tan",
"(",
"altitude",
")",
";",
"return",
"new",
"double",
... | Return the shadow offset in X and Y directions
@param azimuth in radians from north.
@param altitude in radians from east.
@param height of the geometry
@return | [
"Return",
"the",
"shadow",
"offset",
"in",
"X",
"and",
"Y",
"directions"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java#L211-L214 |
107,823 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java | ST_GeometryShadow.moveCoordinate | private static Coordinate moveCoordinate(Coordinate inputCoordinate, double[] shadowOffset) {
return new Coordinate(inputCoordinate.x + shadowOffset[0], inputCoordinate.y + shadowOffset[1], 0);
} | java | private static Coordinate moveCoordinate(Coordinate inputCoordinate, double[] shadowOffset) {
return new Coordinate(inputCoordinate.x + shadowOffset[0], inputCoordinate.y + shadowOffset[1], 0);
} | [
"private",
"static",
"Coordinate",
"moveCoordinate",
"(",
"Coordinate",
"inputCoordinate",
",",
"double",
"[",
"]",
"shadowOffset",
")",
"{",
"return",
"new",
"Coordinate",
"(",
"inputCoordinate",
".",
"x",
"+",
"shadowOffset",
"[",
"0",
"]",
",",
"inputCoordina... | Move the input coordinate according X and Y offset
@param inputCoordinate
@param shadowOffset
@return | [
"Move",
"the",
"input",
"coordinate",
"according",
"X",
"and",
"Y",
"offset"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java#L223-L225 |
107,824 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java | ST_GeometryShadow.createShadowPolygons | private static void createShadowPolygons(Collection<Polygon> shadows, Coordinate[] coordinates, double[] shadow, GeometryFactory factory) {
for (int i = 1; i < coordinates.length; i++) {
Coordinate startCoord = coordinates[i - 1];
Coordinate endCoord = coordinates[i];
Coordin... | java | private static void createShadowPolygons(Collection<Polygon> shadows, Coordinate[] coordinates, double[] shadow, GeometryFactory factory) {
for (int i = 1; i < coordinates.length; i++) {
Coordinate startCoord = coordinates[i - 1];
Coordinate endCoord = coordinates[i];
Coordin... | [
"private",
"static",
"void",
"createShadowPolygons",
"(",
"Collection",
"<",
"Polygon",
">",
"shadows",
",",
"Coordinate",
"[",
"]",
"coordinates",
",",
"double",
"[",
"]",
"shadow",
",",
"GeometryFactory",
"factory",
")",
"{",
"for",
"(",
"int",
"i",
"=",
... | Create and collect shadow polygons.
@param shadows
@param coordinates
@param shadow
@param factory | [
"Create",
"and",
"collect",
"shadow",
"polygons",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java#L235-L248 |
107,825 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/csv/CSVDriverFunction.java | CSVDriverFunction.exportTable | public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String csvOptions) throws SQLException, IOException {
String regex = ".*(?i)\\b(select|from)\\b.*";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(tableRefe... | java | public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String csvOptions) throws SQLException, IOException {
String regex = ".*(?i)\\b(select|from)\\b.*";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(tableRefe... | [
"public",
"void",
"exportTable",
"(",
"Connection",
"connection",
",",
"String",
"tableReference",
",",
"File",
"fileName",
",",
"ProgressVisitor",
"progress",
",",
"String",
"csvOptions",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"String",
"regex",
... | Export a table or a query to a CSV file
@param connection Active connection, do not close this connection.
@param tableReference [[catalog.]schema.]table reference
@param fileName File path to read
@param progress
@param csvOptions the CSV options ie "charset=UTF-8 fieldSeparator=| fieldDelimiter=,"
@throws SQLExcept... | [
"Export",
"a",
"table",
"or",
"a",
"query",
"to",
"a",
"CSV",
"file"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/csv/CSVDriverFunction.java#L94-L128 |
107,826 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/ST_Delaunay.java | ST_Delaunay.createDT | public static GeometryCollection createDT(Geometry geometry, int flag) throws SQLException {
if (geometry != null) {
DelaunayTriangulationBuilder triangulationBuilder = new DelaunayTriangulationBuilder();
triangulationBuilder.setSites(geometry);
if(flag == 0) {
... | java | public static GeometryCollection createDT(Geometry geometry, int flag) throws SQLException {
if (geometry != null) {
DelaunayTriangulationBuilder triangulationBuilder = new DelaunayTriangulationBuilder();
triangulationBuilder.setSites(geometry);
if(flag == 0) {
... | [
"public",
"static",
"GeometryCollection",
"createDT",
"(",
"Geometry",
"geometry",
",",
"int",
"flag",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"geometry",
"!=",
"null",
")",
"{",
"DelaunayTriangulationBuilder",
"triangulationBuilder",
"=",
"new",
"DelaunayTri... | Build a delaunay triangulation based on all coordinates of the geometry
@param geometry
@param flag for flag=0 (default flag) or a MULTILINESTRING for flag=1
@return a set of polygons (triangles)
@throws SQLException | [
"Build",
"a",
"delaunay",
"triangulation",
"based",
"on",
"all",
"coordinates",
"of",
"the",
"geometry"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/ST_Delaunay.java#L71-L82 |
107,827 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/ST_AsKml.java | ST_AsKml.toKml | public static String toKml(Geometry geometry) throws SQLException {
StringBuilder sb = new StringBuilder();
KMLGeometry.toKMLGeometry(geometry, sb);
return sb.toString();
} | java | public static String toKml(Geometry geometry) throws SQLException {
StringBuilder sb = new StringBuilder();
KMLGeometry.toKMLGeometry(geometry, sb);
return sb.toString();
} | [
"public",
"static",
"String",
"toKml",
"(",
"Geometry",
"geometry",
")",
"throws",
"SQLException",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"KMLGeometry",
".",
"toKMLGeometry",
"(",
"geometry",
",",
"sb",
")",
";",
"return",
"s... | Generate a KML geometry
@param geometry
@return
@throws SQLException | [
"Generate",
"a",
"KML",
"geometry"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/ST_AsKml.java#L57-L61 |
107,828 | orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/ST_AsKml.java | ST_AsKml.toKml | public static String toKml(Geometry geometry, boolean extrude, int altitudeModeEnum) throws SQLException {
StringBuilder sb = new StringBuilder();
if (extrude) {
KMLGeometry.toKMLGeometry(geometry, ExtrudeMode.TRUE, altitudeModeEnum, sb);
} else {
KMLGeometry.toKMLGeometr... | java | public static String toKml(Geometry geometry, boolean extrude, int altitudeModeEnum) throws SQLException {
StringBuilder sb = new StringBuilder();
if (extrude) {
KMLGeometry.toKMLGeometry(geometry, ExtrudeMode.TRUE, altitudeModeEnum, sb);
} else {
KMLGeometry.toKMLGeometr... | [
"public",
"static",
"String",
"toKml",
"(",
"Geometry",
"geometry",
",",
"boolean",
"extrude",
",",
"int",
"altitudeModeEnum",
")",
"throws",
"SQLException",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"extrude",
")",
"... | Generates a KML geometry. Specifies the extrude and altitudeMode.
Available extrude values are true, false or none.
Supported altitude mode :
For KML profil
CLAMPTOGROUND = 1; RELATIVETOGROUND = 2; ABSOLUTE = 4;
For GX profil CLAMPTOSEAFLOOR = 8; RELATIVETOSEAFLOOR = 16;
No altitude : NONE = 0;
@param geometry
@... | [
"Generates",
"a",
"KML",
"geometry",
".",
"Specifies",
"the",
"extrude",
"and",
"altitudeMode",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/ST_AsKml.java#L84-L92 |
107,829 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java | SFSUtilities.getGeometryTypeFromGeometry | public static int getGeometryTypeFromGeometry(Geometry geometry) {
Integer sfsGeomCode = GEOM_TYPE_TO_SFS_CODE.get(geometry.getGeometryType().toLowerCase());
if(sfsGeomCode == null) {
return GeometryTypeCodes.GEOMETRY;
} else {
return sfsGeomCode;
}
} | java | public static int getGeometryTypeFromGeometry(Geometry geometry) {
Integer sfsGeomCode = GEOM_TYPE_TO_SFS_CODE.get(geometry.getGeometryType().toLowerCase());
if(sfsGeomCode == null) {
return GeometryTypeCodes.GEOMETRY;
} else {
return sfsGeomCode;
}
} | [
"public",
"static",
"int",
"getGeometryTypeFromGeometry",
"(",
"Geometry",
"geometry",
")",
"{",
"Integer",
"sfsGeomCode",
"=",
"GEOM_TYPE_TO_SFS_CODE",
".",
"get",
"(",
"geometry",
".",
"getGeometryType",
"(",
")",
".",
"toLowerCase",
"(",
")",
")",
";",
"if",
... | Return the sfs geometry type identifier of the provided Geometry
@param geometry Geometry instance
@return The sfs geometry type identifier | [
"Return",
"the",
"sfs",
"geometry",
"type",
"identifier",
"of",
"the",
"provided",
"Geometry"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java#L79-L86 |
107,830 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java | SFSUtilities.getGeometryType | public static int getGeometryType(Connection connection,TableLocation location, String fieldName)
throws SQLException {
if(fieldName==null || fieldName.isEmpty()) {
List<String> geometryFields = getGeometryFields(connection, location);
if(geometryFields.isEmpty()) {
... | java | public static int getGeometryType(Connection connection,TableLocation location, String fieldName)
throws SQLException {
if(fieldName==null || fieldName.isEmpty()) {
List<String> geometryFields = getGeometryFields(connection, location);
if(geometryFields.isEmpty()) {
... | [
"public",
"static",
"int",
"getGeometryType",
"(",
"Connection",
"connection",
",",
"TableLocation",
"location",
",",
"String",
"fieldName",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"fieldName",
"==",
"null",
"||",
"fieldName",
".",
"isEmpty",
"(",
")",
... | Return the sfs geometry type identifier of the provided field of the provided table.
@param connection Active connection
@param location Catalog, schema and table name
@param fieldName Geometry field name or empty (take the first one)
@return The sfs geometry type identifier
@see GeometryTypeCodes
@throws SQLExcept... | [
"Return",
"the",
"sfs",
"geometry",
"type",
"identifier",
"of",
"the",
"provided",
"field",
"of",
"the",
"provided",
"table",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java#L101-L124 |
107,831 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java | SFSUtilities.getGeometryTypes | public static Map<String, Integer> getGeometryTypes(Connection connection, TableLocation location)
throws SQLException {
Map<String, Integer> map = new HashMap<>();
ResultSet geomResultSet = getGeometryColumnsView(connection,location.getCatalog(),location.getSchema(),
locatio... | java | public static Map<String, Integer> getGeometryTypes(Connection connection, TableLocation location)
throws SQLException {
Map<String, Integer> map = new HashMap<>();
ResultSet geomResultSet = getGeometryColumnsView(connection,location.getCatalog(),location.getSchema(),
locatio... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Integer",
">",
"getGeometryTypes",
"(",
"Connection",
"connection",
",",
"TableLocation",
"location",
")",
"throws",
"SQLException",
"{",
"Map",
"<",
"String",
",",
"Integer",
">",
"map",
"=",
"new",
"HashMap",
... | Returns a map containing the field names as key and the SFS geometry type as value from the given table.
@param connection Active connection
@param location Catalog, schema and table name
@return A map containing the geometric fields names as key and the SFS geometry type as value.
@see GeometryTypeCodes
@throws SQ... | [
"Returns",
"a",
"map",
"containing",
"the",
"field",
"names",
"as",
"key",
"and",
"the",
"SFS",
"geometry",
"type",
"as",
"value",
"from",
"the",
"given",
"table",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java#L138-L155 |
107,832 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java | SFSUtilities.getTableEnvelope | public static Envelope getTableEnvelope(Connection connection, TableLocation location, String geometryField)
throws SQLException {
if(geometryField==null || geometryField.isEmpty()) {
List<String> geometryFields = getGeometryFields(connection, location);
if(geometryFields.isE... | java | public static Envelope getTableEnvelope(Connection connection, TableLocation location, String geometryField)
throws SQLException {
if(geometryField==null || geometryField.isEmpty()) {
List<String> geometryFields = getGeometryFields(connection, location);
if(geometryFields.isE... | [
"public",
"static",
"Envelope",
"getTableEnvelope",
"(",
"Connection",
"connection",
",",
"TableLocation",
"location",
",",
"String",
"geometryField",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"geometryField",
"==",
"null",
"||",
"geometryField",
".",
"isEmpty"... | Merge the bounding box of all geometries inside the provided table.
@param connection Active connection (not closed by this function)
@param location Location of the table
@param geometryField Geometry field or empty string (take the first geometry field)
@return Envelope of the table
@throws SQLException If the tab... | [
"Merge",
"the",
"bounding",
"box",
"of",
"all",
"geometries",
"inside",
"the",
"provided",
"table",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java#L212-L229 |
107,833 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java | SFSUtilities.prepareInformationSchemaStatement | public static PreparedStatement prepareInformationSchemaStatement(Connection connection,String catalog,
String schema, String table,
String informationSchemaTable,
... | java | public static PreparedStatement prepareInformationSchemaStatement(Connection connection,String catalog,
String schema, String table,
String informationSchemaTable,
... | [
"public",
"static",
"PreparedStatement",
"prepareInformationSchemaStatement",
"(",
"Connection",
"connection",
",",
"String",
"catalog",
",",
"String",
"schema",
",",
"String",
"table",
",",
"String",
"informationSchemaTable",
",",
"String",
"endQuery",
",",
"String",
... | For table containing catalog, schema and table name, this function create a prepared statement with a filter
on this combination.
@param connection Active connection
@param catalog Table catalog, may be empty
@param schema Table schema, may be empty
@param table Table name
@param informationSchemaTable Information tab... | [
"For",
"table",
"containing",
"catalog",
"schema",
"and",
"table",
"name",
"this",
"function",
"create",
"a",
"prepared",
"statement",
"with",
"a",
"filter",
"on",
"this",
"combination",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java#L263-L300 |
107,834 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java | SFSUtilities.prepareInformationSchemaStatement | public static PreparedStatement prepareInformationSchemaStatement(Connection connection,String catalog,
String schema, String table,
String informationSchemaTable, String endQuery)... | java | public static PreparedStatement prepareInformationSchemaStatement(Connection connection,String catalog,
String schema, String table,
String informationSchemaTable, String endQuery)... | [
"public",
"static",
"PreparedStatement",
"prepareInformationSchemaStatement",
"(",
"Connection",
"connection",
",",
"String",
"catalog",
",",
"String",
"schema",
",",
"String",
"table",
",",
"String",
"informationSchemaTable",
",",
"String",
"endQuery",
")",
"throws",
... | For table containing catalog, schema and table name, this function create a prepared statement with a filter on
this combination. Use "f_table_catalog","f_table_schema","f_table_name" as field names.
@param connection Active connection
@param catalog Table catalog, may be empty
@param schema Table schema, may be empty... | [
"For",
"table",
"containing",
"catalog",
"schema",
"and",
"table",
"name",
"this",
"function",
"create",
"a",
"prepared",
"statement",
"with",
"a",
"filter",
"on",
"this",
"combination",
".",
"Use",
"f_table_catalog",
"f_table_schema",
"f_table_name",
"as",
"field... | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java#L317-L323 |
107,835 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java | SFSUtilities.getGeometryFields | public static List<String> getGeometryFields(ResultSet resultSet) throws SQLException {
List<String> fieldsName = new LinkedList<>();
ResultSetMetaData meta = resultSet.getMetaData();
int columnCount = meta.getColumnCount();
for (int i = 1; i <= columnCount; i++) {
if (meta.g... | java | public static List<String> getGeometryFields(ResultSet resultSet) throws SQLException {
List<String> fieldsName = new LinkedList<>();
ResultSetMetaData meta = resultSet.getMetaData();
int columnCount = meta.getColumnCount();
for (int i = 1; i <= columnCount; i++) {
if (meta.g... | [
"public",
"static",
"List",
"<",
"String",
">",
"getGeometryFields",
"(",
"ResultSet",
"resultSet",
")",
"throws",
"SQLException",
"{",
"List",
"<",
"String",
">",
"fieldsName",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"ResultSetMetaData",
"meta",
"=",
... | Find geometry fields name of a resultSet.
@param resultSet ResultSet to analyse
@return A list of Geometry fields name
@throws SQLException | [
"Find",
"geometry",
"fields",
"name",
"of",
"a",
"resultSet",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java#L363-L373 |
107,836 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java | SFSUtilities.hasGeometryField | public static boolean hasGeometryField(ResultSet resultSet) throws SQLException {
ResultSetMetaData meta = resultSet.getMetaData();
int columnCount = meta.getColumnCount();
for (int i = 1; i <= columnCount; i++) {
if (meta.getColumnTypeName(i).equalsIgnoreCase("geometry")) {
... | java | public static boolean hasGeometryField(ResultSet resultSet) throws SQLException {
ResultSetMetaData meta = resultSet.getMetaData();
int columnCount = meta.getColumnCount();
for (int i = 1; i <= columnCount; i++) {
if (meta.getColumnTypeName(i).equalsIgnoreCase("geometry")) {
... | [
"public",
"static",
"boolean",
"hasGeometryField",
"(",
"ResultSet",
"resultSet",
")",
"throws",
"SQLException",
"{",
"ResultSetMetaData",
"meta",
"=",
"resultSet",
".",
"getMetaData",
"(",
")",
";",
"int",
"columnCount",
"=",
"meta",
".",
"getColumnCount",
"(",
... | Check if the ResultSet contains a geometry field
@param resultSet ResultSet to analyse
@return True if the ResultSet contains one geometry field
@throws SQLException | [
"Check",
"if",
"the",
"ResultSet",
"contains",
"a",
"geometry",
"field"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java#L427-L436 |
107,837 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java | SFSUtilities.getResultSetEnvelope | public static Envelope getResultSetEnvelope(ResultSet resultSet) throws SQLException {
List<String> geometryFields = getGeometryFields(resultSet);
if (geometryFields.isEmpty()) {
throw new SQLException("This ResultSet doesn't contain any geometry field.");
} else {
return... | java | public static Envelope getResultSetEnvelope(ResultSet resultSet) throws SQLException {
List<String> geometryFields = getGeometryFields(resultSet);
if (geometryFields.isEmpty()) {
throw new SQLException("This ResultSet doesn't contain any geometry field.");
} else {
return... | [
"public",
"static",
"Envelope",
"getResultSetEnvelope",
"(",
"ResultSet",
"resultSet",
")",
"throws",
"SQLException",
"{",
"List",
"<",
"String",
">",
"geometryFields",
"=",
"getGeometryFields",
"(",
"resultSet",
")",
";",
"if",
"(",
"geometryFields",
".",
"isEmpt... | Compute the full extend of a ResultSet using the first geometry field. If
the ResultSet does not contain any geometry field throw an exception
@param resultSet ResultSet to analyse
@return The full envelope of the ResultSet
@throws SQLException | [
"Compute",
"the",
"full",
"extend",
"of",
"a",
"ResultSet",
"using",
"the",
"first",
"geometry",
"field",
".",
"If",
"the",
"ResultSet",
"does",
"not",
"contain",
"any",
"geometry",
"field",
"throw",
"an",
"exception"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java#L448-L455 |
107,838 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java | SFSUtilities.getResultSetEnvelope | public static Envelope getResultSetEnvelope(ResultSet resultSet, String fieldName) throws SQLException {
Envelope aggregatedEnvelope = null;
while (resultSet.next()) {
Geometry geom = (Geometry) resultSet.getObject(fieldName);
if (aggregatedEnvelope != null) {
agg... | java | public static Envelope getResultSetEnvelope(ResultSet resultSet, String fieldName) throws SQLException {
Envelope aggregatedEnvelope = null;
while (resultSet.next()) {
Geometry geom = (Geometry) resultSet.getObject(fieldName);
if (aggregatedEnvelope != null) {
agg... | [
"public",
"static",
"Envelope",
"getResultSetEnvelope",
"(",
"ResultSet",
"resultSet",
",",
"String",
"fieldName",
")",
"throws",
"SQLException",
"{",
"Envelope",
"aggregatedEnvelope",
"=",
"null",
";",
"while",
"(",
"resultSet",
".",
"next",
"(",
")",
")",
"{",... | Compute the full extend of a ResultSet using a specified geometry field.
If the ResultSet does not contain this geometry field throw an exception
@param resultSet ResultSet to analyse
@param fieldName Field to analyse
@return The full extend of the field in the ResultSet
@throws SQLException | [
"Compute",
"the",
"full",
"extend",
"of",
"a",
"ResultSet",
"using",
"a",
"specified",
"geometry",
"field",
".",
"If",
"the",
"ResultSet",
"does",
"not",
"contain",
"this",
"geometry",
"field",
"throw",
"an",
"exception"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java#L468-L479 |
107,839 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java | SFSUtilities.getSRID | public static int getSRID(Connection connection, TableLocation table) throws SQLException {
ResultSet geomResultSet = getGeometryColumnsView(connection, table.getCatalog(), table.getSchema(),
table.getTable());
int srid = 0;
while (geomResultSet.next()) {
srid = geomR... | java | public static int getSRID(Connection connection, TableLocation table) throws SQLException {
ResultSet geomResultSet = getGeometryColumnsView(connection, table.getCatalog(), table.getSchema(),
table.getTable());
int srid = 0;
while (geomResultSet.next()) {
srid = geomR... | [
"public",
"static",
"int",
"getSRID",
"(",
"Connection",
"connection",
",",
"TableLocation",
"table",
")",
"throws",
"SQLException",
"{",
"ResultSet",
"geomResultSet",
"=",
"getGeometryColumnsView",
"(",
"connection",
",",
"table",
".",
"getCatalog",
"(",
")",
","... | Return the SRID of the first geometry column of the input table
@param connection Active connection
@param table Table name
@return The SRID of the first geometry column
@throws SQLException | [
"Return",
"the",
"SRID",
"of",
"the",
"first",
"geometry",
"column",
"of",
"the",
"input",
"table"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java#L491-L501 |
107,840 | orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java | SFSUtilities.addTableSRIDConstraint | public static void addTableSRIDConstraint(Connection connection, TableLocation tableLocation, int srid)
throws SQLException {
//Alter table to set the SRID constraint
if (srid > 0) {
connection.createStatement().execute(String.format("ALTER TABLE %s ADD CHECK ST_SRID(the_geom)=%d... | java | public static void addTableSRIDConstraint(Connection connection, TableLocation tableLocation, int srid)
throws SQLException {
//Alter table to set the SRID constraint
if (srid > 0) {
connection.createStatement().execute(String.format("ALTER TABLE %s ADD CHECK ST_SRID(the_geom)=%d... | [
"public",
"static",
"void",
"addTableSRIDConstraint",
"(",
"Connection",
"connection",
",",
"TableLocation",
"tableLocation",
",",
"int",
"srid",
")",
"throws",
"SQLException",
"{",
"//Alter table to set the SRID constraint",
"if",
"(",
"srid",
">",
"0",
")",
"{",
"... | Alter a table to add a SRID constraint.
The srid must be greater than zero.
@param connection Active connection
@param tableLocation TableLocation of the table to update
@param srid SRID to set
@throws SQLException | [
"Alter",
"a",
"table",
"to",
"add",
"a",
"SRID",
"constraint",
".",
"The",
"srid",
"must",
"be",
"greater",
"than",
"zero",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java#L586-L593 |
107,841 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockInternetGatewayController.java | MockInternetGatewayController.createInternetGateway | public MockInternetGateway createInternetGateway() {
MockInternetGateway ret = new MockInternetGateway();
ret.setInternetGatewayId("InternetGateway-"
+ UUID.randomUUID().toString().substring(0, INTERNETGATEWAY_ID_POSTFIX_LENGTH));
allMockInternetGateways.put(ret.getInternetGate... | java | public MockInternetGateway createInternetGateway() {
MockInternetGateway ret = new MockInternetGateway();
ret.setInternetGatewayId("InternetGateway-"
+ UUID.randomUUID().toString().substring(0, INTERNETGATEWAY_ID_POSTFIX_LENGTH));
allMockInternetGateways.put(ret.getInternetGate... | [
"public",
"MockInternetGateway",
"createInternetGateway",
"(",
")",
"{",
"MockInternetGateway",
"ret",
"=",
"new",
"MockInternetGateway",
"(",
")",
";",
"ret",
".",
"setInternetGatewayId",
"(",
"\"InternetGateway-\"",
"+",
"UUID",
".",
"randomUUID",
"(",
")",
".",
... | Create the mock InternetGateway.
@return mock InternetGateway. | [
"Create",
"the",
"mock",
"InternetGateway",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockInternetGatewayController.java#L81-L89 |
107,842 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockInternetGatewayController.java | MockInternetGatewayController.attachInternetGateway | public MockInternetGateway attachInternetGateway(final String internetgatewayId,
final String vpcId) {
if (internetgatewayId == null) {
return null;
}
MockInternetGateway ret = allMockInternetGateways.get(internetgatewayId);
if (ret != null) {
MockInte... | java | public MockInternetGateway attachInternetGateway(final String internetgatewayId,
final String vpcId) {
if (internetgatewayId == null) {
return null;
}
MockInternetGateway ret = allMockInternetGateways.get(internetgatewayId);
if (ret != null) {
MockInte... | [
"public",
"MockInternetGateway",
"attachInternetGateway",
"(",
"final",
"String",
"internetgatewayId",
",",
"final",
"String",
"vpcId",
")",
"{",
"if",
"(",
"internetgatewayId",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"MockInternetGateway",
"ret",
"=",... | Attach the mock InternetGateway.
@param vpcId vpc Id for InternetGateway.
@param internetgatewayId
internetgatewayId to be deleted
@return mock InternetGateway. | [
"Attach",
"the",
"mock",
"InternetGateway",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockInternetGatewayController.java#L98-L116 |
107,843 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockInternetGatewayController.java | MockInternetGatewayController.deleteInternetGateway | public MockInternetGateway deleteInternetGateway(final String internetgatewayId) {
if (internetgatewayId != null && allMockInternetGateways.containsKey(internetgatewayId)) {
return allMockInternetGateways.remove(internetgatewayId);
}
return null;
} | java | public MockInternetGateway deleteInternetGateway(final String internetgatewayId) {
if (internetgatewayId != null && allMockInternetGateways.containsKey(internetgatewayId)) {
return allMockInternetGateways.remove(internetgatewayId);
}
return null;
} | [
"public",
"MockInternetGateway",
"deleteInternetGateway",
"(",
"final",
"String",
"internetgatewayId",
")",
"{",
"if",
"(",
"internetgatewayId",
"!=",
"null",
"&&",
"allMockInternetGateways",
".",
"containsKey",
"(",
"internetgatewayId",
")",
")",
"{",
"return",
"allM... | Delete InternetGateway.
@param internetgatewayId
internetgatewayId to be deleted
@return Mock InternetGateway. | [
"Delete",
"InternetGateway",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockInternetGatewayController.java#L125-L131 |
107,844 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/model/AbstractMockEc2Instance.java | AbstractMockEc2Instance.getMsFromProperty | private static long getMsFromProperty(final String propertyName,
final String propertyNameInSeconds) {
String property = PropertiesUtils.getProperty(propertyName);
if (property != null) {
return Long.parseLong(property);
}
return Integer.parseInt(PropertiesUtils.g... | java | private static long getMsFromProperty(final String propertyName,
final String propertyNameInSeconds) {
String property = PropertiesUtils.getProperty(propertyName);
if (property != null) {
return Long.parseLong(property);
}
return Integer.parseInt(PropertiesUtils.g... | [
"private",
"static",
"long",
"getMsFromProperty",
"(",
"final",
"String",
"propertyName",
",",
"final",
"String",
"propertyNameInSeconds",
")",
"{",
"String",
"property",
"=",
"PropertiesUtils",
".",
"getProperty",
"(",
"propertyName",
")",
";",
"if",
"(",
"proper... | Get millisecs from properties.
@param propertyName
the property name
@param propertyNameInSeconds
the property name for seconds
@return millisecs | [
"Get",
"millisecs",
"from",
"properties",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/model/AbstractMockEc2Instance.java#L495-L503 |
107,845 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/model/AbstractMockEc2Instance.java | AbstractMockEc2Instance.initializeInternalTimer | public final void initializeInternalTimer() {
// if it is the first the instance is started, we initialize the
// internal timer thread
if (!internalTimerInitialized) {
TimerTask internalTimerTask = new TimerTask() {
/**
* this method is triggered e... | java | public final void initializeInternalTimer() {
// if it is the first the instance is started, we initialize the
// internal timer thread
if (!internalTimerInitialized) {
TimerTask internalTimerTask = new TimerTask() {
/**
* this method is triggered e... | [
"public",
"final",
"void",
"initializeInternalTimer",
"(",
")",
"{",
"// if it is the first the instance is started, we initialize the",
"// internal timer thread",
"if",
"(",
"!",
"internalTimerInitialized",
")",
"{",
"TimerTask",
"internalTimerTask",
"=",
"new",
"TimerTask",
... | Start scheduling the internal timer that controls the behaviors and states of this mock ec2 instance. | [
"Start",
"scheduling",
"the",
"internal",
"timer",
"that",
"controls",
"the",
"behaviors",
"and",
"states",
"of",
"this",
"mock",
"ec2",
"instance",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/model/AbstractMockEc2Instance.java#L639-L723 |
107,846 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/model/AbstractMockEc2Instance.java | AbstractMockEc2Instance.start | public final boolean start() {
if (running || booting || stopping || terminated) {
// do nothing if this instance is not stopped
return false;
} else {
// mark this instance started
booting = true;
running = true;
onStarted();
... | java | public final boolean start() {
if (running || booting || stopping || terminated) {
// do nothing if this instance is not stopped
return false;
} else {
// mark this instance started
booting = true;
running = true;
onStarted();
... | [
"public",
"final",
"boolean",
"start",
"(",
")",
"{",
"if",
"(",
"running",
"||",
"booting",
"||",
"stopping",
"||",
"terminated",
")",
"{",
"// do nothing if this instance is not stopped",
"return",
"false",
";",
"}",
"else",
"{",
"// mark this instance started",
... | Start a stopped mock ec2 instance.
@return true for successfully started and false for nothing changed by this action | [
"Start",
"a",
"stopped",
"mock",
"ec2",
"instance",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/model/AbstractMockEc2Instance.java#L739-L753 |
107,847 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/model/AbstractMockEc2Instance.java | AbstractMockEc2Instance.stop | public final boolean stop() {
if (booting || running) {
stopping = true;
booting = false;
onStopping();
return true;
} else {
return false;
}
} | java | public final boolean stop() {
if (booting || running) {
stopping = true;
booting = false;
onStopping();
return true;
} else {
return false;
}
} | [
"public",
"final",
"boolean",
"stop",
"(",
")",
"{",
"if",
"(",
"booting",
"||",
"running",
")",
"{",
"stopping",
"=",
"true",
";",
"booting",
"=",
"false",
";",
"onStopping",
"(",
")",
";",
"return",
"true",
";",
"}",
"else",
"{",
"return",
"false",... | Stop this ec2 instance.
@return true for successfully turned into 'stopping' and false for nothing changed | [
"Stop",
"this",
"ec2",
"instance",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/model/AbstractMockEc2Instance.java#L760-L771 |
107,848 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/model/AbstractMockEc2Instance.java | AbstractMockEc2Instance.getInstanceState | public final InstanceState getInstanceState() {
return isTerminated() ? InstanceState.TERMINATED
: (isBooting() ? InstanceState.PENDING
: (isStopping() ? InstanceState.STOPPING
: (isRunning() ? InstanceState.RUNNING
... | java | public final InstanceState getInstanceState() {
return isTerminated() ? InstanceState.TERMINATED
: (isBooting() ? InstanceState.PENDING
: (isStopping() ? InstanceState.STOPPING
: (isRunning() ? InstanceState.RUNNING
... | [
"public",
"final",
"InstanceState",
"getInstanceState",
"(",
")",
"{",
"return",
"isTerminated",
"(",
")",
"?",
"InstanceState",
".",
"TERMINATED",
":",
"(",
"isBooting",
"(",
")",
"?",
"InstanceState",
".",
"PENDING",
":",
"(",
"isStopping",
"(",
")",
"?",
... | Get state of this mock ec2 instance.
@return state of this mock ec2 instance, should be one of the instance states defined in {@link InstanceState} | [
"Get",
"state",
"of",
"this",
"mock",
"ec2",
"instance",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/model/AbstractMockEc2Instance.java#L795-L801 |
107,849 | treelogic-swe/aws-mock | example/java/simple/DescribeInstancesExample.java | DescribeInstancesExample.describeAllInstances | public static List<Instance> describeAllInstances() {
// pass any credentials as aws-mock does not authenticate them at all
AWSCredentials credentials = new BasicAWSCredentials("foo", "bar");
AmazonEC2Client amazonEC2Client = new AmazonEC2Client(credentials);
// the mock endpoint for ec... | java | public static List<Instance> describeAllInstances() {
// pass any credentials as aws-mock does not authenticate them at all
AWSCredentials credentials = new BasicAWSCredentials("foo", "bar");
AmazonEC2Client amazonEC2Client = new AmazonEC2Client(credentials);
// the mock endpoint for ec... | [
"public",
"static",
"List",
"<",
"Instance",
">",
"describeAllInstances",
"(",
")",
"{",
"// pass any credentials as aws-mock does not authenticate them at all",
"AWSCredentials",
"credentials",
"=",
"new",
"BasicAWSCredentials",
"(",
"\"foo\"",
",",
"\"bar\"",
")",
";",
... | Describe all mock instances within aws-mock.
@return a list of all instances | [
"Describe",
"all",
"mock",
"instances",
"within",
"aws",
"-",
"mock",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/example/java/simple/DescribeInstancesExample.java#L34-L60 |
107,850 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockSubnetController.java | MockSubnetController.createSubnet | public MockSubnet createSubnet(
final String cidrBlock, final String vpcId) {
MockSubnet ret = new MockSubnet();
ret.setCidrBlock(cidrBlock);
ret.setSubnetId(
"subnet-" + UUID.randomUUID().toString().substring(0, SUBNET_ID_POSTFIX_LENGTH));
ret.setVpcId(vpcI... | java | public MockSubnet createSubnet(
final String cidrBlock, final String vpcId) {
MockSubnet ret = new MockSubnet();
ret.setCidrBlock(cidrBlock);
ret.setSubnetId(
"subnet-" + UUID.randomUUID().toString().substring(0, SUBNET_ID_POSTFIX_LENGTH));
ret.setVpcId(vpcI... | [
"public",
"MockSubnet",
"createSubnet",
"(",
"final",
"String",
"cidrBlock",
",",
"final",
"String",
"vpcId",
")",
"{",
"MockSubnet",
"ret",
"=",
"new",
"MockSubnet",
"(",
")",
";",
"ret",
".",
"setCidrBlock",
"(",
"cidrBlock",
")",
";",
"ret",
".",
"setSu... | Create the mock Subnet.
@param cidrBlock VPC cidr block.
@param vpcId vpc Id for subnet.
@return mock Subnet. | [
"Create",
"the",
"mock",
"Subnet",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockSubnetController.java#L80-L92 |
107,851 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockSubnetController.java | MockSubnetController.deleteSubnet | public MockSubnet deleteSubnet(final String subnetId) {
if (subnetId != null && allMockSubnets.containsKey(subnetId)) {
return allMockSubnets.remove(subnetId);
}
return null;
} | java | public MockSubnet deleteSubnet(final String subnetId) {
if (subnetId != null && allMockSubnets.containsKey(subnetId)) {
return allMockSubnets.remove(subnetId);
}
return null;
} | [
"public",
"MockSubnet",
"deleteSubnet",
"(",
"final",
"String",
"subnetId",
")",
"{",
"if",
"(",
"subnetId",
"!=",
"null",
"&&",
"allMockSubnets",
".",
"containsKey",
"(",
"subnetId",
")",
")",
"{",
"return",
"allMockSubnets",
".",
"remove",
"(",
"subnetId",
... | Delete Subnet.
@param subnetId
subnetId to be deleted
@return Mock Subnet. | [
"Delete",
"Subnet",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockSubnetController.java#L101-L108 |
107,852 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.parseInstanceStates | private Set<String> parseInstanceStates(final Map<String, String[]> queryParams) {
Set<String> instanceStates = new TreeSet<String>();
for (String queryKey : queryParams.keySet()) {
// e.g. Filter.1.Value.1: running, Filter.1.Value.2: pending
if (queryKey.startsWith("Filter.1.Va... | java | private Set<String> parseInstanceStates(final Map<String, String[]> queryParams) {
Set<String> instanceStates = new TreeSet<String>();
for (String queryKey : queryParams.keySet()) {
// e.g. Filter.1.Value.1: running, Filter.1.Value.2: pending
if (queryKey.startsWith("Filter.1.Va... | [
"private",
"Set",
"<",
"String",
">",
"parseInstanceStates",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"queryParams",
")",
"{",
"Set",
"<",
"String",
">",
"instanceStates",
"=",
"new",
"TreeSet",
"<",
"String",
">",
"(",
")",
";... | Parse instance states from query parameters.
@param queryParams
map of query parameters in http request
@return a set of instance states in the parameter map | [
"Parse",
"instance",
"states",
"from",
"query",
"parameters",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L944-L956 |
107,853 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.describeAvailabilityZones | private DescribeAvailabilityZonesResponseType describeAvailabilityZones() {
DescribeAvailabilityZonesResponseType ret = new DescribeAvailabilityZonesResponseType();
ret.setRequestId(UUID.randomUUID().toString());
AvailabilityZoneSetType info = new AvailabilityZoneSetType();
Availabilit... | java | private DescribeAvailabilityZonesResponseType describeAvailabilityZones() {
DescribeAvailabilityZonesResponseType ret = new DescribeAvailabilityZonesResponseType();
ret.setRequestId(UUID.randomUUID().toString());
AvailabilityZoneSetType info = new AvailabilityZoneSetType();
Availabilit... | [
"private",
"DescribeAvailabilityZonesResponseType",
"describeAvailabilityZones",
"(",
")",
"{",
"DescribeAvailabilityZonesResponseType",
"ret",
"=",
"new",
"DescribeAvailabilityZonesResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
".",
"randomUUID",
"(... | Handles "describeAvailabilityZones" request, as simple as without any filters to use.
@return a DescribeAvailabilityZonesResponseType with our predefined AMIs
in aws-mock.properties (or if not overridden, as defined in aws-mock-default.properties) | [
"Handles",
"describeAvailabilityZones",
"request",
"as",
"simple",
"as",
"without",
"any",
"filters",
"to",
"use",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L964-L976 |
107,854 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.parseInstanceIDs | private Set<String> parseInstanceIDs(final Map<String, String[]> queryParams) {
Set<String> ret = new TreeSet<String>();
Set<Map.Entry<String, String[]>> entries = queryParams.entrySet();
for (Map.Entry<String, String[]> entry : entries) {
if (null != entry && null != entry.getKey()... | java | private Set<String> parseInstanceIDs(final Map<String, String[]> queryParams) {
Set<String> ret = new TreeSet<String>();
Set<Map.Entry<String, String[]>> entries = queryParams.entrySet();
for (Map.Entry<String, String[]> entry : entries) {
if (null != entry && null != entry.getKey()... | [
"private",
"Set",
"<",
"String",
">",
"parseInstanceIDs",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"queryParams",
")",
"{",
"Set",
"<",
"String",
">",
"ret",
"=",
"new",
"TreeSet",
"<",
"String",
">",
"(",
")",
";",
"Set",
... | Parse instance IDs from query parameters.
@param queryParams
map of query parameters in http request
@return a set of instance IDs in the parameter map | [
"Parse",
"instance",
"IDs",
"from",
"query",
"parameters",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L985-L998 |
107,855 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.generateToken | protected String generateToken() {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < TOKEN_MIDDLE_LEN; i++) {
sb.append(TOKEN_DICT.charAt(random.nextInt(TOKEN_DICT.length())));
}
return TOKEN_PREFIX + sb.toString() + TOKEN_SUFFIX;
} | java | protected String generateToken() {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < TOKEN_MIDDLE_LEN; i++) {
sb.append(TOKEN_DICT.charAt(random.nextInt(TOKEN_DICT.length())));
}
return TOKEN_PREFIX + sb.toString() + TOKEN_SUFFIX;
} | [
"protected",
"String",
"generateToken",
"(",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"TOKEN_MIDDLE_LEN",
";",
"i",
"++",
")",
"{",
"sb",
".",
"append",
"(",
"TOKEN_... | Generate a new token used in describeInstanceResponse while paging enabled.
@return a random string as a token | [
"Generate",
"a",
"new",
"token",
"used",
"in",
"describeInstanceResponse",
"while",
"paging",
"enabled",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1174-L1180 |
107,856 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.runInstances | private RunInstancesResponseType runInstances(final String imageId, final String instanceType,
final int minCount, final int maxCount) {
RunInstancesResponseType ret = new RunInstancesResponseType();
RunningInstancesSetType instSet = new RunningInstancesSetType();
Class<? extends ... | java | private RunInstancesResponseType runInstances(final String imageId, final String instanceType,
final int minCount, final int maxCount) {
RunInstancesResponseType ret = new RunInstancesResponseType();
RunningInstancesSetType instSet = new RunningInstancesSetType();
Class<? extends ... | [
"private",
"RunInstancesResponseType",
"runInstances",
"(",
"final",
"String",
"imageId",
",",
"final",
"String",
"instanceType",
",",
"final",
"int",
"minCount",
",",
"final",
"int",
"maxCount",
")",
"{",
"RunInstancesResponseType",
"ret",
"=",
"new",
"RunInstances... | Handles "runInstances" request, with only simplified filters of imageId, instanceType, minCount and maxCount.
@param imageId
AMI of new mock ec2 instance(s)
@param instanceType
type(scale) of new mock ec2 instance(s), refer to {@link AbstractMockEc2Instance#instanceType}
@param minCount
max count of instances to run
@... | [
"Handles",
"runInstances",
"request",
"with",
"only",
"simplified",
"filters",
"of",
"imageId",
"instanceType",
"minCount",
"and",
"maxCount",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1195-L1245 |
107,857 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.startInstances | private StartInstancesResponseType startInstances(final Set<String> instanceIDs) {
StartInstancesResponseType ret = new StartInstancesResponseType();
ret.setRequestId(UUID.randomUUID().toString());
InstanceStateChangeSetType changeSet = new InstanceStateChangeSetType();
changeSet.getItem... | java | private StartInstancesResponseType startInstances(final Set<String> instanceIDs) {
StartInstancesResponseType ret = new StartInstancesResponseType();
ret.setRequestId(UUID.randomUUID().toString());
InstanceStateChangeSetType changeSet = new InstanceStateChangeSetType();
changeSet.getItem... | [
"private",
"StartInstancesResponseType",
"startInstances",
"(",
"final",
"Set",
"<",
"String",
">",
"instanceIDs",
")",
"{",
"StartInstancesResponseType",
"ret",
"=",
"new",
"StartInstancesResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
".",
... | Handles "startInstances" request, with only a simplified filter of instanceIDs.
@param instanceIDs
a filter of specified instance IDs for the target instance to start
@return a StartInstancesResponse with information for all mock ec2 instances to start | [
"Handles",
"startInstances",
"request",
"with",
"only",
"a",
"simplified",
"filter",
"of",
"instanceIDs",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1254-L1262 |
107,858 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.stopInstances | private StopInstancesResponseType stopInstances(final Set<String> instanceIDs) {
StopInstancesResponseType ret = new StopInstancesResponseType();
ret.setRequestId(UUID.randomUUID().toString());
InstanceStateChangeSetType changeSet = new InstanceStateChangeSetType();
changeSet.getItem().a... | java | private StopInstancesResponseType stopInstances(final Set<String> instanceIDs) {
StopInstancesResponseType ret = new StopInstancesResponseType();
ret.setRequestId(UUID.randomUUID().toString());
InstanceStateChangeSetType changeSet = new InstanceStateChangeSetType();
changeSet.getItem().a... | [
"private",
"StopInstancesResponseType",
"stopInstances",
"(",
"final",
"Set",
"<",
"String",
">",
"instanceIDs",
")",
"{",
"StopInstancesResponseType",
"ret",
"=",
"new",
"StopInstancesResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
".",
"ra... | Handles "stopInstances" request, with only a simplified filter of instanceIDs.
@param instanceIDs
a filter of specified instance IDs for the target instance to stop
@return a StopInstancesResponse with information for all mock ec2 instances to stop | [
"Handles",
"stopInstances",
"request",
"with",
"only",
"a",
"simplified",
"filter",
"of",
"instanceIDs",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1271-L1278 |
107,859 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.terminateInstances | private TerminateInstancesResponseType terminateInstances(final Set<String> instanceIDs) {
TerminateInstancesResponseType ret = new TerminateInstancesResponseType();
ret.setRequestId(UUID.randomUUID().toString());
InstanceStateChangeSetType changeSet = new InstanceStateChangeSetType();
c... | java | private TerminateInstancesResponseType terminateInstances(final Set<String> instanceIDs) {
TerminateInstancesResponseType ret = new TerminateInstancesResponseType();
ret.setRequestId(UUID.randomUUID().toString());
InstanceStateChangeSetType changeSet = new InstanceStateChangeSetType();
c... | [
"private",
"TerminateInstancesResponseType",
"terminateInstances",
"(",
"final",
"Set",
"<",
"String",
">",
"instanceIDs",
")",
"{",
"TerminateInstancesResponseType",
"ret",
"=",
"new",
"TerminateInstancesResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
... | Handles "terminateInstances" request, with only a simplified filter of instanceIDs.
@param instanceIDs
a filter of specified instance IDs for the target instance to terminate
@return a StartInstancesResponse with information for all mock ec2 instances to terminate | [
"Handles",
"terminateInstances",
"request",
"with",
"only",
"a",
"simplified",
"filter",
"of",
"instanceIDs",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1287-L1294 |
107,860 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.describeImages | private DescribeImagesResponseType describeImages(final Set<String> imageId) {
DescribeImagesResponseType ret = new DescribeImagesResponseType();
ret.setRequestId(UUID.randomUUID().toString());
DescribeImagesResponseInfoType info = new DescribeImagesResponseInfoType();
for (String ami : ... | java | private DescribeImagesResponseType describeImages(final Set<String> imageId) {
DescribeImagesResponseType ret = new DescribeImagesResponseType();
ret.setRequestId(UUID.randomUUID().toString());
DescribeImagesResponseInfoType info = new DescribeImagesResponseInfoType();
for (String ami : ... | [
"private",
"DescribeImagesResponseType",
"describeImages",
"(",
"final",
"Set",
"<",
"String",
">",
"imageId",
")",
"{",
"DescribeImagesResponseType",
"ret",
"=",
"new",
"DescribeImagesResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
".",
"ra... | Handles "describeImages" request, as simple as without any filters to use.
@param imageId : Set of imgaesId.
@return a DescribeImagesResponse with our predefined AMIs in aws-mock.properties (or if not overridden, as
defined in aws-mock-default.properties) | [
"Handles",
"describeImages",
"request",
"as",
"simple",
"as",
"without",
"any",
"filters",
"to",
"use",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1302-L1364 |
107,861 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.describeRouteTables | private DescribeRouteTablesResponseType describeRouteTables() {
DescribeRouteTablesResponseType ret = new DescribeRouteTablesResponseType();
ret.setRequestId(UUID.randomUUID().toString());
RouteTableSetType routeTableSet = new RouteTableSetType();
for (Iterator<MockRouteTable> mockRoute... | java | private DescribeRouteTablesResponseType describeRouteTables() {
DescribeRouteTablesResponseType ret = new DescribeRouteTablesResponseType();
ret.setRequestId(UUID.randomUUID().toString());
RouteTableSetType routeTableSet = new RouteTableSetType();
for (Iterator<MockRouteTable> mockRoute... | [
"private",
"DescribeRouteTablesResponseType",
"describeRouteTables",
"(",
")",
"{",
"DescribeRouteTablesResponseType",
"ret",
"=",
"new",
"DescribeRouteTablesResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
".",
"randomUUID",
"(",
")",
".",
"toSt... | Handles "describeRouteTables" request and returns response with a route table.
@return a DescribeRouteTablesResponseType with our predefined route table in aws-mock.properties (or if not
overridden, as defined in aws-mock-default.properties) | [
"Handles",
"describeRouteTables",
"request",
"and",
"returns",
"response",
"with",
"a",
"route",
"table",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1372-L1402 |
107,862 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.createRouteTable | private CreateRouteTableResponseType createRouteTable(final String vpcId,
final String cidrBlock) {
CreateRouteTableResponseType ret = new CreateRouteTableResponseType();
ret.setRequestId(UUID.randomUUID().toString());
MockRouteTable mockRouteTable = mockRouteTableController.createRo... | java | private CreateRouteTableResponseType createRouteTable(final String vpcId,
final String cidrBlock) {
CreateRouteTableResponseType ret = new CreateRouteTableResponseType();
ret.setRequestId(UUID.randomUUID().toString());
MockRouteTable mockRouteTable = mockRouteTableController.createRo... | [
"private",
"CreateRouteTableResponseType",
"createRouteTable",
"(",
"final",
"String",
"vpcId",
",",
"final",
"String",
"cidrBlock",
")",
"{",
"CreateRouteTableResponseType",
"ret",
"=",
"new",
"CreateRouteTableResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
... | Handles "createRouteTable" request to create routetable and returns response with a route table.
@param vpcId vpc Id for Route Table.
@param cidrBlock VPC cidr block.
@return a CreateRouteTableResponseType with our new route table in (or if not
overridden, as defined in aws-mock-default.properties) | [
"Handles",
"createRouteTable",
"request",
"to",
"create",
"routetable",
"and",
"returns",
"response",
"with",
"a",
"route",
"table",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1411-L1423 |
107,863 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.createRoute | private CreateRouteResponseType createRoute(final String destinationCidrBlock,
final String internetGatewayId, final String routeTableId) {
CreateRouteResponseType ret = new CreateRouteResponseType();
ret.setRequestId(UUID.randomUUID().toString());
mockRouteTableController.createRout... | java | private CreateRouteResponseType createRoute(final String destinationCidrBlock,
final String internetGatewayId, final String routeTableId) {
CreateRouteResponseType ret = new CreateRouteResponseType();
ret.setRequestId(UUID.randomUUID().toString());
mockRouteTableController.createRout... | [
"private",
"CreateRouteResponseType",
"createRoute",
"(",
"final",
"String",
"destinationCidrBlock",
",",
"final",
"String",
"internetGatewayId",
",",
"final",
"String",
"routeTableId",
")",
"{",
"CreateRouteResponseType",
"ret",
"=",
"new",
"CreateRouteResponseType",
"("... | Handles "createRoute" request to create route and returns response with a route table.
@param destinationCidrBlock : Route destinationCidrBlock.
@param internetGatewayId : for gateway Id.
@param routeTableId : for Route.
@return a CreateRouteResponseType with our new route. | [
"Handles",
"createRoute",
"request",
"to",
"create",
"route",
"and",
"returns",
"response",
"with",
"a",
"route",
"table",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1432-L1439 |
107,864 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.createVolume | private CreateVolumeResponseType createVolume(final String volumeType, final String size,
final String availabilityZone,
final int iops, final String snapshotId) {
CreateVolumeResponseType ret = new CreateVolumeResponseType();
ret.setRequestId(UUID.randomUUID().toString());
... | java | private CreateVolumeResponseType createVolume(final String volumeType, final String size,
final String availabilityZone,
final int iops, final String snapshotId) {
CreateVolumeResponseType ret = new CreateVolumeResponseType();
ret.setRequestId(UUID.randomUUID().toString());
... | [
"private",
"CreateVolumeResponseType",
"createVolume",
"(",
"final",
"String",
"volumeType",
",",
"final",
"String",
"size",
",",
"final",
"String",
"availabilityZone",
",",
"final",
"int",
"iops",
",",
"final",
"String",
"snapshotId",
")",
"{",
"CreateVolumeRespons... | Handles "createVolume" request to create volume and returns response with a volume.
@param volumeType of Volume.
@param size : Volume size.
@param availabilityZone : Volume availability zone.
@param iops : Volume iops count
@param snapshotId : Volume's SnapshotId.
@return a CreateRouteTableResponseType with our new rou... | [
"Handles",
"createVolume",
"request",
"to",
"create",
"volume",
"and",
"returns",
"response",
"with",
"a",
"volume",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1451-L1466 |
107,865 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.createSubnet | private CreateSubnetResponseType createSubnet(final String vpcId, final String cidrBlock) {
CreateSubnetResponseType ret = new CreateSubnetResponseType();
ret.setRequestId(UUID.randomUUID().toString());
MockSubnet mockSubnet = mockSubnetController.createSubnet(cidrBlock, vpcId);
SubnetT... | java | private CreateSubnetResponseType createSubnet(final String vpcId, final String cidrBlock) {
CreateSubnetResponseType ret = new CreateSubnetResponseType();
ret.setRequestId(UUID.randomUUID().toString());
MockSubnet mockSubnet = mockSubnetController.createSubnet(cidrBlock, vpcId);
SubnetT... | [
"private",
"CreateSubnetResponseType",
"createSubnet",
"(",
"final",
"String",
"vpcId",
",",
"final",
"String",
"cidrBlock",
")",
"{",
"CreateSubnetResponseType",
"ret",
"=",
"new",
"CreateSubnetResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
... | Handles "createSubnet" request to create Subnet and returns response with a subnet.
@param vpcId vpc Id for subnet.
@param cidrBlock VPC cidr block.
@return a CreateSubnetResponseType with our new Subnet | [
"Handles",
"createSubnet",
"request",
"to",
"create",
"Subnet",
"and",
"returns",
"response",
"with",
"a",
"subnet",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1474-L1485 |
107,866 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.createSecurityGroup | private CreateSecurityGroupResponseType createSecurityGroup(final String groupName,
final String groupDescription, final String vpcId) {
CreateSecurityGroupResponseType ret = new CreateSecurityGroupResponseType();
ret.setRequestId(UUID.randomUUID().toString());
MockSecurityGroup mockSecu... | java | private CreateSecurityGroupResponseType createSecurityGroup(final String groupName,
final String groupDescription, final String vpcId) {
CreateSecurityGroupResponseType ret = new CreateSecurityGroupResponseType();
ret.setRequestId(UUID.randomUUID().toString());
MockSecurityGroup mockSecu... | [
"private",
"CreateSecurityGroupResponseType",
"createSecurityGroup",
"(",
"final",
"String",
"groupName",
",",
"final",
"String",
"groupDescription",
",",
"final",
"String",
"vpcId",
")",
"{",
"CreateSecurityGroupResponseType",
"ret",
"=",
"new",
"CreateSecurityGroupRespons... | Handles "createSecurityGroup" request to create SecurityGroup and returns response with a SecurityGroup.
@param vpcId vpc Id for SecurityGroup.
@param groupName group Name.
@param groupDescription group Desc.
@return a CreateSecurityGroupResponseType with our new SecurityGroup | [
"Handles",
"createSecurityGroup",
"request",
"to",
"create",
"SecurityGroup",
"and",
"returns",
"response",
"with",
"a",
"SecurityGroup",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1494-L1502 |
107,867 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.authorizeSecurityGroupIngress | private AuthorizeSecurityGroupIngressResponseType authorizeSecurityGroupIngress(final String groupId,
final String ipProtocol, final Integer fromPort, final Integer toPort, final String cidrIp) {
AuthorizeSecurityGroupIngressResponseType ret = new AuthorizeSecurityGroupIngressResponseType();
... | java | private AuthorizeSecurityGroupIngressResponseType authorizeSecurityGroupIngress(final String groupId,
final String ipProtocol, final Integer fromPort, final Integer toPort, final String cidrIp) {
AuthorizeSecurityGroupIngressResponseType ret = new AuthorizeSecurityGroupIngressResponseType();
... | [
"private",
"AuthorizeSecurityGroupIngressResponseType",
"authorizeSecurityGroupIngress",
"(",
"final",
"String",
"groupId",
",",
"final",
"String",
"ipProtocol",
",",
"final",
"Integer",
"fromPort",
",",
"final",
"Integer",
"toPort",
",",
"final",
"String",
"cidrIp",
")... | Handles "authorizeSecurityGroupIngress" request to SecurityGroup and returns response with a SecurityGroup.
@param groupId group Id for SecurityGroup.
@param ipProtocol Ip protocol Name.
@param fromPort from port ranges.
@param toPort to port ranges.
@param cidrIp cidr Ip for Permission
@return a AuthorizeSecurityGrou... | [
"Handles",
"authorizeSecurityGroupIngress",
"request",
"to",
"SecurityGroup",
"and",
"returns",
"response",
"with",
"a",
"SecurityGroup",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1513-L1519 |
107,868 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.authorizeSecurityGroupEgress | private AuthorizeSecurityGroupEgressResponseType authorizeSecurityGroupEgress(final String groupId,
final String ipProtocol, final Integer fromPort, final Integer toPort, final String cidrIp) {
AuthorizeSecurityGroupEgressResponseType ret = new AuthorizeSecurityGroupEgressResponseType();
ret.se... | java | private AuthorizeSecurityGroupEgressResponseType authorizeSecurityGroupEgress(final String groupId,
final String ipProtocol, final Integer fromPort, final Integer toPort, final String cidrIp) {
AuthorizeSecurityGroupEgressResponseType ret = new AuthorizeSecurityGroupEgressResponseType();
ret.se... | [
"private",
"AuthorizeSecurityGroupEgressResponseType",
"authorizeSecurityGroupEgress",
"(",
"final",
"String",
"groupId",
",",
"final",
"String",
"ipProtocol",
",",
"final",
"Integer",
"fromPort",
",",
"final",
"Integer",
"toPort",
",",
"final",
"String",
"cidrIp",
")",... | Handles "authorizeSecurityGroupEgress" request to SecurityGroup and returns response with a SecurityGroup.
@param groupId group Id for SecurityGroup.
@param ipProtocol Ip protocol Name.
@param fromPort from port ranges.
@param toPort to port ranges.
@param cidrIp cidr Ip for Permission
@return a AuthorizeSecurityGroup... | [
"Handles",
"authorizeSecurityGroupEgress",
"request",
"to",
"SecurityGroup",
"and",
"returns",
"response",
"with",
"a",
"SecurityGroup",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1530-L1536 |
107,869 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.createInternetGateway | private CreateInternetGatewayResponseType createInternetGateway() {
CreateInternetGatewayResponseType ret = new CreateInternetGatewayResponseType();
ret.setRequestId(UUID.randomUUID().toString());
MockInternetGateway mockInternetGateway = mockInternetGatewayController
.createInte... | java | private CreateInternetGatewayResponseType createInternetGateway() {
CreateInternetGatewayResponseType ret = new CreateInternetGatewayResponseType();
ret.setRequestId(UUID.randomUUID().toString());
MockInternetGateway mockInternetGateway = mockInternetGatewayController
.createInte... | [
"private",
"CreateInternetGatewayResponseType",
"createInternetGateway",
"(",
")",
"{",
"CreateInternetGatewayResponseType",
"ret",
"=",
"new",
"CreateInternetGatewayResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
".",
"randomUUID",
"(",
")",
".",... | Handles "createInternetGateway" request to create InternetGateway and returns response with a InternetGateway.
@return a CreateInternetGatewayResponseType with our new InternetGateway | [
"Handles",
"createInternetGateway",
"request",
"to",
"create",
"InternetGateway",
"and",
"returns",
"response",
"with",
"a",
"InternetGateway",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1542-L1551 |
107,870 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.deleteRouteTable | private DeleteRouteTableResponseType deleteRouteTable(final String routeTableId) {
DeleteRouteTableResponseType ret = new DeleteRouteTableResponseType();
ret.setRequestId(UUID.randomUUID().toString());
mockRouteTableController.deleteRouteTable(routeTableId);
return ret;
} | java | private DeleteRouteTableResponseType deleteRouteTable(final String routeTableId) {
DeleteRouteTableResponseType ret = new DeleteRouteTableResponseType();
ret.setRequestId(UUID.randomUUID().toString());
mockRouteTableController.deleteRouteTable(routeTableId);
return ret;
} | [
"private",
"DeleteRouteTableResponseType",
"deleteRouteTable",
"(",
"final",
"String",
"routeTableId",
")",
"{",
"DeleteRouteTableResponseType",
"ret",
"=",
"new",
"DeleteRouteTableResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
".",
"randomUUID",... | Handles "deleteRouteTable" request to delete routetable and returns response with a route table.
@param routeTableId Route table Id.
@return a CreateRouteTableResponseType with route table | [
"Handles",
"deleteRouteTable",
"request",
"to",
"delete",
"routetable",
"and",
"returns",
"response",
"with",
"a",
"route",
"table",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1558-L1563 |
107,871 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.deleteSubnet | private DeleteSubnetResponseType deleteSubnet(final String subnetId) {
DeleteSubnetResponseType ret = new DeleteSubnetResponseType();
ret.setRequestId(UUID.randomUUID().toString());
mockSubnetController.deleteSubnet(subnetId);
return ret;
} | java | private DeleteSubnetResponseType deleteSubnet(final String subnetId) {
DeleteSubnetResponseType ret = new DeleteSubnetResponseType();
ret.setRequestId(UUID.randomUUID().toString());
mockSubnetController.deleteSubnet(subnetId);
return ret;
} | [
"private",
"DeleteSubnetResponseType",
"deleteSubnet",
"(",
"final",
"String",
"subnetId",
")",
"{",
"DeleteSubnetResponseType",
"ret",
"=",
"new",
"DeleteSubnetResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
".",
"randomUUID",
"(",
")",
"."... | Handles "deleteSubnet" request to delete subnet and returns response with a subnet.
@param subnetId Subnet Id.
@return a DeleteSubnetResponseType with subnet. | [
"Handles",
"deleteSubnet",
"request",
"to",
"delete",
"subnet",
"and",
"returns",
"response",
"with",
"a",
"subnet",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1570-L1575 |
107,872 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.deleteSecurityGroup | private DeleteSecurityGroupResponseType deleteSecurityGroup(final String securityGroupId) {
DeleteSecurityGroupResponseType ret = new DeleteSecurityGroupResponseType();
ret.setRequestId(UUID.randomUUID().toString());
mockSecurityGroupController.deleteSecurityGroup(securityGroupId);
retur... | java | private DeleteSecurityGroupResponseType deleteSecurityGroup(final String securityGroupId) {
DeleteSecurityGroupResponseType ret = new DeleteSecurityGroupResponseType();
ret.setRequestId(UUID.randomUUID().toString());
mockSecurityGroupController.deleteSecurityGroup(securityGroupId);
retur... | [
"private",
"DeleteSecurityGroupResponseType",
"deleteSecurityGroup",
"(",
"final",
"String",
"securityGroupId",
")",
"{",
"DeleteSecurityGroupResponseType",
"ret",
"=",
"new",
"DeleteSecurityGroupResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
".",
... | Handles "deleteSecurityGroup" request to delete SecurityGroup and returns response with a SecurityGroup.
@param securityGroupId SecurityGroup Id.
@return a DeleteSecurityGroupResponseType with SecurityGroup. | [
"Handles",
"deleteSecurityGroup",
"request",
"to",
"delete",
"SecurityGroup",
"and",
"returns",
"response",
"with",
"a",
"SecurityGroup",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1582-L1587 |
107,873 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.deleteVolume | private DeleteVolumeResponseType deleteVolume(final String volumeId) {
DeleteVolumeResponseType ret = new DeleteVolumeResponseType();
ret.setRequestId(UUID.randomUUID().toString());
mockVolumeController.deleteVolume(volumeId);
return ret;
} | java | private DeleteVolumeResponseType deleteVolume(final String volumeId) {
DeleteVolumeResponseType ret = new DeleteVolumeResponseType();
ret.setRequestId(UUID.randomUUID().toString());
mockVolumeController.deleteVolume(volumeId);
return ret;
} | [
"private",
"DeleteVolumeResponseType",
"deleteVolume",
"(",
"final",
"String",
"volumeId",
")",
"{",
"DeleteVolumeResponseType",
"ret",
"=",
"new",
"DeleteVolumeResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
".",
"randomUUID",
"(",
")",
"."... | Handles "deleteVolume" request to delete volume and returns response with a volume.
@param volumeId Volume Id.
@return a DeleteVolumeResponseType with volume. | [
"Handles",
"deleteVolume",
"request",
"to",
"delete",
"volume",
"and",
"returns",
"response",
"with",
"a",
"volume",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1594-L1599 |
107,874 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.isVolumeIdExists | private boolean isVolumeIdExists(final List<String> volumeIds, final String volumeId) {
if (volumeIds != null && volumeIds.size() > 0) {
for (String volId : volumeIds) {
if (volId.equals(volumeId)) {
return true;
}
}
}
... | java | private boolean isVolumeIdExists(final List<String> volumeIds, final String volumeId) {
if (volumeIds != null && volumeIds.size() > 0) {
for (String volId : volumeIds) {
if (volId.equals(volumeId)) {
return true;
}
}
}
... | [
"private",
"boolean",
"isVolumeIdExists",
"(",
"final",
"List",
"<",
"String",
">",
"volumeIds",
",",
"final",
"String",
"volumeId",
")",
"{",
"if",
"(",
"volumeIds",
"!=",
"null",
"&&",
"volumeIds",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"for",
"(... | Check whether volumeId exists in list.
@param volumeIds List of volume Ids.
@param volumeId to check in the list.
@return true if volumeId is valid. | [
"Check",
"whether",
"volumeId",
"exists",
"in",
"list",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1730-L1740 |
107,875 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.describeSubnets | private DescribeSubnetsResponseType describeSubnets() {
DescribeSubnetsResponseType ret = new DescribeSubnetsResponseType();
ret.setRequestId(UUID.randomUUID().toString());
SubnetSetType subnetSetType = new SubnetSetType();
for (Iterator<MockSubnet> mockSubnet = mockSubnetController.des... | java | private DescribeSubnetsResponseType describeSubnets() {
DescribeSubnetsResponseType ret = new DescribeSubnetsResponseType();
ret.setRequestId(UUID.randomUUID().toString());
SubnetSetType subnetSetType = new SubnetSetType();
for (Iterator<MockSubnet> mockSubnet = mockSubnetController.des... | [
"private",
"DescribeSubnetsResponseType",
"describeSubnets",
"(",
")",
"{",
"DescribeSubnetsResponseType",
"ret",
"=",
"new",
"DescribeSubnetsResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
".",
"randomUUID",
"(",
")",
".",
"toString",
"(",
... | Handles "describeSubnets" request and returns response with a subnet Set.
@return a DescribeSubnetsResponseType with Created Vpcs | [
"Handles",
"describeSubnets",
"request",
"and",
"returns",
"response",
"with",
"a",
"subnet",
"Set",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1747-L1777 |
107,876 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.describeInternetGateways | private DescribeInternetGatewaysResponseType describeInternetGateways() {
DescribeInternetGatewaysResponseType ret = new DescribeInternetGatewaysResponseType();
InternetGatewaySetType internetGatewaySet = new InternetGatewaySetType();
for (Iterator<MockInternetGateway> mockInternetGateway = mock... | java | private DescribeInternetGatewaysResponseType describeInternetGateways() {
DescribeInternetGatewaysResponseType ret = new DescribeInternetGatewaysResponseType();
InternetGatewaySetType internetGatewaySet = new InternetGatewaySetType();
for (Iterator<MockInternetGateway> mockInternetGateway = mock... | [
"private",
"DescribeInternetGatewaysResponseType",
"describeInternetGateways",
"(",
")",
"{",
"DescribeInternetGatewaysResponseType",
"ret",
"=",
"new",
"DescribeInternetGatewaysResponseType",
"(",
")",
";",
"InternetGatewaySetType",
"internetGatewaySet",
"=",
"new",
"InternetGat... | Handles "describeInternetGateways" request and returns response with a Internet gateway.
@return a DescribeInternetGatewaysResponseType with Created InternetGateways. | [
"Handles",
"describeInternetGateways",
"request",
"and",
"returns",
"response",
"with",
"a",
"Internet",
"gateway",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1784-L1824 |
107,877 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.describeSecurityGroups | private DescribeSecurityGroupsResponseType describeSecurityGroups() {
DescribeSecurityGroupsResponseType ret = new DescribeSecurityGroupsResponseType();
ret.setRequestId(UUID.randomUUID().toString());
SecurityGroupSetType securityGroupSet = new SecurityGroupSetType();
for (Iterator<Moc... | java | private DescribeSecurityGroupsResponseType describeSecurityGroups() {
DescribeSecurityGroupsResponseType ret = new DescribeSecurityGroupsResponseType();
ret.setRequestId(UUID.randomUUID().toString());
SecurityGroupSetType securityGroupSet = new SecurityGroupSetType();
for (Iterator<Moc... | [
"private",
"DescribeSecurityGroupsResponseType",
"describeSecurityGroups",
"(",
")",
"{",
"DescribeSecurityGroupsResponseType",
"ret",
"=",
"new",
"DescribeSecurityGroupsResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
".",
"randomUUID",
"(",
")",
... | Handles "describeSecurityGroups" request and returns response with a security group.
@return a DescribeInternetGatewaysResponseType with our predefined internet gateway in aws-mock.properties (or if
not overridden, as defined in aws-mock-default.properties) | [
"Handles",
"describeSecurityGroups",
"request",
"and",
"returns",
"response",
"with",
"a",
"security",
"group",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1832-L1880 |
107,878 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.describeVpcs | private DescribeVpcsResponseType describeVpcs() {
DescribeVpcsResponseType ret = new DescribeVpcsResponseType();
ret.setRequestId(UUID.randomUUID().toString());
VpcSetType vpcSet = new VpcSetType();
for (Iterator<MockVpc> mockVpc = mockVpcController.describeVpcs().iterator(); mockVpc
... | java | private DescribeVpcsResponseType describeVpcs() {
DescribeVpcsResponseType ret = new DescribeVpcsResponseType();
ret.setRequestId(UUID.randomUUID().toString());
VpcSetType vpcSet = new VpcSetType();
for (Iterator<MockVpc> mockVpc = mockVpcController.describeVpcs().iterator(); mockVpc
... | [
"private",
"DescribeVpcsResponseType",
"describeVpcs",
"(",
")",
"{",
"DescribeVpcsResponseType",
"ret",
"=",
"new",
"DescribeVpcsResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
".",
"randomUUID",
"(",
")",
".",
"toString",
"(",
")",
")",
... | Handles "describeVpcs" request and returns response with a vpc.
@return a DescribeVpcsResponseType with our predefined vpc in aws-mock.properties (or if not overridden, as
defined in aws-mock-default.properties) | [
"Handles",
"describeVpcs",
"request",
"and",
"returns",
"response",
"with",
"a",
"vpc",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1888-L1912 |
107,879 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.describeTags | private DescribeTagsResponseType describeTags() {
DescribeTagsResponseType ret = new DescribeTagsResponseType();
ret.setRequestId(UUID.randomUUID().toString());
TagSetType tagsSet = new TagSetType();
for (MockTags mockVpc : mockTagsController.describeTags()) {
for (String r... | java | private DescribeTagsResponseType describeTags() {
DescribeTagsResponseType ret = new DescribeTagsResponseType();
ret.setRequestId(UUID.randomUUID().toString());
TagSetType tagsSet = new TagSetType();
for (MockTags mockVpc : mockTagsController.describeTags()) {
for (String r... | [
"private",
"DescribeTagsResponseType",
"describeTags",
"(",
")",
"{",
"DescribeTagsResponseType",
"ret",
"=",
"new",
"DescribeTagsResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
".",
"randomUUID",
"(",
")",
".",
"toString",
"(",
")",
")",
... | Handles "describeTags" request and returns response with a Tags.
@return a DescribeTagsResponseType with our predefined Tags in aws-mock.properties (or if not overridden, as
defined in aws-mock-default.properties) | [
"Handles",
"describeTags",
"request",
"and",
"returns",
"response",
"with",
"a",
"Tags",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1920-L1941 |
107,880 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.createTags | private CreateTagsResponseType createTags(final List<String> resourcesSet,
final Map<String, String> tagSet) {
CreateTagsResponseType ret = new CreateTagsResponseType();
ret.setRequestId(UUID.randomUUID().toString());
mockTagsController.createTags(resourcesSet, tagSet);
ret.s... | java | private CreateTagsResponseType createTags(final List<String> resourcesSet,
final Map<String, String> tagSet) {
CreateTagsResponseType ret = new CreateTagsResponseType();
ret.setRequestId(UUID.randomUUID().toString());
mockTagsController.createTags(resourcesSet, tagSet);
ret.s... | [
"private",
"CreateTagsResponseType",
"createTags",
"(",
"final",
"List",
"<",
"String",
">",
"resourcesSet",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"tagSet",
")",
"{",
"CreateTagsResponseType",
"ret",
"=",
"new",
"CreateTagsResponseType",
"(",
"... | Handles "createTags" request and create new Tags.
@param resourcesSet List of resourceIds.
@param tagSet Map for key, value of tags.
@return a CreateTagsResponseType with Status of Tags. | [
"Handles",
"createTags",
"request",
"and",
"create",
"new",
"Tags",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1949-L1956 |
107,881 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.deleteTags | private DeleteTagsResponseType deleteTags(final List<String> resources) {
DeleteTagsResponseType ret = new DeleteTagsResponseType();
ret.setRequestId(UUID.randomUUID().toString());
mockTagsController.deleteTags(resources);
return ret;
} | java | private DeleteTagsResponseType deleteTags(final List<String> resources) {
DeleteTagsResponseType ret = new DeleteTagsResponseType();
ret.setRequestId(UUID.randomUUID().toString());
mockTagsController.deleteTags(resources);
return ret;
} | [
"private",
"DeleteTagsResponseType",
"deleteTags",
"(",
"final",
"List",
"<",
"String",
">",
"resources",
")",
"{",
"DeleteTagsResponseType",
"ret",
"=",
"new",
"DeleteTagsResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
".",
"randomUUID",
... | Handles "deleteTags" request and delete Tags and returns response.
@param resources : List of resource Id to be deleted.
@return a DeleteTagsResponseType with Status | [
"Handles",
"deleteTags",
"request",
"and",
"delete",
"Tags",
"and",
"returns",
"response",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1963-L1969 |
107,882 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.createVpc | private CreateVpcResponseType createVpc(final String cidrBlock, final String instanceTenancy) {
CreateVpcResponseType ret = new CreateVpcResponseType();
ret.setRequestId(UUID.randomUUID().toString());
MockVpc mockVpc = mockVpcController.createVpc(cidrBlock, instanceTenancy);
VpcType vpc... | java | private CreateVpcResponseType createVpc(final String cidrBlock, final String instanceTenancy) {
CreateVpcResponseType ret = new CreateVpcResponseType();
ret.setRequestId(UUID.randomUUID().toString());
MockVpc mockVpc = mockVpcController.createVpc(cidrBlock, instanceTenancy);
VpcType vpc... | [
"private",
"CreateVpcResponseType",
"createVpc",
"(",
"final",
"String",
"cidrBlock",
",",
"final",
"String",
"instanceTenancy",
")",
"{",
"CreateVpcResponseType",
"ret",
"=",
"new",
"CreateVpcResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
... | Handles "createVpc" request and create new Vpc.
@param cidrBlock : vpc cidrBlock.
@param instanceTenancy : vpc instanceTenancy.
@return a CreateVpcResponseType with new Vpc. | [
"Handles",
"createVpc",
"request",
"and",
"create",
"new",
"Vpc",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1977-L1990 |
107,883 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.deleteVpc | private DeleteVpcResponseType deleteVpc(final String vpcId) {
DeleteVpcResponseType ret = new DeleteVpcResponseType();
ret.setRequestId(UUID.randomUUID().toString());
mockVpcController.deleteVpc(vpcId);
return ret;
} | java | private DeleteVpcResponseType deleteVpc(final String vpcId) {
DeleteVpcResponseType ret = new DeleteVpcResponseType();
ret.setRequestId(UUID.randomUUID().toString());
mockVpcController.deleteVpc(vpcId);
return ret;
} | [
"private",
"DeleteVpcResponseType",
"deleteVpc",
"(",
"final",
"String",
"vpcId",
")",
"{",
"DeleteVpcResponseType",
"ret",
"=",
"new",
"DeleteVpcResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
".",
"randomUUID",
"(",
")",
".",
"toString",... | Handles "deleteVpc" request and delete Vpc and returns response.
@param vpcId : Vpc Id to be deleted.
@return a DeleteVpcResponseType with new Vpc | [
"Handles",
"deleteVpc",
"request",
"and",
"delete",
"Vpc",
"and",
"returns",
"response",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1997-L2003 |
107,884 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.getXmlError | private String getXmlError(final String errorCode, final String errorMessage) {
Map<String, Object> data = new HashMap<String, Object>();
data.put("errorCode", StringEscapeUtils.escapeXml(errorCode));
data.put("errorMessage", StringEscapeUtils.escapeXml(errorMessage));
// fake a random U... | java | private String getXmlError(final String errorCode, final String errorMessage) {
Map<String, Object> data = new HashMap<String, Object>();
data.put("errorCode", StringEscapeUtils.escapeXml(errorCode));
data.put("errorMessage", StringEscapeUtils.escapeXml(errorMessage));
// fake a random U... | [
"private",
"String",
"getXmlError",
"(",
"final",
"String",
"errorCode",
",",
"final",
"String",
"errorMessage",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"data",
... | Generate error response body in xml and write it with writer.
@param errorCode
the error code wrapped in the xml response
@param errorMessage
the error message wrapped in the xml response
@return xml body for an error message which can be recognized by AWS clients | [
"Generate",
"error",
"response",
"body",
"in",
"xml",
"and",
"write",
"it",
"with",
"writer",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L2014-L2030 |
107,885 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.getBlankResponseXml | private String getBlankResponseXml() {
Map<String, Object> data = new HashMap<String, Object>();
data.put("requestID", UUID.randomUUID().toString());
String ret = null;
try {
ret = TemplateUtils.get(BLANK_RESPONSE_TEMPLATE, data);
} catch (AwsMockException e) {
... | java | private String getBlankResponseXml() {
Map<String, Object> data = new HashMap<String, Object>();
data.put("requestID", UUID.randomUUID().toString());
String ret = null;
try {
ret = TemplateUtils.get(BLANK_RESPONSE_TEMPLATE, data);
} catch (AwsMockException e) {
... | [
"private",
"String",
"getBlankResponseXml",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"data",
".",
"put",
"(",
"\"requestID\"",
",",
"UUID",
".",
"randomUUI... | Generate blank response body in xml and write it with writer.
@return xml body blank response which can be recognized by AWS clients | [
"Generate",
"blank",
"response",
"body",
"in",
"xml",
"and",
"write",
"it",
"with",
"writer",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L2037-L2050 |
107,886 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java | MockEc2Controller.describeInstances | public Collection<AbstractMockEc2Instance> describeInstances(final Set<String> instanceIDs) {
if (null == instanceIDs || instanceIDs.size() == 0) {
return allMockEc2Instances.values();
} else {
return getInstances(instanceIDs);
}
} | java | public Collection<AbstractMockEc2Instance> describeInstances(final Set<String> instanceIDs) {
if (null == instanceIDs || instanceIDs.size() == 0) {
return allMockEc2Instances.values();
} else {
return getInstances(instanceIDs);
}
} | [
"public",
"Collection",
"<",
"AbstractMockEc2Instance",
">",
"describeInstances",
"(",
"final",
"Set",
"<",
"String",
">",
"instanceIDs",
")",
"{",
"if",
"(",
"null",
"==",
"instanceIDs",
"||",
"instanceIDs",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"re... | List mock ec2 instances in current aws-mock.
@param instanceIDs
a filter of specified instance IDs for the target instance to describe
@return a collection of {@link AbstractMockEc2Instance} with specified instance IDs, or all of the mock ec2
instances if no instance IDs as filtered | [
"List",
"mock",
"ec2",
"instances",
"in",
"current",
"aws",
"-",
"mock",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java#L102-L108 |
107,887 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java | MockEc2Controller.listInstanceIDs | public List<String> listInstanceIDs(final Set<String> instanceIDs) {
Set<String> allInstanceIDs = allMockEc2Instances.keySet();
if (null == instanceIDs || instanceIDs.size() == 0) {
return new ArrayList<String>(allInstanceIDs);
} else {
List<String> filteredInstanceIDs = ... | java | public List<String> listInstanceIDs(final Set<String> instanceIDs) {
Set<String> allInstanceIDs = allMockEc2Instances.keySet();
if (null == instanceIDs || instanceIDs.size() == 0) {
return new ArrayList<String>(allInstanceIDs);
} else {
List<String> filteredInstanceIDs = ... | [
"public",
"List",
"<",
"String",
">",
"listInstanceIDs",
"(",
"final",
"Set",
"<",
"String",
">",
"instanceIDs",
")",
"{",
"Set",
"<",
"String",
">",
"allInstanceIDs",
"=",
"allMockEc2Instances",
".",
"keySet",
"(",
")",
";",
"if",
"(",
"null",
"==",
"in... | List mock ec2 instance IDs in current aws-mock.
@param instanceIDs
a filter of specified instance IDs for the target instance to describe
@return a collection of IDs with specified instance IDs, or all of the mock ec2 instanceIDs if not filtered | [
"List",
"mock",
"ec2",
"instance",
"IDs",
"in",
"current",
"aws",
"-",
"mock",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java#L117-L130 |
107,888 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java | MockEc2Controller.stopInstances | public List<InstanceStateChangeType> stopInstances(final Set<String> instanceIDs) {
List<InstanceStateChangeType> ret = new ArrayList<InstanceStateChangeType>();
Collection<AbstractMockEc2Instance> instances = getInstances(instanceIDs);
for (AbstractMockEc2Instance instance : instances) {
... | java | public List<InstanceStateChangeType> stopInstances(final Set<String> instanceIDs) {
List<InstanceStateChangeType> ret = new ArrayList<InstanceStateChangeType>();
Collection<AbstractMockEc2Instance> instances = getInstances(instanceIDs);
for (AbstractMockEc2Instance instance : instances) {
... | [
"public",
"List",
"<",
"InstanceStateChangeType",
">",
"stopInstances",
"(",
"final",
"Set",
"<",
"String",
">",
"instanceIDs",
")",
"{",
"List",
"<",
"InstanceStateChangeType",
">",
"ret",
"=",
"new",
"ArrayList",
"<",
"InstanceStateChangeType",
">",
"(",
")",
... | Stop one or more existing mock ec2 instances.
@param instanceIDs
a set of instance IDs for those instances to stop
@return a list of state change messages (typically running to stopping) | [
"Stop",
"one",
"or",
"more",
"existing",
"mock",
"ec2",
"instances",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java#L267-L295 |
107,889 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java | MockEc2Controller.getInstances | private Collection<AbstractMockEc2Instance> getInstances(final Set<String> instanceIDs) {
Collection<AbstractMockEc2Instance> ret = new ArrayList<AbstractMockEc2Instance>();
for (String instanceID : instanceIDs) {
ret.add(getMockEc2Instance(instanceID));
}
return ret;
} | java | private Collection<AbstractMockEc2Instance> getInstances(final Set<String> instanceIDs) {
Collection<AbstractMockEc2Instance> ret = new ArrayList<AbstractMockEc2Instance>();
for (String instanceID : instanceIDs) {
ret.add(getMockEc2Instance(instanceID));
}
return ret;
} | [
"private",
"Collection",
"<",
"AbstractMockEc2Instance",
">",
"getInstances",
"(",
"final",
"Set",
"<",
"String",
">",
"instanceIDs",
")",
"{",
"Collection",
"<",
"AbstractMockEc2Instance",
">",
"ret",
"=",
"new",
"ArrayList",
"<",
"AbstractMockEc2Instance",
">",
... | Get mock ec2 instances by instance IDs.
@param instanceIDs
IDs of the mock ec2 instances to get
@return the mock ec2 instances object | [
"Get",
"mock",
"ec2",
"instances",
"by",
"instance",
"IDs",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java#L361-L367 |
107,890 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java | MockEc2Controller.destroyCleanupTerminatedInstanceTimer | public void destroyCleanupTerminatedInstanceTimer() {
cleanupTerminatedInstancesScheduledFuture.cancel(true);
cleanupTerminatedInstancesScheduledFuture = null;
cleanupTerminatedInstancesTimer.shutdown();
cleanupTerminatedInstancesTimer = null;
} | java | public void destroyCleanupTerminatedInstanceTimer() {
cleanupTerminatedInstancesScheduledFuture.cancel(true);
cleanupTerminatedInstancesScheduledFuture = null;
cleanupTerminatedInstancesTimer.shutdown();
cleanupTerminatedInstancesTimer = null;
} | [
"public",
"void",
"destroyCleanupTerminatedInstanceTimer",
"(",
")",
"{",
"cleanupTerminatedInstancesScheduledFuture",
".",
"cancel",
"(",
"true",
")",
";",
"cleanupTerminatedInstancesScheduledFuture",
"=",
"null",
";",
"cleanupTerminatedInstancesTimer",
".",
"shutdown",
"(",... | Cancel the internal timer of cleaning up terminated mock ec2 instances. | [
"Cancel",
"the",
"internal",
"timer",
"of",
"cleaning",
"up",
"terminated",
"mock",
"ec2",
"instances",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java#L433-L438 |
107,891 | treelogic-swe/aws-mock | example/java/full/client-usage/DescribeImagesExample.java | DescribeImagesExample.describeAllImages | public static List<Image> describeAllImages() {
// pass any credentials as aws-mock does not authenticate them at all
AWSCredentials credentials = new BasicAWSCredentials("foo", "bar");
AmazonEC2Client amazonEC2Client = new AmazonEC2Client(credentials);
// the mock endpoint for ec2 whic... | java | public static List<Image> describeAllImages() {
// pass any credentials as aws-mock does not authenticate them at all
AWSCredentials credentials = new BasicAWSCredentials("foo", "bar");
AmazonEC2Client amazonEC2Client = new AmazonEC2Client(credentials);
// the mock endpoint for ec2 whic... | [
"public",
"static",
"List",
"<",
"Image",
">",
"describeAllImages",
"(",
")",
"{",
"// pass any credentials as aws-mock does not authenticate them at all",
"AWSCredentials",
"credentials",
"=",
"new",
"BasicAWSCredentials",
"(",
"\"foo\"",
",",
"\"bar\"",
")",
";",
"Amazo... | Describe all available AMIs within aws-mock.
@return a list of AMIs | [
"Describe",
"all",
"available",
"AMIs",
"within",
"aws",
"-",
"mock",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/example/java/full/client-usage/DescribeImagesExample.java#L30-L43 |
107,892 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockVpcController.java | MockVpcController.createVpc | public MockVpc createVpc(
final String cidrBlock, final String instanceTenancy) {
MockVpc ret = new MockVpc();
ret.setCidrBlock(cidrBlock);
ret.setVpcId("vpc-" + UUID.randomUUID().toString().substring(0, VPC_ID_POSTFIX_LENGTH));
ret.setInstanceTenancy(instanceTenancy);
... | java | public MockVpc createVpc(
final String cidrBlock, final String instanceTenancy) {
MockVpc ret = new MockVpc();
ret.setCidrBlock(cidrBlock);
ret.setVpcId("vpc-" + UUID.randomUUID().toString().substring(0, VPC_ID_POSTFIX_LENGTH));
ret.setInstanceTenancy(instanceTenancy);
... | [
"public",
"MockVpc",
"createVpc",
"(",
"final",
"String",
"cidrBlock",
",",
"final",
"String",
"instanceTenancy",
")",
"{",
"MockVpc",
"ret",
"=",
"new",
"MockVpc",
"(",
")",
";",
"ret",
".",
"setCidrBlock",
"(",
"cidrBlock",
")",
";",
"ret",
".",
"setVpcI... | Create the mock VPC.
@param cidrBlock VPC cidr block.
@param instanceTenancy VPC instance tenancy.
@return mock VPC. | [
"Create",
"the",
"mock",
"VPC",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockVpcController.java#L80-L98 |
107,893 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockVpcController.java | MockVpcController.deleteVpc | public MockVpc deleteVpc(final String vpcId) {
if (vpcId != null && allMockVpcInstances.containsKey(vpcId)) {
return allMockVpcInstances.remove(vpcId);
}
return null;
} | java | public MockVpc deleteVpc(final String vpcId) {
if (vpcId != null && allMockVpcInstances.containsKey(vpcId)) {
return allMockVpcInstances.remove(vpcId);
}
return null;
} | [
"public",
"MockVpc",
"deleteVpc",
"(",
"final",
"String",
"vpcId",
")",
"{",
"if",
"(",
"vpcId",
"!=",
"null",
"&&",
"allMockVpcInstances",
".",
"containsKey",
"(",
"vpcId",
")",
")",
"{",
"return",
"allMockVpcInstances",
".",
"remove",
"(",
"vpcId",
")",
... | Delete vpc.
@param vpcId
vpcId to be deleted
@return Mock vpc. | [
"Delete",
"vpc",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockVpcController.java#L107-L113 |
107,894 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/cloudwatch/control/MockCloudWatchQueryHandler.java | MockCloudWatchQueryHandler.getMetricStatistics | private GetMetricStatisticsResponse getMetricStatistics(final String[] statistics,
final DateTime startTime,
final DateTime endTime, final int period, final String metricName) {
GetMetricStatisticsResponse ret = new GetMetricStatisticsResponse();
GetMetricStatisticsResult result ... | java | private GetMetricStatisticsResponse getMetricStatistics(final String[] statistics,
final DateTime startTime,
final DateTime endTime, final int period, final String metricName) {
GetMetricStatisticsResponse ret = new GetMetricStatisticsResponse();
GetMetricStatisticsResult result ... | [
"private",
"GetMetricStatisticsResponse",
"getMetricStatistics",
"(",
"final",
"String",
"[",
"]",
"statistics",
",",
"final",
"DateTime",
"startTime",
",",
"final",
"DateTime",
"endTime",
",",
"final",
"int",
"period",
",",
"final",
"String",
"metricName",
")",
"... | Handles "GetMetricStatistics" request, as simple as without any filters
to use.
@param statistics
Metric statistics.
@param startTime
Metric statistics start time.
@param endTime
Metric statistics end time.
@param period
Metric collection period.
@param metricName
Metric Name.
@return a GetMetricStatisticsResult for m... | [
"Handles",
"GetMetricStatistics",
"request",
"as",
"simple",
"as",
"without",
"any",
"filters",
"to",
"use",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/cloudwatch/control/MockCloudWatchQueryHandler.java#L339-L367 |
107,895 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/cloudwatch/control/MockCloudWatchQueryHandler.java | MockCloudWatchQueryHandler.describeAlarms | private DescribeAlarmsResponse describeAlarms() {
DescribeAlarmsResponse ret = new DescribeAlarmsResponse();
DescribeAlarmsResult result = new DescribeAlarmsResult();
MetricAlarms metricAlarms = new MetricAlarms();
MetricAlarm metricAlarm = new MetricAlarm();
metricAlarm.setAlar... | java | private DescribeAlarmsResponse describeAlarms() {
DescribeAlarmsResponse ret = new DescribeAlarmsResponse();
DescribeAlarmsResult result = new DescribeAlarmsResult();
MetricAlarms metricAlarms = new MetricAlarms();
MetricAlarm metricAlarm = new MetricAlarm();
metricAlarm.setAlar... | [
"private",
"DescribeAlarmsResponse",
"describeAlarms",
"(",
")",
"{",
"DescribeAlarmsResponse",
"ret",
"=",
"new",
"DescribeAlarmsResponse",
"(",
")",
";",
"DescribeAlarmsResult",
"result",
"=",
"new",
"DescribeAlarmsResult",
"(",
")",
";",
"MetricAlarms",
"metricAlarms... | Handles "describeAlarms" request.
@return a GetMetricStatisticsResult for metricName. | [
"Handles",
"describeAlarms",
"request",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/cloudwatch/control/MockCloudWatchQueryHandler.java#L374-L396 |
107,896 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/cloudwatch/control/MockCloudWatchQueryHandler.java | MockCloudWatchQueryHandler.toXMLGregorianCalendar | private XMLGregorianCalendar toXMLGregorianCalendar(final DateTime date) {
GregorianCalendar gCalendar = new GregorianCalendar(date.getZone().toTimeZone());
gCalendar.setTime(date.toDate());
XMLGregorianCalendar xmlGrogerianCalendar = null;
try {
xmlGrogerianCalendar = Dataty... | java | private XMLGregorianCalendar toXMLGregorianCalendar(final DateTime date) {
GregorianCalendar gCalendar = new GregorianCalendar(date.getZone().toTimeZone());
gCalendar.setTime(date.toDate());
XMLGregorianCalendar xmlGrogerianCalendar = null;
try {
xmlGrogerianCalendar = Dataty... | [
"private",
"XMLGregorianCalendar",
"toXMLGregorianCalendar",
"(",
"final",
"DateTime",
"date",
")",
"{",
"GregorianCalendar",
"gCalendar",
"=",
"new",
"GregorianCalendar",
"(",
"date",
".",
"getZone",
"(",
")",
".",
"toTimeZone",
"(",
")",
")",
";",
"gCalendar",
... | Converts java.util.Date to javax.xml.datatype.XMLGregorianCalendar.
@param date
Date parameter.
@return a XMLGregorianCalendar for date. | [
"Converts",
"java",
".",
"util",
".",
"Date",
"to",
"javax",
".",
"xml",
".",
"datatype",
".",
"XMLGregorianCalendar",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/cloudwatch/control/MockCloudWatchQueryHandler.java#L405-L417 |
107,897 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/cloudwatch/control/MockCloudWatchQueryHandler.java | MockCloudWatchQueryHandler.getMetricUnit | private StandardUnit getMetricUnit(final String metricName) {
String result = null;
if (metricName.equals(Constants.CPU_UTILIZATION)) {
result = Constants.UNIT_PERCENT;
} else if (metricName.equals(Constants.DISK_READ_BYTES)) {
result = Constants.UNIT_BYTES;
} el... | java | private StandardUnit getMetricUnit(final String metricName) {
String result = null;
if (metricName.equals(Constants.CPU_UTILIZATION)) {
result = Constants.UNIT_PERCENT;
} else if (metricName.equals(Constants.DISK_READ_BYTES)) {
result = Constants.UNIT_BYTES;
} el... | [
"private",
"StandardUnit",
"getMetricUnit",
"(",
"final",
"String",
"metricName",
")",
"{",
"String",
"result",
"=",
"null",
";",
"if",
"(",
"metricName",
".",
"equals",
"(",
"Constants",
".",
"CPU_UTILIZATION",
")",
")",
"{",
"result",
"=",
"Constants",
"."... | Get the Metric Unit.
@param metricName
Metric Name parameter.
@return Standard Unit Value. | [
"Get",
"the",
"Metric",
"Unit",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/cloudwatch/control/MockCloudWatchQueryHandler.java#L659-L695 |
107,898 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/common/util/TemplateUtils.java | TemplateUtils.write | public static void write(final String templateFilename, final Map<String, Object> data,
final Writer writer) {
Template tmpl = null;
try {
/*-
* note that we don't need to cache templates by ourselves since getTemplate() does that internally already
*/
... | java | public static void write(final String templateFilename, final Map<String, Object> data,
final Writer writer) {
Template tmpl = null;
try {
/*-
* note that we don't need to cache templates by ourselves since getTemplate() does that internally already
*/
... | [
"public",
"static",
"void",
"write",
"(",
"final",
"String",
"templateFilename",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
",",
"final",
"Writer",
"writer",
")",
"{",
"Template",
"tmpl",
"=",
"null",
";",
"try",
"{",
"/*-\n ... | Process with given template + data and then put result to writer.
@param templateFilename
filename of the .ftl file
@param data
data to fill in the template, as pairs of key-values
@param writer
target writer to print the result | [
"Process",
"with",
"given",
"template",
"+",
"data",
"and",
"then",
"put",
"result",
"to",
"writer",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/common/util/TemplateUtils.java#L68-L110 |
107,899 | treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/common/util/TemplateUtils.java | TemplateUtils.get | public static String get(final String templateName, final Map<String, Object> data) {
StringWriter writer = new StringWriter();
write(templateName, data, writer);
return writer.toString();
} | java | public static String get(final String templateName, final Map<String, Object> data) {
StringWriter writer = new StringWriter();
write(templateName, data, writer);
return writer.toString();
} | [
"public",
"static",
"String",
"get",
"(",
"final",
"String",
"templateName",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
")",
"{",
"StringWriter",
"writer",
"=",
"new",
"StringWriter",
"(",
")",
";",
"write",
"(",
"templateName",
",",
... | Process with given template + data and get result as a string.
@param templateName
filename of the .ftl file
@param data
data to fill in the template, as pairs of key-values
@return processed result from template and data | [
"Process",
"with",
"given",
"template",
"+",
"data",
"and",
"get",
"result",
"as",
"a",
"string",
"."
] | 1d1058c0ebbd0615efa28695481e36ae3ffc58a0 | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/common/util/TemplateUtils.java#L121-L125 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.