This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package iais.spark_dataset; | |
import java.math.BigInteger; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.apache.log4j.Level; | |
import org.apache.log4j.Logger; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package iais.spark_dataset; | |
import static org.apache.spark.sql.functions.*; | |
import java.math.BigInteger; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.util.HashMap; | |
import java.util.Map; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provider "virtualbox" do |vb| | |
vb.gui = true | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package eu.datacron.wayeb.flink.utils; | |
import java.io.BufferedWriter; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.io.PrintWriter; | |
import java.lang.reflect.Field; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.nio.file.StandardOpenOption; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.qadah.slack; | |
import com.fasterxml.jackson.core.JsonProcessingException; | |
import com.fasterxml.jackson.databind.DeserializationFeature; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.web.client.RestTemplateBuilder; | |
import org.springframework.http.HttpEntity; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Ehab Qadah | |
*/ | |
@RestController | |
@RequestMapping(path = {"/api/v1/orders"}, produces = APPLICATION_JSON_VALUE) | |
public class OrderController { | |
private static final Logger logger = | |
LoggerFactory.getLogger(OrderController.class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* <p> Root entity for object persistence via JPA.</p> | |
* | |
* @author Ehab Qadah | |
*/ | |
@MappedSuperclass | |
public abstract class BaseEntity { | |
@Id | |
@GeneratedValue(generator = "custom-generator", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A custom Id generator based on combination of long time hex string and UUID | |
* | |
* @author Ehab Qadah | |
*/ | |
public class BaseIdentifierGenerator extends UUIDGenerator { | |
private static final int NUMBER_OF_CHARS_IN_ID_PART = -5; | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* * Handle all exceptions and java bean validation errors | |
* for all endpoints income data that use the @Valid annotation | |
* | |
* @author Ehab Qadah | |
*/ | |
@ControllerAdvice | |
public class GeneralExceptionHandler extends ResponseEntityExceptionHandler { | |
public static final String ACCESS_DENIED = "Access denied!"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Incoming DTO to create a new record of {@link com.qadah.demo.data.model.Order} | |
* | |
* @author Ehab Qadah | |
*/ | |
public class OrderIncomingDto { | |
@JsonProperty(required = true) | |
@NotEmpty | |
@NotBlank |
OlderNewer