Commit 23f299d5 authored by ctorres's avatar ctorres

Initial commit

parents
Pipeline #317 failed with stages
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
FROM java:openjdk-8-jdk-alpine
MAINTAINER schicoma@bytesw.com
USER root
#RUN yum -y install java-1.8.0-openjdk
RUN apk add --update curl && \
rm -rf /var/cache/apk/*
RUN export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:/bin/java::")
RUN export PATH=$JAVA_HOME/bin:$PATH
# VOLUME /tmp
RUN echo 'target/bytebot-service-1.0.1-SNAPSHOT.jar'
COPY 'target/bytebot-service-1.0.1-SNAPSHOT.jar' app.jar
# ENV JAVA_OPTS="-Xms512m -Xmx1024m"
EXPOSE 8080
EXPOSE 8443
EXPOSE 22
ENTRYPOINT [ "sh", "-c", "java -Djava.security.egd=file:/dev/./urandom -jar /app.jar" ]
FROM python:3.8-slim
USER root
COPY . .
RUN apt update && \
apt install -y nano curl awscli
RUN chmod +x entrypoint.sh
RUN mkdir /data
VOLUME [ "/data" ]
CMD ["sh","entrypoint.sh"]
\ No newline at end of file
pipeline {
agent any
parameters {
string(defaultValue: 'no', description: 'Ejecuta los procesos docker', name: 'include_docker')
}
environment {
IMAGE = readMavenPom().getArtifactId()
VERSION = readMavenPom().getVersion()
url = "http://192.168.27.148:5000"
tag_name = "192.168.27.148:5000"
imagename = "${tag_name}/bytesw/${IMAGE}"
credentials = "admin-docker-hub"
}
tools {
maven 'Maven'
jdk "jdk-11.0.1"
jdk "jdk8"
}
stages {
stage ('Initialize') {
steps {
sh '''
echo "PATH = ${PATH}"
echo "M2_HOME = ${M2_HOME}"
'''
}
}
stage('Build') {
steps {
withMaven(maven: 'Maven', mavenSettingsConfig: '2ea57b6f-d6f0-42bc-9770-f24d4170a439') {
sh 'mvn -B -DskipTests clean package'
}
}
}
stage('Test') {
steps {
withMaven(maven: 'Maven', mavenSettingsConfig: '2ea57b6f-d6f0-42bc-9770-f24d4170a439') {
sh 'mvn test'
}
}
post {
always {
junit 'target/surefire-reports/*.xml'
}
}
}
/* stage('Code Quality Check via SonarQube') {
steps {
withEnv(["JAVA_HOME=${tool 'jdk8'}", "PATH=${tool 'jdk8'}/bin:${env.PATH}"]) {
withMaven(maven: 'Maven', mavenSettingsConfig: '2ea57b6f-d6f0-42bc-9770-f24d4170a439') {
sh 'mvn -DskipTests sonar:sonar \
-Dsonar.projectKey=bytebot-service_$BRANCH_NAME \
-Dsonar.projectName=bytebot-service_$BRANCH_NAME \
-Dsonar.sources=src/main/java/ \
-Dsonar.language=java \
-Dsonar.java.binaries=target/classes \
-Dsonar.junit.reportsPath=target/surefire-reports \
-Dsonar.jacoco.reportPaths=target/jacoco.exec \
-Dsonar.cobertura.reportPath=target/site/cobertura/coverage.xml \
-Dsonar.clover.reportPath=target/clover.xml \
-Dsonar.dynamicAnalysis=reuseReports \
-Dsonar.java.coveragePlugin=plugin \
-Dsonar.jacoco.reportMissing.force.zero=true \
-Dsonar.host.url=http://byteswpe-sonar.tbs.com:9000 \
-Dsonar.login=d09303420d51f36385b4613d29ee98978ca2ebe4'
}}
}
} */
stage('Deploy') {
steps {
withMaven(maven: 'Maven', mavenSettingsConfig: '2ea57b6f-d6f0-42bc-9770-f24d4170a439') {
sh 'mvn -DskipTests deploy'
}
}
}
stage('Build Docker Image') {
when {
expression { params.include_docker == 'yes' }
}
steps {
withMaven(maven: 'Maven', mavenSettingsConfig: '2ea57b6f-d6f0-42bc-9770-f24d4170a439') {
sh 'mvn clean install -DskipTests -P docker'
}
}
}
stage('Deploy Image') {
when {
expression { params.include_docker == 'yes' }
}
steps{
script {
docker.withRegistry(url, credentials ) {
sh "docker push ${imagename}:${VERSION}"
sh "docker tag ${imagename}:${VERSION} ${imagename}:latest"
sh "docker push ${imagename}:latest"
}
}
}
}
stage('Remove Unused docker image') {
when {
expression { params.include_docker == 'yes' }
}
steps {
sh "docker rmi ${imagename}:latest"
sh "docker rmi ${imagename}:${VERSION}"
}
}
}
post {
always {
echo 'Confirmación de ejecución!'
emailext body: "${currentBuild.currentResult}: Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}\n More info at: ${env.BUILD_URL}",
recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class: 'RequesterRecipientProvider']],
subject: "Jenkins Build ${currentBuild.currentResult}: Job ${env.JOB_NAME}",
to: '$DEFAULT_RECIPIENTS'
}
}
}
DROP TABLE IF EXISTS `PILO_ENTITY` CASCADE;
DROP TABLE IF EXISTS `TiposDeMotivo` CASCADE;
DROP TABLE IF EXISTS `XDF_ENTIDADES` CASCADE;
DROP TABLE IF EXISTS `Estados` CASCADE;
DROP TABLE IF EXISTS `Motivos` CASCADE;
CREATE TABLE PILO_ENTITY
(
`ENT_ID` BIGINT NOT NULL COMMENT 'Identificador único del tipo de la entidad, secuencial auto generado.',
`ENT_NAME` VARCHAR(50) NOT NULL COMMENT 'Nombre de la entidad.',
`ENT_DESC` VARCHAR(50) NOT NULL COMMENT 'Descripción de la entidad',
CONSTRAINT `PK_Entidades` PRIMARY KEY (`ENT_ID` ASC)
)
COMMENT='Catálogo de entidades del sistema'
;
CREATE TABLE `Estados`
(
`idEstado` BIGINT NOT NULL,
`idEntidad` BIGINT NULL,
`codEstado` BIGINT NULL,
`aliasEstado` VARCHAR(20) NULL,
`descEstado` VARCHAR(50) NULL,
CONSTRAINT `PK_Estados` PRIMARY KEY (`idEstado` ASC)
)
;
CREATE TABLE `Motivos`
(
`idMotivo` BIGINT NOT NULL COMMENT 'Identificador de motivo, secuencial auto generado.',
`codMotivo` BIGINT NULL COMMENT 'Código de motivo para el negocio.',
`descMotivo` VARCHAR(50) NULL COMMENT 'Descripción motivo.',
`idTipoDeMotivo` BIGINT NULL,
CONSTRAINT `PK_Motivos` PRIMARY KEY (`idMotivo` ASC)
)
COMMENT='Motivos para usos varios.'
;
CREATE TABLE `TiposDeMotivo`
(
`idTipoDeMotivo` BIGINT NOT NULL COMMENT 'Identificador único del tipo de motivo, secuencial auto generado.',
`codTipoDeMotivo` BIGINT NOT NULL COMMENT 'Código del tipo de motivo para el negocio.',
`descTipoDeMotivo` VARCHAR(50) NOT NULL COMMENT 'Descripción del tipo de motivo.',
`aliasTipoDeMotivo` VARCHAR(20) NOT NULL COMMENT 'Alias del tipo de motivo para uso desde el sistema.',
CONSTRAINT `PK_TiposDeMotivo` PRIMARY KEY (`idTipoDeMotivo` ASC)
)
COMMENT='Agrupan los motivos.'
;
\ No newline at end of file
#!/bin/bash
aws s3 sync s3://$bucket$path /data/$directory/
while :
do
echo "Container is still running"
sleep 5
done
\ No newline at end of file
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
fi
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=`cygpath --path --windows "$javaClass"`
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%
<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<netbeans.hint.jdkPlatform>JDK_1.8</netbeans.hint.jdkPlatform>
</properties>
</project-shared-configuration>
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>run</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath com.bytesw.bytebot.BytebotApplication -Djasypt.encryptor.password=179CD78D24F9BC63D6E677272D1A7 -Xms256M -Xmx512M</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
<action>
<actionName>debug</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</goal>
</goals>
<properties>
<exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath com.bytesw.bytebot.BytebotApplication -Djasypt.encryptor.password=179CD78D24F9BC63D6E677272D1A7 -Xms256M -Xmx512M</exec.args>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
</properties>
</action>
<action>
<actionName>profile</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath com.bytesw.bytebot.BytebotApplication -Djasypt.encryptor.password=179CD78D24F9BC63D6E677272D1A7 -Xms256M -Xmx512M</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
</actions>
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>CUSTOM-clean install no test</actionName>
<displayName>clean install no test</displayName>
<goals>
<goal>clean</goal>
<goal>install</goal>
</goals>
<properties>
<skipTests>true</skipTests>
<dockerfile.skip>true</dockerfile.skip>
</properties>
</action>
<action>
<actionName>CUSTOM-basic cobertura</actionName>
<displayName>basic cobertura</displayName>
<goals>
<goal>cobertura:cobertura</goal>
</goals>
</action>
</actions>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>com.bytesw.bytebot</groupId>
<modelVersion>4.0.0</modelVersion>
<artifactId>bytebot-service</artifactId>
<version>1.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<xdf.version>3.4.0</xdf.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<camel.version>2.22.0</camel.version>
<mainclass>com.bytesw.bytebot.BytebotApplication</mainclass>
<docker.image.prefix>192.168.27.148:5000/bytesw</docker.image.prefix>
<docker.image.name>bytebot-service</docker.image.name>
<packaging.type>war</packaging.type>
<json-path.version>2.4.0</json-path.version>
<org.everit.json.schema.version>1.5.1</org.everit.json.schema.version>
<jacoco.version>0.8.5</jacoco.version>
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.jacoco.reportPath>${project.basedir}/../target/jacoco.exec</sonar.jacoco.reportPath>
<sonar.language>java</sonar.language>
<sonar.exclusions></sonar.exclusions>
</properties>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>com.bytesw.xdf</groupId>
<artifactId>byteXDF4Java-coreweb</artifactId>
<version>${xdf.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-websocket</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
<version>7.37.0.Final</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>${json-path.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.retry</groupId>
<artifactId>spring-retry</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-batch</artifactId>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.everit.json</groupId>
<artifactId>org.everit.json.schema</artifactId>
<version>${org.everit.json.schema.version}</version>
</dependency>
<!-- Inicio de Lock para scheduling -->
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-spring</artifactId>
<version>4.30.0</version>
</dependency>
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-provider-jdbc-template</artifactId>
<version>4.30.0</version>
</dependency>
<!-- Fin de Lock para scheduling -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.3.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth.boot</groupId>
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- camel -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-ftp</artifactId>
<version>${camel.version}</version>
</dependency>
<!-- test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.cobertura</groupId>
<artifactId>cobertura</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jparams</groupId>
<artifactId>to-string-verifier</artifactId>
<version>1.4.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.18</version>
</dependency>
<dependency>
<groupId>org.postgis</groupId>
<artifactId>postgis-jdbc</artifactId>
<version>1.3.3</version>
</dependency>
<!-- websocket-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
<version>2.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator-core</artifactId>
<version>0.37</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>sockjs-client</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>stomp-websocket</artifactId>
<version>2.3.3</version>
</dependency>
<!-- fin de web sockets -->
<!-- ibatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/com.twilio.sdk/twilio -->
<dependency>
<groupId>com.twilio.sdk</groupId>
<artifactId>twilio</artifactId>
<version>8.22.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk -->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.12.129</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.2.5.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.codehaus.mojo</groupId>-->
<!-- <artifactId>cobertura-maven-plugin</artifactId>-->
<!-- <version>2.7</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <id>cobertura</id>-->
<!-- <phase>test</phase>-->
<!-- <goals>-->
<!-- <goal>cobertura</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- <formats>-->
<!-- <format>xml</format>-->
<!-- <format>html</format>-->
<!-- </formats>-->
<!-- </configuration>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<runOrder>random</runOrder>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<phase>test-compile</phase>
</execution>
<execution>
<id>jacoco-site</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>docker</id>
<activation>
<property>
<name>docker</name>
</property>
</activation>
<properties>
<packaging.type>jar</packaging.type>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-spi</artifactId>
<version>1.15</version>
</dependency>
<dependency>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-core</artifactId>
<version>1.15</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.3.6</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<repository>${docker.image.prefix}/${docker.image.name}</repository>
<tag>${project.version}</tag>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>default</id>
<activation>
<property>
<name>default</name>
</property>
</activation>
<properties>
<packaging.type>jar</packaging.type>
</properties>
<dependencies>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>4.16</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<warSourceExcludes>**/jboss-web.xml</warSourceExcludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>weblogic</id>
<activation>
<property>
<name>weblogic</name>
</property>
</activation>
<properties>
<packaging.type>war</packaging.type>
</properties>
<dependencies>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>4.16</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<warSourceExcludes>**/jboss-web.xml</warSourceExcludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>nexus</id>
<activation>
<property>
<name>nexus</name>
</property>
</activation>
<properties>
<packaging.type>jar</packaging.type>
</properties>
<dependencies>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>4.16</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
<!-- SOPORTE AL XDF -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.bytesw.xdf</groupId>
<artifactId>byteXDF4Java-arq</artifactId>
<version>${xdf.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<distributionManagement>
<repository>
<id>maven-releases</id>
<name>Repository Release</name>
<url>http://byteswpe-nexus.tbs.com:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>maven-snapshots</id>
<name>RepositoryProxy</name>
<url>http://byteswpe-nexus.tbs.com:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
</project>
package com.bytesw.bytebot;
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.ImportResource;
@SpringBootApplication(scanBasePackages = "com.bytesw")
@ImportResource("classpath:application-config.xml")
@EnableCaching
@EnableAspectJAutoProxy
@EnableFeignClients(basePackages = "com.bytesw")
@EnableBatchProcessing
public class BytebotApplication {
public static void main(String[] args) {
SpringApplication.run(BytebotApplication.class, args);
}
}
package com.bytesw.bytebot.config;
import com.bytesw.bytebot.routes.SFTPRoute;
import lombok.extern.log4j.Log4j2;
import org.apache.camel.CamelContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import javax.annotation.PostConstruct;
@Configuration
@Log4j2
public class CamelConfig {
@Autowired
private CamelContext camelContext;
@Autowired
private SFTPRoute sftpRoute;
@PostConstruct
public void addBuilder() throws Exception {
camelContext.addRoutes(sftpRoute);
}
}
package com.bytesw.bytebot.controller;
import com.google.gson.GsonBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
@RestController
public class AppSettingsController {
@Value("${application.logo.type:png}")
private String type;
@Value("classpath:logo.txt")
Resource resourceFile;
@Value("${application.show-side-bar:true}")
private boolean showSideBar;
@Autowired
private GsonBuilder gsonBuilder;
@GetMapping("/settings/information")
public ResponseEntity<String> getAppSettings() {
HttpStatus hs = HttpStatus.OK;
Map<String, Object> appSettings = new HashMap<>();
appSettings.put("tipo", type);
appSettings.put("logoBase64", getDefaultLogo());
//you
// appSettings.put("showSideBar", true);
return new ResponseEntity<>(gsonBuilder.disableHtmlEscaping().create().toJson(appSettings), hs);
}
public String getDefaultLogo() {
String str = "";
StringBuffer buf = new StringBuffer();
InputStream is = null;
try {
is = resourceFile.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8));
if (is != null) {
while ((str = reader.readLine()) != null) {
buf.append(str + "" );
}
}
} catch (IOException ex) {
ex.printStackTrace();
} finally {
try { is.close(); } catch (Throwable ignore) {}
}
return buf.toString();
}
}
package com.bytesw.bytebot.controller.airport;
import com.bytesw.bytebot.dto.AeropuertoDTO;
import com.bytesw.bytebot.dto.DataPage;
import com.bytesw.bytebot.service.aeropuerto.AeropuertoServiceImpl;
import com.bytesw.xdf.controller.BasicXDFController;
import com.bytesw.xdf.controller.XDFController;
import com.bytesw.xdf.sql.beans.Pagination;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/service/aeropuerto")
public class AeropuertoController extends BasicXDFController<AeropuertoDTO,Integer> {
@Autowired
private AeropuertoServiceImpl aeropuertoService;
@Autowired
private GsonBuilder gsonBuilder;
public AeropuertoController(AeropuertoServiceImpl aeropuertoService){
super(aeropuertoService);
}
public ResponseEntity<String> findAllByPagination(@RequestBody Pagination<AeropuertoDTO> pagination) {
Gson gson = gsonBuilder.create();
DataPage<AeropuertoDTO> value = new DataPage<>();
value.setData(aeropuertoService.getAll());
return new ResponseEntity(value, HttpStatus.OK);
}
}
package com.bytesw.bytebot.controller.airport;
import com.bytesw.bytebot.dto.AgenteReservaDTO;
import com.bytesw.bytebot.dto.DataPage;
import com.bytesw.bytebot.service.AgenteServiceImpl;
import com.bytesw.xdf.controller.BasicXDFController;
import com.bytesw.xdf.sql.beans.Pagination;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/service/agente")
public class AgenteController extends BasicXDFController<AgenteReservaDTO,Integer> {
@Autowired
private AgenteServiceImpl agenteService;
@Autowired
private GsonBuilder gsonBuilder;
public AgenteController(AgenteServiceImpl agenteService){
super(agenteService);
}
public ResponseEntity<String> findAllByPagination(@RequestBody Pagination<AgenteReservaDTO> pagination) {
Gson gson = gsonBuilder.create();
DataPage<AgenteReservaDTO> value = new DataPage<>();
value.setData(agenteService.getAll());
return new ResponseEntity(value, HttpStatus.OK);
}
}
package com.bytesw.bytebot.controller.airport;
import com.bytesw.bytebot.dto.DataPage;
import com.bytesw.bytebot.dto.EscalaDTO;
import com.bytesw.bytebot.dto.ItinerarioReservaDTO;
import com.bytesw.bytebot.model.airport.Escala;
import com.bytesw.bytebot.repository.IEscalaDAO;
import com.bytesw.bytebot.repository.IItinerarioReservaDAO;
import com.bytesw.bytebot.service.EscalaServiceImpl;
import com.bytesw.bytebot.service.ItinerarioReservaServiceImpl;
import com.bytesw.bytebot.service.VueloServiceImpl;
import com.bytesw.xdf.controller.BasicXDFController;
import com.bytesw.xdf.sql.beans.Pagination;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@RestController
@RequestMapping("/service/escala")
public class EscalaController extends BasicXDFController<EscalaDTO,Integer> {
@Autowired
private EscalaServiceImpl escalaService;
@Autowired
private VueloServiceImpl vueloService;
@Autowired
private IItinerarioReservaDAO itinerarioReservaDAO;
@Autowired
private IEscalaDAO iEscalaDAO;
@Autowired
private GsonBuilder gsonBuilder;
public EscalaController(EscalaServiceImpl escalaService){
super(escalaService);
}
public ResponseEntity<String> findAllByPagination(@RequestBody Pagination<EscalaDTO> pagination) {
Gson gson = gsonBuilder.create();
DataPage<EscalaDTO> value = new DataPage<>();
value.setData(escalaService.getAll());
return new ResponseEntity(value, HttpStatus.OK);
}
@GetMapping("listar/{id}/vuelos")
public ResponseEntity<String> listarVuelosByEscalas(@PathVariable(value = "id") Integer id) {
return new ResponseEntity(vueloService.getById(id).getEscalas(), HttpStatus.OK);
}
@PostMapping("/reserva/{id}")
public ResponseEntity<String> addEscala(@PathVariable(value = "id") Integer id, @RequestBody Escala escalaRequest) {
Escala escala = itinerarioReservaDAO.findById(id).map(itinerarioReserva -> {
Integer escalaId = escalaRequest.getId();
Escala _esc = iEscalaDAO.getOne(escalaId);
itinerarioReserva.addEscala(_esc);
itinerarioReservaDAO.save(itinerarioReserva);
return _esc;
}).orElseThrow(null);
return new ResponseEntity( HttpStatus.OK);
}
}
\ No newline at end of file
package com.bytesw.bytebot.controller.airport;
import com.bytesw.bytebot.dto.DataPage;
import com.bytesw.bytebot.dto.ItinerarioReservaDTO;
import com.bytesw.bytebot.dto.PasajeroDTO;
import com.bytesw.bytebot.service.ItinerarioReservaServiceImpl;
import com.bytesw.bytebot.service.PasajeroServiceImpl;
import com.bytesw.xdf.controller.BasicXDFController;
import com.bytesw.xdf.sql.beans.Pagination;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping("/service/itinerarios")
public class ItinerarioReservaController extends BasicXDFController<ItinerarioReservaDTO,Integer> {
@Autowired
private ItinerarioReservaServiceImpl itinerarioReservaService;
@Autowired
private GsonBuilder gsonBuilder;
public ItinerarioReservaController(ItinerarioReservaServiceImpl itinerarioReservaService){
super(itinerarioReservaService);
}
public ResponseEntity<String> findAllByPagination(@RequestBody Pagination<ItinerarioReservaDTO> pagination) {
Gson gson = gsonBuilder.create();
DataPage<ItinerarioReservaDTO> value = new DataPage<>();
value.setData(itinerarioReservaService.getAll());
return new ResponseEntity(value, HttpStatus.OK);
}
public ResponseEntity<String> findAll(HttpServletRequest req) {
return new ResponseEntity(this.itinerarioReservaService.getAll(), HttpStatus.OK);
}
public ResponseEntity<String> findOne(@PathVariable("id") Integer id, HttpServletRequest req) {
return new ResponseEntity(this.itinerarioReservaService.getById(id), HttpStatus.OK);
}
}
package com.bytesw.bytebot.controller.airport;
import com.bytesw.bytebot.dto.DataPage;
import com.bytesw.bytebot.dto.PagoDTO;
import com.bytesw.bytebot.dto.PasajeroDTO;
import com.bytesw.bytebot.model.airport.Pago;
import com.bytesw.bytebot.repository.IItinerarioReservaDAO;
import com.bytesw.bytebot.repository.IPagoDAO;
import com.bytesw.bytebot.service.PagoServiceImpl;
import com.bytesw.bytebot.service.PasajeroServiceImpl;
import com.bytesw.xdf.controller.BasicXDFController;
import com.bytesw.xdf.sql.beans.Pagination;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/service/pago")
public class PagoController extends BasicXDFController<PagoDTO,Integer> {
@Autowired
private PagoServiceImpl pagoService;
@Autowired
private GsonBuilder gsonBuilder;
@Autowired
private IItinerarioReservaDAO itinerarioReservaDAO;
@Autowired
private IPagoDAO pagoDAO;
public PagoController(PagoServiceImpl pagoService){
super(pagoService);
}
public ResponseEntity<String> findAllByPagination(@RequestBody Pagination<PagoDTO> pagination) {
Gson gson = gsonBuilder.create();
DataPage<PagoDTO> value = new DataPage<>();
value.setData(pagoService.getAll());
return new ResponseEntity(value, HttpStatus.OK);
}
@PostMapping("/reservas/{id}/pagos")
public ResponseEntity<String> addTag(@PathVariable(value = "id") Integer id, @RequestBody Pago pagoRequest) {
Pago pago = itinerarioReservaDAO.findById(id).map(itinerarioReserva -> {
Integer pagoId = pagoRequest.getId();
Pago _pag = pagoDAO.findById(pagoId).orElseThrow(null);
itinerarioReserva.addPago(_pag);
itinerarioReservaDAO.save(itinerarioReserva);
return _pag;
}).orElseThrow(null);
return new ResponseEntity( HttpStatus.OK);
}
}
package com.bytesw.bytebot.controller.airport;
import com.bytesw.bytebot.dto.AeropuertoDTO;
import com.bytesw.bytebot.dto.DataPage;
import com.bytesw.bytebot.dto.PasajeroDTO;
import com.bytesw.bytebot.service.PasajeroServiceImpl;
import com.bytesw.bytebot.service.aeropuerto.AeropuertoServiceImpl;
import com.bytesw.xdf.controller.BasicXDFController;
import com.bytesw.xdf.controller.XDFController;
import com.bytesw.xdf.sql.beans.Pagination;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@RestController
@RequestMapping("/service/pasajero")
public class PasajeroController extends BasicXDFController<PasajeroDTO,Integer> {
@Autowired
private PasajeroServiceImpl pasajeroService;
@Autowired
private GsonBuilder gsonBuilder;
public PasajeroController(PasajeroServiceImpl pasajeroService){
super(pasajeroService);
}
public ResponseEntity<String> findAllByPagination(@RequestBody Pagination<PasajeroDTO> pagination) {
Gson gson = gsonBuilder.create();
DataPage<PasajeroDTO> value = new DataPage<>();
value.setData(pasajeroService.getAll());
return new ResponseEntity(value, HttpStatus.OK);
}
public ResponseEntity<String> findAll(HttpServletRequest req) {
return new ResponseEntity(this.pasajeroService.getAll(), HttpStatus.OK);
}
}
package com.bytesw.bytebot.controller.airport;
import com.bytesw.bytebot.dto.DataPage;
import com.bytesw.bytebot.dto.PasajeroDTO;
import com.bytesw.bytebot.dto.VueloDTO;
import com.bytesw.bytebot.service.PasajeroServiceImpl;
import com.bytesw.bytebot.service.VueloServiceImpl;
import com.bytesw.bytebot.service.aeropuerto.AeropuertoServiceImpl;
import com.bytesw.xdf.controller.BasicXDFController;
import com.bytesw.xdf.controller.XDFController;
import com.bytesw.xdf.sql.beans.Pagination;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping("/service/vuelo")
public class VueloController extends XDFController<VueloDTO,Integer> {
@Autowired
private VueloServiceImpl vueloService;
@Autowired
private AeropuertoServiceImpl aeropuertoService;
@Autowired
private GsonBuilder gsonBuilder;
public VueloController(VueloServiceImpl vueloService){
super(vueloService);
}
public ResponseEntity<String> findAllByPagination(@RequestBody Pagination<VueloDTO> pagination) {
Gson gson = gsonBuilder.create();
DataPage<VueloDTO> value = new DataPage<>();
value.setData(vueloService.getAll());
return new ResponseEntity(value, HttpStatus.OK);
}
public ResponseEntity<String> findAll(HttpServletRequest req) {
return new ResponseEntity(this.vueloService.getAll(), HttpStatus.OK);
}
public ResponseEntity<String> findOne(@PathVariable("id") Integer id, HttpServletRequest req) {
return new ResponseEntity(this.vueloService.getById(id), HttpStatus.OK);
}
}
\ No newline at end of file
package com.bytesw.bytebot.controller.bean;
import com.google.gson.annotations.Expose;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
/**
* @author Sebastian Chicoma Sandmann.
* @version 09-sep-2020
*
* Copyright (c) 2020 Byte, S.A. Todos los derechos reservados.
*
* Este software constituye información confidencial y propietaria de Byte, S.A.
* ("Información Confidencial"). Usted no debe develar dicha Información
* Confidencial y debe usarla de acuerdo con los términos de aceptación de
* licencia de uso que firmó con Byte.
*
*/
@Getter
@Setter
@ToString
public class ResponseController implements Serializable {
@Expose
private String message;
@Expose
private int statusCode;
@Expose
private Object additionalData;
public ResponseController() {
}
public ResponseController(String message, int statusCode) {
this.message = message;
this.statusCode = statusCode;
}
public ResponseController(String message, int statusCode, Object additionalData) {
this.message = message;
this.statusCode = statusCode;
this.additionalData = additionalData;
}
}
package com.bytesw.bytebot.controller.sso;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.security.Principal;
@Controller
@Log4j2
@ConditionalOnProperty(
name="application.services.security",
havingValue = "oauth2sso",
matchIfMissing = false)
public class LoginController {
@RequestMapping(value = {"/home"}, method = RequestMethod.GET)
public final String home(HttpServletRequest request, HttpServletResponse response, Principal principal) {
System.out.println("* home *****> " + request.getSession(false).getId());
System.out.println(request.getSession().getAttribute("username"));
return "home";
}
@RequestMapping(value = {"/mylogin"})
public final String mylogin(HttpServletRequest request, HttpServletResponse response) throws IOException {
System.out.println("* mylogin *****> " + request.getSession(false).getId());
System.out.println(request.getSession().getAttribute("username"));
return "home";
}
}
package com.bytesw.bytebot.controller.sso;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.security.Principal;
/**
* @author Marco A. Ortíz García
* @version 2019-03-16.
* <p>
* <p>
* Copyright (c) 2018 Byte, S.A. Todos los derechos reservados.
* <p>
* Este software constituye información confidencial y propietaria de Byte, S.A.
* ("Información Confidencial"). Usted no debe develar dicha Información
* Confidencial y debe usarla de acuerdo con los términos de aceptación de
* licencia de uso que firmó con Byte.
*/
@Controller
@ConditionalOnProperty(
name="application.services.security",
havingValue = "oauth2sso",
matchIfMissing = false)
@Log4j2
public class LogoutController {
@Value("${application.services.security.token-key:#{null}}")
private String tokenKey;
@RequestMapping(value = {"/goodbye"}, method = RequestMethod.GET)
public final String goodbye(HttpServletRequest request, HttpServletResponse response, Principal principal, Model model) {
model.addAttribute("token", tokenKey != null);
return "goodbye";
}
}
package com.bytesw.bytebot.controller.sso;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.security.Principal;
@Controller
@ConditionalOnProperty(
name="application.services.security",
havingValue = "oauth2sso",
matchIfMissing = false)
@Log4j2
public class TokenFailController {
@RequestMapping(value = {"/token-fail"}, method = RequestMethod.GET)
public final String goodbye(HttpServletRequest request, HttpServletResponse response, Principal principal) {
return "/token-fail";
}
}
package com.bytesw.bytebot.dto;
import com.google.gson.annotations.Expose;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
@Getter
@Setter
@ToString
public class AeropuertoDTO implements Serializable {
@Expose
private Integer id;
@Expose
private String codigo;
@Expose
private String nombre;
@Expose
private String localizacion;
@Expose
private String detalles;
}
package com.bytesw.bytebot.dto;
import com.google.gson.annotations.Expose;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
@Getter
@Setter
@ToString
public class AgenteReservaDTO implements Serializable {
@Expose
private Integer id;
@Expose
private String nombre;
@Expose
private String apellido;
@Expose
private String dni;
@Expose
private String telefono;
@Expose
private String detalles;
}
package com.bytesw.bytebot.dto;
import com.google.gson.annotations.Expose;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.List;
@Getter
@Setter
public class DataPage<T> implements Serializable {
@Expose
private List<T> data;
}
package com.bytesw.bytebot.dto;
import com.google.gson.annotations.Expose;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
@Getter
@Setter
@ToString
public class EscalaDTO implements Serializable {
@Expose
private Integer id;
@Expose
private Date fechaSalida;
@Expose
private Date fechaLlegada;
@Expose
private Integer codigoAeropuertoOrigen;
@Expose
private Integer codigoAeropuertoDestino;
@Expose
private Integer codigoVuelo;
@Expose
private String aeropuertoOrigen;
@Expose
private String aeropuertoDestino;
}
package com.bytesw.bytebot.dto;
import com.bytesw.bytebot.model.airport.AgenteReserva;
import com.bytesw.bytebot.model.airport.Escala;
import com.bytesw.bytebot.model.airport.Pago;
import com.bytesw.bytebot.model.airport.Pasajero;
import com.google.gson.annotations.Expose;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Getter
@Setter
@ToString
public class ItinerarioReservaDTO implements Serializable {
@Expose
private Integer id;
@Expose
private Date diaReservacion;
@Expose
private String estado;
@Expose
private Integer codigoPasajero;
@Expose
private Integer codigoAgente;
@Expose
private List<Escala> escalas;
@Expose
private List<Pago> pagos;
}
package com.bytesw.bytebot.dto;
import com.google.gson.annotations.Expose;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
@Getter
@Setter
@ToString
public class PagoDTO implements Serializable {
@Expose
private Integer id;
@Expose
private Date fecha;
@Expose
private double pago;
@Expose
private String estado;
}
package com.bytesw.bytebot.dto;
import com.bytesw.bytebot.model.airport.ItinerarioReserva;
import com.google.gson.annotations.Expose;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@Getter
@Setter
@ToString
public class PasajeroDTO implements Serializable {
@Expose
private Integer id;
@Expose
private String primerNombre;
@Expose
private String segundoNombre;
@Expose
private String apellido;
@Expose
private String telefono;
@Expose
private String correo;
@Expose
private String direccion;
@Expose
private String ciudad;
@Expose
private String provincia;
@Expose
private String pais;
@Expose
private String detalles;
@Expose
private List<ItinerarioReserva> itinerarioReservas = new ArrayList<>();
}
package com.bytesw.bytebot.dto;
import com.bytesw.bytebot.model.airport.Aeropuerto;
import com.bytesw.bytebot.model.airport.Escala;
import com.google.gson.annotations.Expose;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Getter
@Setter
@ToString
public class VueloDTO implements Serializable {
@Expose
private Integer id;
@Expose
private double costo;
@Expose
private String codigoAerolinea;
@Expose
private String codigoTipoAeronave;
@Expose
private Date fechaSalida;
@Expose
private Date fechaLlegada;
@Expose
private Integer codigoAeropuertoOrigen;
@Expose
private Integer codigoAeropuertoDestino;
@Expose
private List<Escala> escalas;
@Expose
private String aeropuertoOrigen;
@Expose
private String aeropuertoDestino;
}
//package com.bytesw.bytebot.jdbc;
//
//import com.bytesw.bytebot.bean.ActionSummaryByGoalBean;
//import org.apache.ibatis.session.SqlSession;
//import org.apache.ibatis.session.SqlSessionFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.stereotype.Component;
//
//import java.time.OffsetDateTime;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
//@Component
//public class ActionJDBCRepository {
// @Autowired
// @Qualifier("sqlSessionFactory")
// private SqlSessionFactory sqlSessionFactory;
//
// public List<ActionSummaryByGoalBean> getSummaryByGoals(OffsetDateTime startDate, OffsetDateTime endDate) {
// SqlSession session = sqlSessionFactory.openSession();
//
// try {
// Map<String, Object> params = new HashMap<>();
// params.put("startDate", startDate);
// params.put("endDate", endDate);
// return session.selectList("com.bytesw.bytebot.dao.jdbc.ActionMapper.getSummaryActionsByGoal", params);
// } finally {
// session.close();
// }
// }
//}
package com.bytesw.bytebot.model.airport;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.envers.Audited;
import javax.persistence.*;
import java.io.Serializable;
import java.util.List;
@Entity
@Table(name="airports")
@Getter
@Setter
@EqualsAndHashCode
@ToString
public class Aeropuerto implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(name="airport_code")
private String codigo;
@Column(name="airport_name")
private String nombre;
@Column(name="airport_location")
private String localizacion;
@Column(name="other_details")
private String detalles;
@OneToMany(mappedBy = "codigoAeropuertoOrigen", cascade = CascadeType.ALL)
private List<Vuelo> vuelos;
@OneToMany(mappedBy = "codigoAeropuertoDestino", cascade = CascadeType.ALL)
private List<Vuelo> vuelosDes;
@OneToMany(mappedBy = "codigoAeropuertoOrigen", cascade = CascadeType.ALL)
private List<Escala> escalas;
@OneToMany(mappedBy = "codigoAeropuertoDestino", cascade = CascadeType.ALL)
private List<Escala> escalasDes;
}
package com.bytesw.bytebot.model.airport;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import javax.persistence.*;
import java.io.Serializable;
import java.util.List;
@Entity
@Table(name="booking_agents")
@Getter
@Setter
@EqualsAndHashCode
@ToString
public class AgenteReserva implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(name="agent_name")
private String nombre;
@Column(name="agent_lastname")
private String apellido;
@Column(name="agent_dni")
private String dni;
@Column(name="agent_phone")
private String telefono;
@Column(name="agent_details")
private String detalles;
}
package com.bytesw.bytebot.model.airport;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.Expose;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Entity
@Table(name="legs")
@Getter
@Setter
public class Escala implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(name="actual_departure_time")
@Temporal(TemporalType.TIMESTAMP)
private Date fechaSalida;
@Column(name="actual_arrival_time")
@Temporal(TemporalType.TIMESTAMP)
private Date fechaLlegada;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "origin_airport_code")
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private Aeropuerto codigoAeropuertoOrigen;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "destination_airport_code")
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private Aeropuerto codigoAeropuertoDestino;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "flight_number")
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private Vuelo codigoVuelo;
@ManyToMany(fetch = FetchType.LAZY,
cascade = {
CascadeType.PERSIST,
CascadeType.MERGE,
CascadeType.ALL
},
mappedBy = "escalas")
@JsonIgnore
private List<ItinerarioReserva> itinerarioReserva;
}
package com.bytesw.bytebot.model.airport;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Entity
@Table(name="itinerary_reservations")
@Getter
@Setter
public class ItinerarioReserva implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "reservation_id", nullable = false)
private Integer id;
@Column(name="date_reservation_made")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date diaReservacion;
@Column(name="reservation_status_code")
private String estado;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "pasajero_id", referencedColumnName = "id")
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private Pasajero pasajero;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "agente_id")
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private AgenteReserva agente;
@ManyToMany(fetch = FetchType.LAZY,
cascade = {
CascadeType.PERSIST,
CascadeType.MERGE,
CascadeType.ALL
})
@JoinTable(name = "itinerary_legs",
joinColumns = { @JoinColumn(name = "reservation_id") },
inverseJoinColumns = { @JoinColumn(name = "leg_id") })
private List<Escala> escalas;
@ManyToMany(fetch = FetchType.LAZY,
cascade = {
CascadeType.PERSIST,
CascadeType.MERGE
})
@JoinTable(name = "reservation_payments",
joinColumns = { @JoinColumn(name = "reservation_id") },
inverseJoinColumns = { @JoinColumn(name = "payment_id") })
private List<Pago> pagos;
@PrePersist
public void prePersist(){
diaReservacion = new Date();
}
public void addEscala(Escala escala) {
this.escalas.add(escala);
escala.getItinerarioReserva().add(this);
}
public void addPago(Pago pago) {
this.pagos.add(pago);
pago.getItinerarioReserva().add(this);
}
}
package com.bytesw.bytebot.model.airport;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Entity
@Table(name="payments")
@Getter
@Setter
@EqualsAndHashCode
@ToString
public class Pago implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "payment_id")
private Integer id;
@Column(name="payment_date")
@Temporal(TemporalType.TIMESTAMP)
private Date fecha;
@Column(name="payment_amount")
private double pago;
@Column(name="payment_status_code")
private String estado;
@ManyToMany(fetch = FetchType.LAZY,
cascade = {
CascadeType.PERSIST,
CascadeType.MERGE,
CascadeType.ALL
},
mappedBy = "pagos")
@JsonIgnore
private List<ItinerarioReserva> itinerarioReserva;
@PrePersist
public void prePersist(){
fecha = new java.util.Date();
}
}
package com.bytesw.bytebot.model.airport;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.*;
import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@Entity
@Table(name="passengers")
@Getter
@Setter
public class Pasajero implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name="id")
private Integer id;
@Column(name="first_name")
private String primerNombre;
@Column(name="second_name")
private String segundoNombre;
@Column(name="last_name")
private String apellido;
@Column(name="phone_number")
private String telefono;
@Column(name="email_address")
private String correo;
@Column(name="address_lines")
private String direccion;
@Column(name="city")
private String ciudad;
@Column(name="state_province_country")
private String provincia;
@Column(name="country")
private String pais;
@Column(name="other_passenger_details")
private String detalles;
@OneToMany(mappedBy = "pasajero")
private List<ItinerarioReserva> itinerarioReservas = new ArrayList<>();
}
package com.bytesw.bytebot.model.airport;
import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Entity
@Table(name="flight_schedules")
@Getter
@Setter
@EqualsAndHashCode
@ToString
public class Vuelo implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(name="flight_cost")
private double costo;
@Column(name="airline_code")
private String codigoAerolinea;
@Column(name="usual_aircraft_type_code")
private String codigoTipoAeronave;
@Column(name="departure_date_time")
@Temporal(TemporalType.TIMESTAMP)
private Date fechaSalida;
@Column(name="arrival_date_time")
@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date fechaLlegada;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "origin_airport_code")
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private Aeropuerto codigoAeropuertoOrigen;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "destination_airport_code")
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private Aeropuerto codigoAeropuertoDestino;
@OneToMany(mappedBy = "codigoVuelo", cascade = CascadeType.ALL)
private List<Escala> escalas;
}
//package com.bytesw.bytebot.model.converters;
//
//import com.bytesw.bytebot.model.enums.AgentStatusEnum;
//import org.apache.camel.Converter;
//
//import javax.persistence.AttributeConverter;
/**
// * @author Sebastian Chicoma Sandmann
// * @version 09-sep-2020
// *
// * Copyright (c) 2020 Byte, S.A. Todos los derechos reservados.
// *
// * Este software constituye información confidencial y propietaria de Byte, S.A.
// * ("Información Confidencial"). Usted no debe develar dicha Información
// * Confidencial y debe usarla de acuerdo con los términos de aceptación de
// * licencia de uso que firmó con Byte.
// */
//@Converter
//public class AgentStatusConverter implements AttributeConverter<AgentStatusEnum, String> {
//
// @Override
// public String convertToDatabaseColumn(AgentStatusEnum value) {
// return value.getName();
// }
//
// @Override
// public AgentStatusEnum convertToEntityAttribute(String value) {
// return AgentStatusEnum.fromString(value);
// }
//}
\ No newline at end of file
package com.bytesw.bytebot.repository;
import com.bytesw.bytebot.model.airport.Aeropuerto;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface IAeropuertoDAO extends CrudRepository<Aeropuerto,Integer> {
}
package com.bytesw.bytebot.repository;
import com.bytesw.bytebot.model.airport.AgenteReserva;
import com.bytesw.bytebot.model.airport.Pasajero;
import org.springframework.data.jpa.repository.JpaRepository;
public interface IAgenteDAO extends JpaRepository<AgenteReserva,Integer> {
}
package com.bytesw.bytebot.repository;
import com.bytesw.bytebot.model.airport.Escala;
import com.bytesw.bytebot.model.airport.Vuelo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.CrudRepository;
import java.util.List;
public interface IEscalaDAO extends JpaRepository<Escala,Integer> {
}
package com.bytesw.bytebot.repository;
import com.bytesw.bytebot.model.airport.AgenteReserva;
import com.bytesw.bytebot.model.airport.ItinerarioReserva;
import org.springframework.data.jpa.repository.JpaRepository;
public interface IItinerarioReservaDAO extends JpaRepository<ItinerarioReserva,Integer> {
}
package com.bytesw.bytebot.repository;
import com.bytesw.bytebot.model.airport.Pago;
import com.bytesw.bytebot.model.airport.Pasajero;
import org.springframework.data.jpa.repository.JpaRepository;
public interface IPagoDAO extends JpaRepository<Pago,Integer> {
}
package com.bytesw.bytebot.repository;
import com.bytesw.bytebot.model.airport.Pasajero;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface IPasajeroDAO extends JpaRepository<Pasajero,Integer> {
}
package com.bytesw.bytebot.repository;
import com.bytesw.bytebot.model.airport.Pasajero;
import com.bytesw.bytebot.model.airport.Vuelo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.CrudRepository;
public interface IVueloDAO extends CrudRepository<Vuelo,Integer> {
}
package com.bytesw.bytebot.routes;
import com.bytesw.xdf.multitenant.core.ThreadLocalStorage;
import org.apache.camel.builder.RouteBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
public class SFTPRoute extends RouteBuilder {
@Value("${application.AVB-integration.ftp.username}")
private String username;
@Value("${application.AVB-integration.ftp.password}")
private String password;
@Value("${application.AVB-integration.ftp.directory:}")
private String directory;
@Value("${application.AVB-integration.ftp.host}")
private String host;
@Value("${application.AVB-integration.ftp.passiveMode:true}")
private boolean passiveMode;
@Value("${application.services.multi-tenant:false}")
private boolean multitenant;
@Override
public void configure() throws Exception {
from("direct:transferFile")
.toF("ftp://%s@%s/%s?password=%s&binary=true&passiveMode=%s", username, host, getDirectory(), password, passiveMode)
.log("Transfered file .${file:name} ");
}
private String getDirectory() {
if (!multitenant || ThreadLocalStorage.getTenantName() == null) {
return directory;
}
return ThreadLocalStorage.getTenantName() + "/" + directory;
}
}
package com.bytesw.bytebot.service;
import com.bytesw.bytebot.dto.AgenteReservaDTO;
import com.bytesw.bytebot.dto.PasajeroDTO;
import com.bytesw.bytebot.model.airport.AgenteReserva;
import com.bytesw.bytebot.model.airport.Pasajero;
import com.bytesw.bytebot.repository.IAgenteDAO;
import com.bytesw.bytebot.repository.IPasajeroDAO;
import com.bytesw.xdf.service.XDFService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class AgenteServiceImpl extends XDFService<AgenteReserva, AgenteReservaDTO,Integer> {
protected AgenteServiceImpl(IAgenteDAO agenteDAO){
super(agenteDAO);
}
@Override
protected AgenteReservaDTO toBean(AgenteReserva model){
AgenteReservaDTO bean = new AgenteReservaDTO();
BeanUtils.copyProperties(model,bean);
return bean;
}
@Override
protected AgenteReserva toModel(AgenteReserva model, AgenteReservaDTO bean){
if(model == null){
model = new AgenteReserva();
}
BeanUtils.copyProperties(bean,model);
return model;
}
}
package com.bytesw.bytebot.service;
import com.bytesw.xdf.dao.rsql.CustomRsqlVisitor;
import com.bytesw.xdf.sql.beans.Pagination;
import com.bytesw.xdf.sql.beans.SortField;
import cz.jirutka.rsql.parser.RSQLParser;
import cz.jirutka.rsql.parser.ast.Node;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import java.util.ArrayList;
import java.util.List;
public abstract class CustomPaginationService<T> {
public Specification<T> createSpecification(final String filterExpression) {
Node rootNode = new RSQLParser().parse(filterExpression);
return rootNode.accept(new CustomRsqlVisitor<>());
}
public Sort createSort(Pagination pagination) {
List<Sort.Order> orderList = new ArrayList<>();
for (SortField sortField : pagination.getSortFields()) {
if ("asc".equalsIgnoreCase(sortField.getDirection())) {
orderList.add(Sort.Order.asc(sortField.getField()));
} else {
orderList.add(Sort.Order.desc(sortField.getField()));
}
}
return Sort.by(orderList);
}
}
\ No newline at end of file
package com.bytesw.bytebot.service;
import com.bytesw.bytebot.dto.AeropuertoDTO;
import com.bytesw.bytebot.dto.EscalaDTO;
import com.bytesw.bytebot.dto.VueloDTO;
import com.bytesw.bytebot.model.airport.Aeropuerto;
import com.bytesw.bytebot.model.airport.Escala;
import com.bytesw.bytebot.model.airport.Vuelo;
import com.bytesw.bytebot.repository.IEscalaDAO;
import com.bytesw.bytebot.service.aeropuerto.AeropuertoServiceImpl;
import com.bytesw.xdf.service.XDFService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class EscalaServiceImpl extends XDFService<Escala, EscalaDTO,Integer> {
@Autowired
private VueloServiceImpl vueloService;
@Autowired
private AeropuertoServiceImpl aeropuertoService;
protected EscalaServiceImpl(IEscalaDAO escalaDAO){
super(escalaDAO);
}
@Override
protected EscalaDTO toBean(Escala model){
EscalaDTO bean = new EscalaDTO();
BeanUtils.copyProperties(model,bean);
bean.setCodigoAeropuertoOrigen(model.getCodigoAeropuertoOrigen().getId());
bean.setCodigoAeropuertoDestino(model.getCodigoAeropuertoDestino().getId());
bean.setAeropuertoOrigen(model.getCodigoAeropuertoOrigen().getCodigo());
bean.setAeropuertoDestino(model.getCodigoAeropuertoDestino().getCodigo());
return bean;
}
@Override
protected Escala toModel(Escala model, EscalaDTO bean){
if(model == null){
model = new Escala();
}
BeanUtils.copyProperties(bean,model);
VueloDTO vueloDTO = vueloService.getById(bean.getCodigoVuelo());
model.setCodigoVuelo(vueloService.toModel(new Vuelo(),vueloDTO));
AeropuertoDTO aeropuertoDTO = aeropuertoService.getById(bean.getCodigoAeropuertoOrigen());
AeropuertoDTO aeropuertoDTO2 = aeropuertoService.getById(bean.getCodigoAeropuertoDestino());
model.setCodigoAeropuertoOrigen(aeropuertoService.toModel(new Aeropuerto(),aeropuertoDTO));
model.setCodigoAeropuertoDestino(aeropuertoService.toModel(new Aeropuerto(), aeropuertoDTO2));
return model;
}
}
package com.bytesw.bytebot.service;
import com.bytesw.bytebot.dto.*;
import com.bytesw.bytebot.model.airport.*;
import com.bytesw.bytebot.repository.IItinerarioReservaDAO;
import com.bytesw.bytebot.service.aeropuerto.AeropuertoServiceImpl;
import com.bytesw.xdf.service.XDFService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
@Transactional
public class ItinerarioReservaServiceImpl extends XDFService<ItinerarioReserva, ItinerarioReservaDTO,Integer> {
@Autowired
private PasajeroServiceImpl pasajeroService;
@Autowired
private AgenteServiceImpl agenteService;
protected ItinerarioReservaServiceImpl(IItinerarioReservaDAO iItinerarioReservaDAO){
super(iItinerarioReservaDAO);
}
@Override
protected ItinerarioReservaDTO toBean(ItinerarioReserva model){
ItinerarioReservaDTO bean = new ItinerarioReservaDTO();
BeanUtils.copyProperties(model,bean);
bean.setCodigoPasajero(model.getPasajero().getId());
bean.setCodigoAgente(model.getAgente().getId());
return bean;
}
@Override
protected ItinerarioReserva toModel(ItinerarioReserva model, ItinerarioReservaDTO bean){
if(model == null){
model = new ItinerarioReserva();
}
BeanUtils.copyProperties(bean,model);
PasajeroDTO pasajeroDTO = pasajeroService.getById(bean.getCodigoPasajero());
AgenteReservaDTO agenteReservaDTO = agenteService.getById(bean.getCodigoAgente());
model.setPasajero(pasajeroService.toModel(new Pasajero(),pasajeroDTO));
model.setAgente(agenteService.toModel(new AgenteReserva(), agenteReservaDTO));
return model;
}
}
\ No newline at end of file
package com.bytesw.bytebot.service;
import com.bytesw.bytebot.dto.AgenteReservaDTO;
import com.bytesw.bytebot.dto.PagoDTO;
import com.bytesw.bytebot.dto.PasajeroDTO;
import com.bytesw.bytebot.model.airport.AgenteReserva;
import com.bytesw.bytebot.model.airport.Pago;
import com.bytesw.bytebot.model.airport.Pasajero;
import com.bytesw.bytebot.repository.IPagoDAO;
import com.bytesw.bytebot.repository.IPasajeroDAO;
import com.bytesw.xdf.service.XDFService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class PagoServiceImpl extends XDFService<Pago, PagoDTO,Integer> {
protected PagoServiceImpl(IPagoDAO pagoDAO){
super(pagoDAO);
}
@Override
protected PagoDTO toBean(Pago model){
PagoDTO bean = new PagoDTO();
BeanUtils.copyProperties(model,bean);
return bean;
}
@Override
protected Pago toModel(Pago model, PagoDTO bean){
if(model == null){
model = new Pago();
}
BeanUtils.copyProperties(bean,model);
return model;
}
}
package com.bytesw.bytebot.service;
import com.bytesw.bytebot.dto.AeropuertoDTO;
import com.bytesw.bytebot.dto.PasajeroDTO;
import com.bytesw.bytebot.model.airport.Aeropuerto;
import com.bytesw.bytebot.model.airport.ItinerarioReserva;
import com.bytesw.bytebot.model.airport.Pasajero;
import com.bytesw.bytebot.repository.IAeropuertoDAO;
import com.bytesw.bytebot.repository.IItinerarioReservaDAO;
import com.bytesw.bytebot.repository.IPasajeroDAO;
import com.bytesw.xdf.service.XDFService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class PasajeroServiceImpl extends XDFService<Pasajero, PasajeroDTO,Integer>{
protected PasajeroServiceImpl(IPasajeroDAO pasajeroDAO){
super(pasajeroDAO);
}
@Override
protected PasajeroDTO toBean(Pasajero model){
PasajeroDTO bean = new PasajeroDTO();
BeanUtils.copyProperties(model,bean);
return bean;
}
@Override
protected Pasajero toModel(Pasajero model, PasajeroDTO bean){
if(model == null){
model = new Pasajero();
}
BeanUtils.copyProperties(bean,model);
return model;
}
}
package com.bytesw.bytebot.service;
import com.bytesw.bytebot.dto.AeropuertoDTO;
import com.bytesw.bytebot.dto.EscalaDTO;
import com.bytesw.bytebot.dto.PasajeroDTO;
import com.bytesw.bytebot.dto.VueloDTO;
import com.bytesw.bytebot.model.airport.Aeropuerto;
import com.bytesw.bytebot.model.airport.Pasajero;
import com.bytesw.bytebot.model.airport.Vuelo;
import com.bytesw.bytebot.repository.IPasajeroDAO;
import com.bytesw.bytebot.repository.IVueloDAO;
import com.bytesw.bytebot.service.aeropuerto.AeropuertoServiceImpl;
import com.bytesw.xdf.service.XDFService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class VueloServiceImpl extends XDFService<Vuelo, VueloDTO,Integer> {
protected VueloServiceImpl(IVueloDAO vueloDAO){
super(vueloDAO);
}
@Autowired
private AeropuertoServiceImpl aeropuertoService;
@Override
protected VueloDTO toBean(Vuelo model){
VueloDTO bean = new VueloDTO();
BeanUtils.copyProperties(model,bean);
bean.setCodigoAeropuertoOrigen(model.getCodigoAeropuertoOrigen().getId());
bean.setCodigoAeropuertoDestino(model.getCodigoAeropuertoDestino().getId());
bean.setAeropuertoOrigen(model.getCodigoAeropuertoOrigen().getCodigo());
bean.setAeropuertoDestino(model.getCodigoAeropuertoDestino().getCodigo());
bean.setEscalas(model.getEscalas());
return bean;
}
@Override
protected Vuelo toModel(Vuelo model, VueloDTO bean){
if(model == null){
model = new Vuelo();
}
BeanUtils.copyProperties(bean,model);
AeropuertoDTO aeropuertoDTO = aeropuertoService.getById(bean.getCodigoAeropuertoOrigen());
AeropuertoDTO aeropuertoDTO2 = aeropuertoService.getById(bean.getCodigoAeropuertoDestino());
model.setCodigoAeropuertoOrigen(aeropuertoService.toModel(new Aeropuerto(),aeropuertoDTO));
model.setCodigoAeropuertoDestino(aeropuertoService.toModel(new Aeropuerto(), aeropuertoDTO2));
return model;
}
}
package com.bytesw.bytebot.service.aeropuerto;
import com.bytesw.bytebot.dto.AeropuertoDTO;
import com.bytesw.bytebot.model.airport.Aeropuerto;
import com.bytesw.bytebot.repository.IAeropuertoDAO;
import com.bytesw.bytebot.service.CustomPaginationService;
import com.bytesw.xdf.service.XDFService;
import com.bytesw.xdf.sql.beans.Pagination;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class AeropuertoServiceImpl extends XDFService<Aeropuerto, AeropuertoDTO,Integer>{
protected AeropuertoServiceImpl(IAeropuertoDAO aeropuertoDAO){
super(aeropuertoDAO);
}
@Override
protected AeropuertoDTO toBean(Aeropuerto model){
AeropuertoDTO bean = new AeropuertoDTO();
BeanUtils.copyProperties(model,bean);
return bean;
}
@Override
public Aeropuerto toModel(Aeropuerto model, AeropuertoDTO bean){
if(model == null){
model = new Aeropuerto();
}
BeanUtils.copyProperties(bean,model);
return model;
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.bytesw.bytebot.utils;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Utilities {
public static String convertDateToString(Date date, String format){
DateFormat formatter = new SimpleDateFormat(format);
return formatter.format(date);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<import resource="classpath:applicationContext-aop.xml" />
<import resource="classpath:applicationContext-datasource.xml" />
<import resource="classpath:applicationContext-scheduler.xml" />
</beans>
spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration
server:
servlet.context-path: ${APPLICATION_PATH:/AVB}
port: ${APPLICATION_PORT:9077}
web:
#static-content-location: file:/home/mgutierrez/Documentos/Bytesw/bytebot-workspace/dist/bytebot-html/
static-content-location: file:/home/charles/Documents/Byte/Angular/bytebot-workspace/dist/bytebot-html/
security:
require-ssl: false
hystrix.shareSecurityContext: true
# oracle
endpoints:
shutdown:
enabled: true
management:
endpoints:
shutdown.enabled: true
web.exposure.include: "*"
application:
byte-bot:
batch:
chunk: 10
cron: 0 0/1 * * * *
show-side-bar: false
test: ENC(OEchnTXpIZnCVdPNthgCZBfQjMt1AUS1)
name: AVB-HDI
license:
applicationId: test
clientId: test
hosts: 38F9D38DD09
type: web # web o service
security:
enabled: true
encryption-key: ENC(0WRfEFi8lYjlJj2bj37z4TRu4zmPnmXl4zM4Jpdh1H8=)*
web:
server: docker # weblogic, docker
ignore:
path: /v2/api-docs, /configuration/**, /swagger-resources/**, /swagger-ui.html, /webjars/**, /api-docs/**, /resources/**, /css/**, /js/**, /fonts/**, /img/**, /modules/**, /system/**, /views/**, /font-awesome/**, /translations/**, /bower_components/**, /cache.manifest, /favicon.ico, /service/file, /providers/**
goodbyeURL: /goodbye
api.info:
title: 'pilotoXDF Service'
description: 'API para el desarrollo de software'
version: '1.0.0'
terms-of-service-url: 'https://es.wikipedia.org/wiki/byteXDF4Java'
license: 'Open source licensing'
license-url: 'https://help.github.com/articles/open-source-licensing/'
services:
multi-tenant-conf:
exclude-service: /
authorization-service.url: http://localhost:17580
security: none #none, basic, oauth2sso
security.method: true
security-exclude: /service/oauth/userinfo, /actuator/**, /mylogout, /login, /logout, /goodbye, /error, /anon, /cache.manifest, /favicon.ico, /service/file, /goodbye /byteboot
messaging:
queue-support: activemq
multi-tenant: false
clustering: true
database: true
send-email: false
jt400: false
rabbitMQ: true
webservices: false
statistics.type: log # database or log
messaging:
queue-test: action_queue.fifo
topic-test: topic-test
AVB-integration:
ftp:
host: localhost
username: ftp
password: ftp
directory: uploadBYTEBOT/IMG/
# email.info:
# smtp:
# host: smtp.gmail.com
# port: 587
# username: mortiz@bytesw-bfm.com
# encrypted.password: ENC(OEchnTXpIZnCVdPNthgCZBfQjMt1AUS1)
# from.email: mortiz@bytesw-bfm.com
# jt400.info:
# username: usuario24
# password: poiuyt5
# host: 192.168.27.30
# queue-name: V4STCPGM.LIB/COLGENESIS.DTAQ
rabbitMQ.info:
host: localhost
port: 8161
queue-name: task_queue
spring:
main:
allow-bean-definition-overriding: true
mbeans.exclude: dataSource
application:
name: AVB-HDI
datasource:
database-type: postgres
schemaName: avb_hdi
url: jdbc:postgresql://localhost:5432/bytebot?useSSL=false&currentSchema=avb_hdi
driverClassName: 'org.postgresql.Driver'
username: postgres
password: postgres
minimum-idle: 10
maximum-pool-size: 10
validationQuery: SELECT 1
testWhileIdle: true
hikari.registerMbeans: true
security:
basepath: http://localhost:9077/AVB
provider: byte # oracle, amazon
oauth2-client:
clientId: xdf-client
clientSecret: xdf-secret
accessTokenUri: http://192.168.0.119:18080/oauth/token
userAuthorizationUri: http://192.168.0.119:18080/oauth/authorize
oauth2-resource:
userInfoUri: http://192.168.0.119:18080/oauth/userinfo
logoutUri: http://192.168.0.119:18080/oauth/userlogout
tenants:
-
id: T186A1
servername: prueba_avb
datasource:
database-type: postgres
schemaName: avb_hdi
url: jdbc:postgresql://localhost:5432/bytebot?useSSL=false&currentSchema=avb_hdi
driverClassName: 'org.postgresql.Driver'
username: postgres
password: postgres
minimum-idle: 10
maximum-pool-size: 10
validationQuery: SELECT 1
testWhileIdle: true
hikari.registerMbeans: true
security:
basepath: http://localhost:9077/AVB
provider: byte # oracle, amazon
oauth2-client:
clientId: xdf-client
clientSecret: xdf-secret
accessTokenUri: http://192.168.0.119:18080/oauth/token
userAuthorizationUri: http://192.168.0.119:18080/oauth/authorize
oauth2-resource:
userInfoUri: http://192.168.0.119:18080/oauth/userinfo
logoutUri: http://192.168.0.119:18080/oauth/userlogout
jpa:
open-in-view: true
properties.hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect #org.hibernate.dialect.MySQL5Dialect
format_sql: false
hbm2ddl.auto: none
jdbc:
lob:
non_contextual_creation: true
show-sql: true
#session.store-type: jdbc
activemq.broker-url: tcp://localhost:8161
logging.level.root: INFO
logging.pattern.console: '%d{dd-MM-yyyy HH:mm:ss.SSS} %magenta([%thread]) %highlight(%-5level) %logger.%M - %msg%n'
logging.level.com.zaxxer.hikari: ERROR
logging.level.springfox.documentation: ERROR
logging.level.org.kie.api.internal: ERROR
logging.level.org.springframework: ERROR
logging.level.org.apache.catalina.core: ERROR
logging.level.org.apache: ERROR
logging.level.org.quartz: ERROR
logging.level.com.bytesw-bfm.xdf.example.security: ERROR
logging.level.net.javacrumbs.shedlock: ERROR
logging.level.com.github.alturkovic.lock: ERROR
logging.level.com.ulisesbocchio.jasyptspringboot: ERROR
#logging.level.org.hibernate.SQL: TRACE
#logging.level.org.hibernate.type: TRACE
#logging.level.net.sf.hibernate.type: TRACE
jasypt.encryptor.password: 179CD78D24F9BC63D6E677272D1A7
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
">
<aop:aspectj-autoproxy proxy-target-class="true" />
<aop:config>
<aop:pointcut id="allServiceMethodsPointcut" expression="execution(* com.bytesw.xdf.example.controller.*.*(..)) || execution(* com.bytesw.xdf.controller.*.*(..))" />
<!--<aop:pointcut id="authResourcesMethodsPointcut" expression="execution(* org.springframework.security.oauth2.client.OAuth2RestTemplate.*(..))" />-->
<aop:advisor pointcut-ref="allServiceMethodsPointcut" advice-ref="statisticsInterceptor" />
<!--<aop:advisor pointcut-ref="authResourcesMethodsPointcut" advice-ref="authResourcerInterceptor" />-->
</aop:config>
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/data/jpa
http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">
<context:annotation-config />
<jpa:repositories base-package="com.bytesw" transaction-manager-ref="transactionManager" entity-manager-factory-ref="entityManagerFactory"/>
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:oauth="http://www.springframework.org/schema/security/oauth2"
xmlns:sec="http://www.springframework.org/schema/security"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd
http://www.springframework.org/schema/security/oauth2 http://www.springframework.org/schema/security/spring-security-oauth2-1.0.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
">
<bean id="threadPoolTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value="2" />
<property name="maxPoolSize" value="5" />
<property name="queueCapacity" value="5" />
<property name="waitForTasksToCompleteOnShutdown" value="true" />
<property name="rejectedExecutionHandler">
<bean class="java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy"/>
</property>
</bean>
<!--<bean name="testServiceJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="name" value="SCH00001: Test Service"/>
<property name="group" value="Security"/>
<property name="targetObject" ref="testService"/>
<property name="targetMethod" value="saludar"/>
</bean>
<bean id="testServiceTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="testServiceJob"/>
<property name="cronExpression" value="0/1 * * * * ?"/>
</bean>-->
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.bytesw.xdf.dao.jdbc.AuditMapper" >
<!-- In Config XML file -->
<cache readOnly="true"></cache>
<select id="getAuditData" resultType="hashmap" flushCache="true">
SELECT ${columns},
SECURITY_AUDIT.REV_USER as username,
SECURITY_AUDIT.REV_MODIF as date,
${tableName}.REVTYPE as revisionType
FROM ${tableName}
LEFT JOIN SECURITY_AUDIT
ON ${tableName}.REV = SECURITY_AUDIT.REV_ID
WHERE ${pkName} = #{pkValue} ORDER BY SECURITY_AUDIT.REV_MODIF DESC
LIMIT ${page},${pageSize}
</select>
<select id="countAuditData" resultType="int" flushCache="true">
SELECT count(${pkName})
FROM ${tableName}
WHERE ${pkName} = #{pkValue}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.bytesw.xdf.dao.jdbc.AuditMapper" >
<!-- In Config XML file -->
<cache readOnly="true"></cache>
<select id="getAuditData" resultType="hashmap" flushCache="true">
SELECT ${columns},
SECURITY_AUDIT.REV_USER as username,
SECURITY_AUDIT.REV_MODIF as date,
${tableName}.REVTYPE as revisionType
FROM ${tableName}
LEFT JOIN SECURITY_AUDIT
ON ${tableName}.REV = SECURITY_AUDIT.REV_ID
WHERE ${pkName} = #{pkValue} ORDER BY SECURITY_AUDIT.REV_MODIF DESC
LIMIT ${page},${pageSize}
</select>
<select id="countAuditData" resultType="int" flushCache="true">
SELECT count(${pkName})
FROM ${tableName}
WHERE ${pkName} = #{pkValue}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{dd-MM-yyyy HH:mm:ss.SSS} %magenta([%thread]) %highlight(%-5level) %logger.%M - %msg%n</pattern>
</encoder>
</appender>
<root level="ALL">
<appender-ref ref="STDOUT" />
</root>
<logger name="org.apache" level="off" />
<logger name="org.springframework" level="info" />
<logger name="javax.management" level="info" />
<logger name="com.bytesw.xdf.example" level="off" />
</configuration>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<properties resource="mybatis.properties" />
<typeAliases>
<!-- <typeAlias type="com.bytesw.bytebot.bean.SummaryMessageByIntentBean" alias="SummaryMessageByIntent"/>-->
</typeAliases>
<mappers>
<mapper resource="config/mappers/xdf/${database-type-xdf}/AuditMapper.xml"/>
<mapper resource="config/mappers/xdf/${database-type-xdf}/AuditMapper.xml"/>
</mappers>
</configuration>
database-type-xdf=postgres
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Spring Session + JDBC Demo</title>
</head>
<body>
<div>
<form th:action="@{/messages}" method="post">
<textarea name="msg" cols="40" rows="4"></textarea>
<input type="submit" value="Save"/>
</form>
<p><a href="/">refresh</a></p>
</div>
<div>
<h2>Messages</h2>
<ul th:each="m : ${messages}">
<li th:text="${m}">msg</li>
</ul>
</div>
<H3>Mensaje a cola</H3>
<div>
<form th:action="@{/sendToQueue}" method="post">
ID: <input name="message" />
<input type="submit" value="Send"/>
</form>
</div>
<H3>Mensaje a topico</H3>
<div>
<form th:action="@{/sendToTopic}" method="post">
ID: <input name="message" />
<input type="submit" value="Send"/>
</form>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>OAuth Server Index</title>
</head>
<body>
<div class="container">
<h1 class="page-header">OAuth Server Administration Dashboard </h1>
<div class="row">
<div class="col-md-12" >
<span sec:authorize="isAuthenticated()" style="display: inline-block;">
<a href="/logout">Sign Out</a>
</span>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Byte - Login</title>
<!-- Vendor CSS -->
<!-- <link href="css/animate.min.css" rel="stylesheet" />-->
<!-- <link href="css/material-design-iconic-font.min.css" rel="stylesheet" />-->
<!-- CSS -->
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<script>
function loginButton() {
window.location.href='./';
}
</script>
<style>
body {
color: #676a6c;
background-color: #f3f3f4;
}
.centered {
position: absolute;
left: 50%;
top: 40%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
h3 {
display: inherit;
font-weight: 600;
}
.text-center {
text-align: center;
}
</style>
</head>
<body>
<div class="row centered" >
<div class="col-lg-12">
<div class="ibox">
<div class="row">
<div class="text-center">
<i class="zmdi zmdi-sign-in" style="font-size: 80px"></i>
<h3 class="text-navy"> Su sesión ha finalizado</h3>
<p>Para iniciar sesión nuevamente presione aquí: <a href="#" onclick="loginButton()">Ingresar</a></p>
</div>
</div>
<div class="row text-center">
<div style="
display: inline-flex;
">
<img class="logo-byte" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAFP0lEQVRIx92WX4hdVxWHv33+3Js7k0zGeidNTLRR6YNaDTGFigq+mIZKzUOpTz4IimKtTw1aS6kahUKpPqixIlEqKFgaa4xYRGNESEtFGtN/dsyEJp3pTDOTzMzN3HvnnrPPXmttH+7JNGkqvuXBBYez4bDXt9b+rbX2cTFGroUl14TyfwnKAJ58dhYABxgQxADWi9mOstJQin29FDlVVPpgEfT3RdCdPuj3IvHB+VXP2V7BUhCCRVLnhr6cI200mD3xDwa/vm8IumSxhjnnsBg/GdS2ebXdlehJH+zbZdB9XnS+Ev2aWDy8VHpWKiGrnf/PjC43BzdD/EEV9FQZ7DYvurkIcqAMdqhSu9OLUoptXQ3y81LsZwlMAIcT+EWKW9PCEUnTFJekV4MSR1uNfZXYS0XQr3jRh9TsKTWOlqJ3lEG7pdhSKfrAIOg7K4tfGIjhLe7VyA0C+5O6XZLGOtQ5pCovA0VwDjSysxT9axn0YCn2DS96JMZ4PE0cWZreJZXca0ZXgUKtNRD9TV/0zhURzovuqGIkzXNcqwXeU734HLK89AYoEom4O6qgTxSVTHmxj4jq5wuvC81mvvltYyOElT4bk6wbXcJyWdGTftELg8/4GHetBN3QT5NnaI3gigFxahJmZ6DXhdbIGyCNkWhxxIvNB42PlUG+OaiE8bEN3/eqPHHsKZ6fPE1rbIx2+zo6Sx02bd/OxLZ30e90T6RZg6QsiWdOE6dfhYsdaDZgZPTKYhCN7xa12UrtQz7oBS+ajLRaE5OvvvbwoT8eY356FvIM5s7xSoxgypn5BdqbztL3FSHNiL0V4tIiZBmMjcGbRtswI42fLcW+W1T6xSLI81nW+Nv5TvfYjx77HSx19nJ9+/04lxLjIvA4SdKRsmR+agrSdOg0z2F0fd0nV8/PDMCrnazE8KK3B40/JWoyqMKmfF3zQti44VvAX4jxInALcDtmL5Dn95PnW4EvAYvAB4AceBloAAqsAinwwwTABz3hRW/zYue8aNIvK9Isv350pAWm88BFYKEeHH8HJoGjwEHgJeC3wDKwpV7fCuwBbgQOQz3rKtWDXvSMF73Li2IuWej0+//q9vot8nyiBq3UkX8K+BUwUgMPAXPAaeB14CzggQvAuUuMDKAS61TBTlYi7ULs4xvXNc5Mv34+2vx8YHz8SZzbQoztetOB+tj3184u2RRQ1usjwNuBAHwO+E4GsFqFfUHjqNe46sX+sNTt7R1tT3DDRz8mM6cm98deF5rN4YAyAZdAo/nnN+n9dP0A/KR+rwM+sZZREbRpMT7kxW4Kqp++WPr3uSSd/OCHd21tbtk6N/3vl6mWFolZDqNjEA3Ozw3BiYOsAUnyVtVW1ZoOQaWYM4u7vei9pej9A7GbBkEfLVaLWxqtkbvbO29+ZLnToSgFshwqgSSHojfMbnUFRIffroRZrW3dR2avaeRPpdg9hdh9heg/B2qPr6rRKQc/XozxuCTZi6SWURVCZTDxjmFGaQrLCzB7Giobwt7i2kgA+l5Y9fJsKfJKoXa01Lhcqt3aVWVBDV8Fp77ag+oMxgwx3k2oIHjwBVy3GbbdWDev/feGnekVOCBN3AOV0R2ofrkrum0u6D2idgLRF1A9juoYYmB2ALVZiEcA0B6MjsN7d8DKIlyYHUJxV4IijstieLhUay+InCtVM9R2YQZiX0XtUVRTVJexOL22IxqoQd6E9ePQWQAVqC+9taNL6uJJ6hiiY3FgNBB7BNE9dXX9khjfQ4y7sbgdeG7NyyVNVIZArtbIXasfyP8ArlhZjGSh5u0AAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMDMtMDVUMTI6NTA6MzUtMDU6MDBkp/5ZAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIwLTAzLTA1VDEyOjUwOjM1LTA1OjAwFfpG5QAAAABJRU5ErkJggg==" style="
height: 20px;
width: 20px;
"> <p class="m-t"> <small class="ng-binding" style="
line-height: 24px;
">&nbsp;Latin American Byte © 2020</small> </p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/favicon.ico" title="Favicon">
<title>Spring Security SSO Client 2</title>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
</head>
<body>
<div class="container">
<div class="col-sm-12">
<h1>Spring Security SSO and logout</h1>
<a href="#" onclick="logout()"><font
class="lightTextLarge">Log Out</font></a>
</div>
</div>
</body>
<script type="text/javascript">
function setTimeZoneInCookie() {
console.log("creando cookie");
var _myDate = new Date();
var _offset = _myDate.getTimezoneOffset();
document.cookie = "TIMEZONE_COOKIE=" + _offset; //Cookie name with value
}
setTimeZoneInCookie();
function logout() {
window.location.href='logout';
}
</script>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/favicon.ico" title="Favicon">
<title>Spring Security SSO Client 2</title>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
</head>
<body>
<div class="container">
<div class="col-sm-12">
<h1>Spring Security SSO and logout</h1>
<form name="logout_form" id="logout_form" method="post" action="/logout1">
<input type="hidden" name="scope" value="read">
<input type="submit" value="Logout"/>
</form>
<a href="#" onclick="login()"><font
class="lightTextLarge">Log Out</font></a>
<a href="#" onclick="logout()"><font
class="lightTextLarge">Log Out</font></a>
</div>
</div>
</body>
<script type="text/javascript">
function setTimeZoneInCookie() {
console.log("creando cookie");
var _myDate = new Date();
var _offset = _myDate.getTimezoneOffset();
document.cookie = "TIMEZONE_COOKIE=" + _offset; //Cookie name with value
}
setTimeZoneInCookie();
function readCookie(name) {
return (name = new RegExp('(?:^|;\\s*)' + ('' + name).replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') + '=([^;]*)').exec(document.cookie)) && name[1];
}
console.log(document.cookie);
function login() {
window.location.href='mylogin';
}
function logout() {
var url = 'https://idcs-204e4341c8eb4484b0edba0934b4d507.identity.oraclecloud.com/oauth2/v1/userlogout?post_logout_redirect_uri=http://localhost:8080/logout&id_token_hint='+readCookie('XSRF-TOKEN');
window.location.href = url;
}
</script>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Spring Session + JDBC Demo</title>
</head>
<body>
<h3>Good bye</h3>
</body>
</html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!--<import resource="classpath:applicationContext-aop.xml" />-->
<import resource="classpath:applicationContext-scheduler.xml" />
<!-- MyBatis stuff -->
<!--
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:/mybatis-config.xml" />
</bean>
-->
</beans>
spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
server:
servlet.context-path: /tenant-server
port: 9443
ssl:
key-store-type: JKS
key-store: 'classpath:keystore.jks'
key-store-password: changeit
key-alias: tomcat
security:
require-ssl: true
basic:
enabled: false
application:
services:
security: none
api.info:
title: 'byteXDF4Java Service'
description: 'API para el desarrollo de software'
version: '1.0.0'
terms-of-service-url: 'https://es.wikipedia.org/wiki/byteXDF4Java'
license: 'Open source licensing'
license-url: 'https://help.github.com/articles/open-source-licensing/'
spring:
application:
name: tenant-server
datasource:
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:db;DB_CLOSE_DELAY=-1
username: sa
password: sa
minimum-idle: 10
maximum-pool-size: 10
validationQuery: SELECT 1
testWhileIdle: true
hikari.registerMbeans: true
jpa:
properties.hibernate.dialect: org.hibernate.dialect.H2Dialect
show-sql: true
logging.level.root: info
logging.pattern.console: '%d{dd-MM-yyyy HH:mm:ss.SSS} %magenta([%thread]) %highlight(%-5level) %logger.%M - %msg%n'
logging.level.com.bytesw: debug
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:oauth="http://www.springframework.org/schema/security/oauth2"
xmlns:sec="http://www.springframework.org/schema/security"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd
http://www.springframework.org/schema/security/oauth2 http://www.springframework.org/schema/security/spring-security-oauth2-1.0.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
">
<bean id="threadPoolTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value="2" />
<property name="maxPoolSize" value="5" />
<property name="queueCapacity" value="5" />
<property name="waitForTasksToCompleteOnShutdown" value="true" />
<property name="rejectedExecutionHandler">
<bean class="java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy"/>
</property>
</bean>
</beans>
\ No newline at end of file
CREATE TABLE SEQUENCE_TABLE
(SEQ_NAME VARCHAR(50) NOT NULL,
SEQ_COUNT INTEGER DEFAULT 0,
PRIMARY KEY (SEQ_NAME));
INSERT SEQUENCE_TABLE (SEQ_NAME, SEQ_COUNT) VALUES ('USER_SEQ', 0);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment