Openshift helpers:
oc-pod-name app_name [namespace]
oc-logs app_name [namespace]
oc-tunnel namespace app_name port
oc-tunnel namespace app_name s_port:d_port
@SpringBootApplication | |
@EnableCaching | |
@Import({ | |
CacheCleanupOnSessionDestroyingListener.class | |
}) | |
public class TestApp { | |
public static void main(String[] args) { | |
SpringApplication.run(TestApp.class, args); | |
} |
import java.lang.annotation.Documented; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.Target; | |
import javax.validation.Constraint; | |
import javax.validation.Payload; | |
import static java.lang.annotation.ElementType.ANNOTATION_TYPE; | |
import static java.lang.annotation.ElementType.CONSTRUCTOR; | |
import static java.lang.annotation.ElementType.FIELD; |
Openshift helpers:
oc-pod-name app_name [namespace]
oc-logs app_name [namespace]
oc-tunnel namespace app_name port
oc-tunnel namespace app_name s_port:d_port
-- vtw_id data | |
-- exam_1 {items: [q1,q2,q3]} | |
-- exam_2 {items: [q3,q4]} | |
-- quiz_3 {examVtwId: ['exam_1', 'exam_2']} | |
-- quiz_4 {examVtwId: ['exam_2'] } | |
-- Result: | |
-- quiz_vtw total_question count(exam) | |
-- quiz_4 2 1 | |
-- quiz_3 5 2 |
public class JsonNodeHelper { | |
/** | |
* remove recursively all blank nodes (null, missed, array/object with size 0 and blank text) | |
* | |
* @param node target node where need to remove blank nodes | |
*/ | |
public static void removeBlankNodes(JsonNode node) { | |
if (node == null) { | |
return; | |
} |
[core] | |
excludesfile = ~/.gitignore | |
autocrlf = input | |
editor = vim | |
[user] | |
name = Ievgen.Pianov | |
email = pyanov.eugen@gmail.com | |
[alias] | |
sync = pull --rebase origin develop | |
unstash = stash apply |
public final class SmartLoggerFactory { | |
public static org.slf4j.Logger getLogger() { | |
final Throwable ex = new Throwable(); | |
ex.fillInStackTrace(); | |
String clazz = ex.getStackTrace()[1].getClassName(); | |
return org.slf4j.LoggerFactory.getLogger(clazz); | |
} | |
private SmartLoggerFactory() { |
@Component | |
public class CompositeValidator implements SmartValidator { | |
@Autowired | |
private List<Validator> validators = Collections.emptyList(); | |
@PostConstruct | |
public void init() { | |
Collections.sort(validators, AnnotationAwareOrderComparator.INSTANCE); | |
} |
import java.io.IOException; | |
import org.joda.time.DateTimeZone; | |
import org.joda.time.LocalDate; | |
import org.joda.time.Period; | |
import com.fasterxml.jackson.databind.JsonNode; | |
import com.github.fge.jackson.JsonLoader; | |
import com.github.fge.jackson.NodeType; | |
import com.github.fge.jsonschema.cfg.ValidationConfiguration; | |
import com.github.fge.jsonschema.core.exceptions.ProcessingException; | |
import com.github.fge.jsonschema.core.keyword.syntax.checkers.helpers.TypeOnlySyntaxChecker; |