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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
162,100 | gresrun/jesque | src/main/java/net/greghaines/jesque/utils/JesqueUtils.java | JesqueUtils.map | @SafeVarargs
public static <K, V> Map<K, V> map(final Entry<? extends K, ? extends V>... entries) {
final Map<K, V> map = new LinkedHashMap<K, V>(entries.length);
for (final Entry<? extends K, ? extends V> entry : entries) {
map.put(entry.getKey(), entry.getValue());
}
re... | java | @SafeVarargs
public static <K, V> Map<K, V> map(final Entry<? extends K, ? extends V>... entries) {
final Map<K, V> map = new LinkedHashMap<K, V>(entries.length);
for (final Entry<? extends K, ? extends V> entry : entries) {
map.put(entry.getKey(), entry.getValue());
}
re... | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"map",
"(",
"final",
"Entry",
"<",
"?",
"extends",
"K",
",",
"?",
"extends",
"V",
">",
"...",
"entries",
")",
"{",
"final",
"Map",
"<",
"K",
",",
... | A convenient way of creating a map on the fly.
@param <K> the key type
@param <V> the value type
@param entries
Map.Entry objects to be added to the map
@return a LinkedHashMap with the supplied entries | [
"A",
"convenient",
"way",
"of",
"creating",
"a",
"map",
"on",
"the",
"fly",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/JesqueUtils.java#L319-L326 |
162,101 | gresrun/jesque | src/main/java/net/greghaines/jesque/utils/JesqueUtils.java | JesqueUtils.set | @SafeVarargs
public static <K> Set<K> set(final K... keys) {
return new LinkedHashSet<K>(Arrays.asList(keys));
} | java | @SafeVarargs
public static <K> Set<K> set(final K... keys) {
return new LinkedHashSet<K>(Arrays.asList(keys));
} | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"K",
">",
"Set",
"<",
"K",
">",
"set",
"(",
"final",
"K",
"...",
"keys",
")",
"{",
"return",
"new",
"LinkedHashSet",
"<",
"K",
">",
"(",
"Arrays",
".",
"asList",
"(",
"keys",
")",
")",
";",
"}"
] | Creates a Set out of the given keys
@param <K> the key type
@param keys
the keys
@return a Set containing the given keys | [
"Creates",
"a",
"Set",
"out",
"of",
"the",
"given",
"keys"
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/JesqueUtils.java#L352-L355 |
162,102 | gresrun/jesque | src/main/java/net/greghaines/jesque/utils/JesqueUtils.java | JesqueUtils.nullSafeEquals | public static boolean nullSafeEquals(final Object obj1, final Object obj2) {
return ((obj1 == null && obj2 == null)
|| (obj1 != null && obj2 != null && obj1.equals(obj2)));
} | java | public static boolean nullSafeEquals(final Object obj1, final Object obj2) {
return ((obj1 == null && obj2 == null)
|| (obj1 != null && obj2 != null && obj1.equals(obj2)));
} | [
"public",
"static",
"boolean",
"nullSafeEquals",
"(",
"final",
"Object",
"obj1",
",",
"final",
"Object",
"obj2",
")",
"{",
"return",
"(",
"(",
"obj1",
"==",
"null",
"&&",
"obj2",
"==",
"null",
")",
"||",
"(",
"obj1",
"!=",
"null",
"&&",
"obj2",
"!=",
... | Test for equality.
@param obj1 the first object
@param obj2 the second object
@return true if both are null or the two objects are equal | [
"Test",
"for",
"equality",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/JesqueUtils.java#L363-L366 |
162,103 | gresrun/jesque | src/main/java/net/greghaines/jesque/meta/dao/impl/QueueInfoDAORedisImpl.java | QueueInfoDAORedisImpl.size | private long size(final Jedis jedis, final String queueName) {
final String key = key(QUEUE, queueName);
final long size;
if (JedisUtils.isDelayedQueue(jedis, key)) { // If delayed queue, use ZCARD
size = jedis.zcard(key);
} else { // Else, use LLEN
size = jedis.l... | java | private long size(final Jedis jedis, final String queueName) {
final String key = key(QUEUE, queueName);
final long size;
if (JedisUtils.isDelayedQueue(jedis, key)) { // If delayed queue, use ZCARD
size = jedis.zcard(key);
} else { // Else, use LLEN
size = jedis.l... | [
"private",
"long",
"size",
"(",
"final",
"Jedis",
"jedis",
",",
"final",
"String",
"queueName",
")",
"{",
"final",
"String",
"key",
"=",
"key",
"(",
"QUEUE",
",",
"queueName",
")",
";",
"final",
"long",
"size",
";",
"if",
"(",
"JedisUtils",
".",
"isDel... | Size of a queue.
@param jedis
@param queueName
@return | [
"Size",
"of",
"a",
"queue",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/meta/dao/impl/QueueInfoDAORedisImpl.java#L219-L228 |
162,104 | gresrun/jesque | src/main/java/net/greghaines/jesque/meta/dao/impl/QueueInfoDAORedisImpl.java | QueueInfoDAORedisImpl.getJobs | private List<Job> getJobs(final Jedis jedis, final String queueName, final long jobOffset, final long jobCount) throws Exception {
final String key = key(QUEUE, queueName);
final List<Job> jobs = new ArrayList<>();
if (JedisUtils.isDelayedQueue(jedis, key)) { // If delayed queue, use ZRANGEWITHS... | java | private List<Job> getJobs(final Jedis jedis, final String queueName, final long jobOffset, final long jobCount) throws Exception {
final String key = key(QUEUE, queueName);
final List<Job> jobs = new ArrayList<>();
if (JedisUtils.isDelayedQueue(jedis, key)) { // If delayed queue, use ZRANGEWITHS... | [
"private",
"List",
"<",
"Job",
">",
"getJobs",
"(",
"final",
"Jedis",
"jedis",
",",
"final",
"String",
"queueName",
",",
"final",
"long",
"jobOffset",
",",
"final",
"long",
"jobCount",
")",
"throws",
"Exception",
"{",
"final",
"String",
"key",
"=",
"key",
... | Get list of Jobs from a queue.
@param jedis
@param queueName
@param jobOffset
@param jobCount
@return | [
"Get",
"list",
"of",
"Jobs",
"from",
"a",
"queue",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/meta/dao/impl/QueueInfoDAORedisImpl.java#L244-L261 |
162,105 | gresrun/jesque | src/main/java/net/greghaines/jesque/Job.java | Job.setVars | @SuppressWarnings("unchecked")
public void setVars(final Map<String, ? extends Object> vars) {
this.vars = (Map<String, Object>)vars;
} | java | @SuppressWarnings("unchecked")
public void setVars(final Map<String, ? extends Object> vars) {
this.vars = (Map<String, Object>)vars;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"setVars",
"(",
"final",
"Map",
"<",
"String",
",",
"?",
"extends",
"Object",
">",
"vars",
")",
"{",
"this",
".",
"vars",
"=",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"... | Set the named arguments.
@param vars
the new named arguments | [
"Set",
"the",
"named",
"arguments",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/Job.java#L193-L196 |
162,106 | gresrun/jesque | src/main/java/net/greghaines/jesque/Job.java | Job.setUnknownField | @JsonAnySetter
public void setUnknownField(final String name, final Object value) {
this.unknownFields.put(name, value);
} | java | @JsonAnySetter
public void setUnknownField(final String name, final Object value) {
this.unknownFields.put(name, value);
} | [
"@",
"JsonAnySetter",
"public",
"void",
"setUnknownField",
"(",
"final",
"String",
"name",
",",
"final",
"Object",
"value",
")",
"{",
"this",
".",
"unknownFields",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Set an unknown field.
@param name the unknown property name
@param value the unknown property value | [
"Set",
"an",
"unknown",
"field",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/Job.java#L240-L243 |
162,107 | gresrun/jesque | src/main/java/net/greghaines/jesque/Job.java | Job.setUnknownFields | @JsonIgnore
public void setUnknownFields(final Map<String,Object> unknownFields) {
this.unknownFields.clear();
this.unknownFields.putAll(unknownFields);
} | java | @JsonIgnore
public void setUnknownFields(final Map<String,Object> unknownFields) {
this.unknownFields.clear();
this.unknownFields.putAll(unknownFields);
} | [
"@",
"JsonIgnore",
"public",
"void",
"setUnknownFields",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"unknownFields",
")",
"{",
"this",
".",
"unknownFields",
".",
"clear",
"(",
")",
";",
"this",
".",
"unknownFields",
".",
"putAll",
"(",
"unknow... | Set all unknown fields
@param unknownFields the new unknown fields | [
"Set",
"all",
"unknown",
"fields"
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/Job.java#L249-L253 |
162,108 | gresrun/jesque | src/main/java/net/greghaines/jesque/worker/MapBasedJobFactory.java | MapBasedJobFactory.addJobType | public void addJobType(final String jobName, final Class<?> jobType) {
checkJobType(jobName, jobType);
this.jobTypes.put(jobName, jobType);
} | java | public void addJobType(final String jobName, final Class<?> jobType) {
checkJobType(jobName, jobType);
this.jobTypes.put(jobName, jobType);
} | [
"public",
"void",
"addJobType",
"(",
"final",
"String",
"jobName",
",",
"final",
"Class",
"<",
"?",
">",
"jobType",
")",
"{",
"checkJobType",
"(",
"jobName",
",",
"jobType",
")",
";",
"this",
".",
"jobTypes",
".",
"put",
"(",
"jobName",
",",
"jobType",
... | Allow the given job type to be executed.
@param jobName the job name as seen
@param jobType the job type to allow | [
"Allow",
"the",
"given",
"job",
"type",
"to",
"be",
"executed",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/worker/MapBasedJobFactory.java#L65-L68 |
162,109 | gresrun/jesque | src/main/java/net/greghaines/jesque/worker/MapBasedJobFactory.java | MapBasedJobFactory.removeJobType | public void removeJobType(final Class<?> jobType) {
if (jobType == null) {
throw new IllegalArgumentException("jobType must not be null");
}
this.jobTypes.values().remove(jobType);
} | java | public void removeJobType(final Class<?> jobType) {
if (jobType == null) {
throw new IllegalArgumentException("jobType must not be null");
}
this.jobTypes.values().remove(jobType);
} | [
"public",
"void",
"removeJobType",
"(",
"final",
"Class",
"<",
"?",
">",
"jobType",
")",
"{",
"if",
"(",
"jobType",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"jobType must not be null\"",
")",
";",
"}",
"this",
".",
"jobTypes... | Disallow the job type from being executed.
@param jobType the job type to disallow | [
"Disallow",
"the",
"job",
"type",
"from",
"being",
"executed",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/worker/MapBasedJobFactory.java#L74-L79 |
162,110 | gresrun/jesque | src/main/java/net/greghaines/jesque/worker/MapBasedJobFactory.java | MapBasedJobFactory.setJobTypes | public void setJobTypes(final Map<String, ? extends Class<?>> jobTypes) {
checkJobTypes(jobTypes);
this.jobTypes.clear();
this.jobTypes.putAll(jobTypes);
} | java | public void setJobTypes(final Map<String, ? extends Class<?>> jobTypes) {
checkJobTypes(jobTypes);
this.jobTypes.clear();
this.jobTypes.putAll(jobTypes);
} | [
"public",
"void",
"setJobTypes",
"(",
"final",
"Map",
"<",
"String",
",",
"?",
"extends",
"Class",
"<",
"?",
">",
">",
"jobTypes",
")",
"{",
"checkJobTypes",
"(",
"jobTypes",
")",
";",
"this",
".",
"jobTypes",
".",
"clear",
"(",
")",
";",
"this",
"."... | Clear any current allowed job types and use the given set.
@param jobTypes the job types to allow | [
"Clear",
"any",
"current",
"allowed",
"job",
"types",
"and",
"use",
"the",
"given",
"set",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/worker/MapBasedJobFactory.java#L96-L100 |
162,111 | gresrun/jesque | src/main/java/net/greghaines/jesque/worker/MapBasedJobFactory.java | MapBasedJobFactory.checkJobTypes | protected void checkJobTypes(final Map<String, ? extends Class<?>> jobTypes) {
if (jobTypes == null) {
throw new IllegalArgumentException("jobTypes must not be null");
}
for (final Entry<String, ? extends Class<?>> entry : jobTypes.entrySet()) {
try {
chec... | java | protected void checkJobTypes(final Map<String, ? extends Class<?>> jobTypes) {
if (jobTypes == null) {
throw new IllegalArgumentException("jobTypes must not be null");
}
for (final Entry<String, ? extends Class<?>> entry : jobTypes.entrySet()) {
try {
chec... | [
"protected",
"void",
"checkJobTypes",
"(",
"final",
"Map",
"<",
"String",
",",
"?",
"extends",
"Class",
"<",
"?",
">",
">",
"jobTypes",
")",
"{",
"if",
"(",
"jobTypes",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"jobTypes mu... | Verify the given job types are all valid.
@param jobTypes the given job types
@throws IllegalArgumentException if any of the job types are invalid
@see #checkJobType(String, Class) | [
"Verify",
"the",
"given",
"job",
"types",
"are",
"all",
"valid",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/worker/MapBasedJobFactory.java#L109-L120 |
162,112 | gresrun/jesque | src/main/java/net/greghaines/jesque/worker/MapBasedJobFactory.java | MapBasedJobFactory.checkJobType | protected void checkJobType(final String jobName, final Class<?> jobType) {
if (jobName == null) {
throw new IllegalArgumentException("jobName must not be null");
}
if (jobType == null) {
throw new IllegalArgumentException("jobType must not be null");
}
if... | java | protected void checkJobType(final String jobName, final Class<?> jobType) {
if (jobName == null) {
throw new IllegalArgumentException("jobName must not be null");
}
if (jobType == null) {
throw new IllegalArgumentException("jobType must not be null");
}
if... | [
"protected",
"void",
"checkJobType",
"(",
"final",
"String",
"jobName",
",",
"final",
"Class",
"<",
"?",
">",
"jobType",
")",
"{",
"if",
"(",
"jobName",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"jobName must not be null\"",
")... | Determine if a job name and job type are valid.
@param jobName the name of the job
@param jobType the class of the job
@throws IllegalArgumentException if the name or type are invalid | [
"Determine",
"if",
"a",
"job",
"name",
"and",
"job",
"type",
"are",
"valid",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/worker/MapBasedJobFactory.java#L128-L140 |
162,113 | gresrun/jesque | src/main/java/net/greghaines/jesque/admin/AbstractAdminClient.java | AbstractAdminClient.doPublish | public static void doPublish(final Jedis jedis, final String namespace, final String channel, final String jobJson) {
jedis.publish(JesqueUtils.createKey(namespace, CHANNEL, channel), jobJson);
} | java | public static void doPublish(final Jedis jedis, final String namespace, final String channel, final String jobJson) {
jedis.publish(JesqueUtils.createKey(namespace, CHANNEL, channel), jobJson);
} | [
"public",
"static",
"void",
"doPublish",
"(",
"final",
"Jedis",
"jedis",
",",
"final",
"String",
"namespace",
",",
"final",
"String",
"channel",
",",
"final",
"String",
"jobJson",
")",
"{",
"jedis",
".",
"publish",
"(",
"JesqueUtils",
".",
"createKey",
"(",
... | Helper method that encapsulates the minimum logic for publishing a job to
a channel.
@param jedis
the connection to Redis
@param namespace
the Resque namespace
@param channel
the channel name
@param jobJson
the job serialized as JSON | [
"Helper",
"method",
"that",
"encapsulates",
"the",
"minimum",
"logic",
"for",
"publishing",
"a",
"job",
"to",
"a",
"channel",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/admin/AbstractAdminClient.java#L133-L135 |
162,114 | gresrun/jesque | src/main/java/net/greghaines/jesque/utils/ReflectionUtils.java | ReflectionUtils.createObject | public static <T> T createObject(final Class<T> clazz, final Object... args) throws NoSuchConstructorException,
AmbiguousConstructorException, ReflectiveOperationException {
return findConstructor(clazz, args).newInstance(args);
} | java | public static <T> T createObject(final Class<T> clazz, final Object... args) throws NoSuchConstructorException,
AmbiguousConstructorException, ReflectiveOperationException {
return findConstructor(clazz, args).newInstance(args);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"createObject",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
",",
"final",
"Object",
"...",
"args",
")",
"throws",
"NoSuchConstructorException",
",",
"AmbiguousConstructorException",
",",
"ReflectiveOperationException",
"{... | Create an object of the given type using a constructor that matches the
supplied arguments.
@param <T> the object type
@param clazz
the type to create
@param args
the arguments to the constructor
@return a new object of the given type, initialized with the given
arguments
@throws NoSuchConstructorException
if there is... | [
"Create",
"an",
"object",
"of",
"the",
"given",
"type",
"using",
"a",
"constructor",
"that",
"matches",
"the",
"supplied",
"arguments",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/ReflectionUtils.java#L118-L121 |
162,115 | gresrun/jesque | src/main/java/net/greghaines/jesque/utils/ReflectionUtils.java | ReflectionUtils.createObject | public static <T> T createObject(final Class<T> clazz, final Object[] args, final Map<String,Object> vars)
throws NoSuchConstructorException, AmbiguousConstructorException, ReflectiveOperationException {
return invokeSetters(findConstructor(clazz, args).newInstance(args), vars);
} | java | public static <T> T createObject(final Class<T> clazz, final Object[] args, final Map<String,Object> vars)
throws NoSuchConstructorException, AmbiguousConstructorException, ReflectiveOperationException {
return invokeSetters(findConstructor(clazz, args).newInstance(args), vars);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"createObject",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
",",
"final",
"Object",
"[",
"]",
"args",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"vars",
")",
"throws",
"NoSuchConstructorException",
... | Create an object of the given type using a constructor that matches the
supplied arguments and invoke the setters with the supplied variables.
@param <T> the object type
@param clazz
the type to create
@param args
the arguments to the constructor
@param vars
the named arguments for setters
@return a new object of the ... | [
"Create",
"an",
"object",
"of",
"the",
"given",
"type",
"using",
"a",
"constructor",
"that",
"matches",
"the",
"supplied",
"arguments",
"and",
"invoke",
"the",
"setters",
"with",
"the",
"supplied",
"variables",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/ReflectionUtils.java#L145-L148 |
162,116 | gresrun/jesque | src/main/java/net/greghaines/jesque/utils/ReflectionUtils.java | ReflectionUtils.findConstructor | @SuppressWarnings("rawtypes")
private static <T> Constructor<T> findConstructor(final Class<T> clazz, final Object... args)
throws NoSuchConstructorException, AmbiguousConstructorException {
final Object[] cArgs = (args == null) ? new Object[0] : args;
Constructor<T> constructorToUse = n... | java | @SuppressWarnings("rawtypes")
private static <T> Constructor<T> findConstructor(final Class<T> clazz, final Object... args)
throws NoSuchConstructorException, AmbiguousConstructorException {
final Object[] cArgs = (args == null) ? new Object[0] : args;
Constructor<T> constructorToUse = n... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"private",
"static",
"<",
"T",
">",
"Constructor",
"<",
"T",
">",
"findConstructor",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
",",
"final",
"Object",
"...",
"args",
")",
"throws",
"NoSuchConstructorExc... | Find a Constructor on the given type that matches the given arguments.
@param <T> the object type
@param clazz
the type to create
@param args
the arguments to the constructor
@return a Constructor from the given type that matches the given
arguments
@throws NoSuchConstructorException
if there is not a constructor that... | [
"Find",
"a",
"Constructor",
"on",
"the",
"given",
"type",
"that",
"matches",
"the",
"given",
"arguments",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/ReflectionUtils.java#L167-L208 |
162,117 | gresrun/jesque | src/main/java/net/greghaines/jesque/utils/ReflectionUtils.java | ReflectionUtils.invokeSetters | public static <T> T invokeSetters(final T instance, final Map<String,Object> vars)
throws ReflectiveOperationException {
if (instance != null && vars != null) {
final Class<?> clazz = instance.getClass();
final Method[] methods = clazz.getMethods();
for (final En... | java | public static <T> T invokeSetters(final T instance, final Map<String,Object> vars)
throws ReflectiveOperationException {
if (instance != null && vars != null) {
final Class<?> clazz = instance.getClass();
final Method[] methods = clazz.getMethods();
for (final En... | [
"public",
"static",
"<",
"T",
">",
"T",
"invokeSetters",
"(",
"final",
"T",
"instance",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"vars",
")",
"throws",
"ReflectiveOperationException",
"{",
"if",
"(",
"instance",
"!=",
"null",
"&&",
"vars",
... | Invoke the setters for the given variables on the given instance.
@param <T> the instance type
@param instance the instance to inject with the variables
@param vars the variables to inject
@return the instance
@throws ReflectiveOperationException if there was a problem finding or invoking a setter method | [
"Invoke",
"the",
"setters",
"for",
"the",
"given",
"variables",
"on",
"the",
"given",
"instance",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/ReflectionUtils.java#L462-L485 |
162,118 | gresrun/jesque | src/main/java/net/greghaines/jesque/worker/WorkerImpl.java | WorkerImpl.checkQueues | protected static void checkQueues(final Iterable<String> queues) {
if (queues == null) {
throw new IllegalArgumentException("queues must not be null");
}
for (final String queue : queues) {
if (queue == null || "".equals(queue)) {
throw new IllegalArgument... | java | protected static void checkQueues(final Iterable<String> queues) {
if (queues == null) {
throw new IllegalArgumentException("queues must not be null");
}
for (final String queue : queues) {
if (queue == null || "".equals(queue)) {
throw new IllegalArgument... | [
"protected",
"static",
"void",
"checkQueues",
"(",
"final",
"Iterable",
"<",
"String",
">",
"queues",
")",
"{",
"if",
"(",
"queues",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"queues must not be null\"",
")",
";",
"}",
"for",
... | Verify that the given queues are all valid.
@param queues the given queues | [
"Verify",
"that",
"the",
"given",
"queues",
"are",
"all",
"valid",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/worker/WorkerImpl.java#L101-L110 |
162,119 | gresrun/jesque | src/main/java/net/greghaines/jesque/worker/WorkerImpl.java | WorkerImpl.failMsg | protected String failMsg(final Throwable thrwbl, final String queue, final Job job) throws IOException {
final JobFailure failure = new JobFailure();
failure.setFailedAt(new Date());
failure.setWorker(this.name);
failure.setQueue(queue);
failure.setPayload(job);
failure.s... | java | protected String failMsg(final Throwable thrwbl, final String queue, final Job job) throws IOException {
final JobFailure failure = new JobFailure();
failure.setFailedAt(new Date());
failure.setWorker(this.name);
failure.setQueue(queue);
failure.setPayload(job);
failure.s... | [
"protected",
"String",
"failMsg",
"(",
"final",
"Throwable",
"thrwbl",
",",
"final",
"String",
"queue",
",",
"final",
"Job",
"job",
")",
"throws",
"IOException",
"{",
"final",
"JobFailure",
"failure",
"=",
"new",
"JobFailure",
"(",
")",
";",
"failure",
".",
... | Create and serialize a JobFailure.
@param thrwbl the Throwable that occurred
@param queue the queue the job came from
@param job the Job that failed
@return the JSON representation of a new JobFailure
@throws IOException if there was an error serializing the JobFailure | [
"Create",
"and",
"serialize",
"a",
"JobFailure",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/worker/WorkerImpl.java#L722-L730 |
162,120 | gresrun/jesque | src/main/java/net/greghaines/jesque/worker/WorkerImpl.java | WorkerImpl.statusMsg | protected String statusMsg(final String queue, final Job job) throws IOException {
final WorkerStatus status = new WorkerStatus();
status.setRunAt(new Date());
status.setQueue(queue);
status.setPayload(job);
return ObjectMapperFactory.get().writeValueAsString(status);
} | java | protected String statusMsg(final String queue, final Job job) throws IOException {
final WorkerStatus status = new WorkerStatus();
status.setRunAt(new Date());
status.setQueue(queue);
status.setPayload(job);
return ObjectMapperFactory.get().writeValueAsString(status);
} | [
"protected",
"String",
"statusMsg",
"(",
"final",
"String",
"queue",
",",
"final",
"Job",
"job",
")",
"throws",
"IOException",
"{",
"final",
"WorkerStatus",
"status",
"=",
"new",
"WorkerStatus",
"(",
")",
";",
"status",
".",
"setRunAt",
"(",
"new",
"Date",
... | Create and serialize a WorkerStatus.
@param queue the queue the Job came from
@param job the Job currently being processed
@return the JSON representation of a new WorkerStatus
@throws IOException if there was an error serializing the WorkerStatus | [
"Create",
"and",
"serialize",
"a",
"WorkerStatus",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/worker/WorkerImpl.java#L740-L746 |
162,121 | gresrun/jesque | src/main/java/net/greghaines/jesque/worker/WorkerImpl.java | WorkerImpl.pauseMsg | protected String pauseMsg() throws IOException {
final WorkerStatus status = new WorkerStatus();
status.setRunAt(new Date());
status.setPaused(isPaused());
return ObjectMapperFactory.get().writeValueAsString(status);
} | java | protected String pauseMsg() throws IOException {
final WorkerStatus status = new WorkerStatus();
status.setRunAt(new Date());
status.setPaused(isPaused());
return ObjectMapperFactory.get().writeValueAsString(status);
} | [
"protected",
"String",
"pauseMsg",
"(",
")",
"throws",
"IOException",
"{",
"final",
"WorkerStatus",
"status",
"=",
"new",
"WorkerStatus",
"(",
")",
";",
"status",
".",
"setRunAt",
"(",
"new",
"Date",
"(",
")",
")",
";",
"status",
".",
"setPaused",
"(",
"... | Create and serialize a WorkerStatus for a pause event.
@return the JSON representation of a new WorkerStatus
@throws IOException if there was an error serializing the WorkerStatus | [
"Create",
"and",
"serialize",
"a",
"WorkerStatus",
"for",
"a",
"pause",
"event",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/worker/WorkerImpl.java#L754-L759 |
162,122 | gresrun/jesque | src/main/java/net/greghaines/jesque/worker/WorkerImpl.java | WorkerImpl.createName | protected String createName() {
final StringBuilder buf = new StringBuilder(128);
try {
buf.append(InetAddress.getLocalHost().getHostName()).append(COLON)
.append(ManagementFactory.getRuntimeMXBean().getName().split("@")[0]) // PID
.append('-').append(... | java | protected String createName() {
final StringBuilder buf = new StringBuilder(128);
try {
buf.append(InetAddress.getLocalHost().getHostName()).append(COLON)
.append(ManagementFactory.getRuntimeMXBean().getName().split("@")[0]) // PID
.append('-').append(... | [
"protected",
"String",
"createName",
"(",
")",
"{",
"final",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
"128",
")",
";",
"try",
"{",
"buf",
".",
"append",
"(",
"InetAddress",
".",
"getLocalHost",
"(",
")",
".",
"getHostName",
"(",
")",
")"... | Creates a unique name, suitable for use with Resque.
@return a unique name for this worker | [
"Creates",
"a",
"unique",
"name",
"suitable",
"for",
"use",
"with",
"Resque",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/worker/WorkerImpl.java#L766-L779 |
162,123 | gresrun/jesque | src/main/java/net/greghaines/jesque/worker/WorkerPool.java | WorkerPool.join | @Override
public void join(final long millis) throws InterruptedException {
for (final Thread thread : this.threads) {
thread.join(millis);
}
} | java | @Override
public void join(final long millis) throws InterruptedException {
for (final Thread thread : this.threads) {
thread.join(millis);
}
} | [
"@",
"Override",
"public",
"void",
"join",
"(",
"final",
"long",
"millis",
")",
"throws",
"InterruptedException",
"{",
"for",
"(",
"final",
"Thread",
"thread",
":",
"this",
".",
"threads",
")",
"{",
"thread",
".",
"join",
"(",
"millis",
")",
";",
"}",
... | Join to internal threads and wait millis time per thread or until all
threads are finished if millis is 0.
@param millis the time to wait in milliseconds for the threads to join; a timeout of 0 means to wait forever.
@throws InterruptedException if any thread has interrupted the current thread.
The interrupted status ... | [
"Join",
"to",
"internal",
"threads",
"and",
"wait",
"millis",
"time",
"per",
"thread",
"or",
"until",
"all",
"threads",
"are",
"finished",
"if",
"millis",
"is",
"0",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/worker/WorkerPool.java#L114-L119 |
162,124 | gresrun/jesque | src/main/java/net/greghaines/jesque/admin/AdminImpl.java | AdminImpl.checkChannels | protected static void checkChannels(final Iterable<String> channels) {
if (channels == null) {
throw new IllegalArgumentException("channels must not be null");
}
for (final String channel : channels) {
if (channel == null || "".equals(channel)) {
throw new... | java | protected static void checkChannels(final Iterable<String> channels) {
if (channels == null) {
throw new IllegalArgumentException("channels must not be null");
}
for (final String channel : channels) {
if (channel == null || "".equals(channel)) {
throw new... | [
"protected",
"static",
"void",
"checkChannels",
"(",
"final",
"Iterable",
"<",
"String",
">",
"channels",
")",
"{",
"if",
"(",
"channels",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"channels must not be null\"",
")",
";",
"}",
... | Verify that the given channels are all valid.
@param channels
the given channels | [
"Verify",
"that",
"the",
"given",
"channels",
"are",
"all",
"valid",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/admin/AdminImpl.java#L395-L404 |
162,125 | gresrun/jesque | src/main/java/net/greghaines/jesque/utils/PoolUtils.java | PoolUtils.doWorkInPool | public static <V> V doWorkInPool(final Pool<Jedis> pool, final PoolWork<Jedis, V> work) throws Exception {
if (pool == null) {
throw new IllegalArgumentException("pool must not be null");
}
if (work == null) {
throw new IllegalArgumentException("work must not be null");
... | java | public static <V> V doWorkInPool(final Pool<Jedis> pool, final PoolWork<Jedis, V> work) throws Exception {
if (pool == null) {
throw new IllegalArgumentException("pool must not be null");
}
if (work == null) {
throw new IllegalArgumentException("work must not be null");
... | [
"public",
"static",
"<",
"V",
">",
"V",
"doWorkInPool",
"(",
"final",
"Pool",
"<",
"Jedis",
">",
"pool",
",",
"final",
"PoolWork",
"<",
"Jedis",
",",
"V",
">",
"work",
")",
"throws",
"Exception",
"{",
"if",
"(",
"pool",
"==",
"null",
")",
"{",
"thr... | Perform the given work with a Jedis connection from the given pool.
@param pool the resource pool
@param work the work to perform
@param <V> the result type
@return the result of the given work
@throws Exception if something went wrong | [
"Perform",
"the",
"given",
"work",
"with",
"a",
"Jedis",
"connection",
"from",
"the",
"given",
"pool",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/PoolUtils.java#L42-L57 |
162,126 | gresrun/jesque | src/main/java/net/greghaines/jesque/utils/PoolUtils.java | PoolUtils.doWorkInPoolNicely | public static <V> V doWorkInPoolNicely(final Pool<Jedis> pool, final PoolWork<Jedis, V> work) {
final V result;
try {
result = doWorkInPool(pool, work);
} catch (RuntimeException re) {
throw re;
} catch (Exception e) {
throw new RuntimeException(e);
... | java | public static <V> V doWorkInPoolNicely(final Pool<Jedis> pool, final PoolWork<Jedis, V> work) {
final V result;
try {
result = doWorkInPool(pool, work);
} catch (RuntimeException re) {
throw re;
} catch (Exception e) {
throw new RuntimeException(e);
... | [
"public",
"static",
"<",
"V",
">",
"V",
"doWorkInPoolNicely",
"(",
"final",
"Pool",
"<",
"Jedis",
">",
"pool",
",",
"final",
"PoolWork",
"<",
"Jedis",
",",
"V",
">",
"work",
")",
"{",
"final",
"V",
"result",
";",
"try",
"{",
"result",
"=",
"doWorkInP... | Perform the given work with a Jedis connection from the given pool.
Wraps any thrown checked exceptions in a RuntimeException.
@param pool the resource pool
@param work the work to perform
@param <V> the result type
@return the result of the given work | [
"Perform",
"the",
"given",
"work",
"with",
"a",
"Jedis",
"connection",
"from",
"the",
"given",
"pool",
".",
"Wraps",
"any",
"thrown",
"checked",
"exceptions",
"in",
"a",
"RuntimeException",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/PoolUtils.java#L68-L78 |
162,127 | gresrun/jesque | src/main/java/net/greghaines/jesque/utils/PoolUtils.java | PoolUtils.createJedisPool | public static Pool<Jedis> createJedisPool(final Config jesqueConfig, final GenericObjectPoolConfig poolConfig) {
if (jesqueConfig == null) {
throw new IllegalArgumentException("jesqueConfig must not be null");
}
if (poolConfig == null) {
throw new IllegalArgumentException... | java | public static Pool<Jedis> createJedisPool(final Config jesqueConfig, final GenericObjectPoolConfig poolConfig) {
if (jesqueConfig == null) {
throw new IllegalArgumentException("jesqueConfig must not be null");
}
if (poolConfig == null) {
throw new IllegalArgumentException... | [
"public",
"static",
"Pool",
"<",
"Jedis",
">",
"createJedisPool",
"(",
"final",
"Config",
"jesqueConfig",
",",
"final",
"GenericObjectPoolConfig",
"poolConfig",
")",
"{",
"if",
"(",
"jesqueConfig",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException"... | A simple helper method that creates a pool of connections to Redis using
the supplied configurations.
@param jesqueConfig the config used to create the pooled Jedis connections
@param poolConfig the config used to create the pool
@return a configured Pool of Jedis connections | [
"A",
"simple",
"helper",
"method",
"that",
"creates",
"a",
"pool",
"of",
"connections",
"to",
"Redis",
"using",
"the",
"supplied",
"configurations",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/PoolUtils.java#L114-L129 |
162,128 | gresrun/jesque | src/main/java/net/greghaines/jesque/client/AbstractClient.java | AbstractClient.doEnqueue | public static void doEnqueue(final Jedis jedis, final String namespace, final String queue, final String jobJson) {
jedis.sadd(JesqueUtils.createKey(namespace, QUEUES), queue);
jedis.rpush(JesqueUtils.createKey(namespace, QUEUE, queue), jobJson);
} | java | public static void doEnqueue(final Jedis jedis, final String namespace, final String queue, final String jobJson) {
jedis.sadd(JesqueUtils.createKey(namespace, QUEUES), queue);
jedis.rpush(JesqueUtils.createKey(namespace, QUEUE, queue), jobJson);
} | [
"public",
"static",
"void",
"doEnqueue",
"(",
"final",
"Jedis",
"jedis",
",",
"final",
"String",
"namespace",
",",
"final",
"String",
"queue",
",",
"final",
"String",
"jobJson",
")",
"{",
"jedis",
".",
"sadd",
"(",
"JesqueUtils",
".",
"createKey",
"(",
"na... | Helper method that encapsulates the minimum logic for adding a job to a
queue.
@param jedis
the connection to Redis
@param namespace
the Resque namespace
@param queue
the Resque queue name
@param jobJson
the job serialized as JSON | [
"Helper",
"method",
"that",
"encapsulates",
"the",
"minimum",
"logic",
"for",
"adding",
"a",
"job",
"to",
"a",
"queue",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/client/AbstractClient.java#L217-L220 |
162,129 | gresrun/jesque | src/main/java/net/greghaines/jesque/client/AbstractClient.java | AbstractClient.doBatchEnqueue | public static void doBatchEnqueue(final Jedis jedis, final String namespace, final String queue, final List<String> jobJsons) {
Pipeline pipelined = jedis.pipelined();
pipelined.sadd(JesqueUtils.createKey(namespace, QUEUES), queue);
for (String jobJson : jobJsons) {
pipelined.rpush(J... | java | public static void doBatchEnqueue(final Jedis jedis, final String namespace, final String queue, final List<String> jobJsons) {
Pipeline pipelined = jedis.pipelined();
pipelined.sadd(JesqueUtils.createKey(namespace, QUEUES), queue);
for (String jobJson : jobJsons) {
pipelined.rpush(J... | [
"public",
"static",
"void",
"doBatchEnqueue",
"(",
"final",
"Jedis",
"jedis",
",",
"final",
"String",
"namespace",
",",
"final",
"String",
"queue",
",",
"final",
"List",
"<",
"String",
">",
"jobJsons",
")",
"{",
"Pipeline",
"pipelined",
"=",
"jedis",
".",
... | Helper method that encapsulates the minimum logic for adding jobs to a queue.
@param jedis
the connection to Redis
@param namespace
the Resque namespace
@param queue
the Resque queue name
@param jobJsons
a list of jobs serialized as JSON | [
"Helper",
"method",
"that",
"encapsulates",
"the",
"minimum",
"logic",
"for",
"adding",
"jobs",
"to",
"a",
"queue",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/client/AbstractClient.java#L234-L241 |
162,130 | gresrun/jesque | src/main/java/net/greghaines/jesque/client/AbstractClient.java | AbstractClient.doPriorityEnqueue | public static void doPriorityEnqueue(final Jedis jedis, final String namespace, final String queue, final String jobJson) {
jedis.sadd(JesqueUtils.createKey(namespace, QUEUES), queue);
jedis.lpush(JesqueUtils.createKey(namespace, QUEUE, queue), jobJson);
} | java | public static void doPriorityEnqueue(final Jedis jedis, final String namespace, final String queue, final String jobJson) {
jedis.sadd(JesqueUtils.createKey(namespace, QUEUES), queue);
jedis.lpush(JesqueUtils.createKey(namespace, QUEUE, queue), jobJson);
} | [
"public",
"static",
"void",
"doPriorityEnqueue",
"(",
"final",
"Jedis",
"jedis",
",",
"final",
"String",
"namespace",
",",
"final",
"String",
"queue",
",",
"final",
"String",
"jobJson",
")",
"{",
"jedis",
".",
"sadd",
"(",
"JesqueUtils",
".",
"createKey",
"(... | Helper method that encapsulates the minimum logic for adding a high
priority job to a queue.
@param jedis
the connection to Redis
@param namespace
the Resque namespace
@param queue
the Resque queue name
@param jobJson
the job serialized as JSON | [
"Helper",
"method",
"that",
"encapsulates",
"the",
"minimum",
"logic",
"for",
"adding",
"a",
"high",
"priority",
"job",
"to",
"a",
"queue",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/client/AbstractClient.java#L256-L259 |
162,131 | gresrun/jesque | src/main/java/net/greghaines/jesque/client/AbstractClient.java | AbstractClient.doAcquireLock | public static boolean doAcquireLock(final Jedis jedis, final String namespace, final String lockName, final String lockHolder, final int timeout) {
final String key = JesqueUtils.createKey(namespace, lockName);
// If lock already exists, extend it
String existingLockHolder = jedis.get(key);
... | java | public static boolean doAcquireLock(final Jedis jedis, final String namespace, final String lockName, final String lockHolder, final int timeout) {
final String key = JesqueUtils.createKey(namespace, lockName);
// If lock already exists, extend it
String existingLockHolder = jedis.get(key);
... | [
"public",
"static",
"boolean",
"doAcquireLock",
"(",
"final",
"Jedis",
"jedis",
",",
"final",
"String",
"namespace",
",",
"final",
"String",
"lockName",
",",
"final",
"String",
"lockHolder",
",",
"final",
"int",
"timeout",
")",
"{",
"final",
"String",
"key",
... | Helper method that encapsulates the logic to acquire a lock.
@param jedis
the connection to Redis
@param namespace
the Resque namespace
@param lockName
all calls to this method will contend for a unique lock with
the name of lockName
@param timeout
seconds until the lock will expire
@param lockHolder
a unique string u... | [
"Helper",
"method",
"that",
"encapsulates",
"the",
"logic",
"to",
"acquire",
"a",
"lock",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/client/AbstractClient.java#L278-L331 |
162,132 | gresrun/jesque | src/main/java/net/greghaines/jesque/ConfigBuilder.java | ConfigBuilder.withHost | public ConfigBuilder withHost(final String host) {
if (host == null || "".equals(host)) {
throw new IllegalArgumentException("host must not be null or empty: " + host);
}
this.host = host;
return this;
} | java | public ConfigBuilder withHost(final String host) {
if (host == null || "".equals(host)) {
throw new IllegalArgumentException("host must not be null or empty: " + host);
}
this.host = host;
return this;
} | [
"public",
"ConfigBuilder",
"withHost",
"(",
"final",
"String",
"host",
")",
"{",
"if",
"(",
"host",
"==",
"null",
"||",
"\"\"",
".",
"equals",
"(",
"host",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"host must not be null or empty: \"",
... | Configs created by this ConfigBuilder will have the given Redis hostname.
@param host the Redis hostname
@return this ConfigBuilder | [
"Configs",
"created",
"by",
"this",
"ConfigBuilder",
"will",
"have",
"the",
"given",
"Redis",
"hostname",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/ConfigBuilder.java#L97-L103 |
162,133 | gresrun/jesque | src/main/java/net/greghaines/jesque/ConfigBuilder.java | ConfigBuilder.withSentinels | public ConfigBuilder withSentinels(final Set<String> sentinels) {
if (sentinels == null || sentinels.size() < 1) {
throw new IllegalArgumentException("sentinels is null or empty: " + sentinels);
}
this.sentinels = sentinels;
return this;
} | java | public ConfigBuilder withSentinels(final Set<String> sentinels) {
if (sentinels == null || sentinels.size() < 1) {
throw new IllegalArgumentException("sentinels is null or empty: " + sentinels);
}
this.sentinels = sentinels;
return this;
} | [
"public",
"ConfigBuilder",
"withSentinels",
"(",
"final",
"Set",
"<",
"String",
">",
"sentinels",
")",
"{",
"if",
"(",
"sentinels",
"==",
"null",
"||",
"sentinels",
".",
"size",
"(",
")",
"<",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",... | Configs created by this ConfigBuilder will use the given Redis sentinels.
@param sentinels the Redis set of sentinels
@return this ConfigBuilder | [
"Configs",
"created",
"by",
"this",
"ConfigBuilder",
"will",
"use",
"the",
"given",
"Redis",
"sentinels",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/ConfigBuilder.java#L182-L188 |
162,134 | gresrun/jesque | src/main/java/net/greghaines/jesque/ConfigBuilder.java | ConfigBuilder.withMasterName | public ConfigBuilder withMasterName(final String masterName) {
if (masterName == null || "".equals(masterName)) {
throw new IllegalArgumentException("masterName is null or empty: " + masterName);
}
this.masterName = masterName;
return this;
} | java | public ConfigBuilder withMasterName(final String masterName) {
if (masterName == null || "".equals(masterName)) {
throw new IllegalArgumentException("masterName is null or empty: " + masterName);
}
this.masterName = masterName;
return this;
} | [
"public",
"ConfigBuilder",
"withMasterName",
"(",
"final",
"String",
"masterName",
")",
"{",
"if",
"(",
"masterName",
"==",
"null",
"||",
"\"\"",
".",
"equals",
"(",
"masterName",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"masterName is n... | Configs created by this ConfigBuilder will use the given Redis master name.
@param masterName the Redis set of sentinels
@return this ConfigBuilder | [
"Configs",
"created",
"by",
"this",
"ConfigBuilder",
"will",
"use",
"the",
"given",
"Redis",
"master",
"name",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/ConfigBuilder.java#L196-L202 |
162,135 | gresrun/jesque | src/main/java/net/greghaines/jesque/utils/JedisUtils.java | JedisUtils.ensureJedisConnection | public static boolean ensureJedisConnection(final Jedis jedis) {
final boolean jedisOK = testJedisConnection(jedis);
if (!jedisOK) {
try {
jedis.quit();
} catch (Exception e) {
} // Ignore
try {
jedis.disconnect();
... | java | public static boolean ensureJedisConnection(final Jedis jedis) {
final boolean jedisOK = testJedisConnection(jedis);
if (!jedisOK) {
try {
jedis.quit();
} catch (Exception e) {
} // Ignore
try {
jedis.disconnect();
... | [
"public",
"static",
"boolean",
"ensureJedisConnection",
"(",
"final",
"Jedis",
"jedis",
")",
"{",
"final",
"boolean",
"jedisOK",
"=",
"testJedisConnection",
"(",
"jedis",
")",
";",
"if",
"(",
"!",
"jedisOK",
")",
"{",
"try",
"{",
"jedis",
".",
"quit",
"(",... | Ensure that the given connection is established.
@param jedis
a connection to Redis
@return true if the supplied connection was already connected | [
"Ensure",
"that",
"the",
"given",
"connection",
"is",
"established",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/JedisUtils.java#L47-L61 |
162,136 | gresrun/jesque | src/main/java/net/greghaines/jesque/utils/JedisUtils.java | JedisUtils.reconnect | public static boolean reconnect(final Jedis jedis, final int reconAttempts, final long reconnectSleepTime) {
int i = 1;
do {
try {
jedis.disconnect();
try {
Thread.sleep(reconnectSleepTime);
} catch (Exception e2) {
... | java | public static boolean reconnect(final Jedis jedis, final int reconAttempts, final long reconnectSleepTime) {
int i = 1;
do {
try {
jedis.disconnect();
try {
Thread.sleep(reconnectSleepTime);
} catch (Exception e2) {
... | [
"public",
"static",
"boolean",
"reconnect",
"(",
"final",
"Jedis",
"jedis",
",",
"final",
"int",
"reconAttempts",
",",
"final",
"long",
"reconnectSleepTime",
")",
"{",
"int",
"i",
"=",
"1",
";",
"do",
"{",
"try",
"{",
"jedis",
".",
"disconnect",
"(",
")"... | Attempt to reconnect to Redis.
@param jedis
the connection to Redis
@param reconAttempts
number of times to attempt to reconnect before giving up
@param reconnectSleepTime
time in milliseconds to wait between attempts
@return true if reconnection was successful | [
"Attempt",
"to",
"reconnect",
"to",
"Redis",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/JedisUtils.java#L91-L108 |
162,137 | gresrun/jesque | src/main/java/net/greghaines/jesque/utils/JedisUtils.java | JedisUtils.isRegularQueue | public static boolean isRegularQueue(final Jedis jedis, final String key) {
return LIST.equalsIgnoreCase(jedis.type(key));
} | java | public static boolean isRegularQueue(final Jedis jedis, final String key) {
return LIST.equalsIgnoreCase(jedis.type(key));
} | [
"public",
"static",
"boolean",
"isRegularQueue",
"(",
"final",
"Jedis",
"jedis",
",",
"final",
"String",
"key",
")",
"{",
"return",
"LIST",
".",
"equalsIgnoreCase",
"(",
"jedis",
".",
"type",
"(",
"key",
")",
")",
";",
"}"
] | Determines if the queue identified by the given key is a regular queue.
@param jedis
connection to Redis
@param key
the key that identifies a queue
@return true if the key identifies a regular queue, false otherwise | [
"Determines",
"if",
"the",
"queue",
"identified",
"by",
"the",
"given",
"key",
"is",
"a",
"regular",
"queue",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/JedisUtils.java#L119-L121 |
162,138 | gresrun/jesque | src/main/java/net/greghaines/jesque/utils/JedisUtils.java | JedisUtils.isDelayedQueue | public static boolean isDelayedQueue(final Jedis jedis, final String key) {
return ZSET.equalsIgnoreCase(jedis.type(key));
} | java | public static boolean isDelayedQueue(final Jedis jedis, final String key) {
return ZSET.equalsIgnoreCase(jedis.type(key));
} | [
"public",
"static",
"boolean",
"isDelayedQueue",
"(",
"final",
"Jedis",
"jedis",
",",
"final",
"String",
"key",
")",
"{",
"return",
"ZSET",
".",
"equalsIgnoreCase",
"(",
"jedis",
".",
"type",
"(",
"key",
")",
")",
";",
"}"
] | Determines if the queue identified by the given key is a delayed queue.
@param jedis
connection to Redis
@param key
the key that identifies a queue
@return true if the key identifies a delayed queue, false otherwise | [
"Determines",
"if",
"the",
"queue",
"identified",
"by",
"the",
"given",
"key",
"is",
"a",
"delayed",
"queue",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/JedisUtils.java#L132-L134 |
162,139 | gresrun/jesque | src/main/java/net/greghaines/jesque/utils/JedisUtils.java | JedisUtils.isKeyUsed | public static boolean isKeyUsed(final Jedis jedis, final String key) {
return !NONE.equalsIgnoreCase(jedis.type(key));
} | java | public static boolean isKeyUsed(final Jedis jedis, final String key) {
return !NONE.equalsIgnoreCase(jedis.type(key));
} | [
"public",
"static",
"boolean",
"isKeyUsed",
"(",
"final",
"Jedis",
"jedis",
",",
"final",
"String",
"key",
")",
"{",
"return",
"!",
"NONE",
".",
"equalsIgnoreCase",
"(",
"jedis",
".",
"type",
"(",
"key",
")",
")",
";",
"}"
] | Determines if the queue identified by the given key is used.
@param jedis
connection to Redis
@param key
the key that identifies a queue
@return true if the key is used, false otherwise | [
"Determines",
"if",
"the",
"queue",
"identified",
"by",
"the",
"given",
"key",
"is",
"used",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/JedisUtils.java#L150-L152 |
162,140 | gresrun/jesque | src/main/java/net/greghaines/jesque/utils/JedisUtils.java | JedisUtils.canUseAsDelayedQueue | public static boolean canUseAsDelayedQueue(final Jedis jedis, final String key) {
final String type = jedis.type(key);
return (ZSET.equalsIgnoreCase(type) || NONE.equalsIgnoreCase(type));
} | java | public static boolean canUseAsDelayedQueue(final Jedis jedis, final String key) {
final String type = jedis.type(key);
return (ZSET.equalsIgnoreCase(type) || NONE.equalsIgnoreCase(type));
} | [
"public",
"static",
"boolean",
"canUseAsDelayedQueue",
"(",
"final",
"Jedis",
"jedis",
",",
"final",
"String",
"key",
")",
"{",
"final",
"String",
"type",
"=",
"jedis",
".",
"type",
"(",
"key",
")",
";",
"return",
"(",
"ZSET",
".",
"equalsIgnoreCase",
"(",... | Determines if the queue identified by the given key can be used as a delayed queue.
@param jedis
connection to Redis
@param key
the key that identifies a queue
@return true if the key already is a delayed queue or is not currently used, false otherwise | [
"Determines",
"if",
"the",
"queue",
"identified",
"by",
"the",
"given",
"key",
"can",
"be",
"used",
"as",
"a",
"delayed",
"queue",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/JedisUtils.java#L163-L166 |
162,141 | arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/SessionManager.java | SessionManager.createNamespace | public void createNamespace() {
Map<String, String> namespaceAnnotations = annotationProvider.create(session.getId(), Constants.RUNNING_STATUS);
if (namespaceService.exists(session.getNamespace())) {
//namespace exists
} else if (configuration.isNamespaceLazyCreateEnabled()) {
... | java | public void createNamespace() {
Map<String, String> namespaceAnnotations = annotationProvider.create(session.getId(), Constants.RUNNING_STATUS);
if (namespaceService.exists(session.getNamespace())) {
//namespace exists
} else if (configuration.isNamespaceLazyCreateEnabled()) {
... | [
"public",
"void",
"createNamespace",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"namespaceAnnotations",
"=",
"annotationProvider",
".",
"create",
"(",
"session",
".",
"getId",
"(",
")",
",",
"Constants",
".",
"RUNNING_STATUS",
")",
";",
"if",
... | Creates a namespace if needed. | [
"Creates",
"a",
"namespace",
"if",
"needed",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/SessionManager.java#L100-L110 |
162,142 | arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/enricher/KuberntesServiceUrlResourceProvider.java | KuberntesServiceUrlResourceProvider.getPort | private static int getPort(Service service, Annotation... qualifiers) {
for (Annotation q : qualifiers) {
if (q instanceof Port) {
Port port = (Port) q;
if (port.value() > 0) {
return port.value();
}
}
}
... | java | private static int getPort(Service service, Annotation... qualifiers) {
for (Annotation q : qualifiers) {
if (q instanceof Port) {
Port port = (Port) q;
if (port.value() > 0) {
return port.value();
}
}
}
... | [
"private",
"static",
"int",
"getPort",
"(",
"Service",
"service",
",",
"Annotation",
"...",
"qualifiers",
")",
"{",
"for",
"(",
"Annotation",
"q",
":",
"qualifiers",
")",
"{",
"if",
"(",
"q",
"instanceof",
"Port",
")",
"{",
"Port",
"port",
"=",
"(",
"P... | Find the the qualified container port of the target service
Uses java annotations first or returns the container port.
@param service
The target service.
@param qualifiers
The set of qualifiers.
@return Returns the resolved containerPort of '0' as a fallback. | [
"Find",
"the",
"the",
"qualified",
"container",
"port",
"of",
"the",
"target",
"service",
"Uses",
"java",
"annotations",
"first",
"or",
"returns",
"the",
"container",
"port",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/enricher/KuberntesServiceUrlResourceProvider.java#L128-L143 |
162,143 | arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/enricher/KuberntesServiceUrlResourceProvider.java | KuberntesServiceUrlResourceProvider.getContainerPort | private static int getContainerPort(Service service, Annotation... qualifiers) {
for (Annotation q : qualifiers) {
if (q instanceof Port) {
Port port = (Port) q;
if (port.value() > 0) {
return port.value();
}
}
}... | java | private static int getContainerPort(Service service, Annotation... qualifiers) {
for (Annotation q : qualifiers) {
if (q instanceof Port) {
Port port = (Port) q;
if (port.value() > 0) {
return port.value();
}
}
}... | [
"private",
"static",
"int",
"getContainerPort",
"(",
"Service",
"service",
",",
"Annotation",
"...",
"qualifiers",
")",
"{",
"for",
"(",
"Annotation",
"q",
":",
"qualifiers",
")",
"{",
"if",
"(",
"q",
"instanceof",
"Port",
")",
"{",
"Port",
"port",
"=",
... | Find the the qualfied container port of the target service
Uses java annotations first or returns the container port.
@param service
The target service.
@param qualifiers
The set of qualifiers.
@return Returns the resolved containerPort of '0' as a fallback. | [
"Find",
"the",
"the",
"qualfied",
"container",
"port",
"of",
"the",
"target",
"service",
"Uses",
"java",
"annotations",
"first",
"or",
"returns",
"the",
"container",
"port",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/enricher/KuberntesServiceUrlResourceProvider.java#L156-L171 |
162,144 | arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/enricher/KuberntesServiceUrlResourceProvider.java | KuberntesServiceUrlResourceProvider.getScheme | private static String getScheme(Service service, Annotation... qualifiers) {
for (Annotation q : qualifiers) {
if (q instanceof Scheme) {
return ((Scheme) q).value();
}
}
if (service.getMetadata() != null && service.getMetadata().getAnnotations() != null)... | java | private static String getScheme(Service service, Annotation... qualifiers) {
for (Annotation q : qualifiers) {
if (q instanceof Scheme) {
return ((Scheme) q).value();
}
}
if (service.getMetadata() != null && service.getMetadata().getAnnotations() != null)... | [
"private",
"static",
"String",
"getScheme",
"(",
"Service",
"service",
",",
"Annotation",
"...",
"qualifiers",
")",
"{",
"for",
"(",
"Annotation",
"q",
":",
"qualifiers",
")",
"{",
"if",
"(",
"q",
"instanceof",
"Scheme",
")",
"{",
"return",
"(",
"(",
"Sc... | Find the scheme to use to connect to the service.
Uses java annotations first and if not found, uses kubernetes annotations on the service object.
@param service
The target service.
@param qualifiers
The set of qualifiers.
@return Returns the resolved scheme of 'http' as a fallback. | [
"Find",
"the",
"scheme",
"to",
"use",
"to",
"connect",
"to",
"the",
"service",
".",
"Uses",
"java",
"annotations",
"first",
"and",
"if",
"not",
"found",
"uses",
"kubernetes",
"annotations",
"on",
"the",
"service",
"object",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/enricher/KuberntesServiceUrlResourceProvider.java#L184-L199 |
162,145 | arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/enricher/KuberntesServiceUrlResourceProvider.java | KuberntesServiceUrlResourceProvider.getPath | private static String getPath(Service service, Annotation... qualifiers) {
for (Annotation q : qualifiers) {
if (q instanceof Scheme) {
return ((Scheme) q).value();
}
}
if (service.getMetadata() != null && service.getMetadata().getAnnotations() != null) {... | java | private static String getPath(Service service, Annotation... qualifiers) {
for (Annotation q : qualifiers) {
if (q instanceof Scheme) {
return ((Scheme) q).value();
}
}
if (service.getMetadata() != null && service.getMetadata().getAnnotations() != null) {... | [
"private",
"static",
"String",
"getPath",
"(",
"Service",
"service",
",",
"Annotation",
"...",
"qualifiers",
")",
"{",
"for",
"(",
"Annotation",
"q",
":",
"qualifiers",
")",
"{",
"if",
"(",
"q",
"instanceof",
"Scheme",
")",
"{",
"return",
"(",
"(",
"Sche... | Find the path to use .
Uses java annotations first and if not found, uses kubernetes annotations on the service object.
@param service
The target service.
@param qualifiers
The set of qualifiers.
@return Returns the resolved path of '/' as a fallback. | [
"Find",
"the",
"path",
"to",
"use",
".",
"Uses",
"java",
"annotations",
"first",
"and",
"if",
"not",
"found",
"uses",
"kubernetes",
"annotations",
"on",
"the",
"service",
"object",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/enricher/KuberntesServiceUrlResourceProvider.java#L212-L226 |
162,146 | arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/enricher/KuberntesServiceUrlResourceProvider.java | KuberntesServiceUrlResourceProvider.getRandomPod | private static Pod getRandomPod(KubernetesClient client, String name, String namespace) {
Endpoints endpoints = client.endpoints().inNamespace(namespace).withName(name).get();
List<String> pods = new ArrayList<>();
if (endpoints != null) {
for (EndpointSubset subset : endpoints.getSu... | java | private static Pod getRandomPod(KubernetesClient client, String name, String namespace) {
Endpoints endpoints = client.endpoints().inNamespace(namespace).withName(name).get();
List<String> pods = new ArrayList<>();
if (endpoints != null) {
for (EndpointSubset subset : endpoints.getSu... | [
"private",
"static",
"Pod",
"getRandomPod",
"(",
"KubernetesClient",
"client",
",",
"String",
"name",
",",
"String",
"namespace",
")",
"{",
"Endpoints",
"endpoints",
"=",
"client",
".",
"endpoints",
"(",
")",
".",
"inNamespace",
"(",
"namespace",
")",
".",
"... | Get a random pod that provides the specified service in the specified namespace.
@param client
The client instance to use.
@param name
The name of the service.
@param namespace
The namespace of the service.
@return The pod or null if no pod matches. | [
"Get",
"a",
"random",
"pod",
"that",
"provides",
"the",
"specified",
"service",
"in",
"the",
"specified",
"namespace",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/enricher/KuberntesServiceUrlResourceProvider.java#L240-L261 |
162,147 | arquillian/arquillian-cube | core/src/main/java/org/arquillian/cube/impl/util/Which.java | Which.classFileUrl | public static URL classFileUrl(Class<?> clazz) throws IOException {
ClassLoader cl = clazz.getClassLoader();
if (cl == null) {
cl = ClassLoader.getSystemClassLoader();
}
URL res = cl.getResource(clazz.getName().replace('.', '/') + ".class");
if (res == null) {
... | java | public static URL classFileUrl(Class<?> clazz) throws IOException {
ClassLoader cl = clazz.getClassLoader();
if (cl == null) {
cl = ClassLoader.getSystemClassLoader();
}
URL res = cl.getResource(clazz.getName().replace('.', '/') + ".class");
if (res == null) {
... | [
"public",
"static",
"URL",
"classFileUrl",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"throws",
"IOException",
"{",
"ClassLoader",
"cl",
"=",
"clazz",
".",
"getClassLoader",
"(",
")",
";",
"if",
"(",
"cl",
"==",
"null",
")",
"{",
"cl",
"=",
"ClassLoade... | Returns the URL of the class file where the given class has been loaded from.
@throws IllegalArgumentException
if failed to determine.
@since 2.24 | [
"Returns",
"the",
"URL",
"of",
"the",
"class",
"file",
"where",
"the",
"given",
"class",
"has",
"been",
"loaded",
"from",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/core/src/main/java/org/arquillian/cube/impl/util/Which.java#L56-L66 |
162,148 | arquillian/arquillian-cube | core/src/main/java/org/arquillian/cube/impl/util/Which.java | Which.decode | private static String decode(String s) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
for (int i = 0; i < s.length(); i++) {
char ch = s.charAt(i);
if (ch == '%') {
baos.write(hexToInt(s.charAt(i + 1)) * 16 + hexToInt(s.charAt(i + 2)));
... | java | private static String decode(String s) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
for (int i = 0; i < s.length(); i++) {
char ch = s.charAt(i);
if (ch == '%') {
baos.write(hexToInt(s.charAt(i + 1)) * 16 + hexToInt(s.charAt(i + 2)));
... | [
"private",
"static",
"String",
"decode",
"(",
"String",
"s",
")",
"{",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"s",
".",
"length",
"(",
")",
";",
"i",
"++",... | Decode '%HH'. | [
"Decode",
"%HH",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/core/src/main/java/org/arquillian/cube/impl/util/Which.java#L239-L255 |
162,149 | arquillian/arquillian-cube | openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/resources/TemplateProcessor.java | TemplateProcessor.processTemplateResources | public List<? super OpenShiftResource> processTemplateResources() {
List<? extends OpenShiftResource> resources;
final List<? super OpenShiftResource> processedResources = new ArrayList<>();
templates = OpenShiftResourceFactory.getTemplates(getType());
boolean sync_instantiation = OpenSh... | java | public List<? super OpenShiftResource> processTemplateResources() {
List<? extends OpenShiftResource> resources;
final List<? super OpenShiftResource> processedResources = new ArrayList<>();
templates = OpenShiftResourceFactory.getTemplates(getType());
boolean sync_instantiation = OpenSh... | [
"public",
"List",
"<",
"?",
"super",
"OpenShiftResource",
">",
"processTemplateResources",
"(",
")",
"{",
"List",
"<",
"?",
"extends",
"OpenShiftResource",
">",
"resources",
";",
"final",
"List",
"<",
"?",
"super",
"OpenShiftResource",
">",
"processedResources",
... | Instantiates the templates specified by @Template within @Templates | [
"Instantiates",
"the",
"templates",
"specified",
"by"
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/resources/TemplateProcessor.java#L47-L72 |
162,150 | arquillian/arquillian-cube | docker/docker/src/main/java/org/arquillian/cube/docker/impl/docker/DockerClientExecutor.java | DockerClientExecutor.execStartVerbose | public ExecInspection execStartVerbose(String containerId, String... commands) {
this.readWriteLock.readLock().lock();
try {
String id = execCreate(containerId, commands);
CubeOutput output = execStartOutput(id);
return new ExecInspection(output, inspectExec(id));
... | java | public ExecInspection execStartVerbose(String containerId, String... commands) {
this.readWriteLock.readLock().lock();
try {
String id = execCreate(containerId, commands);
CubeOutput output = execStartOutput(id);
return new ExecInspection(output, inspectExec(id));
... | [
"public",
"ExecInspection",
"execStartVerbose",
"(",
"String",
"containerId",
",",
"String",
"...",
"commands",
")",
"{",
"this",
".",
"readWriteLock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"String",
"id",
"=",
"execCreate",
"(... | EXecutes command to given container returning the inspection object as well. This method does 3 calls to
dockerhost. Create, Start and Inspect.
@param containerId
to execute command. | [
"EXecutes",
"command",
"to",
"given",
"container",
"returning",
"the",
"inspection",
"object",
"as",
"well",
".",
"This",
"method",
"does",
"3",
"calls",
"to",
"dockerhost",
".",
"Create",
"Start",
"and",
"Inspect",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/docker/docker/src/main/java/org/arquillian/cube/docker/impl/docker/DockerClientExecutor.java#L928-L938 |
162,151 | arquillian/arquillian-cube | openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/resources/OpenShiftResourceFactory.java | OpenShiftResourceFactory.createImageStreamRequest | private static String createImageStreamRequest(String name, String version, String image, boolean insecure) {
JSONObject imageStream = new JSONObject();
JSONObject metadata = new JSONObject();
JSONObject annotations = new JSONObject();
metadata.put("name", name);
annotations.put... | java | private static String createImageStreamRequest(String name, String version, String image, boolean insecure) {
JSONObject imageStream = new JSONObject();
JSONObject metadata = new JSONObject();
JSONObject annotations = new JSONObject();
metadata.put("name", name);
annotations.put... | [
"private",
"static",
"String",
"createImageStreamRequest",
"(",
"String",
"name",
",",
"String",
"version",
",",
"String",
"image",
",",
"boolean",
"insecure",
")",
"{",
"JSONObject",
"imageStream",
"=",
"new",
"JSONObject",
"(",
")",
";",
"JSONObject",
"metadat... | Creates image stream request and returns it in JSON formatted string.
@param name Name of the image stream
@param insecure If the registry where the image is stored is insecure
@param image Image name, includes registry information and tag
@param version Image stream version.
@return JSON formatted string | [
"Creates",
"image",
"stream",
"request",
"and",
"returns",
"it",
"in",
"JSON",
"formatted",
"string",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/resources/OpenShiftResourceFactory.java#L159-L198 |
162,152 | arquillian/arquillian-cube | openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/resources/OpenShiftResourceFactory.java | OpenShiftResourceFactory.getTemplates | static <T> List<Template> getTemplates(T objectType) {
try {
List<Template> templates = new ArrayList<>();
TEMP_FINDER.findAnnotations(templates, objectType);
return templates;
} catch (Exception e) {
throw new IllegalStateException(e);
}
} | java | static <T> List<Template> getTemplates(T objectType) {
try {
List<Template> templates = new ArrayList<>();
TEMP_FINDER.findAnnotations(templates, objectType);
return templates;
} catch (Exception e) {
throw new IllegalStateException(e);
}
} | [
"static",
"<",
"T",
">",
"List",
"<",
"Template",
">",
"getTemplates",
"(",
"T",
"objectType",
")",
"{",
"try",
"{",
"List",
"<",
"Template",
">",
"templates",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"TEMP_FINDER",
".",
"findAnnotations",
"(",
"t... | Aggregates a list of templates specified by @Template | [
"Aggregates",
"a",
"list",
"of",
"templates",
"specified",
"by"
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/resources/OpenShiftResourceFactory.java#L203-L211 |
162,153 | arquillian/arquillian-cube | openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/resources/OpenShiftResourceFactory.java | OpenShiftResourceFactory.syncInstantiation | static <T> boolean syncInstantiation(T objectType) {
List<Template> templates = new ArrayList<>();
Templates tr = TEMP_FINDER.findAnnotations(templates, objectType);
if (tr == null) {
/* Default to synchronous instantiation */
return true;
} else {
ret... | java | static <T> boolean syncInstantiation(T objectType) {
List<Template> templates = new ArrayList<>();
Templates tr = TEMP_FINDER.findAnnotations(templates, objectType);
if (tr == null) {
/* Default to synchronous instantiation */
return true;
} else {
ret... | [
"static",
"<",
"T",
">",
"boolean",
"syncInstantiation",
"(",
"T",
"objectType",
")",
"{",
"List",
"<",
"Template",
">",
"templates",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Templates",
"tr",
"=",
"TEMP_FINDER",
".",
"findAnnotations",
"(",
"templat... | Returns true if templates are to be instantiated synchronously and false if
asynchronously. | [
"Returns",
"true",
"if",
"templates",
"are",
"to",
"be",
"instantiated",
"synchronously",
"and",
"false",
"if",
"asynchronously",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/resources/OpenShiftResourceFactory.java#L217-L226 |
162,154 | arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java | KubernetesAssistant.deployApplication | public void deployApplication(String applicationName, String... classpathLocations) throws IOException {
final List<URL> classpathElements = Arrays.stream(classpathLocations)
.map(classpath -> Thread.currentThread().getContextClassLoader().getResource(classpath))
.collect(Collectors.toL... | java | public void deployApplication(String applicationName, String... classpathLocations) throws IOException {
final List<URL> classpathElements = Arrays.stream(classpathLocations)
.map(classpath -> Thread.currentThread().getContextClassLoader().getResource(classpath))
.collect(Collectors.toL... | [
"public",
"void",
"deployApplication",
"(",
"String",
"applicationName",
",",
"String",
"...",
"classpathLocations",
")",
"throws",
"IOException",
"{",
"final",
"List",
"<",
"URL",
">",
"classpathElements",
"=",
"Arrays",
".",
"stream",
"(",
"classpathLocations",
... | Deploys application reading resources from specified classpath location
@param applicationName to configure in cluster
@param classpathLocations where resources are read
@throws IOException | [
"Deploys",
"application",
"reading",
"resources",
"from",
"specified",
"classpath",
"location"
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java#L107-L114 |
162,155 | arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java | KubernetesAssistant.deployApplication | public void deployApplication(String applicationName, URL... urls) throws IOException {
this.applicationName = applicationName;
for (URL url : urls) {
try (InputStream inputStream = url.openStream()) {
deploy(inputStream);
}
}
} | java | public void deployApplication(String applicationName, URL... urls) throws IOException {
this.applicationName = applicationName;
for (URL url : urls) {
try (InputStream inputStream = url.openStream()) {
deploy(inputStream);
}
}
} | [
"public",
"void",
"deployApplication",
"(",
"String",
"applicationName",
",",
"URL",
"...",
"urls",
")",
"throws",
"IOException",
"{",
"this",
".",
"applicationName",
"=",
"applicationName",
";",
"for",
"(",
"URL",
"url",
":",
"urls",
")",
"{",
"try",
"(",
... | Deploys application reading resources from specified URLs
@param applicationName to configure in cluster
@param urls where resources are read
@return the name of the application
@throws IOException | [
"Deploys",
"application",
"reading",
"resources",
"from",
"specified",
"URLs"
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java#L136-L144 |
162,156 | arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java | KubernetesAssistant.deploy | public void deploy(InputStream inputStream) throws IOException {
final List<? extends HasMetadata> entities = deploy("application", inputStream);
if (this.applicationName == null) {
Optional<String> deployment = entities.stream()
.filter(hm -> hm instanceof Deployment)
... | java | public void deploy(InputStream inputStream) throws IOException {
final List<? extends HasMetadata> entities = deploy("application", inputStream);
if (this.applicationName == null) {
Optional<String> deployment = entities.stream()
.filter(hm -> hm instanceof Deployment)
... | [
"public",
"void",
"deploy",
"(",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"final",
"List",
"<",
"?",
"extends",
"HasMetadata",
">",
"entities",
"=",
"deploy",
"(",
"\"application\"",
",",
"inputStream",
")",
";",
"if",
"(",
"this",
".... | Deploys application reading resources from specified InputStream
@param inputStream where resources are read
@throws IOException | [
"Deploys",
"application",
"reading",
"resources",
"from",
"specified",
"InputStream"
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java#L231-L243 |
162,157 | arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java | KubernetesAssistant.getServiceUrl | public Optional<URL> getServiceUrl(String name) {
Service service = client.services().inNamespace(namespace).withName(name).get();
return service != null ? createUrlForService(service) : Optional.empty();
} | java | public Optional<URL> getServiceUrl(String name) {
Service service = client.services().inNamespace(namespace).withName(name).get();
return service != null ? createUrlForService(service) : Optional.empty();
} | [
"public",
"Optional",
"<",
"URL",
">",
"getServiceUrl",
"(",
"String",
"name",
")",
"{",
"Service",
"service",
"=",
"client",
".",
"services",
"(",
")",
".",
"inNamespace",
"(",
"namespace",
")",
".",
"withName",
"(",
"name",
")",
".",
"get",
"(",
")",... | Gets the URL of the service with the given name that has been created during the current session.
@param name to return its URL
@return URL of the service. | [
"Gets",
"the",
"URL",
"of",
"the",
"service",
"with",
"the",
"given",
"name",
"that",
"has",
"been",
"created",
"during",
"the",
"current",
"session",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java#L263-L266 |
162,158 | arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java | KubernetesAssistant.getServiceUrl | public Optional<URL> getServiceUrl() {
Optional<Service> optionalService = client.services().inNamespace(namespace)
.list().getItems()
.stream()
.findFirst();
return optionalService
.map(this::createUrlForService)
.orElse(Optional.empty());
... | java | public Optional<URL> getServiceUrl() {
Optional<Service> optionalService = client.services().inNamespace(namespace)
.list().getItems()
.stream()
.findFirst();
return optionalService
.map(this::createUrlForService)
.orElse(Optional.empty());
... | [
"public",
"Optional",
"<",
"URL",
">",
"getServiceUrl",
"(",
")",
"{",
"Optional",
"<",
"Service",
">",
"optionalService",
"=",
"client",
".",
"services",
"(",
")",
".",
"inNamespace",
"(",
"namespace",
")",
".",
"list",
"(",
")",
".",
"getItems",
"(",
... | Gets the URL of the first service that have been created during the current session.
@return URL of the first service. | [
"Gets",
"the",
"URL",
"of",
"the",
"first",
"service",
"that",
"have",
"been",
"created",
"during",
"the",
"current",
"session",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java#L273-L282 |
162,159 | arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java | KubernetesAssistant.cleanup | public void cleanup() {
List<String> keys = new ArrayList<>(created.keySet());
keys.sort(String::compareTo);
for (String key : keys) {
created.remove(key)
.stream()
.sorted(Comparator.comparing(HasMetadata::getKind))
.forEach(metadata -... | java | public void cleanup() {
List<String> keys = new ArrayList<>(created.keySet());
keys.sort(String::compareTo);
for (String key : keys) {
created.remove(key)
.stream()
.sorted(Comparator.comparing(HasMetadata::getKind))
.forEach(metadata -... | [
"public",
"void",
"cleanup",
"(",
")",
"{",
"List",
"<",
"String",
">",
"keys",
"=",
"new",
"ArrayList",
"<>",
"(",
"created",
".",
"keySet",
"(",
")",
")",
";",
"keys",
".",
"sort",
"(",
"String",
"::",
"compareTo",
")",
";",
"for",
"(",
"String",... | Removes all resources deployed using this class. | [
"Removes",
"all",
"resources",
"deployed",
"using",
"this",
"class",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java#L361-L373 |
162,160 | arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java | KubernetesAssistant.awaitPodReadinessOrFail | public void awaitPodReadinessOrFail(Predicate<Pod> filter) {
await().atMost(5, TimeUnit.MINUTES).until(() -> {
List<Pod> list = client.pods().inNamespace(namespace).list().getItems();
return list.stream()
.filter(filter)
.filter(Readiness::... | java | public void awaitPodReadinessOrFail(Predicate<Pod> filter) {
await().atMost(5, TimeUnit.MINUTES).until(() -> {
List<Pod> list = client.pods().inNamespace(namespace).list().getItems();
return list.stream()
.filter(filter)
.filter(Readiness::... | [
"public",
"void",
"awaitPodReadinessOrFail",
"(",
"Predicate",
"<",
"Pod",
">",
"filter",
")",
"{",
"await",
"(",
")",
".",
"atMost",
"(",
"5",
",",
"TimeUnit",
".",
"MINUTES",
")",
".",
"until",
"(",
"(",
")",
"->",
"{",
"List",
"<",
"Pod",
">",
"... | Awaits at most 5 minutes until all pods meets the given predicate.
@param filter used to wait to detect that a pod is up and running. | [
"Awaits",
"at",
"most",
"5",
"minutes",
"until",
"all",
"pods",
"meets",
"the",
"given",
"predicate",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java#L430-L439 |
162,161 | arquillian/arquillian-cube | docker/docker/src/main/java/org/arquillian/cube/docker/impl/requirement/DockerRequirement.java | DockerRequirement.getDockerVersion | private static Version getDockerVersion(String serverUrl) {
try {
DockerClient client = DockerClientBuilder.getInstance(serverUrl).build();
return client.versionCmd().exec();
} catch (Exception e) {
return null;
}
} | java | private static Version getDockerVersion(String serverUrl) {
try {
DockerClient client = DockerClientBuilder.getInstance(serverUrl).build();
return client.versionCmd().exec();
} catch (Exception e) {
return null;
}
} | [
"private",
"static",
"Version",
"getDockerVersion",
"(",
"String",
"serverUrl",
")",
"{",
"try",
"{",
"DockerClient",
"client",
"=",
"DockerClientBuilder",
".",
"getInstance",
"(",
"serverUrl",
")",
".",
"build",
"(",
")",
";",
"return",
"client",
".",
"versio... | Returns the docker version.
@param serverUrl
The serverUrl to use. | [
"Returns",
"the",
"docker",
"version",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/docker/docker/src/main/java/org/arquillian/cube/docker/impl/requirement/DockerRequirement.java#L59-L66 |
162,162 | arquillian/arquillian-cube | core/src/main/java/org/arquillian/cube/impl/client/CubeConfigurator.java | CubeConfigurator.configure | public void configure(@Observes(precedence = -10) ArquillianDescriptor arquillianDescriptor) {
Map<String, String> config = arquillianDescriptor.extension(EXTENSION_NAME).getExtensionProperties();
CubeConfiguration cubeConfiguration = CubeConfiguration.fromMap(config);
configurationProducer.set(... | java | public void configure(@Observes(precedence = -10) ArquillianDescriptor arquillianDescriptor) {
Map<String, String> config = arquillianDescriptor.extension(EXTENSION_NAME).getExtensionProperties();
CubeConfiguration cubeConfiguration = CubeConfiguration.fromMap(config);
configurationProducer.set(... | [
"public",
"void",
"configure",
"(",
"@",
"Observes",
"(",
"precedence",
"=",
"-",
"10",
")",
"ArquillianDescriptor",
"arquillianDescriptor",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"config",
"=",
"arquillianDescriptor",
".",
"extension",
"(",
"EXTE... | Add precedence -10 because we need that ContainerRegistry is available in the Arquillian scope. | [
"Add",
"precedence",
"-",
"10",
"because",
"we",
"need",
"that",
"ContainerRegistry",
"is",
"available",
"in",
"the",
"Arquillian",
"scope",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/core/src/main/java/org/arquillian/cube/impl/client/CubeConfigurator.java#L20-L24 |
162,163 | arquillian/arquillian-cube | openshift/openshift-restassured/src/main/java/org/arquillian/cube/openshift/restassured/RestAssuredConfigurator.java | RestAssuredConfigurator.configure | public void configure(@Observes(precedence = -200) ArquillianDescriptor arquillianDescriptor) {
restAssuredConfigurationInstanceProducer.set(
RestAssuredConfiguration.fromMap(arquillianDescriptor
.extension("restassured")
.getExtensionProperties()));
} | java | public void configure(@Observes(precedence = -200) ArquillianDescriptor arquillianDescriptor) {
restAssuredConfigurationInstanceProducer.set(
RestAssuredConfiguration.fromMap(arquillianDescriptor
.extension("restassured")
.getExtensionProperties()));
} | [
"public",
"void",
"configure",
"(",
"@",
"Observes",
"(",
"precedence",
"=",
"-",
"200",
")",
"ArquillianDescriptor",
"arquillianDescriptor",
")",
"{",
"restAssuredConfigurationInstanceProducer",
".",
"set",
"(",
"RestAssuredConfiguration",
".",
"fromMap",
"(",
"arqui... | required for rest assured base URI configuration. | [
"required",
"for",
"rest",
"assured",
"base",
"URI",
"configuration",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/openshift/openshift-restassured/src/main/java/org/arquillian/cube/openshift/restassured/RestAssuredConfigurator.java#L17-L22 |
162,164 | arquillian/arquillian-cube | docker/docker/src/main/java/org/arquillian/cube/docker/impl/client/CubeDockerConfigurationResolver.java | CubeDockerConfigurationResolver.resolve | public Map<String, String> resolve(Map<String, String> config) {
config = resolveSystemEnvironmentVariables(config);
config = resolveSystemDefaultSetup(config);
config = resolveDockerInsideDocker(config);
config = resolveDownloadDockerMachine(config);
config = resolveAutoStartDoc... | java | public Map<String, String> resolve(Map<String, String> config) {
config = resolveSystemEnvironmentVariables(config);
config = resolveSystemDefaultSetup(config);
config = resolveDockerInsideDocker(config);
config = resolveDownloadDockerMachine(config);
config = resolveAutoStartDoc... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"resolve",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"config",
")",
"{",
"config",
"=",
"resolveSystemEnvironmentVariables",
"(",
"config",
")",
";",
"config",
"=",
"resolveSystemDefaultSetup",
"(",
"c... | Resolves the configuration.
@param config The specified configuration.
@return The resolved configuration. | [
"Resolves",
"the",
"configuration",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/docker/docker/src/main/java/org/arquillian/cube/docker/impl/client/CubeDockerConfigurationResolver.java#L68-L79 |
162,165 | arquillian/arquillian-cube | docker/drone/src/main/java/org/arquillian/cube/docker/drone/util/SeleniumVersionExtractor.java | SeleniumVersionExtractor.fromClassPath | public static String fromClassPath() {
Set<String> versions = new HashSet<>();
try {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
Enumeration<URL> manifests = classLoader.getResources("META-INF/MANIFEST.MF");
while (manifests.hasMoreEleme... | java | public static String fromClassPath() {
Set<String> versions = new HashSet<>();
try {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
Enumeration<URL> manifests = classLoader.getResources("META-INF/MANIFEST.MF");
while (manifests.hasMoreEleme... | [
"public",
"static",
"String",
"fromClassPath",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"versions",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"try",
"{",
"ClassLoader",
"classLoader",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassL... | Returns current selenium version from JAR set in classpath.
@return Version of Selenium. | [
"Returns",
"current",
"selenium",
"version",
"from",
"JAR",
"set",
"in",
"classpath",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/docker/drone/src/main/java/org/arquillian/cube/docker/drone/util/SeleniumVersionExtractor.java#L26-L76 |
162,166 | arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/DefaultConfiguration.java | DefaultConfiguration.getKubernetesConfigurationUrl | public static URL getKubernetesConfigurationUrl(Map<String, String> map) throws MalformedURLException {
if (Strings.isNotNullOrEmpty(Utils.getSystemPropertyOrEnvVar(ENVIRONMENT_CONFIG_URL, ""))) {
return new URL(Utils.getSystemPropertyOrEnvVar(ENVIRONMENT_CONFIG_URL, ""));
} else if (Strings... | java | public static URL getKubernetesConfigurationUrl(Map<String, String> map) throws MalformedURLException {
if (Strings.isNotNullOrEmpty(Utils.getSystemPropertyOrEnvVar(ENVIRONMENT_CONFIG_URL, ""))) {
return new URL(Utils.getSystemPropertyOrEnvVar(ENVIRONMENT_CONFIG_URL, ""));
} else if (Strings... | [
"public",
"static",
"URL",
"getKubernetesConfigurationUrl",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"map",
")",
"throws",
"MalformedURLException",
"{",
"if",
"(",
"Strings",
".",
"isNotNullOrEmpty",
"(",
"Utils",
".",
"getSystemPropertyOrEnvVar",
"(",
"ENVI... | Applies the kubernetes json url to the configuration.
@param map
The arquillian configuration. | [
"Applies",
"the",
"kubernetes",
"json",
"url",
"to",
"the",
"configuration",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/DefaultConfiguration.java#L237-L252 |
162,167 | arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/DefaultConfiguration.java | DefaultConfiguration.findConfigResource | public static URL findConfigResource(String resourceName) {
if (Strings.isNullOrEmpty(resourceName)) {
return null;
}
final URL url = resourceName.startsWith(ROOT) ? DefaultConfiguration.class.getResource(resourceName)
: DefaultConfiguration.class.getResource(ROOT + reso... | java | public static URL findConfigResource(String resourceName) {
if (Strings.isNullOrEmpty(resourceName)) {
return null;
}
final URL url = resourceName.startsWith(ROOT) ? DefaultConfiguration.class.getResource(resourceName)
: DefaultConfiguration.class.getResource(ROOT + reso... | [
"public",
"static",
"URL",
"findConfigResource",
"(",
"String",
"resourceName",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"resourceName",
")",
")",
"{",
"return",
"null",
";",
"}",
"final",
"URL",
"url",
"=",
"resourceName",
".",
"startsWith... | Returns the URL of a classpath resource.
@param resourceName
The name of the resource.
@return The URL. | [
"Returns",
"the",
"URL",
"of",
"a",
"classpath",
"resource",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/DefaultConfiguration.java#L262-L287 |
162,168 | arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/DefaultConfiguration.java | DefaultConfiguration.asUrlOrResource | public static URL asUrlOrResource(String s) {
if (Strings.isNullOrEmpty(s)) {
return null;
}
try {
return new URL(s);
} catch (MalformedURLException e) {
//If its not a valid URL try to treat it as a local resource.
return findConfigResour... | java | public static URL asUrlOrResource(String s) {
if (Strings.isNullOrEmpty(s)) {
return null;
}
try {
return new URL(s);
} catch (MalformedURLException e) {
//If its not a valid URL try to treat it as a local resource.
return findConfigResour... | [
"public",
"static",
"URL",
"asUrlOrResource",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"s",
")",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"return",
"new",
"URL",
"(",
"s",
")",
";",
"}",
"catch",
"(",
... | Convert a string to a URL and fallback to classpath resource, if not convertible.
@param s
The string to convert.
@return The URL. | [
"Convert",
"a",
"string",
"to",
"a",
"URL",
"and",
"fallback",
"to",
"classpath",
"resource",
"if",
"not",
"convertible",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/DefaultConfiguration.java#L297-L308 |
162,169 | arquillian/arquillian-cube | openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/client/OpenShiftAssistant.java | OpenShiftAssistant.deploy | @Override
public void deploy(InputStream inputStream) throws IOException {
final List<? extends HasMetadata> entities = deploy("application", inputStream);
if (this.applicationName == null) {
Optional<String> deploymentConfig = entities.stream()
.filter(hm -> hm instanc... | java | @Override
public void deploy(InputStream inputStream) throws IOException {
final List<? extends HasMetadata> entities = deploy("application", inputStream);
if (this.applicationName == null) {
Optional<String> deploymentConfig = entities.stream()
.filter(hm -> hm instanc... | [
"@",
"Override",
"public",
"void",
"deploy",
"(",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"final",
"List",
"<",
"?",
"extends",
"HasMetadata",
">",
"entities",
"=",
"deploy",
"(",
"\"application\"",
",",
"inputStream",
")",
";",
"if",
... | Deploys application reading resources from specified InputStream.
@param inputStream where resources are read
@throws IOException | [
"Deploys",
"application",
"reading",
"resources",
"from",
"specified",
"InputStream",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/client/OpenShiftAssistant.java#L69-L82 |
162,170 | arquillian/arquillian-cube | openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/client/OpenShiftAssistant.java | OpenShiftAssistant.getRoute | public Optional<URL> getRoute(String routeName) {
Route route = getClient().routes()
.inNamespace(namespace).withName(routeName).get();
return route != null ? Optional.ofNullable(createUrlFromRoute(route)) : Optional.empty();
} | java | public Optional<URL> getRoute(String routeName) {
Route route = getClient().routes()
.inNamespace(namespace).withName(routeName).get();
return route != null ? Optional.ofNullable(createUrlFromRoute(route)) : Optional.empty();
} | [
"public",
"Optional",
"<",
"URL",
">",
"getRoute",
"(",
"String",
"routeName",
")",
"{",
"Route",
"route",
"=",
"getClient",
"(",
")",
".",
"routes",
"(",
")",
".",
"inNamespace",
"(",
"namespace",
")",
".",
"withName",
"(",
"routeName",
")",
".",
"get... | Gets the URL of the route with given name.
@param routeName to return its URL
@return URL backed by the route with given name. | [
"Gets",
"the",
"URL",
"of",
"the",
"route",
"with",
"given",
"name",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/client/OpenShiftAssistant.java#L89-L94 |
162,171 | arquillian/arquillian-cube | openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/client/OpenShiftAssistant.java | OpenShiftAssistant.getRoute | public Optional<URL> getRoute() {
Optional<Route> optionalRoute = getClient().routes().inNamespace(namespace)
.list().getItems()
.stream()
.findFirst();
return optionalRoute
.map(OpenShiftRouteLocator::createUrlFromRoute);
} | java | public Optional<URL> getRoute() {
Optional<Route> optionalRoute = getClient().routes().inNamespace(namespace)
.list().getItems()
.stream()
.findFirst();
return optionalRoute
.map(OpenShiftRouteLocator::createUrlFromRoute);
} | [
"public",
"Optional",
"<",
"URL",
">",
"getRoute",
"(",
")",
"{",
"Optional",
"<",
"Route",
">",
"optionalRoute",
"=",
"getClient",
"(",
")",
".",
"routes",
"(",
")",
".",
"inNamespace",
"(",
"namespace",
")",
".",
"list",
"(",
")",
".",
"getItems",
... | Returns the URL of the first route.
@return URL backed by the first route. | [
"Returns",
"the",
"URL",
"of",
"the",
"first",
"route",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/client/OpenShiftAssistant.java#L100-L108 |
162,172 | arquillian/arquillian-cube | openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/client/OpenShiftAssistant.java | OpenShiftAssistant.projectExists | public boolean projectExists(String name) throws IllegalArgumentException {
if (name == null || name.isEmpty()) {
throw new IllegalArgumentException("Project name cannot be empty");
}
return listProjects().stream()
.map(p -> p.getMetadata().getName())
.anyMatc... | java | public boolean projectExists(String name) throws IllegalArgumentException {
if (name == null || name.isEmpty()) {
throw new IllegalArgumentException("Project name cannot be empty");
}
return listProjects().stream()
.map(p -> p.getMetadata().getName())
.anyMatc... | [
"public",
"boolean",
"projectExists",
"(",
"String",
"name",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"name",
"==",
"null",
"||",
"name",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Project name canno... | Checks if the given project exists or not.
@param name project name
@return true/false
@throws IllegalArgumentException | [
"Checks",
"if",
"the",
"given",
"project",
"exists",
"or",
"not",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/client/OpenShiftAssistant.java#L230-L237 |
162,173 | arquillian/arquillian-cube | openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/client/OpenShiftAssistant.java | OpenShiftAssistant.findProject | public Optional<Project> findProject(String name) throws IllegalArgumentException {
if (name == null || name.isEmpty()) {
throw new IllegalArgumentException("Project name cannot be empty");
}
return getProject(name);
} | java | public Optional<Project> findProject(String name) throws IllegalArgumentException {
if (name == null || name.isEmpty()) {
throw new IllegalArgumentException("Project name cannot be empty");
}
return getProject(name);
} | [
"public",
"Optional",
"<",
"Project",
">",
"findProject",
"(",
"String",
"name",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"name",
"==",
"null",
"||",
"name",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(... | Finds for the given project.
@param name project name
@return given project or an empty {@code Optional} if project does not exist
@throws IllegalArgumentException | [
"Finds",
"for",
"the",
"given",
"project",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/client/OpenShiftAssistant.java#L246-L251 |
162,174 | arquillian/arquillian-cube | requirement/src/main/java/org/arquillian/cube/requirement/Constraints.java | Constraints.loadConstraint | private static Constraint loadConstraint(Annotation context) {
Constraint constraint = null;
final ServiceLoader<Constraint> constraints = ServiceLoader.load(Constraint.class);
for (Constraint aConstraint : constraints) {
try {
aConstraint.getClass().getDeclaredMetho... | java | private static Constraint loadConstraint(Annotation context) {
Constraint constraint = null;
final ServiceLoader<Constraint> constraints = ServiceLoader.load(Constraint.class);
for (Constraint aConstraint : constraints) {
try {
aConstraint.getClass().getDeclaredMetho... | [
"private",
"static",
"Constraint",
"loadConstraint",
"(",
"Annotation",
"context",
")",
"{",
"Constraint",
"constraint",
"=",
"null",
";",
"final",
"ServiceLoader",
"<",
"Constraint",
">",
"constraints",
"=",
"ServiceLoader",
".",
"load",
"(",
"Constraint",
".",
... | we have only one implementation on classpath. | [
"we",
"have",
"only",
"one",
"implementation",
"on",
"classpath",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/requirement/src/main/java/org/arquillian/cube/requirement/Constraints.java#L38-L56 |
162,175 | arquillian/arquillian-cube | openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/CEEnvironmentProcessor.java | CEEnvironmentProcessor.createEnvironment | public void createEnvironment(@Observes(precedence = 10) BeforeClass event, OpenShiftAdapter client,
CubeOpenShiftConfiguration cubeOpenShiftConfiguration) {
final TestClass testClass = event.getTestClass();
log.info(String.format("Creating environment for %s", testClass.getName()));
Ope... | java | public void createEnvironment(@Observes(precedence = 10) BeforeClass event, OpenShiftAdapter client,
CubeOpenShiftConfiguration cubeOpenShiftConfiguration) {
final TestClass testClass = event.getTestClass();
log.info(String.format("Creating environment for %s", testClass.getName()));
Ope... | [
"public",
"void",
"createEnvironment",
"(",
"@",
"Observes",
"(",
"precedence",
"=",
"10",
")",
"BeforeClass",
"event",
",",
"OpenShiftAdapter",
"client",
",",
"CubeOpenShiftConfiguration",
"cubeOpenShiftConfiguration",
")",
"{",
"final",
"TestClass",
"testClass",
"="... | Create the environment as specified by @Template or
arq.extension.ce-cube.openshift.template.* properties.
<p>
In the future, this might be handled by starting application Cube
objects, e.g. CreateCube(application), StartCube(application)
<p>
Needs to fire before the containers are started. | [
"Create",
"the",
"environment",
"as",
"specified",
"by"
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/CEEnvironmentProcessor.java#L87-L96 |
162,176 | arquillian/arquillian-cube | docker/docker/src/main/java/org/arquillian/cube/docker/impl/client/containerobject/DockerContainerObjectBuilder.java | DockerContainerObjectBuilder.withContainerObjectClass | public DockerContainerObjectBuilder<T> withContainerObjectClass(Class<T> containerObjectClass) {
if (containerObjectClass == null) {
throw new IllegalArgumentException("container object class cannot be null");
}
this.containerObjectClass = containerObjectClass;
//First we ch... | java | public DockerContainerObjectBuilder<T> withContainerObjectClass(Class<T> containerObjectClass) {
if (containerObjectClass == null) {
throw new IllegalArgumentException("container object class cannot be null");
}
this.containerObjectClass = containerObjectClass;
//First we ch... | [
"public",
"DockerContainerObjectBuilder",
"<",
"T",
">",
"withContainerObjectClass",
"(",
"Class",
"<",
"T",
">",
"containerObjectClass",
")",
"{",
"if",
"(",
"containerObjectClass",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"contain... | Specifies the container object class to be instantiated
@param containerObjectClass
container object class to be instantiated
@return the current builder instance | [
"Specifies",
"the",
"container",
"object",
"class",
"to",
"be",
"instantiated"
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/docker/docker/src/main/java/org/arquillian/cube/docker/impl/client/containerobject/DockerContainerObjectBuilder.java#L184-L241 |
162,177 | arquillian/arquillian-cube | docker/docker/src/main/java/org/arquillian/cube/docker/impl/client/containerobject/DockerContainerObjectBuilder.java | DockerContainerObjectBuilder.withEnrichers | public DockerContainerObjectBuilder<T> withEnrichers(Collection<TestEnricher> enrichers) {
if (enrichers == null) {
throw new IllegalArgumentException("enrichers cannot be null");
}
this.enrichers = enrichers;
return this;
} | java | public DockerContainerObjectBuilder<T> withEnrichers(Collection<TestEnricher> enrichers) {
if (enrichers == null) {
throw new IllegalArgumentException("enrichers cannot be null");
}
this.enrichers = enrichers;
return this;
} | [
"public",
"DockerContainerObjectBuilder",
"<",
"T",
">",
"withEnrichers",
"(",
"Collection",
"<",
"TestEnricher",
">",
"enrichers",
")",
"{",
"if",
"(",
"enrichers",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"enrichers cannot be null... | Specifies the list of enrichers that will be used to enrich the container object.
@param enrichers
list of enrichers that will be used to enrich the container object
@return the current builder instance | [
"Specifies",
"the",
"list",
"of",
"enrichers",
"that",
"will",
"be",
"used",
"to",
"enrich",
"the",
"container",
"object",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/docker/docker/src/main/java/org/arquillian/cube/docker/impl/client/containerobject/DockerContainerObjectBuilder.java#L282-L288 |
162,178 | arquillian/arquillian-cube | docker/docker/src/main/java/org/arquillian/cube/docker/impl/client/containerobject/DockerContainerObjectBuilder.java | DockerContainerObjectBuilder.build | public T build() throws IllegalAccessException, IOException, InvocationTargetException {
generatedConfigutation = new CubeContainer();
findContainerName();
// if needed, prepare prepare resources required to build a docker image
prepareImageBuild();
// instantiate container obje... | java | public T build() throws IllegalAccessException, IOException, InvocationTargetException {
generatedConfigutation = new CubeContainer();
findContainerName();
// if needed, prepare prepare resources required to build a docker image
prepareImageBuild();
// instantiate container obje... | [
"public",
"T",
"build",
"(",
")",
"throws",
"IllegalAccessException",
",",
"IOException",
",",
"InvocationTargetException",
"{",
"generatedConfigutation",
"=",
"new",
"CubeContainer",
"(",
")",
";",
"findContainerName",
"(",
")",
";",
"// if needed, prepare prepare reso... | Triggers the building process, builds, creates and starts the docker container associated with the requested
container object, creates the container object and returns it
@return the created container object
@throws IllegalAccessException
if there is an error accessing the container object fields
@throws IOException
... | [
"Triggers",
"the",
"building",
"process",
"builds",
"creates",
"and",
"starts",
"the",
"docker",
"container",
"associated",
"with",
"the",
"requested",
"container",
"object",
"creates",
"the",
"container",
"object",
"and",
"returns",
"it"
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/docker/docker/src/main/java/org/arquillian/cube/docker/impl/client/containerobject/DockerContainerObjectBuilder.java#L318-L338 |
162,179 | arquillian/arquillian-cube | docker/docker/src/main/java/org/arquillian/cube/docker/impl/client/DockerContainerDefinitionParser.java | DockerContainerDefinitionParser.resolveDockerDefinition | private static Path resolveDockerDefinition(Path fullpath) {
final Path ymlPath = fullpath.resolveSibling(fullpath.getFileName() + ".yml");
if (Files.exists(ymlPath)) {
return ymlPath;
} else {
final Path yamlPath = fullpath.resolveSibling(fullpath.getFileName() + ".yaml"... | java | private static Path resolveDockerDefinition(Path fullpath) {
final Path ymlPath = fullpath.resolveSibling(fullpath.getFileName() + ".yml");
if (Files.exists(ymlPath)) {
return ymlPath;
} else {
final Path yamlPath = fullpath.resolveSibling(fullpath.getFileName() + ".yaml"... | [
"private",
"static",
"Path",
"resolveDockerDefinition",
"(",
"Path",
"fullpath",
")",
"{",
"final",
"Path",
"ymlPath",
"=",
"fullpath",
".",
"resolveSibling",
"(",
"fullpath",
".",
"getFileName",
"(",
")",
"+",
"\".yml\"",
")",
";",
"if",
"(",
"Files",
".",
... | Resolves current full path with .yml and .yaml extensions
@param fullpath
without extension.
@return Path of existing definition or null | [
"Resolves",
"current",
"full",
"path",
"with",
".",
"yml",
"and",
".",
"yaml",
"extensions"
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/docker/docker/src/main/java/org/arquillian/cube/docker/impl/client/DockerContainerDefinitionParser.java#L206-L218 |
162,180 | arquillian/arquillian-cube | openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/client/ResourceUtil.java | ResourceUtil.awaitRoute | public static void awaitRoute(URL routeUrl, int timeout, TimeUnit timeoutUnit, int repetitions, int... statusCodes) {
AtomicInteger successfulAwaitsInARow = new AtomicInteger(0);
await().atMost(timeout, timeoutUnit).until(() -> {
if (tryConnect(routeUrl, statusCodes)) {
succe... | java | public static void awaitRoute(URL routeUrl, int timeout, TimeUnit timeoutUnit, int repetitions, int... statusCodes) {
AtomicInteger successfulAwaitsInARow = new AtomicInteger(0);
await().atMost(timeout, timeoutUnit).until(() -> {
if (tryConnect(routeUrl, statusCodes)) {
succe... | [
"public",
"static",
"void",
"awaitRoute",
"(",
"URL",
"routeUrl",
",",
"int",
"timeout",
",",
"TimeUnit",
"timeoutUnit",
",",
"int",
"repetitions",
",",
"int",
"...",
"statusCodes",
")",
"{",
"AtomicInteger",
"successfulAwaitsInARow",
"=",
"new",
"AtomicInteger",
... | Waits for the timeout duration until the url responds with correct status code
@param routeUrl URL to check (usually a route one)
@param timeout Max timeout value to await for route readiness.
If not set, default timeout value is set to 5.
@param timeoutUnit TimeUnit used for timeout duration.
If not set, Minut... | [
"Waits",
"for",
"the",
"timeout",
"duration",
"until",
"the",
"url",
"responds",
"with",
"correct",
"status",
"code"
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/client/ResourceUtil.java#L190-L200 |
162,181 | arquillian/arquillian-cube | core/src/main/java/org/arquillian/cube/impl/util/ReflectionUtil.java | ReflectionUtil.getConstructor | public static Constructor<?> getConstructor(final Class<?> clazz,
final Class<?>... argumentTypes) throws NoSuchMethodException {
try {
return AccessController
.doPrivileged(new PrivilegedExceptionAction<Constructor<?>>() {
public Constructor<?> run()
... | java | public static Constructor<?> getConstructor(final Class<?> clazz,
final Class<?>... argumentTypes) throws NoSuchMethodException {
try {
return AccessController
.doPrivileged(new PrivilegedExceptionAction<Constructor<?>>() {
public Constructor<?> run()
... | [
"public",
"static",
"Constructor",
"<",
"?",
">",
"getConstructor",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"Class",
"<",
"?",
">",
"...",
"argumentTypes",
")",
"throws",
"NoSuchMethodException",
"{",
"try",
"{",
"return",
"AccessControl... | Obtains the Constructor specified from the given Class and argument types
@throws NoSuchMethodException | [
"Obtains",
"the",
"Constructor",
"specified",
"from",
"the",
"given",
"Class",
"and",
"argument",
"types"
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/core/src/main/java/org/arquillian/cube/impl/util/ReflectionUtil.java#L53-L83 |
162,182 | arquillian/arquillian-cube | core/src/main/java/org/arquillian/cube/impl/util/ConfigUtil.java | ConfigUtil.getStringProperty | public static String getStringProperty(String name, Map<String, String> map, String defaultValue) {
if (map.containsKey(name) && Strings.isNotNullOrEmpty(map.get(name))) {
defaultValue = map.get(name);
}
return getPropertyOrEnvironmentVariable(name, defaultValue);
} | java | public static String getStringProperty(String name, Map<String, String> map, String defaultValue) {
if (map.containsKey(name) && Strings.isNotNullOrEmpty(map.get(name))) {
defaultValue = map.get(name);
}
return getPropertyOrEnvironmentVariable(name, defaultValue);
} | [
"public",
"static",
"String",
"getStringProperty",
"(",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"String",
">",
"map",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"map",
".",
"containsKey",
"(",
"name",
")",
"&&",
"Strings",
".",
"isNotN... | Gets a property from system, environment or an external map.
The lookup order is system > env > map > defaultValue.
@param name
The name of the property.
@param map
The external map.
@param defaultValue
The value that should be used if property is not found. | [
"Gets",
"a",
"property",
"from",
"system",
"environment",
"or",
"an",
"external",
"map",
".",
"The",
"lookup",
"order",
"is",
"system",
">",
"env",
">",
"map",
">",
"defaultValue",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/core/src/main/java/org/arquillian/cube/impl/util/ConfigUtil.java#L25-L30 |
162,183 | arquillian/arquillian-cube | openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/client/OpenShiftAssistantTemplate.java | OpenShiftAssistantTemplate.parameter | public OpenShiftAssistantTemplate parameter(String name, String value) {
parameterValues.put(name, value);
return this;
} | java | public OpenShiftAssistantTemplate parameter(String name, String value) {
parameterValues.put(name, value);
return this;
} | [
"public",
"OpenShiftAssistantTemplate",
"parameter",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"parameterValues",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Stores template parameters for OpenShiftAssistantTemplate.
@param name template parameter name
@param value template parameter value | [
"Stores",
"template",
"parameters",
"for",
"OpenShiftAssistantTemplate",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/client/OpenShiftAssistantTemplate.java#L37-L40 |
162,184 | arquillian/arquillian-cube | core/src/main/java/org/arquillian/cube/impl/util/Timespan.java | Timespan.create | public static Timespan create(Timespan... timespans) {
if (timespans == null) {
return null;
}
if (timespans.length == 0) {
return ZERO_MILLISECONDS;
}
Timespan res = timespans[0];
for (int i = 1; i < timespans.length; i++) {
Timespa... | java | public static Timespan create(Timespan... timespans) {
if (timespans == null) {
return null;
}
if (timespans.length == 0) {
return ZERO_MILLISECONDS;
}
Timespan res = timespans[0];
for (int i = 1; i < timespans.length; i++) {
Timespa... | [
"public",
"static",
"Timespan",
"create",
"(",
"Timespan",
"...",
"timespans",
")",
"{",
"if",
"(",
"timespans",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"timespans",
".",
"length",
"==",
"0",
")",
"{",
"return",
"ZERO_MILLISECONDS"... | Creates a timespan from a list of other timespans.
@return a timespan representing the sum of all the timespans provided | [
"Creates",
"a",
"timespan",
"from",
"a",
"list",
"of",
"other",
"timespans",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/core/src/main/java/org/arquillian/cube/impl/util/Timespan.java#L470-L487 |
162,185 | arquillian/arquillian-cube | docker/drone/src/main/java/org/arquillian/cube/docker/drone/InstallSeleniumCube.java | InstallSeleniumCube.install | public void install(@Observes(precedence = 90) CubeDockerConfiguration configuration,
ArquillianDescriptor arquillianDescriptor) {
DockerCompositions cubes = configuration.getDockerContainersContent();
final SeleniumContainers seleniumContainers =
SeleniumContainers.create(getBrows... | java | public void install(@Observes(precedence = 90) CubeDockerConfiguration configuration,
ArquillianDescriptor arquillianDescriptor) {
DockerCompositions cubes = configuration.getDockerContainersContent();
final SeleniumContainers seleniumContainers =
SeleniumContainers.create(getBrows... | [
"public",
"void",
"install",
"(",
"@",
"Observes",
"(",
"precedence",
"=",
"90",
")",
"CubeDockerConfiguration",
"configuration",
",",
"ArquillianDescriptor",
"arquillianDescriptor",
")",
"{",
"DockerCompositions",
"cubes",
"=",
"configuration",
".",
"getDockerContainer... | ten less than Cube Q | [
"ten",
"less",
"than",
"Cube",
"Q"
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/docker/drone/src/main/java/org/arquillian/cube/docker/drone/InstallSeleniumCube.java#L31-L51 |
162,186 | arquillian/arquillian-cube | docker/docker/src/main/java/org/arquillian/cube/docker/impl/util/DockerMachine.java | DockerMachine.startDockerMachine | public void startDockerMachine(String cliPathExec, String machineName) {
commandLineExecutor.execCommand(createDockerMachineCommand(cliPathExec), "start", machineName);
this.manuallyStarted = true;
} | java | public void startDockerMachine(String cliPathExec, String machineName) {
commandLineExecutor.execCommand(createDockerMachineCommand(cliPathExec), "start", machineName);
this.manuallyStarted = true;
} | [
"public",
"void",
"startDockerMachine",
"(",
"String",
"cliPathExec",
",",
"String",
"machineName",
")",
"{",
"commandLineExecutor",
".",
"execCommand",
"(",
"createDockerMachineCommand",
"(",
"cliPathExec",
")",
",",
"\"start\"",
",",
"machineName",
")",
";",
"this... | Starts given docker machine.
@param cliPathExec
location of docker-machine or null if it is on PATH.
@param machineName
to be started. | [
"Starts",
"given",
"docker",
"machine",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/docker/docker/src/main/java/org/arquillian/cube/docker/impl/util/DockerMachine.java#L53-L56 |
162,187 | arquillian/arquillian-cube | docker/docker/src/main/java/org/arquillian/cube/docker/impl/util/DockerMachine.java | DockerMachine.isDockerMachineInstalled | public boolean isDockerMachineInstalled(String cliPathExec) {
try {
commandLineExecutor.execCommand(createDockerMachineCommand(cliPathExec));
return true;
} catch (Exception e) {
return false;
}
} | java | public boolean isDockerMachineInstalled(String cliPathExec) {
try {
commandLineExecutor.execCommand(createDockerMachineCommand(cliPathExec));
return true;
} catch (Exception e) {
return false;
}
} | [
"public",
"boolean",
"isDockerMachineInstalled",
"(",
"String",
"cliPathExec",
")",
"{",
"try",
"{",
"commandLineExecutor",
".",
"execCommand",
"(",
"createDockerMachineCommand",
"(",
"cliPathExec",
")",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"Excepti... | Checks if Docker Machine is installed by running docker-machine and inspect the result.
@param cliPathExec
location of docker-machine or null if it is on PATH.
@return true if it is installed, false otherwise. | [
"Checks",
"if",
"Docker",
"Machine",
"is",
"installed",
"by",
"running",
"docker",
"-",
"machine",
"and",
"inspect",
"the",
"result",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/docker/docker/src/main/java/org/arquillian/cube/docker/impl/util/DockerMachine.java#L85-L92 |
162,188 | arquillian/arquillian-cube | docker/docker/src/main/java/org/arquillian/cube/docker/impl/client/config/DockerCompositions.java | DockerCompositions.overrideCubeProperties | public void overrideCubeProperties(DockerCompositions overrideDockerCompositions) {
final Set<String> containerIds = overrideDockerCompositions.getContainerIds();
for (String containerId : containerIds) {
// main definition of containers contains a container that must be overrode
... | java | public void overrideCubeProperties(DockerCompositions overrideDockerCompositions) {
final Set<String> containerIds = overrideDockerCompositions.getContainerIds();
for (String containerId : containerIds) {
// main definition of containers contains a container that must be overrode
... | [
"public",
"void",
"overrideCubeProperties",
"(",
"DockerCompositions",
"overrideDockerCompositions",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"containerIds",
"=",
"overrideDockerCompositions",
".",
"getContainerIds",
"(",
")",
";",
"for",
"(",
"String",
"containe... | This method only overrides properties that are specific from Cube like await strategy or before stop events.
@param overrideDockerCompositions
that contains information to override. | [
"This",
"method",
"only",
"overrides",
"properties",
"that",
"are",
"specific",
"from",
"Cube",
"like",
"await",
"strategy",
"or",
"before",
"stop",
"events",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/docker/docker/src/main/java/org/arquillian/cube/docker/impl/client/config/DockerCompositions.java#L109-L142 |
162,189 | arquillian/arquillian-cube | docker/docker/src/main/java/org/arquillian/cube/docker/impl/docker/compose/DockerComposeEnvironmentVarResolver.java | DockerComposeEnvironmentVarResolver.replaceParameters | public static String replaceParameters(final InputStream stream) {
String content = IOUtil.asStringPreservingNewLines(stream);
return resolvePlaceholders(content);
} | java | public static String replaceParameters(final InputStream stream) {
String content = IOUtil.asStringPreservingNewLines(stream);
return resolvePlaceholders(content);
} | [
"public",
"static",
"String",
"replaceParameters",
"(",
"final",
"InputStream",
"stream",
")",
"{",
"String",
"content",
"=",
"IOUtil",
".",
"asStringPreservingNewLines",
"(",
"stream",
")",
";",
"return",
"resolvePlaceholders",
"(",
"content",
")",
";",
"}"
] | Method that takes an inputstream, read it preserving the end lines, and subtitute using commons-lang-3 calls
the variables, first searching as system properties vars and then in environment var list.
In case of missing the property is replaced by white space.
@param stream
@return | [
"Method",
"that",
"takes",
"an",
"inputstream",
"read",
"it",
"preserving",
"the",
"end",
"lines",
"and",
"subtitute",
"using",
"commons",
"-",
"lang",
"-",
"3",
"calls",
"the",
"variables",
"first",
"searching",
"as",
"system",
"properties",
"vars",
"and",
... | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/docker/docker/src/main/java/org/arquillian/cube/docker/impl/docker/compose/DockerComposeEnvironmentVarResolver.java#L22-L25 |
162,190 | arquillian/arquillian-cube | core/src/main/java/org/arquillian/cube/impl/util/Strings.java | Strings.join | public static String join(final Collection<?> collection, final String separator) {
StringBuffer buffer = new StringBuffer();
boolean first = true;
Iterator<?> iter = collection.iterator();
while (iter.hasNext()) {
Object next = iter.next();
if (first) {
... | java | public static String join(final Collection<?> collection, final String separator) {
StringBuffer buffer = new StringBuffer();
boolean first = true;
Iterator<?> iter = collection.iterator();
while (iter.hasNext()) {
Object next = iter.next();
if (first) {
... | [
"public",
"static",
"String",
"join",
"(",
"final",
"Collection",
"<",
"?",
">",
"collection",
",",
"final",
"String",
"separator",
")",
"{",
"StringBuffer",
"buffer",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"boolean",
"first",
"=",
"true",
";",
"Iterat... | joins a collection of objects together as a String using a separator | [
"joins",
"a",
"collection",
"of",
"objects",
"together",
"as",
"a",
"String",
"using",
"a",
"separator"
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/core/src/main/java/org/arquillian/cube/impl/util/Strings.java#L26-L40 |
162,191 | arquillian/arquillian-cube | core/src/main/java/org/arquillian/cube/impl/util/Strings.java | Strings.splitAsList | public static List<String> splitAsList(String text, String delimiter) {
List<String> answer = new ArrayList<String>();
if (text != null && text.length() > 0) {
answer.addAll(Arrays.asList(text.split(delimiter)));
}
return answer;
} | java | public static List<String> splitAsList(String text, String delimiter) {
List<String> answer = new ArrayList<String>();
if (text != null && text.length() > 0) {
answer.addAll(Arrays.asList(text.split(delimiter)));
}
return answer;
} | [
"public",
"static",
"List",
"<",
"String",
">",
"splitAsList",
"(",
"String",
"text",
",",
"String",
"delimiter",
")",
"{",
"List",
"<",
"String",
">",
"answer",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"if",
"(",
"text",
"!=",
"nu... | splits a string into a list of strings, ignoring the empty string | [
"splits",
"a",
"string",
"into",
"a",
"list",
"of",
"strings",
"ignoring",
"the",
"empty",
"string"
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/core/src/main/java/org/arquillian/cube/impl/util/Strings.java#L45-L51 |
162,192 | arquillian/arquillian-cube | core/src/main/java/org/arquillian/cube/impl/util/Strings.java | Strings.splitAndTrimAsList | public static List<String> splitAndTrimAsList(String text, String sep) {
ArrayList<String> answer = new ArrayList<>();
if (text != null && text.length() > 0) {
for (String v : text.split(sep)) {
String trim = v.trim();
if (trim.length() > 0) {
... | java | public static List<String> splitAndTrimAsList(String text, String sep) {
ArrayList<String> answer = new ArrayList<>();
if (text != null && text.length() > 0) {
for (String v : text.split(sep)) {
String trim = v.trim();
if (trim.length() > 0) {
... | [
"public",
"static",
"List",
"<",
"String",
">",
"splitAndTrimAsList",
"(",
"String",
"text",
",",
"String",
"sep",
")",
"{",
"ArrayList",
"<",
"String",
">",
"answer",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"text",
"!=",
"null",
"&&",... | splits a string into a list of strings. Trims the results and ignores empty strings | [
"splits",
"a",
"string",
"into",
"a",
"list",
"of",
"strings",
".",
"Trims",
"the",
"results",
"and",
"ignores",
"empty",
"strings"
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/core/src/main/java/org/arquillian/cube/impl/util/Strings.java#L56-L67 |
162,193 | arquillian/arquillian-cube | openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/ext/TemplateContainerStarter.java | TemplateContainerStarter.waitForDeployments | public void waitForDeployments(@Observes(precedence = -100) AfterStart event, OpenShiftAdapter client,
CEEnvironmentProcessor.TemplateDetails details, TestClass testClass, CubeOpenShiftConfiguration configuration, OpenShiftClient openshiftClient)
throws Exception {
if (testClass == null) {
... | java | public void waitForDeployments(@Observes(precedence = -100) AfterStart event, OpenShiftAdapter client,
CEEnvironmentProcessor.TemplateDetails details, TestClass testClass, CubeOpenShiftConfiguration configuration, OpenShiftClient openshiftClient)
throws Exception {
if (testClass == null) {
... | [
"public",
"void",
"waitForDeployments",
"(",
"@",
"Observes",
"(",
"precedence",
"=",
"-",
"100",
")",
"AfterStart",
"event",
",",
"OpenShiftAdapter",
"client",
",",
"CEEnvironmentProcessor",
".",
"TemplateDetails",
"details",
",",
"TestClass",
"testClass",
",",
"... | Wait for the template resources to come up after the test container has
been started. This allows the test container and the template resources
to come up in parallel. | [
"Wait",
"for",
"the",
"template",
"resources",
"to",
"come",
"up",
"after",
"the",
"test",
"container",
"has",
"been",
"started",
".",
"This",
"allows",
"the",
"test",
"container",
"and",
"the",
"template",
"resources",
"to",
"come",
"up",
"in",
"parallel",
... | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/ext/TemplateContainerStarter.java#L25-L42 |
162,194 | arquillian/arquillian-cube | docker/drone/src/main/java/org/arquillian/cube/docker/drone/util/IpAddressValidator.java | IpAddressValidator.validate | public static boolean validate(final String ip) {
Matcher matcher = pattern.matcher(ip);
return matcher.matches();
} | java | public static boolean validate(final String ip) {
Matcher matcher = pattern.matcher(ip);
return matcher.matches();
} | [
"public",
"static",
"boolean",
"validate",
"(",
"final",
"String",
"ip",
")",
"{",
"Matcher",
"matcher",
"=",
"pattern",
".",
"matcher",
"(",
"ip",
")",
";",
"return",
"matcher",
".",
"matches",
"(",
")",
";",
"}"
] | Validate ipv4 address with regular expression
@param ip
address for validation
@return true valid ip address, false invalid ip address | [
"Validate",
"ipv4",
"address",
"with",
"regular",
"expression"
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/docker/drone/src/main/java/org/arquillian/cube/docker/drone/util/IpAddressValidator.java#L27-L30 |
162,195 | spacecowboy/NoNonsense-FilePicker | examples/src/main/java/com/nononsenseapps/filepicker/examples/backbutton/BackHandlingFilePickerActivity.java | BackHandlingFilePickerActivity.getFragment | @Override
protected AbstractFilePickerFragment<File> getFragment(
final String startPath, final int mode, final boolean allowMultiple,
final boolean allowDirCreate, final boolean allowExistingFile,
final boolean singleClick) {
// startPath is allowed to be null.
... | java | @Override
protected AbstractFilePickerFragment<File> getFragment(
final String startPath, final int mode, final boolean allowMultiple,
final boolean allowDirCreate, final boolean allowExistingFile,
final boolean singleClick) {
// startPath is allowed to be null.
... | [
"@",
"Override",
"protected",
"AbstractFilePickerFragment",
"<",
"File",
">",
"getFragment",
"(",
"final",
"String",
"startPath",
",",
"final",
"int",
"mode",
",",
"final",
"boolean",
"allowMultiple",
",",
"final",
"boolean",
"allowDirCreate",
",",
"final",
"boole... | Return a copy of the new fragment and set the variable above. | [
"Return",
"a",
"copy",
"of",
"the",
"new",
"fragment",
"and",
"set",
"the",
"variable",
"above",
"."
] | 396ef7fa5e87791170791f9d94c78f6e42a7679a | https://github.com/spacecowboy/NoNonsense-FilePicker/blob/396ef7fa5e87791170791f9d94c78f6e42a7679a/examples/src/main/java/com/nononsenseapps/filepicker/examples/backbutton/BackHandlingFilePickerActivity.java#L20-L35 |
162,196 | spacecowboy/NoNonsense-FilePicker | library/src/main/java/com/nononsenseapps/filepicker/FilePickerFragment.java | FilePickerFragment.getParent | @NonNull
@Override
public File getParent(@NonNull final File from) {
if (from.getPath().equals(getRoot().getPath())) {
// Already at root, we can't go higher
return from;
} else if (from.getParentFile() != null) {
return from.getParentFile();
} else {
... | java | @NonNull
@Override
public File getParent(@NonNull final File from) {
if (from.getPath().equals(getRoot().getPath())) {
// Already at root, we can't go higher
return from;
} else if (from.getParentFile() != null) {
return from.getParentFile();
} else {
... | [
"@",
"NonNull",
"@",
"Override",
"public",
"File",
"getParent",
"(",
"@",
"NonNull",
"final",
"File",
"from",
")",
"{",
"if",
"(",
"from",
".",
"getPath",
"(",
")",
".",
"equals",
"(",
"getRoot",
"(",
")",
".",
"getPath",
"(",
")",
")",
")",
"{",
... | Return the path to the parent directory. Should return the root if
from is root.
@param from either a file or directory
@return the parent directory | [
"Return",
"the",
"path",
"to",
"the",
"parent",
"directory",
".",
"Should",
"return",
"the",
"root",
"if",
"from",
"is",
"root",
"."
] | 396ef7fa5e87791170791f9d94c78f6e42a7679a | https://github.com/spacecowboy/NoNonsense-FilePicker/blob/396ef7fa5e87791170791f9d94c78f6e42a7679a/library/src/main/java/com/nononsenseapps/filepicker/FilePickerFragment.java#L145-L156 |
162,197 | spacecowboy/NoNonsense-FilePicker | library/src/main/java/com/nononsenseapps/filepicker/FilePickerFragment.java | FilePickerFragment.getLoader | @NonNull
@Override
public Loader<SortedList<File>> getLoader() {
return new AsyncTaskLoader<SortedList<File>>(getActivity()) {
FileObserver fileObserver;
@Override
public SortedList<File> loadInBackground() {
File[] listFiles = mCurrentPath.listFiles... | java | @NonNull
@Override
public Loader<SortedList<File>> getLoader() {
return new AsyncTaskLoader<SortedList<File>>(getActivity()) {
FileObserver fileObserver;
@Override
public SortedList<File> loadInBackground() {
File[] listFiles = mCurrentPath.listFiles... | [
"@",
"NonNull",
"@",
"Override",
"public",
"Loader",
"<",
"SortedList",
"<",
"File",
">",
">",
"getLoader",
"(",
")",
"{",
"return",
"new",
"AsyncTaskLoader",
"<",
"SortedList",
"<",
"File",
">",
">",
"(",
"getActivity",
"(",
")",
")",
"{",
"FileObserver... | Get a loader that lists the Files in the current path,
and monitors changes. | [
"Get",
"a",
"loader",
"that",
"lists",
"the",
"Files",
"in",
"the",
"current",
"path",
"and",
"monitors",
"changes",
"."
] | 396ef7fa5e87791170791f9d94c78f6e42a7679a | https://github.com/spacecowboy/NoNonsense-FilePicker/blob/396ef7fa5e87791170791f9d94c78f6e42a7679a/library/src/main/java/com/nononsenseapps/filepicker/FilePickerFragment.java#L210-L297 |
162,198 | spacecowboy/NoNonsense-FilePicker | library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java | AbstractFilePickerFragment.onLoadFinished | @Override
public void onLoadFinished(final Loader<SortedList<T>> loader,
final SortedList<T> data) {
isLoading = false;
mCheckedItems.clear();
mCheckedVisibleViewHolders.clear();
mFiles = data;
mAdapter.setList(data);
if (mCurrentDirView... | java | @Override
public void onLoadFinished(final Loader<SortedList<T>> loader,
final SortedList<T> data) {
isLoading = false;
mCheckedItems.clear();
mCheckedVisibleViewHolders.clear();
mFiles = data;
mAdapter.setList(data);
if (mCurrentDirView... | [
"@",
"Override",
"public",
"void",
"onLoadFinished",
"(",
"final",
"Loader",
"<",
"SortedList",
"<",
"T",
">",
">",
"loader",
",",
"final",
"SortedList",
"<",
"T",
">",
"data",
")",
"{",
"isLoading",
"=",
"false",
";",
"mCheckedItems",
".",
"clear",
"(",... | Called when a previously created loader has finished its load.
@param loader The Loader that has finished.
@param data The data generated by the Loader. | [
"Called",
"when",
"a",
"previously",
"created",
"loader",
"has",
"finished",
"its",
"load",
"."
] | 396ef7fa5e87791170791f9d94c78f6e42a7679a | https://github.com/spacecowboy/NoNonsense-FilePicker/blob/396ef7fa5e87791170791f9d94c78f6e42a7679a/library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java#L575-L588 |
162,199 | spacecowboy/NoNonsense-FilePicker | library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java | AbstractFilePickerFragment.clearSelections | public void clearSelections() {
for (CheckableViewHolder vh : mCheckedVisibleViewHolders) {
vh.checkbox.setChecked(false);
}
mCheckedVisibleViewHolders.clear();
mCheckedItems.clear();
} | java | public void clearSelections() {
for (CheckableViewHolder vh : mCheckedVisibleViewHolders) {
vh.checkbox.setChecked(false);
}
mCheckedVisibleViewHolders.clear();
mCheckedItems.clear();
} | [
"public",
"void",
"clearSelections",
"(",
")",
"{",
"for",
"(",
"CheckableViewHolder",
"vh",
":",
"mCheckedVisibleViewHolders",
")",
"{",
"vh",
".",
"checkbox",
".",
"setChecked",
"(",
"false",
")",
";",
"}",
"mCheckedVisibleViewHolders",
".",
"clear",
"(",
")... | Animate de-selection of visible views and clear
selected set. | [
"Animate",
"de",
"-",
"selection",
"of",
"visible",
"views",
"and",
"clear",
"selected",
"set",
"."
] | 396ef7fa5e87791170791f9d94c78f6e42a7679a | https://github.com/spacecowboy/NoNonsense-FilePicker/blob/396ef7fa5e87791170791f9d94c78f6e42a7679a/library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java#L674-L680 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.